Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePointG1 ¶
func G1Generator ¶
Types ¶
type PrivateKey ¶
type PrivateKey struct {
// contains filtered or unexported fields
}
func DeriveChildSk ¶
func DeriveChildSk(parentSk PrivateKey, index int) PrivateKey
DeriveChildSk python-impl: def derive_child_sk(parent_sk: PrivateKey, index: int) -> PrivateKey:
""" Derives a hardened EIP-2333 child private key, from a parent private key, at the specified index. """ lamport_pk = parent_sk_to_lamport_pk(parent_sk, index) return key_gen(lamport_pk)
func KeyGen ¶
func KeyGen(seed []byte) PrivateKey
KeyGen python-impl: def key_gen(seed: bytes) -> PrivateKey:
# KeyGen # 1. PRK = HKDF-Extract("BLS-SIG-KEYGEN-SALT-", IKM || I2OSP(0, 1)) # 2. OKM = HKDF-Expand(PRK, keyInfo || I2OSP(L, 2), L) # 3. SK = OS2IP(OKM) mod r # 4. return SK L = 48 # `ceil((3 * ceil(log2(r))) / 16)`, where `r` is the order of the BLS 12-381 curve okm = extract_expand(L, seed + bytes([0]), b"BLS-SIG-KEYGEN-SALT-", bytes([0, L])) return PrivateKey(int.from_bytes(okm, "big") % default_ec.n)
func (PrivateKey) Bytes ¶
func (pk PrivateKey) Bytes() []byte
func (PrivateKey) GetG1 ¶
func (pk PrivateKey) GetG1() *bls12381.PointG1
GetG1 python-impl: def get_g1(self):
return self.value * G1Generator()
Click to show internal directories.
Click to hide internal directories.