Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for benchmarkAllCurves (0.31 sec)

  1. src/crypto/elliptic/elliptic_test.go

    func BenchmarkScalarMult(b *testing.B) {
    	benchmarkAllCurves(b, func(b *testing.B, curve Curve) {
    		_, x, y, _ := GenerateKey(curve, rand.Reader)
    		priv, _, _, _ := GenerateKey(curve, rand.Reader)
    		b.ReportAllocs()
    		b.ResetTimer()
    		for i := 0; i < b.N; i++ {
    			x, y = curve.ScalarMult(x, y, priv)
    		}
    	})
    }
    
    func BenchmarkMarshalUnmarshal(b *testing.B) {
    	benchmarkAllCurves(b, func(b *testing.B, curve Curve) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu Apr 27 02:00:03 UTC 2023
    - 11.6K bytes
    - Viewed (0)
  2. src/crypto/ecdsa/ecdsa_test.go

    		_, _, err := randomPoint(p384(), rand)
    		return err
    	case elliptic.P521().Params():
    		_, _, err := randomPoint(p521(), rand)
    		return err
    	default:
    		panic("unknown curve")
    	}
    }
    
    func benchmarkAllCurves(b *testing.B, f func(*testing.B, elliptic.Curve)) {
    	tests := []struct {
    		name  string
    		curve elliptic.Curve
    	}{
    		{"P256", elliptic.P256()},
    		{"P384", elliptic.P384()},
    		{"P521", elliptic.P521()},
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:58 UTC 2024
    - 13.5K bytes
    - Viewed (0)
  3. src/crypto/ecdh/ecdh_test.go

    	t.Run("P521", func(t *testing.T) { f(t, ecdh.P521()) })
    	t.Run("X25519", func(t *testing.T) { f(t, ecdh.X25519()) })
    }
    
    func BenchmarkECDH(b *testing.B) {
    	benchmarkAllCurves(b, func(b *testing.B, curve ecdh.Curve) {
    		c, err := chacha20.NewUnauthenticatedCipher(make([]byte, 32), make([]byte, 12))
    		if err != nil {
    			b.Fatal(err)
    		}
    		rand := cipher.StreamReader{
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Wed Mar 27 18:23:49 UTC 2024
    - 18K bytes
    - Viewed (0)
Back to top