Fix test-aeadchacha20poly1305

The function `i2pd::crypto::AEADChaCha20Poly1305Encrypt()` was
changed[1] to the overloaded method `Encrypt()` in a new class
object named `i2pd::crypto::AEADChaCha20Poly1305Encrypt`.

test-aeadchacha20poly1305 needs to be updated for this.

Fixes #2143

[1] 3534b9c499

Signed-off-by: Daniel Bermond <dbermond@archlinux.org>
This commit is contained in:
Daniel Bermond 2025-01-01 16:38:28 -03:00
parent 1293e122bc
commit 8c4d7743c8
No known key found for this signature in database
GPG key ID: E85B8683EB48BC95

View file

@ -54,7 +54,8 @@ int main ()
// test encryption of multiple buffers // test encryption of multiple buffers
memcpy (buf, text, 114); 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) }; 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); i2p::crypto::AEADChaCha20Poly1305 (buf, 114, nullptr, 0, key, nonce, buf1, 114, false);
assert (memcmp (buf1, text, 114) == 0); assert (memcmp (buf1, text, 114) == 0);
} }