From: Pauli Date: Tue, 25 May 2021 00:40:44 +0000 (+1000) Subject: aes: rename new bsaes_ symbols -> ossl_bsaes_ ones X-Git-Tag: openssl-3.0.0-beta1~364 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3675334e2b92eabedbd2f0eb452ade30283b0e56;p=thirdparty%2Fopenssl.git aes: rename new bsaes_ symbols -> ossl_bsaes_ ones bsaes_cbc_encrypt -> ossl_bsaes_cbc_encrypt bsaes_ctr32_encrypt_blocks -> ossl_bsaes_ctr32_encrypt_blocks bsaes_xts_decrypt -> ossl_bsaes_xts_decrypt bsaes_xts_encrypt -> ossl_bsaes_xts_encrypt Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/15445) --- diff --git a/crypto/aes/asm/bsaes-armv7.pl b/crypto/aes/asm/bsaes-armv7.pl index 39ccc3dbedd..f97dea20779 100644 --- a/crypto/aes/asm/bsaes-armv7.pl +++ b/crypto/aes/asm/bsaes-armv7.pl @@ -1119,10 +1119,10 @@ $code.=<<___; .extern AES_cbc_encrypt .extern AES_decrypt -.global bsaes_cbc_encrypt -.type bsaes_cbc_encrypt,%function +.global ossl_bsaes_cbc_encrypt +.type ossl_bsaes_cbc_encrypt,%function .align 5 -bsaes_cbc_encrypt: +ossl_bsaes_cbc_encrypt: #ifndef __KERNEL__ cmp $len, #128 #ifndef __thumb__ @@ -1384,7 +1384,7 @@ bsaes_cbc_encrypt: vst1.8 {@XMM[15]}, [$ivp] @ return IV VFP_ABI_POP ldmia sp!, {r4-r10, pc} -.size bsaes_cbc_encrypt,.-bsaes_cbc_encrypt +.size ossl_bsaes_cbc_encrypt,.-ossl_bsaes_cbc_encrypt ___ } { @@ -1394,10 +1394,10 @@ my $keysched = "sp"; $code.=<<___; .extern AES_encrypt -.global bsaes_ctr32_encrypt_blocks -.type bsaes_ctr32_encrypt_blocks,%function +.global ossl_bsaes_ctr32_encrypt_blocks +.type ossl_bsaes_ctr32_encrypt_blocks,%function .align 5 -bsaes_ctr32_encrypt_blocks: +ossl_bsaes_ctr32_encrypt_blocks: cmp $len, #8 @ use plain AES for blo .Lctr_enc_short @ small sizes @@ -1620,7 +1620,7 @@ bsaes_ctr32_encrypt_blocks: vstmia sp!, {q0-q1} ldmia sp!, {r4-r8, pc} -.size bsaes_ctr32_encrypt_blocks,.-bsaes_ctr32_encrypt_blocks +.size ossl_bsaes_ctr32_encrypt_blocks,.-ossl_bsaes_ctr32_encrypt_blocks ___ } { @@ -1635,10 +1635,10 @@ my $twmask=@XMM[5]; my @T=@XMM[6..7]; $code.=<<___; -.globl bsaes_xts_encrypt -.type bsaes_xts_encrypt,%function +.globl ossl_bsaes_xts_encrypt +.type ossl_bsaes_xts_encrypt,%function .align 4 -bsaes_xts_encrypt: +ossl_bsaes_xts_encrypt: mov ip, sp stmdb sp!, {r4-r10, lr} @ 0x20 VFP_ABI_PUSH @@ -2037,12 +2037,12 @@ $code.=<<___; VFP_ABI_POP ldmia sp!, {r4-r10, pc} @ return -.size bsaes_xts_encrypt,.-bsaes_xts_encrypt +.size ossl_bsaes_xts_encrypt,.-ossl_bsaes_xts_encrypt -.globl bsaes_xts_decrypt -.type bsaes_xts_decrypt,%function +.globl ossl_bsaes_xts_decrypt +.type ossl_bsaes_xts_decrypt,%function .align 4 -bsaes_xts_decrypt: +ossl_bsaes_xts_decrypt: mov ip, sp stmdb sp!, {r4-r10, lr} @ 0x20 VFP_ABI_PUSH @@ -2472,7 +2472,7 @@ $code.=<<___; VFP_ABI_POP ldmia sp!, {r4-r10, pc} @ return -.size bsaes_xts_decrypt,.-bsaes_xts_decrypt +.size ossl_bsaes_xts_decrypt,.-ossl_bsaes_xts_decrypt ___ } $code.=<<___; diff --git a/crypto/aes/asm/bsaes-x86_64.pl b/crypto/aes/asm/bsaes-x86_64.pl index 2cf8211581d..fa249cc3d96 100644 --- a/crypto/aes/asm/bsaes-x86_64.pl +++ b/crypto/aes/asm/bsaes-x86_64.pl @@ -1611,10 +1611,10 @@ ___ } $code.=<<___; .extern asm_AES_cbc_encrypt -.globl bsaes_cbc_encrypt -.type bsaes_cbc_encrypt,\@abi-omnipotent +.globl ossl_bsaes_cbc_encrypt +.type ossl_bsaes_cbc_encrypt,\@abi-omnipotent .align 16 -bsaes_cbc_encrypt: +ossl_bsaes_cbc_encrypt: .cfi_startproc endbranch ___ @@ -1915,12 +1915,12 @@ $code.=<<___; .Lcbc_dec_epilogue: ret .cfi_endproc -.size bsaes_cbc_encrypt,.-bsaes_cbc_encrypt +.size ossl_bsaes_cbc_encrypt,.-ossl_bsaes_cbc_encrypt -.globl bsaes_ctr32_encrypt_blocks -.type bsaes_ctr32_encrypt_blocks,\@abi-omnipotent +.globl ossl_bsaes_ctr32_encrypt_blocks +.type ossl_bsaes_ctr32_encrypt_blocks,\@abi-omnipotent .align 16 -bsaes_ctr32_encrypt_blocks: +ossl_bsaes_ctr32_encrypt_blocks: .cfi_startproc endbranch mov %rsp, %rax @@ -2166,7 +2166,7 @@ $code.=<<___; .Lctr_enc_epilogue: ret .cfi_endproc -.size bsaes_ctr32_encrypt_blocks,.-bsaes_ctr32_encrypt_blocks +.size ossl_bsaes_ctr32_encrypt_blocks,.-ossl_bsaes_ctr32_encrypt_blocks ___ ###################################################################### # void bsaes_xts_[en|de]crypt(const char *inp,char *out,size_t len, @@ -2177,10 +2177,10 @@ my ($twmask,$twres,$twtmp)=@XMM[13..15]; $arg6=~s/d$//; $code.=<<___; -.globl bsaes_xts_encrypt -.type bsaes_xts_encrypt,\@abi-omnipotent +.globl ossl_bsaes_xts_encrypt +.type ossl_bsaes_xts_encrypt,\@abi-omnipotent .align 16 -bsaes_xts_encrypt: +ossl_bsaes_xts_encrypt: .cfi_startproc mov %rsp, %rax .Lxts_enc_prologue: @@ -2574,12 +2574,12 @@ $code.=<<___; .Lxts_enc_epilogue: ret .cfi_endproc -.size bsaes_xts_encrypt,.-bsaes_xts_encrypt +.size ossl_bsaes_xts_encrypt,.-ossl_bsaes_xts_encrypt -.globl bsaes_xts_decrypt -.type bsaes_xts_decrypt,\@abi-omnipotent +.globl ossl_bsaes_xts_decrypt +.type ossl_bsaes_xts_decrypt,\@abi-omnipotent .align 16 -bsaes_xts_decrypt: +ossl_bsaes_xts_decrypt: .cfi_startproc mov %rsp, %rax .Lxts_dec_prologue: @@ -2998,7 +2998,7 @@ $code.=<<___; .Lxts_dec_epilogue: ret .cfi_endproc -.size bsaes_xts_decrypt,.-bsaes_xts_decrypt +.size ossl_bsaes_xts_decrypt,.-ossl_bsaes_xts_decrypt ___ } $code.=<<___; diff --git a/crypto/evp/e_aes.c b/crypto/evp/e_aes.c index 91e8cd861cd..7e8f8ece728 100644 --- a/crypto/evp/e_aes.c +++ b/crypto/evp/e_aes.c @@ -2323,7 +2323,7 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, ret = AES_set_decrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, &dat->ks.ks); dat->block = (block128_f) AES_decrypt; - dat->stream.cbc = (cbc128_f) bsaes_cbc_encrypt; + dat->stream.cbc = (cbc128_f) ossl_bsaes_cbc_encrypt; } else #endif #ifdef VPAES_CAPABLE @@ -2369,7 +2369,7 @@ static int aes_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, ret = AES_set_encrypt_key(key, EVP_CIPHER_CTX_key_length(ctx) * 8, &dat->ks.ks); dat->block = (block128_f) AES_encrypt; - dat->stream.ctr = (ctr128_f) bsaes_ctr32_encrypt_blocks; + dat->stream.ctr = (ctr128_f) ossl_bsaes_ctr32_encrypt_blocks; } else #endif #ifdef VPAES_CAPABLE @@ -2711,7 +2711,7 @@ static int aes_gcm_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, AES_set_encrypt_key(key, ctx->key_len * 8, &gctx->ks.ks); CRYPTO_gcm128_init(&gctx->gcm, &gctx->ks, (block128_f) AES_encrypt); - gctx->ctr = (ctr128_f) bsaes_ctr32_encrypt_blocks; + gctx->ctr = (ctr128_f) ossl_bsaes_ctr32_encrypt_blocks; break; } else #endif @@ -3168,7 +3168,7 @@ static int aes_xts_init_key(EVP_CIPHER_CTX *ctx, const unsigned char *key, #endif #ifdef BSAES_CAPABLE if (BSAES_CAPABLE) - xctx->stream = enc ? bsaes_xts_encrypt : bsaes_xts_decrypt; + xctx->stream = enc ? ossl_bsaes_xts_encrypt : ossl_bsaes_xts_decrypt; else #endif #ifdef VPAES_CAPABLE diff --git a/include/crypto/aes_platform.h b/include/crypto/aes_platform.h index b2b0b118778..fa3b3eb8ab0 100644 --- a/include/crypto/aes_platform.h +++ b/include/crypto/aes_platform.h @@ -29,18 +29,19 @@ void vpaes_cbc_encrypt(const unsigned char *in, # endif /* VPAES_ASM */ # ifdef BSAES_ASM -void bsaes_cbc_encrypt(const unsigned char *in, unsigned char *out, - size_t length, const AES_KEY *key, - unsigned char ivec[16], int enc); -void bsaes_ctr32_encrypt_blocks(const unsigned char *in, unsigned char *out, - size_t len, const AES_KEY *key, - const unsigned char ivec[16]); -void bsaes_xts_encrypt(const unsigned char *inp, unsigned char *out, - size_t len, const AES_KEY *key1, - const AES_KEY *key2, const unsigned char iv[16]); -void bsaes_xts_decrypt(const unsigned char *inp, unsigned char *out, - size_t len, const AES_KEY *key1, - const AES_KEY *key2, const unsigned char iv[16]); +void ossl_bsaes_cbc_encrypt(const unsigned char *in, unsigned char *out, + size_t length, const AES_KEY *key, + unsigned char ivec[16], int enc); +void ossl_bsaes_ctr32_encrypt_blocks(const unsigned char *in, + unsigned char *out, size_t len, + const AES_KEY *key, + const unsigned char ivec[16]); +void ossl_bsaes_xts_encrypt(const unsigned char *inp, unsigned char *out, + size_t len, const AES_KEY *key1, + const AES_KEY *key2, const unsigned char iv[16]); +void ossl_bsaes_xts_decrypt(const unsigned char *inp, unsigned char *out, + size_t len, const AES_KEY *key1, + const AES_KEY *key2, const unsigned char iv[16]); # endif /* BSAES_ASM */ # ifdef AES_CTR_ASM diff --git a/providers/implementations/ciphers/cipher_aes_gcm_hw.c b/providers/implementations/ciphers/cipher_aes_gcm_hw.c index 1aca2bf9e7c..44fa9d4d72e 100644 --- a/providers/implementations/ciphers/cipher_aes_gcm_hw.c +++ b/providers/implementations/ciphers/cipher_aes_gcm_hw.c @@ -37,7 +37,7 @@ static int aes_gcm_initkey(PROV_GCM_CTX *ctx, const unsigned char *key, # ifdef BSAES_CAPABLE if (BSAES_CAPABLE) { GCM_HW_SET_KEY_CTR_FN(ks, AES_set_encrypt_key, AES_encrypt, - bsaes_ctr32_encrypt_blocks); + ossl_bsaes_ctr32_encrypt_blocks); } else # endif /* BSAES_CAPABLE */ diff --git a/providers/implementations/ciphers/cipher_aes_hw.c b/providers/implementations/ciphers/cipher_aes_hw.c index d9b9b044b88..596cdba8d30 100644 --- a/providers/implementations/ciphers/cipher_aes_hw.c +++ b/providers/implementations/ciphers/cipher_aes_hw.c @@ -46,7 +46,7 @@ static int cipher_hw_aes_initkey(PROV_CIPHER_CTX *dat, if (BSAES_CAPABLE && dat->mode == EVP_CIPH_CBC_MODE) { ret = AES_set_decrypt_key(key, keylen * 8, ks); dat->block = (block128_f)AES_decrypt; - dat->stream.cbc = (cbc128_f)bsaes_cbc_encrypt; + dat->stream.cbc = (cbc128_f)ossl_bsaes_cbc_encrypt; } else #endif #ifdef VPAES_CAPABLE @@ -91,7 +91,7 @@ static int cipher_hw_aes_initkey(PROV_CIPHER_CTX *dat, if (BSAES_CAPABLE && dat->mode == EVP_CIPH_CTR_MODE) { ret = AES_set_encrypt_key(key, keylen * 8, ks); dat->block = (block128_f)AES_encrypt; - dat->stream.ctr = (ctr128_f)bsaes_ctr32_encrypt_blocks; + dat->stream.ctr = (ctr128_f)ossl_bsaes_ctr32_encrypt_blocks; } else #endif #ifdef VPAES_CAPABLE diff --git a/providers/implementations/ciphers/cipher_aes_xts_hw.c b/providers/implementations/ciphers/cipher_aes_xts_hw.c index c45d67b825b..bd19868f627 100644 --- a/providers/implementations/ciphers/cipher_aes_xts_hw.c +++ b/providers/implementations/ciphers/cipher_aes_xts_hw.c @@ -65,8 +65,8 @@ static int cipher_hw_aes_xts_generic_initkey(PROV_CIPHER_CTX *ctx, #ifdef BSAES_CAPABLE if (BSAES_CAPABLE) { - stream_enc = bsaes_xts_encrypt; - stream_dec = bsaes_xts_decrypt; + stream_enc = ossl_bsaes_xts_encrypt; + stream_dec = ossl_bsaes_xts_decrypt; } else #endif /* BSAES_CAPABLE */ #ifdef VPAES_CAPABLE