mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-29 04:07:49 +02:00
use new aes implementation for NTCP
This commit is contained in:
parent
81b57141d4
commit
6bf5d98c4d
3 changed files with 24 additions and 19 deletions
8
aes.h
8
aes.h
|
@ -21,8 +21,8 @@ namespace crypto
|
|||
|
||||
CBCEncryption () { memset (m_LastBlock.buf, 0, 16); };
|
||||
|
||||
void SetKey (uint8_t * key) { m_ECBEncryption.SetKey (key, 32); }; // 32 bytes
|
||||
void SetIV (uint8_t * iv) { memcpy (m_LastBlock.buf, iv, 16); }; // 16 bytes
|
||||
void SetKey (const uint8_t * key) { m_ECBEncryption.SetKey (key, 32); }; // 32 bytes
|
||||
void SetIV (const uint8_t * iv) { memcpy (m_LastBlock.buf, iv, 16); }; // 16 bytes
|
||||
|
||||
void Encrypt (int numBlocks, const ChipherBlock * in, ChipherBlock * out);
|
||||
bool Encrypt (const uint8_t * in, std::size_t len, uint8_t * out);
|
||||
|
@ -39,8 +39,8 @@ namespace crypto
|
|||
|
||||
CBCDecryption () { memset (m_IV.buf, 0, 16); };
|
||||
|
||||
void SetKey (uint8_t * key) { m_ECBDecryption.SetKey (key, 32); }; // 32 bytes
|
||||
void SetIV (uint8_t * iv) { memcpy (m_IV.buf, iv, 16); }; // 16 bytes
|
||||
void SetKey (const uint8_t * key) { m_ECBDecryption.SetKey (key, 32); }; // 32 bytes
|
||||
void SetIV (const uint8_t * iv) { memcpy (m_IV.buf, iv, 16); }; // 16 bytes
|
||||
|
||||
void Decrypt (int numBlocks, const ChipherBlock * in, ChipherBlock * out);
|
||||
bool Decrypt (const uint8_t * in, std::size_t len, uint8_t * out);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue