From d4588cfb6a62cc1cbc4deb09d9d8f90a5a7a535a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Mon, 30 Dec 2013 13:54:23 +0100 Subject: [PATCH] aesni_gcm_mult() now returns void --- include/polarssl/aesni.h | 8 +++----- library/aesni.c | 6 +++--- library/gcm.c | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/include/polarssl/aesni.h b/include/polarssl/aesni.h index 808ff4d49..92b23cd6b 100644 --- a/include/polarssl/aesni.h +++ b/include/polarssl/aesni.h @@ -74,12 +74,10 @@ int aesni_crypt_ecb( aes_context *ctx, * * \note Both operands and result are bit strings interpreted as * elements of GF(2^128) as per the GCM spec. - * - * \return 0 on success (cannot fail) */ -int aesni_gcm_mult( unsigned char c[16], - const unsigned char a[16], - const unsigned char b[16] ); +void aesni_gcm_mult( unsigned char c[16], + const unsigned char a[16], + const unsigned char b[16] ); /** * \brief Compute decryption round keys from encryption round keys diff --git a/library/aesni.c b/library/aesni.c index aa1f4b1c4..b5858dc35 100644 --- a/library/aesni.c +++ b/library/aesni.c @@ -107,9 +107,9 @@ int aesni_crypt_ecb( aes_context *ctx, * GCM multiplication: c = a times b in GF(2^128) * Based on [CLMUL-WP] algorithms 1 (with equation 27) and 5. */ -int aesni_gcm_mult( unsigned char c[16], - const unsigned char a[16], - const unsigned char b[16] ) +void aesni_gcm_mult( unsigned char c[16], + const unsigned char a[16], + const unsigned char b[16] ) { unsigned char aa[16], bb[16], cc[16]; size_t i; diff --git a/library/gcm.c b/library/gcm.c index 894c5d3eb..8950360f6 100644 --- a/library/gcm.c +++ b/library/gcm.c @@ -198,7 +198,7 @@ static void gcm_mult( gcm_context *ctx, const unsigned char x[16], PUT_UINT32_BE( ctx->HL[8] >> 32, h, 8 ); PUT_UINT32_BE( ctx->HL[8], h, 12 ); - (void) aesni_gcm_mult( output, x, h ); + aesni_gcm_mult( output, x, h ); return; } #endif