xref: /freebsd/sys/crypto/openssl/ossl_aarch64.h (revision e655cc70dfcda5cfedb5a1d9bef1e87d55519f64)
1197ff4c3SKornel Duleba /*
2197ff4c3SKornel Duleba  * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
3197ff4c3SKornel Duleba  *
4197ff4c3SKornel Duleba  * Licensed under the OpenSSL license (the "License").  You may not use
5197ff4c3SKornel Duleba  * this file except in compliance with the License.  You can obtain a copy
6197ff4c3SKornel Duleba  * in the file LICENSE in the source distribution or at
7197ff4c3SKornel Duleba  * https://www.openssl.org/source/license.html
8197ff4c3SKornel Duleba  */
9197ff4c3SKornel Duleba 
10197ff4c3SKornel Duleba #ifndef __OSSL_AARCH64__
11197ff4c3SKornel Duleba #define __OSSL_AARCH64__
12197ff4c3SKornel Duleba 
13197ff4c3SKornel Duleba #include <crypto/openssl/ossl.h>
14197ff4c3SKornel Duleba #include <crypto/openssl/ossl_cipher.h>
15*e655cc70SMark Johnston #include <crypto/openssl/arm_arch.h>
16197ff4c3SKornel Duleba 
17197ff4c3SKornel Duleba /* aesv8-armx.S */
18197ff4c3SKornel Duleba ossl_cipher_encrypt_t aes_v8_cbc_encrypt;
19197ff4c3SKornel Duleba /* vpaes-armv8.S */
20197ff4c3SKornel Duleba ossl_cipher_encrypt_t vpaes_cbc_encrypt;
21197ff4c3SKornel Duleba 
22197ff4c3SKornel Duleba static void
AES_CBC_ENCRYPT(const unsigned char * in,unsigned char * out,size_t length,const void * key,unsigned char * iv,int encrypt)23197ff4c3SKornel Duleba AES_CBC_ENCRYPT(const unsigned char *in, unsigned char *out,
24197ff4c3SKornel Duleba     size_t length, const void *key, unsigned char *iv, int encrypt)
25197ff4c3SKornel Duleba {
26197ff4c3SKornel Duleba 	if (OPENSSL_armcap_P & ARMV8_AES)
27197ff4c3SKornel Duleba 		aes_v8_cbc_encrypt(in, out, length, key, iv, encrypt);
28197ff4c3SKornel Duleba 	else
29197ff4c3SKornel Duleba 		vpaes_cbc_encrypt(in, out, length, key, iv, encrypt);
30197ff4c3SKornel Duleba }
31197ff4c3SKornel Duleba #endif
32