mbed TLS v2.16.7
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 OR GPL-2.0-or-later
12  *
13  * This file is provided under the Apache License 2.0, or the
14  * GNU General Public License v2.0 or later.
15  *
16  * **********
17  * Apache License 2.0:
18  *
19  * Licensed under the Apache License, Version 2.0 (the "License"); you may
20  * not use this file except in compliance with the License.
21  * You may obtain a copy of the License at
22  *
23  * http://www.apache.org/licenses/LICENSE-2.0
24  *
25  * Unless required by applicable law or agreed to in writing, software
26  * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28  * See the License for the specific language governing permissions and
29  * limitations under the License.
30  *
31  * **********
32  *
33  * **********
34  * GNU General Public License v2.0 or later:
35  *
36  * This program is free software; you can redistribute it and/or modify
37  * it under the terms of the GNU General Public License as published by
38  * the Free Software Foundation; either version 2 of the License, or
39  * (at your option) any later version.
40  *
41  * This program is distributed in the hope that it will be useful,
42  * but WITHOUT ANY WARRANTY; without even the implied warranty of
43  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
44  * GNU General Public License for more details.
45  *
46  * You should have received a copy of the GNU General Public License along
47  * with this program; if not, write to the Free Software Foundation, Inc.,
48  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
49  *
50  * **********
51  *
52  * This file is part of mbed TLS (https://tls.mbed.org)
53  */
54 #ifndef MBEDTLS_AESNI_H
55 #define MBEDTLS_AESNI_H
56 
57 #if !defined(MBEDTLS_CONFIG_FILE)
58 #include "config.h"
59 #else
60 #include MBEDTLS_CONFIG_FILE
61 #endif
62 
63 #include "aes.h"
64 
65 #define MBEDTLS_AESNI_AES 0x02000000u
66 #define MBEDTLS_AESNI_CLMUL 0x00000002u
67 
68 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
69  ( defined(__amd64__) || defined(__x86_64__) ) && \
70  ! defined(MBEDTLS_HAVE_X86_64)
71 #define MBEDTLS_HAVE_X86_64
72 #endif
73 
74 #if defined(MBEDTLS_HAVE_X86_64)
75 
76 #ifdef __cplusplus
77 extern "C" {
78 #endif
79 
91 int mbedtls_aesni_has_support( unsigned int what );
92 
106 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
107  int mode,
108  const unsigned char input[16],
109  unsigned char output[16] );
110 
124 void mbedtls_aesni_gcm_mult( unsigned char c[16],
125  const unsigned char a[16],
126  const unsigned char b[16] );
127 
139 void mbedtls_aesni_inverse_key( unsigned char *invkey,
140  const unsigned char *fwdkey,
141  int nr );
142 
155 int mbedtls_aesni_setkey_enc( unsigned char *rk,
156  const unsigned char *key,
157  size_t bits );
158 
159 #ifdef __cplusplus
160 }
161 #endif
162 
163 #endif /* MBEDTLS_HAVE_X86_64 */
164 
165 #endif /* MBEDTLS_AESNI_H */
aes.h
This file contains AES definitions and functions.
mbedtls_aes_context
The AES context-type definition.
Definition: aes.h:115
config.h
Configuration options (set of defines)