mirror of
https://github.com/PurpleI2P/i2pd.git
synced 2025-04-28 11:47:48 +02:00
counter is always in Little Endian
This commit is contained in:
parent
e2071542bf
commit
5b56f4007b
2 changed files with 4 additions and 3 deletions
|
@ -1236,7 +1236,7 @@ namespace crypto
|
|||
#if OPENSSL_AEAD_CHACHA20_POLY1305
|
||||
EVP_CIPHER_CTX *ctx = EVP_CIPHER_CTX_new ();
|
||||
uint32_t iv[4];
|
||||
iv[0] = 1; memcpy (iv + 1, nonce, 12); // counter | nonce
|
||||
iv[0] = htole32 (1); memcpy (iv + 1, nonce, 12); // counter | nonce
|
||||
EVP_EncryptInit_ex(ctx, EVP_chacha20 (), NULL, key, (const uint8_t *)iv);
|
||||
int outlen = 0;
|
||||
EVP_EncryptUpdate(ctx, out, &outlen, msg, msgLen);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue