diff options
Diffstat (limited to 'src/lib/libcrypto/modes')
| -rw-r--r-- | src/lib/libcrypto/modes/gcm128.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/lib/libcrypto/modes/gcm128.c b/src/lib/libcrypto/modes/gcm128.c index b6874296e0..a88f589b00 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.54 2025/06/28 12:39:10 jsing Exp $ */ | 1 | /* $OpenBSD: gcm128.c,v 1.55 2026/01/17 14:30:37 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 | * |
| @@ -52,6 +52,7 @@ | |||
| 52 | 52 | ||
| 53 | #include <openssl/crypto.h> | 53 | #include <openssl/crypto.h> |
| 54 | 54 | ||
| 55 | #include "crypto_arch.h" | ||
| 55 | #include "crypto_internal.h" | 56 | #include "crypto_internal.h" |
| 56 | #include "modes_local.h" | 57 | #include "modes_local.h" |
| 57 | 58 | ||
| @@ -84,17 +85,17 @@ gcm_init_4bit(u128 Htable[16], uint64_t H[2]) | |||
| 84 | } | 85 | } |
| 85 | } | 86 | } |
| 86 | 87 | ||
| 87 | #ifdef GHASH_ASM | 88 | #if !defined(HAVE_GCM_GHASH_4BIT) && !defined(HAVE_GCM_GMULT_4BIT) |
| 88 | void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]); | ||
| 89 | void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, | ||
| 90 | size_t len); | ||
| 91 | |||
| 92 | #else | ||
| 93 | static const uint16_t rem_4bit[16] = { | 89 | static const uint16_t rem_4bit[16] = { |
| 94 | 0x0000, 0x1c20, 0x3840, 0x2460, 0x7080, 0x6ca0, 0x48c0, 0x54e0, | 90 | 0x0000, 0x1c20, 0x3840, 0x2460, 0x7080, 0x6ca0, 0x48c0, 0x54e0, |
| 95 | 0xe100, 0xfd20, 0xd940, 0xc560, 0x9180, 0x8da0, 0xa9c0, 0xb5e0, | 91 | 0xe100, 0xfd20, 0xd940, 0xc560, 0x9180, 0x8da0, 0xa9c0, 0xb5e0, |
| 96 | }; | 92 | }; |
| 93 | #endif | ||
| 94 | |||
| 95 | #ifdef HAVE_GCM_GMULT_4BIT | ||
| 96 | void gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]); | ||
| 97 | 97 | ||
| 98 | #else | ||
| 98 | static void | 99 | static void |
| 99 | gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) | 100 | gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) |
| 100 | { | 101 | { |
| @@ -135,7 +136,13 @@ gcm_gmult_4bit(uint64_t Xi[2], const u128 Htable[16]) | |||
| 135 | Xi[0] = htobe64(Z.hi); | 136 | Xi[0] = htobe64(Z.hi); |
| 136 | Xi[1] = htobe64(Z.lo); | 137 | Xi[1] = htobe64(Z.lo); |
| 137 | } | 138 | } |
| 139 | #endif | ||
| 138 | 140 | ||
| 141 | #ifdef HAVE_GCM_GHASH_4BIT | ||
| 142 | void gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], const uint8_t *inp, | ||
| 143 | size_t len); | ||
| 144 | |||
| 145 | #else | ||
| 139 | static void | 146 | static void |
| 140 | gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], | 147 | gcm_ghash_4bit(uint64_t Xi[2], const u128 Htable[16], |
| 141 | const uint8_t *inp, size_t len) | 148 | const uint8_t *inp, size_t len) |
