Documentation ¶
Index ¶
- Variables
- func RecoverPubkey(msg []byte, sig []byte) ([]byte, error)
- func Sign(msg []byte, seckey []byte, rand io.Reader) ([]byte, error)
- type BitCurve
- func (BitCurve *BitCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) IsOnCurve(x, y *big.Int) bool
- func (BitCurve *BitCurve) Params() *elliptic.CurveParams
- func (BitCurve *BitCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int)
- func (BitCurve *BitCurve) ScalarMult(Bx, By *big.Int, scalar []byte) (*big.Int, *big.Int)
Constants ¶
This section is empty.
Variables ¶
View Source
var (
N *big.Int
)
holds ptr to secp256k1_context_struct (see secp256k1/include/secp256k1.h)
Functions ¶
func RecoverPubkey ¶
RecoverPubkey returns the the public key of the signer. msg must be the 32-byte hash of the message to be signed. sig must be a 65-byte compact ECDSA signature containing the recovery id as the last element.
Types ¶
type BitCurve ¶
type BitCurve struct { P *big.Int // the order of the underlying field N *big.Int // the order of the base point B *big.Int // the constant of the BitCurve equation Gx, Gy *big.Int // (x,y) of the base point BitSize int // the size of the underlying field Name string // the canonical name of the curve }
A BitCurve represents a Koblitz Curve with a=0. See http://www.hyperelliptic.org/EFD/g1p/auto-shortw.html
func S256 ¶
func S256() *BitCurve
S256 returns a BitCurve which implements secp256k1 (see SEC 2 section 2.7.1)
func (*BitCurve) Params ¶
func (BitCurve *BitCurve) Params() *elliptic.CurveParams
Params returns elliptic curve parameter
func (*BitCurve) ScalarBaseMult ¶
ScalarBaseMult returns k*G, where G is the base point of the group and k is an integer in big-endian form.
Click to show internal directories.
Click to hide internal directories.