.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__
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
___
}
{
$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
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
___
}
{
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
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
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.=<<___;
}
$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
___
.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
.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,
$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:
.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:
.Lxts_dec_epilogue:
ret
.cfi_endproc
-.size bsaes_xts_decrypt,.-bsaes_xts_decrypt
+.size ossl_bsaes_xts_decrypt,.-ossl_bsaes_xts_decrypt
___
}
$code.=<<___;
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
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
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
#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
# 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
# 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 */
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
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
#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