Skip to content

Commit 4415dcd

Browse files
committed
Merge remote-tracking branch 'origin/arduino' into chore(arduino)/merge-changes-at-105
2 parents 2a6f9a2 + 87793f6 commit 4415dcd

7 files changed

Lines changed: 47 additions & 136 deletions

File tree

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,3 @@ workflows:
1818
build:
1919
jobs:
2020
- build-arduino-default
21-

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
/.editorconfig export-ignore
66
/.gitattributes export-ignore
77
/.gitignore export-ignore
8-
/README.md export-ignore

.gitignore

Lines changed: 2 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,4 @@
11

2-
.DS_Store
3-
/.history
4-
/.vs
2+
/.circleci
53
/.vscode
6-
.pioenvs
7-
.piolibdeps
8-
.vscode/.browse.c_cpp.db*
9-
.vscode/c_cpp_properties.json
10-
.vscode/launch.json
11-
/include/uECC
12-
/lib/
13-
/bin/
14-
/src/CMakeFiles
15-
/CMakeFiles
16-
/src/Ark-Cpp-Crypto-lib.dir
17-
/src/cmake_install.cmake
18-
/src/Ark-Cpp-Crypto-lib.vcxproj.filters
19-
/src/Ark-Cpp-Crypto-lib.vcxproj
20-
/src/Ark-Cpp-Crypto-lib.sln
21-
/src/ALL_BUILD.vcxproj.filters
22-
/src/ALL_BUILD.vcxproj
23-
/test/Ark-Cpp-Crypto-tests.dir
24-
/test/CMakeFiles
25-
/test/NightlyMemoryCheck.vcxproj.filters
26-
/test/NightlyMemoryCheck.vcxproj
27-
/test/Nightly.vcxproj.filters
28-
/test/Nightly.vcxproj
29-
/test/Experimental.vcxproj.filters
30-
/test/Experimental.vcxproj
31-
/test/DartConfiguration.tcl
32-
/test/CTestTestfile.cmake
33-
/test/Continuous.vcxproj.filters
34-
/test/Continuous.vcxproj
35-
/test/cmake_install.cmake
36-
/test/Ark-Cpp-Crypto-tests.vcxproj.filters
37-
/test/Ark-Cpp-Crypto-tests.vcxproj
38-
/test/Ark-Cpp-Crypto-tests.sln
39-
/test/ALL_BUILD.vcxproj.filters
40-
/test/ALL_BUILD.vcxproj
41-
/test/INSTALL.vcxproj.filters
42-
/test/INSTALL.vcxproj
43-
/Win32
44-
/_3rdParty/Hunter
45-
/ZERO_CHECK.vcxproj.filters
46-
/ZERO_CHECK.vcxproj
47-
/cmake_install.cmake
48-
/CMakeCache.txt
49-
/Ark-Cpp-Crypto.sln
50-
/ALL_BUILD.vcxproj.filters
51-
/ALL_BUILD.vcxproj
52-
/src/INSTALL.vcxproj.filters
53-
/src/INSTALL.vcxproj
54-
/INSTALL.vcxproj.filters
55-
/INSTALL.vcxproj
56-
/src/Debug
57-
/test/Debug
58-
/examples/cmake_example/ZERO_CHECK.vcxproj.filters
59-
/examples/cmake_example/Win32/Debug
60-
/examples/cmake_example/cmake_example.vcxproj.filters
61-
/examples/cmake_example/cmake_example.vcxproj
62-
/examples/cmake_example/cmake_example.sln
63-
/examples/cmake_example/cmake_example.dir/Debug
64-
/examples/cmake_example/Debug
65-
/examples/cmake_example/cmake_install.cmake
66-
/examples/cmake_example/CMakeFiles
67-
/examples/cmake_example/CMakeCache.txt
68-
/examples/cmake_example/ALL_BUILD.vcxproj.filters
69-
/examples/cmake_example/ALL_BUILD.vcxproj
70-
/examples/cmake_example/ZERO_CHECK.vcxproj
71-
/examples/cmake_example/Cpp-Crypto-Example.dir/Debug
72-
/examples/cmake_example/Cpp-Crypto-Example.vcxproj.filters
73-
/examples/cmake_example/Cpp-Crypto-Example.vcxproj
74-
/examples/cmake_example/Cpp-Crypto-Example.sln
4+
.DS_Store

extras/docs/cpp.md

Lines changed: 15 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,6 @@ title: "Cpp"
44

55
# Cpp
66

7-
::: warning
8-
This project is still under development. This page will get more content as the project evolves. In the meantime you can view its source on [Github](https://github.com/ArkEcosystem/cpp-crypto/).
9-
:::
10-
117
[[toc]]
128

139
## Installation
@@ -63,7 +59,6 @@ const auto MyBridgechainTransaction = Builder::buildTransfer(
6359
MyBridgechainConfiguration);
6460
```
6561

66-
6762
#### With custom Fees
6863

6964
```cpp
@@ -205,16 +200,16 @@ const uint8_t wifByte = 0xaa;
205200
WIF wif = WIF::fromPassphrase(passphrase, wifByte);
206201
```
207202

208-
#
203+
#
209204

210205
# Arduino
211-
**Arduino IDE:**
212-
Download and install the Arduino IDE (>=1.8.5) from the following link:
206+
**Arduino IDE:**
207+
Download and install the Arduino IDE (>=1.8.5) from the following link:
213208
```https://www.arduino.cc/en/Main/Software```
214209

215-
Using the Arduino IDE's built in Library Manager,
216-
install the following Libraries:
217-
```micro-ecc```
210+
Using the Arduino IDE's built in Library Manager,
211+
install the following Libraries:
212+
```micro-ecc```
218213
```AUnit```
219214

220215
#### Ensure all git submodules have been cloned
@@ -268,11 +263,11 @@ void setup()
268263
void loop() {}
269264
```
270265

271-
**PlatformIO IDE:**
266+
**PlatformIO IDE:**
272267

273-
#### Python:
274-
Use an installer package from the following link or use your preferred method to install Python:
275-
```https://www.python.org/downloads/```
268+
#### Python:
269+
Use an installer package from the following link or use your preferred method to install Python:
270+
```https://www.python.org/downloads/```
276271

277272
Install PlatformIO:
278273

@@ -295,7 +290,7 @@ Install AUnit (2778), micro-ecc (1665)
295290

296291
cd test
297292

298-
#### execute the following command to upload test to your board
293+
#### execute the following command to upload test to your board
299294

300295
>| board | command |
301296
>|:-- |:-- |
@@ -307,20 +302,20 @@ Install AUnit (2778), micro-ecc (1665)
307302
# OS
308303
## Linux, macOS and Windows
309304

310-
**CMake:**
305+
**CMake:**
311306

312-
Use an installer package from the following link, Homebrew, or use your preferred method:
307+
Use an installer package from the following link, Homebrew, or use your preferred method:
313308
```https://www.cmake.org/download/```
314309

315310
using
316-
**Homebrew:**
311+
**Homebrew:**
317312

318313
brew install cmake
319314

320315
> note: all other dependencies will be automatically installed via CMake and Hunter Package Manager.
321316
322317
### make and build
323-
cd cpp-crypto
318+
cd cpp-crypto
324319
cmake . && cmake --build .
325320

326321
### run tests (Linux, macOS)

library.json

Lines changed: 6 additions & 26 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.6.0",
10+
"version": "0.6.0-arduino",
1111
"authors": [
1212
{
1313
"name": "Ark Ecosystem",
@@ -23,29 +23,9 @@
2323
},
2424
{
2525
"name": "ArduinoJson"
26+
},
27+
{
28+
"name": "BIP66"
2629
}
27-
],
28-
"export": {
29-
"include": [
30-
"src/*",
31-
"examples/*",
32-
"docs/*",
33-
"extras/*",
34-
"*.md",
35-
"*.json",
36-
"*.properties",
37-
"LICENSE",
38-
"*.ini",
39-
"keywords.txt"
40-
],
41-
"exclude": [
42-
"*/*.txt"
43-
]
44-
},
45-
"build": {
46-
"flags": [
47-
"-I src/include/cpp-crypto",
48-
"-I src/lib"
49-
]
50-
}
51-
}
30+
]
31+
}

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.6.0
2+
version=0.6.0-arduino
33
author=Ark Ecosystem
44
maintainer=Ark Ecosystem
55
sentence=A simple Cryptography Implementation in C++ for the ARK Blockchain.

src/identities/privatekey.h

Lines changed: 23 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,34 +10,42 @@
1010
#ifndef PRIVATEKEY_H
1111
#define PRIVATEKEY_H
1212

13-
#include "helpers/crypto_helpers.h"
14-
15-
#include <cstdint>
13+
#include <cassert>
1614
#include <string>
15+
#include "bcl/Base58Check.hpp"
16+
#include "bcl/Sha256.hpp"
17+
#include "bcl/Sha256Hash.hpp"
18+
#include "helpers/encoding/hex.h"
19+
#include "helpers/crypto_helpers.h"
1720

1821
namespace Ark {
1922
namespace Crypto {
2023
namespace Identities {
21-
/**/
24+
25+
/**
26+
* This is the private key class.
27+
*
28+
* @author Simon Downey <simon@ark.io>
29+
**/
2230
class PrivateKey {
23-
private:
24-
uint8_t bytes_[PRIVATEKEY_SIZE] {};
31+
protected:
32+
uint8_t bytes_[PRIVATEKEY_SIZE];
2533

26-
public:
27-
PrivateKey() : bytes_() {};
28-
PrivateKey(const char* newPrivateKeyStr);
29-
PrivateKey(const uint8_t* newPrivateKeyBytes);
34+
public:
35+
PrivateKey() : bytes_(){};
36+
PrivateKey(const char *const newPrivateKeyStr);
37+
PrivateKey(const uint8_t *newPrivateKeyBytes);
3038

3139
const uint8_t *toBytes();
3240
std::string toString() const;
3341

34-
static PrivateKey fromPassphrase(const char* passphrase);
35-
static PrivateKey fromHex(const char* privateKey);
36-
static PrivateKey fromWIFString(const char* wifStr, uint8_t wifByte);
42+
static PrivateKey fromPassphrase(const char *const passphrase);
43+
static PrivateKey fromHex(const char *const privateKey);
44+
static PrivateKey fromWIFString(const char *wifStr, uint8_t wifByte);
3745

3846
static bool validate(PrivateKey privateKey);
39-
static bool validate(const char* privateKeyStr);
40-
static bool validate(const uint8_t* privateKeyBytes);
47+
static bool validate(const char *privateKeyStr);
48+
static bool validate(const uint8_t *privateKeyBytes);
4149
};
4250
/**/
4351
}; // namespace Identities

0 commit comments

Comments
 (0)