1
1
mirror of https://github.com/henrydcase/pqc.git synced 2024-11-22 23:48:58 +00:00
pqcrypto/test/bench/kyber.cc

25 lines
670 B
C++
Raw Normal View History

2021-04-22 21:41:40 +01:00
#include <array>
#include <stdint.h>
#include <utility>
#include <gtest/gtest.h>
#include <benchmark/benchmark.h>
#include <benchmark/../../src/statistics.h>
#include <benchmark/../../src/cycleclock.h>
auto cpucycle = [](benchmark::State &st, int64_t cycles) {
st.counters["CPU cycles: mean"] = benchmark::Counter(
cycles, benchmark::Counter::kAvgIterations | benchmark::Counter::kResultNoFormat);
};
static void BenchKyberMatK2(benchmark::State &st) {
int64_t t, total = 0;
for (auto _ : st) {
t = benchmark::cycleclock::Now();
total += benchmark::cycleclock::Now() - t;
}
cpucycle(st, total);
}
BENCHMARK(BenchKyberMatK2);