aes: rename new bsaes_ symbols -> ossl_bsaes_ ones
authorPauli <pauli@openssl.org>
Tue, 25 May 2021 00:40:44 +0000 (10:40 +1000)
committerPauli <pauli@openssl.org>
Wed, 26 May 2021 23:35:50 +0000 (09:35 +1000)
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 <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/15445)

crypto/aes/asm/bsaes-armv7.pl
crypto/aes/asm/bsaes-x86_64.pl
crypto/evp/e_aes.c
include/crypto/aes_platform.h
providers/implementations/ciphers/cipher_aes_gcm_hw.c
providers/implementations/ciphers/cipher_aes_hw.c
providers/implementations/ciphers/cipher_aes_xts_hw.c

index 39ccc3dbedded9c80412708ca4e3ca3bf930a301..f97dea207798faa280b530a8658115a58a60b99e 100644 (file)
@@ -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.=<<___;
index 2cf8211581ddd9a9ae71e2bc4bc04c6968eb8ae6..fa249cc3d96cc1ff098ea824dc9f01a7682e840d 100644 (file)
@@ -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.=<<___;
index 91e8cd861cd560a0ed20d7bc62ebe387eeb50b82..7e8f8ece728b3f8af2cb89f552a2cd91c4b80180 100644 (file)
@@ -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
index b2b0b1187789c5c27fcf6a0d2f0c153f19a318cc..fa3b3eb8ab0355a8081819e7d9207d3de9b556f6 100644 (file)
@@ -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
index 1aca2bf9e7cba3f697d757f0eaa041257f581063..44fa9d4d72ea5d6f6f78de9958a2b9ab862b3ccb 100644 (file)
@@ -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 */
 
index d9b9b044b8899d7692ee49bf64137f168996ffab..596cdba8d3070f0dc1e1d9a19c407a3d87572194 100644 (file)
@@ -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
index c45d67b825b1c834e2d5fb048f24296193d0f057..bd19868f62773382c69057552e9f23c5e6c07653 100644 (file)
@@ -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