diff options
| author | jsing <> | 2025-04-25 12:08:53 +0000 |
|---|---|---|
| committer | jsing <> | 2025-04-25 12:08:53 +0000 |
| commit | 464b7f6aadea76e935b18e8bd06d68a5c5917b5f (patch) | |
| tree | 5bc660880b7cdd08ef3f28c19cab2e57bb56455a | |
| parent | a847d98920d11851b5bb5352a2f44447b91e1fe0 (diff) | |
| download | openbsd-464b7f6aadea76e935b18e8bd06d68a5c5917b5f.tar.gz openbsd-464b7f6aadea76e935b18e8bd06d68a5c5917b5f.tar.bz2 openbsd-464b7f6aadea76e935b18e8bd06d68a5c5917b5f.zip | |
Restore two #if defined(GHASH) that were incorrectly removed.
Also condition on defined(GHASH_CHUNK) since this is used within these
blocks. This makes the conditionals consistent with other usage.
Fixes build with TABLE_BITS == 1.
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/modes/gcm128.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index 1e925f2a1f..21ba9eef57 100644 --- a/src/lib/libcrypto/modes/gcm128.c +++ b/src/lib/libcrypto/modes/gcm128.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: gcm128.c,v 1.34 2025/04/25 08:26:57 jsing Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.35 2025/04/25 12:08:53 jsing Exp $ */ |
| 2 | /* ==================================================================== | 2 | /* ==================================================================== |
| 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. | 3 | * Copyright (c) 2010 The OpenSSL Project. All rights reserved. |
| 4 | * | 4 | * |
| @@ -1093,7 +1093,7 @@ CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
| 1093 | return 0; | 1093 | return 0; |
| 1094 | } | 1094 | } |
| 1095 | } | 1095 | } |
| 1096 | 1096 | #if defined(GHASH) && defined(GHASH_CHUNK) | |
| 1097 | while (len >= GHASH_CHUNK) { | 1097 | while (len >= GHASH_CHUNK) { |
| 1098 | (*stream)(in, out, GHASH_CHUNK/16, key, ctx->Yi.c); | 1098 | (*stream)(in, out, GHASH_CHUNK/16, key, ctx->Yi.c); |
| 1099 | ctr += GHASH_CHUNK/16; | 1099 | ctr += GHASH_CHUNK/16; |
| @@ -1103,7 +1103,7 @@ CRYPTO_gcm128_encrypt_ctr32(GCM128_CONTEXT *ctx, | |||
| 1103 | in += GHASH_CHUNK; | 1103 | in += GHASH_CHUNK; |
| 1104 | len -= GHASH_CHUNK; | 1104 | len -= GHASH_CHUNK; |
| 1105 | } | 1105 | } |
| 1106 | 1106 | #endif | |
| 1107 | if ((i = (len & (size_t)-16))) { | 1107 | if ((i = (len & (size_t)-16))) { |
| 1108 | size_t j = i/16; | 1108 | size_t j = i/16; |
| 1109 | 1109 | ||
| @@ -1185,7 +1185,7 @@ CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
| 1185 | return 0; | 1185 | return 0; |
| 1186 | } | 1186 | } |
| 1187 | } | 1187 | } |
| 1188 | 1188 | #if defined(GHASH) && defined(GHASH_CHUNK) | |
| 1189 | while (len >= GHASH_CHUNK) { | 1189 | while (len >= GHASH_CHUNK) { |
| 1190 | GHASH(ctx, in, GHASH_CHUNK); | 1190 | GHASH(ctx, in, GHASH_CHUNK); |
| 1191 | (*stream)(in, out, GHASH_CHUNK/16, key, ctx->Yi.c); | 1191 | (*stream)(in, out, GHASH_CHUNK/16, key, ctx->Yi.c); |
| @@ -1195,7 +1195,7 @@ CRYPTO_gcm128_decrypt_ctr32(GCM128_CONTEXT *ctx, | |||
| 1195 | in += GHASH_CHUNK; | 1195 | in += GHASH_CHUNK; |
| 1196 | len -= GHASH_CHUNK; | 1196 | len -= GHASH_CHUNK; |
| 1197 | } | 1197 | } |
| 1198 | 1198 | #endif | |
| 1199 | if ((i = (len & (size_t)-16))) { | 1199 | if ((i = (len & (size_t)-16))) { |
| 1200 | size_t j = i/16; | 1200 | size_t j = i/16; |
| 1201 | 1201 | ||
