package ecc import ( "bytes" "errors" "math/big" ) type EC struct { A *big.Int B *big.Int Q *big.Int } // NewEC (y^2 = x^3 + ax + b) mod q, where q is a prime number func NewEC(a, b, q int) (ec EC) { ec.A = big.NewInt(int64(a)) ec.B = big.NewInt(int64(b)) ec.Q = big.NewInt(int64(q)) return ec } // At gets a point x in the curve func (ec *EC) At(x *big.Int) (Point, Point, error) { if x.Cmp(ec.Q) > 0 { return Point{}, Point{}, errors.New("x