| Age | Commit message (Collapse) | Author |
|
When the 6-byte extended prefix sentinel is detected, validate that
the decoded length is >= extended_prefix_threshold (65536). Without
this, the same plaintext could be encoded with either prefix format,
breaking strict canonicalization.
|
|
and test vectors
|
|
Extend the v2 padding format with a backwards-compatible sentinel:
when the first 2 bytes of the length prefix are zero, the next 4
bytes encode the plaintext length as a big-endian u32. This raises
the maximum from 65535 bytes to 2^32-1 bytes without requiring a
version bump.
Fixes from nostr-protocol/nips#1907:
- Fix off-by-one: use >= 65536 (not > 65536) for the extended path,
since u16 can only represent 0..65535
- Fix padding validation: use dynamic prefix_len (2 or 6) instead of
hardcoded 2 in the unpad() size check
- Fix len(d) typo in decode_payload (should be len(data))
- Remove upper-bound size checks in decode_payload that would reject
large payloads
- Add write_u32_be, read_uint16_be, read_uint32_be to function list
- Add extended_prefix_threshold constant
- Update size range comments for both small and large payload paths
|
|
|
|
|
|
"Encoding algorithm" instead of "compression algorithm"
|
|
nip44: clarify ecdh hashing
|
|
|
|
|
|
|
|
|
|
|
|
|
|
improve formatting and clarify encryption/decryption steps
|
|
|
|
|
|
* Introduce NIP-44 encryption standard
* Finalize NIP-44
* Update spec.
---------
Co-authored-by: Jonathan Staab <shtaab@gmail.com>
|