Documentation
¶
Index ¶
- func AESDecrypt(crypted, key []byte) ([]byte, error)
- func AESDecryptV2(src, key string) string
- func AESEncrypt(src, key []byte) ([]byte, error)
- func AESEncryptV2(src, key string) string
- func Base58CheckDecode(s string) (b []byte, err error)
- func Base58CheckEncode(b []byte) string
- func Base58Decode(s string) ([]byte, error)
- func Base58Encode(bytes []byte) string
- type ECPoint
- type EllipticCurve
- func (c *EllipticCurve) Add(P, Q ECPoint) (R ECPoint)
- func (c *EllipticCurve) Decompress(x *big.Int, ylsb uint) (P ECPoint, err error)
- func (c *EllipticCurve) IsInfinity(P ECPoint) bool
- func (c *EllipticCurve) IsOnCurve(P ECPoint) bool
- func (c *EllipticCurve) ScalarBaseMult(k *big.Int) (Q ECPoint)
- func (c *EllipticCurve) ScalarMult(k *big.Int, P ECPoint) (Q ECPoint)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecrypt ¶
AESDecrypt decrypts the encrypted source with the given key.
func AESDecryptV2 ¶
AESDecryptV2 decode by AES output string
func AESEncrypt ¶
AESEncrypt encrypts the key with the given source.
func AESEncryptV2 ¶
AESEncryptV2 encode by AES output string
func Base58CheckDecode ¶
Base58CheckDecode decodes the given string.
func Base58CheckEncode ¶
Base58checkEncode encodes b into a base-58 check encoded string.
func Base58Decode ¶
Base58Decode decodes the base58 encoded string.
func Base58Encode ¶
Base58Encode encodes a byte slice to be a base58 encoded string.
Types ¶
type ECPoint ¶
ECPoint represents a point on the EllipticCurve.
func ECPointFromReader ¶
ECPointFromReader return a new point from the given reader. f == 4, 6 or 7 are not implemented.
func RandomECPoint ¶
func RandomECPoint() ECPoint
RandomECPoint returns a random generated ECPoint, mostly used for testing.
func (ECPoint) EncodeBinary ¶
EncodeBinary encodes the point to the given io.Writer.
func (*ECPoint) IsInfinity ¶
IsInfinity checks if point P is infinity on EllipticCurve ec.
type EllipticCurve ¶
EllipticCurve represents the parameters of a short Weierstrass equation elliptic curve.
func NewEllipticCurve ¶
func NewEllipticCurve() EllipticCurve
NewEllipticCurve returns a ready to use EllipticCurve with preconfigured fields for the NEO protocol.
func (*EllipticCurve) Add ¶
func (c *EllipticCurve) Add(P, Q ECPoint) (R ECPoint)
Add computes R = P + Q on EllipticCurve ec.
func (*EllipticCurve) Decompress ¶
Decompress decompresses coordinate x and ylsb (y's least significant bit) into a ECPoint P on EllipticCurve ec.
func (*EllipticCurve) IsInfinity ¶
func (c *EllipticCurve) IsInfinity(P ECPoint) bool
IsInfinity checks if point P is infinity on EllipticCurve ec.
func (*EllipticCurve) IsOnCurve ¶
func (c *EllipticCurve) IsOnCurve(P ECPoint) bool
IsOnCurve checks if point P is on EllipticCurve ec.
func (*EllipticCurve) ScalarBaseMult ¶
func (c *EllipticCurve) ScalarBaseMult(k *big.Int) (Q ECPoint)
ScalarBaseMult computes Q = k * G on EllipticCurve ec.
func (*EllipticCurve) ScalarMult ¶
func (c *EllipticCurve) ScalarMult(k *big.Int, P ECPoint) (Q ECPoint)
ScalarMult computes Q = k * P on EllipticCurve ec.