Skip to content

Commit d42cabe

Browse files
committed
Add polyvecl_pointwise_acc_montgomery to component benchmarks
Signed-off-by: Matthias J. Kannwischer <[email protected]>
1 parent c2e3863 commit d42cabe

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

test/bench_components_mldsa.c

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <string.h>
1111
#include "../mldsa/ntt.h"
1212
#include "../mldsa/poly.h"
13+
#include "../mldsa/polyvec.h"
1314
#include "../mldsa/randombytes.h"
1415
#include "hal.h"
1516

@@ -26,6 +27,8 @@ static int cmp_uint64_t(const void *a, const void *b)
2627
for (i = 0; i < NTESTS; i++) \
2728
{ \
2829
randombytes((uint8_t *)data0, sizeof(data0)); \
30+
randombytes((uint8_t *)data1, sizeof(data1)); \
31+
randombytes((uint8_t *)data2, sizeof(data2)); \
2932
for (j = 0; j < NWARMUP; j++) \
3033
{ \
3134
code; \
@@ -44,15 +47,20 @@ static int cmp_uint64_t(const void *a, const void *b)
4447

4548
static int bench(void)
4649
{
47-
int32_t data0[256];
50+
MLD_ALIGN int32_t data0[256];
51+
MLD_ALIGN int32_t data1[MLDSA_K * 256];
52+
MLD_ALIGN int32_t data2[MLDSA_K * 256];
4853
uint64_t cyc[NTESTS];
4954
unsigned i, j;
5055
uint64_t t0, t1;
5156

52-
/* ntt */
5357
BENCH("poly_ntt", poly_ntt((poly *)data0))
58+
5459
BENCH("poly_invntt_tomont", poly_invntt_tomont((poly *)data0))
5560

61+
BENCH("polyvecl_pointwise_acc_montgomery",
62+
polyvecl_pointwise_acc_montgomery(
63+
(poly *)data0, (const polyvecl *)data1, (const polyvecl *)data2))
5664
return 0;
5765
}
5866

0 commit comments

Comments
 (0)