seed

package
v0.0.0-...-b781472 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 6, 2025 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EntropySize determines the length of entropy to be generated
	EntropySize = 128 // Set default entropy size to 128 bits for 12-word mnemonic
	SaltSize    = 16  // 128 bits salt size
	PasskeySize = 32  // Set this to 32 bytes for a 256-bit output
	NonceSize   = 16  // 128 bits nonce size, adjustable as needed

)

Define constants for the sizes used in the seed generation process

Variables

This section is empty.

Functions

func EncodeBase32

func EncodeBase32(data []byte) string

EncodeBase32 encodes the input data into Base32 format without padding.

func GenerateEntropy

func GenerateEntropy() ([]byte, error)

GenerateEntropy generates secure random entropy for private key generation.

func GenerateKeys

func GenerateKeys() (passphrase string, base32Passkey string, hashedPasskey []byte, macKey []byte, chainCode []byte, fingerprint []byte, err error)

GenerateKeys generates a passphrase, a hashed Base32-encoded passkey, and its fingerprint.

func GenerateNonce

func GenerateNonce() ([]byte, error)

GenerateNonce generates a cryptographically secure random nonce.

func GeneratePasskey

func GeneratePasskey(passphrase string, pk []byte) ([]byte, error)

GeneratePasskey generates a passkey using Argon2 with the given passphrase and an optional public key as input material. If no public key (pk) is provided, a new one will be generated.

func GeneratePassphrase

func GeneratePassphrase(entropy []byte) (string, error)

GeneratePassphrase generates a sips0003 passphrase from entropy.

func GenerateSalt

func GenerateSalt() ([]byte, error)

GenerateSalt generates a cryptographically secure random salt.

func HashPasskey

func HashPasskey(passkey []byte) ([]byte, error)

HashPasskey hashes the given passkey using SHA3-512.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL