00001
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef MBEDTLS_AESNI_H
00025 #define MBEDTLS_AESNI_H
00026
00027 #if !defined(MBEDTLS_CONFIG_FILE)
00028 #include "config.h"
00029 #else
00030 #include MBEDTLS_CONFIG_FILE
00031 #endif
00032
00033 #include "aes.h"
00034
00035 #define MBEDTLS_AESNI_AES 0x02000000u
00036 #define MBEDTLS_AESNI_CLMUL 0x00000002u
00037
00038 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
00039 ( defined(__amd64__) || defined(__x86_64__) ) && \
00040 ! defined(MBEDTLS_HAVE_X86_64)
00041 #define MBEDTLS_HAVE_X86_64
00042 #endif
00043
00044 #if defined(MBEDTLS_HAVE_X86_64)
00045
00046 #ifdef __cplusplus
00047 extern "C" {
00048 #endif
00049
00058 int mbedtls_aesni_has_support( unsigned int what );
00059
00070 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
00071 int mode,
00072 const unsigned char input[16],
00073 unsigned char output[16] );
00074
00085 void mbedtls_aesni_gcm_mult( unsigned char c[16],
00086 const unsigned char a[16],
00087 const unsigned char b[16] );
00088
00096 void mbedtls_aesni_inverse_key( unsigned char *invkey,
00097 const unsigned char *fwdkey, int nr );
00098
00108 int mbedtls_aesni_setkey_enc( unsigned char *rk,
00109 const unsigned char *key,
00110 size_t bits );
00111
00112 #ifdef __cplusplus
00113 }
00114 #endif
00115
00116 #endif
00117
00118 #endif