modes/gcm128.c: fix OPENSSL_SMALL_FOOTPRINT compile failure
authorAndy Polyakov <appro@openssl.org>
Sun, 25 Jan 2015 13:51:43 +0000 (14:51 +0100)
committerAndy Polyakov <appro@openssl.org>
Fri, 30 Jan 2015 15:38:42 +0000 (16:38 +0100)
on affected platforms (PowerPC and AArch64).

For reference, minimalistic #ifdef GHASH is sufficient, because
it's never defined with OPENSSL_SMALL_FOOTPRINT and ctx->ghash
is never referred.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit b2991c081aba5351a3386bdde2927672d53e5c99)

crypto/modes/gcm128.c

index 4debf537f071bdf41e0efcf822ceaa90e561b3d3..24a84a7ae7ec14f3091315bc3725344f805432d6 100644 (file)
@@ -852,7 +852,11 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block)
     {
         gcm_init_4bit(ctx->Htable, ctx->H.u);
         ctx->gmult = gcm_gmult_4bit;
+#  if defined(GHASH)
         ctx->ghash = gcm_ghash_4bit;
+#  else
+        ctx->ghash = NULL;
+#  endif
     }
 # elif  defined(GHASH_ASM_SPARC)
     if (OPENSSL_sparcv9cap_P[0] & SPARCV9_VIS3) {
@@ -872,7 +876,11 @@ void CRYPTO_gcm128_init(GCM128_CONTEXT *ctx, void *key, block128_f block)
     } else {
         gcm_init_4bit(ctx->Htable, ctx->H.u);
         ctx->gmult = gcm_gmult_4bit;
+#  if defined(GHASH)
         ctx->ghash = gcm_ghash_4bit;
+#  else
+        ctx->ghash = NULL;
+#  endif
     }
 # else
     gcm_init_4bit(ctx->Htable, ctx->H.u);