Documentation
¶
Index ¶
- func Prime() *big.Int
- type FieldElement
- func (elm *FieldElement) Add(a, b FieldInterface) FieldInterface
- func (elm *FieldElement) Calc() (FieldInterface, error)
- func (elm *FieldElement) Copy() FieldInterface
- func (elm *FieldElement) Div(a, b FieldInterface) FieldInterface
- func (elm *FieldElement) Eq(other FieldInterface) bool
- func (elm *FieldElement) Mul(a, b FieldInterface) FieldInterface
- func (elm *FieldElement) Ne(other FieldInterface) bool
- func (elm *FieldElement) Pow(n FieldInterface, exp *big.Int) FieldInterface
- func (elm *FieldElement) RMul(n FieldInterface, coef *big.Int) FieldInterface
- func (elm *FieldElement) String() string
- func (elm *FieldElement) Sub(a, b FieldInterface) FieldInterface
- type FieldInterface
- type Point
- type PrivateKey
- type S256Field
- type S256Point
- func (p *S256Point) Add(p1, p2 *S256Point) *S256Point
- func (p *S256Point) Address(compress, testnet bool) string
- func (p *S256Point) Hash160(compress bool) []byte
- func (p *S256Point) RMul(r *S256Point, coef *big.Int) *S256Point
- func (p *S256Point) Sec(compress bool) []byte
- func (p *S256Point) Verify(z *big.Int, sig *Signature) bool
- type Signature
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type FieldElement ¶
func NewFieldElement ¶
func NewFieldElementFromInt64 ¶
func NewFieldElementFromInt64(num int64, prime int64) (*FieldElement, error)
func (*FieldElement) Add ¶
func (elm *FieldElement) Add(a, b FieldInterface) FieldInterface
func (*FieldElement) Calc ¶
func (elm *FieldElement) Calc() (FieldInterface, error)
func (*FieldElement) Copy ¶
func (elm *FieldElement) Copy() FieldInterface
func (*FieldElement) Div ¶
func (elm *FieldElement) Div(a, b FieldInterface) FieldInterface
func (*FieldElement) Eq ¶
func (elm *FieldElement) Eq(other FieldInterface) bool
func (*FieldElement) Mul ¶
func (elm *FieldElement) Mul(a, b FieldInterface) FieldInterface
func (*FieldElement) Ne ¶
func (elm *FieldElement) Ne(other FieldInterface) bool
func (*FieldElement) Pow ¶
func (elm *FieldElement) Pow(n FieldInterface, exp *big.Int) FieldInterface
func (*FieldElement) RMul ¶
func (elm *FieldElement) RMul(n FieldInterface, coef *big.Int) FieldInterface
func (*FieldElement) String ¶
func (elm *FieldElement) String() string
func (*FieldElement) Sub ¶
func (elm *FieldElement) Sub(a, b FieldInterface) FieldInterface
type FieldInterface ¶
type FieldInterface interface { Eq(other FieldInterface) bool Ne(other FieldInterface) bool Calc() (FieldInterface, error) Copy() FieldInterface Add(a, b FieldInterface) FieldInterface Sub(a, b FieldInterface) FieldInterface Mul(a, b FieldInterface) FieldInterface Div(a, b FieldInterface) FieldInterface Pow(n FieldInterface, exp *big.Int) FieldInterface RMul(n FieldInterface, coef *big.Int) FieldInterface }
type Point ¶
type Point struct { X FieldInterface Y FieldInterface A FieldInterface B FieldInterface Err error }
func NewPoint ¶
func NewPoint(x FieldInterface, y FieldInterface, a FieldInterface, b FieldInterface) (*Point, error)
type PrivateKey ¶
func NewPrivateKey ¶
func NewPrivateKey(secret *big.Int) *PrivateKey
func (*PrivateKey) Hex ¶
func (key *PrivateKey) Hex() string
func (*PrivateKey) Wif ¶
func (key *PrivateKey) Wif(compress, testnet bool) string
type S256Field ¶
type S256Field struct {
*FieldElement
}
Click to show internal directories.
Click to hide internal directories.