Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add fast, layer-merged forward and inverse NTT code. #610

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion examples/bring_your_own_fips202/mlkem_native/zetas.c

This file was deleted.

1 change: 1 addition & 0 deletions examples/bring_your_own_fips202/mlkem_native/zetas.i
1 change: 0 additions & 1 deletion examples/custom_backend/mlkem_native/mlkem/zetas.c

This file was deleted.

1 change: 1 addition & 0 deletions examples/custom_backend/mlkem_native/mlkem/zetas.i
118 changes: 101 additions & 17 deletions examples/monolithic_build/mlkem_native_monobuild.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include "mlkem/polyvec.c"
#include "mlkem/rej_uniform.c"
#include "mlkem/verify.c"
#include "mlkem/zetas.c"


/*
Expand Down Expand Up @@ -1144,24 +1143,109 @@
#undef KeccakF1600x4_StateXORBytes
#endif

/* mlkem/ntt.c */
#if defined(MONT_F)
#undef MONT_F
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND1)
#undef NTT_BOUND1
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND2)
#undef NTT_BOUND2
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND4)
#undef NTT_BOUND4
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND6)
#undef NTT_BOUND6
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND7)
#undef NTT_BOUND7
#endif

/* mlkem/ntt.c */
#if defined(NTT_BOUND8)
#undef NTT_BOUND8
#endif

/* mlkem/ntt.c */
#if defined(ct_butterfly)
#undef ct_butterfly
#endif

/* mlkem/ntt.c */
#if defined(empty_cu_ntt)
#undef empty_cu_ntt
#endif

/* mlkem/ntt.c */
#if defined(invntt_layer)
#undef invntt_layer
#if defined(gs_butterfly_defer)
#undef gs_butterfly_defer
#endif

/* mlkem/ntt.c */
#if defined(gs_butterfly_reduce)
#undef gs_butterfly_reduce
#endif

/* mlkem/ntt.c */
#if defined(invntt_layer321)
#undef invntt_layer321
#endif

/* mlkem/ntt.c */
#if defined(invntt_layer54)
#undef invntt_layer54
#endif

/* mlkem/ntt.c */
#if defined(invntt_layer54_butterfly)
#undef invntt_layer54_butterfly
#endif

/* mlkem/ntt.c */
#if defined(invntt_layer6)
#undef invntt_layer6
#endif

/* mlkem/ntt.c */
#if defined(ntt_butterfly_block)
#undef ntt_butterfly_block
#if defined(invntt_layer7_invert)
#undef invntt_layer7_invert
#endif

/* mlkem/ntt.c */
#if defined(ntt_layer)
#undef ntt_layer
#if defined(ntt_layer123)
#undef ntt_layer123
#endif

/* mlkem/ntt.c */
#if defined(ntt_layer45)
#undef ntt_layer45
#endif

/* mlkem/ntt.c */
#if defined(ntt_layer45_butterfly)
#undef ntt_layer45_butterfly
#endif

/* mlkem/ntt.c */
#if defined(ntt_layer6)
#undef ntt_layer6
#endif

/* mlkem/ntt.c */
#if defined(ntt_layer7)
#undef ntt_layer7
#endif

/* mlkem/ntt.h */
Expand All @@ -1170,8 +1254,8 @@
#endif

/* mlkem/ntt.h */
#if defined(basemul_cached)
#undef basemul_cached
#if defined(layer7_zetas)
#undef layer7_zetas
#endif

/* mlkem/ntt.h */
Expand All @@ -1184,9 +1268,9 @@
#undef poly_ntt
#endif

/* mlkem/ntt.h */
#if defined(zetas)
#undef zetas
/* mlkem/poly.c */
#if defined(basemul_cached)
#undef basemul_cached
#endif

/* mlkem/poly.c */
Expand Down Expand Up @@ -1544,6 +1628,11 @@
#undef MLKEM_NATIVE_SYS_H
#endif

/* mlkem/sys.h */
#if defined(NO_INLINE)
#undef NO_INLINE
#endif

/* mlkem/sys.h */
#if defined(RESTRICT)
#undef RESTRICT
Expand Down Expand Up @@ -1654,9 +1743,4 @@
#undef value_barrier_u8
#endif

/* mlkem/zetas.c */
#if defined(empty_cu_zetas)
#undef empty_cu_zetas
#endif

#endif /* MLKEM_NATIVE_MONOBUILD_KEEP_SHARED_HEADERS */
Loading
Loading