Documentation ¶
Index ¶
- Constants
- Variables
- func AESDecrypt(crypted, key []byte) ([]byte, error)
- func AESEncrypt(src, key []byte) ([]byte, error)
- func AddressToScriptHash(address string, version byte) (*helper.UInt160, error)
- func Base58CheckDecode(input string) ([]byte, error)
- func Base58CheckEncode(input []byte) string
- func Base64Decode(input string) ([]byte, error)
- func Base64Encode(input []byte) string
- func BytesToScriptHash(script []byte) *helper.UInt160
- func Decode(input string) ([]byte, error)
- func Encode(input []byte) string
- func ExpectedECPointLength(curve *elliptic.Curve) int
- func Hash160(ba []byte) []byte
- func Hash256(ba []byte) []byte
- func ScriptHashToAddress(scriptHash *helper.UInt160, version byte) string
- func Sha256(b []byte) []byte
- type ECPoint
- func CreateECPoint(x *big.Int, y *big.Int, curve *elliptic.Curve) (*ECPoint, error)
- func DecodePoint(encoded []byte, curve *elliptic.Curve) (*ECPoint, error)
- func DeserializeFrom(br *io.BinaryReader, curve *elliptic.Curve) (*ECPoint, error)
- func FromBytes(data []byte, curve *elliptic.Curve) (*ECPoint, error)
- func NewECPoint() (*ECPoint, error)
- func NewECPointFromBytes(data []byte) (*ECPoint, error)
- func NewECPointFromString(s string) (*ECPoint, error)
- func Parse(value string, curve *elliptic.Curve) (*ECPoint, error)
- func (p *ECPoint) CompareTo(other *ECPoint) int
- func (p *ECPoint) Deserialize(br *io.BinaryReader)
- func (p *ECPoint) EncodePoint(compressed bool) []byte
- func (p *ECPoint) Equals(other *ECPoint) bool
- func (p *ECPoint) ExistsIn(points []ECPoint) bool
- func (p *ECPoint) IsInfinity() bool
- func (p *ECPoint) IsOnCurve() bool
- func (p *ECPoint) Serialize(bw *io.BinaryWriter)
- func (p *ECPoint) Size() int
- func (p *ECPoint) String() string
- func (p *ECPoint) ToECDsa() *ecdsa.PublicKey
- type PublicKeySlice
Constants ¶
View Source
const BASE58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"
View Source
const PREFIX rune = '1'
Variables ¶
View Source
var P256 = elliptic.P256()
Functions ¶
func AESDecrypt ¶
AESDecrypt decrypts the encrypted source with the given key.
func AESEncrypt ¶
AESEncrypt encrypts the key with the given source.
func AddressToScriptHash ¶
func Base64Decode ¶
func Base64Encode ¶
func BytesToScriptHash ¶
func ExpectedECPointLength ¶
expected byte array length
func Hash160 ¶
Hash160 first calculate SHA-256 hash result of ba, then RIPEMD-160 hash of the result
func ScriptHashToAddress ¶
Types ¶
type ECPoint ¶
type ECPoint struct {
X, Y *big.Int
Curve elliptic.Curve
// contains filtered or unexported fields
}
func CreateECPoint ¶
func DeserializeFrom ¶
func NewECPoint ¶
func NewECPointFromBytes ¶
NewPublicKey return a public key created from the given []byte.
func NewECPointFromString ¶
NewPublicKeyFromString return a public key created from the given hex string.
func (*ECPoint) Deserialize ¶
func (p *ECPoint) Deserialize(br *io.BinaryReader)
Deserialize a PublicKey from the given io.Reader.
func (*ECPoint) EncodePoint ¶
EncodePoint encodes the point to a byte array
func (*ECPoint) IsInfinity ¶
IsInfinity checks if point P is infinity on EllipticCurve ec.
func (*ECPoint) Serialize ¶
func (p *ECPoint) Serialize(bw *io.BinaryWriter)
Serialize encodes a PublicKey to the given io.Writer.
type PublicKeySlice ¶
type PublicKeySlice []ECPoint
PublicKeys is a list of public keys.
func (PublicKeySlice) GetVarSize ¶
func (keys PublicKeySlice) GetVarSize() int
func (PublicKeySlice) Len ¶
func (keys PublicKeySlice) Len() int
func (PublicKeySlice) Less ¶
func (keys PublicKeySlice) Less(i, j int) bool
func (PublicKeySlice) Swap ¶
func (keys PublicKeySlice) Swap(i, j int)
Click to show internal directories.
Click to hide internal directories.