]> Cypherpunks repositories - gostls13.git/commit
crypto/rsa: deprecate and de-optimize multi-prime RSA
authorFilippo Valsorda <filippo@golang.org>
Sun, 23 Oct 2022 12:22:22 +0000 (14:22 +0200)
committerFilippo Valsorda <filippo@golang.org>
Sat, 19 Nov 2022 16:48:39 +0000 (16:48 +0000)
commitee5ccc9d4a41df1a1c6d339fa2624b0ee8e26045
tree5d04851590d3a771269e03e558b3078edb166b4d
parent8a81fdf165facdcefa06531de5af98a4db343035
crypto/rsa: deprecate and de-optimize multi-prime RSA

I have never encountered multi-prime RSA in the wild. A GitHub-wide
search reveals exactly two explicit uses of it (and a couple of tools
that leave the number configurable but defaulting to two).

https://github.com/decred/tumblebit/blob/31898baea/puzzle/puzzlekey.go#L38
https://github.com/carl-mastrangelo/pixur/blob/95d4a4208/tools/genkeys/genkeys.go#L13

Multi-prime RSA has a slight performance advantage, but has limited
compatibility and the number of primes must be chosen carefully based on
the key size to avoid security issues. It also requires a completely
separate and rarely used private key operation code path, which if buggy
or incorrect would leak the private key.

Mark it as deprecated, and remove the dedicated CRT optimization,
falling back instead to the slower but safer non-CRT fallback.

Change-Id: Iba95edc044fcf9b37bc1f4bb59c6ea273975837f
Reviewed-on: https://go-review.googlesource.com/c/go/+/445017
Reviewed-by: Roland Shoemaker <roland@golang.org>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Run-TryBot: Filippo Valsorda <filippo@golang.org>
src/crypto/rsa/rsa.go