Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for SetCanonicalBytes (0.28 sec)

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

    	fiatScalarToMontgomery(&s.s, (*fiatScalarNonMontgomeryDomainFieldElement)(&s.s))
    	return s
    }
    
    // SetCanonicalBytes sets s = x, where x is a 32-byte little-endian encoding of
    // s, and returns s. If x is not a canonical encoding of s, SetCanonicalBytes
    // returns nil and an error, and the receiver is unchanged.
    func (s *Scalar) SetCanonicalBytes(x []byte) (*Scalar, error) {
    	if len(x) != 32 {
    		return nil, errors.New("invalid scalar length")
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Mon May 13 18:57:38 UTC 2024
    - 10.8K bytes
    - Viewed (0)
  2. src/crypto/ed25519/ed25519.go

    	k, err := edwards25519.NewScalar().SetUniformBytes(hramDigest)
    	if err != nil {
    		panic("ed25519: internal error: setting scalar failed")
    	}
    
    	S, err := edwards25519.NewScalar().SetCanonicalBytes(sig[32:])
    	if err != nil {
    		return false
    	}
    
    	// [S]B = R + [k]A --> [k](-A) + [S]B = R
    	minusA := (&edwards25519.Point{}).Negate(A)
    	R := (&edwards25519.Point{}).VarTimeDoubleScalarBaseMult(k, minusA, S)
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Thu May 23 00:11:18 UTC 2024
    - 11.7K bytes
    - Viewed (0)
Back to top