mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
crypto/internal/fips140test: make entropy file pair names match
Change-Id: I6a6a69642d00e3994277d9b5631d1d7f18f3f356 Reviewed-on: https://go-review.googlesource.com/c/go/+/710055 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> Auto-Submit: Filippo Valsorda <filippo@golang.org> Reviewed-by: Michael Pratt <mpratt@google.com>
This commit is contained in:
parent
941e5917c1
commit
ae094a1397
1 changed files with 3 additions and 2 deletions
|
|
@ -31,11 +31,12 @@ var flagNISTSP80090B = flag.Bool("nist-sp800-90b", false, "run NIST SP 800-90B t
|
|||
|
||||
func TestEntropySamples(t *testing.T) {
|
||||
cryptotest.MustSupportFIPS140(t)
|
||||
now := time.Now().UTC()
|
||||
|
||||
var seqSamples [1_000_000]uint8
|
||||
samplesOrTryAgain(t, seqSamples[:])
|
||||
seqSamplesName := fmt.Sprintf("entropy_samples_sequential_%s_%s_%s_%s_%s.bin", entropy.Version(),
|
||||
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, time.Now().Format("20060102T150405Z"))
|
||||
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
|
||||
if *flagEntropySamples != "" {
|
||||
if err := os.WriteFile(seqSamplesName, seqSamples[:], 0644); err != nil {
|
||||
t.Fatalf("failed to write samples to %q: %v", seqSamplesName, err)
|
||||
|
|
@ -50,7 +51,7 @@ func TestEntropySamples(t *testing.T) {
|
|||
copy(restartSamples[i][:], samples[:])
|
||||
}
|
||||
restartSamplesName := fmt.Sprintf("entropy_samples_restart_%s_%s_%s_%s_%s.bin", entropy.Version(),
|
||||
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, time.Now().Format("20060102T150405Z"))
|
||||
runtime.GOOS, runtime.GOARCH, *flagEntropySamples, now.Format("20060102T150405Z"))
|
||||
if *flagEntropySamples != "" {
|
||||
f, err := os.Create(restartSamplesName)
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue