Repository navigation
Commit d0c8275
outputs: message_hash64 uses the standard FNV-1a 64 offset basis
output_message_hash() seeded FNV-1a 64 with 1469598103934665603, the
standard offset basis 14695981039346656037 with its last digit dropped,
while pineforge.h and docs/outputs.md promise FNV-1a 64 and tell users
to re-hash the bytes they recorded. message_hash64 is new in 1.5.0, so
the standard basis costs nothing before the release.
The test helper fnv1a64() repeated the same truncated seed, so the
recorder test compared the bug with itself and could never catch it.
The recorder test now also pins the published FNV-1a 64 test vectors
("" -> 0xcbf29ce484222325, "a" -> 0xaf63dc4c8601ec8c), and
docs/outputs.md states the basis, the prime and the "a" vector.
The internal state-hash folds that share the old constant are not
public hashes and stay as they are.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>1 parent 3c126b4 commit d0c8275
4 files changed
Lines changed: 10 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
351 | | - | |
| 351 | + | |
352 | 352 | | |
353 | | - | |
| 353 | + | |
354 | 354 | | |
355 | 355 | | |
356 | 356 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
280 | 280 | | |
281 | 281 | | |
282 | 282 | | |
283 | | - | |
| 283 | + | |
284 | 284 | | |
285 | 285 | | |
286 | 286 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
210 | 210 | | |
211 | 211 | | |
212 | 212 | | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
213 | 217 | | |
214 | 218 | | |
215 | 219 | | |
| |||
0 commit comments