IBR-DTN  1.0.0
HashProtocol.h
Go to the documentation of this file.
1 /*
2  * HashProtocol.h
3  *
4  * Copyright (C) 2014 IBR, TU Braunschweig
5  *
6  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7  * Thomas Schrader <schrader.thomas@gmail.com>
8  *
9  * Licensed under the Apache License, Version 2.0 (the "License");
10  * you may not use this file except in compliance with the License.
11  * You may obtain a copy of the License at
12  *
13  * http://www.apache.org/licenses/LICENSE-2.0
14  *
15  * Unless required by applicable law or agreed to in writing, software
16  * distributed under the License is distributed on an "AS IS" BASIS,
17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18  * See the License for the specific language governing permissions and
19  * limitations under the License.
20  *
21  */
22 
23 #ifndef HASHPROTOCOL_H_
24 #define HASHPROTOCOL_H_
25 
28 
29 namespace dtn
30 {
31  namespace security
32  {
34  {
35  public:
37  virtual ~HashProtocol();
38 
39  virtual KeyExchangeSession* createSession(const dtn::data::EID &peer, unsigned int uniqueId);
40 
41  virtual void begin(KeyExchangeSession &session, KeyExchangeData &data);
42  virtual void step(KeyExchangeSession &session, KeyExchangeData &data);
43 
44  private:
46  {
47  public:
48  virtual ~HashState();
49  std::vector<char> random;
50  std::vector<char> commitment;
51  };
52 
53  static void sha256(std::ostream &stream, const std::string &str);
54  };
55  } /* namespace security */
56 } /* namespace dtn */
57 
58 #endif /* HASHPROTOCOL_H_ */
virtual void begin(KeyExchangeSession &session, KeyExchangeData &data)
virtual KeyExchangeSession * createSession(const dtn::data::EID &peer, unsigned int uniqueId)
virtual void step(KeyExchangeSession &session, KeyExchangeData &data)
HashProtocol(KeyExchangeManager &manager)