From: Filippo Valsorda Date: Tue, 28 Oct 2025 10:44:57 +0000 (+0100) Subject: crypto/internal/fips140test: collect 300M entropy samples for ESV X-Git-Tag: go1.26rc1~440 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=3da0356685;p=gostls13.git 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 Auto-Submit: Filippo Valsorda Reviewed-by: Roland Shoemaker Reviewed-by: Daniel McCarney LUCI-TryBot-Result: Go LUCI --- 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)