Fix whitespace issues
Only whitespace changes. * Remove tabs. * Remove trailing whitespace. * Correct some misindented lines. * Normalize whitespace around some punctuation. * Split some lines to avoid going over 80 columns.
This commit is contained in:
parent
7f87850fc4
commit
4ca9c3f9a1
2 changed files with 117 additions and 103 deletions
|
@ -172,4 +172,3 @@ key_lifetime_set_fail:1:PSA_KEY_LIFETIME_WRITE_ONCE:PSA_ERROR_NOT_SUPPORTED
|
|||
|
||||
PSA Key Lifetime set fail, invalid key lifetime value
|
||||
key_lifetime_set_fail:1:PSA_KEY_LIFETIME_PERSISTENT+1:PSA_ERROR_INVALID_ARGUMENT
|
||||
|
||||
|
|
|
@ -305,8 +305,8 @@ void cipher_test_encrypt( int alg_arg, int key_type_arg,
|
|||
|
||||
TEST_ASSERT( psa_encrypt_setup( &operation, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation, iv,
|
||||
sizeof( iv ) ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||
output_size_1 = input_size + operation.block_size;
|
||||
output = mbedtls_calloc( 1, output_size_1 );
|
||||
|
||||
|
@ -370,8 +370,8 @@ void cipher_test_encrypt_multipart( int alg_arg, int key_type_arg,
|
|||
|
||||
TEST_ASSERT( psa_encrypt_setup( &operation, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation, iv,
|
||||
sizeof( iv ) ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||
output_size_1 = input_size + operation.block_size;
|
||||
output = mbedtls_calloc( 1, output_size_1 );
|
||||
|
||||
|
@ -379,7 +379,9 @@ void cipher_test_encrypt_multipart( int alg_arg, int key_type_arg,
|
|||
TEST_ASSERT( psa_cipher_update( &operation, input, first_part_size,
|
||||
output, output_size_1,
|
||||
&output_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_update( &operation, input + first_part_size, input_size - first_part_size,
|
||||
TEST_ASSERT( psa_cipher_update( &operation,
|
||||
input + first_part_size,
|
||||
input_size - first_part_size,
|
||||
output, output_size_1,
|
||||
&output_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation, output + output_length,
|
||||
|
@ -438,8 +440,8 @@ void cipher_test_decrypt_multipart( int alg_arg, int key_type_arg,
|
|||
|
||||
TEST_ASSERT( psa_decrypt_setup( &operation, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation, iv,
|
||||
sizeof( iv ) ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||
|
||||
output_size_1 = input_size + operation.block_size;
|
||||
output = mbedtls_calloc( 1, output_size_1 );
|
||||
|
@ -448,7 +450,9 @@ void cipher_test_decrypt_multipart( int alg_arg, int key_type_arg,
|
|||
TEST_ASSERT( psa_cipher_update( &operation, input, first_part_size,
|
||||
output, output_size_1,
|
||||
&output_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_update( &operation, input + first_part_size, input_size - first_part_size,
|
||||
TEST_ASSERT( psa_cipher_update( &operation,
|
||||
input + first_part_size,
|
||||
input_size - first_part_size,
|
||||
output, output_size_1,
|
||||
&output_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation, output + output_length,
|
||||
|
@ -507,8 +511,8 @@ void cipher_test_decrypt( int alg_arg, int key_type_arg,
|
|||
|
||||
TEST_ASSERT( psa_decrypt_setup( &operation, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation, iv,
|
||||
sizeof( iv ) ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation,
|
||||
iv, sizeof( iv ) ) == PSA_SUCCESS );
|
||||
|
||||
output_size_1 = input_size + operation.block_size;
|
||||
output = mbedtls_calloc( 1, output_size );
|
||||
|
@ -577,8 +581,9 @@ void cipher_test_verify_output( int alg_arg, int key_type_arg,
|
|||
TEST_ASSERT( psa_encrypt_setup( &operation1, key_slot, alg ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_decrypt_setup( &operation2, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_generate_iv( &operation1, iv,
|
||||
iv_size, &iv_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_generate_iv( &operation1,
|
||||
iv, iv_size,
|
||||
&iv_length ) == PSA_SUCCESS );
|
||||
output1_size = input_size + operation1.block_size;
|
||||
output1 = mbedtls_calloc( 1, output1_size );
|
||||
TEST_ASSERT( output1 != NULL );
|
||||
|
@ -586,8 +591,9 @@ void cipher_test_verify_output( int alg_arg, int key_type_arg,
|
|||
TEST_ASSERT( psa_cipher_update( &operation1, input, input_size,
|
||||
output1, output1_size,
|
||||
&output1_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation1, output1 + output1_length,
|
||||
output1_size, &tmp_output_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation1,
|
||||
output1 + output1_length, output1_size,
|
||||
&tmp_output_length ) == PSA_SUCCESS );
|
||||
|
||||
output1_length += tmp_output_length;
|
||||
|
||||
|
@ -596,13 +602,16 @@ void cipher_test_verify_output( int alg_arg, int key_type_arg,
|
|||
output2_size = output1_length;
|
||||
output2 = mbedtls_calloc( 1, output2_size );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation2, iv,
|
||||
iv_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation2,
|
||||
iv, iv_length ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_update( &operation2, output1, output1_length,
|
||||
output2, output2_size, &output2_length) == PSA_SUCCESS );
|
||||
output2, output2_size,
|
||||
&output2_length ) == PSA_SUCCESS );
|
||||
tmp_output_length = 0;
|
||||
TEST_ASSERT( psa_cipher_finish( &operation2, output2 + output2_length,
|
||||
output2_size, &tmp_output_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation2,
|
||||
output2 + output2_length,
|
||||
output2_size,
|
||||
&tmp_output_length ) == PSA_SUCCESS );
|
||||
|
||||
output2_length += tmp_output_length;
|
||||
|
||||
|
@ -660,8 +669,9 @@ void cipher_test_verify_output_multpart( int alg_arg,
|
|||
TEST_ASSERT( psa_encrypt_setup( &operation1, key_slot, alg ) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_decrypt_setup( &operation2, key_slot, alg ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_generate_iv( &operation1, iv,
|
||||
iv_size, &iv_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_generate_iv( &operation1,
|
||||
iv, iv_size,
|
||||
&iv_length ) == PSA_SUCCESS );
|
||||
output1_size = input_size + operation1.block_size;
|
||||
output1 = mbedtls_calloc( 1, output1_size );
|
||||
|
||||
|
@ -672,13 +682,16 @@ void cipher_test_verify_output_multpart( int alg_arg,
|
|||
&output1_length ) == PSA_SUCCESS );
|
||||
temp = output1_length;
|
||||
|
||||
TEST_ASSERT( psa_cipher_update( &operation1, input + first_part_size, input_size - first_part_size,
|
||||
TEST_ASSERT( psa_cipher_update( &operation1,
|
||||
input + first_part_size,
|
||||
input_size - first_part_size,
|
||||
output1, output1_size,
|
||||
&output1_length ) == PSA_SUCCESS );
|
||||
output1_length += temp;
|
||||
|
||||
TEST_ASSERT( psa_cipher_finish( &operation1, output1 + output1_length,
|
||||
output1_size - output1_length, &tmp_output_length) == PSA_SUCCESS );
|
||||
output1_size - output1_length,
|
||||
&tmp_output_length ) == PSA_SUCCESS );
|
||||
|
||||
output1_length += tmp_output_length;
|
||||
|
||||
|
@ -687,8 +700,8 @@ void cipher_test_verify_output_multpart( int alg_arg,
|
|||
output2_size = output1_length;
|
||||
output2 = mbedtls_calloc( 1, output2_size );
|
||||
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation2, iv,
|
||||
iv_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_encrypt_set_iv( &operation2,
|
||||
iv, iv_length ) == PSA_SUCCESS );
|
||||
|
||||
TEST_ASSERT( psa_cipher_update( &operation2, output1, first_part_size,
|
||||
output2, output2_size,
|
||||
|
@ -703,8 +716,10 @@ void cipher_test_verify_output_multpart( int alg_arg,
|
|||
|
||||
output2_length += temp;
|
||||
tmp_output_length = 0;
|
||||
TEST_ASSERT( psa_cipher_finish( &operation2, output2 + output2_length,
|
||||
output2_size - output2_length, &tmp_output_length) == PSA_SUCCESS );
|
||||
TEST_ASSERT( psa_cipher_finish( &operation2,
|
||||
output2 + output2_length,
|
||||
output2_size - output2_length,
|
||||
&tmp_output_length ) == PSA_SUCCESS );
|
||||
|
||||
output2_length += tmp_output_length;
|
||||
|
||||
|
|
Loading…
Reference in a new issue