Skip to content
Open
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
2 changes: 1 addition & 1 deletion BIBLIOGRAPHY.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ source code and documentation.
- [mldsa/src/fips202/fips202x4.c](mldsa/src/fips202/fips202x4.c)
- [mldsa/src/poly.c](mldsa/src/poly.c)
- [mldsa/src/poly_kl.c](mldsa/src/poly_kl.c)
- [mldsa/src/polyvec.c](mldsa/src/polyvec.c)
- [mldsa/src/polyvec_lazy.c](mldsa/src/polyvec_lazy.c)
- [mldsa/src/rounding.h](mldsa/src/rounding.h)
- [mldsa/src/sign.c](mldsa/src/sign.c)
- [mldsa/src/sign.h](mldsa/src/sign.h)
Expand Down
6 changes: 5 additions & 1 deletion dev/aarch64_clean/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ static MLD_INLINE int mld_polyz_unpack_19_native(int32_t *r, const uint8_t *buf)
}
#endif /* MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLD_CONFIG_PARAMETER_SET == 65 \
|| MLD_CONFIG_PARAMETER_SET == 87 */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */

#if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)
MLD_MUST_CHECK_RETURN_VALUE
static MLD_INLINE int mld_poly_pointwise_montgomery_native(
int32_t out[MLDSA_N], const int32_t in0[MLDSA_N],
Expand All @@ -213,7 +216,8 @@ static MLD_INLINE int mld_poly_pointwise_montgomery_native(
mld_poly_pointwise_montgomery_asm(out, in0, in1);
return MLD_NATIVE_FUNC_SUCCESS;
}
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API || \
MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST */

#if defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 4
MLD_MUST_CHECK_RETURN_VALUE
Expand Down
6 changes: 5 additions & 1 deletion dev/aarch64_clean/src/arith_native_aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ void mld_polyz_unpack_17_asm(int32_t *r, const uint8_t *buf,
#define mld_polyz_unpack_19_asm MLD_NAMESPACE(polyz_unpack_19_asm)
void mld_polyz_unpack_19_asm(int32_t *r, const uint8_t *buf,
const uint8_t *indices);
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */

#if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)
#define mld_poly_pointwise_montgomery_asm \
MLD_NAMESPACE(poly_pointwise_montgomery_asm)
void mld_poly_pointwise_montgomery_asm(int32_t *r, const int32_t *a,
Expand All @@ -162,7 +165,8 @@ __contract__(
ensures(array_abs_bound(r, 0, MLDSA_N, 8380417))
/* check-magic: on */
);
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API || \
MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST */

#define mld_polyvecl_pointwise_acc_montgomery_l4_asm \
MLD_NAMESPACE(polyvecl_pointwise_acc_montgomery_l4_asm)
Expand Down
8 changes: 5 additions & 3 deletions dev/aarch64_clean/src/pointwise_montgomery.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

#include "../../../common.h"
#if defined(MLD_ARITH_BACKEND_AARCH64) && \
(!defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API)) && \
#if defined(MLD_ARITH_BACKEND_AARCH64) && \
(!defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)) && \
!defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
/* simpasm: header-end */

Expand Down Expand Up @@ -167,4 +168,5 @@ poly_pointwise_montgomery_loop_start:

/* simpasm: footer-start */
#endif /* MLD_ARITH_BACKEND_AARCH64 && (!MLD_CONFIG_NO_SIGN_API || \
!MLD_CONFIG_NO_VERIFY_API) && !MLD_CONFIG_MULTILEVEL_NO_SHARED */
!MLD_CONFIG_NO_VERIFY_API || MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST) \
&& !MLD_CONFIG_MULTILEVEL_NO_SHARED */
6 changes: 5 additions & 1 deletion dev/aarch64_opt/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,10 @@ static MLD_INLINE int mld_polyz_unpack_19_native(int32_t *r, const uint8_t *buf)
}
#endif /* MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLD_CONFIG_PARAMETER_SET == 65 \
|| MLD_CONFIG_PARAMETER_SET == 87 */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */

#if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)
MLD_MUST_CHECK_RETURN_VALUE
static MLD_INLINE int mld_poly_pointwise_montgomery_native(
int32_t out[MLDSA_N], const int32_t in0[MLDSA_N],
Expand All @@ -213,7 +216,8 @@ static MLD_INLINE int mld_poly_pointwise_montgomery_native(
mld_poly_pointwise_montgomery_asm(out, in0, in1);
return MLD_NATIVE_FUNC_SUCCESS;
}
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API || \
MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST */

#if defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 4
MLD_MUST_CHECK_RETURN_VALUE
Expand Down
6 changes: 5 additions & 1 deletion dev/aarch64_opt/src/arith_native_aarch64.h
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,10 @@ void mld_polyz_unpack_17_asm(int32_t *r, const uint8_t *buf,
#define mld_polyz_unpack_19_asm MLD_NAMESPACE(polyz_unpack_19_asm)
void mld_polyz_unpack_19_asm(int32_t *r, const uint8_t *buf,
const uint8_t *indices);
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */

#if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)
#define mld_poly_pointwise_montgomery_asm \
MLD_NAMESPACE(poly_pointwise_montgomery_asm)
void mld_poly_pointwise_montgomery_asm(int32_t *r, const int32_t *a,
Expand All @@ -162,7 +165,8 @@ __contract__(
ensures(array_abs_bound(r, 0, MLDSA_N, 8380417))
/* check-magic: on */
);
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API || \
MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST */

#define mld_polyvecl_pointwise_acc_montgomery_l4_asm \
MLD_NAMESPACE(polyvecl_pointwise_acc_montgomery_l4_asm)
Expand Down
8 changes: 5 additions & 3 deletions dev/aarch64_opt/src/pointwise_montgomery.S
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
*/

#include "../../../common.h"
#if defined(MLD_ARITH_BACKEND_AARCH64) && \
(!defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API)) && \
#if defined(MLD_ARITH_BACKEND_AARCH64) && \
(!defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)) && \
!defined(MLD_CONFIG_MULTILEVEL_NO_SHARED)
/* simpasm: header-end */

Expand Down Expand Up @@ -167,4 +168,5 @@ poly_pointwise_montgomery_loop_start:

/* simpasm: footer-start */
#endif /* MLD_ARITH_BACKEND_AARCH64 && (!MLD_CONFIG_NO_SIGN_API || \
!MLD_CONFIG_NO_VERIFY_API) && !MLD_CONFIG_MULTILEVEL_NO_SHARED */
!MLD_CONFIG_NO_VERIFY_API || MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST) \
&& !MLD_CONFIG_MULTILEVEL_NO_SHARED */
6 changes: 5 additions & 1 deletion dev/x86_64/meta.h
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,10 @@ static MLD_INLINE int mld_polyz_unpack_19_native(int32_t *r, const uint8_t *a)
}
#endif /* MLD_CONFIG_MULTILEVEL_WITH_SHARED || MLD_CONFIG_PARAMETER_SET == 65 \
|| MLD_CONFIG_PARAMETER_SET == 87 */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */

#if !defined(MLD_CONFIG_NO_SIGN_API) || !defined(MLD_CONFIG_NO_VERIFY_API) || \
defined(MLD_CONFIG_REDUCE_RAM) || defined(MLD_UNIT_TEST)
MLD_MUST_CHECK_RETURN_VALUE
static MLD_INLINE int mld_poly_pointwise_montgomery_native(
int32_t c[MLDSA_N], const int32_t a[MLDSA_N], const int32_t b[MLDSA_N])
Expand All @@ -269,7 +272,8 @@ static MLD_INLINE int mld_poly_pointwise_montgomery_native(
mld_pointwise_avx2(c, a, b, mld_qdata);
return MLD_NATIVE_FUNC_SUCCESS;
}
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API */
#endif /* !MLD_CONFIG_NO_SIGN_API || !MLD_CONFIG_NO_VERIFY_API || \
MLD_CONFIG_REDUCE_RAM || MLD_UNIT_TEST */

#if defined(MLD_CONFIG_MULTILEVEL_WITH_SHARED) || MLDSA_L == 4
MLD_MUST_CHECK_RETURN_VALUE
Expand Down
1 change: 1 addition & 0 deletions examples/custom_backend/mldsa_native/src/polyvec_lazy.c
19 changes: 11 additions & 8 deletions integration/liboqs/ML-DSA-44_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/packing.c mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c
mldsa/src/poly.h mldsa/src/poly_kl.c mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/polyvec_lazy.c mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h
mldsa/src/rounding.h mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h
mldsa/src/zetas.inc
- name: x86_64
version: FIPS204
folder_name: .
Expand All @@ -51,9 +52,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/x86_64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/x86_64
supported_platforms:
- architecture: x86_64
operating_systems:
Expand All @@ -77,9 +79,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/aarch64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/aarch64
supported_platforms:
- architecture: arm_8
operating_systems:
Expand Down
19 changes: 11 additions & 8 deletions integration/liboqs/ML-DSA-65_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/packing.c mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c
mldsa/src/poly.h mldsa/src/poly_kl.c mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/polyvec_lazy.c mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h
mldsa/src/rounding.h mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h
mldsa/src/zetas.inc
- name: x86_64
version: FIPS204
folder_name: .
Expand All @@ -51,9 +52,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/x86_64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/x86_64
supported_platforms:
- architecture: x86_64
operating_systems:
Expand All @@ -77,9 +79,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/aarch64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/aarch64
supported_platforms:
- architecture: arm_8
operating_systems:
Expand Down
19 changes: 11 additions & 8 deletions integration/liboqs/ML-DSA-87_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,9 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/packing.c mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c
mldsa/src/poly.h mldsa/src/poly_kl.c mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/polyvec_lazy.c mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h
mldsa/src/rounding.h mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h
mldsa/src/zetas.inc
- name: x86_64
version: FIPS204
folder_name: .
Expand All @@ -51,9 +52,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/x86_64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/x86_64
supported_platforms:
- architecture: x86_64
operating_systems:
Expand All @@ -77,9 +79,10 @@ implementations:
mldsa/src/cbmc.h mldsa/src/common.h mldsa/src/ct.c mldsa/src/ct.h mldsa/src/debug.c
mldsa/src/debug.h mldsa/src/native/api.h mldsa/src/native/meta.h mldsa/src/packing.c
mldsa/src/packing.h mldsa/src/params.h mldsa/src/poly.c mldsa/src/poly.h mldsa/src/poly_kl.c
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.h
mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h mldsa/src/sign.c
mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc mldsa/src/native/aarch64
mldsa/src/poly_kl.h mldsa/src/polyvec.c mldsa/src/polyvec.h mldsa/src/polyvec_lazy.c
mldsa/src/polyvec_lazy.h mldsa/src/randombytes.h mldsa/src/reduce.h mldsa/src/rounding.h
mldsa/src/sign.c mldsa/src/sign.h mldsa/src/symmetric.h mldsa/src/sys.h mldsa/src/zetas.inc
mldsa/src/native/aarch64
supported_platforms:
- architecture: arm_8
operating_systems:
Expand Down
3 changes: 2 additions & 1 deletion integration/opentitan/add_polyvec_lazy.patch
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,11 @@ diff --git a/third_party/mldsa_native/BUILD.mldsa_native.bazel b/third_party/mld
index 8a63d09..1c576c2 100644
--- a/third_party/mldsa_native/BUILD.mldsa_native.bazel
+++ b/third_party/mldsa_native/BUILD.mldsa_native.bazel
@@ -26,6 +26,7 @@ cc_library(
@@ -26,6 +26,8 @@ cc_library(
"mldsa/src/poly_kl.h",
"mldsa/src/polyvec.c",
"mldsa/src/polyvec.h",
+ "mldsa/src/polyvec_lazy.c",
+ "mldsa/src/polyvec_lazy.h",
"mldsa/src/reduce.h",
"mldsa/src/rounding.h",
Expand Down
29 changes: 16 additions & 13 deletions integration/opentitan/reduce_alloc.patch
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ index be11f20..0000000 100644
+++ b/sw/device/lib/crypto/include/mldsa.h
@@ -41,15 +41,15 @@ enum {
kOtcryptoMldsa87SeedBytes = 32,

// Work buffer sizes in 32-bit words
- kOtcryptoMldsa44WorkBufferKeypairWords = 32992 / sizeof(uint32_t),
- kOtcryptoMldsa44WorkBufferSignWords = 32448 / sizeof(uint32_t),
+ kOtcryptoMldsa44WorkBufferKeypairWords = 16672 / sizeof(uint32_t),
+ kOtcryptoMldsa44WorkBufferSignWords = 20256 / sizeof(uint32_t),
kOtcryptoMldsa44WorkBufferVerifyWords = 22464 / sizeof(uint32_t),

- kOtcryptoMldsa44WorkBufferVerifyWords = 22464 / sizeof(uint32_t),
+ kOtcryptoMldsa44WorkBufferKeypairWords = 14624 / sizeof(uint32_t),
+ kOtcryptoMldsa44WorkBufferSignWords = 18208 / sizeof(uint32_t),
+ kOtcryptoMldsa44WorkBufferVerifyWords = 20416 / sizeof(uint32_t),

- kOtcryptoMldsa65WorkBufferKeypairWords = 46304 / sizeof(uint32_t),
- kOtcryptoMldsa65WorkBufferSignWords = 44768 / sizeof(uint32_t),
+ kOtcryptoMldsa65WorkBufferKeypairWords = 23840 / sizeof(uint32_t),
+ kOtcryptoMldsa65WorkBufferSignWords = 26432 / sizeof(uint32_t),
kOtcryptoMldsa65WorkBufferVerifyWords = 30720 / sizeof(uint32_t),

- kOtcryptoMldsa65WorkBufferVerifyWords = 30720 / sizeof(uint32_t),
+ kOtcryptoMldsa65WorkBufferKeypairWords = 20768 / sizeof(uint32_t),
+ kOtcryptoMldsa65WorkBufferSignWords = 23360 / sizeof(uint32_t),
+ kOtcryptoMldsa65WorkBufferVerifyWords = 27648 / sizeof(uint32_t),

- kOtcryptoMldsa87WorkBufferKeypairWords = 62688 / sizeof(uint32_t),
- kOtcryptoMldsa87WorkBufferSignWords = 59104 / sizeof(uint32_t),
+ kOtcryptoMldsa87WorkBufferKeypairWords = 32032 / sizeof(uint32_t),
+ kOtcryptoMldsa87WorkBufferSignWords = 34624 / sizeof(uint32_t),
kOtcryptoMldsa87WorkBufferVerifyWords = 41216 / sizeof(uint32_t),
- kOtcryptoMldsa87WorkBufferVerifyWords = 41216 / sizeof(uint32_t),
+ kOtcryptoMldsa87WorkBufferKeypairWords = 26912 / sizeof(uint32_t),
+ kOtcryptoMldsa87WorkBufferSignWords = 29504 / sizeof(uint32_t),
+ kOtcryptoMldsa87WorkBufferVerifyWords = 36096 / sizeof(uint32_t),
};

15 changes: 11 additions & 4 deletions mldsa/mldsa_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
#include "src/poly.c"
#include "src/poly_kl.c"
#include "src/polyvec.c"
#include "src/polyvec_lazy.c"
#include "src/sign.c"

#if !defined(MLD_CONFIG_FIPS202_CUSTOM_HEADER)
Expand Down Expand Up @@ -312,10 +313,6 @@
#undef mld_polyz_unpack
/* mldsa/src/polyvec.h */
#undef MLD_POLYVEC_H
#undef mld_polymat
#undef mld_polymat_get_row
#undef mld_polyvec_matrix_expand
#undef mld_polyvec_matrix_pointwise_montgomery
#undef mld_polyveck
#undef mld_polyveck_add
#undef mld_polyveck_caddq
Expand Down Expand Up @@ -344,6 +341,16 @@
#undef mld_polyvecl_unpack_z
/* mldsa/src/polyvec_lazy.h */
#undef MLD_POLYVEC_LAZY_H
#undef mld_poly_permute_bitrev_to_custom_optional
#undef mld_polymat
#undef mld_polymat_eager
#undef mld_polymat_lazy
#undef mld_polyvec_matrix_expand
#undef mld_polyvec_matrix_expand_eager
#undef mld_polyvec_matrix_expand_lazy
#undef mld_polyvec_matrix_pointwise_montgomery
#undef mld_polyvec_matrix_pointwise_montgomery_eager
#undef mld_polyvec_matrix_pointwise_montgomery_lazy
#undef mld_sk_s1hat
#undef mld_sk_s1hat_eager
#undef mld_sk_s1hat_get_poly
Expand Down
Loading
Loading