cosmopolitan/third_party/mbedtls/aesni.h
Justine Tunney e51034bab3 Make GCM AES faster
13.22% mbedtls_aesni_gcm_mult
    13.03% mbedtls_gcm_update
     9.85% mbedtls_aesni_crypt_ecb

Overhead improvement (perf record)

    10.97% mbedtls_aesni_gcm_mult
    10.59% mbedtls_aesni_crypt_ecb
     2.26% mbedtls_gcm_update
2021-07-06 08:27:16 -07:00

17 lines
642 B
C

#ifndef MBEDTLS_AESNI_H_
#define MBEDTLS_AESNI_H_
#include "third_party/mbedtls/aes.h"
#include "third_party/mbedtls/config.h"
COSMOPOLITAN_C_START_
/* clang-format off */
#define MBEDTLS_AESNI_AES 0x02000000u
#define MBEDTLS_AESNI_CLMUL 0x00000002u
int mbedtls_aesni_crypt_ecb( mbedtls_aes_context *, int, const unsigned char[16], unsigned char[16] );
void mbedtls_aesni_gcm_mult( unsigned char[16], const uint64_t[2] );
void mbedtls_aesni_inverse_key( unsigned char *, const unsigned char *, int );
int mbedtls_aesni_setkey_enc( unsigned char *, const unsigned char *, size_t );
COSMOPOLITAN_C_END_
#endif /* MBEDTLS_AESNI_H_ */