]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: use runtime.getRandomData on js/wasm
authorFilippo Valsorda <filippo@golang.org>
Sun, 25 Aug 2024 12:00:18 +0000 (14:00 +0200)
committerFilippo Valsorda <filippo@golang.org>
Mon, 7 Oct 2024 15:34:27 +0000 (15:34 +0000)
commitef14ba3e68c166596963bc26187e118cf79375cf
treed5496162586153a5388f8562fda04d693fae39e8
parentdd6b3821ca4ffec1ae074e60f5a990835b976662
crypto/rand: use runtime.getRandomData on js/wasm

This mechanism ultimately calls the same JavaScript method, but being
consistent between runtime and crypto/rand lets us reuse test coverage
across them. Also, no allocations.

Cq-Include-Trybots: luci.golang.try:gotip-js-wasm
Change-Id: I035da1ed603fbcdad61945f2b57f3fb527a959fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/608396
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
src/crypto/rand/rand_js.go
src/crypto/rand/rand_test.go