Add 'too big' tests for nonce generation

Signed-off-by: Paul Elliott <paul.elliott@arm.com>
This commit is contained in:
Paul Elliott 2021-07-16 18:52:03 +01:00
parent d85f547b65
commit e0fcb3b99e
2 changed files with 10 additions and 2 deletions

View file

@ -2582,6 +2582,10 @@ PSA Multipart Nonce Generation, AES - GCM, IV = 0
depends_on:PSA_WANT_ALG_GCM:PSA_WANT_KEY_TYPE_AES
aead_multipart_generate_nonce:PSA_KEY_TYPE_AES:"aa740abfadcda779220d3b406c5d7ec09a77fe9d94104539":PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM,16):0:0:"":"":PSA_ERROR_BUFFER_TOO_SMALL
PSA Multipart Nonce Generation, AES - GCM, IV = 16
depends_on:PSA_WANT_ALG_GCM:PSA_WANT_KEY_TYPE_AES
aead_multipart_generate_nonce:PSA_KEY_TYPE_AES:"aa740abfadcda779220d3b406c5d7ec09a77fe9d94104539":PSA_ALG_AEAD_WITH_SHORTENED_TAG(PSA_ALG_GCM,16):16:12:"290322092d57479e20f6281e331d95a9":"e7fb0631eebf9bdba87045b33650c4ce":PSA_SUCCESS
PSA Multipart Nonce Generation: ChaCha20 - Poly1305, IV = 12
depends_on:PSA_WANT_ALG_CHACHA20_POLY1305:PSA_WANT_KEY_TYPE_CHACHA20
aead_multipart_generate_nonce:PSA_KEY_TYPE_CHACHA20:"808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f":PSA_ALG_CHACHA20_POLY1305:12:12:"50515253c0c1c2c3c4c5c6c7":"4c616469657320616e642047656e746c656d656e206f662074686520636c617373206f66202739393a204966204920636f756c64206f6666657220796f75206f6e6c79206f6e652074697020666f7220746865206675747572652c2073756e73637265656e20776f756c642062652069742e":PSA_SUCCESS
@ -2594,6 +2598,10 @@ PSA Multipart Nonce Generation: ChaCha20 - Poly1305, IV = 0
depends_on:PSA_WANT_ALG_CHACHA20_POLY1305:PSA_WANT_KEY_TYPE_CHACHA20
aead_multipart_generate_nonce:PSA_KEY_TYPE_CHACHA20:"808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f":PSA_ALG_CHACHA20_POLY1305:0:0:"":"":PSA_ERROR_BUFFER_TOO_SMALL
PSA Multipart Nonce Generation: ChaCha20 - Poly1305, IV = 16
depends_on:PSA_WANT_ALG_CHACHA20_POLY1305:PSA_WANT_KEY_TYPE_CHACHA20
aead_multipart_generate_nonce:PSA_KEY_TYPE_CHACHA20:"808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9f":PSA_ALG_CHACHA20_POLY1305:16:12:"":"":PSA_SUCCESS
PSA Multipart State Checks, AES - GCM
depends_on:PSA_WANT_ALG_GCM:PSA_WANT_KEY_TYPE_AES
aead_multipart_state_test:PSA_KEY_TYPE_AES:"C0C1C2C3C4C5C6C7C8C9CACBCCCDCECF":PSA_ALG_GCM:"000102030405060708090A0B0C0D0E0F":"000102030405060708090A0B":"0C0D0E0F101112131415161718191A1B1C1D1E"

View file

@ -3758,8 +3758,6 @@ void aead_multipart_generate_nonce( int key_type_arg, data_t *key_data,
PSA_ASSERT( status );
TEST_ASSERT( nonce_len < PSA_AEAD_NONCE_MAX_SIZE );
status = psa_aead_generate_nonce( &operation, nonce_buffer,
nonce_len,
&nonce_generated_len );
@ -3768,6 +3766,8 @@ void aead_multipart_generate_nonce( int key_type_arg, data_t *key_data,
TEST_EQUAL( nonce_generated_len, expected_generated_len );
TEST_ASSERT( nonce_generated_len < PSA_AEAD_NONCE_MAX_SIZE );
if( expected_status_arg == PSA_SUCCESS )
{