Documentation ¶
Overview ¶
Package p256 Encapsulates secP256k1 elliptic curve.
Index ¶
- Variables
- func F(x *big.Int) (*big.Int, error)
- func HashToInt(b bytes.Buffer) (*big.Int, error)
- type MyBitCurve
- type P256
- func (p *P256) Add(a, b *P256) *P256
- func (p *P256) Double(a *P256) *P256
- func (p *P256) IsOnCurve() bool
- func (p *P256) IsZero() bool
- func (p *P256) Multiply(a, b *P256) *P256
- func (p *P256) Neg(a *P256) *P256
- func (p *P256) ScalarBaseMult(n *big.Int) *P256
- func (p *P256) ScalarMult(a *P256, n *big.Int) *P256
- func (p *P256) SetInfinity() *P256
- func (p *P256) String() string
Constants ¶
This section is empty.
Variables ¶
var (
CURVE = S256()
)
Functions ¶
Types ¶
type MyBitCurve ¶
type P256 ¶
Elliptic Curve Point struct.
func MapToGroup ¶
MapToGroup is a hash function that returns a valid elliptic curve point given as input a string. It is also known as hash-to-point and is used to obtain a generator that has no discrete logarithm known relation, thus addressing the concept of NUMS (nothing up my sleeve). This implementation is based on the paper: Short signatures from the Weil pairing Boneh, Lynn and Shacham Journal of Cryptology, September 2004, Volume 17, Issue 4, pp 297–319
func (*P256) IsOnCurve ¶
IsOnCurve returns TRUE if and only if p has coordinates X and Y that satisfy the Elliptic Curve equation: y^2 = x^3 + 7.
func (*P256) IsZero ¶
IsZero returns true if and only if the elliptic curve point is the point at infinity.
func (*P256) Multiply ¶
Multiply actually is reponsible for the addition of elliptic curve points. The name here is to maintain compatibility with bn256 interface. This algorithm verifies if the given elliptic curve points are equal, in which case it returns the result of Double function, otherwise it returns the result of Add function.
func (*P256) ScalarBaseMult ¶
ScalarBaseMult returns the Scalar Multiplication by the base generator.
func (*P256) ScalarMult ¶
ScalarMul encapsulates the scalar Multiplication Algorithm from secP256k1.
func (*P256) SetInfinity ¶
SetInfinity sets the given elliptic curve point to the point at infinity.