Passa al contenuto principale

Appendix A. ASN.1 Module

Questa sezione conserva il testo RFC per ML-KEM in PKIX, inclusi algorithm identifiers, SubjectPublicKeyInfo, private key formats, ASN.1 objects, security considerations ed examples.

Appendix A.  ASN.1 Module

   This appendix includes the ASN.1 module [X680] for the ML-KEM.  Note
   that as per [RFC5280], certificates use the Distinguished Encoding
   Rules; see [X690].  This module imports objects from [RFC5912] and
   [RFC9629].

   <CODE BEGINS>
   X509-ML-KEM-2025
   { iso(1) identified-organization(3) dod(6)
     internet(1) security(5) mechanisms(5) pkix(7) id-mod(0)
     id-mod-x509-ml-kem-2025(121) }

   DEFINITIONS IMPLICIT TAGS ::= BEGIN

   EXPORTS ALL;

   IMPORTS

    PUBLIC-KEY
      FROM AlgorithmInformation-2009  -- [RFC 5912]
        { iso(1) identified-organization(3) dod(6) internet(1)
          security(5) mechanisms(5) pkix(7) id-mod(0)
          id-mod-algorithmInformation-02(58) }

    KEM-ALGORITHM
      FROM KEMAlgorithmInformation-2023  -- [RFC 9629]
        { iso(1) identified-organization(3) dod(6) internet(1)
          security(5) mechanisms(5) pkix(7) id-mod(0)
          id-mod-kemAlgorithmInformation-2023(109) };

   --
   -- ML-KEM Identifiers
   --

   nistAlgorithms OBJECT IDENTIFIER ::= { joint-iso-ccitt(2)
     country(16) us(840) organization(1) gov(101) csor(3)
     nistAlgorithm(4) }

   kems OBJECT IDENTIFIER ::= { nistAlgorithms 4 }

   id-alg-ml-kem-512 OBJECT IDENTIFIER ::= { kems 1 }

   id-alg-ml-kem-768 OBJECT IDENTIFIER ::= { kems 2 }

   id-alg-ml-kem-1024 OBJECT IDENTIFIER ::= { kems 3 }

   --
   -- Public Key Algorithms
   --

   PublicKeys PUBLIC-KEY ::= {
     -- This expands PublicKeys from [RFC 5912]
     pk-ml-kem-512 |
     pk-ml-kem-768 |
     pk-ml-kem-1024,
     ...
     }

   --
   -- ML-KEM Public Keys
   --

   pk-ml-kem-512 PUBLIC-KEY ::= {
     IDENTIFIER id-alg-ml-kem-512
     -- KEY no ASN.1 wrapping; 800 octets --
     PARAMS ARE absent
     CERT-KEY-USAGE { keyEncipherment }
     PRIVATE-KEY ML-KEM-512-PrivateKey
     }

   ML-KEM-512-PrivateKey ::= CHOICE {
     seed [0] OCTET STRING (SIZE (64)),
     expandedKey OCTET STRING (SIZE (1632)),
     both SEQUENCE {
         seed OCTET STRING (SIZE (64)),
         expandedKey OCTET STRING (SIZE (1632))
         }
     }

   pk-ml-kem-768 PUBLIC-KEY ::= {
     IDENTIFIER id-alg-ml-kem-768
     -- KEY no ASN.1 wrapping; 1184 octets --
     PARAMS ARE absent
     CERT-KEY-USAGE { keyEncipherment }
     PRIVATE-KEY ML-KEM-768-PrivateKey
     }

   ML-KEM-768-PrivateKey ::= CHOICE {
     seed [0] OCTET STRING (SIZE (64)),
     expandedKey OCTET STRING (SIZE (2400)),
     both SEQUENCE {
         seed OCTET STRING (SIZE (64)),
         expandedKey OCTET STRING (SIZE (2400))
         }
     }

   pk-ml-kem-1024 PUBLIC-KEY ::= {
     IDENTIFIER id-alg-ml-kem-1024
     -- KEY no ASN.1 wrapping; 1568 octets --
     PARAMS ARE absent
     CERT-KEY-USAGE { keyEncipherment }
     PRIVATE-KEY ML-KEM-1024-PrivateKey
     }

   ML-KEM-1024-PrivateKey ::= CHOICE {
     seed [0] OCTET STRING (SIZE (64)),
     expandedKey OCTET STRING (SIZE (3168)),
     both SEQUENCE {
         seed OCTET STRING (SIZE (64)),
         expandedKey OCTET STRING (SIZE (3168))
         }
     }

   ML-KEM-512-PublicKey ::= OCTET STRING (SIZE (800))

   ML-KEM-768-PublicKey ::= OCTET STRING (SIZE (1184))

   ML-KEM-1024-PublicKey ::= OCTET STRING (SIZE (1568))

   END
   <CODE ENDS>