mbed TLS v2.16.3
aesni.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
11  * SPDX-License-Identifier: Apache-2.0
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License"); you may
14  * not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
21  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  * This file is part of mbed TLS (https://tls.mbed.org)
26  */
27 #ifndef MBEDTLS_AESNI_H
28 #define MBEDTLS_AESNI_H
29 
30 #if !defined(MBEDTLS_CONFIG_FILE)
31 #include "config.h"
32 #else
33 #include MBEDTLS_CONFIG_FILE
34 #endif
35 
36 #include "aes.h"
37 
38 #define MBEDTLS_AESNI_AES 0x02000000u
39 #define MBEDTLS_AESNI_CLMUL 0x00000002u
40 
41 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
42  ( defined(__amd64__) || defined(__x86_64__) ) && \
43  ! defined(MBEDTLS_HAVE_X86_64)
44 #define MBEDTLS_HAVE_X86_64
45 #endif
46 
47 #if defined(MBEDTLS_HAVE_X86_64)
48 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
64 int mbedtls_aesni_has_support( unsigned int what );
65 
79 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
80  int mode,
81  const unsigned char input[16],
82  unsigned char output[16] );
83 
97 void mbedtls_aesni_gcm_mult( unsigned char c[16],
98  const unsigned char a[16],
99  const unsigned char b[16] );
100 
112 void mbedtls_aesni_inverse_key( unsigned char *invkey,
113  const unsigned char *fwdkey,
114  int nr );
115 
128 int mbedtls_aesni_setkey_enc( unsigned char *rk,
129  const unsigned char *key,
130  size_t bits );
131 
132 #ifdef __cplusplus
133 }
134 #endif
135 
136 #endif /* MBEDTLS_HAVE_X86_64 */
137 
138 #endif /* MBEDTLS_AESNI_H */
aes.h
This file contains AES definitions and functions.
mbedtls_aes_context
The AES context-type definition.
Definition: aes.h:86
config.h
Configuration options (set of defines)