mirror of
https://github.com/golang/go.git
synced 2026-02-02 09:02:05 +03:00
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>
This commit is contained in:
committed by
Gopher Robot
parent
d5953185d5
commit
3da0356685
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user