7.4 Object Encoding

Every object is a sequence of fields in a fixed order with no padding. No field is optional. Where a field's size varies, a length precedes it.

7.4.1 The header #

Every object begins with these 6 bytes.

FieldTypeValue
magicu8[3]50 53 4f, the ASCII bytes PSO
kindu8What the object is (§7.B)
versionu8The format version. This chapter specifies 0x01.
reservedu80x00

A verifier MUST treat an object whose magic, version, or reserved differs from these values as malformed, and MUST treat an object as malformed if its kind is not the kind the context calls for.

7.4.2 Malformed objects #

An object is malformed if it does not decode exactly as its layout gives: a field out of its permitted range, a length that runs past the end of the object, a reserved bit that is set, or any byte after the last field. A verifier MUST NOT repair, truncate, or reinterpret a malformed object.

7.4.3 Hashes #

Every hash in this chapter is SHA-512 (FIPS 180-4), 64 bytes, carried as raw bytes.

The object hash of an object is the hash of all of its bytes, from the first byte of the header through the last byte of its signature.

The key hash of a key is the hash of its key type byte followed by the key's bytes.

Where a hash names a file in the trust store or in a directory of certificates, the name is the hash in lowercase hexadecimal, 128 characters.

7.4.4 Keys #

A key is a key type and the raw public key that the type implies.

Key typeAlgorithmPublic keySignature
0x01ML-DSA-651952 bytes3309 bytes
0x02ML-DSA-872592 bytes4627 bytes

The enumeration is closed (§7.15). A public key is the raw encoding of FIPS 204, with no wrapper.

7.4.5 Signatures #

A signature is the last field of the object it signs, and covers every byte of the object before it, the header included.

ML-DSA.Sign(private_key, bytes_before_signature, ctx = "")

This is pure ML-DSA, FIPS 204 Algorithm 2, with an empty context string. An authority MUST NOT use the pre-hashing variant and MUST NOT set a context.

The issuer's key decides the algorithm. A signed object does not name the algorithm of its own signature. A verifier takes the algorithm, and so the length of the signature field, from the key type of the issuer the object names. A verifier MUST NOT take either from anything in the object being verified.

Edit this page