Documentation
¶
Overview ¶
Package mnemonic provides functions to generate and validate mnemonic phrases based on the BIP-39 standard, and to derive Falcon seeds from them.
It uses 24 words from the BIP-39 English word list, corresponding to 256 bits of entropy plus an 8-bit checksum.
This is consistent with NIST level 5 security requirements of 128 bits of quantum security, even if reduces Falcon-1024 native security of ~140 bits
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EntropyToMnemonic ¶
EntropyToMnemonic converts a 32-byte entropy value into a 24-word BIP-39 mnemonic.
func MnemonicToEntropy ¶
MnemonicToEntropy converts a 24-word BIP-39 mnemonic phrase into the original 32-byte entropy.
func SeedFromMnemonic ¶
SeedFromMnemonic derives a 48-byte Falcon seed from a BIP-39 mnemonic and optional passphrase. The procedure mirrors the BIP-39 specification and documents our only intentional deviation:
- Normalize the mnemonic sentence and passphrase with NFKD (as required by BIP-39) and run PBKDF2-HMAC-SHA512 with 2048 iterations and the "mnemonic"+passphrase salt to obtain the canonical 64-byte BIP-39 seed.
- Collapse that seed to the 48-byte value we'll use in falcon.GenerateKey via HKDF-SHA512 using a Falcon-specific salt/info pair.
Types ¶
This section is empty.