diff --git a/BIBLIOGRAPHY.md b/BIBLIOGRAPHY.md index 090fa7b4a3..30c0f61350 100644 --- a/BIBLIOGRAPHY.md +++ b/BIBLIOGRAPHY.md @@ -81,9 +81,20 @@ source code and documentation. * URL: https://csrc.nist.gov/pubs/fips/203/final * Referenced from: - [README.md](README.md) + - [examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h](examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h) + - [examples/custom_backend/mlkem_native/custom_config.h](examples/custom_backend/mlkem_native/custom_config.h) + - [examples/monolithic_build/config_1024.h](examples/monolithic_build/config_1024.h) + - [examples/monolithic_build/config_512.h](examples/monolithic_build/config_512.h) + - [examples/monolithic_build/config_768.h](examples/monolithic_build/config_768.h) + - [examples/monolithic_build_multilevel/multilevel_config.h](examples/monolithic_build_multilevel/multilevel_config.h) + - [examples/monolithic_build_multilevel_native/multilevel_config.h](examples/monolithic_build_multilevel_native/multilevel_config.h) + - [examples/monolithic_build_native/config_1024.h](examples/monolithic_build_native/config_1024.h) + - [examples/monolithic_build_native/config_512.h](examples/monolithic_build_native/config_512.h) + - [examples/monolithic_build_native/config_768.h](examples/monolithic_build_native/config_768.h) - [mlkem/mlkem_native.h](mlkem/mlkem_native.h) - [mlkem/src/compress.c](mlkem/src/compress.c) - [mlkem/src/compress.h](mlkem/src/compress.h) + - [mlkem/src/config.h](mlkem/src/config.h) - [mlkem/src/fips202/fips202.c](mlkem/src/fips202/fips202.c) - [mlkem/src/fips202/fips202x4.c](mlkem/src/fips202/fips202x4.c) - [mlkem/src/indcpa.c](mlkem/src/indcpa.c) @@ -97,6 +108,18 @@ source code and documentation. - [mlkem/src/sampling.h](mlkem/src/sampling.h) - [mlkem/src/symmetric.h](mlkem/src/symmetric.h) - [mlkem/src/verify.h](mlkem/src/verify.h) + - [test/break_pct_config.h](test/break_pct_config.h) + - [test/custom_memcpy_config.h](test/custom_memcpy_config.h) + - [test/custom_memset_config.h](test/custom_memset_config.h) + - [test/custom_native_capability_config_0.h](test/custom_native_capability_config_0.h) + - [test/custom_native_capability_config_1.h](test/custom_native_capability_config_1.h) + - [test/custom_native_capability_config_CPUID_AVX2.h](test/custom_native_capability_config_CPUID_AVX2.h) + - [test/custom_native_capability_config_ID_AA64PFR1_EL1.h](test/custom_native_capability_config_ID_AA64PFR1_EL1.h) + - [test/custom_randombytes_config.h](test/custom_randombytes_config.h) + - [test/custom_stdlib_config.h](test/custom_stdlib_config.h) + - [test/custom_zeroize_config.h](test/custom_zeroize_config.h) + - [test/no_asm_config.h](test/no_asm_config.h) + - [test/serial_fips202_config.h](test/serial_fips202_config.h) ### `HYBRID` diff --git a/examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h b/examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h index 0358a41a01..a037f0b02b 100644 --- a/examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h +++ b/examples/basic_deterministic/mlkem_native/custom_no_randomized_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -468,6 +474,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/custom_backend/mlkem_native/custom_config.h b/examples/custom_backend/mlkem_native/custom_config.h index 090a6f94fc..85b9f9202e 100644 --- a/examples/custom_backend/mlkem_native/custom_config.h +++ b/examples/custom_backend/mlkem_native/custom_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -262,8 +267,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -464,6 +470,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build/config_1024.h b/examples/monolithic_build/config_1024.h index fd6e6f4adb..0c6b62efef 100644 --- a/examples/monolithic_build/config_1024.h +++ b/examples/monolithic_build/config_1024.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -263,8 +268,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -465,6 +471,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build/config_512.h b/examples/monolithic_build/config_512.h index 27f92e5b33..66a688cab4 100644 --- a/examples/monolithic_build/config_512.h +++ b/examples/monolithic_build/config_512.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -263,8 +268,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -465,6 +471,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build/config_768.h b/examples/monolithic_build/config_768.h index 10b65ee677..24115ca5b4 100644 --- a/examples/monolithic_build/config_768.h +++ b/examples/monolithic_build/config_768.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -263,8 +268,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -465,6 +471,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build_multilevel/multilevel_config.h b/examples/monolithic_build_multilevel/multilevel_config.h index 853b3079bd..0647d3b2ef 100644 --- a/examples/monolithic_build_multilevel/multilevel_config.h +++ b/examples/monolithic_build_multilevel/multilevel_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -467,6 +473,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build_multilevel_native/multilevel_config.h b/examples/monolithic_build_multilevel_native/multilevel_config.h index 878a88119f..f56dfa339f 100644 --- a/examples/monolithic_build_multilevel_native/multilevel_config.h +++ b/examples/monolithic_build_multilevel_native/multilevel_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * 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) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build_native/config_1024.h b/examples/monolithic_build_native/config_1024.h index a6d5ec22b0..a95e6e2d8b 100644 --- a/examples/monolithic_build_native/config_1024.h +++ b/examples/monolithic_build_native/config_1024.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -264,8 +269,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -466,6 +472,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build_native/config_512.h b/examples/monolithic_build_native/config_512.h index 61526e5717..a98f43cac0 100644 --- a/examples/monolithic_build_native/config_512.h +++ b/examples/monolithic_build_native/config_512.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -264,8 +269,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -466,6 +472,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/examples/monolithic_build_native/config_768.h b/examples/monolithic_build_native/config_768.h index 49f27f91a4..2ea6a199a9 100644 --- a/examples/monolithic_build_native/config_768.h +++ b/examples/monolithic_build_native/config_768.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -264,8 +269,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -466,6 +472,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/mlkem/src/config.h b/mlkem/src/config.h index 1c4daf2ff4..49a19361b9 100644 --- a/mlkem/src/config.h +++ b/mlkem/src/config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ #ifndef MLK_CONFIG_H @@ -250,8 +255,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -452,6 +458,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/scripts/autogen b/scripts/autogen index 312d0d4c12..7bcae9af4d 100755 --- a/scripts/autogen +++ b/scripts/autogen @@ -1880,7 +1880,6 @@ def get_config_options(): "MLK_SYS_AARCH64_SLOW_BARREL_SHIFTER", "MLKEM_DEBUG", # TODO: Rename? "MLK_BREAK_PCT", # Use in PCT breakage test] - "MLK_CONFIG_NO_ASM_VALUE_BARRIER", # TODO: Add to config? "MLK_CHECK_APIS", "MLK_CONFIG_API_XXX", "MLK_USE_NATIVE_XXX", diff --git a/test/break_pct_config.h b/test/break_pct_config.h index 9fb365ccaa..90737e6331 100644 --- a/test/break_pct_config.h +++ b/test/break_pct_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -468,6 +474,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_memcpy_config.h b/test/custom_memcpy_config.h index faec776e23..6fb22ce776 100644 --- a/test/custom_memcpy_config.h +++ b/test/custom_memcpy_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -475,6 +481,20 @@ static MLK_INLINE void *mlk_memcpy(void *dest, const void *src, size_t n) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_memset_config.h b/test/custom_memset_config.h index 83d13592b1..95ef4af7d7 100644 --- a/test/custom_memset_config.h +++ b/test/custom_memset_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -474,6 +480,20 @@ static MLK_INLINE void *mlk_memset(void *s, int c, size_t n) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_native_capability_config_0.h b/test/custom_native_capability_config_0.h index bfe9e88707..56392480a9 100644 --- a/test/custom_native_capability_config_0.h +++ b/test/custom_native_capability_config_0.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -471,6 +477,20 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_native_capability_config_1.h b/test/custom_native_capability_config_1.h index 07679703b6..85a95e5edb 100644 --- a/test/custom_native_capability_config_1.h +++ b/test/custom_native_capability_config_1.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -470,6 +476,20 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_native_capability_config_CPUID_AVX2.h b/test/custom_native_capability_config_CPUID_AVX2.h index f2095a5f86..88aef818b7 100644 --- a/test/custom_native_capability_config_CPUID_AVX2.h +++ b/test/custom_native_capability_config_CPUID_AVX2.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -502,6 +508,20 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_native_capability_config_ID_AA64PFR1_EL1.h b/test/custom_native_capability_config_ID_AA64PFR1_EL1.h index 952ca3e91c..8d16cd9d2a 100644 --- a/test/custom_native_capability_config_ID_AA64PFR1_EL1.h +++ b/test/custom_native_capability_config_ID_AA64PFR1_EL1.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -489,6 +495,20 @@ static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_randombytes_config.h b/test/custom_randombytes_config.h index 32ecee587a..df55865c36 100644 --- a/test/custom_randombytes_config.h +++ b/test/custom_randombytes_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -468,6 +474,20 @@ static MLK_INLINE void mlk_randombytes(uint8_t *ptr, size_t len) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_stdlib_config.h b/test/custom_stdlib_config.h index 31a7467ac2..df49d950ad 100644 --- a/test/custom_stdlib_config.h +++ b/test/custom_stdlib_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -483,6 +489,20 @@ static MLK_INLINE void *mlk_memset(void *s, int c, size_t n) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/custom_zeroize_config.h b/test/custom_zeroize_config.h index 8786f3b510..0d90887de3 100644 --- a/test/custom_zeroize_config.h +++ b/test/custom_zeroize_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -468,6 +474,20 @@ static MLK_INLINE void mlk_zeroize(void *ptr, size_t len) *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/no_asm_config.h b/test/no_asm_config.h index bdf8dad213..42cc204481 100644 --- a/test/no_asm_config.h +++ b/test/no_asm_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -266,8 +271,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -469,6 +475,20 @@ static MLK_INLINE void mlk_zeroize(void *ptr, size_t len) *****************************************************************************/ #define MLK_CONFIG_NO_ASM +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API * diff --git a/test/serial_fips202_config.h b/test/serial_fips202_config.h index d17283e248..8bac43e5a2 100644 --- a/test/serial_fips202_config.h +++ b/test/serial_fips202_config.h @@ -11,6 +11,11 @@ * Validation Program * National Institute of Standards and Technology * https://csrc.nist.gov/projects/cryptographic-module-validation-program/fips-140-3-ig-announcements + * + * - [FIPS203] + * FIPS 203 Module-Lattice-Based Key-Encapsulation Mechanism Standard + * National Institute of Standards and Technology + * https://csrc.nist.gov/pubs/fips/203/final */ /* @@ -265,8 +270,9 @@ /****************************************************************************** * Name: MLK_CONFIG_CUSTOM_ZEROIZE * - * Description: In compliance with FIPS 203 Section 3.3, mlkem-native zeroizes - * intermediate stack buffers before returning from function calls. + * Description: In compliance with @[FIPS203, Section 3.3], mlkem-native + * zeroizes intermediate stack buffers before returning from + * function calls. * * Set this option and define `mlk_zeroize` if you want to * use a custom method to zeroize intermediate stack buffers. @@ -467,6 +473,20 @@ *****************************************************************************/ /* #define MLK_CONFIG_NO_ASM */ +/****************************************************************************** + * Name: MLK_CONFIG_NO_ASM_VALUE_BARRIER + * + * Description: If this option is set, mlkem-native will be built without + * use of native code or inline assembly for value barriers. + * + * By default, inline assembly (if available) is used to implement + * value barriers. + * Without inline assembly, mlkem-native will use a global volatile + * 'opt blocker' instead; see verify.h. + * + *****************************************************************************/ +/* #define MLk_CONFIG_NO_ASM_VALUE_BARRIER */ + /****************************************************************************** * Name: MLK_CONFIG_NO_RANDOMIZED_API *