]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.boringcrypto] crypto/ecdsa, crypto/rsa: use boring.Cache
authorRuss Cox <rsc@golang.org>
Wed, 27 Apr 2022 13:02:53 +0000 (09:02 -0400)
committerRuss Cox <rsc@golang.org>
Fri, 29 Apr 2022 14:23:32 +0000 (14:23 +0000)
commite845f572ec6163fd3bad0267b5bb4f24d369bd93
tree9156df472b1692b5a4ff180bdaf02e98b5f40dbb
parenta840bf871e005d948ba6442948997eb3ef2e3c7f
[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>
src/crypto/ecdsa/boring.go
src/crypto/ecdsa/ecdsa.go
src/crypto/internal/boring/cache.go
src/crypto/internal/boring/cache_test.go
src/crypto/rsa/boring.go
src/crypto/rsa/boring_test.go
src/crypto/rsa/rsa.go
src/internal/boringtest/boring.go [deleted file]
src/internal/boringtest/boring_test.go [deleted file]
src/runtime/mgc.go
src/runtime/mgc_boring.go [deleted file]