crypto/cipher: NewGCMWithRandomNonce error with GOEXPERIMENT=boringcrypto #72016
Labels
BugReport
Issues describing a possible bug in the Go implementation.
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Go version
go version go1.24.0 linux/amd64
Output of
go env
in your module/workspace:What did you do?
When using
cipher.NewGCMWithRandomNonce
, the function will error whenGOEXPERIMENT=boringcrypto
is enabled.What did you see happen?
The function reports the error
cipher: NewGCMWithRandomNonce requires aes.Block
.It does not do that when BoringCrypto is not used. The error comes from https://github.com/golang/go/blob/master/src/crypto/cipher/gcm.go#L96 where it tests for a
cipher.(*aes.Block)
, which is apparently not the case when using BoringCrypto.What did you expect to see?
I expected to see no error when using BoringCrypto. It is easy to work around by using
cipher.NewGCM
instead.The text was updated successfully, but these errors were encountered: