Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implementation of Composite Sig #317

Merged
merged 165 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from 164 commits
Commits
Show all changes
165 commits
Select commit Hold shift + click to select a range
6d3ed88
Create CODE_OF_CONDUCT.md (#258)
baentsch Sep 21, 2023
659abf8
adding contributing guideline (#259)
baentsch Sep 22, 2023
07d5ebd
CI & cmake changes for Windows (#263)
qnfm Sep 24, 2023
914844b
Attempt to add Dilithium5+Falcon1024 as Composite Method
feventura Jul 22, 2022
cc374ca
Added notes with usefull commands
feventura Jul 22, 2022
f091743
Composite mechanisms added
feventura Aug 1, 2022
c0aaed3
Composite Dilithium5+Falcon1024 working in test case
feventura Aug 3, 2022
68f3aee
working falcon+dilithium
feventura Sep 20, 2022
0349f68
Composite ASN1 structure
feventura Sep 30, 2022
d78ca20
Composite ASN1 structure
feventura Oct 6, 2022
bd0c4ac
ec_rsa
feventura Oct 6, 2022
f5756d4
composite key generation with the right format
feventura Oct 12, 2022
24d09c7
add non PQC keys to Composite
feventura Oct 21, 2022
1527996
p521_rsa3072
feventura Oct 28, 2022
17d0740
Fixed execution error for the non-PQC key
feventura Nov 3, 2022
e4cacbb
Setup for the classical encoding on composite keys
feventura Nov 8, 2022
bec88fd
Working classical (ec, rsa) in composite structure
feventura Nov 10, 2022
4fc939d
Illegal instruction error
feventura Nov 17, 2022
f6e7e6f
starting the certificate structures
feventura Nov 22, 2022
115e9ce
added: dilithium3_rsa3072, dilithium3_p256 and falcon512_p256
feventura Dec 1, 2022
1068450
Decode singarures
feventura Jan 4, 2023
a289415
allocate memory
feventura Jan 6, 2023
91f12a8
working raw signatures
feventura Jan 12, 2023
6789503
ASN1 format for raw signatures
feventura Jan 24, 2023
8ebc7c1
public key extraction working
feventura Jan 31, 2023
32dd8d7
raw signature verification
feventura Feb 7, 2023
381f98a
change sha512 to sha256 for dgst RSA
feventura Feb 10, 2023
f43a600
Certificate working
feventura Feb 23, 2023
bf222f3
2+ composite keys
feventura Mar 21, 2023
323538f
bugfix
Mar 21, 2023
e0521a3
removed prints and old commented code
feventura Mar 21, 2023
2985284
remove notes.txt
feventura Mar 21, 2023
e45b822
signature ASN1 structure for 2+ keys
feventura Mar 28, 2023
2de1505
Revert "remove notes.txt"
feventura Aug 11, 2023
43c90cc
working 2keys and cert
Aug 21, 2023
2dcaa80
added composite draft keys pairs
Aug 25, 2023
c7f82f5
working PSS key and cert gen
Sep 11, 2023
6e37759
adding padding for pss signing & fix param bug
Sep 12, 2023
d1d1d26
removed internal OIDS
Sep 13, 2023
a5be140
pss format fix, removed publickey copy from the end of privatekey
Sep 15, 2023
3dded68
fixed unused bits check for encoding sigs
Sep 21, 2023
3b7bca0
RSA encoding fixed
Sep 25, 2023
0e5535c
removed internal OID from pubkey & fixed key reconstruction to not lo…
Sep 26, 2023
97844d8
free memory
Sep 26, 2023
d772d97
CMS sign and verification
Sep 28, 2023
71fc8a2
Removed unused comments
Sep 28, 2023
f111eb4
fixed bug from last commit
Sep 28, 2023
38d77f7
rebase to the open-quantum-safe master branch
feventura Oct 5, 2023
207fae8
fix for txt output length of plain PQ key material (#268)
baentsch Oct 3, 2023
2a34ee4
KEM en/decoders (#266)
baentsch Oct 5, 2023
83937ce
getting up-to-date with oqsprov upstream
feventura Oct 5, 2023
70729a4
fixed oid list len
feventura Oct 5, 2023
ccf5536
removed notes.txt
feventura Oct 5, 2023
d5902d1
comments for pre-hash
feventura Oct 5, 2023
faff483
comments for pre-hash on verification
feventura Oct 5, 2023
42a1f85
test commit
feventura Oct 5, 2023
828771c
Version 10 pre-hash added
feventura Oct 12, 2023
68c63eb
set up SHAKE256 size to 512bits
feventura Oct 13, 2023
6af1bf8
remove duplicate LIBOQS_BRANCH option in config doc (#274)
psschwei Oct 6, 2023
a049292
add cloudflare interop tests (#278)
baentsch Oct 10, 2023
74eb302
added MLDSA44 algs
feventura Oct 13, 2023
12f149e
Add releasetest (#281)
baentsch Oct 16, 2023
0b15706
Support web proxy in external interop tests (#288)
mouse07410 Oct 19, 2023
916a871
Get Windows CI to work again; prepare for release (#291)
baentsch Oct 20, 2023
2086b53
add 0.5.2 release documentation
baentsch Oct 21, 2023
f49275d
switch repo to -dev mode/unlock release
baentsch Oct 21, 2023
6f0d4e5
Clarify liboqs_DIR naming convention (#292)
ajbozarth Oct 23, 2023
9d3e2a8
check empty params lists passed (#296)
baentsch Oct 26, 2023
e3eda76
Fixed memory issues and added optimizations
feventura Nov 27, 2023
d344c9f
fixed memory leak and typos
feventura Nov 30, 2023
a90ce1e
fixed memory issues with single sigs
feventura Dec 1, 2023
6f471ed
Fix minor typos in documentation (#304)
johnma14 Nov 29, 2023
c334b34
HQC code point update (#306)
baentsch Dec 1, 2023
d4eac6c
Fix broken circleci job for macOS (#305)
johnma14 Dec 5, 2023
04f2874
Contribution policy (#286)
baentsch Dec 5, 2023
91e63fb
Fix link in GOVERNANCE.md (#309)
pi-314159 Dec 6, 2023
7b36297
Add a example of how to load oqsprovider using `OSSL_PROVIDER_add_bui…
Dec 6, 2023
66ce928
Get Windows CI to work again (#310)
qnfm Dec 7, 2023
e372d5f
added TEXT encoder options for composite
feventura Dec 8, 2023
85a3ce1
fix composite adjust
feventura Dec 8, 2023
d5b8d90
bugfix
feventura Dec 8, 2023
a4911d5
bugfix
feventura Dec 8, 2023
2015b2d
changed to OpenSSL coding style
feventura Dec 11, 2023
5aa2907
added composite to generate.yaml
feventura Dec 12, 2023
74c334f
missed one file from last commit
feventura Dec 12, 2023
bd9dd85
Use `build` directory instead of `_build`. (#314)
Dec 12, 2023
c648c70
added composite OID scheme comment
feventura Dec 12, 2023
a80e109
bugfix changes
feventura Dec 13, 2023
493f613
simplified the code and fix some memory leaks
feventura Dec 19, 2023
f25d4ec
adaptations to draft v11
feventura Dec 19, 2023
20af978
updated internal OIDs to v11
feventura Dec 19, 2023
4f5c859
using OpenSSL coding style
feventura Dec 19, 2023
74620bf
fixed DOQS_KEM_ENCODERS=ON
feventura Dec 19, 2023
5afb6ba
added composite to README.md and ALGORITHMS.md && inverted logic for …
feventura Dec 21, 2023
9e313e4
fix rsa size mismatch bug
feventura Jan 11, 2024
9f926f7
0.5.3 release
baentsch Dec 24, 2023
86110cd
correct upstream and Windows CI snafus (#322)
baentsch Dec 24, 2023
054edeb
Revert "Use `build` directory instead of `_build`. (#314)" (#325)
baentsch Dec 28, 2023
3c54874
0.5.3rc2
baentsch Dec 28, 2023
49f717d
reverting to dev (#327)
baentsch Jan 3, 2024
1c27104
fixed memory leaks
feventura Jan 15, 2024
15175d2
solved some memleaks
feventura Jan 18, 2024
e269970
solved memory leaks
feventura Jan 22, 2024
8b38b15
Bump jinja2 from 3.0.3 to 3.1.3 in /oqs-template (#334)
dependabot[bot] Jan 16, 2024
f8e708a
LICENSE copyright update [skip ci] (#336)
baentsch Jan 18, 2024
76263be
update to 0.5.4-dev (#337)
baentsch Jan 19, 2024
acd3870
correcting mem allocation
feventura Jan 22, 2024
ab497cd
added oid to privkey and fix keys format
feventura Feb 15, 2024
cdb25d9
bring GOVERNANCE in line with liboqs [skip ci] (#342)
baentsch Jan 23, 2024
281d015
Automatically trigger CI on significant liboqs changes (#345)
SWilson4 Feb 2, 2024
8e85bb4
add more defensive error handling (#346)
baentsch Feb 3, 2024
cd5cab5
correct wrong use of sizeof (#347)
baentsch Feb 3, 2024
ca50cba
Protecting from NULL parameters (#350)
baentsch Feb 12, 2024
dc363e7
merged upstream
feventura Feb 15, 2024
166e846
adjusted flags for SubjectPublicKeyInto BIT_STRING
feventura Feb 15, 2024
d15fc6b
added support for EC without ECParam and Pubkey
feventura Feb 23, 2024
a2348e7
guard external testing against algorithm absence (#352)
baentsch Feb 23, 2024
c74da32
first cut adding ML-* (#348)
baentsch Feb 24, 2024
6b068b6
removed deprecated functions
feventura Feb 26, 2024
180e489
fix composite EC
feventura Feb 27, 2024
711a0af
changed composite dilithium to ML-*
feventura Feb 27, 2024
7493201
added more descriptive comments
feventura Feb 29, 2024
7bee2c7
added option to easily switch back to dilithium3 instead of ML-DLS65 …
feventura Feb 29, 2024
1e3a8d6
switched comparison from dilithium to ML-DSA
feventura Feb 29, 2024
762e7f8
switched comparison from dilithium to ML-DSA form validation
feventura Feb 29, 2024
8bf4c5f
adding Felipe to the contribuitors list
feventura Mar 1, 2024
be0df24
fix OID prefix format
feventura Mar 1, 2024
2631429
Adapt Kyber OIDs and avoid testing using downlevel brew releases (#356)
baentsch Mar 1, 2024
70fd101
Add extra debug information in case of TLS handshake failure. (#357)
beldmit Mar 1, 2024
d646f80
p384_mlkem1024 hybrid added (#361)
bencemali Mar 1, 2024
b3a6979
correct generate output files
feventura Mar 1, 2024
8f97872
manipulating pointer on a temp instead of void*
feventura Mar 1, 2024
e245471
fix pubkey typo
feventura Mar 1, 2024
09e6e60
removed strtok_r
feventura Mar 4, 2024
294bc98
removed Falcon accordingly to the draft-ounsworth-pq-composite-sigs-13
feventura Mar 4, 2024
1ecceeb
changed composite classic digest hash logic
feventura Mar 4, 2024
8a8a680
fixed heap buffer overflow
feventura Mar 4, 2024
faacdbb
removed interop comment
feventura Mar 4, 2024
ddaadc6
length and null checks in en/decaps (#364)
bencemali Mar 4, 2024
caa53b1
documentation update [skip ci] (#366)
baentsch Mar 6, 2024
cce2279
added composite draft link to README
feventura Mar 7, 2024
539d692
added the draft hyperlink to Composite text
feventura Mar 7, 2024
518a688
fixed space in the Composite hyperlink on README
feventura Mar 7, 2024
c909ce9
Set Kyber OIDs (#368)
bhess Mar 7, 2024
3f7deba
Add code points for PADDED variant of Falcon [skip ci] (#362)
SWilson4 Mar 7, 2024
a4c97c9
rebase
feventura Mar 7, 2024
c088cb7
Update oqsprov/oqs_encode_key2any.c
feventura Mar 7, 2024
9c967fe
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
1d00461
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
6261fb6
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
0ec3887
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
8db7d92
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
a272a6a
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
ce0d523
Update oqsprov/oqs_sig.c
feventura Mar 7, 2024
2d282be
Update oqsprov/oqsprov_keys.c
feventura Mar 7, 2024
3855252
Update oqsprov/oqsprov.c
feventura Mar 7, 2024
0dcd42a
fix typo
feventura Mar 7, 2024
549ae3a
buflen isnt always oqsxkey->privkeylen_cmp
feventura Mar 7, 2024
07cc594
implemented suggested changes and useful comments
feventura Mar 12, 2024
f75e4ea
fix casting
feventura Mar 12, 2024
11d156b
generated and formated all methods
feventura Mar 17, 2024
0fa7382
fixed rebase diff
feventura Mar 17, 2024
a4c6846
Merge branch 'upstream/main'
feventura Mar 17, 2024
d6eedfb
solve conflicts
feventura Mar 17, 2024
3f5888e
added --repeat until-pass:5 to the asan GitActions
feventura Mar 18, 2024
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
13 changes: 13 additions & 0 deletions ALGORITHMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,10 +152,23 @@ adapting the OIDs of all supported signature algorithms as per the table below.
| mldsa44 | 1.3.6.1.4.1.2.267.12.4.4 |Yes| OQS_OID_MLDSA44
| p256_mldsa44 | 1.3.9999.7.1 |Yes| OQS_OID_P256_MLDSA44
| rsa3072_mldsa44 | 1.3.9999.7.2 |Yes| OQS_OID_RSA3072_MLDSA44
| mldsa44_pss2048 | 2.16.840.1.114027.80.8.1.1 |Yes| OQS_OID_MLDSA44_pss2048
| mldsa44_rsa2048 | 2.16.840.1.114027.80.8.1.2 |Yes| OQS_OID_MLDSA44_rsa2048
| mldsa44_ed25519 | 2.16.840.1.114027.80.8.1.3 |Yes| OQS_OID_MLDSA44_ed25519
| mldsa44_p256 | 2.16.840.1.114027.80.8.1.4 |Yes| OQS_OID_MLDSA44_p256
| mldsa44_bp256 | 2.16.840.1.114027.80.8.1.5 |Yes| OQS_OID_MLDSA44_bp256
| mldsa65 | 1.3.6.1.4.1.2.267.12.6.5 |Yes| OQS_OID_MLDSA65
| p384_mldsa65 | 1.3.9999.7.3 |Yes| OQS_OID_P384_MLDSA65
| mldsa65_pss3072 | 2.16.840.1.114027.80.8.1.6 |Yes| OQS_OID_MLDSA65_pss3072
| mldsa65_rsa3072 | 2.16.840.1.114027.80.8.1.7 |Yes| OQS_OID_MLDSA65_rsa3072
| mldsa65_p256 | 2.16.840.1.114027.80.8.1.8 |Yes| OQS_OID_MLDSA65_p256
| mldsa65_bp256 | 2.16.840.1.114027.80.8.1.9 |Yes| OQS_OID_MLDSA65_bp256
| mldsa65_ed25519 | 2.16.840.1.114027.80.8.1.10 |Yes| OQS_OID_MLDSA65_ed25519
| mldsa87 | 1.3.6.1.4.1.2.267.12.8.7 |Yes| OQS_OID_MLDSA87
| p521_mldsa87 | 1.3.9999.7.4 |Yes| OQS_OID_P521_MLDSA87
| mldsa87_p384 | 2.16.840.1.114027.80.8.1.11 |Yes| OQS_OID_MLDSA87_p384
| mldsa87_bp384 | 2.16.840.1.114027.80.8.1.12 |Yes| OQS_OID_MLDSA87_bp384
| mldsa87_ed448 | 2.16.840.1.114027.80.8.1.13 |Yes| OQS_OID_MLDSA87_ed448
| falcon512 | 1.3.9999.3.11 |Yes| OQS_OID_FALCON512
| p256_falcon512 | 1.3.9999.3.12 |Yes| OQS_OID_P256_FALCON512
| rsa3072_falcon512 | 1.3.9999.3.13 |Yes| OQS_OID_RSA3072_FALCON512
Expand Down
10 changes: 7 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ This implementation makes available the following quantum safe algorithms:
### Signature algorithms

- **CRYSTALS-Dilithium**:`dilithium2`\*, `p256_dilithium2`\*, `rsa3072_dilithium2`\*, `dilithium3`\*, `p384_dilithium3`\*, `dilithium5`\*, `p521_dilithium5`\*
- **ML-DSA**:`mldsa44`\*, `p256_mldsa44`\*, `rsa3072_mldsa44`\*, `mldsa65`\*, `p384_mldsa65`\*, `mldsa87`\*, `p521_mldsa87`\*
- **ML-DSA**:`mldsa44`\*, `p256_mldsa44`\*, `rsa3072_mldsa44`\*, `mldsa44_pss2048`\*, `mldsa44_rsa2048`\*, `mldsa44_ed25519`\*, `mldsa44_p256`\*, `mldsa44_bp256`\*, `mldsa65`\*, `p384_mldsa65`\*, `mldsa65_pss3072`\*, `mldsa65_rsa3072`\*, `mldsa65_p256`\*, `mldsa65_bp256`\*, `mldsa65_ed25519`\*, `mldsa87`\*, `p521_mldsa87`\*, `mldsa87_p384`\*, `mldsa87_bp384`\*, `mldsa87_ed448`\*
- **Falcon**:`falcon512`\*, `p256_falcon512`\*, `rsa3072_falcon512`\*, `falconpadded512`\*, `p256_falconpadded512`\*, `rsa3072_falconpadded512`\*, `falcon1024`\*, `p521_falcon1024`\*, `falconpadded1024`\*, `p521_falconpadded1024`\*

- **SPHINCS-SHA2**:`sphincssha2128fsimple`\*, `p256_sphincssha2128fsimple`\*, `rsa3072_sphincssha2128fsimple`\*, `sphincssha2128ssimple`\*, `p256_sphincssha2128ssimple`\*, `rsa3072_sphincssha2128ssimple`\*, `sphincssha2192fsimple`\*, `p384_sphincssha2192fsimple`\*, `sphincssha2192ssimple`, `p384_sphincssha2192ssimple`, `sphincssha2256fsimple`, `p521_sphincssha2256fsimple`, `sphincssha2256ssimple`, `p521_sphincssha2256ssimple`
Expand All @@ -66,8 +66,11 @@ TLS operations. This designation [can be changed by modifying the

In order to support parallel use of classic and quantum-safe cryptography
this provider also provides different hybrid algorithms, combining classic
and quantum-safe methods: These are listed above with a prefix denoting a
classic algorithm, e.g., for elliptic curve: "p256_".
and quantum-safe methods.
There are two types of combinations:
The Hybrids are listed above with a prefix denoting a classic algorithm, e.g., for elliptic curve: "p256_".
The [Composite](https://datatracker.ietf.org/doc/draft-ounsworth-pq-composite-sigs/) are listed above with a suffix denoting a
classic algorithm, e.g., for elliptic curve: "_p256".

A full list of algorithms, their interoperability code points and OIDs as well
as a method to dynamically adapt them, e.g., for interoperability testing are
Expand Down Expand Up @@ -186,6 +189,7 @@ Contributors to the `oqsprovider` include:
- Alex Zaslavsky
- Will Childs-Klein
- Thomas Bailleux
- Felipe Ventura

History
-------
Expand Down
3 changes: 3 additions & 0 deletions oqs-template/ALGORITHMS.md/oids.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
{%- for classical_alg in variant['mix_with'] %}
| {{ classical_alg['name'] }}_{{variant['name']}} | {{ classical_alg['oid'] }} | {%- if variant['enable'] -%} Yes {%- else -%} No {%- endif -%} | OQS_OID_{{ classical_alg['name']|upper }}_{{ variant['name']|upper }}
{%- endfor %}
{%- for composite_alg in variant['composite'] %}
| {{variant['name']}}_{{ composite_alg['name'] }} | {{ composite_alg['oid'] }} | {%- if variant['enable'] -%} Yes {%- else -%} No {%- endif -%} | OQS_OID_{{ variant['name']|upper }}_{{ composite_alg['name'] }}
{%- endfor %}
{%- endfor %}
{%- endfor %}

Expand Down
1 change: 1 addition & 0 deletions oqs-template/README.md/algs.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
`{{ variant['name'] }}`
{%- if variant['enable'] -%} \* {%- endif -%}
{%- for classical_alg in variant['mix_with'] -%} , `{{ classical_alg['name']}}_{{ variant['name'] }}`{%- if variant['enable'] -%} \* {%- endif -%}{%- endfor -%}
{%- for composite_alg in variant['composite'] -%} , `{{ variant['name'] }}_{{ composite_alg['name']}}`{%- if variant['enable'] -%} \* {%- endif -%}{%- endfor -%}
{%- if not loop.last %}, {% endif -%}
{%- endfor -%}
{%- endif -%}
Expand Down
70 changes: 70 additions & 0 deletions oqs-template/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,23 @@ sigs:
# 'pretty_name': 'RSA3072',
# 'oid': '1.3.9999.1.3',
# 'code_point': '0xfe02'}]
# composite:[{'name': 'p256',
# 'pretty_name': 'ECDSA p256',
# 'security': '128',
# 'oid': '2.16.840.1.114027.80.1.8'}]
-
# The Composite OIDs are kept up to date by @feventura (Entrust)
# These are prototype OIDs and are in line with draft-ounsworth-pq-composite-sigs-13
# OID scheme for composite variants:
baentsch marked this conversation as resolved.
Show resolved Hide resolved
# joint-iso-itu-t (2)
# country (16)
# us (840)
# organization (1)
# entrust (114027)
# algorithm (80)
# composite (8)
# signature (1)
# -
# OID scheme for hybrid variants of Dilithium:
# iso (1)
# identified-organization (3)
Expand All @@ -439,6 +455,8 @@ sigs:
# IBM (2)
# qsc (267)
# Dilithium-r3 (7)


family: 'CRYSTALS-Dilithium'
variants:
-
Expand Down Expand Up @@ -548,6 +566,26 @@ sigs:
'pretty_name': 'RSA3072',
'oid': '1.3.9999.7.2',
'code_point': '0xfed4'}]
composite: [{'name': 'pss2048',
'pretty_name': 'RSA PSS 2048',
'security': '112',
'oid': '2.16.840.1.114027.80.8.1.1'},
{'name': 'rsa2048',
'pretty_name': 'RSA2028',
'security': '112',
'oid': '2.16.840.1.114027.80.8.1.2'},
{'name': 'ed25519',
'pretty_name': 'ED25519',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.3'},
{'name': 'p256',
'pretty_name': 'ECDSA p256',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.4'},
{'name': 'bp256',
'pretty_name': 'ECDSA brainpoolP256r1',
'security': '256',
'oid': '2.16.840.1.114027.80.8.1.5'}]
-
name: 'mldsa65'
pretty_name: 'ML-DSA-65'
Expand All @@ -559,6 +597,26 @@ sigs:
'pretty_name': 'ECDSA p384',
'oid': '1.3.9999.7.3',
'code_point': '0xfed5'}]
composite: [{'name': 'pss3072',
'pretty_name': 'RSA PSS 3072',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.6'},
{'name': 'rsa3072',
'pretty_name': 'RSA 3072',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.7'},
{'name': 'p256',
'pretty_name': 'ECDSA p256',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.8'},
{'name': 'bp256',
'pretty_name': 'ECDSA brainpoolP256r1',
'security': '256',
'oid': '2.16.840.1.114027.80.8.1.9'},
{'name': 'ed25519',
'pretty_name': 'ED25519',
'security': '128',
'oid': '2.16.840.1.114027.80.8.1.10'}]
-
name: 'mldsa87'
pretty_name: 'ML-DSA-87'
Expand All @@ -570,6 +628,18 @@ sigs:
'pretty_name': 'ECDSA p521',
'oid': '1.3.9999.7.4',
'code_point': '0xfed6'}]
composite: [{'name': 'p384',
'pretty_name': 'ECDSA p384',
'security': '192',
'oid': '2.16.840.1.114027.80.8.1.11'},
{'name': 'bp384',
'pretty_name': 'ECDSA brainpoolP384r1',
'security': '384',
'oid': '2.16.840.1.114027.80.8.1.12'},
{'name': 'ed448',
'pretty_name': 'ED448',
'security': '192',
'oid': '2.16.840.1.114027.80.8.1.13'}]
-
# iso (1)
# identified-organization (3)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ MAKE_DECODER(, "{{ variant['name'] }}", {{ variant['name'] }}, oqsx, SubjectPubl
MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectPublicKeyInfo);
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo);
{%- endfor -%}
{%- endfor %}
{%- endfor %}

Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@
# define {{ classical_alg['name'] }}_{{ variant['name'] }}_input_type "{{ classical_alg['name'] }}_{{ variant['name'] }}"
# define {{ classical_alg['name'] }}_{{ variant['name'] }}_pem_type "{{ classical_alg['name'] }}_{{ variant['name'] }}"
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
# define {{ variant['name'] }}_{{ composite_alg['name'] }}_evp_type 0
# define {{ variant['name'] }}_{{ composite_alg['name'] }}_input_type "{{ variant['name'] }}_{{ composite_alg['name'] }}"
# define {{ variant['name'] }}_{{ composite_alg['name'] }}_pem_type "{{ variant['name'] }}_{{ composite_alg['name'] }}"
{%- endfor -%}
{%- endfor %}
{%- endfor %}

Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,15 @@ MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectP
MAKE_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }}, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, {{ classical_alg['name'] }}_{{ variant['name'] }});
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, EncryptedPrivateKeyInfo, pem);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, PrivateKeyInfo, pem);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo, der);
MAKE_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }}, oqsx, SubjectPublicKeyInfo, pem);
MAKE_TEXT_ENCODER(, {{ variant['name'] }}_{{ composite_alg['name'] }});
{%- endfor -%}
{%- endfor %}
{%- endfor %}

13 changes: 13 additions & 0 deletions oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_constructors.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ static void *{{ classical_alg['name'] }}_{{variant['name']}}_gen_init(void *prov
return oqsx_gen_init(provctx, selection, {{variant['oqs_meth']}}, "{{ classical_alg['name'] }}_{{variant['name']}}", KEY_TYPE_HYB_SIG, {{variant['security']}}, {{ count.val }});
}

{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
{%- set count.val = count.val + 1 %}
static void *{{ variant['name'] }}_{{ composite_alg['name'] }}_new_key(void *provctx)
{
return oqsx_key_new(PROV_OQS_LIBCTX_OF(provctx), {{variant['oqs_meth']}}, "{{ variant['name'] }}_{{ composite_alg['name'] }}", KEY_TYPE_CMP_SIG, NULL, {{composite_alg['security']}}, {{ count.val }});
}

static void *{{ variant['name'] }}_{{ composite_alg['name'] }}_gen_init(void *provctx, int selection)
{
return oqsx_gen_init(provctx, selection, {{variant['oqs_meth']}}, "{{ variant['name'] }}_{{ composite_alg['name'] }}", KEY_TYPE_CMP_SIG, {{composite_alg['security']}}, {{ count.val }});
}

{%- endfor -%}
{%- endfor %}
{% endfor %}
Expand Down
3 changes: 3 additions & 0 deletions oqs-template/oqsprov/oqs_kmgmt.c/keymgmt_functions.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ MAKE_SIG_KEYMGMT_FUNCTIONS({{variant['name']}})
{%- for classical_alg in variant['mix_with'] %}
MAKE_SIG_KEYMGMT_FUNCTIONS({{ classical_alg['name'] }}_{{variant['name']}})
{%- endfor -%}
{%- for composite_alg in variant['composite'] %}
MAKE_SIG_KEYMGMT_FUNCTIONS({{variant['name']}}_{{ composite_alg['name'] }})
{%- endfor -%}
{%- endfor %}
{%- endfor %}
{% for kem in config['kems'] %}
Expand Down
3 changes: 3 additions & 0 deletions oqs-template/oqsprov/oqs_prov.h/alg_functions.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_keymgmt_functions[];
{%- for classical_alg in variant['mix_with'] -%}
extern const OSSL_DISPATCH oqs_{{ classical_alg['name'] }}_{{ variant['name'] }}_keymgmt_functions[];
{%- endfor -%}
{%- for composite_alg in variant['composite'] -%}
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_keymgmt_functions[];
{%- endfor -%}
{%- endfor %}
{%- endfor %}
{% for kem in config['kems'] %}
Expand Down
11 changes: 11 additions & 0 deletions oqs-template/oqsprov/oqs_prov.h/endecoder_functions.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ extern const OSSL_DISPATCH oqs_{{ classical_alg['name'] }}_{{ variant['name'] }}
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_{{ classical_alg['name'] }}_{{ variant['name'] }}_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_{{ classical_alg['name'] }}_{{ variant['name'] }}_decoder_functions[];
{%- endfor -%}
{%- for composite_alg in variant['composite'] -%}
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_PrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_PrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_EncryptedPrivateKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_EncryptedPrivateKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_SubjectPublicKeyInfo_der_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_SubjectPublicKeyInfo_pem_encoder_functions[];
extern const OSSL_DISPATCH oqs_{{ variant['name'] }}_{{ composite_alg['name'] }}_to_text_encoder_functions[];
extern const OSSL_DISPATCH oqs_PrivateKeyInfo_der_to_{{ variant['name'] }}_{{ composite_alg['name'] }}_decoder_functions[];
extern const OSSL_DISPATCH oqs_SubjectPublicKeyInfo_der_to_{{ variant['name'] }}_{{ composite_alg['name'] }}_decoder_functions[];
{%- endfor -%}
{%- endfor %}
{%- endfor %}

4 changes: 4 additions & 0 deletions oqs-template/oqsprov/oqsdecoders.inc/make.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ DECODER_w_structure("{{ variant['name'] }}", der, SubjectPublicKeyInfo, {{ varia
DECODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", der, PrivateKeyInfo, {{ classical_alg['name'] }}_{{ variant['name'] }}),
DECODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", der, SubjectPublicKeyInfo, {{ classical_alg['name'] }}_{{ variant['name'] }}),
{%- endfor %}
{%- for composite_alg in variant['composite'] -%}
DECODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", der, PrivateKeyInfo, {{ variant['name'] }}_{{ composite_alg['name'] }}),
DECODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", der, SubjectPublicKeyInfo, {{ variant['name'] }}_{{ composite_alg['name'] }}),
{%- endfor %}
#endif
{%- endfor %}
{%- endfor %}
Expand Down
9 changes: 9 additions & 0 deletions oqs-template/oqsprov/oqsencoders.inc/make.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,15 @@ ENCODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ clas
ENCODER_w_structure("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}, pem, SubjectPublicKeyInfo),
ENCODER_TEXT("{{ classical_alg['name'] }}_{{ variant['name'] }}", {{ classical_alg['name'] }}_{{ variant['name'] }}),
{% endfor -%}
{% for composite_alg in variant['composite'] -%}
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, PrivateKeyInfo),
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, PrivateKeyInfo),
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, EncryptedPrivateKeyInfo),
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, EncryptedPrivateKeyInfo),
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, der, SubjectPublicKeyInfo),
ENCODER_w_structure("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}, pem, SubjectPublicKeyInfo),
ENCODER_TEXT("{{ variant['name'] }}_{{ composite_alg['name'] }}", {{ variant['name'] }}_{{ composite_alg['name'] }}),
{% endfor -%}
#endif
{%- endfor %}
{%- endfor %}
Expand Down
6 changes: 6 additions & 0 deletions oqs-template/oqsprov/oqsprov.c/assign_sig_oids.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{%- for variant in sig['variants'] %}
{%- set count.val = count.val + 1 -%}
{%- for classical_alg in variant['mix_with'] %}
{%- set count.val = count.val + 1 -%}
{%- endfor %}
{%- for composite_alg in variant['composite'] %}
{%- set count.val = count.val + 1 -%}
{%- endfor %}
{%- endfor %}
Expand Down Expand Up @@ -40,6 +43,9 @@ const char* oqs_oid_alg_list[OQS_OID_CNT] =
{%- for classical_alg in variant['mix_with'] %}
"{{ classical_alg['oid'] }}" , "{{ classical_alg['name'] }}_{{ variant['name'] }}",
{%- endfor %}
{%- for composite_alg in variant['composite'] %}
"{{ composite_alg['oid'] }}" , "{{ variant['name'] }}_{{ composite_alg['name'] }}",
{%- endfor %}
{%- endfor %}
{%- endfor %}

5 changes: 5 additions & 0 deletions oqs-template/oqsprov/oqsprov.c/encoding_patching.fragment
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}");
if (getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{ classical_alg['name']|upper }}_{{variant['name']|upper}}_ALGNAME");
{%- endfor %}
{%- for composite_alg in variant['composite'] %}
{%- set cnt.val = cnt.val + 2 %}
if (getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}")) oqs_alg_encoding_list[{{ cnt.val }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}");
baentsch marked this conversation as resolved.
Show resolved Hide resolved
if (getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}_ALGNAME")) oqs_alg_encoding_list[{{ cnt.val + 1 }}] = getenv("OQS_ENCODING_{{variant['name']|upper}}_{{ composite_alg['name']|upper }}_ALGNAME");
{%- endfor %}
{%- endfor %}
{%- endfor %}

Loading
Loading