diff options
author | Russ Cox <rsc@golang.org> | 2022-04-27 09:02:53 -0400 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2022-04-29 14:23:32 +0000 |
commit | e845f572ec6163fd3bad0267b5bb4f24d369bd93 (patch) | |
tree | 9156df472b1692b5a4ff180bdaf02e98b5f40dbb /src/crypto/rsa/rsa.go | |
parent | a840bf871e005d948ba6442948997eb3ef2e3c7f (diff) | |
download | go-e845f572ec6163fd3bad0267b5bb4f24d369bd93.tar.gz go-e845f572ec6163fd3bad0267b5bb4f24d369bd93.zip |
[dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache
In the original BoringCrypto port, ecdsa and rsa's public and private
keys added a 'boring unsafe.Pointer' field to cache the BoringCrypto
form of the key. This led to problems with code that “knew” the layout
of those structs and in particular that they had no unexported fields.
In response, as an awful kludge, I changed the compiler to pretend
that field did not exist when laying out reflect data. Because we want
to merge BoringCrypto in the main tree, we need a different solution.
Using boring.Cache is that solution.
For #51940.
Change-Id: Ideb2b40b599a1dc223082eda35a5ea9abcc01e30
Reviewed-on: https://go-review.googlesource.com/c/go/+/395883
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
Diffstat (limited to 'src/crypto/rsa/rsa.go')
-rw-r--r-- | src/crypto/rsa/rsa.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/crypto/rsa/rsa.go b/src/crypto/rsa/rsa.go index e084be15cc..c941124fb2 100644 --- a/src/crypto/rsa/rsa.go +++ b/src/crypto/rsa/rsa.go @@ -34,7 +34,6 @@ import ( "io" "math" "math/big" - "unsafe" ) var bigZero = big.NewInt(0) @@ -44,8 +43,6 @@ var bigOne = big.NewInt(1) type PublicKey struct { N *big.Int // modulus E int // public exponent - - boring unsafe.Pointer } // Any methods implemented on PublicKey might need to also be implemented on @@ -109,8 +106,6 @@ type PrivateKey struct { // Precomputed contains precomputed values that speed up private // operations, if available. Precomputed PrecomputedValues - - boring unsafe.Pointer } // Public returns the public key corresponding to priv. |