aes: Use length instead of bits_length in XTS

mbedtls_aes_crypt_xts() currently takes a `bits_length` parameter, unlike
the other block modes. Change the parameter to accept a bytes length
instead, as the `bits_length` parameter is not actually ever used in the
current implementation.
This commit is contained in:
Jaeden Amero 2018-05-29 12:55:24 +01:00
parent 9366feb504
commit 5162b932a2
3 changed files with 7 additions and 6 deletions

View file

@ -1130,7 +1130,7 @@ static void mbedtls_gf128mul_x_ble( unsigned char r[16],
*/
int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
int mode,
size_t bits_length,
size_t length,
const unsigned char iv[16],
const unsigned char *input,
unsigned char *output )
@ -1147,7 +1147,6 @@ int mbedtls_aes_crypt_xts( mbedtls_aes_xts_context *ctx,
union xts_buf128 *inbuf;
union xts_buf128 *outbuf;
size_t length = bits_length / 8;
size_t nblk = length / 16;
size_t remn = length % 16;