diff options
author | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | 2018-05-22 13:18:01 +0200 |
---|---|---|
committer | Manuel Pégourié-Gonnard <manuel.pegourie-gonnard@arm.com> | 2018-05-22 13:18:01 +0200 |
commit | 08c337d058bef5f66bc8c28c5fa8b9df7b80b3ae (patch) | |
tree | 22fdef559511c0e483ba6d707a10966f3b593e0a /library | |
parent | 89924ddc7e861d8c86bc90b7a0fc049998863221 (diff) |
Remove useless parameter from function
Diffstat (limited to 'library')
-rw-r--r-- | library/aria.c | 19 | ||||
-rw-r--r-- | library/cipher_wrap.c | 6 |
2 files changed, 11 insertions, 14 deletions
diff --git a/library/aria.c b/library/aria.c index 498a1326..646978e8 100644 --- a/library/aria.c +++ b/library/aria.c @@ -536,7 +536,6 @@ int mbedtls_aria_setkey_dec( mbedtls_aria_context *ctx, * Encrypt a block */ int mbedtls_aria_crypt_ecb( mbedtls_aria_context *ctx, - int mode, const unsigned char input[MBEDTLS_ARIA_BLOCKSIZE], unsigned char output[MBEDTLS_ARIA_BLOCKSIZE] ) { @@ -544,8 +543,6 @@ int mbedtls_aria_crypt_ecb( mbedtls_aria_context *ctx, uint32_t a, b, c, d; - ( (void) mode ); - GET_UINT32_LE( a, input, 0 ); GET_UINT32_LE( b, input, 4 ); GET_UINT32_LE( c, input, 8 ); @@ -626,7 +623,7 @@ int mbedtls_aria_crypt_cbc( mbedtls_aria_context *ctx, while( length > 0 ) { memcpy( temp, input, MBEDTLS_ARIA_BLOCKSIZE ); - mbedtls_aria_crypt_ecb( ctx, mode, input, output ); + mbedtls_aria_crypt_ecb( ctx, input, output ); for( i = 0; i < MBEDTLS_ARIA_BLOCKSIZE; i++ ) output[i] = (unsigned char)( output[i] ^ iv[i] ); @@ -645,7 +642,7 @@ int mbedtls_aria_crypt_cbc( mbedtls_aria_context *ctx, for( i = 0; i < MBEDTLS_ARIA_BLOCKSIZE; i++ ) output[i] = (unsigned char)( input[i] ^ iv[i] ); - mbedtls_aria_crypt_ecb( ctx, mode, output, output ); + mbedtls_aria_crypt_ecb( ctx, output, output ); memcpy( iv, output, MBEDTLS_ARIA_BLOCKSIZE ); input += MBEDTLS_ARIA_BLOCKSIZE; @@ -678,7 +675,7 @@ int mbedtls_aria_crypt_cfb128( mbedtls_aria_context *ctx, while( length-- ) { if( n == 0 ) - mbedtls_aria_crypt_ecb( ctx, MBEDTLS_ARIA_ENCRYPT, iv, iv ); + mbedtls_aria_crypt_ecb( ctx, iv, iv ); c = *input++; *output++ = (unsigned char)( c ^ iv[n] ); @@ -692,7 +689,7 @@ int mbedtls_aria_crypt_cfb128( mbedtls_aria_context *ctx, while( length-- ) { if( n == 0 ) - mbedtls_aria_crypt_ecb( ctx, MBEDTLS_ARIA_ENCRYPT, iv, iv ); + mbedtls_aria_crypt_ecb( ctx, iv, iv ); iv[n] = *output++ = (unsigned char)( iv[n] ^ *input++ ); @@ -724,7 +721,7 @@ int mbedtls_aria_crypt_ctr( mbedtls_aria_context *ctx, while( length-- ) { if( n == 0 ) { - mbedtls_aria_crypt_ecb( ctx, MBEDTLS_ARIA_ENCRYPT, nonce_counter, + mbedtls_aria_crypt_ecb( ctx, nonce_counter, stream_block ); for( i = MBEDTLS_ARIA_BLOCKSIZE; i > 0; i-- ) @@ -916,8 +913,7 @@ int mbedtls_aria_self_test( int verbose ) if( verbose ) printf( " ARIA-ECB-%d (enc): ", 128 + 64 * i ); mbedtls_aria_setkey_enc( &ctx, aria_test1_ecb_key, 128 + 64 * i ); - mbedtls_aria_crypt_ecb( &ctx, MBEDTLS_ARIA_ENCRYPT, - aria_test1_ecb_pt, blk ); + mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_pt, blk ); if( memcmp( blk, aria_test1_ecb_ct[i], MBEDTLS_ARIA_BLOCKSIZE ) != 0 ) ARIA_SELF_TEST_IF_FAIL; @@ -925,8 +921,7 @@ int mbedtls_aria_self_test( int verbose ) if( verbose ) printf( " ARIA-ECB-%d (dec): ", 128 + 64 * i ); mbedtls_aria_setkey_dec( &ctx, aria_test1_ecb_key, 128 + 64 * i ); - mbedtls_aria_crypt_ecb( &ctx, MBEDTLS_ARIA_DECRYPT, - aria_test1_ecb_ct[i], blk ); + mbedtls_aria_crypt_ecb( &ctx, aria_test1_ecb_ct[i], blk ); if( memcmp( blk, aria_test1_ecb_pt, MBEDTLS_ARIA_BLOCKSIZE ) != 0 ) ARIA_SELF_TEST_IF_FAIL; } diff --git a/library/cipher_wrap.c b/library/cipher_wrap.c index 47851e9c..b1ab8f16 100644 --- a/library/cipher_wrap.c +++ b/library/cipher_wrap.c @@ -831,7 +831,8 @@ static const mbedtls_cipher_info_t camellia_256_ccm_info = { static int aria_crypt_ecb_wrap( void *ctx, mbedtls_operation_t operation, const unsigned char *input, unsigned char *output ) { - return mbedtls_aria_crypt_ecb( (mbedtls_aria_context *) ctx, operation, input, + (void) operation; + return mbedtls_aria_crypt_ecb( (mbedtls_aria_context *) ctx, input, output ); } @@ -840,7 +841,8 @@ static int aria_crypt_cbc_wrap( void *ctx, mbedtls_operation_t operation, size_t length, unsigned char *iv, const unsigned char *input, unsigned char *output ) { - return mbedtls_aria_crypt_cbc( (mbedtls_aria_context *) ctx, operation, length, iv, + (void) operation; + return mbedtls_aria_crypt_cbc( (mbedtls_aria_context *) ctx, length, iv, input, output ); } #endif /* MBEDTLS_CIPHER_MODE_CBC */ |