From eecdb61eebabc083f588a349d4ce5ac2defaf2ca Mon Sep 17 00:00:00 2001 From: Filippo Valsorda Date: Wed, 17 Dec 2025 17:50:07 +0100 Subject: [PATCH] crypto: rename fips140v2.0 to fips140v1.26 Turns out we can't use non-v1 versions for the FIPS 140-3 module, so we decided to match the versioning of the Go release the module is frozen from. Change-Id: Ib5c13511a51f9930fcde86cd7e8bd39c6a6a6964 Reviewed-on: https://go-review.googlesource.com/c/go/+/730740 Auto-Submit: Filippo Valsorda Reviewed-by: Roland Shoemaker LUCI-TryBot-Result: Go LUCI Reviewed-by: Michael Knyszek --- .../{gcm_fips140v2.0_test.go => gcm_fips140v1.26_test.go} | 4 ++-- src/crypto/hpke/{aead_fipsv1.0.go => aead_fips140v1.0.go} | 0 src/crypto/hpke/{aead_fipsv2.0.go => aead_fips140v1.26.go} | 0 ...s_fips140v2.0.json => acvp_capabilities_fips140v1.26.json} | 0 .../{acvp_fips140v2.0_test.go => acvp_fips140v1.26_test.go} | 4 ++-- ...140v2.0.config.json => acvp_test_fips140v1.26.config.json} | 0 src/crypto/internal/fips140test/cast_fips140v1.0_test.go | 2 +- .../{cast_fips140v2.0_test.go => cast_fips140v1.26_test.go} | 2 +- src/crypto/internal/fips140test/cast_test.go | 2 +- .../internal/rand/{rand_fipsv1.0.go => rand_fips140v1.0.go} | 0 .../internal/rand/{rand_fipsv2.0.go => rand_fips140v1.26.go} | 0 11 files changed, 7 insertions(+), 7 deletions(-) rename src/crypto/cipher/{gcm_fips140v2.0_test.go => gcm_fips140v1.26_test.go} (97%) rename src/crypto/hpke/{aead_fipsv1.0.go => aead_fips140v1.0.go} (100%) rename src/crypto/hpke/{aead_fipsv2.0.go => aead_fips140v1.26.go} (100%) rename src/crypto/internal/fips140test/{acvp_capabilities_fips140v2.0.json => acvp_capabilities_fips140v1.26.json} (100%) rename src/crypto/internal/fips140test/{acvp_fips140v2.0_test.go => acvp_fips140v1.26_test.go} (97%) rename src/crypto/internal/fips140test/{acvp_test_fips140v2.0.config.json => acvp_test_fips140v1.26.config.json} (100%) rename src/crypto/internal/fips140test/{cast_fips140v2.0_test.go => cast_fips140v1.26_test.go} (91%) rename src/crypto/internal/rand/{rand_fipsv1.0.go => rand_fips140v1.0.go} (100%) rename src/crypto/internal/rand/{rand_fipsv2.0.go => rand_fips140v1.26.go} (100%) diff --git a/src/crypto/cipher/gcm_fips140v2.0_test.go b/src/crypto/cipher/gcm_fips140v1.26_test.go similarity index 97% rename from src/crypto/cipher/gcm_fips140v2.0_test.go rename to src/crypto/cipher/gcm_fips140v1.26_test.go index d3a8ea5c63..9f17a497ca 100644 --- a/src/crypto/cipher/gcm_fips140v2.0_test.go +++ b/src/crypto/cipher/gcm_fips140v1.26_test.go @@ -18,10 +18,10 @@ import ( "testing" ) -func TestGCMNoncesFIPSV2(t *testing.T) { +func TestGCMNoncesFIPSV126(t *testing.T) { cryptotest.MustSupportFIPS140(t) if !fips140.Enabled { - cmd := testenv.Command(t, testenv.Executable(t), "-test.run=^TestGCMNoncesFIPSV2$", "-test.v") + cmd := testenv.Command(t, testenv.Executable(t), "-test.run=^TestGCMNoncesFIPSV126$", "-test.v") cmd.Env = append(cmd.Environ(), "GODEBUG=fips140=on") out, err := cmd.CombinedOutput() t.Logf("running with GODEBUG=fips140=on:\n%s", out) diff --git a/src/crypto/hpke/aead_fipsv1.0.go b/src/crypto/hpke/aead_fips140v1.0.go similarity index 100% rename from src/crypto/hpke/aead_fipsv1.0.go rename to src/crypto/hpke/aead_fips140v1.0.go diff --git a/src/crypto/hpke/aead_fipsv2.0.go b/src/crypto/hpke/aead_fips140v1.26.go similarity index 100% rename from src/crypto/hpke/aead_fipsv2.0.go rename to src/crypto/hpke/aead_fips140v1.26.go diff --git a/src/crypto/internal/fips140test/acvp_capabilities_fips140v2.0.json b/src/crypto/internal/fips140test/acvp_capabilities_fips140v1.26.json similarity index 100% rename from src/crypto/internal/fips140test/acvp_capabilities_fips140v2.0.json rename to src/crypto/internal/fips140test/acvp_capabilities_fips140v1.26.json diff --git a/src/crypto/internal/fips140test/acvp_fips140v2.0_test.go b/src/crypto/internal/fips140test/acvp_fips140v1.26_test.go similarity index 97% rename from src/crypto/internal/fips140test/acvp_fips140v2.0_test.go rename to src/crypto/internal/fips140test/acvp_fips140v1.26_test.go index e9ef91537a..10a44f1492 100644 --- a/src/crypto/internal/fips140test/acvp_fips140v2.0_test.go +++ b/src/crypto/internal/fips140test/acvp_fips140v1.26_test.go @@ -12,10 +12,10 @@ import ( "fmt" ) -//go:embed acvp_capabilities_fips140v2.0.json +//go:embed acvp_capabilities_fips140v1.26.json var capabilitiesJson []byte -var testConfigFile = "acvp_test_fips140v2.0.config.json" +var testConfigFile = "acvp_test_fips140v1.26.config.json" func init() { commands["ML-DSA-44/keyGen"] = cmdMlDsaKeyGenAft(mldsa.NewPrivateKey44) diff --git a/src/crypto/internal/fips140test/acvp_test_fips140v2.0.config.json b/src/crypto/internal/fips140test/acvp_test_fips140v1.26.config.json similarity index 100% rename from src/crypto/internal/fips140test/acvp_test_fips140v2.0.config.json rename to src/crypto/internal/fips140test/acvp_test_fips140v1.26.config.json diff --git a/src/crypto/internal/fips140test/cast_fips140v1.0_test.go b/src/crypto/internal/fips140test/cast_fips140v1.0_test.go index 4780966208..b9ddfe4d8b 100644 --- a/src/crypto/internal/fips140test/cast_fips140v1.0_test.go +++ b/src/crypto/internal/fips140test/cast_fips140v1.0_test.go @@ -6,4 +6,4 @@ package fipstest -func fips140v2Conditionals() {} +func fips140v126Conditionals() {} diff --git a/src/crypto/internal/fips140test/cast_fips140v2.0_test.go b/src/crypto/internal/fips140test/cast_fips140v1.26_test.go similarity index 91% rename from src/crypto/internal/fips140test/cast_fips140v2.0_test.go rename to src/crypto/internal/fips140test/cast_fips140v1.26_test.go index 06e0513a7f..ef79068c38 100644 --- a/src/crypto/internal/fips140test/cast_fips140v2.0_test.go +++ b/src/crypto/internal/fips140test/cast_fips140v1.26_test.go @@ -8,7 +8,7 @@ package fipstest import "crypto/internal/fips140/mldsa" -func fips140v2Conditionals() { +func fips140v126Conditionals() { // ML-DSA sign and verify PCT kMLDSA := mldsa.GenerateKey44() // ML-DSA-44 diff --git a/src/crypto/internal/fips140test/cast_test.go b/src/crypto/internal/fips140test/cast_test.go index 5a80006622..817dcb9a35 100644 --- a/src/crypto/internal/fips140test/cast_test.go +++ b/src/crypto/internal/fips140test/cast_test.go @@ -115,7 +115,7 @@ func TestAllCASTs(t *testing.T) { // TestConditionals causes the conditional CASTs and PCTs to be invoked. func TestConditionals(t *testing.T) { - fips140v2Conditionals() + fips140v126Conditionals() // ML-KEM PCT kMLKEM, err := mlkem.GenerateKey768() if err != nil { diff --git a/src/crypto/internal/rand/rand_fipsv1.0.go b/src/crypto/internal/rand/rand_fips140v1.0.go similarity index 100% rename from src/crypto/internal/rand/rand_fipsv1.0.go rename to src/crypto/internal/rand/rand_fips140v1.0.go diff --git a/src/crypto/internal/rand/rand_fipsv2.0.go b/src/crypto/internal/rand/rand_fips140v1.26.go similarity index 100% rename from src/crypto/internal/rand/rand_fipsv2.0.go rename to src/crypto/internal/rand/rand_fips140v1.26.go