Skip to content

Commit 7bc3281

Browse files
committed
crypto/rsa: use BoringCrypto for 4096 bit keys
Fixes #58803 Change-Id: I097938ff61dae2b65214f8d0126d68de63525f5b Reviewed-on: https://go-review.googlesource.com/c/go/+/474515 Run-TryBot: Filippo Valsorda <filippo@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Roland Shoemaker <roland@golang.org>
1 parent 547aed1 commit 7bc3281

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/crypto/rsa/rsa.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -286,7 +286,8 @@ func GenerateKey(random io.Reader, bits int) (*PrivateKey, error) {
286286
func GenerateMultiPrimeKey(random io.Reader, nprimes int, bits int) (*PrivateKey, error) {
287287
randutil.MaybeReadByte(random)
288288

289-
if boring.Enabled && random == boring.RandReader && nprimes == 2 && (bits == 2048 || bits == 3072) {
289+
if boring.Enabled && random == boring.RandReader && nprimes == 2 &&
290+
(bits == 2048 || bits == 3072 || bits == 4096) {
290291
bN, bE, bD, bP, bQ, bDp, bDq, bQinv, err := boring.GenerateKeyRSA(bits)
291292
if err != nil {
292293
return nil, err

0 commit comments

Comments
 (0)