Fcrand (Go language): drop-in replacement for crypto/rand, up to 10x faster

2 sdrapkin 2 7/18/2025, 10:14:34 PM github.com ↗

Comments (2)

bhaney · 3h ago
What makes it so much faster? Were there a few particular big wins or is it just tons of small optimizations?

If it's faster, fully API compatible, and maintains all the same guarantees, why isn't the implementation being upstreamed to crypto/rand?

Edit: Looked at the code. It's a little read-ahead cache wrapped around crypto/rand. Good idea! I can't help but wonder if this actually does have some security implications, since rand data is going to be sitting around in process memory potentially long before it's actually requested.

sdrapkin · 3h ago
fcrand (fast crypto/rand) is a high-performance drop-in replacement for Go's crypto/rand.