Skip to content

Commit 3da0356

Browse files
FiloSottilegopherbot
authored andcommitted
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>
1 parent d595318 commit 3da0356

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/crypto/internal/fips140test/entropy_test.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,17 @@ func TestEntropySamples(t *testing.T) {
3434
cryptotest.MustSupportFIPS140(t)
3535
now := time.Now().UTC()
3636

37-
var seqSamples [1_000_000]uint8
38-
samplesOrTryAgain(t, seqSamples[:])
37+
seqSampleCount := 1_000_000
38+
if *flagEntropySamples != "" {
39+
// The lab requested 300 million samples for a new heuristic procedure.
40+
seqSampleCount = 300_000_000
41+
}
42+
seqSamples := make([]uint8, seqSampleCount)
43+
samplesOrTryAgain(t, seqSamples)
3944
seqSamplesName := fmt.Sprintf("entropy_samples_sequential_%s_%s_%s_%s_%s.bin", entropy.Version(),
4045
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
4146
if *flagEntropySamples != "" {
42-
if err := os.WriteFile(seqSamplesName, seqSamples[:], 0644); err != nil {
47+
if err := os.WriteFile(seqSamplesName, seqSamples, 0644); err != nil {
4348
t.Fatalf("failed to write samples to %q: %v", seqSamplesName, err)
4449
}
4550
t.Logf("wrote %s", seqSamplesName)

0 commit comments

Comments
 (0)