xref: /freebsd/sys/crypto/openssl/ossl_aarch64.h (revision 06c3fb2749bda94cb5201f81ffdb8fa6c3161b2e)
1 /*
2  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3  *
4  * Licensed under the OpenSSL license (the "License").  You may not use
5  * this file except in compliance with the License.  You can obtain a copy
6  * in the file LICENSE in the source distribution or at
7  * https://www.openssl.org/source/license.html
8  */
9 
10 #ifndef __OSSL_AARCH64__
11 #define __OSSL_AARCH64__
12 
13 #include <crypto/openssl/ossl.h>
14 #include <crypto/openssl/ossl_cipher.h>
15 #include <crypto/openssl/arm_arch.h>
16 
17 /* aesv8-armx.S */
18 ossl_cipher_encrypt_t aes_v8_cbc_encrypt;
19 /* vpaes-armv8.S */
20 ossl_cipher_encrypt_t vpaes_cbc_encrypt;
21 
22 static void
23 AES_CBC_ENCRYPT(const unsigned char *in, unsigned char *out,
24     size_t length, const void *key, unsigned char *iv, int encrypt)
25 {
26 	if (OPENSSL_armcap_P & ARMV8_AES)
27 		aes_v8_cbc_encrypt(in, out, length, key, iv, encrypt);
28 	else
29 		vpaes_cbc_encrypt(in, out, length, key, iv, encrypt);
30 }
31 #endif
32