1
0
mirror of https://github.com/PurpleI2P/i2pd.git synced 2025-01-15 17:59:58 +00:00

fixed AEAD/Chacha20/Poly1305 test

This commit is contained in:
orignal 2025-01-02 09:04:57 -05:00
parent 1293e122bc
commit 619ec5d9c1

View File

@ -54,7 +54,8 @@ int main ()
// test encryption of multiple buffers
memcpy (buf, text, 114);
std::vector<std::pair<uint8_t*, std::size_t> > bufs{ std::make_pair (buf, 20), std::make_pair (buf + 20, 10), std::make_pair (buf + 30, 70), std::make_pair (buf + 100, 14) };
i2p::crypto::AEADChaCha20Poly1305Encrypt (bufs, key, nonce, buf + 114);
i2p::crypto::AEADChaCha20Poly1305Encryptor encryptor;
encryptor.Encrypt (bufs, key, nonce, buf + 114);
i2p::crypto::AEADChaCha20Poly1305 (buf, 114, nullptr, 0, key, nonce, buf1, 114, false);
assert (memcmp (buf1, text, 114) == 0);
}