mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-12-23 17:45:35 +00:00
Set default IV for AES-GCM to 12 bytes
Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
parent
82645b153d
commit
2f09913aeb
|
@ -484,6 +484,10 @@ static int exercise_aead_key( mbedtls_svc_key_id_t key,
|
||||||
size_t ciphertext_length = sizeof( ciphertext );
|
size_t ciphertext_length = sizeof( ciphertext );
|
||||||
size_t plaintext_length = sizeof( ciphertext );
|
size_t plaintext_length = sizeof( ciphertext );
|
||||||
|
|
||||||
|
/* Default IV length for AES-GCM is 12 bytes */
|
||||||
|
if( (alg & ~PSA_ALG_AEAD_TAG_LENGTH_MASK) == PSA_ALG_GCM )
|
||||||
|
nonce_length = 12;
|
||||||
|
|
||||||
if( usage & PSA_KEY_USAGE_ENCRYPT )
|
if( usage & PSA_KEY_USAGE_ENCRYPT )
|
||||||
{
|
{
|
||||||
PSA_ASSERT( psa_aead_encrypt( key, alg,
|
PSA_ASSERT( psa_aead_encrypt( key, alg,
|
||||||
|
|
Loading…
Reference in a new issue