cryptofun/ecc/coord.go
ecc/coord.goRaw
1package ecc
2
3import (
4 "bytes"
5 "math/big"
6)
7
8var (
9 bigZero = big.NewInt(int64(0))
10 zeroPoint = Point{bigZero, bigZero}
11)
12
13type Point struct {
14 X *big.Int
15 Y *big.Int
16}
17
18func (c1 *Point) Equal(c2 Point) bool {
19 if !bytes.Equal(c1.X.Bytes(), c2.X.Bytes()) {
20 return false
21 }
22 if !bytes.Equal(c1.Y.Bytes(), c2.Y.Bytes()) {
23 return false
24 }
25 return true
26}