Skip to content

Commit

Permalink
changed composite dilithium to ML-*
Browse files Browse the repository at this point in the history
  • Loading branch information
feventura committed Feb 27, 2024
1 parent 9a1dbe4 commit 63fc458
Show file tree
Hide file tree
Showing 12 changed files with 957 additions and 991 deletions.
26 changes: 13 additions & 13 deletions ALGORITHMS.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,30 +139,30 @@ adapting the OIDs of all supported signature algorithms as per the table below.
| dilithium2 | 1.3.6.1.4.1.2.267.7.4.4 |Yes| OQS_OID_DILITHIUM2
| p256_dilithium2 | 1.3.9999.2.7.1 |Yes| OQS_OID_P256_DILITHIUM2
| rsa3072_dilithium2 | 1.3.9999.2.7.2 |Yes| OQS_OID_RSA3072_DILITHIUM2
| dilithium2_pss2048 | 2.16.840.1.114027.80.8.1.1 |Yes| OQS_OID_DILITHIUM2_pss2048
| dilithium2_rsa2048 | 2.16.840.1.114027.80.8.1.2 |Yes| OQS_OID_DILITHIUM2_rsa2048
| dilithium2_ed25519 | 2.16.840.1.114027.80.8.1.3 |Yes| OQS_OID_DILITHIUM2_ed25519
| dilithium2_p256 | 2.16.840.1.114027.80.8.1.4 |Yes| OQS_OID_DILITHIUM2_p256
| dilithium2_bp256 | 2.16.840.1.114027.80.8.1.5 |Yes| OQS_OID_DILITHIUM2_bp256
| dilithium3 | 1.3.6.1.4.1.2.267.7.6.5 |Yes| OQS_OID_DILITHIUM3
| p384_dilithium3 | 1.3.9999.2.7.3 |Yes| OQS_OID_P384_DILITHIUM3
| dilithium3_pss3072 | 2.16.840.1.114027.80.8.1.6 |Yes| OQS_OID_DILITHIUM3_pss3072
| dilithium3_rsa3072 | 2.16.840.1.114027.80.8.1.7 |Yes| OQS_OID_DILITHIUM3_rsa3072
| dilithium3_p256 | 2.16.840.1.114027.80.8.1.8 |Yes| OQS_OID_DILITHIUM3_p256
| dilithium3_bp256 | 2.16.840.1.114027.80.8.1.9 |Yes| OQS_OID_DILITHIUM3_bp256
| dilithium3_ed25519 | 2.16.840.1.114027.80.8.1.10 |Yes| OQS_OID_DILITHIUM3_ed25519
| dilithium5 | 1.3.6.1.4.1.2.267.7.8.7 |Yes| OQS_OID_DILITHIUM5
| p521_dilithium5 | 1.3.9999.2.7.4 |Yes| OQS_OID_P521_DILITHIUM5
| dilithium5_p384 | 2.16.840.1.114027.80.8.1.11 |Yes| OQS_OID_DILITHIUM5_p384
| dilithium5_bp384 | 2.16.840.1.114027.80.8.1.12 |Yes| OQS_OID_DILITHIUM5_bp384
| dilithium5_ed448 | 2.16.840.1.114027.80.8.1.13 |Yes| OQS_OID_DILITHIUM5_ed448
| 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.6 |Yes| OQS_OID_FALCON512
| p256_falcon512 | 1.3.9999.3.7 |Yes| OQS_OID_P256_FALCON512
| rsa3072_falcon512 | 1.3.9999.3.8 |Yes| OQS_OID_RSA3072_FALCON512
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ This implementation makes available the following quantum safe algorithms:

### Signature algorithms

- **CRYSTALS-Dilithium**:`dilithium2`\*, `p256_dilithium2`\*, `rsa3072_dilithium2`\*, `dilithium2_pss2048`\*, `dilithium2_rsa2048`\*, `dilithium2_ed25519`\*, `dilithium2_p256`\*, `dilithium2_bp256`\*, `dilithium3`\*, `p384_dilithium3`\*, `dilithium3_pss3072`\*, `dilithium3_rsa3072`\*, `dilithium3_p256`\*, `dilithium3_bp256`\*, `dilithium3_ed25519`\*, `dilithium5`\*, `p521_dilithium5`\*, `dilithium5_p384`\*, `dilithium5_bp384`\*, `dilithium5_ed448`\*
- **ML-DSA**:`mldsa44`\*, `p256_mldsa44`\*, `rsa3072_mldsa44`\*, `mldsa65`\*, `p384_mldsa65`\*, `mldsa87`\*, `p521_mldsa87`\*
- **CRYSTALS-Dilithium**:`dilithium2`\*, `p256_dilithium2`\*, `rsa3072_dilithium2`\*, `dilithium3`\*, `p384_dilithium3`\*, `dilithium5`\*, `p521_dilithium5`\*
- **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`\*, `falcon512_p256`\*, `falcon512_bp256`\*, `falcon512_ed25519`\*, `falcon1024`\*, `p521_falcon1024`\*

- **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 Down
104 changes: 52 additions & 52 deletions oqs-template/generate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -467,26 +467,6 @@ sigs:
'pretty_name': 'RSA3072',
'oid': '1.3.9999.2.7.2',
'code_point': '0xfea2'}]
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: 'dilithium3'
pretty_name: 'Dilithium3'
Expand All @@ -499,26 +479,6 @@ sigs:
'pretty_name': 'ECDSA p384',
'oid': '1.3.9999.2.7.3',
'code_point': '0xfea4'}]
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: 'dilithium5'
pretty_name: 'Dilithium5'
Expand All @@ -531,18 +491,6 @@ sigs:
'pretty_name': 'ECDSA p521',
'oid': '1.3.9999.2.7.4',
'code_point': '0xfea6'}]
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'}]
-
name: 'dilithium2_aes'
pretty_name: 'Dilithium2_AES'
Expand Down Expand Up @@ -610,6 +558,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 @@ -621,6 +589,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 @@ -632,6 +620,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
62 changes: 26 additions & 36 deletions oqsprov/oqs_decode_der2key.c
Original file line number Diff line number Diff line change
Expand Up @@ -693,64 +693,54 @@ MAKE_DECODER(, "p256_dilithium2", p256_dilithium2, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "rsa3072_dilithium2", rsa3072_dilithium2, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_pss2048", dilithium2_pss2048, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_rsa2048", dilithium2_rsa2048, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_ed25519", dilithium2_ed25519, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_p256", dilithium2_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium2_bp256", dilithium2_bp256, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3", dilithium3, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3", dilithium3, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p384_dilithium3", p384_dilithium3, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "p384_dilithium3", p384_dilithium3, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_pss3072", dilithium3_pss3072, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_rsa3072", dilithium3_rsa3072, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_p256", dilithium3_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_bp256", dilithium3_bp256, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium3_ed25519", dilithium3_ed25519, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5", dilithium5, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5", dilithium5, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p521_dilithium5", p521_dilithium5, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "p521_dilithium5", p521_dilithium5, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_p384", dilithium5_p384, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_bp384", dilithium5_bp384, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "dilithium5_ed448", dilithium5_ed448, oqsx,
SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44", mldsa44, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44", mldsa44, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p256_mldsa44", p256_mldsa44, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "p256_mldsa44", p256_mldsa44, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "rsa3072_mldsa44", rsa3072_mldsa44, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "rsa3072_mldsa44", rsa3072_mldsa44, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44_pss2048", mldsa44_pss2048, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44_pss2048", mldsa44_pss2048, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44_rsa2048", mldsa44_rsa2048, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44_rsa2048", mldsa44_rsa2048, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44_ed25519", mldsa44_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44_ed25519", mldsa44_ed25519, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44_p256", mldsa44_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44_p256", mldsa44_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa44_bp256", mldsa44_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa44_bp256", mldsa44_bp256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65", mldsa65, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65", mldsa65, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p384_mldsa65", p384_mldsa65, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "p384_mldsa65", p384_mldsa65, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65_pss3072", mldsa65_pss3072, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65_pss3072", mldsa65_pss3072, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65_rsa3072", mldsa65_rsa3072, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65_rsa3072", mldsa65_rsa3072, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65_p256", mldsa65_p256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65_p256", mldsa65_p256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65_bp256", mldsa65_bp256, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65_bp256", mldsa65_bp256, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa65_ed25519", mldsa65_ed25519, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa65_ed25519", mldsa65_ed25519, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa87", mldsa87, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa87", mldsa87, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p521_mldsa87", p521_mldsa87, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "p521_mldsa87", p521_mldsa87, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa87_p384", mldsa87_p384, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa87_p384", mldsa87_p384, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa87_bp384", mldsa87_bp384, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa87_bp384", mldsa87_bp384, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "mldsa87_ed448", mldsa87_ed448, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "mldsa87_ed448", mldsa87_ed448, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "falcon512", falcon512, oqsx, PrivateKeyInfo);
MAKE_DECODER(, "falcon512", falcon512, oqsx, SubjectPublicKeyInfo);
MAKE_DECODER(, "p256_falcon512", p256_falcon512, oqsx, PrivateKeyInfo);
Expand Down
Loading

0 comments on commit 63fc458

Please sign in to comment.