Skip to content

Commit c2caea3

Browse files
committed
mldsa-native integration [full tests] [extended tests]
Signed-off-by: Matthias J. Kannwischer <matthias@kannwischer.eu>
1 parent dd942d4 commit c2caea3

File tree

484 files changed

+79294
-21709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

484 files changed

+79294
-21709
lines changed

.CMake/alg_support.cmake

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -636,20 +636,38 @@ endif()
636636

637637

638638
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
639-
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
640-
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_44" OFF)
639+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
640+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_44" OFF)
641+
endif()
642+
endif()
643+
644+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
645+
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
646+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_44_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_44" OFF)
641647
endif()
642648
endif()
643649

644650
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
645651
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
646-
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_65" OFF)
652+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_65" OFF)
653+
endif()
654+
endif()
655+
656+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
657+
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
658+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_65_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_65" OFF)
647659
endif()
648660
endif()
649661

650662
if(CMAKE_SYSTEM_NAME MATCHES "Darwin|Linux")
651663
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
652-
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_avx2 "" ON "OQS_ENABLE_SIG_ml_dsa_87" OFF)
664+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_x86_64 "" ON "OQS_ENABLE_SIG_ml_dsa_87" OFF)
665+
endif()
666+
endif()
667+
668+
if(CMAKE_SYSTEM_NAME MATCHES "Linux|Darwin")
669+
if(OQS_DIST_ARM64_V8_BUILD OR (OQS_USE_ARM_NEON_INSTRUCTIONS AND OQS_USE_ARM_NEON_INSTRUCTIONS))
670+
cmake_dependent_option(OQS_ENABLE_SIG_ml_dsa_87_aarch64 "" ON "OQS_ENABLE_SIG_ml_dsa_87" OFF)
653671
endif()
654672
endif()
655673

docs/algorithms/sig/ml_dsa.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- **Authors' website**: https://pq-crystals.org/dilithium/ and https://csrc.nist.gov/pubs/fips/204/final
88
- **Specification version**: ML-DSA.
99
- **Primary Source**<a name="primary-source"></a>:
10-
- **Source**: https://github.com/pq-crystals/dilithium/commit/444cdcc84eb36b66fe27b3a2529ee48f6d8150c2 with copy_from_upstream patches
10+
- **Source**: https://github.com/pq-code-package/mldsa-native/commit/2394b85e9073c1db34b75893e170d8394f0f5404
1111
- **Implementation license (SPDX-Identifier)**: CC0-1.0 or Apache-2.0
1212

1313

@@ -24,7 +24,7 @@
2424
| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage?‡ |
2525
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:----------------------|
2626
| [Primary Source](#primary-source) | ref | All | All | None | True | True | False |
27-
| [Primary Source](#primary-source) | avx2 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
27+
| [Primary Source](#primary-source) | x86\_64 | x86\_64 | Darwin,Linux | AVX2,BMI2,POPCNT | True | True | False |
2828

2929
Are implementations chosen based on runtime CPU feature detection? **Yes**.
3030

@@ -35,7 +35,7 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.
3535
| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
3636
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
3737
| [Primary Source](#primary-source) | ref | All | All | None | True | True | False |
38-
| [Primary Source](#primary-source) | avx2 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
38+
| [Primary Source](#primary-source) | x86\_64 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
3939

4040
Are implementations chosen based on runtime CPU feature detection? **Yes**.
4141

@@ -44,7 +44,7 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.
4444
| Implementation source | Identifier in upstream | Supported architecture(s) | Supported operating system(s) | CPU extension(s) used | No branching-on-secrets claimed? | No branching-on-secrets checked by valgrind? | Large stack usage? |
4545
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
4646
| [Primary Source](#primary-source) | ref | All | All | None | True | True | False |
47-
| [Primary Source](#primary-source) | avx2 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
47+
| [Primary Source](#primary-source) | x86\_64 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
4848

4949
Are implementations chosen based on runtime CPU feature detection? **Yes**.
5050

docs/algorithms/sig/ml_dsa.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@ website: https://pq-crystals.org/dilithium/ and https://csrc.nist.gov/pubs/fips/
1515
nist-round: FIPS204
1616
spec-version: ML-DSA
1717
primary-upstream:
18-
source: https://github.com/pq-crystals/dilithium/commit/444cdcc84eb36b66fe27b3a2529ee48f6d8150c2
19-
with copy_from_upstream patches
18+
source: https://github.com/pq-code-package/mldsa-native/commit/2394b85e9073c1db34b75893e170d8394f0f5404
2019
spdx-license-identifier: CC0-1.0 or Apache-2.0
2120
parameter-sets:
2221
- name: ML-DSA-44
@@ -36,14 +35,15 @@ parameter-sets:
3635
no-secret-dependent-branching-checked-by-valgrind: true
3736
large-stack-usage: false
3837
- upstream: primary-upstream
39-
upstream-id: avx2
38+
upstream-id: x86_64
4039
supported-platforms:
4140
- architecture: x86_64
4241
operating_systems:
4342
- Darwin
4443
- Linux
4544
required_flags:
4645
- avx2
46+
- bmi2
4747
- popcnt
4848
common-crypto:
4949
- SHA3: liboqs
@@ -67,7 +67,7 @@ parameter-sets:
6767
no-secret-dependent-branching-checked-by-valgrind: true
6868
large-stack-usage: false
6969
- upstream: primary-upstream
70-
upstream-id: avx2
70+
upstream-id: x86_64
7171
supported-platforms:
7272
- architecture: x86_64
7373
operating_systems:
@@ -98,7 +98,7 @@ parameter-sets:
9898
no-secret-dependent-branching-checked-by-valgrind: true
9999
large-stack-usage: false
100100
- upstream: primary-upstream
101-
upstream-id: avx2
101+
upstream-id: x86_64
102102
supported-platforms:
103103
- architecture: x86_64
104104
operating_systems:

scripts/copy_from_upstream/copy_from_upstream.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -56,13 +56,13 @@ upstreams:
5656
kem_scheme_path: '.'
5757
patches: [icicle-mlkem-enc-derand.patch]
5858
-
59-
name: pqcrystals-dilithium-standard
60-
git_url: https://github.com/pq-crystals/dilithium.git
61-
git_branch: master
62-
git_commit: 444cdcc84eb36b66fe27b3a2529ee48f6d8150c2
63-
sig_meta_path: '{pretty_name_full}_META.yml'
59+
name: mldsa-native
60+
git_url: https://github.com/pq-code-package/mldsa-native.git
61+
git_branch: liboqs-integration
62+
git_commit: 2394b85e9073c1db34b75893e170d8394f0f5404
63+
sig_meta_path: 'integration/liboqs/{pretty_name_full}_META.yml'
6464
sig_scheme_path: '.'
65-
patches: [pqcrystals-ml_dsa.patch, pqcrystals-ml_dsa-SUF-CMA.patch]
65+
preserve_folder_structure: True
6666
-
6767
name: pqmayo
6868
git_url: https://github.com/PQCMayo/MAYO-C.git
@@ -216,7 +216,7 @@ sigs:
216216
-
217217
name: ml_dsa
218218
default_implementation: ref
219-
upstream_location: pqcrystals-dilithium-standard
219+
upstream_location: mldsa-native
220220
schemes:
221221
-
222222
scheme: "44"

src/oqsconfig.h.cmake

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,14 @@
162162

163163
#cmakedefine OQS_ENABLE_SIG_ML_DSA 1
164164
#cmakedefine OQS_ENABLE_SIG_ml_dsa_44 1
165-
#cmakedefine OQS_ENABLE_SIG_ml_dsa_44_avx2 1
165+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_44_x86_64 1
166+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_44_aarch64 1
166167
#cmakedefine OQS_ENABLE_SIG_ml_dsa_65 1
167-
#cmakedefine OQS_ENABLE_SIG_ml_dsa_65_avx2 1
168+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_65_x86_64 1
169+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_65_aarch64 1
168170
#cmakedefine OQS_ENABLE_SIG_ml_dsa_87 1
169-
#cmakedefine OQS_ENABLE_SIG_ml_dsa_87_avx2 1
171+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_87_x86_64 1
172+
#cmakedefine OQS_ENABLE_SIG_ml_dsa_87_aarch64 1
170173

171174
#cmakedefine OQS_ENABLE_SIG_FALCON 1
172175
#cmakedefine OQS_ENABLE_SIG_falcon_512 1

0 commit comments

Comments
 (0)