You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
DateKeys/testdata/vectors/quicknet_rounds.json

108 lines
3.0 KiB

{
Implement capsule format 2 of spec v0.9 The reference moves to the DateKeys Protocol Specification v0.9, approved by its author on 29 September 2026. Encrypt writes capsule format 2 only; Open and Inspect read formats 1 and 2, and a format 1 capsule keeps the verdict v0.8.2 gave it. Format 2 (spec §22, §29.1, §31, §39): - VERSION in the PRELUDE is the capsule format, capsule.Format; any other value is ERR_UNSUPPORTED_VERSION at step 2. - CONTROL_CBOR has the schema version of its format. Version 2 adds key 6, payload_length (8 bytes, big-endian, at most L_MAX = 2^53 - 2^46), and key 7, padding (1 bloque256, 2 reforzado); it is 103 bytes without extensions, whatever L. - The payload is the content padded with zeros to P = rule(L). Step 17 checks the length and the zeros, and Open writes only the first L bytes. - INNER_ACCESS_AGE holds exactly 16 X25519 stanzas: 1 to 16 credentials, and a dummy in each slot left, in a uniformly random order. Writer rules (spec §62.1): EncryptOptions.Length is required and the source must deliver exactly that many bytes; recipients that are not canonical or of low order are rejected (agewrap.CheckX25519Recipient); self-checks of the header, the control, INNER_ACCESS_AGE and PAYLOAD_AGE. The CLI measures its input, takes -padding and reports the format. Test data: seven format 2 fixtures, padding vectors checked against math/big, format 2 CBOR vectors, and the mutation corpus in both formats with the 22 cases of the third list of spec §64, built without randomness by sealing the fixtures again with their known keys and nonces. The format 1 fixtures are kept byte for byte and never regenerated; the differential corpus keeps its 1825 cases and adds a block per format 2 fixture. The spec copy loses its "to be implemented" markers, and the READMEs, CHANGELOG, traceability and testdata/README.md follow v0.9. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 week ago
"spec": "0.9",
"profile": "datekeys:quicknet:v1",
"description": "Quicknet date to round resolution (spec §15, §16, §65), generated by the reference implementation.",
"vectors": [
{
"name": "genesis exactly: round 1",
"requested": "2023-08-23T15:09:27Z",
"round": 1,
"effective": "2023-08-23T15:09:27Z"
},
{
"name": "genesis + 1ns: next round",
"requested": "2023-08-23T15:09:27.000000001Z",
"round": 2,
"effective": "2023-08-23T15:09:30Z"
},
{
"name": "genesis + 1s",
"requested": "2023-08-23T15:09:28Z",
"round": 2,
"effective": "2023-08-23T15:09:30Z"
},
{
"name": "genesis + one period: round 2",
"requested": "2023-08-23T15:09:30Z",
"round": 2,
"effective": "2023-08-23T15:09:30Z"
},
{
"name": "genesis + one period + 1ns: round 3",
"requested": "2023-08-23T15:09:30.000000001Z",
"round": 3,
"effective": "2023-08-23T15:09:33Z"
},
{
"name": "genesis - 1s: before the profile",
"requested": "2023-08-23T15:09:26Z",
"error": "ERR_DATEKEY_INVALID"
},
{
"name": "round 1000 boundary exactly",
"requested": "2023-08-23T15:59:24Z",
"round": 1000,
"effective": "2023-08-23T15:59:24Z"
},
{
"name": "one second before the round 1000 boundary",
"requested": "2023-08-23T15:59:23Z",
"round": 1000,
"effective": "2023-08-23T15:59:24Z"
},
{
"name": "one second after the round 1000 boundary",
"requested": "2023-08-23T15:59:25Z",
"round": 1001,
"effective": "2023-08-23T15:59:27Z"
},
{
"name": "1ns after the round 1000 boundary",
"requested": "2023-08-23T15:59:24.000000001Z",
"round": 1001,
"effective": "2023-08-23T15:59:27Z"
},
{
"name": "half a second after the round 1000 boundary",
"requested": "2023-08-23T15:59:24.5Z",
"round": 1001,
"effective": "2023-08-23T15:59:27Z"
},
{
"name": "normative vector 2030-01-01 (spec §16)",
"requested": "2030-01-01T00:00:00Z",
"round": 66884212,
"effective": "2030-01-01T00:00:00Z"
},
{
"name": "1ns after 2030-01-01",
"requested": "2030-01-01T00:00:00.000000001Z",
"round": 66884213,
"effective": "2030-01-01T00:00:03Z"
},
{
"name": "normative vector round 66432123 (spec §16)",
"requested": "2029-12-16T07:15:33Z",
"round": 66432123,
"effective": "2029-12-16T07:15:33Z"
},
{
"name": "offset timezone equals UTC instant",
"requested": "2026-10-22T19:00:00.001+02:00",
"round": 33295013,
"effective": "2026-10-22T17:00:03Z"
},
{
"name": "last representable round time",
"requested": "9999-12-31T23:59:57Z",
"round": 83903165811,
"effective": "9999-12-31T23:59:57Z"
},
{
"name": "after the last representable round",
"requested": "9999-12-31T23:59:59Z",
"error": "ERR_DATEKEY_INVALID"
}
]
}

Powered by TurnKey Linux.