diff --git a/test/bench/kyber.cc b/test/bench/kyber.cc index 06605144..2fba7b29 100644 --- a/test/bench/kyber.cc +++ b/test/bench/kyber.cc @@ -6,6 +6,11 @@ #include #include #include +#include "kem/kyber/kyber512/avx2/polyvec.h" + +extern "C" { + #include "kem/kyber/kyber512/avx2/indcpa.h" +} auto cpucycle = [](benchmark::State &st, int64_t cycles) { st.counters["CPU cycles: mean"] = benchmark::Counter( @@ -14,9 +19,13 @@ auto cpucycle = [](benchmark::State &st, int64_t cycles) { static void BenchKyberMatK2(benchmark::State &st) { int64_t t, total = 0; + polyvec a[KYBER_K]; + uint8_t seed[32]; for (auto _ : st) { t = benchmark::cycleclock::Now(); + PQCLEAN_KYBER512_AVX2_gen_matrix(a, seed, 0); total += benchmark::cycleclock::Now() - t; + benchmark::DoNotOptimize(a); } cpucycle(st, total); }