Lines Matching refs:big

13 	zero     = big.NewInt(0)
14 two = big.NewInt(2)
15 three = big.NewInt(3)
16 eight = big.NewInt(8)
17 nineteen = big.NewInt(19)
23 P *big.Int // the order of the underlying field
24 N *big.Int // the order of the base point
25 A *big.Int // the other constant of the curve equation
26 B *big.Int // the constant of the curve equation
27 Gx, Gy *big.Int // (x,y) of the base point
38 func (curve *SIEC255Params) IsOnCurve(x, y *big.Int) bool {
40 LHS := new(big.Int).Exp(y, two, curve.P)
42 RHS := new(big.Int).Exp(x, three, curve.P)
49 func (curve *SIEC255Params) Add(x1, y1, x2, y2 *big.Int) (x3, y3 *big.Int) {
61 z := new(big.Int).Sub(x2, x1)
62 lambda := new(big.Int).Sub(y2, y1)
70 x3 = new(big.Int).Exp(lambda, two, curve.P)
74 y3 = new(big.Int).Mul(lambda, z.Sub(x1, x3))
82 func (curve *SIEC255Params) Double(x1, y1 *big.Int) (x3, y3 *big.Int) {
83 x3 = new(big.Int)
84 y3 = new(big.Int)
87 lambda := new(big.Int).Mul(three, x3.Exp(x1, two, curve.P))
99 y3.Mul(lambda, new(big.Int).Sub(x1, x3))
107 …phiX, _ = new(big.Int).SetString("4000000000000000000000000200104000000000000000000004004101081000…
111 func (curve *SIEC255Params) phi(x1, y1 *big.Int) (x2, y2 *big.Int) {
112 x2 = new(big.Int).Mul(phiX, x1)
114 y2 = new(big.Int).Neg(y1)
120 endK, _ = new(big.Int).SetString("80000000000000000000000002001040", 16)
123 func (curve *SIEC255Params) scalarMult2(x1, y1 *big.Int, k []byte) (x, y *big.Int) {
124 z := new(big.Int).SetBytes(k)
125 r := new(big.Int)
140 x, y = new(big.Int), new(big.Int)
163 func (curve *SIEC255Params) ScalarMult(x1, y1 *big.Int, k []byte) (x, y *big.Int) {
164 x, y = new(big.Int), new(big.Int)
179 func (curve *SIEC255Params) ScalarBaseMult(k []byte) (x, y *big.Int) {
187 func (curve *SIEC255Params) liftX(X *big.Int) (x, y *big.Int) {
189 x = new(big.Int).Set(X)
190 y = new(big.Int)
192 y.Add(y, new(big.Int).Mul(x, curve.A))
200 if y.Cmp(new(big.Int).Sub(curve.P, y)) > 0 {
210 func (curve *SIEC255Params) Compress(x, y *big.Int) (c [32]byte) {
221 func (curve *SIEC255Params) Decompress(c [32]byte) (x, y *big.Int) {
224 x, y = curve.liftX(new(big.Int).SetBytes(reverse(c[:])))
235 siec255.Gx = big.NewInt(5)
236 siec255.Gy = big.NewInt(12)
237 siec255.A = big.NewInt(0)
238 siec255.B = big.NewInt(19)
239 …siec255.P, _ = new(big.Int).SetString("28948022309329048855892746252183396360603931420023084536990…
240 …siec255.N, _ = new(big.Int).SetString("28948022309329048855892746252183396360263649053102146073526…
255 func (curve *SIEC255Params) GenerateKey(rand io.Reader) (k []byte, x, y *big.Int, err error) {
272 if new(big.Int).SetBytes(k).Cmp(N) >= 0 {