seedgenerator

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2024 License: MPL-2.0 Imports: 7 Imported by: 3

Documentation

Index

Constants

View Source
const (
	EntMultiplicity = 32
	ENT32           = 32
	ENT64           = ENT32 + EntMultiplicity
	ENT96           = ENT64 + EntMultiplicity
	ENT128          = ENT96 + EntMultiplicity
	ENT160          = ENT128 + EntMultiplicity
	ENT192          = ENT160 + EntMultiplicity
	ENT224          = ENT192 + EntMultiplicity
	ENT256          = ENT224 + EntMultiplicity
)

Base entropy sizes.

View Source
const (
	// DictBitsSize - dict len in bits
	DictBitsSize = 11 // bits
	// DictLen - dict len in words.
	DictLen = (1 << DictBitsSize) - 1
)
View Source
const (
	DefaultArgon2Times   = 1
	DefaultArgon2Mem     = 64 * 1024
	DefaultArgon2Threads = 4
	DefaultArgon2SaltLen = 16 // bytes
)

Argon2 constants.

Variables

View Source
var (
	// ErrDictIndexTooBig - big dict index (>2047).
	ErrDictIndexTooBig = errors.New("dict index too big")
	// ErrUnsupportedEntropySize - unsupported entropy size.
	ErrUnsupportedEntropySize = errors.New("usuported entropy size")
)

Functions

func EntropyWithCS

func EntropyWithCS(sz int) ([]byte, int, error)

EntropyWithCS - make entropy, and append control sum as bip39.

func ExtractChunk

func ExtractChunk(buf []byte, i int) int

ExtractChunk - extract DictBitSize chunk at a position in byte slice.

func Mnemonics

func Mnemonics(sz int, dict []string) (string, error)

Mnemonics - create mnemo phrase.

func Seed

func Seed(sz int, extra string) (string, []byte, []byte, error)

Seed - assemble mnemo and generate seed from this memo.

func SeedFromMnemonics

func SeedFromMnemonics(mnemo, extra string) ([]byte, []byte, error)

SeedFromMnemonics - generate seed from given mnemonics.

func SeedFromSaltMnemonics

func SeedFromSaltMnemonics(mnemo, extra string, salt []byte) []byte

SeedFromSaltMnemonics - generate seed from given mnemonics and salt.

Types

This section is empty.

Jump to

Keyboard shortcuts

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