common MixHash and MixKey

This commit is contained in:
orignal 2020-10-28 21:53:11 -04:00
parent b2f0278180
commit 9f2a2e44a3
7 changed files with 36 additions and 42 deletions

View file

@ -12,12 +12,13 @@
#include <vector>
#include "Identity.h"
#include "RouterContext.h"
#include "Crypto.h"
namespace i2p
{
namespace tunnel
{
struct TunnelHopConfig
struct TunnelHopConfig: public i2p::crypto::NoiseSymmetricState
{
std::shared_ptr<const i2p::data::IdentityEx> ident;
i2p::data::IdentHash nextIdent;
@ -30,7 +31,6 @@ namespace tunnel
TunnelHopConfig * next, * prev;
int recordIndex; // record # in tunnel build message
uint8_t ck[32], h[32]; // for ECIES
TunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r);
@ -43,7 +43,6 @@ namespace tunnel
void CreateBuildRequestRecord (uint8_t * record, uint32_t replyMsgID, BN_CTX * ctx);
void EncryptECIES (std::shared_ptr<i2p::crypto::CryptoKeyEncryptor>& encryptor,
const uint8_t * clearText, uint8_t * encrypted, BN_CTX * ctx);
void MixHash (const uint8_t * buf, size_t len);
};
class TunnelConfig