Skip to content

Commit 268116d

Browse files
committed
config.h: Add missing MLK_CONFIG_NO_ASM_VALUE_BARRIER
- This commit add missing MLK_CONFIG_NO_ASM_VALUE_BARRIER and remove following from autogen: "MLK_CONFIG_NO_ASM_VALUE_BARRIER", # TODO: Add to config? - Also, this commit added the missing citation for FIPS203 in config.h Signed-off-by: willieyz <willie.zhao@chelpis.com>
1 parent 1601215 commit 268116d

25 files changed

+529
-47
lines changed

BIBLIOGRAPHY.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,20 @@ source code and documentation.
8181
* URL: https://csrc.nist.gov/pubs/fips/203/final
8282
* Referenced from:
8383
- [README.md](README.md)
84+
- [examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h](examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h)
85+
- [examples/custom_backend/mlkem_native/custom_config.h](examples/custom_backend/mlkem_native/custom_config.h)
86+
- [examples/monolithic_build/config_1024.h](examples/monolithic_build/config_1024.h)
87+
- [examples/monolithic_build/config_512.h](examples/monolithic_build/config_512.h)
88+
- [examples/monolithic_build/config_768.h](examples/monolithic_build/config_768.h)
89+
- [examples/monolithic_build_multilevel/multilevel_config.h](examples/monolithic_build_multilevel/multilevel_config.h)
90+
- [examples/monolithic_build_multilevel_native/multilevel_config.h](examples/monolithic_build_multilevel_native/multilevel_config.h)
91+
- [examples/monolithic_build_native/config_1024.h](examples/monolithic_build_native/config_1024.h)
92+
- [examples/monolithic_build_native/config_512.h](examples/monolithic_build_native/config_512.h)
93+
- [examples/monolithic_build_native/config_768.h](examples/monolithic_build_native/config_768.h)
8494
- [mlkem/mlkem_native.h](mlkem/mlkem_native.h)
8595
- [mlkem/src/compress.c](mlkem/src/compress.c)
8696
- [mlkem/src/compress.h](mlkem/src/compress.h)
97+
- [mlkem/src/config.h](mlkem/src/config.h)
8798
- [mlkem/src/fips202/fips202.c](mlkem/src/fips202/fips202.c)
8899
- [mlkem/src/fips202/fips202x4.c](mlkem/src/fips202/fips202x4.c)
89100
- [mlkem/src/indcpa.c](mlkem/src/indcpa.c)
@@ -97,6 +108,18 @@ source code and documentation.
97108
- [mlkem/src/sampling.h](mlkem/src/sampling.h)
98109
- [mlkem/src/symmetric.h](mlkem/src/symmetric.h)
99110
- [mlkem/src/verify.h](mlkem/src/verify.h)
111+
- [test/break_pct_config.h](test/break_pct_config.h)
112+
- [test/custom_memcpy_config.h](test/custom_memcpy_config.h)
113+
- [test/custom_memset_config.h](test/custom_memset_config.h)
114+
- [test/custom_native_capability_config_0.h](test/custom_native_capability_config_0.h)
115+
- [test/custom_native_capability_config_1.h](test/custom_native_capability_config_1.h)
116+
- [test/custom_native_capability_config_CPUID_AVX2.h](test/custom_native_capability_config_CPUID_AVX2.h)
117+
- [test/custom_native_capability_config_ID_AA64PFR1_EL1.h](test/custom_native_capability_config_ID_AA64PFR1_EL1.h)
118+
- [test/custom_randombytes_config.h](test/custom_randombytes_config.h)
119+
- [test/custom_stdlib_config.h](test/custom_stdlib_config.h)
120+
- [test/custom_zeroize_config.h](test/custom_zeroize_config.h)
121+
- [test/no_asm_config.h](test/no_asm_config.h)
122+
- [test/serial_fips202_config.h](test/serial_fips202_config.h)
100123

101124
### `HYBRID`
102125

examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -266,8 +271,9 @@
266271
/******************************************************************************
267272
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
268273
*
269-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
270-
* intermediate stack buffers before returning from function calls.
274+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
275+
* zeroizes intermediate stack buffers before returning from
276+
* function calls.
271277
*
272278
* Set this option and define `mlk_zeroize` if you want to
273279
* use a custom method to zeroize intermediate stack buffers.
@@ -468,6 +474,20 @@
468474
*****************************************************************************/
469475
/* #define MLK_CONFIG_NO_ASM */
470476

477+
/******************************************************************************
478+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
479+
*
480+
* Description: If this option is set, mlkem-native will be built without
481+
* use of native code or inline assembly for value barriers.
482+
*
483+
* By default, inline assembly (if available) is used to implement
484+
* value barriers.
485+
* Without inline assembly, mlkem-native will use a global volatile
486+
* 'opt blocker' instead; see ct.h.
487+
*
488+
*****************************************************************************/
489+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
490+
471491
/******************************************************************************
472492
* Name: MLK_CONFIG_NO_RANDOMIZED_API
473493
*

examples/custom_backend/mlkem_native/custom_config.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -262,8 +267,9 @@
262267
/******************************************************************************
263268
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
264269
*
265-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
266-
* intermediate stack buffers before returning from function calls.
270+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
271+
* zeroizes intermediate stack buffers before returning from
272+
* function calls.
267273
*
268274
* Set this option and define `mlk_zeroize` if you want to
269275
* use a custom method to zeroize intermediate stack buffers.
@@ -464,6 +470,20 @@
464470
*****************************************************************************/
465471
/* #define MLK_CONFIG_NO_ASM */
466472

473+
/******************************************************************************
474+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
475+
*
476+
* Description: If this option is set, mlkem-native will be built without
477+
* use of native code or inline assembly for value barriers.
478+
*
479+
* By default, inline assembly (if available) is used to implement
480+
* value barriers.
481+
* Without inline assembly, mlkem-native will use a global volatile
482+
* 'opt blocker' instead; see ct.h.
483+
*
484+
*****************************************************************************/
485+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
486+
467487
/******************************************************************************
468488
* Name: MLK_CONFIG_NO_RANDOMIZED_API
469489
*

examples/monolithic_build/config_1024.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -263,8 +268,9 @@
263268
/******************************************************************************
264269
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
265270
*
266-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
267-
* intermediate stack buffers before returning from function calls.
271+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
272+
* zeroizes intermediate stack buffers before returning from
273+
* function calls.
268274
*
269275
* Set this option and define `mlk_zeroize` if you want to
270276
* use a custom method to zeroize intermediate stack buffers.
@@ -465,6 +471,20 @@
465471
*****************************************************************************/
466472
/* #define MLK_CONFIG_NO_ASM */
467473

474+
/******************************************************************************
475+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
476+
*
477+
* Description: If this option is set, mlkem-native will be built without
478+
* use of native code or inline assembly for value barriers.
479+
*
480+
* By default, inline assembly (if available) is used to implement
481+
* value barriers.
482+
* Without inline assembly, mlkem-native will use a global volatile
483+
* 'opt blocker' instead; see ct.h.
484+
*
485+
*****************************************************************************/
486+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
487+
468488
/******************************************************************************
469489
* Name: MLK_CONFIG_NO_RANDOMIZED_API
470490
*

examples/monolithic_build/config_512.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -263,8 +268,9 @@
263268
/******************************************************************************
264269
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
265270
*
266-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
267-
* intermediate stack buffers before returning from function calls.
271+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
272+
* zeroizes intermediate stack buffers before returning from
273+
* function calls.
268274
*
269275
* Set this option and define `mlk_zeroize` if you want to
270276
* use a custom method to zeroize intermediate stack buffers.
@@ -465,6 +471,20 @@
465471
*****************************************************************************/
466472
/* #define MLK_CONFIG_NO_ASM */
467473

474+
/******************************************************************************
475+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
476+
*
477+
* Description: If this option is set, mlkem-native will be built without
478+
* use of native code or inline assembly for value barriers.
479+
*
480+
* By default, inline assembly (if available) is used to implement
481+
* value barriers.
482+
* Without inline assembly, mlkem-native will use a global volatile
483+
* 'opt blocker' instead; see ct.h.
484+
*
485+
*****************************************************************************/
486+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
487+
468488
/******************************************************************************
469489
* Name: MLK_CONFIG_NO_RANDOMIZED_API
470490
*

examples/monolithic_build/config_768.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -263,8 +268,9 @@
263268
/******************************************************************************
264269
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
265270
*
266-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
267-
* intermediate stack buffers before returning from function calls.
271+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
272+
* zeroizes intermediate stack buffers before returning from
273+
* function calls.
268274
*
269275
* Set this option and define `mlk_zeroize` if you want to
270276
* use a custom method to zeroize intermediate stack buffers.
@@ -465,6 +471,20 @@
465471
*****************************************************************************/
466472
/* #define MLK_CONFIG_NO_ASM */
467473

474+
/******************************************************************************
475+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
476+
*
477+
* Description: If this option is set, mlkem-native will be built without
478+
* use of native code or inline assembly for value barriers.
479+
*
480+
* By default, inline assembly (if available) is used to implement
481+
* value barriers.
482+
* Without inline assembly, mlkem-native will use a global volatile
483+
* 'opt blocker' instead; see ct.h.
484+
*
485+
*****************************************************************************/
486+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
487+
468488
/******************************************************************************
469489
* Name: MLK_CONFIG_NO_RANDOMIZED_API
470490
*

examples/monolithic_build_multilevel/multilevel_config.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -265,8 +270,9 @@
265270
/******************************************************************************
266271
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
267272
*
268-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
269-
* intermediate stack buffers before returning from function calls.
273+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
274+
* zeroizes intermediate stack buffers before returning from
275+
* function calls.
270276
*
271277
* Set this option and define `mlk_zeroize` if you want to
272278
* use a custom method to zeroize intermediate stack buffers.
@@ -467,6 +473,20 @@
467473
*****************************************************************************/
468474
/* #define MLK_CONFIG_NO_ASM */
469475

476+
/******************************************************************************
477+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
478+
*
479+
* Description: If this option is set, mlkem-native will be built without
480+
* use of native code or inline assembly for value barriers.
481+
*
482+
* By default, inline assembly (if available) is used to implement
483+
* value barriers.
484+
* Without inline assembly, mlkem-native will use a global volatile
485+
* 'opt blocker' instead; see ct.h.
486+
*
487+
*****************************************************************************/
488+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
489+
470490
/******************************************************************************
471491
* Name: MLK_CONFIG_NO_RANDOMIZED_API
472492
*

examples/monolithic_build_multilevel_native/multilevel_config.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -265,8 +270,9 @@
265270
/******************************************************************************
266271
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
267272
*
268-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
269-
* intermediate stack buffers before returning from function calls.
273+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
274+
* zeroizes intermediate stack buffers before returning from
275+
* function calls.
270276
*
271277
* Set this option and define `mlk_zeroize` if you want to
272278
* use a custom method to zeroize intermediate stack buffers.
@@ -474,6 +480,20 @@ static MLK_INLINE void mlk_randombytes(uint8_t *ptr, size_t len)
474480
*****************************************************************************/
475481
/* #define MLK_CONFIG_NO_ASM */
476482

483+
/******************************************************************************
484+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
485+
*
486+
* Description: If this option is set, mlkem-native will be built without
487+
* use of native code or inline assembly for value barriers.
488+
*
489+
* By default, inline assembly (if available) is used to implement
490+
* value barriers.
491+
* Without inline assembly, mlkem-native will use a global volatile
492+
* 'opt blocker' instead; see ct.h.
493+
*
494+
*****************************************************************************/
495+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
496+
477497
/******************************************************************************
478498
* Name: MLK_CONFIG_NO_RANDOMIZED_API
479499
*

examples/monolithic_build_native/config_1024.h

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@
1111
* Validation Program
1212
* National Institute of Standards and Technology
1313
* https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements
14+
*
15+
* - [FIPS203]
16+
* FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard
17+
* National Institute of Standards and Technology
18+
* https://csrc.nist.gov/pubs/fips/203/final
1419
*/
1520

1621
/*
@@ -264,8 +269,9 @@
264269
/******************************************************************************
265270
* Name: MLK_CONFIG_CUSTOM_ZEROIZE
266271
*
267-
* Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes
268-
* intermediate stack buffers before returning from function calls.
272+
* Description: In compliance with @[FIPS203, Section 3.3], mlkem-native
273+
* zeroizes intermediate stack buffers before returning from
274+
* function calls.
269275
*
270276
* Set this option and define `mlk_zeroize` if you want to
271277
* use a custom method to zeroize intermediate stack buffers.
@@ -466,6 +472,20 @@
466472
*****************************************************************************/
467473
/* #define MLK_CONFIG_NO_ASM */
468474

475+
/******************************************************************************
476+
* Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER
477+
*
478+
* Description: If this option is set, mlkem-native will be built without
479+
* use of native code or inline assembly for value barriers.
480+
*
481+
* By default, inline assembly (if available) is used to implement
482+
* value barriers.
483+
* Without inline assembly, mlkem-native will use a global volatile
484+
* 'opt blocker' instead; see ct.h.
485+
*
486+
*****************************************************************************/
487+
/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */
488+
469489
/******************************************************************************
470490
* Name: MLK_CONFIG_NO_RANDOMIZED_API
471491
*

0 commit comments

Comments
 (0)