mnemonic

package
v1.1.2 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2025 License: AGPL-3.0 Imports: 9 Imported by: 0

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

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

EntropyToMnemonic converts a 32-byte entropy value into a 24-word BIP-39 mnemonic.

func MnemonicToEntropy

func MnemonicToEntropy(phrase []string) ([]byte, error)

MnemonicToEntropy converts a 24-word BIP-39 mnemonic phrase into the original 32-byte entropy.

func SeedFromMnemonic

func SeedFromMnemonic(phrase []string, passphrase string) ([falconSeedSize]byte, error)

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:

  1. 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.
  2. 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.

Jump to

Keyboard shortcuts

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