go icon indicating copy to clipboard operation
go copied to clipboard

x/crypto/cryptotest: new package

Open FiloSottile opened this issue 7 years ago • 6 comments

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

FiloSottile avatar May 09 '18 12:05 FiloSottile

Change https://golang.org/cl/112315 mentions this issue: cryptotest: new package

gopherbot avatar May 09 '18 12:05 gopherbot

Sounds fine to us.

bradfitz avatar Jul 16 '18 20:07 bradfitz

Change https://go.dev/cl/592855 mentions this issue: crypto: add common tests for the hash.Hash interface

gopherbot avatar Jun 14 '24 21:06 gopherbot

Change https://go.dev/cl/594018 mentions this issue: crypto: add tests for the cipher.Block interface

gopherbot avatar Jun 21 '24 21:06 gopherbot

Change https://go.dev/cl/595120 mentions this issue: crypto: add tests for the cipher.BlockMode interface

gopherbot avatar Jun 27 '24 13:06 gopherbot

Change https://go.dev/cl/595564 mentions this issue: crypto: add tests for the cipher.Stream interface

gopherbot avatar Jun 28 '24 21:06 gopherbot

Change https://go.dev/cl/601778 mentions this issue: crypto/internal/cryptotest: add tests for the cipher.AEAD interface

gopherbot avatar Jul 30 '24 17:07 gopherbot

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.

dmitshur avatar Nov 25 '24 18:11 dmitshur