]> Cypherpunks repositories - gostls13.git/commitdiff
crypto/elliptic: delete outdated fuzz test
authorFilippo Valsorda <filippo@golang.org>
Sun, 27 Mar 2022 01:07:30 +0000 (03:07 +0200)
committerFilippo Valsorda <filippo@golang.org>
Tue, 5 Apr 2022 09:26:22 +0000 (09:26 +0000)
It had not been doing anything since CL 233939, because the Params
method was getting upgraded to the assembly one. We could make it use
genericParamsForCurve, but really we need lower-level, targeted Go 1.18
fuzz targets in nistec now.

Change-Id: I5b198a309aa90ecef9c04aaa6c107d5c0a41a44b
Reviewed-on: https://go-review.googlesource.com/c/go/+/396254
Run-TryBot: Filippo Valsorda <filippo@golang.org>
Trust: Filippo Valsorda <filippo@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Roland Shoemaker <roland@golang.org>
src/crypto/elliptic/fuzz_test.go [deleted file]

diff --git a/src/crypto/elliptic/fuzz_test.go b/src/crypto/elliptic/fuzz_test.go
deleted file mode 100644 (file)
index 2b5ddae..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-// Copyright 2018 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-//go:build amd64 || arm64 || ppc64le
-
-package elliptic
-
-import (
-       "crypto/rand"
-       "testing"
-       "time"
-)
-
-func TestFuzz(t *testing.T) {
-       p256 := P256()
-       p256Generic := p256.Params()
-
-       var scalar1 [32]byte
-       var scalar2 [32]byte
-       var timeout *time.Timer
-
-       if testing.Short() {
-               timeout = time.NewTimer(10 * time.Millisecond)
-       } else {
-               timeout = time.NewTimer(2 * time.Second)
-       }
-
-       for {
-               select {
-               case <-timeout.C:
-                       return
-               default:
-               }
-
-               rand.Read(scalar1[:])
-               rand.Read(scalar2[:])
-
-               x, y := p256.ScalarBaseMult(scalar1[:])
-               x2, y2 := p256Generic.ScalarBaseMult(scalar1[:])
-
-               xx, yy := p256.ScalarMult(x, y, scalar2[:])
-               xx2, yy2 := p256Generic.ScalarMult(x2, y2, scalar2[:])
-
-               if x.Cmp(x2) != 0 || y.Cmp(y2) != 0 {
-                       t.Fatalf("ScalarBaseMult does not match reference result with scalar: %x, please report this error to security@golang.org", scalar1)
-               }
-
-               if xx.Cmp(xx2) != 0 || yy.Cmp(yy2) != 0 {
-                       t.Fatalf("ScalarMult does not match reference result with scalars: %x and %x, please report this error to security@golang.org", scalar1, scalar2)
-               }
-       }
-}