Lines Matching refs:big

28 	IsOnCurve(x, y *big.Int) bool
30 Add(x1, y1, x2, y2 *big.Int) (x, y *big.Int)
32 Double(x1, y1 *big.Int) (x, y *big.Int)
34 ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int)
37 ScalarBaseMult(k []byte) (x, y *big.Int)
43 P *big.Int // the order of the underlying field
44 N *big.Int // the order of the base point
45 B *big.Int // the constant of the curve equation
46 Gx, Gy *big.Int // (x,y) of the base point
54 func (curve *CurveParams) IsOnCurve(x, y *big.Int) bool {
56 y2 := new(big.Int).Mul(y, y)
59 x3 := new(big.Int).Mul(x, x)
62 threeX := new(big.Int).Lsh(x, 1)
75 func zForAffine(x, y *big.Int) *big.Int {
76 z := new(big.Int)
85 func (curve *CurveParams) affineFromJacobian(x, y, z *big.Int) (xOut, yOut *big.Int) {
87 return new(big.Int), new(big.Int)
90 zinv := new(big.Int).ModInverse(z, curve.P)
91 zinvsq := new(big.Int).Mul(zinv, zinv)
93 xOut = new(big.Int).Mul(x, zinvsq)
96 yOut = new(big.Int).Mul(y, zinvsq)
101 func (curve *CurveParams) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) {
109 func (curve *CurveParams) addJacobian(x1, y1, z1, x2, y2, z2 *big.Int) (*big.Int, *big.Int, *big.In…
111 x3, y3, z3 := new(big.Int), new(big.Int), new(big.Int)
125 z1z1 := new(big.Int).Mul(z1, z1)
127 z2z2 := new(big.Int).Mul(z2, z2)
130 u1 := new(big.Int).Mul(x1, z2z2)
132 u2 := new(big.Int).Mul(x2, z1z1)
134 h := new(big.Int).Sub(u2, u1)
139 i := new(big.Int).Lsh(h, 1)
141 j := new(big.Int).Mul(h, i)
143 s1 := new(big.Int).Mul(y1, z2)
146 s2 := new(big.Int).Mul(y2, z1)
149 r := new(big.Int).Sub(s2, s1)
158 v := new(big.Int).Mul(u1, i)
185 func (curve *CurveParams) Double(x1, y1 *big.Int) (*big.Int, *big.Int) {
192 func (curve *CurveParams) doubleJacobian(x, y, z *big.Int) (*big.Int, *big.Int, *big.Int) {
194 delta := new(big.Int).Mul(z, z)
196 gamma := new(big.Int).Mul(y, y)
198 alpha := new(big.Int).Sub(x, delta)
202 alpha2 := new(big.Int).Add(x, delta)
210 x3 := new(big.Int).Mul(alpha, alpha)
211 beta8 := new(big.Int).Lsh(beta, 3)
218 z3 := new(big.Int).Add(y, z)
250 func (curve *CurveParams) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) {
251 Bz := new(big.Int).SetInt64(1)
252 x, y, z := new(big.Int), new(big.Int), new(big.Int)
267 func (curve *CurveParams) ScalarBaseMult(k []byte) (*big.Int, *big.Int) {
275 func GenerateKey(curve Curve, rand io.Reader) (priv []byte, x, y *big.Int, err error) {
297 func Marshal(curve Curve, x, y *big.Int) []byte {
311 func Unmarshal(curve Curve, data []byte) (x, y *big.Int) {
319 x = new(big.Int).SetBytes(data[1 : 1+byteLen])
320 y = new(big.Int).SetBytes(data[1+byteLen:])
339 …p256.P, _ = new(big.Int).SetString("11579208921035624876269744694940757353008614341529031419553363…
340 …p256.N, _ = new(big.Int).SetString("11579208921035624876269744694940757352999695522413576034242225…
341 …p256.B, _ = new(big.Int).SetString("5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d260…
342 …p256.Gx, _ = new(big.Int).SetString("6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c…
343 …p256.Gy, _ = new(big.Int).SetString("4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf5…
350 …p384.P, _ = new(big.Int).SetString("39402006196394479212279040100143613805079739270465446667948293…
351 …p384.N, _ = new(big.Int).SetString("39402006196394479212279040100143613805079739270465446667946905…
352 …p384.B, _ = new(big.Int).SetString("b3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f501387…
353 …p384.Gx, _ = new(big.Int).SetString("aa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542…
354 …p384.Gy, _ = new(big.Int).SetString("3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b…
361 …p521.P, _ = new(big.Int).SetString("68647976601306097149819007990813932172694353001433054093944634…
362 …p521.N, _ = new(big.Int).SetString("68647976601306097149819007990813932172694353001433054093944634…
363 …p521.B, _ = new(big.Int).SetString("051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef…
364 …p521.Gx, _ = new(big.Int).SetString("c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4…
365 …p521.Gy, _ = new(big.Int).SetString("11839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd1727…