added ShortECIESTunnelHopConfig

This commit is contained in:
orignal 2021-07-02 22:06:24 -04:00
parent 0ae170531e
commit aace644815
3 changed files with 58 additions and 14 deletions

View file

@ -58,8 +58,8 @@ namespace tunnel
ECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r):
TunnelHopConfig (r) {};
bool IsECIES () const { return true; };
void EncryptECIES (std::shared_ptr<i2p::crypto::CryptoKeyEncryptor>& encryptor,
const uint8_t * clearText, uint8_t * encrypted, BN_CTX * ctx);
void EncryptECIES (const uint8_t * clearText, size_t len, uint8_t * encrypted);
bool DecryptECIES (const uint8_t * encrypted, size_t len, uint8_t * clearText);
};
struct LongECIESTunnelHopConfig: public ECIESTunnelHopConfig
@ -69,6 +69,14 @@ namespace tunnel
void CreateBuildRequestRecord (uint8_t * record, uint32_t replyMsgID, BN_CTX * ctx);
bool DecryptBuildResponseRecord (const uint8_t * encrypted, uint8_t * clearText);
};
struct ShortECIESTunnelHopConfig: public ECIESTunnelHopConfig
{
ShortECIESTunnelHopConfig (std::shared_ptr<const i2p::data::IdentityEx> r):
ECIESTunnelHopConfig (r) {};
void CreateBuildRequestRecord (uint8_t * record, uint32_t replyMsgID, BN_CTX * ctx);
bool DecryptBuildResponseRecord (const uint8_t * encrypted, uint8_t * clearText);
};
class TunnelConfig
{