aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFilippo Valsorda <filippo@golang.org>2025-10-28 11:44:57 +0100
committerGopher Robot <gobot@golang.org>2025-10-28 09:45:07 -0700
commit3da03566858a1676b7d928366db11e301c511b94 (patch)
tree39b3c78e7ad85f9de44678560fa455768a27f83b /src
parentd5953185d5ef5a4d1572b526474117d3a5220193 (diff)
downloadgo-3da03566858a1676b7d928366db11e301c511b94.tar.xz
crypto/internal/fips140test: collect 300M entropy samples for ESV
Change-Id: I6a6a69649df8f576df62e22c16db7813cde75224 Reviewed-on: https://go-review.googlesource.com/c/go/+/715401 Reviewed-by: Michael Knyszek <mknyszek@google.com> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Roland Shoemaker <roland@golang.org> Reviewed-by: Daniel McCarney <daniel@binaryparadox.net> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src')
-rw-r--r--src/crypto/internal/fips140test/entropy_test.go11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/crypto/internal/fips140test/entropy_test.go b/src/crypto/internal/fips140test/entropy_test.go
index cdaa4b7d80..82d921ffb7 100644
--- a/src/crypto/internal/fips140test/entropy_test.go
+++ b/src/crypto/internal/fips140test/entropy_test.go
@@ -34,12 +34,17 @@ func TestEntropySamples(t *testing.T) {
cryptotest.MustSupportFIPS140(t)
now := time.Now().UTC()
- var seqSamples [1_000_000]uint8
- samplesOrTryAgain(t, seqSamples[:])
+ seqSampleCount := 1_000_000
+ if *flagEntropySamples != "" {
+ // The lab requested 300 million samples for a new heuristic procedure.
+ seqSampleCount = 300_000_000
+ }
+ seqSamples := make([]uint8, seqSampleCount)
+ samplesOrTryAgain(t, seqSamples)
seqSamplesName := fmt.Sprintf("entropy_samples_sequential_%s_%s_%s_%s_%s.bin", entropy.Version(),
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
if *flagEntropySamples != "" {
- if err := os.WriteFile(seqSamplesName, seqSamples[:], 0644); err != nil {
+ if err := os.WriteFile(seqSamplesName, seqSamples, 0644); err != nil {
t.Fatalf("failed to write samples to %q: %v", seqSamplesName, err)
}
t.Logf("wrote %s", seqSamplesName)