Documentation ¶
Index ¶
- func BuildKeyBySeed(seed *[]byte, salt []byte) (*[]byte, *[]byte, error)
- func CheckPukAddr(pre string, pubKey []byte, addr AddressCoin) bool
- func DecryptCBC(ciphertext, key, iv []byte) ([]byte, error)
- func EncryptCBC(plantText, key, iv []byte) ([]byte, error)
- func GetHkdfChainCode(master, salt []byte, index uint64) (key, chainCode []byte, err error)
- func HkdfChainCodeNew(master, salt []byte, index uint64) (*[]byte, *[]byte, error)
- func HkdfChainCodeNewV3(master, salt []byte, index uint64) (*[]byte, *[]byte, error)
- func PKCS7Padding(ciphertext []byte, blockSize int) []byte
- func PKCS7UnPadding(plantText []byte, blockSize int) ([]byte, error)
- func ParseAddrPrefix(addr AddressCoin) string
- func Rand16Byte() ([16]byte, error)
- func Rand32Byte() ([32]byte, error)
- func ValidAddr(pre string, addr AddressCoin) bool
- type AddressCoin
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildKeyBySeed ¶
通过种子生成key和chainCode
func CheckPukAddr ¶
func CheckPukAddr(pre string, pubKey []byte, addr AddressCoin) bool
检查公钥生成的地址是否一样 @return bool 是否一样 true=相同;false=不相同;
func GetHkdfChainCode ¶
获取hkdf链编码 @master []byte 随机数 @salt []byte 盐 @index uint64 索引,棘轮数
func HkdfChainCodeNew ¶
获取hkdf链编码 @master []byte 随机数 @salt []byte 盐 @index uint64 索引,棘轮数
func HkdfChainCodeNewV3 ¶
获取hkdf链编码 @master []byte 随机数 @salt []byte 盐 @index uint64 索引,棘轮数
func PKCS7Padding ¶
PKCS #7 填充字符串由一个字节序列组成,每个字节填充该字节序列的长度。 下面的示例演示这些模式的工作原理。假定块长度为 8,数据长度为 9,则填充用八位字节数等于 7,数据等于 FF FF FF FF FF FF FF FF FF: 数据: FF FF FF FF FF FF FF FF FF PKCS7 填充: FF FF FF FF FF FF FF FF FF 07 07 07 07 07 07 07
func ParseAddrPrefix ¶
func ParseAddrPrefix(addr AddressCoin) string
func ValidAddr ¶
func ValidAddr(pre string, addr AddressCoin) bool
判断有效地址 @version []byte 版本号(如比特币主网版本号“0x00")
Types ¶
type AddressCoin ¶
type AddressCoin []byte
func AddressFromB58String ¶
func AddressFromB58String(str string) AddressCoin
func BuildAddr ¶
func BuildAddr(pre string, pubKey []byte) AddressCoin
通过公钥生成地址 @version []byte 版本号(如比特币主网版本号“0x00")
func (*AddressCoin) B58String ¶
func (this *AddressCoin) B58String() string
Click to show internal directories.
Click to hide internal directories.