Skip to content
Merged
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: 1 addition & 0 deletions examples/custom_backend/mlkem_native/src/capability.h
1 change: 1 addition & 0 deletions examples/monolithic_build/mlkem_native/src/capability.h
40 changes: 20 additions & 20 deletions integration/liboqs/ML-KEM-1024_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM1024_C_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM1024_C_dec_oqs
sources: integration/liboqs/config_c.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc
- name: x86_64
Expand All @@ -52,11 +52,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM1024_X86_64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM1024_X86_64_dec_oqs
sources: integration/liboqs/config_x86_64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/x86_64
supported_platforms:
Expand All @@ -78,11 +78,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM1024_AARCH64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM1024_AARCH64_dec_oqs
sources: integration/liboqs/config_aarch64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/aarch64
supported_platforms:
Expand All @@ -102,11 +102,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM1024_PPC64LE_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM1024_PPC64LE_dec_oqs
sources: integration/liboqs/config_ppc64le.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/ppc64le
supported_platforms:
Expand Down
40 changes: 20 additions & 20 deletions integration/liboqs/ML-KEM-512_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM512_C_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM512_C_dec_oqs
sources: integration/liboqs/config_c.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc
- name: x86_64
Expand All @@ -52,11 +52,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM512_X86_64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM512_X86_64_dec_oqs
sources: integration/liboqs/config_x86_64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/x86_64
supported_platforms:
Expand All @@ -78,11 +78,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM512_AARCH64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM512_AARCH64_dec_oqs
sources: integration/liboqs/config_aarch64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/aarch64
supported_platforms:
Expand All @@ -102,11 +102,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM512_PPC64LE_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM512_PPC64LE_dec_oqs
sources: integration/liboqs/config_ppc64le.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/ppc64le
supported_platforms:
Expand Down
40 changes: 20 additions & 20 deletions integration/liboqs/ML-KEM-768_META.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM768_C_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM768_C_dec_oqs
sources: integration/liboqs/config_c.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc
- name: x86_64
Expand All @@ -52,11 +52,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM768_X86_64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM768_X86_64_dec_oqs
sources: integration/liboqs/config_x86_64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/x86_64
supported_platforms:
Expand All @@ -78,11 +78,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM768_AARCH64_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM768_AARCH64_dec_oqs
sources: integration/liboqs/config_aarch64.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/aarch64
supported_platforms:
Expand All @@ -102,11 +102,11 @@ implementations:
signature_enc_derand: PQCP_MLKEM_NATIVE_MLKEM768_PPC64LE_enc_derand_oqs
signature_dec: PQCP_MLKEM_NATIVE_MLKEM768_PPC64LE_dec_oqs
sources: integration/liboqs/config_ppc64le.h integration/liboqs/fips202_glue.h integration/liboqs/fips202x4_glue.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/cbmc.h mlkem/src/common.h
mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h mlkem/src/debug.c
mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c mlkem/src/kem.h
mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h mlkem/src/poly.c
mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
integration/liboqs/kem_glue.c mlkem/mlkem_native.h mlkem/src/capability.h mlkem/src/cbmc.h
mlkem/src/common.h mlkem/src/compress.c mlkem/src/compress.h mlkem/src/context.h
mlkem/src/debug.c mlkem/src/debug.h mlkem/src/indcpa.c mlkem/src/indcpa.h mlkem/src/kem.c
mlkem/src/kem.h mlkem/src/native/api.h mlkem/src/native/meta.h mlkem/src/params.h
mlkem/src/poly.c mlkem/src/poly.h mlkem/src/poly_k.c mlkem/src/poly_k.h mlkem/src/randombytes.h
mlkem/src/sampling.c mlkem/src/sampling.h mlkem/src/symmetric.h mlkem/src/sys.h
mlkem/src/verify.c mlkem/src/verify.h mlkem/src/zetas.inc mlkem/src/native/ppc64le
supported_platforms:
Expand Down
12 changes: 12 additions & 0 deletions integration/pavona/capability-header.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
diff --git a/third_party/mlkem_native/BUILD.mlkem_native.bazel b/third_party/mlkem_native/BUILD.mlkem_native.bazel
--- a/third_party/mlkem_native/BUILD.mlkem_native.bazel
+++ b/third_party/mlkem_native/BUILD.mlkem_native.bazel
@@ -10,6 +10,7 @@ cc_library(
hdrs = [
"mlkem/mlkem_native.c",
"mlkem/mlkem_native.h",
+ "mlkem/src/capability.h",
"mlkem/src/cbmc.h",
"mlkem/src/common.h",
"mlkem/src/context.h",
8 changes: 5 additions & 3 deletions mlkem/mlkem_native.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
#undef MLK_COMMON_H
#undef MLK_CONCAT
#undef MLK_CONCAT_
#undef MLK_CT_TESTING_DECLASSIFY
#undef MLK_CT_TESTING_SECRET
#undef MLK_EMPTY_CU
#undef MLK_ERR_FAIL
#undef MLK_ERR_INVALID_PK
Expand All @@ -199,6 +201,7 @@
#undef MLK_FIPS202X4_HEADER_FILE
#undef MLK_FIPS202_HEADER_FILE
#undef MLK_FREE
#undef MLK_HAVE_INLINE_ASM
#undef MLK_INTERNAL_API
#undef MLK_INTERNAL_DATA_DECLARATION
#undef MLK_INTERNAL_DATA_DEFINITION
Expand Down Expand Up @@ -281,6 +284,8 @@
/*
* Undefine macros from MLK_CONFIG_PARAMETER_SET-generic files
*/
/* mlkem/src/capability.h */
#undef MLK_CAPABILITY_H
/* mlkem/src/compress.h */
#undef MLK_COMPRESS_H
#undef mlk_poly_compress_d10
Expand Down Expand Up @@ -661,10 +666,7 @@
#undef MLK_ALIGN_UP
#undef MLK_ALWAYS_INLINE
#undef MLK_CET_ENDBR
#undef MLK_CT_TESTING_DECLASSIFY
#undef MLK_CT_TESTING_SECRET
#undef MLK_DEFAULT_ALIGN
#undef MLK_HAVE_INLINE_ASM
#undef MLK_INLINE
#undef MLK_MUST_CHECK_RETURN_VALUE
#undef MLK_NOINLINE
Expand Down
8 changes: 5 additions & 3 deletions mlkem/mlkem_native_asm.S
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@
#undef MLK_COMMON_H
#undef MLK_CONCAT
#undef MLK_CONCAT_
#undef MLK_CT_TESTING_DECLASSIFY
#undef MLK_CT_TESTING_SECRET
#undef MLK_EMPTY_CU
#undef MLK_ERR_FAIL
#undef MLK_ERR_INVALID_PK
Expand All @@ -230,6 +232,7 @@
#undef MLK_FIPS202X4_HEADER_FILE
#undef MLK_FIPS202_HEADER_FILE
#undef MLK_FREE
#undef MLK_HAVE_INLINE_ASM
#undef MLK_INTERNAL_API
#undef MLK_INTERNAL_DATA_DECLARATION
#undef MLK_INTERNAL_DATA_DEFINITION
Expand Down Expand Up @@ -312,6 +315,8 @@
/*
* Undefine macros from MLK_CONFIG_PARAMETER_SET-generic files
*/
/* mlkem/src/capability.h */
#undef MLK_CAPABILITY_H
/* mlkem/src/compress.h */
#undef MLK_COMPRESS_H
#undef mlk_poly_compress_d10
Expand Down Expand Up @@ -692,10 +697,7 @@
#undef MLK_ALIGN_UP
#undef MLK_ALWAYS_INLINE
#undef MLK_CET_ENDBR
#undef MLK_CT_TESTING_DECLASSIFY
#undef MLK_CT_TESTING_SECRET
#undef MLK_DEFAULT_ALIGN
#undef MLK_HAVE_INLINE_ASM
#undef MLK_INLINE
#undef MLK_MUST_CHECK_RETURN_VALUE
#undef MLK_NOINLINE
Expand Down
30 changes: 30 additions & 0 deletions mlkem/src/capability.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
/*
* Copyright (c) The mlkem-native project authors
* SPDX-License-Identifier: Apache-2.0 OR ISC OR MIT
*/
#ifndef MLK_CAPABILITY_H
#define MLK_CAPABILITY_H

#include "sys.h"

#if !defined(MLK_CONFIG_CUSTOM_CAPABILITY_FUNC) && !defined(__ASSEMBLER__)
#include "cbmc.h"

MLK_MUST_CHECK_RETURN_VALUE
static MLK_INLINE int mlk_sys_check_capability(mlk_sys_cap cap)
__contract__(
ensures(return_value == 0 || return_value == 1)
)
{
/* By default, we rely on compile-time feature detection/specification:
* If a feature is enabled at compile-time, we assume it is supported by
* the host that the resulting library/binary will be built on.
* If this assumption is not true, you MUST overwrite this function.
* See the documentation of MLK_CONFIG_CUSTOM_CAPABILITY_FUNC in
* mlkem_native_config.h for more information. */
(void)cap;
return 1;
}
#endif /* !MLK_CONFIG_CUSTOM_CAPABILITY_FUNC && !__ASSEMBLER__ */

#endif /* !MLK_CAPABILITY_H */
Loading
Loading