]> Cypherpunks repositories - gostls13.git/commit
crypto/internal/fips: move most tests to crypto/internal/fipstest
authorFilippo Valsorda <filippo@golang.org>
Thu, 14 Nov 2024 11:41:47 +0000 (12:41 +0100)
committerGopher Robot <gobot@golang.org>
Tue, 19 Nov 2024 22:29:12 +0000 (22:29 +0000)
commit349d7d92bb02e1132f0920acefd70db670ba9a24
tree0a0fa996a6f43c02af783af99dbb0f94f8d6bcf0
parent382b20a09e90d3d96003bd3d22418d79d2e9d2d3
crypto/internal/fips: move most tests to crypto/internal/fipstest

As explained in fips_test.go, we generally want to minimize tests inside
the FIPS module. When there is a relevant calling package, the tests
should go there, otherwise in fipstest.

This required redoing a bit the CAST failure tests, but the new version
is actually more robust because it will fail if a _ import is missing.

Since TestCAST doesn't print a line for each passed CAST anymore, made
GODEBUG=fips140=debug do that, in case we need to show it to the lab.

For #69536

Change-Id: I0c1b82a4e9ee39e8df9bbe95bebb0527753f51c8
Reviewed-on: https://go-review.googlesource.com/c/go/+/627955
Reviewed-by: Daniel McCarney <daniel@binaryparadox.net>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Filippo Valsorda <filippo@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
26 files changed:
src/crypto/internal/fips/cast.go
src/crypto/internal/fips/cast_external_test.go [deleted file]
src/crypto/internal/fips/cast_test.go [deleted file]
src/crypto/internal/fips/check/check.go
src/crypto/internal/fips/check/export_test.go [deleted file]
src/crypto/internal/fips/drbg/ctrdrbg_test.go [deleted file]
src/crypto/internal/fips/fips.go
src/crypto/internal/fips/mlkem/cast.go
src/crypto/internal/fips/mlkem/generate1024.go
src/crypto/internal/fips/mlkem/mlkem1024.go
src/crypto/internal/fips/mlkem/mlkem768.go
src/crypto/internal/fipstest/acvp_capabilities.json [moved from src/crypto/internal/fips/acvp_capabilities.json with 100% similarity]
src/crypto/internal/fipstest/acvp_test.config.json [moved from src/crypto/internal/fips/acvp_test.config.json with 100% similarity]
src/crypto/internal/fipstest/acvp_test.go [moved from src/crypto/internal/fips/acvp_test.go with 99% similarity]
src/crypto/internal/fipstest/alias_test.go [moved from src/crypto/internal/fips/alias/alias_test.go with 89% similarity]
src/crypto/internal/fipstest/cast_test.go [new file with mode: 0644]
src/crypto/internal/fipstest/check_test.go [moved from src/crypto/internal/fips/check/check_test.go with 94% similarity]
src/crypto/internal/fipstest/cmac_test.go [moved from src/crypto/internal/fips/aes/gcm/cmac_test.go with 82% similarity]
src/crypto/internal/fipstest/ctrdrbg_test.go [new file with mode: 0644]
src/crypto/internal/fipstest/fips_test.go [new file with mode: 0644]
src/crypto/internal/fipstest/hkdf_test.go [moved from src/crypto/internal/fips/hkdf/hkdf_test.go with 99% similarity]
src/crypto/internal/fipstest/indicator_test.go [moved from src/crypto/internal/fips/indicator_test.go with 99% similarity]
src/crypto/internal/fipstest/mlkem_test.go [moved from src/crypto/internal/fips/mlkem/mlkem_test.go with 95% similarity]
src/crypto/internal/fipstest/sha3_test.go [moved from src/crypto/internal/fips/sha3/sha3_test.go with 98% similarity]
src/crypto/internal/fipstest/sshkdf_test.go [moved from src/crypto/internal/fips/ssh/kdf_test.go with 98% similarity]
src/crypto/internal/fipstest/xaes_test.go [moved from src/crypto/internal/fips/aes/gcm/ctrkdf_test.go with 97% similarity]