mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-29 18:27:29 +02:00
Merge pull request #2890 from JacobBarthelmeh/Testing
set ChaCha counter state for TLS 1.3 AEAD
This commit is contained in:
@ -1656,6 +1656,9 @@ static int ChaCha20Poly1305_Encrypt(WOLFSSL* ssl, byte* output,
|
||||
return ret;
|
||||
/* Create Poly1305 key using ChaCha20 keystream. */
|
||||
ret = wc_Chacha_Process(ssl->encrypt.chacha, poly, poly, sizeof(poly));
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
ret = wc_Chacha_SetIV(ssl->encrypt.chacha, nonce, 1);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
/* Encrypt the plain text. */
|
||||
@ -1939,6 +1942,9 @@ static int ChaCha20Poly1305_Decrypt(WOLFSSL* ssl, byte* output,
|
||||
return ret;
|
||||
/* Use ChaCha20 keystream to get Poly1305 key for tag. */
|
||||
ret = wc_Chacha_Process(ssl->decrypt.chacha, poly, poly, sizeof(poly));
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
ret = wc_Chacha_SetIV(ssl->decrypt.chacha, nonce, 1);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
|
||||
|
Reference in New Issue
Block a user