Files
meshcore-spec/corpus/payloads/encrypted/padding.json
T
swaitsandClaude Opus 4.7 d785e35919 feat(mdbook): publish spec via mdBook on GitHub Pages
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>
2026-05-12 09:36:28 -06:00

100 lines
3.3 KiB
JSON

{
"$schema": "../../schema/test-vector.schema.json",
"name": "Encrypted Payload - AES Block Padding",
"spec_ref": "src/06-payload-encrypted.md",
"protocol_version": 0,
"description": "Tests AES-128-ECB zero-padding behavior at block boundaries. Plaintexts of 1, 15, 16, 17, and 32 bytes exercise all padding edge cases.",
"vectors": [
{
"id": "pad-001",
"description": "1-byte plaintext: padded with 15 zero bytes",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "txt_msg",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"dest_hash": "AB",
"src_hash": "CD",
"cipher_mac": "83FB",
"ciphertext": "2D4135E80761429386BFE3833C535AA8"
}
},
"binary": "09 00 ABCD 83FB 2D4135E80761429386BFE3833C535AA8",
"crypto_context": {
"shared_secret": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
"encryption_key": "000102030405060708090A0B0C0D0E0F",
"plaintext": "42"
},
"notes": "1 byte padded to 16: 42 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00. 1 AES block output."
},
{
"id": "pad-002",
"description": "16-byte plaintext: no padding needed (exact block boundary)",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "txt_msg",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"dest_hash": "AB",
"src_hash": "CD",
"cipher_mac": "631C",
"ciphertext": "0A940BB5416EF045F1C39458C653EA5A"
}
},
"binary": "09 00 ABCD 631C 0A940BB5416EF045F1C39458C653EA5A",
"crypto_context": {
"shared_secret": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
"encryption_key": "000102030405060708090A0B0C0D0E0F",
"plaintext": "000102030405060708090A0B0C0D0E0F"
},
"notes": "Exactly 16 bytes: no padding. 1 AES block output."
},
{
"id": "pad-003",
"description": "17-byte plaintext: 1 byte in second block, padded with 15 zeros",
"type": "encode_decode",
"structured": {
"header": {
"version": 0,
"payload_type": "txt_msg",
"route_type": "flood"
},
"path": {
"hash_size": 1,
"hash_count": 0,
"hashes": []
},
"payload": {
"dest_hash": "AB",
"src_hash": "CD",
"cipher_mac": "9822",
"ciphertext": "0A940BB5416EF045F1C39458C653EA5A299F7C29A3E13AE7F64ECBA062FC7560"
}
},
"binary": "09 00 ABCD 9822 0A940BB5416EF045F1C39458C653EA5A299F7C29A3E13AE7F64ECBA062FC7560",
"crypto_context": {
"shared_secret": "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F",
"encryption_key": "000102030405060708090A0B0C0D0E0F",
"plaintext": "000102030405060708090A0B0C0D0E0F10"
},
"notes": "17 bytes spans 2 blocks. Block 2 = 10 00 00 ... 00. 32 bytes ciphertext."
}
]
}