Skip to content
Draft
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
166 changes: 83 additions & 83 deletions .github/workflows/all.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,93 +20,93 @@ jobs:
id-token: 'write'
uses: ./.github/workflows/base.yml
secrets: inherit
lint-markdown:
name: Lint Markdown
permissions:
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/lint_markdown.yml
nix:
name: Nix
permissions:
actions: 'write'
contents: 'read'
id-token: 'write'
uses: ./.github/workflows/nix.yml
secrets: inherit
ci:
name: Extended
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/ci.yml
secrets: inherit
# lint-markdown:
# name: Lint Markdown
# permissions:
# contents: 'read'
# id-token: 'write'
# uses: ./.github/workflows/lint_markdown.yml
# nix:
# name: Nix
# permissions:
# actions: 'write'
# contents: 'read'
# id-token: 'write'
# uses: ./.github/workflows/nix.yml
# secrets: inherit
# ci:
# name: Extended
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/ci.yml
# secrets: inherit
cbmc:
name: CBMC
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
# needs: [ base, nix ]
uses: ./.github/workflows/cbmc.yml
secrets: inherit
oqs_integration:
name: libOQS
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-liboqs.yml
secrets: inherit
opentitan_integration:
name: OpenTitan
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-opentitan.yml
secrets: inherit
awslc_integration_fixed:
name: AWS-LC (v1.64.0)
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-awslc.yml
with:
commit: 7187ab572ddcdae4fa408e932d3e878c9941137b # v1.64.0
secrets: inherit
awslc_integration_head:
name: AWS-LC (HEAD)
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/integration-awslc.yml
with:
commit: main
secrets: inherit
ct-test:
name: Constant-time
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/ct-tests.yml
secrets: inherit
slothy:
name: SLOTHY
permissions:
contents: 'read'
id-token: 'write'
needs: [ base, nix ]
uses: ./.github/workflows/slothy.yml
secrets: inherit
baremetal:
name: Baremetal
permissions:
contents: 'read'
id-token: 'write'
needs: [ base ]
uses: ./.github/workflows/baremetal.yml
secrets: inherit
# oqs_integration:
# name: libOQS
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-liboqs.yml
# secrets: inherit
# opentitan_integration:
# name: OpenTitan
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-opentitan.yml
# secrets: inherit
# awslc_integration_fixed:
# name: AWS-LC (v1.64.0)
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-awslc.yml
# with:
# commit: 7187ab572ddcdae4fa408e932d3e878c9941137b # v1.64.0
# secrets: inherit
# awslc_integration_head:
# name: AWS-LC (HEAD)
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/integration-awslc.yml
# with:
# commit: main
# secrets: inherit
# ct-test:
# name: Constant-time
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/ct-tests.yml
# secrets: inherit
# slothy:
# name: SLOTHY
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base, nix ]
# uses: ./.github/workflows/slothy.yml
# secrets: inherit
# baremetal:
# name: Baremetal
# permissions:
# contents: 'read'
# id-token: 'write'
# needs: [ base ]
# uses: ./.github/workflows/baremetal.yml
# secrets: inherit
17 changes: 9 additions & 8 deletions mlkem/src/kem.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,16 @@ static int mlk_check_pct(uint8_t const pk[MLKEM_INDCCA_PUBLICKEYBYTES],
#endif /* MLK_CONFIG_KEYGEN_PCT_BREAKAGE_TEST */

ret = mlk_ct_memcmp(ss_enc, ss_dec, MLKEM_SSBYTES);

cleanup:
/* The result of the PCT is public. */
MLK_CT_TESTING_DECLASSIFY(&ret, sizeof(ret));
if (ret != 0)
{
/* The non-zero return value of mlk_ct_memcmp is unspecified.
* Map it to the toplevel error code. */
ret = MLK_ERR_FAIL;
}

cleanup:

/* Specification: Partially implements
* @[FIPS203, Section 3.3, Destruction of intermediate values] */
Expand Down Expand Up @@ -214,12 +220,7 @@ int crypto_kem_keypair_derand(uint8_t pk[MLKEM_INDCCA_PUBLICKEYBYTES],
MLK_CT_TESTING_DECLASSIFY(pk, MLKEM_INDCCA_PUBLICKEYBYTES);

/* Pairwise Consistency Test (PCT) @[FIPS140_3_IG, p.87] */
if (mlk_check_pct(pk, sk))
{
return MLK_ERR_FAIL;
}

return 0;
return mlk_check_pct(pk, sk);
}

#if !defined(MLK_CONFIG_NO_RANDOMIZED_API)
Expand Down
2 changes: 1 addition & 1 deletion proofs/cbmc/check_pct/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ FUNCTION_NAME = mlk_check_pct
# EXPENSIVE = true

# This function is large enough to need...
CBMC_OBJECT_BITS = 8
CBMC_OBJECT_BITS = 9

# If you require access to a file-local ("static") function or object to conduct
# your proof, set the following (and do not include the original source file
Expand Down
1 change: 0 additions & 1 deletion scripts/tests
Original file line number Diff line number Diff line change
Expand Up @@ -917,7 +917,6 @@ class Tests:
"python3",
"run-cbmc-proofs.py",
"--summarize",
"--no-coverage",
"--per-proof-timeout",
str(self.args.per_proof_timeout),
"-p",
Expand Down
Loading