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 #include "aes.h"
00028
00029 #define MBEDTLS_AESNI_AES 0x02000000u
00030 #define MBEDTLS_AESNI_CLMUL 0x00000002u
00031
00032 #if defined(MBEDTLS_HAVE_ASM) && defined(__GNUC__) && \
00033 ( defined(__amd64__) || defined(__x86_64__) ) && \
00034 ! defined(MBEDTLS_HAVE_X86_64)
00035 #define MBEDTLS_HAVE_X86_64
00036 #endif
00037
00038 #if defined(MBEDTLS_HAVE_X86_64)
00039
00040 #ifdef __cplusplus
00041 extern "C" {
00042 #endif
00043
00052 int mbedtls_aesni_has_support( unsigned int what );
00053
00064 int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *ctx,
00065 int mode,
00066 const unsigned char input[16],
00067 unsigned char output[16] );
00068
00079 void mbedtls_aesni_gcm_mult( unsigned char c[16],
00080 const unsigned char a[16],
00081 const unsigned char b[16] );
00082
00090 void mbedtls_aesni_inverse_key( unsigned char *invkey,
00091 const unsigned char *fwdkey, int nr );
00092
00102 int mbedtls_aesni_setkey_enc( unsigned char *rk,
00103 const unsigned char *key,
00104 size_t bits );
00105
00106 #ifdef __cplusplus
00107 }
00108 #endif
00109
00110 #endif
00111
00112 #endif