{
  "_comment": "Golden vectors for the Reticulum protocol specification. Generated by gen_vectors.py from the vendored reference. Do not edit by hand; re-run the harness.",
  "meta": {
    "rns_version": "1.3.5",
    "reticulum_commit": "d5e62d4e15c5fe2e170f7bd9e120551671f21a27",
    "fixed_time": 1700000000.0,
    "src_identity_prv_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f",
    "dst_identity_prv_hex": "404142434445464748494a4b4c4d4e4f505152535455565758595a5b5c5d5e5f606162636465666768696a6b6c6d6e6f707172737475767778797a7b7c7d7e7f"
  },
  "constants": {
    "MTU": 500,
    "MDU": 464,
    "HEADER_MINSIZE": 19,
    "HEADER_MAXSIZE": 35,
    "TRUNCATED_HASHLENGTH": 128,
    "Packet_ENCRYPTED_MDU": 383,
    "Packet_PLAIN_MDU": 464,
    "Identity_KEYSIZE": 512,
    "Identity_HASHLENGTH": 256,
    "Identity_SIGLENGTH": 512,
    "Identity_NAME_HASH_LENGTH": 80,
    "Identity_RATCHETSIZE": 256,
    "Token_TOKEN_OVERHEAD": 48,
    "Link_ECPUBSIZE": 64,
    "Link_KEYSIZE": 32,
    "packet_context_bytes": {
      "NONE": 0,
      "RESOURCE": 1,
      "RESOURCE_ADV": 2,
      "RESOURCE_REQ": 3,
      "RESOURCE_HMU": 4,
      "RESOURCE_PRF": 5,
      "RESOURCE_ICL": 6,
      "RESOURCE_RCL": 7,
      "CACHE_REQUEST": 8,
      "REQUEST": 9,
      "RESPONSE": 10,
      "PATH_RESPONSE": 11,
      "COMMAND": 12,
      "COMMAND_STATUS": 13,
      "CHANNEL": 14,
      "KEEPALIVE": 250,
      "LINKIDENTIFY": 251,
      "LINKCLOSE": 252,
      "LINKPROOF": 253,
      "LRRTT": 254,
      "LRPROOF": 255
    }
  },
  "vectors": [
    {
      "id": "VEC-HASH",
      "kind": "frozen",
      "citation": "Identity.py:373-390",
      "title": "SHA-256 full and truncated hash",
      "input_hex": "7265746963756c756d2d73706563",
      "full_hash_hex": "659fe249468c635cdfe90a12624abec49f0bd36ba66d467b4f7155c79e8addf2",
      "truncated_hash_hex": "659fe249468c635cdfe90a12624abec4"
    },
    {
      "id": "VEC-HKDF",
      "kind": "frozen",
      "citation": "Cryptography/HKDF.py:35-62",
      "title": "HKDF-SHA256, 32-byte output",
      "derive_from_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
      "salt_hex": "000102030405060708090a0b0c0d0e0f",
      "length": 32,
      "okm_hex": "2bc3faec9f360e81e77086b6e17a9ce8722a4cb3bc0ed90b4d78d37036e43a0f"
    },
    {
      "id": "VEC-HMAC",
      "kind": "frozen",
      "citation": "Cryptography/HMAC.py",
      "title": "HMAC-SHA256",
      "key_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
      "msg_hex": "7265746963756c756d2d73706563",
      "digest_hex": "7029183bb56129dba963bd1f376b7500320fa33ac8f68dfec51b984fafc53965"
    },
    {
      "id": "VEC-AES",
      "kind": "frozen",
      "citation": "Cryptography/AES.py",
      "title": "AES-256-CBC with fixed key and IV (one block)",
      "key_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
      "iv_hex": "000102030405060708090a0b0c0d0e0f",
      "plaintext_hex": "30313233343536373839616263646566",
      "ciphertext_hex": "e23fc0b91c7bd64425c559736e9b0c58",
      "roundtrip_ok": true
    },
    {
      "id": "VEC-ID-HASH",
      "kind": "frozen",
      "citation": "Identity.py:805-810",
      "title": "Identity public key and identity hash",
      "src_prv_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f202122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f",
      "public_key_hex": "8f40c5adb68f25624ae5b214ea767a6ec94d829d3d7b5e1ad1ba6f3e2138285f29acbae141bccaf0b22e1a94d34d0bc7361e526d0bfe12c89794bc9322966dd7",
      "public_key_len": 64,
      "identity_hash_hex": "aca31af0441d81dbec71e82da0b4b5f5"
    },
    {
      "id": "VEC-ID-SIGN",
      "kind": "frozen",
      "citation": "Identity.py:931-964",
      "title": "Ed25519 signature over fixed message (deterministic)",
      "message_hex": "7265746963756c756d2d737065632d7369676e65642d6d657373616765",
      "signature_hex": "bbfdcde5aa05197f77acd8ac31aceb1e6470fe69b894ce4ea52da018c88c411cb6aa7352e3c30323462a362b767600d163cce4c10ae69769f3f0a78c06a8b10d",
      "signature_len": 64,
      "valid": true
    },
    {
      "id": "VEC-ID-TOKEN",
      "kind": "frozen-injection",
      "citation": "Identity.py:827-928; Cryptography/Token.py",
      "title": "Encryption token (ephemeral pub || IV || ciphertext || HMAC)",
      "plaintext_hex": "7265746963756c756d20656e63727970746564207061796c6f6164",
      "token_hex": "efd9ec3449e46df22de114b1f785b359bef07989e7e1bbb62a0e9908cb72ed5353f9c3fa8c40c79941c89cf944dd56950758047257bf483145886d2115b50dc2e84dec35bc18a0b37d31e9350c8cb09a0d6facefdc669d6f1c9bc07f5e46b99a2c00a3ea0059e49adecc7c5df500491b",
      "token_len": 112,
      "structure": "ephemeral_x25519_pub(32) || token(IV(16)||ct||HMAC(32))",
      "reproducible": "guaranteed by harness determinism self-check",
      "decrypt_roundtrip_ok": true
    },
    {
      "id": "VEC-DEST-HASH",
      "kind": "frozen",
      "citation": "Destination.py:116-141",
      "title": "Destination name hash and destination hash",
      "app_name": "test",
      "aspects": [
        "vec"
      ],
      "identity_hash_hex": "069092a03c194639207219dd05f9c840",
      "name_hash_hex": "9da53eec82a28ce2f2e9",
      "name_hash_len": 10,
      "destination_hash_hex": "07d4541d4fdc0abfacc9364fdf979ee1",
      "destination_hash_len": 16
    },
    {
      "id": "VEC-PKT-PLAIN",
      "kind": "frozen",
      "citation": "Packet.py:177-272",
      "title": "PLAIN HEADER_1 data packet pack",
      "raw_hex": "0800fc0910664040482cd653166c8f225520006869",
      "raw_len": 21,
      "flags_byte": "08",
      "hops_byte": "00",
      "destination_hash_hex": "fc0910664040482cd653166c8f225520",
      "context_byte": "00",
      "payload_hex": "6869",
      "flags_decode": {
        "ifac": 0,
        "header_type": 0,
        "context_flag": 0,
        "transport_type": 0,
        "destination_type": 2,
        "packet_type": 0
      }
    },
    {
      "id": "VEC-PKT-ENC",
      "kind": "frozen-injection",
      "citation": "Packet.py:177-239; Identity.py:827",
      "title": "SINGLE encrypted HEADER_1 data packet pack",
      "raw_hex": "000007d4541d4fdc0abfacc9364fdf979ee100efd9ec3449e46df22de114b1f785b359bef07989e7e1bbb62a0e9908cb72ed5353f9c3fa8c40c79941c89cf944dd569596af2aace61bdae5e686bb838c4811a6a2d333f1a814290166a7b1880646c942d833176a24c19fea421427513093d573",
      "raw_len": 115,
      "flags_byte": "00",
      "destination_hash_hex": "07d4541d4fdc0abfacc9364fdf979ee1",
      "context_byte": "00",
      "reproducible": "guaranteed by harness determinism self-check"
    },
    {
      "id": "VEC-ANN-NORATCHET",
      "kind": "frozen-injection",
      "citation": "Destination.py:280-317; Identity.py:532-634",
      "title": "Announce without ratchet (context flag 0)",
      "raw_hex": "010007d4541d4fdc0abfacc9364fdf979ee10079a631eede1bf9c98f12032cdeadd0e7a079398fc786b88cc846ec89af85a51a174553b456dddfc6908ecab1c101fe6ab21e2baa0617795b7d43a63482993fd59da53eec82a28ce2f2e930078528be006553f1000766299dffcc8ecad446372b2b47b7e6afc0f699487099642a81378c49888e43a626529d493fd8b1da2fd17b43161bcb8b2506fee1e65ff92ce8b1b015a595004144",
      "flags_byte": "01",
      "context_flag": 0,
      "announce_data_hex": "79a631eede1bf9c98f12032cdeadd0e7a079398fc786b88cc846ec89af85a51a174553b456dddfc6908ecab1c101fe6ab21e2baa0617795b7d43a63482993fd59da53eec82a28ce2f2e930078528be006553f1000766299dffcc8ecad446372b2b47b7e6afc0f699487099642a81378c49888e43a626529d493fd8b1da2fd17b43161bcb8b2506fee1e65ff92ce8b1b015a595004144",
      "announce_data_len": 150,
      "structure": "public_key(64) || name_hash(10) || random_hash(10) || signature(64) || app_data",
      "reproducible": "guaranteed by harness determinism self-check",
      "validate_announce": true
    },
    {
      "id": "VEC-ANN-RATCHET",
      "kind": "frozen-injection",
      "citation": "Destination.py:284-314; Identity.py:546-553",
      "title": "Announce with ratchet (context flag 1)",
      "raw_hex": "2100bb0868b19b0a9c1f2df1441de5dfcfbc0079a631eede1bf9c98f12032cdeadd0e7a079398fc786b88cc846ec89af85a51a174553b456dddfc6908ecab1c101fe6ab21e2baa0617795b7d43a63482993fd585eae8cf1203d961396730078528be006553f10047ef27fd7465d539b8d23394c0d6a0021223ec7107422d60213c0e98d25b6a7f494d501a6f6cab03cea2950c43b53f721c9d68458c875f4644ece57eb2ecec038ecae1f1ccd3c2ad080e418eac4f17d97cfdc353e99556514a70f037c887230d4144",
      "flags_byte": "21",
      "context_flag": 1,
      "announce_data_len": 182,
      "structure": "public_key(64) || name_hash(10) || random_hash(10) || ratchet(32) || signature(64) || app_data",
      "validate_announce": true
    },
    {
      "id": "VEC-RES-PROOF",
      "kind": "frozen",
      "citation": "Resource.py:752-756",
      "title": "Resource proof hash construction",
      "data_len": 152,
      "resource_hash_hex": "d257b38bc5d6aa2231514e8b1225f7802421c73bb48def3625c0feb075c8c6c1",
      "proof_hex": "b281a932d4fc76da3cc2f97e0513898b54c0e32553f7f0c38618de41382eac08",
      "proof_data_hex": "d257b38bc5d6aa2231514e8b1225f7802421c73bb48def3625c0feb075c8c6c1b281a932d4fc76da3cc2f97e0513898b54c0e32553f7f0c38618de41382eac08",
      "proof_data_len": 64,
      "structure": "proof = full_hash(data || resource_hash); proof_data = resource_hash(32) || proof(32)"
    },
    {
      "id": "VEC-CHAN-ENVELOPE",
      "kind": "frozen",
      "citation": "Channel.py:174-200",
      "title": "Channel envelope framing",
      "msgtype": 43981,
      "sequence": 7,
      "payload_hex": "6368616e6e656c64617461",
      "envelope_hex": "abcd0007000b6368616e6e656c64617461",
      "structure": "u16 msgtype || u16 sequence || u16 length || payload"
    },
    {
      "id": "VEC-STREAM-HDR",
      "kind": "frozen",
      "citation": "Buffer.py:80-92",
      "title": "StreamDataMessage header encoding",
      "stream_id": 258,
      "eof": true,
      "compressed": false,
      "header_value": "8102",
      "packed_hex": "810273747265616d64617461",
      "structure": "u16 (bits0-13 stream_id, bit14 compressed, bit15 eof) || data"
    },
    {
      "id": "VEC-HDLC",
      "kind": "frozen",
      "citation": "Interfaces/TCPInterface.py:44-52,323",
      "title": "HDLC byte-stuffing frame",
      "flag": "7e",
      "escape": "7d",
      "escape_mask": "20",
      "input_hex": "017e027d03",
      "framed_hex": "7e017d5e027d5d037e",
      "structure": "FLAG || stuffed(data) || FLAG; 0x7E->0x7D5E, 0x7D->0x7D5D"
    },
    {
      "id": "VEC-PKT-HEADER2",
      "kind": "computed",
      "citation": "Packet.py:255-259",
      "title": "HEADER_2 (transport) addressing layout",
      "note": "constructed per the unpack offsets; a live HEADER_2 packet needs transport routing state",
      "flags_byte": "40",
      "header_type": 1,
      "raw_hex": "4000a0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebf0064617461",
      "transport_id_hex": "a0a1a2a3a4a5a6a7a8a9aaabacadaeaf",
      "destination_hash_hex": "b0b1b2b3b4b5b6b7b8b9babbbcbdbebf",
      "context_byte": "00",
      "payload_hex": "64617461",
      "structure": "flags || hops || transport_id(16) || dest_hash(16) || context || data"
    },
    {
      "id": "VEC-PATH-REQUEST",
      "kind": "frozen-injection",
      "citation": "Transport.py:2780-2787",
      "title": "Path request packet (transport disabled)",
      "destination_namehash_hex": "7926bbe7dd7f9aba88b0",
      "target_hash_hex": "000102030405060708090a0b0c0d0e0f",
      "request_tag_hex": "30078528befab3e6193ceeb01dd3b898",
      "payload_hex": "000102030405060708090a0b0c0d0e0f30078528befab3e6193ceeb01dd3b898",
      "payload_structure": "target_destination_hash(16) || request_tag (|| transport_identity_hash(16) when transport enabled)",
      "raw_hex": "08006b9f66014d9853faab220fba47d0276100000102030405060708090a0b0c0d0e0f30078528befab3e6193ceeb01dd3b898",
      "flags_byte": "08",
      "reproducible": "guaranteed by harness determinism self-check"
    },
    {
      "id": "VEC-LINK",
      "kind": "frozen-injection",
      "citation": "Link.py:308-366",
      "title": "Link request payload, link id, and session key derivation",
      "request_data_structure": "ephemeral_x25519_pub(32) || ephemeral_ed25519_pub(32) || signalling(3, MTU+mode)",
      "signalling_hex": "2001f4",
      "request_data_hex": "a4e09292b651c278b9772c569f5fa9bb13d906b46ab68c9df9dc2b4409f8a2098139770ea87d175f56a35466c34c7ecccb8d8a91b4ee37a25df60f5b8fc9b3942001f4",
      "link_id_hex": "4725ac1375601d182afec3610f019b25",
      "link_id_len": 16,
      "link_id_derivation": "truncated_hash(packet.get_hashable_part()[:ECPUBSIZE])",
      "ecdh_agreement": true,
      "session_key_hex": "569ac51a07fb242fa1db5ae7c0f53af6a68a10c22fc2856364cdf1189dd50d2140ab55dd6c82e7a3bc8fcacebc40eb74e914c19b57ab86e8f1fe8de7a8b70cb9",
      "session_key_len": 64,
      "key_derivation": "hkdf(64, derive_from=ecdh_shared, salt=link_id, context=None)",
      "reproducible": "guaranteed by harness determinism self-check"
    },
    {
      "id": "VEC-RES-ADV",
      "kind": "computed",
      "citation": "Resource.py:1278-1355",
      "title": "Resource advertisement msgpack dictionary",
      "note": "assembled per ResourceAdvertisement.pack with representative values; a live advertisement needs a Resource over a Link",
      "flags_byte": "03",
      "flags_decode": {
        "has_metadata": 0,
        "is_response": 0,
        "is_request": 0,
        "split": 0,
        "compressed": 1,
        "encrypted": 1
      },
      "keys": "t=transfer_size d=data_size n=parts h=hash r=random_hash o=original_hash i=segment l=total_segments q=request_id f=flags m=hashmap",
      "packed_hex": "8ba174cd1000a164cd2000a16e09a168c420329c99c7060c1ea2a9a1e3be9dbed0d734f09f1efa45859a5f33772ffb6d30dea172c40400010203a16fc420329c99c7060c1ea2a9a1e3be9dbed0d734f09f1efa45859a5f33772ffb6d30dea16900a16c01a171c0a16603a16dc424000102030001020300010203000102030001020300010203000102030001020300010203",
      "packed_len": 146
    },
    {
      "id": "VEC-IFAC",
      "kind": "frozen",
      "citation": "Transport.py:1051-1087",
      "title": "IFAC packet masking",
      "ifac_size": 8,
      "ifac_key_hex": "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f",
      "input_raw_hex": "0800fa443b1a5e7e90ce7d6781a6a3e33e85006869",
      "ifac_hex": "2cf485c1dfcea002",
      "mask_hex": "974a236edb36efad08cebb6334dfc086417ede12e73ab8127e64f1af82",
      "masked_hex": "9f4a2cf485c1dfcea00241270fc59ef8d1b0a375669c1bf140e1f1c7eb",
      "structure": "ifac = sign(raw)[-n:]; mask = hkdf(len(raw)+n, ifac, salt=ifac_key); new = header|0x80 || ifac || raw[2:], then XOR-mask all but the ifac bytes",
      "header_ifac_flag_set": 1,
      "unmask_roundtrip_ok": true
    }
  ]
}
