Versions in this module Expand all Collapse all v0 v0.1.0 Sep 21, 2019 Changes in this version + const ECP256_FIPS186 + const PUBLICKEY_FINGERPRINT_LEN + const PublicKeyCompressedLength + const SECP256K1 + var DefaultCurveType = ECP256_FIPS186 + var DefaultFactory = cryptoFactory + var DefaultVersion = crypto.DefaultVersion + func GetEC(curveType int32) (elliptic.Curve, error) + func Secp256k1() elliptic.Curve + type KeyDerivation struct + Chaincode []byte + Index *big.Int + RootFingerPrint []byte + func (kd *KeyDerivation) FromKDMessage(msg *protos.KeyDerived) + func (kd *KeyDerivation) GenIntermediary(pub *ecdsa.PublicKey, index *big.Int) ([]byte, *KeyDerivation, error) + func (kd *KeyDerivation) GetIndex() *big.Int + func (kd *KeyDerivation) GetRootFingerPrint() []byte + func (kd *KeyDerivation) ToKDMessage() *protos.KeyDerived + type KoblitzCurve struct + B *big.Int + BitSize int + Gx *big.Int + Gy *big.Int + N *big.Int + P *big.Int + func (curve *KoblitzCurve) Add(x1, y1, x2, y2 *big.Int) (*big.Int, *big.Int) + func (curve *KoblitzCurve) Double(x1, y1 *big.Int) (*big.Int, *big.Int) + func (curve *KoblitzCurve) IsOnCurve(x, y *big.Int) bool + func (curve *KoblitzCurve) Params() *elliptic.CurveParams + func (curve *KoblitzCurve) ScalarBaseMult(k []byte) (*big.Int, *big.Int) + func (curve *KoblitzCurve) ScalarMult(Bx, By *big.Int, k []byte) (*big.Int, *big.Int) + type PrivateKey struct + CurveType int32 + Key *ecdsa.PrivateKey + Version int32 + func NewDefaultPrivatekey() (*PrivateKey, error) + func NewPrivatekey(curveType int32) (*PrivateKey, error) + func NewSECP256K1Privkey(s string) *PrivateKey + func (priv *PrivateKey) Child(index *big.Int) (crypto.Hierarchical, error) + func (priv *PrivateKey) ChildPublic(index *big.Int) (*PublicKey, error) + func (priv *PrivateKey) FromPBMessage(msg proto.Message) error + func (priv *PrivateKey) IsEqual(p interface{}) bool + func (priv *PrivateKey) IsEqualForTest(otherPriv *PrivateKey) bool + func (priv *PrivateKey) PBMessage() proto.Message + func (priv *PrivateKey) Public() crypto.Verifier + func (priv *PrivateKey) Sign(hash []byte) (sig *protos.Signature, err error) + func (priv *PrivateKey) String() string + func (priv *PrivateKey) ToECDSA() *ecdsa.PrivateKey + type PublicKey struct + CurveType int32 + Key *ecdsa.PublicKey + Version int32 + func (pub *PublicKey) Child(index *big.Int) (crypto.Hierarchical, error) + func (pub *PublicKey) Digest() []byte + func (pub *PublicKey) FromPBMessage(msg proto.Message) error + func (pub *PublicKey) IsEqual(p interface{}) bool + func (pub *PublicKey) IsEqualForTest(otherPub *PublicKey) bool + func (pub *PublicKey) PBMessage() proto.Message + func (pub *PublicKey) Recover(sig *protos.Signature) error + func (pub *PublicKey) String() string + func (pub *PublicKey) ToECDSA() *ecdsa.PublicKey + func (pub *PublicKey) Verify(hash []byte, sig *protos.Signature) bool