1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Merge pull request #4768 from JoeSubbiani/TestBlockSizes_2.x

Backport 2.x: Test block sizes are powers of 2
This commit is contained in:
Ronald Cron
2021-07-22 11:19:01 +02:00
committed by GitHub

View File

@ -603,6 +603,10 @@ void block_cipher_key_type( int type_arg, int block_size_arg )
TEST_EQUAL( type & PSA_KEY_TYPE_CATEGORY_MASK,
PSA_KEY_TYPE_CATEGORY_SYMMETRIC );
TEST_EQUAL( PSA_BLOCK_CIPHER_BLOCK_LENGTH( type ), block_size );
/* Check that the block size is a power of 2. This is required, at least,
for PSA_ROUND_UP_TO_MULTIPLE(block_size, length) in crypto_sizes.h. */
TEST_ASSERT( ( ( block_size - 1 ) & block_size ) == 0 );
}
/* END_CASE */