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

Drop DER encoding for composite ML-KEM functions #94

Merged
merged 13 commits into from
Nov 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
87 changes: 34 additions & 53 deletions Composite-MLKEM-2024.asn
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,6 @@ KEM-ALGORITHM
{ iso(1) identified-organization(3) dod(6) internet(1)
security(5) mechanisms(5) pkix(7) id-mod(0)
id-mod-kemAlgorithmInformation-2023(109) }

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) }

;


Expand All @@ -50,42 +31,42 @@ RSAPublicKey, ECPoint
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 }

--
-- Composite KEM basic structures
--

CompositeKEMPublicKey ::= SEQUENCE SIZE (2) OF BIT STRING
-- When a CompositeKEMPublicKey is used with an RSA public key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- an RSAPublicKey (which is a DER encoded RSAPublicKey).

-- When a CompositeKEMPublicKey is used with an EC public key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- an ECDHPublicKey (which is a DER encoded ECPoint).

-- When a CompositeKEMPublicKey is used with an Edwards public key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- a raw Edwards public key according to [RFC8410].

CompositeKEMPublicKeyOs ::= OCTET STRING (CONTAINING
CompositeKEMPublicKey ENCODED BY der)
CompositeKEMPublicKey ::= BIT STRING

CompositeKEMPublicKeyBs ::= BIT STRING (CONTAINING
CompositeKEMPublicKey ENCODED BY der)
-- When a CompositeKEMPrivateKey is used with an RSA private key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- an RSAPrivateKey (which is a DER encoded RSAPrivateKey).

CompositeKEMPrivateKey ::= SEQUENCE SIZE (2) OF OCTET STRING
-- When a CompositeKEMPrivateKey is used with an EC private key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- an ECDHPrivateKey (which is a DER encoded ECPoint).

CompositeCiphertextValue ::= SEQUENCE SIZE (2) OF OCTET STRING
-- When a CompositeKEMPrivateKey is used with an Edwards private key, the BIT STRING itself is generated
-- by the concatenation of a raw ML-KEM key according to {{I-D.ietf-lamps-kyber-certificates}} and
-- a raw Edwards private key according to [RFC8410].

RsaCompositeKemPublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (CONTAINING RSAPublicKey)
}
CompositeKEMPrivateKey ::= OCTET STRING

EcCompositeKemPublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (CONTAINING ECPoint)
}
-- Composite Ciphertext Value is just an OCTET STRING and is a concatenation of the component ciphertext
-- values.

EdCompositeKemPublicKey ::= SEQUENCE {
firstPublicKey BIT STRING (ENCODED BY id-raw-key),
secondPublicKey BIT STRING (ENCODED BY id-raw-key)
}
CompositeCiphertextValue ::= OCTET STRING

--
-- Information Object Classes
Expand Down Expand Up @@ -125,7 +106,7 @@ id-MLKEM768-RSA2048 OBJECT IDENTIFIER ::= {
pk-MLKEM768-RSA2048 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-RSA2048,
RsaCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-RSA2048 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -142,7 +123,7 @@ id-MLKEM768-RSA3072 OBJECT IDENTIFIER ::= {
pk-MLKEM768-RSA3072 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-RSA3072,
RsaCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-RSA3072 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -159,7 +140,7 @@ id-MLKEM768-RSA4096 OBJECT IDENTIFIER ::= {
pk-MLKEM768-RSA4096 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-RSA4096,
RsaCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-RSA4096 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -175,7 +156,7 @@ id-MLKEM768-ECDH-P384 OBJECT IDENTIFIER ::= {
pk-MLKEM768-ECDH-P384 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-ECDH-P384,
EcCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-ECDH-P384 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -191,7 +172,7 @@ id-MLKEM768-ECDH-brainpoolP256r1 OBJECT IDENTIFIER ::= {
pk-MLKEM768-ECDH-brainpoolP256r1 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-ECDH-brainpoolP256r1,
EcCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-ECDH-brainpoolP256r1 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -207,7 +188,7 @@ id-MLKEM768-X25519 OBJECT IDENTIFIER ::= {
pk-MLKEM768-X25519 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM768-X25519,
EdCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM768-X25519 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -224,7 +205,7 @@ id-MLKEM1024-ECDH-P384 OBJECT IDENTIFIER ::= {
pk-MLKEM1024-ECDH-P384 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM1024-ECDH-P384,
EcCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM1024-ECDH-P384 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -240,7 +221,7 @@ id-MLKEM1024-ECDH-brainpoolP384r1 OBJECT IDENTIFIER ::= {
pk-MLKEM1024-ECDH-brainpoolP384r1 PUBLIC-KEY ::=
pk-CompositeKEM{
id-MLKEM1024-ECDH-brainpoolP384r1,
EcCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM1024-ECDH-brainpoolP384r1 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand All @@ -256,7 +237,7 @@ id-MLKEM1024-X448 OBJECT IDENTIFIER ::= {
pk-MLKEM1024-X448 PUBLIC-KEY ::=
pk-CompositeKEM {
id-MLKEM1024-X448,
EdCompositeKemPublicKey }
CompositeKEMPublicKey }

kema-MLKEM1024-X448 KEM-ALGORITHM ::=
kema-CompositeKEM{
Expand Down
Loading