infincia / bip39-rs

A Rust implementation of BIP-0039
Apache License 2.0
54 stars 61 forks source link

Refactor #14

Closed maciejhirsz closed 5 years ago

maciejhirsz commented 5 years ago

Disclaimer: This is a really big PR and I'm happy to make a fork of the crate and maintain it on crates.io if you'd rather not change the API as much as I've done here.

Performance:

test from_entropy ... bench:         418 ns/iter (+/- 229)
test new_mnemonic ... bench:         560 ns/iter (+/- 347)
test new_seed     ... bench:   1,404,971 ns/iter (+/- 397,740)
test validate     ... bench:         657 ns/iter (+/- 591)

Generating a Seed is obviously most expensive due to the 2048 pbkdf2 rounds.

maciejhirsz commented 5 years ago

Closing since it's included in #15.