mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-07-26 06:38:42 +00:00
c1f48fc79a
Go 1.26 added a CPU jitter-based SP 800-90B entropy source for FIPS 140-3 compliance (crypto/internal/entropy/v1.0.0). It declares a 32 MiB global ScratchBuffer ([1<<25]byte) used for memory access timing noise. On systems with virtual memory this stays in .noptrbss and is lazily paged, but on baremetal targets it becomes static RAM, causing fatal overflow (e.g. pybadge with 192 KB SRAM reports 33 MB overflow). Since FIPS jitter entropy is never used on TinyGo targets (fips140.Enabled is always false, so drbg.Read falls through to sysrand.Read), provide a TinyGo overlay that replaces ScratchBuffer with [0]byte and stubs out all entropy functions with panics.