Set up the protocol spec as an mdBook and add a GitHub Actions workflow that builds it on every push/PR and deploys to GitHub Pages on main. The repo is now both a machine-readable corpus and a browsable, searchable site. Structure changes (one-time, mechanical): - Rename the spec source directory from `spec/` to `src/` to match mdBook's default convention. All 21 chapter files move; their internal relative cross-links are unchanged. - Add `src/SUMMARY.md` as the mdBook table of contents, grouping chapters under Wire Format, Payloads, Cryptography & Identity, and Routing & Higher-Layer Protocols. - Add `book.toml` at repo root: title, author, search enabled, fold enabled, edit-on-GitHub links, navy theme. - Add `.github/workflows/mdbook.yml`: build on push + PR, deploy on push to main only (configure-pages + upload-pages-artifact + deploy-pages from actions/). - Add `/book/` to .gitignore. Reference updates so the old path is fully retired: - Every `spec_ref` in `corpus/**/*.json` rewritten from `spec/` to `src/` (54 files). - Schema description text and example path in `corpus/schema/test-vector.schema.json`. - `README.md`: prominent link to the published site near the top; "What's Here" updated for the new layout. - `CONTRIBUTING.md`: spec-editing instructions point at `src/` and note the SUMMARY.md requirement. - `CLAUDE.md`: directory-layout notes updated. CHANGELOG.md historical entries intentionally keep their `spec/` paths since those record what the paths were at the time of those commits. After this lands, the user needs to enable GitHub Pages in repo settings with source = "GitHub Actions" (one-time, manual). The workflow will then publish to https://swaits.github.io/meshcore-spec/ on every push to main. Verified locally: `mdbook build` produces a clean book/ tree with all 21 chapters rendered and the SUMMARY-driven sidebar populated. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
114 lines
3.4 KiB
JSON
114 lines
3.4 KiB
JSON
{
|
|
"$schema": "../../schema/test-vector.schema.json",
|
|
"name": "AES-128-ECB Block Padding",
|
|
"spec_ref": "src/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."
|
|
}
|
|
]
|
|
}
|