Documentation ¶
Index ¶
- Constants
- Variables
- type CurveID
- type PrivateKey
- func NewAMAPrivateKey(wif string) (*PrivateKey, error)
- func NewAMAPrivateKeyFromSeed(seed string) (*PrivateKey, error)
- func NewDeterministicAMAPrivateKey(randSource io.Reader) (*PrivateKey, error)
- func NewDeterministicPrivateKey(randSource io.Reader) (*PrivateKey, error)
- func NewPrivateKey(wif string) (*PrivateKey, error)
- func NewPrivateKeyFromSeed(seed string) (*PrivateKey, error)
- func NewRandomAMAPrivateKey() (*PrivateKey, error)
- func NewRandomPrivateKey() (*PrivateKey, error)
- type PublicKey
- type Signature
- func MustNewAMASignature(fromText string) Signature
- func MustNewAMASignatureFromData(data []byte) Signature
- func MustNewSignature(fromText string) Signature
- func MustNewSignatureFromData(data []byte) Signature
- func NewAMASignature(signature string) (out Signature, err error)
- func NewAMASignatureFromData(data []byte) (Signature, error)
- func NewSignature(signature string) (out Signature, err error)
- func NewSignatureFromData(data []byte) (Signature, error)
- func (s Signature) MarshalJSON() ([]byte, error)
- func (s Signature) PublicKey(hash []byte) (out PublicKey, err error)
- func (s Signature) String() string
- func (s *Signature) UnmarshalJSON(data []byte) (err error)
- func (s Signature) Validate() error
- func (s Signature) Verify(hash []byte, pubKey PublicKey) bool
Constants ¶
View Source
const ( CurveK1 = CurveID(iota) CurveR1 CurveWA CurveK1AM )
View Source
const PrivateKeyPrefix = "PVT_"
View Source
const SignatureK1Prefix = "SIG_K1_"
View Source
const SignatureR1Prefix = "SIG_R1_"
View Source
const SignatureWAPrefix = "SIG_WA_"
Variables ¶
View Source
var B3 = big.NewInt(3)
We use 3 a couple of times in the decompress algorithm below
View Source
var PublicKeyAMPrefix = "AM"
View Source
var PublicKeyK1Prefix = "PUB_K1_"
View Source
var PublicKeyPrefix = "PUB_"
View Source
var PublicKeyPrefixCompat = "EOS"
View Source
var PublicKeyR1Prefix = "PUB_R1_"
View Source
var PublicKeyWAPrefix = "PUB_WA_"
Functions ¶
This section is empty.
Types ¶
type PrivateKey ¶
type PrivateKey struct { Curve CurveID // contains filtered or unexported fields }
func NewAMAPrivateKey ¶ added in v0.10.3
func NewAMAPrivateKey(wif string) (*PrivateKey, error)
func NewAMAPrivateKeyFromSeed ¶ added in v0.10.3
func NewAMAPrivateKeyFromSeed(seed string) (*PrivateKey, error)
func NewDeterministicAMAPrivateKey ¶ added in v0.10.3
func NewDeterministicAMAPrivateKey(randSource io.Reader) (*PrivateKey, error)
func NewDeterministicPrivateKey ¶
func NewDeterministicPrivateKey(randSource io.Reader) (*PrivateKey, error)
func NewPrivateKey ¶
func NewPrivateKey(wif string) (*PrivateKey, error)
func NewPrivateKeyFromSeed ¶ added in v0.10.3
func NewPrivateKeyFromSeed(seed string) (*PrivateKey, error)
func NewRandomAMAPrivateKey ¶ added in v0.10.3
func NewRandomAMAPrivateKey() (*PrivateKey, error)
func NewRandomPrivateKey ¶
func NewRandomPrivateKey() (*PrivateKey, error)
func (*PrivateKey) MarshalJSON ¶
func (p *PrivateKey) MarshalJSON() ([]byte, error)
func (*PrivateKey) PublicKey ¶
func (p *PrivateKey) PublicKey() PublicKey
func (*PrivateKey) Sign ¶
func (p *PrivateKey) Sign(hash []byte) (out Signature, err error)
Sign signs a 32 bytes SHA256 hash..
func (*PrivateKey) String ¶
func (p *PrivateKey) String() string
func (*PrivateKey) UnmarshalJSON ¶
func (p *PrivateKey) UnmarshalJSON(v []byte) (err error)
type PublicKey ¶
func MustNewPublicKey ¶
func NewPublicKey ¶
func NewPublicKeyFromData ¶
func (PublicKey) KeyMaterialSize ¶ added in v0.10.3
func (PublicKey) MarshalJSON ¶
func (*PublicKey) UnmarshalJSON ¶
type Signature ¶
type Signature struct { Curve CurveID Content []byte // the Compact signature as bytes // contains filtered or unexported fields }
Signature represents a signature for some hash
func MustNewAMASignature ¶ added in v0.10.3
func MustNewAMASignatureFromData ¶ added in v0.10.3
AMAX兼容
func MustNewSignature ¶ added in v0.10.3
func NewAMASignature ¶ added in v0.10.3
func NewAMASignatureFromData ¶ added in v0.10.3
func NewSignature ¶
func NewSignatureFromData ¶
func (Signature) MarshalJSON ¶
func (*Signature) UnmarshalJSON ¶
Click to show internal directories.
Click to hide internal directories.