From fd19eff2f98d72aee359ddccbf890bac0361fb66 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 27 Jun 2025 17:26:57 +0000 Subject: Simplify EVP AES-GCM implementation and remove AES-NI specific code. Like CTR, the mode implementation for GCM has two variants - rather than using multiple variants (one for AES-NI, another for non-AES-NI), consistently use CRYPTO_gcm128_{en,de}crypt_ctr32() with the aes_ctr32_encrypt_internal() function added for CTR mode. This lets us remove the AES-NI specific code, AES-NI specific EVP_CIPHER methods and the ctr function pointer from EVP_AES_GCM_CTX. ok tb@ --- src/lib/libcrypto/aes/aes_local.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/lib/libcrypto/aes') diff --git a/src/lib/libcrypto/aes/aes_local.h b/src/lib/libcrypto/aes/aes_local.h index dab12ed3f9..f9bd363802 100644 --- a/src/lib/libcrypto/aes/aes_local.h +++ b/src/lib/libcrypto/aes/aes_local.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_local.h,v 1.6 2025/06/27 16:43:54 jsing Exp $ */ +/* $OpenBSD: aes_local.h,v 1.7 2025/06/27 17:26:57 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -63,6 +63,9 @@ __BEGIN_HIDDEN_DECLS /* This controls loop-unrolling in aes_core.c */ #undef FULL_UNROLL +void aes_ctr32_encrypt_ctr128f(const unsigned char *in, unsigned char *out, + size_t blocks, const void *key, const unsigned char ivec[AES_BLOCK_SIZE]); + __END_HIDDEN_DECLS #endif /* !HEADER_AES_LOCAL_H */ -- cgit v1.2.3-55-g6feb