Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for hashToNat (0.24 sec)

  1. src/crypto/ecdsa/ecdsa.go

    	// Calculate the inverse of s in GF(N) using Fermat's method
    	// (exponentiation modulo P - 2, per Euler's theorem)
    	kInv.Exp(k, c.nMinus2, c.N)
    }
    
    // hashToNat sets e to the left-most bits of hash, according to
    // SEC 1, Section 4.1.3, point 5 and Section 4.1.4, point 3.
    func hashToNat[Point nistPoint[Point]](c *nistCurve[Point], e *bigmod.Nat, hash []byte) {
    	// ECDSA asks us to take the left-most log2(N) bits of hash, and use them as
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 20.4K bytes
    - Viewed (0)
  2. src/crypto/ecdsa/ecdsa_test.go

    	t.Run("P-521", func(t *testing.T) { testHashToNat(t, p521()) })
    }
    
    func testHashToNat[Point nistPoint[Point]](t *testing.T, c *nistCurve[Point]) {
    	for l := 0; l < 600; l++ {
    		h := bytes.Repeat([]byte{0xff}, l)
    		hashToNat(c, bigmod.NewNat(), h)
    	}
    }
    
    func TestZeroSignature(t *testing.T) {
    	testAllCurves(t, testZeroSignature)
    }
    
    func testZeroSignature(t *testing.T, curve elliptic.Curve) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Feb 26 21:33:58 UTC 2024
    - 13.5K bytes
    - Viewed (0)
Back to top