-
Notifications
You must be signed in to change notification settings - Fork 1
Commit 0c2021e
Correct §2.1 flag byte: bit 7 is IFAC, not part of header_type
Reverts the wrong normative claim added in 8c4d550. The official
manual §4.6.3 documents byte 1 as ifac_flag(7) | header_type(6) |
context_flag(5) | propagation_type(4) | dest_type(3-2) | packet_type(1-0).
Upstream confirms:
- RNS/Packet.py:246 — `(self.flags & 0b01000000) >> 6` parses
header_type as a 1-bit field at position 6.
- RNS/Transport.py:1003 — `bytes([raw[0] | 0x80, raw[1]])` sets the
IFAC flag at bit 7 in Transport.transmit when ifac_identity is
attached.
The reporter on issue #4 was correct: bit 7 has always been the IFAC
indicator. The 8c4d550 paragraph telling implementations "MUST NOT
treat bit 7 as a separate flag" is removed and replaced with the
correct layout, the upstream parse masks, and the IFAC sealing snippet
showing where the bit gets set on the wire.
A spec-correction callout in §2.1 documents the prior-version mistake
so anyone who consumed the bad guidance can identify the breakage.
verify_packet_header.py gains verify_ifac_bit_position() which locks
in the bit-7-is-IFAC invariant against future regression: it asserts
header_type's parse mask covers bit 6 only, never bit 7, and that the
IFAC mask 0x80 is disjoint from the header_type mask. The existing
flag-layout cases were always correct (header_type << 6 puts it at
bit 6); only the docstring described the wrong layout.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 8c4d550 commit 0c2021e
2 files changed
Lines changed: 73 additions & 11 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | - | ||
319 | + | ||
320 | + | ||
320 | 321 | | |
321 | - | ||
322 | - | ||
323 | - | ||
322 | + | ||
323 | + | ||
324 | + | ||
324 | 325 | | |
325 | 326 | | |
326 | - | ||
327 | + | ||
328 | + | ||
329 | + | ||
330 | + | ||
331 | + | ||
332 | + | ||
333 | + | ||
334 | + | ||
335 | + | ||
336 | + | ||
337 | + | ||
338 | + | ||
339 | + | ||
340 | + | ||
341 | + | ||
342 | + | ||
343 | + | ||
344 | + | ||
345 | + | ||
346 | + | ||
347 | + | ||
348 | + | ||
327 | 349 | | |
328 | 350 | | |
329 | 351 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | - | ||
6 | - | ||
7 | - | ||
5 | + | ||
6 | + | ||
7 | + | ||
8 | + | ||
9 | + | ||
10 | + | ||
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
| |||
48 | 51 | | |
49 | 52 | | |
50 | 53 | | |
51 | - | ||
52 | - | ||
54 | + | ||
55 | + | ||
53 | 56 | | |
54 | - | ||
57 | + | ||
58 | + | ||
55 | 59 | | |
56 | 60 | | |
57 | 61 | | |
| |||
70 | 74 | | |
71 | 75 | | |
72 | 76 | | |
77 | + | ||
78 | + | ||
79 | + | ||
80 | + | ||
81 | + | ||
82 | + | ||
83 | + | ||
84 | + | ||
85 | + | ||
86 | + | ||
87 | + | ||
88 | + | ||
89 | + | ||
90 | + | ||
91 | + | ||
92 | + | ||
93 | + | ||
94 | + | ||
95 | + | ||
96 | + | ||
97 | + | ||
98 | + | ||
99 | + | ||
100 | + | ||
101 | + | ||
102 | + | ||
103 | + | ||
104 | + | ||
105 | + | ||
106 | + | ||
107 | + | ||
108 | + | ||
109 | + | ||
110 | + | ||
111 | + | ||
73 | 112 | | |
74 | 113 | | |
75 | 114 | | |
| |||
182 | 221 | | |
183 | 222 | | |
184 | 223 | | |
224 | + | ||
185 | 225 | | |
186 | 226 | | |
187 | 227 | | |
| |||
0 commit comments