upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/EE.md
diff options
context:
space:
mode:
authorAlex Gleason <alex@alexgleason.me>2026-03-17 15:33:00 -0500
committerAlex Gleason <alex@alexgleason.me>2026-03-17 15:33:00 -0500
commitac2f6a6cf9c2368f1c6a87c1716751fdf7496707 (patch)
treea873560e18da7ab6a6c5750d0fb75eb0622d6111 /EE.md
parent3492eb1affa5e93e658224a81bb832d2b6090ecd (diff)
nip44: allow encryption of payloads larger than 65535 bytes
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
Diffstat (limited to 'EE.md')
0 files changed, 0 insertions, 0 deletions