Change test on local nonce buffer size to an assertion
Signed-off-by: Ronald Cron <ronald.cron@arm.com>
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index daa34ff..d3a2865 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -3893,11 +3893,9 @@
goto exit;
}
- if( required_nonce_size > sizeof( local_nonce ) )
- {
- status = PSA_ERROR_GENERIC_ERROR;
- goto exit;
- }
+#if defined(assert)
+ assert( required_nonce_size <= sizeof( local_nonce ) );
+#endif
status = psa_generate_random( local_nonce, required_nonce_size );
if( status != PSA_SUCCESS )