mbed TLS v2.28.0
aesni.h
Go to the documentation of this file.
1 
9 /*
10  * Copyright The Mbed TLS Contributors
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 #ifndef MBEDTLS_AESNI_H
26 #define MBEDTLS_AESNI_H
27 
28 #if !defined(MBEDTLS_CONFIG_FILE)
29 #include "mbedtls/config.h"
30 #else
31 #include MBEDTLS_CONFIG_FILE
32 #endif
33 
34 #include "mbedtls/aes.h"
35 
36 #define MBEDTLS_AESNI_AES 0x02000000u
37 #define MBEDTLS_AESNI_CLMUL 0x00000002u
38 
39 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
40  ( defined(__amd64__) || defined(__x86_64__) ) && \
41  ! defined(MBEDTLS_HAVE_X86_64)
42 #define MBEDTLS_HAVE_X86_64
43 #endif
44 
45 #if defined(MBEDTLS_HAVE_X86_64)
46 
47 #ifdef __cplusplus
48 extern "C" {
49 #endif
50 
62 int mbedtls_aesni_has_support( unsigned int what );
63 
77 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
78  int mode,
79  const unsigned char input[16],
80  unsigned char output[16] );
81 
95 void mbedtls_aesni_gcm_mult( unsigned char c[16],
96  const unsigned char a[16],
97  const unsigned char b[16] );
98 
110 void mbedtls_aesni_inverse_key( unsigned char *invkey,
111  const unsigned char *fwdkey,
112  int nr );
113 
126 int mbedtls_aesni_setkey_enc( unsigned char *rk,
127  const unsigned char *key,
128  size_t bits );
129 
130 #ifdef __cplusplus
131 }
132 #endif
133 
134 #endif /* MBEDTLS_HAVE_X86_64 */
135 
136 #endif /* MBEDTLS_AESNI_H */
Configuration options (set of defines)
This file contains AES definitions and functions.
The AES context-type definition.
Definition: aes.h:91