apov1 / PA193_mnemonic_SIGSEGVboys

Autumn 2019 semester project for PA193
GNU General Public License v3.0
0 stars 1 forks source link

PA193_mnemonic_SIGSEGVboys

Autumn 2019 semester project for PA193

Build Status codecov

Description

Implements generation of mnemonic sentence as defined in BIP39 Bitcoin Improvement Proposal 39. Written in C++, the implementation provides 3 basic functionalities:

  1. generation of mnemonic seed and phrase from input entropy
  2. generation of seed and initial entropy from mnemonic phrase
  3. checking if given mnemonic phrase generates given seed

The implementation itself (not counting tests) consists of two components: the library and the CLI. The library defines and implements API for usage in other projects. CLI provides demonstration of the library's functionality using command line arguments.

Usage

Prerequisites

  1. C++ compiler supporting at least c++17
  2. CMake, version at least 3.0
  3. OpenSSL library

Building the CMake projects creates three files - a bip39 library, a cli, and testsuite.

BIP39 library

API is described in the header files dictionary.hpp and mnemonic.hpp.

CLI usage

Availible arguments:

-h --help                   Prints out help similar to this one and quits
-d --dictionary             Sets path to file with dictionary (REQUIRED)
Exactly one of those three options are required:
-g --generate <entropy>     Generates mnemonic phrase and seed from input entropy file
-r --reverse <phrase>       Generates initial entropy and seed from mnemonic phrase
-c --check <phrase> <seed>  Checks if phrase generates seed

Testsuite

The last binary runs all tests from tests/ directory. Tests were written using Catch2 unit testing framework which is already included in the repository, so it generates no additional prerequisites.