10 return tv.tv_usec * 0.000001 +
tv.tv_sec;
27 void (*setup)(
void *),
void (*
teardown)(
void *),
33 for (i = 0; i <
count; i++) {
52 printf(
"%s: min ",
name);
64 for (i = 0; i < 50000; i++) {
71 static const uint8_t key[16] = {0};
79 for (i = 0; i < 4000000 / 16; i++) {
88 for (i = 0; i < 4000000 / 16; i++) {
96 for (i = 0; i < 50000; i++) {
103 static const uint8_t key[16] = {0};
111 for (i = 0; i < 4000000 / 16; i++) {
120 for (i = 0; i < 4000000 / 16; i++) {
128 for (i = 0; i < 50000; i++) {
135 static const uint8_t key[16] = {0};
143 for (i = 0; i < 4000000 / 16; i++) {
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)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...