mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-30 04:37:50 +02:00
Add tests for AES CBC (mainly important for custom AESNI implementation).
This commit is contained in:
parent
59e081f41e
commit
5d0b24d696
3 changed files with 213 additions and 2 deletions
|
@ -146,7 +146,7 @@ namespace crypto
|
|||
{
|
||||
SetKey(key);
|
||||
SetIV(iv);
|
||||
};
|
||||
}
|
||||
|
||||
void SetKey (const AESKey& key) { m_ECBEncryption.SetKey (key); }; // 32 bytes
|
||||
void SetIV (const uint8_t * iv) { memcpy (m_LastBlock.buf, iv, 16); }; // 16 bytes
|
||||
|
@ -168,6 +168,13 @@ namespace crypto
|
|||
|
||||
CBCDecryption () { memset (m_IV.buf, 0, 16); };
|
||||
|
||||
CBCDecryption(const AESKey& key, const uint8_t* iv)
|
||||
: CBCDecryption()
|
||||
{
|
||||
SetKey(key);
|
||||
SetIV(iv);
|
||||
}
|
||||
|
||||
void SetKey (const AESKey& key) { m_ECBDecryption.SetKey (key); }; // 32 bytes
|
||||
void SetIV (const uint8_t * iv) { memcpy (m_IV.buf, iv, 16); }; // 16 bytes
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue