Documentation
¶
Index ¶
- Constants
- func EncodeBase32(data []byte) string
- func GenerateEntropy() ([]byte, error)
- func GenerateKeys() (passphrase string, base32Passkey string, hashedPasskey []byte, macKey []byte, ...)
- func GenerateNonce() ([]byte, error)
- func GeneratePasskey(passphrase string, pk []byte) ([]byte, error)
- func GeneratePassphrase(entropy []byte) (string, error)
- func GenerateSalt() ([]byte, error)
- func HashPasskey(passkey []byte) ([]byte, error)
Constants ¶
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 ¶
EncodeBase32 encodes the input data into Base32 format without padding.
func GenerateEntropy ¶
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 ¶
GenerateNonce generates a cryptographically secure random nonce.
func GeneratePasskey ¶
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 ¶
GeneratePassphrase generates a sips0003 passphrase from entropy.
func GenerateSalt ¶
GenerateSalt generates a cryptographically secure random salt.
func HashPasskey ¶
HashPasskey hashes the given passkey using SHA3-512.
Types ¶
This section is empty.