mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
- calcPaddedLen used Float math and returned wrong buckets above 2^24 (20971520 -> 25165824, 33554432 -> 41943040) and overflowed Int past 2^30. It is now integer-only on Long, as the spec requires. - unpad rejects an extended [0,0][u32] prefix whose length is < 65536, so a short message has a single valid encoding. - decodePayload enforces a configurable maximum (default 64M chars) before base64 decoding, and rejects payloads that decode to fewer than 99 bytes. - Nip44 reads only the first base64 quantum to find the version byte. - Adds the spec's 65535/65536/65537-byte vectors and padding tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MGR1u8SyzcUuekub39SBsc