Merge pull request #4753 from JoeSubbiani/TestBlockSizes_dev

Test block sizes are powers of 2
This commit is contained in:
Ronald Cron 2021-07-22 11:19:18 +02:00 committed by GitHub
commit dfce58f32d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -629,6 +629,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 */