go
go copied to clipboard
x/crypto/cryptotest: new package
crypto/cipher has well defined interfaces with plenty of tricky requirements (about aliasing, different lengths, state) that are hard to test for and easy to overlook.
cryptotest will be an interface test suite, like nettest. It caught a bug in x/crypto/internal/chacha20 and can replace a bunch of duplicated tests in the standard library, too.
It's useful to expose it in x/crypto for external implementations of the interface to use it. It will be vendored back.
Originally submitted as an internal package in https://golang.org/cl/102196
Change https://golang.org/cl/112315 mentions this issue: cryptotest: new package
Sounds fine to us.
Change https://go.dev/cl/592855 mentions this issue: crypto: add common tests for the hash.Hash interface
Change https://go.dev/cl/594018 mentions this issue: crypto: add tests for the cipher.Block interface
Change https://go.dev/cl/595120 mentions this issue: crypto: add tests for the cipher.BlockMode interface
Change https://go.dev/cl/595564 mentions this issue: crypto: add tests for the cipher.Stream interface
Change https://go.dev/cl/601778 mentions this issue: crypto/internal/cryptotest: add tests for the cipher.AEAD interface
It's useful to expose it in x/crypto for external implementations of the interface to use it. It will be vendored back.
If I understand right, it's currently added to the main Go repo as the internal package crypto/internal/cryptotest as an intermediate step. Since it's an internal package and nothing more, that suggests there's nothing here that needs to be mentioned in Go 1.24 release notes. Please comment otherwise.