Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 3 of 3 for isReduced (0.23 sec)

  1. src/crypto/internal/edwards25519/scalar_alias_test.go

    		if out := f(&v, &x, &y); out != &v || !isReduced(out.Bytes()) {
    			return false
    		}
    
    		// Test aliasing the first argument and the receiver.
    		v1 = x
    		if out := f(&v1, &v1, &y); out != &v1 || v1 != v || !isReduced(out.Bytes()) {
    			return false
    		}
    		// Test aliasing the second argument and the receiver.
    		v1 = y
    		if out := f(&v1, &x, &v1); out != &v1 || v1 != v || !isReduced(out.Bytes()) {
    			return false
    		}
    
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 3K bytes
    - Viewed (0)
  2. src/crypto/internal/edwards25519/scalar_test.go

    		// Compute t2 = x*z + y*z
    		var t2 Scalar
    		var t3 Scalar
    		t2.Multiply(&x, &z)
    		t3.Multiply(&y, &z)
    		t2.Add(&t2, &t3)
    
    		reprT1, reprT2 := t1.Bytes(), t2.Bytes()
    
    		return t1 == t2 && isReduced(reprT1) && isReduced(reprT2)
    	}
    
    	if err := quick.Check(multiplyDistributesOverAdd, quickCheckConfig(1024)); err != nil {
    		t.Error(err)
    	}
    }
    
    func TestScalarAddLikeSubNeg(t *testing.T) {
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon Aug 28 17:26:17 UTC 2023
    - 7.6K bytes
    - Viewed (0)
  3. src/crypto/internal/edwards25519/scalar.go

    var scalarMinusOneBytes = [32]byte{236, 211, 245, 92, 26, 99, 18, 88, 214, 156, 247, 162, 222, 249, 222, 20, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 16}
    
    // isReduced returns whether the given scalar in 32-byte little endian encoded
    // form is reduced modulo l.
    func isReduced(s []byte) bool {
    	if len(s) != 32 {
    		return false
    	}
    
    	for i := len(s) - 1; i >= 0; i-- {
    		switch {
    		case s[i] > scalarMinusOneBytes[i]:
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
Back to top