diff --git a/CMakeLists.txt b/CMakeLists.txt index a5edd61..e821d8d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,7 +18,7 @@ set (PROGRAM_EXE ${CMAKE_PROJECT_NAME}) set (PROGRAM_SOURCE src/string.cpp - src/ec.cpp + src/ec/openssl.cpp src/base58.cpp src/checksum.cpp src/WIF.cpp diff --git a/src/WIF.h b/src/WIF.h index 5102e65..48eb6a8 100644 --- a/src/WIF.h +++ b/src/WIF.h @@ -25,7 +25,7 @@ #define WIF_H #include -#include "types.h" +#include "ec/types.h" std::string wif_priv_encode(ec_privkey_t priv); diff --git a/src/benchmark.cpp b/src/benchmark.cpp index 6fb6c66..228b045 100644 --- a/src/benchmark.cpp +++ b/src/benchmark.cpp @@ -22,7 +22,7 @@ * SOFTWARE. */ #include -#include "ec.h" +#include "ec/generate.h" #include "benchmark.h" using std::chrono::steady_clock; diff --git a/src/ec.h b/src/ec/generate.h similarity index 94% rename from src/ec.h rename to src/ec/generate.h index 29269e8..ccde10c 100644 --- a/src/ec.h +++ b/src/ec/generate.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef EC_H -#define EC_H +#ifndef EC_GENERATE_H +#define EC_GENERATE_H #include "types.h" @@ -32,4 +32,4 @@ */ int ec_generate_key(struct ec_keypair *pair); -#endif /* EC_H */ +#endif /* EC_GENERATE_H */ diff --git a/src/ec.cpp b/src/ec/openssl.cpp similarity index 98% rename from src/ec.cpp rename to src/ec/openssl.cpp index d277eda..40e0cf3 100644 --- a/src/ec.cpp +++ b/src/ec/openssl.cpp @@ -24,7 +24,7 @@ #include #include #include -#include "ec.h" +#include "generate.h" static int ec_generate_pair(unsigned char *priv, unsigned char *pub) { diff --git a/src/types.h b/src/ec/types.h similarity index 96% rename from src/types.h rename to src/ec/types.h index 1977f5d..19a2312 100644 --- a/src/types.h +++ b/src/ec/types.h @@ -21,8 +21,8 @@ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * SOFTWARE. */ -#ifndef TYPES_H -#define TYPES_H +#ifndef EC_TYPES_H +#define EC_TYPES_H #include @@ -35,7 +35,6 @@ */ #define EC_PUBKEY_SIZE (32 + 1) - typedef std::array ec_privkey_t; typedef std::array ec_pubkey_t; @@ -44,4 +43,4 @@ struct ec_keypair { ec_pubkey_t pub; }; -#endif /* TYPES_H */ +#endif /* EC_TYPES_H */ diff --git a/src/key_search.cpp b/src/key_search.cpp index 285962b..9e1a259 100644 --- a/src/key_search.cpp +++ b/src/key_search.cpp @@ -22,7 +22,7 @@ * SOFTWARE. */ #include -#include "ec.h" +#include "ec/generate.h" #include "key_search_helpers.h" #include "key_search.h" diff --git a/src/key_search_helpers.h b/src/key_search_helpers.h index b9679b9..1b80105 100644 --- a/src/key_search_helpers.h +++ b/src/key_search_helpers.h @@ -25,7 +25,7 @@ #define KEY_SEARCH_HELPERS_H #include "string.h" -#include "types.h" +#include "ec/types.h" struct key_result { size_t pos; // position where the word was found. diff --git a/src/key_search_mt.cpp b/src/key_search_mt.cpp index 3d7dc5e..85f3e2a 100644 --- a/src/key_search_mt.cpp +++ b/src/key_search_mt.cpp @@ -25,7 +25,7 @@ #include #include #include -#include "ec.h" +#include "ec/generate.h" #include "key_search_helpers.h" #include "key_search.h" diff --git a/src/main.cpp b/src/main.cpp index 3a25014..cdc2dfe 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -28,7 +28,7 @@ #include #include "string.h" #include "WIF.h" -#include "ec.h" +#include "ec/generate.h" #include "key_search.h" #include "benchmark.h"