mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-06 03:38:23 +00:00
sha256() and sha256Into() in Sha256.apple.kt pinned the input and took addressOf(0), which throws ArrayIndexOutOfBoundsException on Kotlin/Native when the array is empty. So sha256(ByteArray(0)) crashed on iOS/macOS, and test-quartz-ios failed 7 OversizedTransferTest cases that hash "" (red on main too). CommonCrypto's CC_SHA256 accepts a null data pointer for a zero-length input, so pass null when the array is empty. Adds Sha256Test with FIPS 180-2 vectors (empty, "abc", prefix hashing through sha256Into) so every platform's actual is checked, not only through CEP-22. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015VvJ8XpeYqBe8bYT3bJ7UD