]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: batch large random reads on js
authorJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Tue, 31 Jan 2023 04:09:23 +0000 (20:09 -0800)
committerJohan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Wed, 1 Feb 2023 16:56:49 +0000 (16:56 +0000)
commitc846964df5eeab05c8620d34fcd3e56d5b6cbcfa
tree29fdf33f1e08950080ddad66c4e1e2cdbfcdb151
parent6e668267ac89a07fdf9aa9ca0d19a4a9f3077c4b
crypto/rand: batch large random reads on js

CL 463975 replaced the use of the NodeJS crypto.randomFillSync API
with a direct call to crypto.getRandomValues. This function rejects
any requests to fill a buffer larger than 65536 bytes, so we need to
batch reads larger than this size. This reuses the batching
functions used on other platforms to perform this batching.

Fixes #58145

Change-Id: Ic0acf3be7c9e994bc345d6614867c9b0c47bd26d
Reviewed-on: https://go-review.googlesource.com/c/go/+/463993
Reviewed-by: Roland Shoemaker <roland@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Run-TryBot: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
Auto-Submit: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com>
src/crypto/rand/rand_js.go