From 1f1b20b627ad4fbd29d285cdbb3b1b7284b91774 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20BR=C3=89ZOT?= Date: Thu, 26 Jun 2025 14:27:48 +0200 Subject: [PATCH 1/3] Add two different kinds of benches on the CI --- .github/workflows/benches.yml | 8 +++++++- src/abe_policy/access_structure.rs | 8 +++++--- src/core/primitives.rs | 3 ++- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/.github/workflows/benches.yml b/.github/workflows/benches.yml index 85359266..e880306c 100644 --- a/.github/workflows/benches.yml +++ b/.github/workflows/benches.yml @@ -5,9 +5,15 @@ name: Benches on demand on: workflow_dispatch jobs: - bench-classic: + bench-MLKEM512-Curve25519: uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@develop with: toolchain: stable features: test-utils force: true + bench-MLKEM512-P256: + uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@develop + with: + toolchain: stable + features: test-utils,mlkem-512,p-256 + force: true diff --git a/src/abe_policy/access_structure.rs b/src/abe_policy/access_structure.rs index 13259657..fb15e910 100644 --- a/src/abe_policy/access_structure.rs +++ b/src/abe_policy/access_structure.rs @@ -309,10 +309,12 @@ impl AccessStructure { } } -/// Combines all attributes IDs from the given dimensions using at most one attribute for each -/// dimensions. Returns the disjunction of the associated hybridization and activation status. +/// Combines all attributes IDs from the given dimensions using at most one +/// attribute for each dimensions. Returns the disjunction of the associated +/// hybridization and activation status. /// -/// As an example, if dimensions D1::A1 and D2::(A2,B2) are given, the following combinations will be created: +/// As an example, if dimensions D1::A1 and D2::(A2,B2) are given, the following +/// combinations will be created: /// - D1::A1 /// - D1::A1 && D2::A2 /// - D1::A1 && D2::B2 diff --git a/src/core/primitives.rs b/src/core/primitives.rs index 718fc317..c938ab5a 100644 --- a/src/core/primitives.rs +++ b/src/core/primitives.rs @@ -380,11 +380,12 @@ fn h_decaps( let mut encs = encs.iter().collect::>(); shuffle(&mut encs, rng); - // Loop order matters: this ordering is faster. for mut revision in usk.secrets.revisions() { // Shuffle secrets to counter timing attacks attempting to determine // whether successive encapsulations target the same user right. shuffle(&mut revision, rng); + + // Loop order matters: this ordering is faster. for (E, F) in &encs { for (_, secret) in &revision { if let RightSecretKey::Hybridized { sk, dk } = secret { From d73d27e908960da7297872521a47328b452b34d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20BR=C3=89ZOT?= Date: Thu, 26 Jun 2025 16:13:49 +0200 Subject: [PATCH 2/3] fix CI: attempt 1 --- .github/workflows/benches.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/benches.yml b/.github/workflows/benches.yml index e880306c..ccad3448 100644 --- a/.github/workflows/benches.yml +++ b/.github/workflows/benches.yml @@ -15,5 +15,6 @@ jobs: uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@develop with: toolchain: stable + default-features: false features: test-utils,mlkem-512,p-256 force: true From 7dec34715c9e5438e201d114b17fc66f1f23c229 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9ophile=20BR=C3=89ZOT?= Date: Thu, 26 Jun 2025 16:32:47 +0200 Subject: [PATCH 3/3] fix CI: attempt 2 --- .github/workflows/benches.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/benches.yml b/.github/workflows/benches.yml index ccad3448..f3201da4 100644 --- a/.github/workflows/benches.yml +++ b/.github/workflows/benches.yml @@ -6,15 +6,14 @@ on: workflow_dispatch jobs: bench-MLKEM512-Curve25519: - uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@develop + uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@fix/remove-default-features-in-benches with: toolchain: stable - features: test-utils + features: test-utils,mlkem-512,curve25519 force: true bench-MLKEM512-P256: - uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@develop + uses: Cosmian/reusable_workflows/.github/workflows/cargo-bench.yml@fix/remove-default-features-in-benches with: toolchain: stable - default-features: false features: test-utils,mlkem-512,p-256 force: true