feat(versioning): snapshot corpus per spec version
A frozen spec is only meaningful if it's paired with the corpus that was current at release time — otherwise a v0.1.0 reader follows "see corpus/payloads/ack/" and lands on a file whose test vectors may have changed since v0.1.0 was cut. Three changes: 1. `cut-version` now copies BOTH src/ AND corpus/ into the snapshot directory. A release is the pair, not just the text. 2. The corpus URL rewriting in cut-version now retargets /tree/main/corpus -> /tree/main/versions/<v>/corpus (and the blob variant). This lets the link resolve on GitHub from main alone — no git tag required, since the frozen copy is a real path under main. Downgrades the "tag is REQUIRED" message from last commit back to "optionally tag the commit". 3. The frozen corpus's spec_ref fields get rewritten too: from `src/04-payload-ack.md` to `versions/<v>/04-payload-ack.md`, so a reader following a test vector lands on the spec text the vector was paired with at release time. versions/v0.1.0/ regenerated from scratch via `just cut-version v0.1.0` to pick up the corpus snapshot + the new sed patterns. The release is now self-consistent: v0.1.0 spec links go to v0.1.0 corpus, which links back to v0.1.0 spec. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
71 files changed
+5924
-28
No files matched your search
@@ -0,0 +1,113 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "AES-128-ECB Block Padding",
|
||||
"spec_ref": "versions/v0.1.0/14-crypto.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Tests AES-128-ECB zero-padding for partial blocks. MeshCore pads the final block with zeros before encryption.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "aes-pad-001",
|
||||
"description": "5-byte plaintext 'Hello' padded to 16 bytes with zeros",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "D9FD218D50A4409143A7243D6D913502"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 D9FD218D50A4409143A7243D6D913502",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "48656C6C6F"
|
||||
},
|
||||
"notes": "Padded input: 48656C6C6F 0000000000000000000000. Output: 1 block."
|
||||
},
|
||||
{
|
||||
"id": "aes-pad-002",
|
||||
"description": "15-byte plaintext padded with 1 zero byte",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "BF70C038D511F2A8B528E06691C6D42D"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 BF70C038D511F2A8B528E06691C6D42D",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "000102030405060708090A0B0C0D0E"
|
||||
},
|
||||
"notes": "15 bytes padded with 1 zero: 000102...0E00. Output: 1 block."
|
||||
},
|
||||
{
|
||||
"id": "aes-pad-003",
|
||||
"description": "16-byte plaintext: no padding needed",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "0A940BB5416EF045F1C39458C653EA5A"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 0A940BB5416EF045F1C39458C653EA5A",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "000102030405060708090A0B0C0D0E0F"
|
||||
},
|
||||
"notes": "Exact block boundary: no padding. Output: 1 block."
|
||||
},
|
||||
{
|
||||
"id": "aes-pad-004",
|
||||
"description": "17-byte plaintext: 2 blocks, second padded with 15 zeros",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "0A940BB5416EF045F1C39458C653EA5A299F7C29A3E13AE7F64ECBA062FC7560"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 0A940BB5416EF045F1C39458C653EA5A299F7C29A3E13AE7F64ECBA062FC7560",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "000102030405060708090A0B0C0D0E0F10"
|
||||
},
|
||||
"notes": "Block 1: 000102...0F (no pad). Block 2: 10 + 15 zeros. Output: 2 blocks = 32 bytes."
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
{
|
||||
"$schema": "../../schema/test-vector.schema.json",
|
||||
"name": "AES-128-ECB Encryption",
|
||||
"spec_ref": "versions/v0.1.0/14-crypto.md",
|
||||
"protocol_version": 0,
|
||||
"description": "Standalone AES-128-ECB encryption test vectors. Key is the first 16 bytes of the shared secret. These vectors test the raw encryption operation without MAC.",
|
||||
"vectors": [
|
||||
{
|
||||
"id": "aes-001",
|
||||
"description": "AES-128-ECB: key=00..0F, plaintext=all zeros",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "C6A13B37878F5B826F4F8162A1C8D879"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 C6A13B37878F5B826F4F8162A1C8D879",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "00000000000000000000000000000000"
|
||||
},
|
||||
"notes": "AES-128-ECB(key=00..0F, pt=00×16) = C6A13B37878F5B826F4F8162A1C8D879. Wrapped in RAW_CUSTOM for schema compliance."
|
||||
},
|
||||
{
|
||||
"id": "aes-002",
|
||||
"description": "AES-128-ECB: key=00..0F, plaintext=all FF",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "3C441F32CE07822364D7A2990E50BB13"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 3C441F32CE07822364D7A2990E50BB13",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "aes-003",
|
||||
"description": "AES-128-ECB: key=00..0F, plaintext=00..0F (sequential)",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "0A940BB5416EF045F1C39458C653EA5A"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 0A940BB5416EF045F1C39458C653EA5A",
|
||||
"crypto_context": {
|
||||
"encryption_key": "000102030405060708090A0B0C0D0E0F",
|
||||
"plaintext": "000102030405060708090A0B0C0D0E0F"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": "aes-004",
|
||||
"description": "AES-128-ECB: key=all FF, plaintext=all zeros",
|
||||
"type": "encode_decode",
|
||||
"structured": {
|
||||
"header": {
|
||||
"version": 0,
|
||||
"payload_type": "raw_custom",
|
||||
"route_type": "flood"
|
||||
},
|
||||
"path": {
|
||||
"hash_size": 1,
|
||||
"hash_count": 0,
|
||||
"hashes": []
|
||||
},
|
||||
"payload": {
|
||||
"data": "A1F6258C877D5FCD8964484538BFC92C"
|
||||
}
|
||||
},
|
||||
"binary": "3D 00 A1F6258C877D5FCD8964484538BFC92C",
|
||||
"crypto_context": {
|
||||
"encryption_key": "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF",
|
||||
"plaintext": "00000000000000000000000000000000"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in new issue
Block a user