Documentation ¶
Index ¶
- Constants
- Variables
- func G1Generator() *bls12381.PointG1
- func Hash256(m []byte) []byte
- type AugSchemeMPL
- func (asm *AugSchemeMPL) Aggregate(signatures ...[]byte) ([]byte, error)
- func (asm *AugSchemeMPL) AggregateVerify(pks [][]byte, messages [][]byte, sig []byte) bool
- func (asm *AugSchemeMPL) Sign(sk PrivateKey, message []byte) []byte
- func (asm *AugSchemeMPL) SignWithPrependPK(sk PrivateKey, prependPK PublicKey, message []byte) []byte
- func (asm *AugSchemeMPL) Verify(pk PublicKey, message []byte, sig []byte) bool
- type PrivateKey
- func DeriveChildSk(parentSk PrivateKey, index int) PrivateKey
- func DeriveChildSkUnhardened(parentSk PrivateKey, index uint32) PrivateKey
- func DerivePathUnhardened(sk PrivateKey, path []uint32) PrivateKey
- func KeyFromBytes(keyBytes []byte) PrivateKey
- func KeyFromHexString(key string) (PrivateKey, error)
- func KeyGen(seed []byte) PrivateKey
- func KeyGenWithMnemonic(mnemonic, password string) PrivateKey
- func (key PrivateKey) Bytes() []byte
- func (key PrivateKey) FarmerSk() PrivateKey
- func (key PrivateKey) GetPublicKey() PublicKey
- func (key PrivateKey) Hex() string
- func (key PrivateKey) LocalSk() PrivateKey
- func (key PrivateKey) PoolSk() PrivateKey
- func (key PrivateKey) SyntheticSk(hiddenPuzzleHash []byte) PrivateKey
- func (key PrivateKey) WalletSk(index int) PrivateKey
- type PublicKey
Constants ¶
View Source
const PrivateKeySize = 32
Variables ¶
View Source
var (
AugSchemeDst = []byte("BLS_SIG_BLS12381G2_XMD:SHA-256_SSWU_RO_AUG_")
)
View Source
var GroupOrder = new(big.Int).SetBytes([]byte{
115, 237, 167, 83, 41, 157, 125, 72, 51, 57, 216, 8, 9, 161, 216, 5,
83, 189, 164, 2, 255, 254, 91, 254, 255, 255, 255, 255, 0, 0, 0, 1,
})
View Source
var Hidden = []byte{
113, 29, 108, 78, 50, 201, 46, 83, 23, 155, 25, 148, 132, 207, 140, 137,
117, 66, 188, 87, 242, 178, 37, 130, 121, 159, 157, 101, 126, 236, 70, 153,
}
Functions ¶
func G1Generator ¶
Types ¶
type AugSchemeMPL ¶
type AugSchemeMPL struct{}
func (*AugSchemeMPL) Aggregate ¶
func (asm *AugSchemeMPL) Aggregate(signatures ...[]byte) ([]byte, error)
Aggregate 多签
func (*AugSchemeMPL) AggregateVerify ¶
func (asm *AugSchemeMPL) AggregateVerify(pks [][]byte, messages [][]byte, sig []byte) bool
AggregateVerify 多签验证
func (*AugSchemeMPL) Sign ¶
func (asm *AugSchemeMPL) Sign(sk PrivateKey, message []byte) []byte
Sign 签名
func (*AugSchemeMPL) SignWithPrependPK ¶
func (asm *AugSchemeMPL) SignWithPrependPK(sk PrivateKey, prependPK PublicKey, message []byte) []byte
SignWithPrependPK 前置pubKey签名
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func DeriveChildSk ¶
func DeriveChildSk(parentSk PrivateKey, index int) PrivateKey
func DeriveChildSkUnhardened ¶
func DeriveChildSkUnhardened(parentSk PrivateKey, index uint32) PrivateKey
func DerivePathUnhardened ¶
func DerivePathUnhardened(sk PrivateKey, path []uint32) PrivateKey
To make keys more secure, choose path len value of at least 4 ex: []int{44, 8444, 2, varyingIndex}
func KeyFromBytes ¶
func KeyFromBytes(keyBytes []byte) PrivateKey
func KeyFromHexString ¶
func KeyFromHexString(key string) (PrivateKey, error)
func KeyGen ¶
func KeyGen(seed []byte) PrivateKey
func KeyGenWithMnemonic ¶
func KeyGenWithMnemonic(mnemonic, password string) PrivateKey
func (PrivateKey) SyntheticSk ¶
func (key PrivateKey) SyntheticSk(hiddenPuzzleHash []byte) PrivateKey
SyntheticSk 生成SyntheticSk
func (PrivateKey) WalletSk ¶
func (key PrivateKey) WalletSk(index int) PrivateKey
WalletSk 派生WalletSk
type PublicKey ¶
type PublicKey struct {
// contains filtered or unexported fields
}
func NewPublicKey ¶
Click to show internal directories.
Click to hide internal directories.