Skip to content

Commit 8396209

Browse files
sleepdefic1tfaustbrian
authored andcommitted
refactor: Remove bip39 library (#86)
1 parent 3f20868 commit 8396209

19 files changed

Lines changed: 12 additions & 306 deletions

File tree

.gitmodules

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
[submodule "src/lib/uECC"]
22
path = src/lib/uECC
33
url = https://github.com/kmackay/micro-ecc
4-
[submodule "src/lib/bip39"]
5-
path = src/lib/bip39
6-
url = https://github.com/ciband/bip39.git
74
[submodule "test/lib/googletest"]
85
path = test/lib/googletest
96
url = https://github.com/google/googletest.git

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
66
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
77

8+
## [0.5.0] - 2019-02-20
9+
10+
### Changed
11+
12+
- removed bip39 and mnemonic feature ([#86])
13+
814
## [0.4.0] - 2019-05-20
915

1016
### Changed

docs/INSTALL_PLATFORMIO.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ or
1818
1919

2020
also install platformio dependencies:
21-
> install AUnit (2778), micro-ecc (1665) bip39 (5886) ArduinoJson@6.10.0 libraries
22-
>```platformio lib -g install 2778 1665 5886 ArduinoJson@6.10.0```
21+
> install AUnit (2778), micro-ecc (1665) ArduinoJson@6.10.0 libraries
22+
>```platformio lib -g install 2778 1665 ArduinoJson@6.10.0```
2323
2424
#
2525

docs/cpp.md

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -68,18 +68,6 @@ message.verify();
6868

6969
## Identities
7070

71-
### Passphrase
72-
73-
#### Generate a default passphrase with 12 words in English
74-
```cpp
75-
const auto passphrase = Ark::Crypto::Identies::Mnemonic::generate();
76-
```
77-
78-
#### Generate a passphrase with the given language and 24 words
79-
```cpp
80-
const auto passphrase = Ark::Crypto::Identies::Mnemonic::generate(24, Ark::Crypto::Identies::Language::en);
81-
```
82-
8371
### Address
8472

8573
#### Get an address from a passphrase

examples/cmake_example/main.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,6 @@ int main(int argc, char* argv[]) {
3434
std::cout << "\tVerified: " << std::boolalpha << message.verify() << '\n';
3535
std::cout << '\n';
3636

37-
// Mnemonic
38-
const auto new_passphrase = Ark::Crypto::Identities::Mnemonic::generate();
39-
std::cout << "Generated Mnemonic: " << new_passphrase << '\n';
40-
std::cout << '\n';
41-
4237
// Address - from passphrase
4338
const uint8_t networkVersion = 0x1E;
4439
auto address = Address::fromPassphrase(passphrase, networkVersion);

examples/platformio_example/src/main.ino

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ void loop() {
4242
Serial.print("\tVerified: "); Serial.print(message.verify()); Serial.println();
4343
Serial.println();
4444

45-
// Mnemonic
46-
const auto new_passphrase = Ark::Crypto::Identities::Mnemonic::generate();
47-
Serial.print("Generated Mnemonic: "); Serial.print(new_passphrase.c_str()); Serial.println();
48-
Serial.println();
49-
5045
// Address - from passphrase
5146
const uint8_t networkVersion = 0x1E;
5247
auto address = Address::fromPassphrase(passphrase, networkVersion);

extras/ARDUINO_IDE.sh

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -115,15 +115,6 @@ if [[ -d ${INCLUDE_DIR} ]]; then
115115
mkdir ${SRC_ENCODING_DIR}
116116
mv ${INCLUDE_HELPERS_DIR}/encoding/hex.h ${SRC_ENCODING_DIR}
117117

118-
## 'bip39' library is not supported in Arduino
119-
echo -e "Backing up and removing 'mnemonic.h'.\n"
120-
mkdir ${EXTRAS_BACKUP_DIR}
121-
mkdir ${EXTRAS_IDENTITIES_DIR}
122-
mv ${INCLUDE_IDENTITIES_DIR}/mnemonic.h ${EXTRAS_IDENTITIES_DIR}
123-
mv ${SRC_IDENTITIES_DIR}/mnemonic.cpp ${EXTRAS_IDENTITIES_DIR}
124-
echo "// this is a dummy file" >> ${SRC_IDENTITIES_DIR}/mnemonic.h
125-
echo "// this is a dummy file" >> ${SRC_IDENTITIES_DIR}/mnemonic.cpp
126-
127118
echo -e "Moving 'identites' headers.\n"
128119
mv ${INCLUDE_IDENTITIES_DIR}/address.h ${SRC_IDENTITIES_DIR}
129120
mv ${INCLUDE_IDENTITIES_DIR}/privatekey.h ${SRC_IDENTITIES_DIR}
@@ -144,7 +135,6 @@ if [[ -d ${INCLUDE_DIR} ]]; then
144135

145136
echo -e "Backing up, moving, and removing relevant modules from the 'lib' directory.\n"
146137
mv ${SRC_LIB_DIR}/ArduinoJson ${EXTRAS_BACKUP_DIR}
147-
mv ${SRC_LIB_DIR}/bip39 ${EXTRAS_BACKUP_DIR}
148138
mv ${SRC_LIB_DIR}/uECC ${EXTRAS_BACKUP_DIR}
149139
mv ${SRC_LIB_DIR}/bcl ${SRC_DIR}
150140
mv ${SRC_LIB_DIR}/date ${SRC_DIR}
@@ -196,7 +186,6 @@ else
196186

197187
echo -e "Moving 'identities' headers.\n"
198188
mv ${SRC_IDENTITIES_DIR}/address.h ${INCLUDE_IDENTITIES_DIR}
199-
mv ${SRC_IDENTITIES_DIR}/mnemonic.h ${INCLUDE_IDENTITIES_DIR}
200189
mv ${SRC_IDENTITIES_DIR}/privatekey.h ${INCLUDE_IDENTITIES_DIR}
201190
mv ${SRC_IDENTITIES_DIR}/publickey.h ${INCLUDE_IDENTITIES_DIR}
202191
mv ${SRC_IDENTITIES_DIR}/wif.h ${INCLUDE_IDENTITIES_DIR}
@@ -213,18 +202,9 @@ else
213202
mv ${SRC_TRANSACTIONS_DIR}/serializer.h ${INCLUDE_TRANSACTIONS_DIR}
214203
mv ${SRC_TRANSACTIONS_DIR}/transaction.h ${INCLUDE_TRANSACTIONS_DIR}
215204

216-
## 'bip39' library is not supported in Arduino
217-
echo -e "Restoring 'mnemonic.h'.\n"
218-
rm -rf ${SRC_IDENTITIES_DIR}/mnemonic.h
219-
rm -rf ${SRC_IDENTITIES_DIR}/mnemonic.cpp
220-
mv ${EXTRAS_IDENTITIES_DIR}/mnemonic.h ${INCLUDE_IDENTITIES_DIR}
221-
mv ${EXTRAS_IDENTITIES_DIR}/mnemonic.cpp ${SRC_IDENTITIES_DIR}
222-
rm -rf ${EXTRAS_IDENTITIES_DIR}/mnemonic.cpp
223-
224205
echo -e "Restoring the 'lib' directory.\n"
225206
mkdir ${SRC_LIB_DIR}
226207
mv ${EXTRAS_BACKUP_DIR}/ArduinoJson ${SRC_LIB_DIR}
227-
mv ${EXTRAS_BACKUP_DIR}/bip39 ${SRC_LIB_DIR}
228208
mv ${EXTRAS_BACKUP_DIR}/uECC ${SRC_LIB_DIR}
229209
mv ${SRC_DIR}/bcl ${SRC_LIB_DIR}
230210
mv ${SRC_DIR}/date ${SRC_LIB_DIR}

keywords.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ Fees KEYWORD1
2222
Types KEYWORD1
2323

2424
Address KEYWORD1
25-
Mnemonic KEYWORD1
2625
PrivateKey KEYWORD1
2726
PublicKey KEYWORD1
2827
WIF KEYWORD1

library.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"type": "git",
88
"url": "https://github.com/ArkEcosystem/Cpp-Crypto.git"
99
},
10-
"version": "0.4.0",
10+
"version": "0.5.0",
1111
"authors": [
1212
{
1313
"name": "Ark Ecosystem",
@@ -21,9 +21,6 @@
2121
{
2222
"name": "micro-ecc"
2323
},
24-
{
25-
"name": "bip39"
26-
},
2724
{
2825
"name": "ArduinoJson"
2926
}

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=Ark-Cpp-Crypto
2-
version=0.4.0
2+
version=0.5.0
33
author=Ark Ecosystem
44
maintainer=Ark Ecosystem
55
sentence=A simple Cryptography Implementation in C++ for the ARK Blockchain.

0 commit comments

Comments
 (0)