diff options
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/aes/aes_cbc.c | 19 | ||||
-rw-r--r-- | lib/libcrypto/aes/asm/aes-586.pl | 9 | ||||
-rwxr-xr-x | lib/libcrypto/aes/asm/aes-x86_64.pl | 13 | ||||
-rw-r--r-- | lib/libcrypto/arch/amd64/Makefile.inc | 4 | ||||
-rw-r--r-- | lib/libcrypto/arch/i386/Makefile.inc | 4 |
5 files changed, 32 insertions, 17 deletions
diff --git a/lib/libcrypto/aes/aes_cbc.c b/lib/libcrypto/aes/aes_cbc.c index 5e76f6ea018..f578be9901b 100644 --- a/lib/libcrypto/aes/aes_cbc.c +++ b/lib/libcrypto/aes/aes_cbc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aes_cbc.c,v 1.12 2014/06/12 15:49:27 deraadt Exp $ */ +/* $OpenBSD: aes_cbc.c,v 1.13 2024/03/28 12:28:48 jsing Exp $ */ /* ==================================================================== * Copyright (c) 1998-2002 The OpenSSL Project. All rights reserved. * @@ -52,8 +52,13 @@ #include <openssl/aes.h> #include <openssl/modes.h> -void -AES_cbc_encrypt(const unsigned char *in, unsigned char *out, +#ifdef HAVE_AES_CBC_ENCRYPT_INTERNAL +void aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out, + size_t len, const AES_KEY *key, unsigned char *ivec, const int enc); + +#else +static inline void +aes_cbc_encrypt_internal(const unsigned char *in, unsigned char *out, size_t len, const AES_KEY *key, unsigned char *ivec, const int enc) { if (enc) @@ -63,3 +68,11 @@ AES_cbc_encrypt(const unsigned char *in, unsigned char *out, CRYPTO_cbc128_decrypt(in, out, len, key, ivec, (block128_f)AES_decrypt); } +#endif + +void +AES_cbc_encrypt(const unsigned char *in, unsigned char *out, + size_t len, const AES_KEY *key, unsigned char *ivec, const int enc) +{ + aes_cbc_encrypt_internal(in, out, len, key, ivec, enc); +} diff --git a/lib/libcrypto/aes/asm/aes-586.pl b/lib/libcrypto/aes/asm/aes-586.pl index 4e0f34cba31..733675ce7d9 100644 --- a/lib/libcrypto/aes/asm/aes-586.pl +++ b/lib/libcrypto/aes/asm/aes-586.pl @@ -2004,9 +2004,8 @@ sub declast() &mov (&DWP(12,$acc),$s3); &function_end("AES_decrypt"); -# void AES_cbc_encrypt (const void char *inp, unsigned char *out, -# size_t length, const AES_KEY *key, -# unsigned char *ivp,const int enc); +# void aes_cbc_encrypt_internal(const void char *inp, unsigned char *out, +# size_t length, const AES_KEY *key, unsigned char *ivp,const int enc); { # stack frame layout # -4(%esp) # return address 0(%esp) @@ -2029,7 +2028,7 @@ my $ivec=&DWP(60,"esp"); # ivec[16] my $aes_key=&DWP(76,"esp"); # copy of aes_key my $mark=&DWP(76+240,"esp"); # copy of aes_key->rounds -&function_begin("AES_cbc_encrypt"); +&function_begin("aes_cbc_encrypt_internal"); &mov ($s2 eq "ecx"? $s2 : "",&wparam(2)); # load len &cmp ($s2,0); &je (&label("drop_out")); @@ -2617,7 +2616,7 @@ my $mark=&DWP(76+240,"esp"); # copy of aes_key->rounds &mov ("esp",$_esp); &popf (); -&function_end("AES_cbc_encrypt"); +&function_end("aes_cbc_encrypt_internal"); } #------------------------------------------------------------------# diff --git a/lib/libcrypto/aes/asm/aes-x86_64.pl b/lib/libcrypto/aes/asm/aes-x86_64.pl index 299214800bc..a5148f7c1a5 100755 --- a/lib/libcrypto/aes/asm/aes-x86_64.pl +++ b/lib/libcrypto/aes/asm/aes-x86_64.pl @@ -1641,9 +1641,8 @@ $code.=<<___; .size AES_set_decrypt_key,.-AES_set_decrypt_key ___ -# void AES_cbc_encrypt (const void char *inp, unsigned char *out, -# size_t length, const AES_KEY *key, -# unsigned char *ivp,const int enc); +# void aes_cbc_encrypt_internal(const void char *inp, unsigned char *out, +# size_t length, const AES_KEY *key, unsigned char *ivp,const int enc); { # stack frame layout # -8(%rsp) return address @@ -1660,15 +1659,15 @@ my $aes_key="80(%rsp)"; # copy of aes_key my $mark="80+240(%rsp)"; # copy of aes_key->rounds $code.=<<___; -.globl AES_cbc_encrypt -.type AES_cbc_encrypt,\@function,6 +.globl aes_cbc_encrypt_internal +.type aes_cbc_encrypt_internal,\@function,6 .align 16 .extern OPENSSL_ia32cap_P .hidden OPENSSL_ia32cap_P .globl asm_AES_cbc_encrypt .hidden asm_AES_cbc_encrypt asm_AES_cbc_encrypt: -AES_cbc_encrypt: +aes_cbc_encrypt_internal: _CET_ENDBR cmp \$0,%rdx # check length je .Lcbc_epilogue @@ -2118,7 +2117,7 @@ AES_cbc_encrypt: popfq .Lcbc_epilogue: ret -.size AES_cbc_encrypt,.-AES_cbc_encrypt +.size aes_cbc_encrypt_internal,.-aes_cbc_encrypt_internal ___ } diff --git a/lib/libcrypto/arch/amd64/Makefile.inc b/lib/libcrypto/arch/amd64/Makefile.inc index 40ba3c063c4..13d2c0b1beb 100644 --- a/lib/libcrypto/arch/amd64/Makefile.inc +++ b/lib/libcrypto/arch/amd64/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.18 2024/03/28 01:57:00 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.19 2024/03/28 12:28:48 jsing Exp $ # amd64-specific libcrypto build rules @@ -13,6 +13,8 @@ SSLASM+= aes bsaes-x86_64 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86_64 SSLASM+= aes aesni-x86_64 +CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL +SRCS+= aes_cbc.c # bn CFLAGS+= -DOPENSSL_IA32_SSE2 CFLAGS+= -DRSA_ASM diff --git a/lib/libcrypto/arch/i386/Makefile.inc b/lib/libcrypto/arch/i386/Makefile.inc index aedd1d7683b..cd356eeea5d 100644 --- a/lib/libcrypto/arch/i386/Makefile.inc +++ b/lib/libcrypto/arch/i386/Makefile.inc @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile.inc,v 1.15 2024/03/28 01:57:00 jsing Exp $ +# $OpenBSD: Makefile.inc,v 1.16 2024/03/28 12:28:48 jsing Exp $ # i386-specific libcrypto build rules @@ -11,6 +11,8 @@ SSLASM+= aes aes-586 CFLAGS+= -DVPAES_ASM SSLASM+= aes vpaes-x86 SSLASM+= aes aesni-x86 +CFLAGS+= -DHAVE_AES_CBC_ENCRYPT_INTERNAL +SRCS+= aes_cbc.c # bn CFLAGS+= -DOPENSSL_IA32_SSE2 SSLASM+= bn bn-586 |