aboutsummaryrefslogtreecommitdiff
path: root/sys/crypto/openssl/ossl_aarch64.h
blob: 57183aa9ed69682f9b5833e46779e47001f1e8fa (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
/*
 * Copyright 1995-2016 The OpenSSL Project Authors. All Rights Reserved.
 *
 * Licensed under the OpenSSL license (the "License").  You may not use
 * this file except in compliance with the License.  You can obtain a copy
 * in the file LICENSE in the source distribution or at
 * https://www.openssl.org/source/license.html
 */

#ifndef __OSSL_AARCH64__
#define __OSSL_AARCH64__

#include <crypto/openssl/ossl.h>
#include <crypto/openssl/ossl_cipher.h>
#include <crypto/openssl/arm_arch.h>

/* aesv8-armx.S */
ossl_cipher_encrypt_t aes_v8_cbc_encrypt;
/* vpaes-armv8.S */
ossl_cipher_encrypt_t vpaes_cbc_encrypt;

static void
AES_CBC_ENCRYPT(const unsigned char *in, unsigned char *out,
    size_t length, const void *key, unsigned char *iv, int encrypt)
{
	if (OPENSSL_armcap_P & ARMV8_AES)
		aes_v8_cbc_encrypt(in, out, length, key, iv, encrypt);
	else
		vpaes_cbc_encrypt(in, out, length, key, iv, encrypt);
}
#endif