Skip to content

Commit d6e8eb8

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

File tree

476 files changed

+79682
-21724
lines changed

Some content is hidden

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

476 files changed

+79682
-21724
lines changed

.CMake/alg_support.cmake

Lines changed: 23 additions & 5 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")
645-
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)
651+
if(OQS_DIST_X86_64_BUILD OR (OQS_USE_AVX2_INSTRUCTIONS AND OQS_USE_BMI2_INSTRUCTIONS AND OQS_USE_POPCNT_INSTRUCTIONS))
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: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
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
11-
- **Implementation license (SPDX-Identifier)**: CC0-1.0 or Apache-2.0
10+
- **Source**: https://github.com/pq-code-package/mldsa-native/commit/7cd8aba68be2b35fc34bbf738a097f269be60b31
11+
- **Implementation license (SPDX-Identifier)**: MIT or Apache-2.0 or ISC
1212

1313

1414
## Parameter set summary
@@ -24,7 +24,8 @@
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 |
28+
| [Primary Source](#primary-source) | aarch64 | ARM64\_V8 | Linux,Darwin | None | True | False | False |
2829

2930
Are implementations chosen based on runtime CPU feature detection? **Yes**.
3031

@@ -35,7 +36,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.
3536
| 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? |
3637
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
3738
| [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 |
39+
| [Primary Source](#primary-source) | x86\_64 | x86\_64 | Darwin,Linux | AVX2,BMI2,POPCNT | True | True | False |
40+
| [Primary Source](#primary-source) | aarch64 | ARM64\_V8 | Linux,Darwin | None | True | False | False |
3941

4042
Are implementations chosen based on runtime CPU feature detection? **Yes**.
4143

@@ -44,7 +46,8 @@ Are implementations chosen based on runtime CPU feature detection? **Yes**.
4446
| 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? |
4547
|:---------------------------------:|:-------------------------|:----------------------------|:--------------------------------|:------------------------|:-----------------------------------|:-----------------------------------------------|:---------------------|
4648
| [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 |
49+
| [Primary Source](#primary-source) | x86\_64 | x86\_64 | Darwin,Linux | AVX2,POPCNT | True | True | False |
50+
| [Primary Source](#primary-source) | aarch64 | ARM64\_V8 | Linux,Darwin | None | True | False | False |
4851

4952
Are implementations chosen based on runtime CPU feature detection? **Yes**.
5053

docs/algorithms/sig/ml_dsa.yml

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,8 @@ 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
20-
spdx-license-identifier: CC0-1.0 or Apache-2.0
18+
source: https://github.com/pq-code-package/mldsa-native/commit/7cd8aba68be2b35fc34bbf738a097f269be60b31
19+
spdx-license-identifier: MIT or Apache-2.0 or ISC
2120
parameter-sets:
2221
- name: ML-DSA-44
2322
claimed-nist-level: 2
@@ -36,20 +35,33 @@ 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
5050
no-secret-dependent-branching-claimed: true
5151
no-secret-dependent-branching-checked-by-valgrind: true
5252
large-stack-usage: false
53+
- upstream: primary-upstream
54+
upstream-id: aarch64
55+
supported-platforms:
56+
- architecture: ARM64_V8
57+
operating_systems:
58+
- Linux
59+
- Darwin
60+
common-crypto:
61+
- SHA3: liboqs
62+
no-secret-dependent-branching-claimed: true
63+
no-secret-dependent-branching-checked-by-valgrind: false
64+
large-stack-usage: false
5365
- name: ML-DSA-65
5466
claimed-nist-level: 3
5567
claimed-security: SUF-CMA
@@ -67,20 +79,33 @@ parameter-sets:
6779
no-secret-dependent-branching-checked-by-valgrind: true
6880
large-stack-usage: false
6981
- upstream: primary-upstream
70-
upstream-id: avx2
82+
upstream-id: x86_64
7183
supported-platforms:
7284
- architecture: x86_64
7385
operating_systems:
7486
- Darwin
7587
- Linux
7688
required_flags:
7789
- avx2
90+
- bmi2
7891
- popcnt
7992
common-crypto:
8093
- SHA3: liboqs
8194
no-secret-dependent-branching-claimed: true
8295
no-secret-dependent-branching-checked-by-valgrind: true
8396
large-stack-usage: false
97+
- upstream: primary-upstream
98+
upstream-id: aarch64
99+
supported-platforms:
100+
- architecture: ARM64_V8
101+
operating_systems:
102+
- Linux
103+
- Darwin
104+
common-crypto:
105+
- SHA3: liboqs
106+
no-secret-dependent-branching-claimed: true
107+
no-secret-dependent-branching-checked-by-valgrind: false
108+
large-stack-usage: false
84109
- name: ML-DSA-87
85110
claimed-nist-level: 5
86111
claimed-security: SUF-CMA
@@ -98,7 +123,7 @@ parameter-sets:
98123
no-secret-dependent-branching-checked-by-valgrind: true
99124
large-stack-usage: false
100125
- upstream: primary-upstream
101-
upstream-id: avx2
126+
upstream-id: x86_64
102127
supported-platforms:
103128
- architecture: x86_64
104129
operating_systems:
@@ -112,3 +137,15 @@ parameter-sets:
112137
no-secret-dependent-branching-claimed: true
113138
no-secret-dependent-branching-checked-by-valgrind: true
114139
large-stack-usage: false
140+
- upstream: primary-upstream
141+
upstream-id: aarch64
142+
supported-platforms:
143+
- architecture: ARM64_V8
144+
operating_systems:
145+
- Linux
146+
- Darwin
147+
common-crypto:
148+
- SHA3: liboqs
149+
no-secret-dependent-branching-claimed: true
150+
no-secret-dependent-branching-checked-by-valgrind: false
151+
large-stack-usage: false

docs/cbom.json

Lines changed: 88 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,23 @@
22
"$schema": "https://raw.githubusercontent.com/CycloneDX/specification/1.6/schema/bom-1.6.schema.json",
33
"bomFormat": "CycloneDX",
44
"specVersion": "1.6",
5-
"serialNumber": "urn:uuid:e3f0e064-0a7b-49da-8f9c-20969271ed8f",
5+
"serialNumber": "urn:uuid:96e5dd1c-c97c-4290-82e0-77879e474f25",
66
"version": 1,
77
"metadata": {
8-
"timestamp": "2025-09-11T19:12:41.723813+00:00",
8+
"timestamp": "2025-09-25T05:06:11.659435+00:00",
99
"component": {
1010
"type": "library",
11-
"bom-ref": "pkg:github/open-quantum-safe/liboqs@c25f169f5ad77d5b96984357a396f98c223b7a98",
11+
"bom-ref": "pkg:github/open-quantum-safe/liboqs@f684a57e2d787d1fc41edfe69f5bbce551568701",
1212
"name": "liboqs",
13-
"version": "c25f169f5ad77d5b96984357a396f98c223b7a98"
13+
"version": "f684a57e2d787d1fc41edfe69f5bbce551568701"
1414
}
1515
},
1616
"components": [
1717
{
1818
"type": "library",
19-
"bom-ref": "pkg:github/open-quantum-safe/liboqs@c25f169f5ad77d5b96984357a396f98c223b7a98",
19+
"bom-ref": "pkg:github/open-quantum-safe/liboqs@f684a57e2d787d1fc41edfe69f5bbce551568701",
2020
"name": "liboqs",
21-
"version": "c25f169f5ad77d5b96984357a396f98c223b7a98"
21+
"version": "f684a57e2d787d1fc41edfe69f5bbce551568701"
2222
},
2323
{
2424
"type": "cryptographic-asset",
@@ -2700,6 +2700,26 @@
27002700
}
27012701
}
27022702
},
2703+
{
2704+
"type": "cryptographic-asset",
2705+
"bom-ref": "alg:ML-DSA-44:armv8-a",
2706+
"name": "ML-DSA",
2707+
"cryptoProperties": {
2708+
"assetType": "algorithm",
2709+
"algorithmProperties": {
2710+
"parameterSetIdentifier": "ML-DSA-44",
2711+
"primitive": "signature",
2712+
"executionEnvironment": "software-plain-ram",
2713+
"cryptoFunctions": [
2714+
"keygen",
2715+
"sign",
2716+
"verify"
2717+
],
2718+
"nistQuantumSecurityLevel": 2,
2719+
"implementationPlatform": "armv8-a"
2720+
}
2721+
}
2722+
},
27032723
{
27042724
"type": "cryptographic-asset",
27052725
"bom-ref": "alg:ML-DSA-65:generic",
@@ -2740,6 +2760,26 @@
27402760
}
27412761
}
27422762
},
2763+
{
2764+
"type": "cryptographic-asset",
2765+
"bom-ref": "alg:ML-DSA-65:armv8-a",
2766+
"name": "ML-DSA",
2767+
"cryptoProperties": {
2768+
"assetType": "algorithm",
2769+
"algorithmProperties": {
2770+
"parameterSetIdentifier": "ML-DSA-65",
2771+
"primitive": "signature",
2772+
"executionEnvironment": "software-plain-ram",
2773+
"cryptoFunctions": [
2774+
"keygen",
2775+
"sign",
2776+
"verify"
2777+
],
2778+
"nistQuantumSecurityLevel": 3,
2779+
"implementationPlatform": "armv8-a"
2780+
}
2781+
}
2782+
},
27432783
{
27442784
"type": "cryptographic-asset",
27452785
"bom-ref": "alg:ML-DSA-87:generic",
@@ -2780,6 +2820,26 @@
27802820
}
27812821
}
27822822
},
2823+
{
2824+
"type": "cryptographic-asset",
2825+
"bom-ref": "alg:ML-DSA-87:armv8-a",
2826+
"name": "ML-DSA",
2827+
"cryptoProperties": {
2828+
"assetType": "algorithm",
2829+
"algorithmProperties": {
2830+
"parameterSetIdentifier": "ML-DSA-87",
2831+
"primitive": "signature",
2832+
"executionEnvironment": "software-plain-ram",
2833+
"cryptoFunctions": [
2834+
"keygen",
2835+
"sign",
2836+
"verify"
2837+
],
2838+
"nistQuantumSecurityLevel": 5,
2839+
"implementationPlatform": "armv8-a"
2840+
}
2841+
}
2842+
},
27832843
{
27842844
"type": "cryptographic-asset",
27852845
"bom-ref": "alg:SLH_DSA_PURE_SHA2_128S:generic",
@@ -7847,7 +7907,7 @@
78477907
],
78487908
"dependencies": [
78497909
{
7850-
"ref": "pkg:github/open-quantum-safe/liboqs@c25f169f5ad77d5b96984357a396f98c223b7a98",
7910+
"ref": "pkg:github/open-quantum-safe/liboqs@f684a57e2d787d1fc41edfe69f5bbce551568701",
78517911
"provides": [
78527912
"alg:BIKE-L1:x86_64",
78537913
"alg:BIKE-L3:x86_64",
@@ -7983,10 +8043,13 @@
79838043
"alg:MAYO-5:armv8-a",
79848044
"alg:ML-DSA-44:generic",
79858045
"alg:ML-DSA-44:x86_64",
8046+
"alg:ML-DSA-44:armv8-a",
79868047
"alg:ML-DSA-65:generic",
79878048
"alg:ML-DSA-65:x86_64",
8049+
"alg:ML-DSA-65:armv8-a",
79888050
"alg:ML-DSA-87:generic",
79898051
"alg:ML-DSA-87:x86_64",
8052+
"alg:ML-DSA-87:armv8-a",
79908053
"alg:SLH_DSA_PURE_SHA2_128S:generic",
79918054
"alg:SLH_DSA_PURE_SHA2_128F:generic",
79928055
"alg:SLH_DSA_PURE_SHA2_192S:generic",
@@ -9063,6 +9126,12 @@
90639126
"alg:sha3"
90649127
]
90659128
},
9129+
{
9130+
"ref": "alg:ML-DSA-44:armv8-a",
9131+
"dependsOn": [
9132+
"alg:sha3"
9133+
]
9134+
},
90669135
{
90679136
"ref": "alg:ML-DSA-65:generic",
90689137
"dependsOn": [
@@ -9075,6 +9144,12 @@
90759144
"alg:sha3"
90769145
]
90779146
},
9147+
{
9148+
"ref": "alg:ML-DSA-65:armv8-a",
9149+
"dependsOn": [
9150+
"alg:sha3"
9151+
]
9152+
},
90789153
{
90799154
"ref": "alg:ML-DSA-87:generic",
90809155
"dependsOn": [
@@ -9087,6 +9162,12 @@
90879162
"alg:sha3"
90889163
]
90899164
},
9165+
{
9166+
"ref": "alg:ML-DSA-87:armv8-a",
9167+
"dependsOn": [
9168+
"alg:sha3"
9169+
]
9170+
},
90909171
{
90919172
"ref": "alg:SNOVA_24_5_4:generic",
90929173
"dependsOn": [

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: 7cd8aba68be2b35fc34bbf738a097f269be60b31
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"

0 commit comments

Comments
 (0)