9 gettimeofday(&tv, NULL);
10 return tv.tv_usec * 0.000001 + tv.tv_sec;
27 void (*setup)(
void *),
void (*teardown)(
void *),
28 void *data,
int count,
int iter) {
30 double min = HUGE_VAL;
33 for (i = 0; i <
count; i++) {
41 if (teardown != NULL) {
64 for (i = 0; i < 50000; i++) {
71 static const uint8_t key[16] = {0};
77 uint8_t scratch[16] = {0};
79 for (i = 0; i < 4000000 / 16; i++) {
86 uint8_t scratch[16] = {0};
88 for (i = 0; i < 4000000 / 16; i++) {
96 for (i = 0; i < 50000; i++) {
103 static const uint8_t key[16] = {0};
109 uint8_t scratch[16] = {0};
111 for (i = 0; i < 4000000 / 16; i++) {
118 uint8_t scratch[16] = {0};
120 for (i = 0; i < 4000000 / 16; i++) {
128 for (i = 0; i < 50000; i++) {
135 static const uint8_t key[16] = {0};
141 uint8_t scratch[16] = {0};
143 for (i = 0; i < 4000000 / 16; i++) {
150 uint8_t scratch[16] = {0};
152 for (i = 0; i < 4000000 / 16; i++) {
static void bench_AES256_encrypt_setup(void *data)
static void print_number(double x)
static void bench_AES192_decrypt(void *data)
static double gettimedouble(void)
static void bench_AES192_encrypt_setup(void *data)
static void bench_AES192_init(void *data)
static void bench_AES256_decrypt(void *data)
static void run_benchmark(char *name, void(*benchmark)(void *), void(*setup)(void *), void(*teardown)(void *), void *data, int count, int iter)
static void bench_AES128_init(void *data)
static void bench_AES128_decrypt(void *data)
static void bench_AES128_encrypt(void *data)
static void bench_AES256_encrypt(void *data)
static void bench_AES128_encrypt_setup(void *data)
static void bench_AES192_encrypt(void *data)
static void bench_AES256_init(void *data)
void AES192_decrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
void AES128_decrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
void AES256_decrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *plain16, const uint8_t *cipher16)
void AES128_init(AES128_ctx *ctx, const uint8_t *key16)
void AES256_encrypt(const AES256_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
void AES192_encrypt(const AES192_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
void AES256_init(AES256_ctx *ctx, const uint8_t *key32)
void AES128_encrypt(const AES128_ctx *ctx, size_t blocks, uint8_t *cipher16, const uint8_t *plain16)
void AES192_init(AES192_ctx *ctx, const uint8_t *key24)