]> Cypherpunks repositories - gostls13.git/commit
crypto/rand: make Prime not deterministic for a fixed input stream
authorFilippo Valsorda <filippo@golang.org>
Thu, 10 Mar 2022 16:43:43 +0000 (11:43 -0500)
committerGopher Robot <gobot@golang.org>
Tue, 5 Apr 2022 01:35:39 +0000 (01:35 +0000)
commitc18f398f32c45afe2e9a81a6d885a4e0183cd649
tree47006a67107f62eb89a60a1b81817e2eb1476375
parent4aacb7ff0f103d95a724a91736823f44aa599634
crypto/rand: make Prime not deterministic for a fixed input stream

rand.Prime does not guarantee the precise prime selection algorithm as
part of its contract. For example, it changed slightly in CL 387554. We
want to ensure that no tests come to rely on it staying the same, so
just like other cryptographic functions that use randomness in an
unspecified way (ECDSA signing, RSA PKCS #1 v1.5 encryption, RSA key
generation), make it randomly read an extra byte or not.

Change-Id: Ib9079c03360812d412b7c21d5a06caadabb4a8bf
Reviewed-on: https://go-review.googlesource.com/c/go/+/391554
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/rand/util.go
src/crypto/rand/util_test.go
src/go/build/deps_test.go