Skip to content

Commit

Permalink
Merge pull request #89 from lamps-wg/85_RemoveASN1Wrapping
Browse files Browse the repository at this point in the history
Removing DER wrapper
  • Loading branch information
johngray-dev authored Nov 27, 2024
2 parents bd4d0ed + 6b1326b commit d606485
Show file tree
Hide file tree
Showing 2 changed files with 301 additions and 155 deletions.
146 changes: 55 additions & 91 deletions Composite-MLDSA-2024.asn
Original file line number Diff line number Diff line change
Expand Up @@ -14,30 +14,6 @@ IMPORTS
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-algorithmInformation-02(58) }

SubjectPublicKeyInfo
FROM PKIX1Explicit-2009
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-pkix1-explicit-02(51) }

OneAsymmetricKey
FROM AsymmetricKeyPackageModuleV1
{ iso(1) member-body(2) us(840) rsadsi(113549) pkcs(1)
pkcs-9(9) smime(16) modules(0)
id-mod-asymmetricKeyPkgV1(50) }

RSAPublicKey, ECPoint
FROM PKIXAlgs-2009
{ iso(1) identified-organization(3) dod(6)
internet(1) security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-pkix1-algorithms2008-02(56) }

sa-rsaSSA-PSS
FROM PKIX1-PSS-OAEP-Algorithms-2009
{iso(1) identified-organization(3) dod(6) internet(1) security(5)
mechanisms(5) pkix(7) id-mod(0) id-mod-pkix1-rsa-pkalgs-02(54)}

;

--
Expand All @@ -48,60 +24,48 @@ IMPORTS
der OBJECT IDENTIFIER ::=
{joint-iso-itu-t asn1(1) ber-derived(2) distinguished-encoding(1)}


-- Just for testing, to be assigned by IANA
id-raw-key OBJECT IDENTIFIER ::= {
joint-iso-itu-t(2) country(16) us(840) organization(1)
entrust(114027) algorithm(80) composite(8) raw(999) 1 }


--
-- Signature Algorithm
--


--
-- Composite Signature basic structures
--

CompositeSignaturePublicKey ::= SEQUENCE SIZE (2) OF BIT STRING

CompositeSignaturePublicKeyOs ::= OCTET STRING (CONTAINING
CompositeSignaturePublicKey ENCODED BY der)
--
-- When a CompositeMLDSAPublicKey is used with an RSA public key, the BIT STRING is generated
-- by the concatenation of a raw ML-DSA key according to {{I-D.ietf-lamps-dilithium-certificates}},
-- and an RSAPublicKey (which is a DER encoded RSAPublicKey).

CompositeSignaturePublicKeyBs ::= BIT STRING (CONTAINING
CompositeSignaturePublicKey ENCODED BY der)
-- When a CompositeMLDSAPublicKey is used with an EC public key, the BIT STRING is generated
-- by the concatenation of a raw ML-DSA key according to {{I-D.ietf-lamps-dilithium-certificates}}
-- and an ECDSAPublicKey according to [RFC5480].

CompositeSignaturePrivateKey ::= SEQUENCE SIZE (2) OF OCTET STRING
-- When a CompositeMLDSAPublicKey is used with an Edwards public key, the BIT STRING is generated
-- by the concatenation of a raw ML-DSA key according to {{I-D.ietf-lamps-dilithium-certificates}}
-- and a raw Edwards public key according to [RFC8410].

CompositeSignatureValue ::= SEQUENCE SIZE (2) OF BIT STRING
CompositeMLDSAPublicKey ::= BIT STRING

RsaCompositeSignaturePublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (CONTAINING RSAPublicKey)
}
--
-- When a CompositeMLDSAPrivateKey is used with an RSA public key, the OCTET STRING is generated
-- by the concatenation of an ML-DSA private key according to {{I-D.ietf-lamps-dilithium-certificates}},
-- and an RSAPrivateKey (which is a DER encoded RSAPrivateKey).

EcCompositeSignaturePublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (CONTAINING ECPoint)
}
-- When a CompositeMLDSAPrivateKey is used with an EC public key, the OCTET STRING is generated
-- by the concatenation of an ML-DSA private key according to {{I-D.ietf-lamps-dilithium-certificates}},
-- and an ECDSAPrivateKey according to [RFC5915].

EdCompositeSignaturePublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (ENCODED BY id-raw-key)
}
-- When a CompositeMLDSAPrivateKey is used with an Edwards public key, the OCTET STRING is generated
-- by the concatenation of an ML-DSA private key according to {{I-D.ietf-lamps-dilithium-certificates}},
-- and a raw Edwards private key according to [RFC8410].

-- Composite Signature Value is just a sequence of OCTET STRINGS
CompositeMLDSAPrivateKey ::= OCTET STRING

-- CompositeSignaturePair{FirstSignatureValue, SecondSignatureValue} ::=
-- SEQUENCE {
-- signaturevalue1 FirstSignatureValue,
-- signaturevalue2 SecondSignatureValue }
-- Composite Signature Value is just an BIT STRING and is a concatenation of the component signature
-- algorithms.

-- An Explicit Compsite Signature is a set of Signatures which
-- are composed of OCTET STRINGS
-- ExplicitCompositeSignatureValue ::= CompositeSignaturePair {
-- OCTET STRING,OCTET STRING}
CompositeSignatureValue ::= BIT STRING


--
Expand Down Expand Up @@ -134,7 +98,7 @@ id-MLDSA44-RSA2048-PSS OBJECT IDENTIFIER ::= {

pk-MLDSA44-RSA2048-PSS PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA44-RSA2048-PSS,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA44-RSA2048-PSS SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -148,7 +112,7 @@ id-MLDSA44-RSA2048-PKCS15 OBJECT IDENTIFIER ::= {

pk-MLDSA44-RSA2048-PKCS15 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA44-RSA2048-PKCS15,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA44-RSA2048-PKCS15 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -163,7 +127,7 @@ id-MLDSA44-Ed25519 OBJECT IDENTIFIER ::= {

pk-MLDSA44-Ed25519 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA44-Ed25519,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA44-Ed25519 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -178,7 +142,7 @@ id-MLDSA44-ECDSA-P256 OBJECT IDENTIFIER ::= {

pk-MLDSA44-ECDSA-P256 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA44-ECDSA-P256,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA44-ECDSA-P256 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -193,7 +157,7 @@ id-MLDSA65-RSA3072-PSS OBJECT IDENTIFIER ::= {

pk-MLDSA65-RSA3072-PSS PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-RSA3072-PSS,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-RSA3072-PSS SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -208,7 +172,7 @@ id-MLDSA65-RSA3072-PKCS15 OBJECT IDENTIFIER ::= {

pk-MLDSA65-RSA3072-PKCS15 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-RSA3072-PKCS15,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-RSA3072-PKCS15 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -222,7 +186,7 @@ id-MLDSA65-RSA4096-PSS OBJECT IDENTIFIER ::= {

pk-MLDSA65-RSA4096-PSS PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-RSA4096-PSS,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-RSA4096-PSS SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -237,12 +201,12 @@ id-MLDSA65-RSA4096-PKCS15 OBJECT IDENTIFIER ::= {

pk-MLDSA65-RSA4096-PKCS15 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-RSA4096-PKCS15,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-RSA4096-PKCS15 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
id-MLDSA65-RSA4096-SHA512,
pk-MLDSA65-RSA4096-SHA512 }
id-MLDSA65-RSA4096-PKCS15,
pk-MLDSA65-RSA4096-PKCS15 }

-- TODO: OID to be replaced by IANA
id-MLDSA65-ECDSA-P384 OBJECT IDENTIFIER ::= {
Expand All @@ -251,7 +215,7 @@ id-MLDSA65-ECDSA-P384 OBJECT IDENTIFIER ::= {

pk-MLDSA65-ECDSA-P384 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-ECDSA-P384,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-ECDSA-P256 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -266,7 +230,7 @@ id-MLDSA65-ECDSA-brainpoolP256r1 OBJECT IDENTIFIER ::= {

pk-MLDSA65-ECDSA-brainpoolP256r1 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-ECDSA-brainpoolP256r1,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-ECDSA-brainpoolP256r1 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -281,7 +245,7 @@ id-MLDSA65-Ed25519 OBJECT IDENTIFIER ::= {

pk-MLDSA65-Ed25519 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA65-Ed25519,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA65-Ed25519 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -296,7 +260,7 @@ id-MLDSA87-ECDSA-P384 OBJECT IDENTIFIER ::= {

pk-MLDSA87-ECDSA-P384 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA87-ECDSA-P384,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA87-ECDSA-P384 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -311,7 +275,7 @@ id-MLDSA87-ECDSA-brainpoolP384r1 OBJECT IDENTIFIER ::= {

pk-MLDSA87-ECDSA-brainpoolP384r1 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA87-ECDSA-brainpoolP384r1,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA87-ECDSA-brainpoolP384r1 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -326,7 +290,7 @@ id-MLDSA87-Ed448 OBJECT IDENTIFIER ::= {

pk-MLDSA87-Ed448 PUBLIC-KEY ::=
pk-CompositeSignature{ id-MLDSA87-Ed448,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-MLDSA87-Ed448 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -343,7 +307,7 @@ id-HashMLDSA44-RSA2048-PSS-SHA256 OBJECT IDENTIFIER ::= {

pk-HashMLDSA44-RSA2048-PSS-SHA256 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA44-RSA2048-PSS-SHA256,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA44-RSA2048-PSS-SHA256 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -357,7 +321,7 @@ id-HashMLDSA44-RSA2048-PKCS15-SHA256 OBJECT IDENTIFIER ::= {

pk-HashMLDSA44-RSA2048-PKCS15-SHA256 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA44-RSA2048-PKCS15-SHA256,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA44-RSA2048-PKCS15-SHA256 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -372,7 +336,7 @@ id-HashMLDSA44-Ed25519-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA44-Ed25519-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA44-Ed25519-SHA512,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA44-Ed25519-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -387,7 +351,7 @@ id-HashMLDSA44-ECDSA-P256-SHA256 OBJECT IDENTIFIER ::= {

pk-HashMLDSA44-ECDSA-P256-SHA256 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA44-ECDSA-P256-SHA256,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA44-ECDSA-P256-SHA256 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -402,7 +366,7 @@ id-HashMLDSA65-RSA3072-PSS-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-RSA3072-PSS-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-RSA3072-PSS-SHA512,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-RSA3072-PSS-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -417,7 +381,7 @@ id-HashMLDSA65-RSA3072-PKCS15-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-RSA3072-PKCS15-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-RSA3072-PKCS15-SHA512,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-RSA3072-PKCS15-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -431,7 +395,7 @@ id-HashMLDSA65-RSA4096-PSS-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-RSA4096-PSS-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-RSA4096-PSS-SHA512,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-RSA4096-PSS-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -446,7 +410,7 @@ id-HashMLDSA65-RSA4096-PKCS15-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-RSA4096-PKCS15-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-RSA4096-PKCS15-SHA512,
RsaCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-RSA4096-PKCS15-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -460,7 +424,7 @@ id-HashMLDSA65-ECDSA-P384-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-ECDSA-P384-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-ECDSA-P384-SHA512,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-ECDSA-P256-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -475,7 +439,7 @@ id-HashMLDSA65-ECDSA-brainpoolP256r1-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-ECDSA-brainpoolP256r1-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-ECDSA-brainpoolP256r1-SHA512,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-ECDSA-brainpoolP256r1-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -490,7 +454,7 @@ id-HashMLDSA65-Ed25519-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA65-Ed25519-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA65-Ed25519-SHA512,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA65-Ed25519-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -505,7 +469,7 @@ id-HashMLDSA87-ECDSA-P384-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA87-ECDSA-P384-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA87-ECDSA-P384-SHA512,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA87-ECDSA-P384-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -520,7 +484,7 @@ id-HashMLDSA87-ECDSA-brainpoolP384r1-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA87-ECDSA-brainpoolP384r1-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA87-ECDSA-brainpoolP384r1-SHA512,
EcCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA87-ECDSA-brainpoolP384r1-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand All @@ -535,7 +499,7 @@ id-HashMLDSA87-Ed448-SHA512 OBJECT IDENTIFIER ::= {

pk-HashMLDSA87-Ed448-SHA512 PUBLIC-KEY ::=
pk-CompositeSignature{ id-HashMLDSA87-Ed448-SHA512,
EdCompositeSignaturePublicKey}
CompositeMLDSAPublicKey}

sa-HashMLDSA87-Ed448-SHA512 SIGNATURE-ALGORITHM ::=
sa-CompositeSignature{
Expand Down
Loading

0 comments on commit d606485

Please sign in to comment.