mbed TLS v2.7.15
aesni.h
Go to the documentation of this file.
1 
6 /*
7  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
8  * SPDX-License-Identifier: Apache-2.0
9  *
10  * Licensed under the Apache License, Version 2.0 (the "License"); you may
11  * not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * http://www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  * This file is part of mbed TLS (https://tls.mbed.org)
23  */
24 #ifndef MBEDTLS_AESNI_H
25 #define MBEDTLS_AESNI_H
26 
27 #if !defined(MBEDTLS_CONFIG_FILE)
28 #include "config.h"
29 #else
30 #include MBEDTLS_CONFIG_FILE
31 #endif
32 
33 #include "aes.h"
34 
35 #define MBEDTLS_AESNI_AES 0x02000000u
36 #define MBEDTLS_AESNI_CLMUL 0x00000002u
37 
38 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
39  ( defined(__amd64__) || defined(__x86_64__) ) && \
40  ! defined(MBEDTLS_HAVE_X86_64)
41 #define MBEDTLS_HAVE_X86_64
42 #endif
43 
44 #if defined(MBEDTLS_HAVE_X86_64)
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
58 int mbedtls_aesni_has_support( unsigned int what );
59 
70 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
71  int mode,
72  const unsigned char input[16],
73  unsigned char output[16] );
74 
85 void mbedtls_aesni_gcm_mult( unsigned char c[16],
86  const unsigned char a[16],
87  const unsigned char b[16] );
88 
96 void mbedtls_aesni_inverse_key( unsigned char *invkey,
97  const unsigned char *fwdkey, int nr );
98 
108 int mbedtls_aesni_setkey_enc( unsigned char *rk,
109  const unsigned char *key,
110  size_t bits );
111 
112 #ifdef __cplusplus
113 }
114 #endif
115 
116 #endif /* MBEDTLS_HAVE_X86_64 */
117 
118 #endif /* MBEDTLS_AESNI_H */
Configuration options (set of defines)
The Advanced Encryption Standard (AES) specifies a FIPS-approved cryptographic algorithm that can be ...
The AES context-type definition.
Definition: aes.h:73