1
0
Fork 0
mirror of https://github.com/eosswedenorg/antelope-keygen synced 2026-06-16 03:44:56 +02:00

Compare commits

...

85 commits

Author SHA1 Message Date
6c4769a030 .github/workflows/package.yml: fix qt5 package for fedora 38 2023-08-27 14:19:35 +02:00
24136406a7 .github/workflows/package.yml: for ubuntu, use matrix includes for qt package instead of the if/else in bash. 2023-08-25 12:41:19 +02:00
7e8b1d6e66 README.md: fix link to CI tests. 2023-08-25 12:38:34 +02:00
8949a80b11 .github/workflows/package.yml: set-output command to environment variables. 2023-08-17 17:14:26 +02:00
2874862d70 .github/workflows/package.yml: Package for fedora 37 2023-08-17 16:55:05 +02:00
d03d27589e .github/workflows/package.yml: build and package for fedora 38 2023-08-16 18:57:48 +02:00
772d03a6e3 .github/workflows/package.yml: Typofix, change "DBM" to "DEB" 2023-08-16 18:57:33 +02:00
53644e9ceb .github/workflows/ci.yml: update actions/checkout to version 3. 2023-08-16 18:52:15 +02:00
1ef3424638 .github/workflows/ci.yml: Update qt version for windows/mac to 5.15.2 2023-08-16 18:52:15 +02:00
ad5d464792 .github/workflows/package.yml: Update actions/checkout to version 3 2023-08-16 18:52:15 +02:00
baaf7e5b54 common/cmake/libantelope.cmake: Use version 0.2.2 2023-08-16 16:00:10 +02:00
1c4e01a726
README.md: Fix link 2023-07-05 05:00:01 +02:00
83f09d494c common/cmake/libantelope.cmake: use version 0.2.1 2023-05-31 19:21:05 +02:00
b82ba44544 Version 1.1.0 2023-05-04 13:42:24 +02:00
54ca24bbd9 .github/workflows/package.yml: fix ls command for finding the package files. 2023-05-04 13:38:51 +02:00
8cab0cbced .github/workflows/package.yml: Use Environment files for output parameters 2023-05-04 13:37:51 +02:00
a421ceb5d8 .github/workflows/package.yml: bump cmake version for fedora 2023-05-04 13:11:40 +02:00
a73b52b987 CMakeLists.txt: Update project description 2023-05-04 12:55:21 +02:00
ec07b199ed cli/src/main.cpp: update program description 2023-05-04 12:54:47 +02:00
9a83929029 gui/README.md: Update security notice. 2023-04-10 16:40:02 +02:00
19f8b67fdd gui/README.md: change from eosio-keygen to antelope-keygen 2023-04-10 16:39:20 +02:00
133aa230fb cli/docs/antelope-keygen.1.in: remove subcommands and refer to their man pages. update security notice and some formatting fixes. 2023-04-10 16:36:20 +02:00
3a2c80e9b5 cli/docs: adding antelope-keygen-benchmark.1.in and antelope-keygen-search.1.in 2023-04-10 16:35:15 +02:00
6554e6c806 cli/docs/README.md.in: use @PROJECT_NAME@ in some missed places that used hardcoded values. 2023-04-10 16:33:43 +02:00
2f92e6b2b2 cli/docs/README.md.in: Update to reflect new cli syntax and security notice. 2023-04-10 16:31:53 +02:00
25025c21b4 README.md: Update security notice. 2023-04-10 16:10:54 +02:00
10ec4355e6 cli/docs/antelope-keygen.1.in: Update to reflect new cli syntax and change eosio to antelope. 2023-04-10 15:41:56 +02:00
2b4ab78176 rename namespace and header guards from eosio to antelope 2023-04-10 14:53:26 +02:00
2679dc6ef4 README.md: change "EOS Sweden" to "Sw/eden" 2023-04-06 15:23:37 +02:00
4b26e277f8 README.md: Update documentation for libeosio to use libantelope instead. 2023-04-06 15:22:01 +02:00
914205541a Update from libeosio v0.1.7 to libantelope v0.2.0 2023-04-06 15:11:20 +02:00
d5da7d1491 README.md: Update info about supported Linux distros/versions. 2023-04-05 21:14:57 +02:00
61ce4c751d Merge branch 'rpm-pkg' into develop 2023-04-05 19:38:21 +02:00
6589011be5 gui/src/GenerateWindow.cpp: Make the key fields abit longer. 2023-04-05 19:37:40 +02:00
3ae2c00faa gui/src/GenerateWindow.cpp: set fixed font (monospace) for the key fQLineEdit fields. 2023-04-05 19:36:36 +02:00
3d5b163e9f Merge branch 'k1' into develop 2023-04-05 19:20:45 +02:00
9ed6e6ab80 gui: implement support for K1 keys. 2023-04-05 19:20:16 +02:00
90f5aa17a8 build.sh: set default TARGET value to "all" 2023-04-05 19:17:45 +02:00
85955baf42 .github/workflows/package.yml: add RPM package. 2023-04-05 19:16:48 +02:00
8076eb6342 build.sh: support rpm for --pkg-type 2023-04-05 16:19:45 +02:00
2cc93efadf cmake/CPackConfig.cmake: Adding RPM stuff. 2023-04-05 16:19:16 +02:00
8bb1649974 .github/workflows/package.yml: set qt versions from ci.yml 2023-04-05 15:33:35 +02:00
aacfdbe4a9 cli/CMakeLists.txt: Minor whitespace fix. 2023-04-05 15:18:22 +02:00
9ad3d47d95 CMakeLists.txt: Compile position independent code. 2023-04-05 15:18:00 +02:00
71cb07e6e7 CMakeLists.txt: Set strip flag for GNU linkers on release config. 2023-04-05 15:16:12 +02:00
5fd76814c1 CMakeLists.txt: use COMPILE_LANG_AND_ID generator expression instead of just CXX_COMPILER_ID 2023-04-05 15:14:24 +02:00
cf104e1616 .github/workflows/ci.yml: fix qt package on ubuntu-22.04 2023-04-04 19:30:08 +02:00
8bc93c1bec .github/workflows: run on ubuntu-22.04 2023-04-04 19:19:20 +02:00
8d413941ed .github/workflows: remove ubuntu-18.04 as its is not supported anymore as github runner. 2023-04-04 19:19:20 +02:00
04b1d60f9b .github/workflows: Update jurplel/install-qt-action to v3 2023-04-04 19:15:54 +02:00
e18886e074 cli: implement support for K1 keys (default, can be switched with --legacy flag) 2023-04-04 19:06:00 +02:00
cbe6902d03 common/cmake/libeosio.cmake: Use libeosio v0.1.7 2023-04-04 19:06:00 +02:00
d579879d71 common/include/eoskeygen/key_search.hpp: make prefix into a variable (we need it for k1 keys). 2023-04-04 14:58:36 +02:00
b39a2a09ae LICENSE: Update year. 2023-03-29 11:33:23 +02:00
e0a7d8fb21 gui/src/MainWindow.cpp: Make sure to call libeosio::ec_init() and ec_shutdown() 2023-03-29 11:31:42 +02:00
0781b7db80 cli/src/main.cpp: Make sure to call libeosio::ec_init() and ec_shutdown() 2023-03-29 11:31:21 +02:00
13a99e15d9 fix libeosio header includes. 2023-03-29 11:30:49 +02:00
b3378eda16 common/cmake/libeosio.cmake: Update to v0.1.6 2023-03-29 11:30:24 +02:00
864a55e485 gui/src/MainWindow.hpp: fix indentation 2023-03-29 11:28:03 +02:00
d3fd36ef0e .github/workflows/package.yml: update QT versions 2022-11-11 13:20:13 +01:00
1d6fc76eca Version 1.0.8 2022-11-11 13:02:22 +01:00
23a43ff6b3 cli/cmake/CPackComponentConfig.cmake.in: Add libssl1.1 or libssl3 as dependancies to debian package. 2022-11-11 12:38:05 +01:00
40831b6941 common/cmake/libeosio.cmake: minor indent fix. 2022-11-11 12:36:06 +01:00
1ca85a37b8 cli/src/main.cpp: use new C++11 syntax to loop over vectors. 2022-09-22 12:42:15 +02:00
8e2378cfe8 common/cmake/libeosio.cmake: update to v0.1.4 2022-09-21 10:51:04 +02:00
6273b048bb CMakeLists.txt: remove -Werror flag for GNU compilers. 2022-09-21 10:21:19 +02:00
f5d733a4f1 .github/workflows/ci.yml: disable fail-fast. 2022-09-21 10:20:48 +02:00
e41def2149 .github/workflows/ci.yml: run apt-get update 2022-09-21 10:17:12 +02:00
a92cb0c1d9 .github/workflows/ci.yml: Update QT on ubuntu-18.04 2022-09-21 09:55:38 +02:00
f40c680ad1 .github/workflows/ci.yml: Update QT on ubuntu-20.04 2022-09-21 09:50:52 +02:00
6a7454875c cli/src/main.cpp: use CLI11 to parse cli args. 2022-09-20 18:54:51 +02:00
81007003d7 cli/CMakeLists.txt: Link with CLI11 and install it's license file. 2022-09-20 17:54:29 +02:00
4a3e7d8fa4 common/src/key_search.hpp: Adding getThreadCount() 2022-09-20 17:47:06 +02:00
1d923d3dd8 Adding lib/CLI11 2022-09-20 15:18:49 +02:00
0e4a574f7a cli/src/main.cpp: fix indent in usage string. 2022-09-20 15:18:49 +02:00
a73689e275
Merge pull request #35 from eosswedenorg/fio
Adding FIO support
2021-05-07 13:59:51 +02:00
7fb1774359 gui/src/MainWindow: Add menu item to switch between FIO/EOS key prefixes. 2021-05-07 13:50:27 +02:00
6bd84b1d8d gui/src/GenerateWindow.cpp: Check Settings::shouldGenerateFioKeys() if we should use "FIO" or "EOS" prefix. 2021-05-07 13:50:27 +02:00
8c9047d716 gui/src/SearchWindow.cpp: Check Settings::shouldGenerateFioKeys() to know if we should use "FIO" or "EOS" prefix. 2021-05-07 13:50:27 +02:00
f7b84c7752 GUI: Adding Settings Component. 2021-05-07 13:50:27 +02:00
486d2c5030 cli/src/main.cpp: implement "--fio" option to generate FIO keys. 2021-05-07 13:50:27 +02:00
52e255850a cli/src/cli_key_search_result: Add prefix parameter to constructor. 2021-05-07 13:50:27 +02:00
554cfd5884 common/cmake/libeosio.cmake: set v0.1.3 needed for prefix parameter to wif_print_key() 2021-05-07 13:50:27 +02:00
95849b1e32 build.sh: adding --libeosio flag 2021-05-06 18:05:39 +02:00
010edeb2f5 cli/src/main.cpp: Improve usage text format. 2021-05-06 15:32:27 +02:00
55 changed files with 10222 additions and 625 deletions

View file

@ -12,8 +12,9 @@ on:
jobs: jobs:
compile: compile:
strategy: strategy:
fail-fast: false
matrix: matrix:
os: [ ubuntu-20.04, ubuntu-18.04, macos-latest, windows-latest ] os: [ ubuntu-20.04, ubuntu-22.04, macos-latest, windows-latest ]
build: [ cli, cli-mt, cli-ansi, cli-ansi-mt, gui, gui-mt ] build: [ cli, cli-mt, cli-ansi, cli-ansi-mt, gui, gui-mt ]
include: include:
- build: cli - build: cli
@ -33,7 +34,7 @@ jobs:
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: OpenSSL OSX - name: OpenSSL OSX
if: runner.os == 'macOS' if: runner.os == 'macOS'
@ -44,17 +45,18 @@ jobs:
if: startsWith(matrix.build, 'gui') && runner.os == 'Linux' if: startsWith(matrix.build, 'gui') && runner.os == 'Linux'
shell: bash shell: bash
run: | run: |
if [ "${{matrix.os}}" == "ubuntu-20.04" ]; then sudo apt-get update
sudo apt-get install qt5-default=5.12.8+dfsg-0ubuntu1 if [ "${{matrix.os}}" == "ubuntu-22.04" ]; then
sudo apt-get install qtbase5-dev=5.15.3+dfsg-2ubuntu0.2
else : else :
sudo apt-get install qt5-default=5.9.5+dfsg-0ubuntu2.5 sudo apt-get install qt5-default=5.12.8+dfsg-0ubuntu2.1
fi fi
- name: Qt - Windows/Mac - name: Qt - Windows/Mac
if: startsWith(matrix.build, 'gui') && runner.os != 'Linux' if: startsWith(matrix.build, 'gui') && runner.os != 'Linux'
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v3
with: with:
version: '5.11.0' version: '5.15.2'
- name: Configure - name: Configure
shell: bash shell: bash

View file

@ -9,35 +9,36 @@ jobs:
ubuntu: ubuntu:
strategy: strategy:
matrix: matrix:
os: [ ubuntu-18.04, ubuntu-20.04 ] os: [ ubuntu-20.04, ubuntu-22.04 ]
component: [ cli, gui ] component: [ cli, gui ]
include: include:
- os: ubuntu-20.04
qt: qt5-default=5.12.8+dfsg-0ubuntu2.1
- os: ubuntu-22.04
qt: qtbase5-dev=5.15.3+dfsg-2ubuntu0.2
- component: cli - component: cli
build-opts: --cli --no-gui -t Release --pkg-type deb build-opts: --cli --no-gui -t Release --pkg-type deb
- component: gui - component: gui
build-opts: --no-cli --gui -t Release --pkg-type deb build-opts: --no-cli --gui -t Release --pkg-type deb
name: ${{matrix.os}} (${{matrix.component}}) name: DEB ${{matrix.os}} (${{matrix.component}})
runs-on: ${{matrix.os}} runs-on: ${{matrix.os}}
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: Qt - name: Qt
if: startsWith(matrix.component, 'gui') if: startsWith(matrix.component, 'gui')
shell: bash shell: bash
run: | run: |
if [ "${{matrix.os}}" == "ubuntu-20.04" ]; then sudo apt-get update
sudo apt-get install qt5-default=5.12.8+dfsg-0ubuntu1 sudo apt-get install ${{matrix.qt}}
else :
sudo apt-get install qt5-default=5.9.5+dfsg-0ubuntu2.5
fi
- name: Package - name: Package
id: package id: package
run: | run: |
./build.sh ${{matrix.build-opts}} ./build.sh ${{matrix.build-opts}}
FILE=$(ls build/eosio-*.deb | head -1) FILE=$(ls build/*.deb | head -1)
echo "::set-output name=filename::$FILE" echo "filename=$FILE" >> "$GITHUB_OUTPUT"
echo "::set-output name=name::$(basename $FILE)" echo "name=$(basename $FILE)" >> "$GITHUB_OUTPUT"
- name: Upload - name: Upload
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1
@ -49,6 +50,74 @@ jobs:
asset_path: ${{ steps.package.outputs.filename }} asset_path: ${{ steps.package.outputs.filename }}
asset_content_type: application/x-deb asset_content_type: application/x-deb
# RPM package for redhat based systems.
rpm:
strategy:
matrix:
container:
- name: "fedora:36"
deps:
gcc-12.2.1-4.fc36.x86_64
gcc-c++-12.2.1-4.fc36.x86_64
cmake-3.26.3-1.fc36.x86_64
openssl1.1-devel-1.1.1q-1.fc36.x86_64
qt: qt5-qtbase-devel-5.15.3-1.fc36.x86_64
- name: "fedora:37"
deps:
gcc-12.3.1-1.fc37.x86_64
gcc-c++-12.3.1-1.fc37.x86_64
cmake-3.27.1-1.fc37.x86_64
openssl-devel-3.0.9-1.fc37.x86_64
qt: qt5-qtbase-devel-5.15.9-3.fc37.x86_64
- name: "fedora:38"
deps:
gcc-13.2.1-1.fc38.x86_64
gcc-c++-13.2.1-1.fc38.x86_64
cmake-3.26.2-1.fc38.x86_64
openssl-devel-1:3.0.9-2.fc38.x86_64
qt: qt5-qtbase-devel-5.15.10-5.fc38.x86_64
component: [ cli, gui ]
include:
- component: cli
build-opts: --cli --no-gui -t Release --pkg-type rpm
- component: gui
build-opts: --no-cli --gui -t Release --pkg-type rpm
name: RPM ${{matrix.container.name}} (${{matrix.component}})
runs-on: ubuntu-latest
container: ${{ matrix.container.name }}
steps:
- uses: actions/checkout@v3
- name: Dependancies
run: |
sudo dnf install -y util-linux rpmdevtools git ${{ matrix.container.deps }}
- name: Qt
if: startsWith(matrix.component, 'gui')
shell: bash
run: |
sudo dnf install -y ${{ matrix.container.qt }}
- name: Package
id: package
run: |
./build.sh ${{matrix.build-opts}}
FILE=$(ls build/*.rpm | head -1)
echo "filename=$FILE" >> "$GITHUB_OUTPUT"
echo "name=$(basename $FILE)" >> "$GITHUB_OUTPUT"
- name: Upload
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_name: ${{ steps.package.outputs.name }}
asset_path: ${{ steps.package.outputs.filename }}
asset_content_type: application/octet-stream
# Windows installer # Windows installer
windows: windows:
strategy: strategy:
@ -62,10 +131,10 @@ jobs:
name: Windows (${{matrix.arch}}) name: Windows (${{matrix.arch}})
runs-on: windows-latest runs-on: windows-latest
steps: steps:
- uses: actions/checkout@v1 - uses: actions/checkout@v3
- name: Qt - name: Qt
uses: jurplel/install-qt-action@v2 uses: jurplel/install-qt-action@v3
with: with:
arch: ${{ matrix.qt-arch }} arch: ${{ matrix.qt-arch }}
version: '5.11.0' version: '5.11.0'
@ -78,8 +147,8 @@ jobs:
run: | run: |
cmake --build build --config Release --target package cmake --build build --config Release --target package
$FILE=(ls build/*.exe) $FILE=(ls build/*.exe)
echo "::set-output name=filename::$FILE" echo "filename=$FILE" >> "$GITHUB_OUTPUT"
echo "::set-output name=name::$(([io.fileinfo]"$FILE").basename).exe" echo "name=$(([io.fileinfo]"$FILE").basename)" >> "$GITHUB_OUTPUT"
- name: Upload - name: Upload
uses: actions/upload-release-asset@v1 uses: actions/upload-release-asset@v1

View file

@ -4,10 +4,10 @@ cmake_minimum_required(VERSION 3.15)
# Project Info # Project Info
# -------------------------------- # --------------------------------
project(eosio-keygen project(antelope-keygen
VERSION 1.0.7 VERSION 1.1.0
DESCRIPTION "Keygenerator for EOSIO" DESCRIPTION "Keygenerator for Antelope based blockchain"
HOMEPAGE_URL "https://github.com/eosswedenorg/eosio-keygen" ) HOMEPAGE_URL "https://github.com/eosswedenorg/antelope-keygen" )
set( PROJECT_MAINTAINER "Henrik Hautakoski <henrik@eossweden.org>") set( PROJECT_MAINTAINER "Henrik Hautakoski <henrik@eossweden.org>")
set( PROJECT_LICENSE_FILE ${CMAKE_CURRENT_LIST_DIR}/LICENSE ) set( PROJECT_LICENSE_FILE ${CMAKE_CURRENT_LIST_DIR}/LICENSE )
@ -71,27 +71,38 @@ set( CMAKE_CXX_EXTENSIONS OFF )
# c++ flags # c++ flags
add_compile_options( add_compile_options(
"$<$<CXX_COMPILER_ID:GNU>:-Werror;-Wall;-Wconversion;-Wno-sign-conversion;-Wextra>" "$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Wall;-Wconversion;-Wno-sign-conversion;-Wextra>"
"$<$<CXX_COMPILER_ID:MSVC>:/W3;-D_CRT_SECURE_NO_WARNINGS=1>" "$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/W3;-D_CRT_SECURE_NO_WARNINGS=1>"
# Debug # Debug
"$<$<CONFIG:Debug>:$<$<CXX_COMPILER_ID:GNU>:-O0;-g>>" "$<$<CONFIG:Debug>:$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-O0;-g>>"
"$<$<CONFIG:Debug>:$<$<CXX_COMPILER_ID:MSVC>:/Od;/Zi>>" "$<$<CONFIG:Debug>:$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/Od;/Zi>>"
# Release # Release
"$<$<CONFIG:Release>:$<$<CXX_COMPILER_ID:GNU>:-O3>>" "$<$<CONFIG:Release>:$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-O3>>"
"$<$<CONFIG:Release>:$<$<CXX_COMPILER_ID:MSVC>:/O2>>" "$<$<CONFIG:Release>:$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/O2>>"
# MinSizeRel # MinSizeRel
"$<$<CONFIG:MinSizeRel>:$<$<CXX_COMPILER_ID:GNU>:-Os>>" "$<$<CONFIG:MinSizeRel>:$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-Os>>"
"$<$<CONFIG:MinSizeRel>:$<$<CXX_COMPILER_ID:MSVC>:/O1>>" "$<$<CONFIG:MinSizeRel>:$<$<COMPILE_LANG_AND_ID:CXX,MSVC>:/O1>>"
) )
add_link_options(
# Release
"$<$<CONFIG:Release>:$<$<COMPILE_LANG_AND_ID:CXX,GNU>:-s>>"
)
include(CheckPIESupported)
check_pie_supported()
#cmake_policy(SET CMP0083 NEW)
set( CMAKE_POSITION_INDEPENDENT_CODE TRUE )
# Project config file # Project config file
configure_file(config.hpp.in "${PROJECT_BINARY_DIR}/config.hpp" @ONLY) configure_file(config.hpp.in "${PROJECT_BINARY_DIR}/config.hpp" @ONLY)
include_directories(${PROJECT_BINARY_DIR}) include_directories(${PROJECT_BINARY_DIR})
# Bundle eosio-extras on windows. # Bundle antelope-extras on windows.
if (WIN32) if (WIN32)
include(extras) include(extras)
list(APPEND components extras ) list(APPEND components extras )

View file

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2019-2021 EOS Sw/eden Copyright (c) 2019-2023 EOS Sw/eden
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View file

@ -1,24 +1,24 @@
![](https://github.com/eosswedenorg/eosio-keygen/workflows/CI/badge.svg) [![CI Test](https://github.com/eosswedenorg/antelope-keygen/workflows/CI/badge.svg)](https://github.com/eosswedenorg/antelope-keygen/actions)
[![GitHub release](https://img.shields.io/github/v/release/eosswedenorg/eosio-keygen?include_prereleases)](https://github.com/eosswedenorg/eosio-keygen/releases/latest) [![GitHub release](https://img.shields.io/github/v/release/eosswedenorg/antelope-keygen?include_prereleases)](https://github.com/eosswedenorg/antelope-keygen/releases/latest)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
# EOSIO Keygen # Antelope Keygen
This program generates public and private keypair for [EOS](https://eos.io/) This program generates public and private keypair for [Antelope IO](https://antelope.io)
## Compile ## Compile
You will need `libeosio` and `cmake 3.15` or later to compile this project. You will need `libantelope` and `cmake 3.15` or later to compile this project.
`Qt 5.9.0` or later is required for the graphical program. `Qt 5.9.0` or later is required for the graphical program.
### Linux/MacOS ### Linux/MacOS
**NOTE:** Only Ubuntu 18.04 is officially supported. **NOTE:** Only Ubuntu 20.04 and 22.04 and Fedoora 36 is officially supported.
The project should compile fine on most versions/distros but it is only tested The project should compile fine on most versions/distros but it is only tested
and distributed for Ubuntu 18.04 by [Sw/eden](www.eossweden.org). and distributed for those distros/versions by [Sw/eden](http://www.eossweden.org).
#### Dependencies #### Dependencies
@ -78,7 +78,7 @@ $ brew install cmake
If you need a newer version of cmake, you can download the official `.dmg` file: [cmake-3.15.7-Darwin-x86_64.dmg](https://github.com/Kitware/CMake/releases/download/v3.15.7/cmake-3.15.7-Darwin-x86_64.dmg). or see https://cmake.org/download for other versions. If you need a newer version of cmake, you can download the official `.dmg` file: [cmake-3.15.7-Darwin-x86_64.dmg](https://github.com/Kitware/CMake/releases/download/v3.15.7/cmake-3.15.7-Darwin-x86_64.dmg). or see https://cmake.org/download for other versions.
`libeosio` needs to be compiled and installed from source. [Go here](https://github.com/eosswedenorg/libeosio) `libantelope` needs to be compiled and installed from source. [Go here](https://github.com/eosswedenorg/libantelope)
**Qt (only for gui program)** **Qt (only for gui program)**
@ -150,31 +150,30 @@ These compile options are available:
For more details about options run `./build.sh -l` or `mkdir build && cmake build -LA` For more details about options run `./build.sh -l` or `mkdir build && cmake build -LA`
### libeosio ### libantelope
To speed up the build process, you can install `libeosio` To speed up the build process, you can install `libantelope`
#### Ubuntu #### Ubuntu
You can use [EOS Sweden's APT Repository](https://eosswedenorg.github.io/apt) like this: You can use [Sw/eden's APT Repository](https://eosswedenorg.github.io/apt) like this:
```sh ```sh
$ sudo apt-get install software-properties-common $ sudo apt-get install software-properties-common
$ curl https://apt.eossweden.org/key 2> /dev/null | sudo apt-key add - $ curl https://apt.eossweden.org/key 2> /dev/null | sudo apt-key add -
$ sudo apt-add-repository -y 'deb [arch=amd64] https://apt.eossweden.org/main `lsb_release -cs` stable' $ sudo apt-add-repository -y 'deb [arch=amd64] https://apt.eossweden.org/main `lsb_release -cs` stable'
$ sudo apt-get install libeosio-dev $ sudo apt-get install libantelope-dev
``` ```
or manually via `.deb` file from [github](https://github.com/eosswedenorg/libantelope/releases)
or manually via `.deb` file from [github](https://github.com/eosswedenorg/libeosio/releases)
```sh ```sh
$ wget <url> $ wget <url>
$ sudo apt install ./libeosio-dev-<version>.deb $ sudo apt install ./libantelope-dev-<version>.deb
``` ```
#### Other #### Other
Consult [libeosio's github](https://github.com/eosswedenorg/libeosio) Consult [libantelope's github](https://github.com/eosswedenorg/libantelope)
## Install ## Install
@ -196,13 +195,12 @@ Run `sudo ./uninstall.sh` or remove the files listed in `build/install_manifest.
## Security notice ## Security notice
Keys are generated by `OpenSSL`'s `EC_KEY_generate_key` function. The program will Keys are generated using [libantelope](https://github.com/eosswedenorg/libantelope)
never expose your keys to anything but the computers memory and output of the while the library does not claim to guarantee cryptographically secure keys. it
program. You are free to inspect the source code and compile yourself to verify. relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
However, use this at your own risk. we cannot guarantee that the keys are Use at your own risk. The author and [Sw/eden](https://eossweden.org/) does not take responsability
cryptographically secure as this depends on OpenSSL's implementation (alto it is for any damage caused by keys generated by the program.
widely used and should be safe)
Please read the `LICENSE` file. Please read the `LICENSE` file.

View file

@ -1,16 +1,17 @@
#!/bin/bash #!/bin/bash
function usage() { function usage() {
echo "Usage: ${0##*/} [ -h|--help ] [ --cli|--no-cli ] [ --gui|--no-gui] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [--pkg-type nsis|deb|zip|tgz] [ --disable-threads ] [ --force-ansi ]" echo "Usage: ${0##*/} [ -h|--help ] [ --cli|--no-cli ] [ --gui|--no-gui] [ -t|--type Debug|Release|RelWithDebInfo|MinSizeRel ] [ --libeosio=<path> ] [ --pkg-type nsis|deb|zip|tgz ] [ --disable-threads ] [ --force-ansi ]"
exit 1 exit 1
} }
options=$(getopt -n "${0##*/}" -o "lht:" -l "help,cli,no-cli,gui,no-gui,type:,pkg-type:,disable-threads,force-ansi" -- "$@") options=$(getopt -n "${0##*/}" -o "lht:" -l "help,cli,no-cli,gui,no-gui,type:,libeosio:,pkg-type:,disable-threads,force-ansi" -- "$@")
[ $? -eq 0 ] || usage [ $? -eq 0 ] || usage
eval set -- "$options" eval set -- "$options"
TARGET="all"
ONLY_CONFIG=0 ONLY_CONFIG=0
ARGS="" ARGS=""
BUILD_ARGS="--clean-first" BUILD_ARGS="--clean-first"
@ -28,13 +29,17 @@ while true; do
;; ;;
--pkg-type) --pkg-type)
shift shift
[[ ! "$1" =~ ^(nsis|deb|zip|tgz)$ ]] && { [[ ! "$1" =~ ^(nsis|deb|rpm|zip|tgz)$ ]] && {
echo "Incorrect package type '$1' provided" echo "Incorrect package type '$1' provided"
usage usage
} }
TARGET="package" TARGET="package"
ARGS="${ARGS} -DCPACK_GENERATOR=${1^^}" ARGS="${ARGS} -DCPACK_GENERATOR=${1^^}"
;; ;;
--libeosio)
shift
ARGS="${ARGS} -DLIBEOSIO_SOURCE_DIR=${1}"
;;
--cli) --cli)
ARGS="${ARGS} -DCOMPONENT_CLI=ON" ;; ARGS="${ARGS} -DCOMPONENT_CLI=ON" ;;
--no-cli) --no-cli)

View file

@ -4,7 +4,7 @@ cmake_minimum_required(VERSION 3.15)
# Project Info # Project Info
# -------------------------------- # --------------------------------
project(eosio-keygen project(antelope-keygen
VERSION ${CMAKE_PROJECT_VERSION} VERSION ${CMAKE_PROJECT_VERSION}
LANGUAGES CXX) LANGUAGES CXX)
@ -34,6 +34,10 @@ endif()
add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} ) add_executable( ${PROGRAM_EXE} ${PROGRAM_SOURCE} )
# Include CLI11
include ( ${CMAKE_SOURCE_DIR}/lib/CLI11/CMakeLists.txt )
target_include_directories( ${PROGRAM_EXE} PRIVATE ${LIBCLI11_INCLUDE} )
target_link_libraries( ${PROGRAM_EXE} PUBLIC common ) target_link_libraries( ${PROGRAM_EXE} PUBLIC common )
# -------------------------------- # --------------------------------
@ -49,6 +53,12 @@ install(FILES ${PROJECT_LICENSE_FILE}
COMPONENT cli COMPONENT cli
RENAME LICENSE.cli) RENAME LICENSE.cli)
install (FILES ${LIBCLI11_LICENSE}
DESTINATION ${CMAKE_INSTALL_SHAREDIR}
COMPONENT cli
RENAME LICENSE.libcli11)
# Documentation # Documentation
configure_file( docs/README.md.in ${PROJECT_BINARY_DIR}/README.cli.md @ONLY ) configure_file( docs/README.md.in ${PROJECT_BINARY_DIR}/README.cli.md @ONLY )
@ -57,7 +67,9 @@ install(FILES ${PROJECT_BINARY_DIR}/README.cli.md
COMPONENT cli) COMPONENT cli)
if (UNIX) if (UNIX)
configure_file( docs/eosio-keygen.1.in ${PROJECT_BINARY_DIR}/man1/eosio-keygen.1 ) configure_file( docs/antelope-keygen.1.in ${PROJECT_BINARY_DIR}/man1/antelope-keygen.1 )
configure_file( docs/antelope-keygen-search.1.in ${PROJECT_BINARY_DIR}/man1/antelope-keygen-search.1 )
configure_file( docs/antelope-keygen-benchmark.1.in ${PROJECT_BINARY_DIR}/man1/antelope-keygen-benchmark.1 )
install(DIRECTORY ${PROJECT_BINARY_DIR}/man1 install(DIRECTORY ${PROJECT_BINARY_DIR}/man1
DESTINATION ${CMAKE_INSTALL_MANDIR} DESTINATION ${CMAKE_INSTALL_MANDIR}

View file

@ -13,4 +13,4 @@ set( CPACK_DEBIAN_CLI_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-${CPACK_DEBI
set( CPACK_DEBIAN_CLI_PACKAGE_NAME "${PROJECT_NAME}" ) set( CPACK_DEBIAN_CLI_PACKAGE_NAME "${PROJECT_NAME}" )
set( CPACK_DEBIAN_CLI_PACKAGE_PRIORITY "optional" ) set( CPACK_DEBIAN_CLI_PACKAGE_PRIORITY "optional" )
set( CPACK_DEBIAN_CLI_PACKAGE_SECTION "misc" ) set( CPACK_DEBIAN_CLI_PACKAGE_SECTION "misc" )
set( CPACK_DEBIAN_CLI_PACKAGE_DEPENDS "libssl1.1 (>= 1.1.0), libstdc++6 (>= 6)") set( CPACK_DEBIAN_CLI_PACKAGE_DEPENDS "libssl1.1 (>= 1.1.0) | libssl3 (>= 3.0.0), libstdc++6 (>= 6)")

View file

@ -1,9 +1,9 @@
# eosio-keygen (cli) # @PROJECT_NAME@ (cli)
Generate public and private keypair for [EOSIO](https://eos.io/) Generate public and private keypair for [Antelope IO](https://antelope.io)
Source code is available at [github.com](https://github.com/eosswedenorg/eosio-keygen) Source code is available at [github.com](https://github.com/eosswedenorg/antelope-keygen)
## Synopsis ## Synopsis
@ -12,14 +12,14 @@ Source code is available at [github.com](https://github.com/eosswedenorg/eosio-k
@PROJECT_NAME@ [-v] @PROJECT_NAME@ [-v]
@PROJECT_NAME@ search [-m] [--l33t] [--threads=<num>] [--dict=<file1> ...] [--lang=<value> ...] word_list [count] @PROJECT_NAME@ search [-m] [--l33t] [--threads <num>] [--dict <file1> ...] [--lang <value> ...] word_list [count]
@PROJECT_NAME@ benchmark [num_keys] @PROJECT_NAME@ benchmark [num_keys]
``` ```
## Description ## Description
Output one EOSIO key pair if no arguments are given. Output one Antelope key pair if no arguments are given.
Options and subcommands are as follows: Options and subcommands are as follows:
### General flags ### General flags
@ -32,7 +32,7 @@ Options and subcommands are as follows:
### search command ### search command
`eosio-keygen search [-m] [--l33t] [--threads=<num>] [--dict=<file1> ...] [--lang=<value> ...] word_list [count]` `@PROJECT_NAME@ search [-m] [--l33t] [--threads <num>] [--dict <file1> ...] [--lang <value> ...] word_list [count]`
performs a search, finding `count` public keys containing one or more words from `word_list` (separated with ','). performs a search, finding `count` public keys containing one or more words from `word_list` (separated with ',').
@ -48,17 +48,17 @@ Monochrome, disables all color output.
Takes each word in `word_list` and find all l33tspeak combinations of that word and uses the new list for the search. Takes each word in `word_list` and find all l33tspeak combinations of that word and uses the new list for the search.
#### --threads=num #### --threads num
Use `num` of parallel threads for searching. Default is what the operating system recommends. Use `num` of parallel threads for searching. Default is what the operating system recommends.
#### --dict=file #### --dict file
Use words found in `file` (separated by newline) to highlight words in the keys Use words found in `file` (separated by newline) to highlight words in the keys
found (note that the words in this file are not used for search. only for highlight output). found (note that the words in this file are not used for search. only for highlight output).
There can be more then one `--dict` flag. In that case contents of all files are merged into one dictionary. There can be more then one `--dict` flag. In that case contents of all files are merged into one dictionary.
#### --lang=value #### --lang value
Same as `--dict` but will use `value` to find a file in `@CMAKE_INSTALL_FULL_DATADIR@/@CMAKE_PROJECT_NAME@/dict`. Same as `--dict` but will use `value` to find a file in `@CMAKE_INSTALL_FULL_DATADIR@/@CMAKE_PROJECT_NAME@/dict`.
There can be more then one `--lang` flag. In that case contents of all files are merged into one dictionary. There can be more then one `--lang` flag. In that case contents of all files are merged into one dictionary.
@ -70,7 +70,7 @@ Number of keys to search for (default is 10)
### benchmark command ### benchmark command
`eosio-keygen benchmark [num_keys]` `@PROJECT_NAME@ benchmark [num_keys]`
performs a benchmark test, generating `num_keys` keys and measuring the time. performs a benchmark test, generating `num_keys` keys and measuring the time.
@ -83,13 +83,12 @@ Number of keys to search for (default is 10)
## Security notice ## Security notice
Keys are generated by `OpenSSL`'s `EC_KEY_generate_key` function. The program will Keys are generated using [libantelope](https://github.com/eosswedenorg/libantelope)
never expose your keys to anything but the computers memory and output of the while the library does not claim to guarantee cryptographically secure keys. it
program. You are free to inspect the source code and compile yourself to verify. relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
However, use this at your own risk. we cannot guarantee that the keys are Use at your own risk. The author and [Sw/eden](https://eossweden.org/) does not take responsability
cryptographically secure as this depends on OpenSSL's implementation (alto it is for any damage caused by keys generated by the program.
widely used and should be safe)
Please read the `LICENSE.cli` file. Please read the `LICENSE.cli` file.

View file

@ -0,0 +1,67 @@
.TH @PROJECT_NAME@-benchmark 1 "April, 2023" "@PROJECT_NAME@-benchmark @PROJECT_VERSION@"
.SH NAME
@PROJECT_NAME@ benchmark - Benchmark the performance of the @PROJECT_NAME@ key generator.
.SH SYNOPSIS
.SY @PROJECT_NAME@
benchmark
.OP \-h|--help
.YS
.SY @PROJECT_NAME@
benchmark
.OP num_keys
.YS
.SH DESCRIPTION
performs a benchmark test, generating \fInum_keys\fR (default 1000) keys and measuring the time.
.SH SECURITY NOTICE
.PP
Keys are generated using
.UR https://github.com/eosswedenorg/libantelope
libantelope
.UE .
while the library does not claim to guarantee cryptographically secure keys. it
relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
.PP
Use at your own risk. The author and
.UR https://eossweden.org
Sw/eden
.UE
does not take responsability for any damage caused by keys generated by the program.
.P
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
.br
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
.br
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
.br
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
.br
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
.br
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.SH BUGS
Report bugs to
.UR https://github.com/eosswedenorg/eosio-keygen/issues
Github
.UE . Thank you.
.SH AUTHOR
.MT henrik@eossweden.org
Henrik Hautakoski
.ME
.UR https://eossweden.org
EOS Sw/eden
.UE

View file

@ -0,0 +1,112 @@
.TH @PROJECT_NAME@-search 1 "April, 2023" "@PROJECT_NAME@-search @PROJECT_VERSION@"
.SH NAME
@PROJECT_NAME@ search - Search after
.UR https://antelope.io
Antelope IO
.UE
vanity keys.
.SH SYNOPSIS
.SY @PROJECT_NAME@
search
.OP \-h|--help
.YS
.SY @PROJECT_NAME@
search
.OP -m
.OP \--l33t
.OP \--threads <num>
.OP \--dict <file1> ...
.OP \--lang <value> ...
.B word_list
.OP count
.YS
.SH DESCRIPTION
.PP
performs a search, finding \fIcount\fR public keys containing one or more words from
\fIword_list\fR (separated with ',').
.PP
Instead of a list it is possible to specify a file with words (separated with newline \fB'\\n'\fR) using
\fIfile:<filename\fR
.TP
\fB\-h\fR, \fB\-\-help\fR
Show help text.
.TP
\fB\-m\fR
Monochrome, disables all color output.
.TP
.B --l33t
Takes each word in <\fIword_list\fR> and find all l33tspeak combinations of that word and uses the new list for the search.
.TP
\fB\-\-threads\fR \fInum\fR
Use <\fInum\fR> of parallel threads for searching. Default is what the operating system recommends.
.TP
\fB\-\-dict\fR \fIfile\fR
Use words found in \fIfile\fR (separated by newline) to highlight words in the keys found.
.br
There can be more then one \fB\-\-dict\fR flag.
In that case contents of all files are merged into one dictionary.
.br
\fBnote:\fR the words in this file are not used for search. only for highlight output.
.TP
\fB\-\-lang\fR \fIvalue\fR
Same as \fB\-\-dict\fR but will use \fIvalue\fR to find a file in
\fB@CMAKE_INSTALL_FULL_DATADIR@/@CMAKE_PROJECT_NAME@/dict\fR.
.br
There can be more then one \fB\-\-lang\fR flag. In that case contents of all files are merged into one dictionary.
.TP
\fBcount\fR
Number of keys to search for (default is 10)
.SH SECURITY NOTICE
.PP
Keys are generated using
.UR https://github.com/eosswedenorg/libantelope
libantelope
.UE .
while the library does not claim to guarantee cryptographically secure keys. it
relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
.PP
Use at your own risk. The author and
.UR https://eossweden.org
Sw/eden
.UE
does not take responsability for any damage caused by keys generated by the program.
.P
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
.br
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
.br
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
.br
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
.br
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
.br
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.SH BUGS
Report bugs to
.UR https://github.com/eosswedenorg/eosio-keygen/issues
Github
.UE . Thank you.
.SH AUTHOR
.MT henrik@eossweden.org
Henrik Hautakoski
.ME
.UR https://eossweden.org
EOS Sw/eden
.UE

View file

@ -0,0 +1,106 @@
.TH @PROJECT_NAME@ 1 "April, 2023" "@PROJECT_NAME@ @PROJECT_VERSION@"
.SH NAME
@PROJECT_NAME@ - Generate public and private keypair for
.UR https://antelope.io
Antelope IO
.UE .
.SH SYNOPSIS
.SY @PROJECT_NAME@
.OP \-h|--help
.YS
.SY @PROJECT_NAME@
.OP \-v
.YS
.SY @PROJECT_NAME@
.OP \--format <value>
.YS
.SH SUBCOMMANDS
.PP
\fB@PROJECT_NAME@ search\fR
.RS 4
Search after
.UR https://antelope.io
Antelope IO
.UE
vanity keys.
.br
see \fB@PROJECT_NAME@-search\fR(1)
.RE
.PP
\fB@PROJECT_NAME@ benchmark\fR
.RS 4
Benchmark the performance of the @PROJECT_NAME@ key generator.
.br
see \fB@PROJECT_NAME@-benchmark\fR(1)
.RE
.SH DESCRIPTION
.PP
Output one Antelope key pair if no arguments are given
.PP
Options and subcommands are as follows:
.TP
\fB\-h\fR, \fB\-\-help\fR
Shows this help text.
.TP
\fB\-v\fR
Shows version.
.TP
\fB\-\-format\fR \fR\fI\,value\/\fR
What keyformat to use, valid values are: \fIK1\fR, \fIlegacy\fR, \fIfio\fR
.SH SECURITY NOTICE
.PP
Keys are generated using
.UR https://github.com/eosswedenorg/libantelope
libantelope
.UE .
while the library does not claim to guarantee cryptographically secure keys. it
relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
.PP
Use at your own risk. The author and
.UR https://eossweden.org
Sw/eden
.UE
does not take responsability for any damage caused by keys generated by the program.
.P
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
.br
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
.br
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
.br
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
.br
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
.br
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.SH BUGS
Report bugs to
.UR https://github.com/eosswedenorg/eosio-keygen/issues
Github
.UE . Thank you.
.SH AUTHOR
.MT henrik@eossweden.org
Henrik Hautakoski
.ME
.UR https://eossweden.org
EOS Sw/eden
.UE

View file

@ -1,153 +0,0 @@
.TH @PROJECT_NAME@ 1 "January, 2020" "@PROJECT_NAME@ @PROJECT_VERSION@"
.SH NAME
@PROJECT_NAME@ - Generate public and private keypair for
.UR https://eos.io/
EOS
.UE .
.SH SYNOPSIS
.SY @PROJECT_NAME@
.OP \-h|--help
.YS
.SY @PROJECT_NAME@
.OP \-v
.YS
.SY @PROJECT_NAME@
search
.OP -m
.OP \--l33t
.OP \--threads=<num>
.OP \--dict=<file1> ...
.OP \--lang=<value> ...
.B word_list
.OP count
.YS
.SY @PROJECT_NAME@
benchmark
.OP num_keys
.YS
.SH DESCRIPTION
.P
Output one EOSIO key pair if no arguments are given
.P
Options and subcommands are as follows:
.TP 15
.B -h, --help
Shows this help text.
.TP 15
.B -v
Shows version.
.TP 15
.B search
performs a search, finding
.I <count>
public keys containing one or more words from
.I <word_list>
(separated with ',').
Instead of a list it is possible to specify a file with words (separated with newline '\\n') using
.I file:<filename>
.RS 16
Search specific options:
.RS 2
.TP 20
.B -m
Monochrome, disables all color output.
.TP 20
.B --l33t
Takes each word in
.I <word_list>
and find all l33tspeak combinations of that word and uses the new list for the search.
.TP 20
.B --threads=<num>
Use
.I <num>
of parallel threads for searching. Default is what the operating system recommends.
.TP 20
.B --dict=<file>
Use words found in
.I <file>
(separated by newline) to highlight words in the keys found (note that the words in this
file are not used for search. only for highlight output). There can be more then one
.B --dict
flag. In that case contents of all files are merged into one dictionary.
.TP 20
.B --lang=<value>
Same as
.B --dict
but will use
.I <value>
to find a file in
.B @CMAKE_INSTALL_FULL_DATADIR@/@CMAKE_PROJECT_NAME@/dict.
There can be more then one
.B --lang
flag. In that case contents of all files are merged into one dictionary.
.TP 20
.B count
Number of keys to search for (default is 10)
.RE 1
.TP 15
.B benchmark
performs a benchmark test, generating
.I <num_keys>
keys and measuring the time.
.PP
.RS 16
Benchmark specific options:
.RS 2
.TP 15
.B num_keys
Number of keys to search for (default is 10)
.RE 1
.SH SECURITY NOTICE
Keys are generated by OpenSSL\'s
.B EC_KEY_generate_key
function. The program will
never expose your keys to anything but the computers memory and output of the\
program. You are free to inspect the source code and compile yourself to verify.
.P
However, use this at your own risk. we cannot guarantee that the keys are\
cryptographically secure as this depends on OpenSSL's implementation (alto it is\
widely used and should be safe)
.P
Please read the
.I LICENSE
file.
.P
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
.br
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
.br
PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
.br
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
.br
CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
.br
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.SH BUGS
Report bugs to
.UR https://github.com/eosswedenorg/eosio-keygen/issues
Github
.UE . Thank you.
.SH AUTHOR
.MT henrik@eossweden.org
Henrik Hautakoski
.ME
.UR https://eossweden.org
EOS Sw/eden
.UE

View file

@ -22,16 +22,16 @@
* SOFTWARE. * SOFTWARE.
*/ */
#include <chrono> #include <chrono>
#include <libeosio/ec.hpp> #include <libantelope/ec.hpp>
#include "benchmark.hpp" #include "benchmark.hpp"
namespace eoskeygen { namespace antelopekeygen {
std::chrono::duration<float> _run_benchmark(size_t num_keys) { std::chrono::duration<float> _run_benchmark(size_t num_keys) {
auto start = std::chrono::steady_clock::now(); auto start = std::chrono::steady_clock::now();
for(size_t i = 0; i < num_keys; i++) { for(size_t i = 0; i < num_keys; i++) {
struct libeosio::ec_keypair k; struct libantelope::ec_keypair k;
libeosio::ec_generate_key(&k); libantelope::ec_generate_key(&k);
} }
return std::chrono::steady_clock::now() - start; return std::chrono::steady_clock::now() - start;
} }
@ -47,4 +47,4 @@ void benchmark(size_t num_keys, struct benchmark_result* res) {
res->kps = static_cast<float>(num_keys) / res->sec; res->kps = static_cast<float>(num_keys) / res->sec;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -26,7 +26,7 @@
#include <ctime> #include <ctime>
namespace eoskeygen { namespace antelopekeygen {
struct benchmark_result { struct benchmark_result {
float sec; // elapsed seconds. float sec; // elapsed seconds.
@ -35,6 +35,6 @@ struct benchmark_result {
void benchmark(size_t num_keys, struct benchmark_result* res); void benchmark(size_t num_keys, struct benchmark_result* res);
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_BENCHMARK_H */ #endif /* EOSIOKEYGEN_BENCHMARK_H */

View file

@ -21,13 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#include <string>
#include <iostream> #include <iostream>
#include <libeosio/WIF.hpp> #include <libantelope/WIF.hpp>
#include <eoskeygen/core/dictionary.hpp> #include <eoskeygen/core/dictionary.hpp>
#include "console.hpp" #include "console.hpp"
#include "cli_key_search_result.hpp" #include "cli_key_search_result.hpp"
namespace eoskeygen { namespace antelopekeygen {
static size_t highlight(console::Color color, const std::string& str, size_t pos, size_t len) { static size_t highlight(console::Color color, const std::string& str, size_t pos, size_t len) {
@ -37,21 +38,23 @@ static size_t highlight(console::Color color, const std::string& str, size_t pos
return len; return len;
} }
CliKeySearchResult::CliKeySearchResult(const Dictionary& dict) : CliKeySearchResult::CliKeySearchResult(const Dictionary& dict, const libantelope::wif_codec_t& codec) :
m_dict (dict) m_dict (dict),
m_codec (codec)
{ {
} }
void CliKeySearchResult::onResult(const struct libeosio::ec_keypair* key, const struct KeySearch::result& result) { void CliKeySearchResult::onResult(const struct libantelope::ec_keypair* key, const struct KeySearch::result& result) {
std::string pub = libeosio::wif_pub_encode(key->pub); std::string pub = libantelope::wif_pub_encode(key->pub, m_codec.pub);
Dictionary::search_result_t dict_res = m_dict.search(pub); Dictionary::search_result_t dict_res = m_dict.search(pub);
int pub_prefix_len = (int) m_codec.pub.length();
std::cout << "----" << std::endl; std::cout << "----" << std::endl;
std::cout << "Found: " << pub.substr(result.pos, result.len) << std::endl; std::cout << "Found: " << pub.substr(result.pos, result.len) << std::endl;
std::cout << "Public: EOS"; std::cout << "Public: " << m_codec.pub;
for(size_t i = 3; i < pub.length(); ) { for(size_t i = pub_prefix_len; i < pub.length(); ) {
if (i == result.pos) { if (i == result.pos) {
i += highlight(console::red, pub, result.pos, result.len); i += highlight(console::red, pub, result.pos, result.len);
@ -68,7 +71,7 @@ void CliKeySearchResult::onResult(const struct libeosio::ec_keypair* key, const
} }
std::cout << std::endl std::cout << std::endl
<< "Private: " << libeosio::wif_priv_encode(key->secret) << std::endl; << "Private: " << libantelope::wif_priv_encode(key->secret, m_codec.pvt) << std::endl;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -24,27 +24,31 @@
#ifndef EOSIOKEYGEN_KEY_SEARCH_HELPERS_H #ifndef EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
#define EOSIOKEYGEN_KEY_SEARCH_HELPERS_H #define EOSIOKEYGEN_KEY_SEARCH_HELPERS_H
#include <libeosio/types.hpp> #include <string>
#include <libantelope/ec.hpp>
#include <libantelope/WIF.hpp>
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
#include <eoskeygen/key_search.hpp> #include <eoskeygen/key_search.hpp>
#include <eoskeygen/key_search_result.hpp> #include <eoskeygen/key_search_result.hpp>
namespace eoskeygen { namespace antelopekeygen {
class Dictionary; class Dictionary;
class CliKeySearchResult : public IKeySearchResult class CliKeySearchResult : public IKeySearchResult
{ {
public: public:
CliKeySearchResult(const Dictionary& dict); CliKeySearchResult(const Dictionary& dict, const libantelope::wif_codec_t& codec);
virtual void onResult(const struct libeosio::ec_keypair* key, const struct KeySearch::result& result); virtual void onResult(const struct libantelope::ec_keypair* key, const struct KeySearch::result& result);
protected : protected :
const Dictionary& m_dict; const Dictionary& m_dict;
libantelope::wif_codec_t m_codec;
}; };
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_KEY_SEARCH_HELPERS_H */ #endif /* EOSIOKEYGEN_KEY_SEARCH_HELPERS_H */

View file

@ -25,7 +25,7 @@
#include "isatty.hpp" #include "isatty.hpp"
#include "console.hpp" #include "console.hpp"
namespace eoskeygen { namespace console { namespace antelopekeygen { namespace console {
bool disable_color = false; bool disable_color = false;
@ -45,4 +45,4 @@ bool isColorsSupported(const std::ostream& os) {
return disable_color == false && isatty(fd); return disable_color == false && isatty(fd);
} }
} } // namespace eoskeygen::console } } // namespace antelopekeygen::console

View file

@ -26,7 +26,7 @@
#include <ostream> #include <ostream>
namespace eoskeygen { namespace antelopekeygen {
namespace console { namespace console {
@ -86,6 +86,6 @@ namespace console {
} // namespace console } // namespace console
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_CONSOLE_H */ #endif /* EOSIOKEYGEN_CONSOLE_H */

View file

@ -24,7 +24,7 @@
#include <iostream> #include <iostream>
#include "console.hpp" #include "console.hpp"
namespace eoskeygen { namespace antelopekeygen {
namespace console { namespace console {
@ -80,4 +80,4 @@ std::ostream& operator<<(std::ostream& os, const fg& obj) {
} // namespace console } // namespace console
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -25,7 +25,7 @@
#include <iostream> #include <iostream>
#include "console.hpp" #include "console.hpp"
namespace eoskeygen { namespace antelopekeygen {
// WinAPI colors // WinAPI colors
#define FG_BLACK 0 #define FG_BLACK 0
@ -105,4 +105,4 @@ std::ostream& operator<<(std::ostream& os, const fg& obj) {
} // namespace console } // namespace console
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -31,7 +31,7 @@
#endif #endif
#include "isatty.hpp" #include "isatty.hpp"
namespace eoskeygen { namespace antelopekeygen {
bool isatty(int fd) { bool isatty(int fd) {
return ::_isatty(fd); return ::_isatty(fd);
@ -42,4 +42,4 @@ bool isatty(FILE* fd) {
return fd ? isatty(_fileno(fd)) : false; return fd ? isatty(_fileno(fd)) : false;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -26,12 +26,12 @@
#include <stdio.h> #include <stdio.h>
namespace eoskeygen { namespace antelopekeygen {
bool isatty(int fd); bool isatty(int fd);
bool isatty(FILE* fd); bool isatty(FILE* fd);
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_CORE_ISATTY_H */ #endif /* EOSIOKEYGEN_CORE_ISATTY_H */

View file

@ -23,9 +23,10 @@
*/ */
#include <iostream> #include <iostream>
#include <cstring> #include <cstring>
#include <libeosio/base58.hpp> #include <CLI11/CLI11.hpp>
#include <libeosio/ec.hpp> #include <libantelope/base58.hpp>
#include <libeosio/WIF.hpp> #include <libantelope/ec.hpp>
#include <libantelope/WIF.hpp>
#include <eoskeygen/config.hpp> #include <eoskeygen/config.hpp>
#include <eoskeygen/core/file.hpp> #include <eoskeygen/core/file.hpp>
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
@ -39,77 +40,38 @@
// Command line options. // Command line options.
bool option_l33t = false; bool option_l33t = false;
libantelope::wif_codec_t key_codec;
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef EOSIOKEYGEN_HAVE_THREADS
size_t option_num_threads = eoskeygen::KeySearch::max_threads(); size_t option_num_threads;
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
void usage(const char *name) { class CustomFormatter : public CLI::Formatter {
public:
std::cout << name std::string make_usage(const CLI::App *app, std::string name) const
<< " [ -h | --help | -v | search [ -m | --l33t" {
#ifdef EOSIOKEYGEN_HAVE_THREADS std::stringstream out;
<< " | --threads=<num>"
#endif /* EOSIOKEYGEN_HAVE_THREADS */
<< " | --dict=<file> ... "
<< " | --lang=<value> ... ] <word_list>|file:<filename> [ <count:10> ]"
<< " | benchmark [ <num:1000> ]"
<< " ]"
<< std::endl << std::endl;
std::cout << " - Output one EOSIO key pair if no arguments are given" << std::endl << std::endl; out << std::endl << CLI::Formatter::make_usage(app, name)
<< std::endl
<< "Outputs one EOSIO key pair if no subcommand is given"
<< std::endl;
// Options return out.str();
std::cout }
<< " Options:" << std::endl };
<< " -h, --help Shows this help text."
<< std::endl << std::endl
<< " -v Shows version."
<< std::endl << std::endl;
std::cout << " search: " << std::endl int cmd_search(const antelopekeygen::strlist_t& words, const antelopekeygen::Dictionary& dict, int count) {
<< " performs a search, finding <count> public keys containing" << std::endl
<< " one or more words from <word_list> (separated with ',')." << std::endl
<< std::endl
<< " Instead of a list it is possible to specify a file with words" << std::endl
<< " (separated with newline '\\n') using file:<filename>"
<< std::endl << std::endl
<< " -m: Monochrome, disables all color output."
<< std::endl << std::endl
<< " --l33t: Takes each word in <word_list> and find all l33tspeak" << std::endl
<< " combinations of that word and uses the new list for the search."
#ifdef EOSIOKEYGEN_HAVE_THREADS
<< std::endl << std::endl
<< " --threads=<num>: Use <num> of parallel threads for searching." << std::endl
<< " Default is what the operating system recomend."
#endif /* EOSIOKEYGEN_HAVE_THREADS */
<< std::endl << std::endl
<< " --dict=<file>: Use words found in <file> (separated by newline) to" << std::endl
<< " highlight words in the keys found (note that the words in this" << std::endl
<< " file are not used for search. only for highlight output)." << std::endl
<< " There can be more then one --dict flag. In that case contents" << std::endl
<< " of all files are merged into one dictionary." << std::endl
<< std::endl << std::endl
<< " --lang=<value>: Same as --dict but will use <value>" << std::endl
<< " to find a file in " << CONFIG_SHARE_FULL_PATH << "/dict." << std::endl
<< " There can be more then one --lang flag. In that case contents" << std::endl
<< " of all files are merged into one dictionary." << std::endl
<< std::endl;
std::cout << " Benchmark: " << std::endl antelopekeygen::KeySearch ks;
<< " performs a benchmark test, generating <num> keys and measuring the time." << std::endl antelopekeygen::CliKeySearchResult rs(dict, key_codec);
<< std::endl;
}
int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& dict, int count) {
eoskeygen::KeySearch ks;
eoskeygen::CliKeySearchResult rs(dict);
ks.setPrefix(key_codec.pub);
ks.setCallback(&rs); ks.setCallback(&rs);
for(auto it = words.begin(); it != words.end(); it++) { for(auto it = words.begin(); it != words.end(); it++) {
size_t p = libeosio::is_base58(*it); size_t p = libantelope::is_base58(*it);
if (p != std::string::npos) { if (p != std::string::npos) {
std::cerr << "The word '" std::cerr << "The word '"
<< *it << "' contains an invalid non-base58 character '" << *it << "' contains an invalid non-base58 character '"
@ -120,7 +82,7 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
if (option_l33t) { if (option_l33t) {
for(std::size_t i = 0; i < words.size(); i++) { for(std::size_t i = 0; i < words.size(); i++) {
ks.addList(eoskeygen::l33twords(words[i])); ks.addList(antelopekeygen::l33twords(words[i]));
} }
} else { } else {
ks.addList(words); ks.addList(words);
@ -131,9 +93,9 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
std::cout << "Searching for " << count std::cout << "Searching for " << count
<< " keys containing: " << eoskeygen::strlist::join(ks.getList(), ",") << " keys containing: " << antelopekeygen::strlist::join(ks.getList(), ",")
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef EOSIOKEYGEN_HAVE_THREADS
<< ", Using: " << option_num_threads << " threads" << ", Using: " << ks.getThreadCount() << " threads"
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
<< std::endl; << std::endl;
@ -144,12 +106,12 @@ int cmd_search(const eoskeygen::strlist_t& words, const eoskeygen::Dictionary& d
void cmd_benchmark(size_t num_keys) { void cmd_benchmark(size_t num_keys) {
struct eoskeygen::benchmark_result res; struct antelopekeygen::benchmark_result res;
std::cout << "Benchmark: Generating " std::cout << "Benchmark: Generating "
<< num_keys << " keys" << std::endl; << num_keys << " keys" << std::endl;
eoskeygen::benchmark(num_keys, &res); antelopekeygen::benchmark(num_keys, &res);
std::cout << "Result: Took " << res.sec << " seconds, " std::cout << "Result: Took " << res.sec << " seconds, "
<< res.kps << " keys per second." << std::endl; << res.kps << " keys per second." << std::endl;
@ -157,137 +119,129 @@ void cmd_benchmark(size_t num_keys) {
int main(int argc, char **argv) { int main(int argc, char **argv) {
// current position in argv CLI::App cmd("Keygenerator for Antelope based blockchains", PROGRAM_NAME);
// when parsing command line. std::vector<std::string> dict_list;
int p = 1; std::vector<std::string> lang_list;
std::string search_words;
std::string key_format;
int search_count;
size_t bench_count;
int rc = 0;
// No args, just print a key. libantelope::ec_init();
if (argc <= 1) {
struct libeosio::ec_keypair pair;
libeosio::ec_generate_key(&pair);
libeosio::wif_print_key(&pair);
return 0;
}
if (!strcmp(argv[p], "-h") || !strcmp(argv[p], "--help")) { CLI::Option* version = cmd.add_flag("-v,--version", "Show version");
usage(argv[0]); cmd.add_option("--format", key_format, "valid values: K1, fio, legacy")->default_val("K1");
return 0;
}
if (!strcmp(argv[p], "-v")) { // Search
std::cout << PROGRAM_NAME << " v" << PROGRAM_VERSION << std::endl; CLI::App* search_cmd = cmd.add_subcommand("search",
return 0; "performs a search, finding <count> public keys containing "
} "one or more words from <word_list> (separated with \",\")");
CLI::Option* monocrome = search_cmd->add_flag("-m", "Monochrome, disables all color output.");
if (!strcmp(argv[p], "search")) { search_cmd->add_flag("--l33t", option_l33t, "Takes each word in <word_list> and find all l33tspeak"
" combinations of that word and uses the new list for the search.");
int count = 10;
eoskeygen::strlist_t words;
eoskeygen::Dictionary dict;
while(p++ < argc - 1) {
if (!strcmp(argv[p], "-m")) {
eoskeygen::console::disable_color = true;
} else if (!strcmp(argv[p], "--l33t")) {
option_l33t = true;
} else if (!memcmp(argv[p], "--threads=", 10)) {
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef EOSIOKEYGEN_HAVE_THREADS
option_num_threads = atoi(argv[p] + 10); search_cmd->add_option("--threads", option_num_threads,
if (option_num_threads < 2) { "Use <num> of parallel threads for searching.\n"
std::cerr << "NOTICE: Number of threads less than 2 does not make sense." "Default is what the operating system recomends.")
<< " So eosio-keygen will use 2." << std::endl; ->default_val(antelopekeygen::KeySearch::max_threads());
option_num_threads = 2;
}
#else
// Even if we dont have threads. we consume the flag.
// otherwise we might break scripts. Print a nice message instead.
std::cerr << "NOTICE: eosio-keygen is not compiled with"
<< " thread support. this option is ignored." << std::endl;
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
}
// Dictionary.
else if (!memcmp(argv[p], "--dict=", 7)) {
eoskeygen::Dictionary d;
std::string filename(argv[p] + 7);
if (d.loadFromFile(filename)) { search_cmd->add_option("--dict", dict_list, "");
dict.add(d); search_cmd->add_option("--lang", lang_list, "");
} else { search_cmd->add_option("word_list", search_words,
std::cerr << "Could not load dictionary from file: " << filename << std::endl; "one or more words (separated with \",\")\n\n"
} "Instead of a list it is possible to specify a file with words\n"
} "(separated with newline '\\n') using file:<filename>")->required();
// Language (dictionary, but we find the file in <CONFIG_SHARE_FULL_PATH>/dict/<lang>) search_cmd->add_option("count", search_count, "Number of keys to search for before the program terminates.")->default_val(10);
else if (!memcmp(argv[p], "--lang=", 7)) {
eoskeygen::Dictionary d;
std::string lang(argv[p] + 7);
std::string filename(std::string(CONFIG_SHARE_FULL_PATH) + "/dict/" + lang);
if (d.loadFromFile(filename)) {
dict.add(d);
} else {
std::cerr << "Could not load language " << lang << " (" << filename << ")" << std::endl;
}
}
// Error out on any flag we don't support.
else if (argv[p][0] == '-') {
std::cerr << "Unrecognized flag: " << argv[p] << std::endl;
usage(argv[0]);
return 0;
}
// wordlist and count
else if (words.size() < 1) {
std::string arg = std::string(argv[p]);
if (arg.rfind("file:", 0) == 0) {
std::string filename = arg.substr(5);
if (!eoskeygen::readLines(filename, words)) {
std::cerr << "Could not read file: " << filename << std::endl;
return 0;
}
if (words.size() < 1) {
std::cerr << filename << " did not contain any words" << std::endl;
return 0;
}
}
// List
else {
words = eoskeygen::strlist::splitw(arg);
}
if (p + 1 < argc) {
count = atoi(argv[++p]);
if (count < 1) {
count = 1;
}
}
}
}
if (words.size() < 1) {
std::cerr << "You must specify a word list." << std::endl;
usage(argv[0]);
return 1;
}
return cmd_search(words, dict, count);
}
// Benchmark // Benchmark
else if (!strcmp(argv[p], "benchmark")) { CLI::App* bench_cmd = cmd.add_subcommand("benchmark", "performs a benchmark test, "
int num_keys = 1000; "generating <num> keys and measuring the time.");
bench_cmd->add_option("count", bench_count, "")->default_val(1000);
if (++p < argc) { // Parse command line.
num_keys = atoi(argv[p]); cmd.formatter(std::make_shared<CustomFormatter>());
if (num_keys < 1) {
num_keys = 1; CLI11_PARSE(cmd, argc, argv);
if (*version) {
std::cout << PROGRAM_NAME << ": v" << PROGRAM_VERSION << std::endl;
goto end;
}
if (key_format == "fio") {
key_codec = libantelope::wif_create_legacy_codec("FIO");
} else if (key_format == "legacy") {
key_codec = libantelope::WIF_CODEC_LEG;
} else if (key_format == "K1") {
key_codec = libantelope::WIF_CODEC_K1;
} else {
std::cerr << "invalid key format: " << key_format << std::endl;
goto end;
}
if (search_cmd->parsed()) {
antelopekeygen::strlist_t words;
antelopekeygen::Dictionary dict;
if (*monocrome) {
antelopekeygen::console::disable_color = true;
}
for (auto item : dict_list) {
antelopekeygen::Dictionary d;
if (d.loadFromFile(item)) {
dict.add(d);
} else {
std::cerr << "Could not load dictionary from file: " << item << std::endl;
} }
} }
cmd_benchmark(num_keys); for (auto item : lang_list) {
} else { antelopekeygen::Dictionary d;
std::cerr << "Unrecogniced command: " << argv[1] << std::endl; std::string filename(CONFIG_SHARE_FULL_PATH "/dicts/" + item);
usage(argv[0]);
return 1; if (d.loadFromFile(filename)) {
dict.add(d);
} else {
std::cerr << "Could not load dictionary from language file: " << filename << std::endl;
}
}
if (search_words.rfind("file:", 0) == 0) {
std::string filename = search_words.substr(5);
if (!antelopekeygen::readLines(filename, words)) {
std::cerr << "Could not read file: " << filename << std::endl;
goto end;
}
if (words.size() < 1) {
std::cerr << filename << " did not contain any words" << std::endl;
goto end;
}
} else {
words = antelopekeygen::strlist::splitw(search_words);
}
rc = cmd_search(words, dict, search_count);
goto end;
} else if (bench_cmd->parsed()) {
cmd_benchmark(bench_count);
}
// No subcommand given, just generate and print a keypair.
else {
struct libantelope::ec_keypair pair;
libantelope::ec_generate_key(&pair);
libantelope::wif_print_key(&pair, key_codec);
goto end;
} }
return 0; end: libantelope::ec_shutdown();
return rc;
} }

View file

@ -97,6 +97,19 @@ set( CPACK_DEBIAN_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE_URL}" )
set( CPACK_DEB_COMPONENT_INSTALL ON ) set( CPACK_DEB_COMPONENT_INSTALL ON )
# RPM
# Always build components for rpm packages
set( CPACK_RPM_COMPONENT_INSTALL ON )
# Same as with DEB package.
set( CPACK_RPM_PACKAGE_HOMEPAGE "${PROJECT_HOMEPAGE_URL}" )
set( CPACK_RPM_PACKAGE_RELEASE_DIST ON )
set( CPACK_RPM_PACKAGE_RELEASE "1" CACHE STRING "RPM package release version" )
set( CPACK_RPM_PACKAGE_LICENSE "MIT" )
set( CPACK_RPM_FILE_NAME "RPM-DEFAULT" )
# -------------------------------- # --------------------------------
# Generator default # Generator default
# -------------------------------- # --------------------------------

View file

@ -28,7 +28,7 @@ set( COMMON_SOURCE
if (USE_THREADS) if (USE_THREADS)
find_package(Threads) find_package(Threads)
if (Threads_FOUND) if (Threads_FOUND)
set( EOSIOKEYGEN_HAVE_THREADS TRUE ) set( ANTELOPEKEYGEN_HAVE_THREADS TRUE )
set( COMMON_SOURCE ${COMMON_SOURCE} src/key_search_mt.cpp ) set( COMMON_SOURCE ${COMMON_SOURCE} src/key_search_mt.cpp )
endif (Threads_FOUND) endif (Threads_FOUND)
endif (USE_THREADS) endif (USE_THREADS)
@ -40,10 +40,10 @@ add_library( ${COMMON_NAME} STATIC ${COMMON_SOURCE} )
target_include_directories( ${COMMON_NAME} PUBLIC include ) target_include_directories( ${COMMON_NAME} PUBLIC include )
# Link with libeosio and threads library. # Link with libantelope and threads library.
include( libeosio ) include( libantelope )
target_link_libraries( ${COMMON_NAME} target_link_libraries( ${COMMON_NAME}
PUBLIC PUBLIC
libeosio libantelope
${CMAKE_THREAD_LIBS_INIT} ${CMAKE_THREAD_LIBS_INIT}
) )

View file

@ -0,0 +1,53 @@
# --------------------------------
# Variables
# --------------------------------
set( LIBANTELOPE_GIT_URL "https://github.com/eosswedenorg/libantelope.git" )
set( LIBANTELOPE_WANTED_VERSION v0.2.2 )
# --------------------------------
# Macros
# --------------------------------
macro(fromGit tag)
message ("Using libantelope from: ${LIBANTELOPE_GIT_URL}@${tag}")
include(FetchContent)
FetchContent_Declare(libantelope
GIT_REPOSITORY ${LIBANTELOPE_GIT_URL}
GIT_TAG ${tag}
SOURCE_DIR ${DOWNLOAD_CACHE_DIR}/libeosio/src
STAMP_DIR ${DOWNLOAD_CACHE_DIR}/libeosio/stamp
)
FetchContent_GetProperties(libantelope)
if (NOT libantelope_POPULATED)
FetchContent_Populate(libantelope)
add_subdirectory(${libantelope_SOURCE_DIR} ${libantelope_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endmacro()
macro(buildLocal src)
message ("Using local libantelope at: ${src}")
add_subdirectory(${src} ${src}/build EXCLUDE_FROM_ALL)
endmacro()
# If we have a local libantelope
if (LIBANTELOPE_SOURCE_DIR)
buildLocal( ${LIBANTELOPE_SOURCE_DIR} )
else()
# Check if version is in fact a version.
if (LIBANTELOPE_WANTED_VERSION MATCHES "^[0-9]+(.[0-9]+)?(.[0-9]+)(-[a-zA-Z0-9]+)?$")
# Try finding the package on the system.
find_package(libantelope ${LIBANTELOPE_WANTED_VERSION} QUIET)
if (libantelope_FOUND)
message ("Using libeosio in: ${libantelope_DIR}")
# Not found, download from git.
else()
fromGit( v${LIBANTELOPE_WANTED_VERSION} )
endif()
# Assume version contains a git branch.
else()
fromGit( ${LIBANTELOPE_WANTED_VERSION} )
endif()
endif()

View file

@ -1,53 +0,0 @@
# --------------------------------
# Variables
# --------------------------------
set( LIBEOSIO_GIT_URL "https://github.com/eosswedenorg/libeosio.git" )
set( LIBEOSIO_WANTED_VERSION v0.1.2 )
# --------------------------------
# Macros
# --------------------------------
macro(fromGit tag)
message ("Using libeosio from: ${LIBEOSIO_GIT_URL}@${tag}")
include(FetchContent)
FetchContent_Declare(libeosio
GIT_REPOSITORY ${LIBEOSIO_GIT_URL}
GIT_TAG ${tag}
SOURCE_DIR ${DOWNLOAD_CACHE_DIR}/libeosio/src
STAMP_DIR ${DOWNLOAD_CACHE_DIR}/libeosio/stamp
)
FetchContent_GetProperties(libeosio)
if (NOT libeosio_POPULATED)
FetchContent_Populate(libeosio)
add_subdirectory(${libeosio_SOURCE_DIR} ${libeosio_BINARY_DIR} EXCLUDE_FROM_ALL)
endif()
endmacro()
macro(buildLocal src)
message ("Using local libeosio at: ${src}")
add_subdirectory(${src} ${src}/build EXCLUDE_FROM_ALL)
endmacro()
# If we have a locallibeosio
if (LIBEOSIO_SOURCE_DIR)
buildLocal( ${LIBEOSIO_SOURCE_DIR} )
else()
# Check if version is in fact a version.
if (LIBEOSIO_WANTED_VERSION MATCHES "^[0-9]+(.[0-9]+)?(.[0-9]+)(-[a-zA-Z0-9]+)?$")
# Try finding the package on the system.
find_package(libeosio ${LIBEOSIO_WANTED_VERSION} QUIET)
if (libeoskeygen_FOUND)
message ("Using libeosio in: ${libeosio_DIR}")
# Not found, download from git.
else()
fromGit( v${LIBEOSIO_WANTED_VERSION} )
endif()
# Assume version contains a git branch.
else()
fromGit( ${LIBEOSIO_WANTED_VERSION} )
endif()
endif()

View file

@ -21,10 +21,10 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CONFIG_H #ifndef ANTELOPEKEYGEN_COMMON_CONFIG_H
#define EOSIOKEYGEN_COMMON_CONFIG_H #define ANTELOPEKEYGEN_COMMON_CONFIG_H
// Defined if we have thread support. // Defined if we have thread support.
#cmakedefine EOSIOKEYGEN_HAVE_THREADS #cmakedefine ANTELOPEKEYGEN_HAVE_THREADS
#endif /* EOSIOKEYGEN_COMMON_CONFIG_H */ #endif /* ANTELOPEKEYGEN_COMMON_CONFIG_H */

View file

@ -21,14 +21,14 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H #ifndef ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H
#define EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H #define ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H
#include <string> #include <string>
#include <map> #include <map>
#include <set> #include <set>
namespace eoskeygen { namespace antelopekeygen {
class Dictionary class Dictionary
{ {
@ -70,6 +70,6 @@ protected :
std::set<std::string> m_words; std::set<std::string> m_words;
}; };
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_CORE_DICTIONARY_H */ #endif /* ANTELOPEKEYGEN_COMMON_CORE_DICTIONARY_H */

View file

@ -21,15 +21,15 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CORE_FILE_H #ifndef ANTELOPEKEYGEN_COMMON_CORE_FILE_H
#define EOSIOKEYGEN_COMMON_CORE_FILE_H #define ANTELOPEKEYGEN_COMMON_CORE_FILE_H
#include <eoskeygen/core/strlist.hpp> #include <eoskeygen/core/strlist.hpp>
namespace eoskeygen { namespace antelopekeygen {
bool readLines(const std::string& filename, strlist_t& lines); bool readLines(const std::string& filename, strlist_t& lines);
} // namespace } // namespace
#endif /* EOSIOKEYGEN_COMMON_CORE_FILE_H */ #endif /* ANTELOPEKEYGEN_COMMON_CORE_FILE_H */

View file

@ -21,16 +21,16 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CORE_LEET_H #ifndef ANTELOPEKEYGEN_COMMON_CORE_LEET_H
#define EOSIOKEYGEN_COMMON_CORE_LEET_H #define ANTELOPEKEYGEN_COMMON_CORE_LEET_H
#include <string> #include <string>
#include <eoskeygen/core/strlist.hpp> #include <eoskeygen/core/strlist.hpp>
namespace eoskeygen { namespace antelopekeygen {
strlist_t l33twords(std::string str); strlist_t l33twords(std::string str);
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_CORE_LEET_H */ #endif /* ANTELOPEKEYGEN_COMMON_CORE_LEET_H */

View file

@ -21,13 +21,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CORE_STRING_H #ifndef ANTELOPEKEYGEN_COMMON_CORE_STRING_H
#define EOSIOKEYGEN_COMMON_CORE_STRING_H #define ANTELOPEKEYGEN_COMMON_CORE_STRING_H
#include <vector> #include <vector>
#include <string> #include <string>
namespace eoskeygen { namespace antelopekeygen {
std::string& strtolower(std::string& str); std::string& strtolower(std::string& str);
@ -35,6 +35,6 @@ std::string& rtrim(std::string& str);
std::string& ltrim(std::string& str); std::string& ltrim(std::string& str);
std::string& trim(std::string& str); std::string& trim(std::string& str);
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_CORE_STRING_H */ #endif /* ANTELOPEKEYGEN_COMMON_CORE_STRING_H */

View file

@ -21,13 +21,13 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_CORE_STRLIST_H #ifndef ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H
#define EOSIOKEYGEN_COMMON_CORE_STRLIST_H #define ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H
#include <vector> #include <vector>
#include <string> #include <string>
namespace eoskeygen { namespace antelopekeygen {
typedef std::vector<std::string> strlist_t; typedef std::vector<std::string> strlist_t;
@ -45,6 +45,6 @@ strlist_t& strip(strlist_t& list, strlist_stripfunc_t fn);
} // namespace strlist } // namespace strlist
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_CORE_STRLIST_H */ #endif /* ANTELOPEKEYGEN_COMMON_CORE_STRLIST_H */

View file

@ -21,17 +21,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_KEY_SEARCH_H #ifndef ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H
#define EOSIOKEYGEN_COMMON_KEY_SEARCH_H #define ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H
#include <stdint.h> #include <stdint.h>
#include <string> #include <string>
#include <libeosio/types.hpp> #include <libantelope/ec.hpp>
#include <eoskeygen/config.hpp> #include <eoskeygen/config.hpp>
#include <eoskeygen/core/dictionary.hpp> #include <eoskeygen/core/dictionary.hpp>
#include <eoskeygen/core/strlist.hpp> #include <eoskeygen/core/strlist.hpp>
namespace eoskeygen { namespace antelopekeygen {
class IKeySearchResult; class IKeySearchResult;
@ -47,6 +47,8 @@ public :
public : public :
KeySearch(); KeySearch();
void setPrefix(const std::string& prefix);
// Add a word to search for. // Add a word to search for.
void addWord(const std::string& str); void addWord(const std::string& str);
@ -62,14 +64,16 @@ public :
// Set callback for search result. // Set callback for search result.
void setCallback(IKeySearchResult* callback); void setCallback(IKeySearchResult* callback);
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef ANTELOPEKEYGEN_HAVE_THREADS
// Returns the maximum number of threads // Returns the maximum number of threads
// reported by the operating system. // reported by the operating system.
static size_t max_threads(); static size_t max_threads();
// Set the number of threads to use while searching. // Set the number of threads to use while searching.
void setThreadCount(size_t num); void setThreadCount(size_t num);
#endif /* EOSIOKEYGEN_HAVE_THREADS */
size_t getThreadCount() const;
#endif /* ANTELOPEKEYGEN_HAVE_THREADS */
// Aborts find() operation if started. // Aborts find() operation if started.
// This is useful for multithreaded code (like GUI application) // This is useful for multithreaded code (like GUI application)
@ -84,17 +88,21 @@ protected :
// Check if any word in <word_list> appears in <key>'s public key. // Check if any word in <word_list> appears in <key>'s public key.
// returns true if a word was found (stored in <result>), false otherwise. // returns true if a word was found (stored in <result>), false otherwise.
bool _contains_word(const struct libeosio::ec_keypair* key, struct result& result); bool _contains_word(const struct libantelope::ec_keypair* key, struct result& result);
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef ANTELOPEKEYGEN_HAVE_THREADS
void _thr_proc(); void _thr_proc();
void _search_mt(); void _search_mt();
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* ANTELOPEKEYGEN_HAVE_THREADS */
void _search_linear(); void _search_linear();
protected : protected :
// Public key prefix.
std::string m_prefix;
// List of words to search for. // List of words to search for.
strlist_t m_words; strlist_t m_words;
@ -104,14 +112,14 @@ protected :
// Current number of keys found. // Current number of keys found.
std::size_t m_count; std::size_t m_count;
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef ANTELOPEKEYGEN_HAVE_THREADS
// Number of threads to use. // Number of threads to use.
size_t m_threads; size_t m_threads;
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* ANTELOPEKEYGEN_HAVE_THREADS */
IKeySearchResult* m_callback; IKeySearchResult* m_callback;
}; };
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_KEY_SEARCH_H */ #endif /* ANTELOPEKEYGEN_COMMON_KEY_SEARCH_H */

View file

@ -21,20 +21,20 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#ifndef EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H #ifndef ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H
#define EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H #define ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H
#include <eoskeygen/key_search.hpp> #include <eoskeygen/key_search.hpp>
namespace eoskeygen { namespace antelopekeygen {
class IKeySearchResult class IKeySearchResult
{ {
public : public :
virtual void onResult(const struct libeosio::ec_keypair* key, const struct KeySearch::result& result) = 0; virtual void onResult(const struct libantelope::ec_keypair* key, const struct KeySearch::result& result) = 0;
}; };
} // namespace eoskeygen } // namespace antelopekeygen
#endif /* EOSIOKEYGEN_COMMON_KEY_SEARCH_RESULT_H */ #endif /* ANTELOPEKEYGEN_COMMON_KEY_SEARCH_RESULT_H */

View file

@ -29,7 +29,7 @@
#include <eoskeygen/core/dictionary.hpp> #include <eoskeygen/core/dictionary.hpp>
#include <eoskeygen/core/file.hpp> #include <eoskeygen/core/file.hpp>
namespace eoskeygen { namespace antelopekeygen {
struct StringContains { struct StringContains {
StringContains(const std::string& str, std::vector<size_t>& pos) : m_str(str), m_pos(pos) {} StringContains(const std::string& str, std::vector<size_t>& pos) : m_str(str), m_pos(pos) {}
@ -126,4 +126,4 @@ Dictionary::search_result_t Dictionary::search(const std::string& subject) const
return res; return res;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -25,7 +25,7 @@
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
#include <eoskeygen/core/file.hpp> #include <eoskeygen/core/file.hpp>
namespace eoskeygen { namespace antelopekeygen {
bool readLines(const std::string& filename, strlist_t& lines) { bool readLines(const std::string& filename, strlist_t& lines) {
@ -46,4 +46,4 @@ bool readLines(const std::string& filename, strlist_t& lines) {
return true; return true;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -24,7 +24,7 @@
#include <algorithm> #include <algorithm>
#include <eoskeygen/core/leet.hpp> #include <eoskeygen/core/leet.hpp>
namespace eoskeygen { namespace antelopekeygen {
static bool is_l33t(char ch, char& r) { static bool is_l33t(char ch, char& r) {
@ -79,4 +79,4 @@ strlist_t l33twords(std::string str) {
return list; return list;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -26,7 +26,7 @@
#include <algorithm> #include <algorithm>
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
namespace eoskeygen { namespace antelopekeygen {
std::string& strtolower(std::string& str) { std::string& strtolower(std::string& str) {
std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); }); std::transform(str.begin(), str.end(), str.begin(), [](unsigned char c){ return std::tolower(c); });
@ -49,4 +49,4 @@ std::string& trim(std::string& str) {
return ltrim(rtrim(str)); return ltrim(rtrim(str));
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -25,7 +25,7 @@
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
#include <eoskeygen/core/strlist.hpp> #include <eoskeygen/core/strlist.hpp>
namespace eoskeygen { namespace antelopekeygen {
strlist_t strlist::splitw(const std::string& str, const std::string& delim) { strlist_t strlist::splitw(const std::string& str, const std::string& delim) {
@ -48,7 +48,7 @@ strlist_t strlist::split(const std::string& str, const std::string& delim) {
return r; return r;
} }
std::string strlist::join(const eoskeygen::strlist_t& list, const std::string& delim) { std::string strlist::join(const strlist_t& list, const std::string& delim) {
std::string out; std::string out;
@ -72,4 +72,4 @@ strlist_t& strlist::strip(strlist_t& list, strlist_stripfunc_t fn) {
return list; return list;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -21,16 +21,17 @@
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE. * SOFTWARE.
*/ */
#include <libeosio/ec.hpp> #include <libantelope/ec.hpp>
#include <libeosio/WIF.hpp> #include <libantelope/WIF.hpp>
#include <eoskeygen/config.hpp> #include <eoskeygen/config.hpp>
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
#include <eoskeygen/key_search_result.hpp> #include <eoskeygen/key_search_result.hpp>
#include <eoskeygen/key_search.hpp> #include <eoskeygen/key_search.hpp>
namespace eoskeygen { namespace antelopekeygen {
KeySearch::KeySearch() : KeySearch::KeySearch() :
m_prefix ("EOS"),
m_max (0), m_max (0),
m_count (0), m_count (0),
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef EOSIOKEYGEN_HAVE_THREADS
@ -40,6 +41,11 @@ KeySearch::KeySearch() :
{ {
} }
void KeySearch::setPrefix(const std::string& prefix)
{
m_prefix = prefix;
}
void KeySearch::addWord(const std::string& str) void KeySearch::addWord(const std::string& str)
{ {
std::string tmp = str; std::string tmp = str;
@ -71,11 +77,11 @@ void KeySearch::setCallback(IKeySearchResult* callback)
void KeySearch::_search_linear() void KeySearch::_search_linear()
{ {
struct libeosio::ec_keypair pair; struct libantelope::ec_keypair pair;
while (m_count < m_max) { while (m_count < m_max) {
struct result res; struct result res;
libeosio::ec_generate_key(&pair); libantelope::ec_generate_key(&pair);
if (_contains_word(&pair, res)) { if (_contains_word(&pair, res)) {
m_callback->onResult(&pair, res); m_callback->onResult(&pair, res);
m_count++; m_count++;
@ -105,16 +111,16 @@ void KeySearch::find(size_t num_results)
_search_linear(); _search_linear();
} }
bool KeySearch::_contains_word(const struct libeosio::ec_keypair* key, struct result& result) { bool KeySearch::_contains_word(const struct libantelope::ec_keypair* key, struct result& result) {
// skip first 3 chars, as those are always "EOS" size_t prefix_len = m_prefix.length();
std::string pubstr = libeosio::wif_pub_encode(key->pub).substr(3); std::string pubstr = libantelope::wif_pub_encode(key->pub, m_prefix).substr(prefix_len);
strtolower(pubstr); strtolower(pubstr);
for(auto const& w: m_words) { for(auto const& w: m_words) {
size_t p = pubstr.find(w); size_t p = pubstr.find(w);
if (p != std::string::npos) { if (p != std::string::npos) {
result.pos = p + 3; result.pos = p + prefix_len;
result.len = w.length(); result.len = w.length();
return true; return true;
} }
@ -122,4 +128,4 @@ bool KeySearch::_contains_word(const struct libeosio::ec_keypair* key, struct re
return false; return false;
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -25,11 +25,11 @@
#include <thread> #include <thread>
#include <mutex> #include <mutex>
#include <vector> #include <vector>
#include <libeosio/ec.hpp> #include <libantelope/ec.hpp>
#include <eoskeygen/key_search_result.hpp> #include <eoskeygen/key_search_result.hpp>
#include <eoskeygen/key_search.hpp> #include <eoskeygen/key_search.hpp>
namespace eoskeygen { namespace antelopekeygen {
// Mutex guard for m_count. // Mutex guard for m_count.
std::mutex g_count_mtx; std::mutex g_count_mtx;
@ -37,12 +37,12 @@ std::mutex g_count_mtx;
// Thread process. // Thread process.
void KeySearch::_thr_proc() void KeySearch::_thr_proc()
{ {
struct libeosio::ec_keypair pair; struct libantelope::ec_keypair pair;
while (m_count < m_max) { while (m_count < m_max) {
struct result res; struct result res;
libeosio::ec_generate_key(&pair); libantelope::ec_generate_key(&pair);
if (_contains_word(&pair, res)) { if (_contains_word(&pair, res)) {
// Guard output with mutex, so we don't get // Guard output with mutex, so we don't get
@ -73,6 +73,11 @@ size_t KeySearch::max_threads()
return std::thread::hardware_concurrency(); return std::thread::hardware_concurrency();
} }
size_t KeySearch::getThreadCount() const
{
return m_threads;
}
void KeySearch::_search_mt() void KeySearch::_search_mt()
{ {
std::vector<std::thread> t; std::vector<std::thread> t;
@ -93,4 +98,4 @@ void KeySearch::_search_mt()
} }
} }
} // namespace eoskeygen } // namespace antelopekeygen

View file

@ -1,8 +1,8 @@
cmake_minimum_required(VERSION 3.15) cmake_minimum_required(VERSION 3.15)
project(eosio-keygen-gui project(antelope-keygen-gui
VERSION ${CMAKE_PROJECT_VERSION} VERSION ${CMAKE_PROJECT_VERSION}
DESCRIPTION "Keygenerator for EOSIO (gui)" DESCRIPTION "Keygenerator for Antelope blockchain (gui)"
LANGUAGES CXX) LANGUAGES CXX)
# Append modules dir # Append modules dir
@ -39,6 +39,7 @@ set( PROGRAM_SRC
src/GenerateWindow.cpp src/GenerateWindow.cpp
src/SearchWindow.cpp src/SearchWindow.cpp
src/MultiSelect.cpp src/MultiSelect.cpp
src/Settings.cpp
src/helpers.cpp src/helpers.cpp
) )

View file

@ -1,23 +1,22 @@
# eosio-keygen (gui) # antelope-keygen (gui)
This is the graphical version of [eosio-keygen](https://github.com/eosswedenorg/eosio-keygen) project. This is the graphical version of the [antelope-keygen](https://github.com/eosswedenorg/antelope-keygen) project.
The program generates public and private keypairs for [EOSIO](https://eos.io/) This program generates public and private keypair for [Antelope IO](https://antelope.io)
Among the basic functionality the program can also search for keys containing specific words also know as _vanity keys_. Among the basic functionality the program can also search for keys containing specific words also know as _vanity keys_.
## Security notice ## Security notice
Keys are generated by `OpenSSL`'s `EC_KEY_generate_key` function. The program will Keys are generated using [libantelope](https://github.com/eosswedenorg/libantelope)
never expose your keys to anything but the computers memory and output of the while the library does not claim to guarantee cryptographically secure keys. it
program. You are free to inspect the source code and compile yourself to verify. relies on widly used open source cryptographic libraries (OpenSSL, libsecp256k1).
However, use this at your own risk. we cannot guarantee that the keys are Use at your own risk. The author and [Sw/eden](https://eossweden.org/) does not take responsability
cryptographically secure as this depends on OpenSSL's implementation (alto it is for any damage caused by keys generated by the program.
widely used and should be safe)
Please read the `LICENSE.gui` file. Please read the `LICENSE` file.
``` ```
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,

View file

@ -26,12 +26,16 @@
#include <QGridLayout> #include <QGridLayout>
#include <QClipboard> #include <QClipboard>
#include <QGuiApplication> #include <QGuiApplication>
#include <libeosio/ec.hpp> #include <QFont>
#include <libeosio/WIF.hpp> #include <QFontDatabase>
#include <libantelope/ec.hpp>
#include <libantelope/WIF.hpp>
#include "Settings.hpp"
#include "GenerateWindow.hpp" #include "GenerateWindow.hpp"
void _initKeyWidget(QLineEdit& w) { void _initKeyWidget(QLineEdit& w, const QFont& font) {
w.setFixedWidth(450); w.setFixedWidth(460);
w.setFont(font);
w.setReadOnly(true); w.setReadOnly(true);
} }
@ -45,11 +49,13 @@ QWidget (parent),
m_btn_gen ("Generate"), m_btn_gen ("Generate"),
m_btn_copy_both ("Copy keys") m_btn_copy_both ("Copy keys")
{ {
QFont mono = QFontDatabase::systemFont(QFontDatabase::FixedFont);
QIcon copy_icon = QIcon::fromTheme("edit-copy"); QIcon copy_icon = QIcon::fromTheme("edit-copy");
QGridLayout* layout; QGridLayout* layout;
_initKeyWidget(m_pub); _initKeyWidget(m_pub, mono);
_initKeyWidget(m_priv); _initKeyWidget(m_priv, mono);
_initKeyCopyButton(m_btn_copy_pub, copy_icon); _initKeyCopyButton(m_btn_copy_pub, copy_icon);
_initKeyCopyButton(m_btn_copy_priv, copy_icon); _initKeyCopyButton(m_btn_copy_priv, copy_icon);
@ -91,13 +97,16 @@ m_btn_copy_both ("Copy keys")
void GenerateWindow::generate_key() void GenerateWindow::generate_key()
{ {
std::string pubstr, privstr; std::string pubstr, pvtstr;
struct libeosio::ec_keypair pair; struct libantelope::ec_keypair pair;
const libantelope::wif_codec_t& codec = Settings::getKeyCodec();
libeosio::ec_generate_key(&pair); libantelope::ec_generate_key(&pair);
m_pub.setText(QString::fromStdString(libeosio::wif_pub_encode(pair.pub))); pubstr = libantelope::wif_pub_encode(pair.pub, codec.pub);
m_priv.setText(QString::fromStdString(libeosio::wif_priv_encode(pair.secret))); pvtstr = libantelope::wif_priv_encode(pair.secret, codec.pvt);
m_pub.setText(QString::fromStdString(pubstr));
m_priv.setText(QString::fromStdString(pvtstr));
} }
void GenerateWindow::copy_both_keys() void GenerateWindow::copy_both_keys()

View file

@ -25,14 +25,21 @@
#include <QMenuBar> #include <QMenuBar>
#include <QGridLayout> #include <QGridLayout>
#include <QStackedWidget> #include <QStackedWidget>
#include <libantelope/WIF.hpp>
#include "gui_text.h" #include "gui_text.h"
#include "Settings.hpp"
#include "GenerateWindow.hpp" #include "GenerateWindow.hpp"
#include "SearchWindow.hpp" #include "SearchWindow.hpp"
#include "MainWindow.hpp" #include "MainWindow.hpp"
MainWindow::MainWindow(QWidget *parent) : MainWindow::MainWindow(QWidget *parent) :
QMainWindow (parent) QMainWindow (parent),
m_format_fio_action (nullptr),
m_format_legacy_action (nullptr),
m_format_k1_action (nullptr)
{ {
libantelope::ec_init();
// Create sub windows and stacked widget. // Create sub windows and stacked widget.
m_stacked = new QStackedWidget(); m_stacked = new QStackedWidget();
m_stacked->addWidget(new GenerateWindow()); m_stacked->addWidget(new GenerateWindow());
@ -40,13 +47,45 @@ QMainWindow (parent)
setCentralWidget(m_stacked); setCentralWidget(m_stacked);
// Menu bar. // Add to menu bar.
menuBar()->addAction("Generate", this, SLOT(switchToGenerate())); menuBar()->addAction("Generate", this, SLOT(switchToGenerate()));
menuBar()->addAction("Search", this, SLOT(switchToSearch())); menuBar()->addAction("Search", this, SLOT(switchToSearch()));
// Settings
QActionGroup* formatGroup = new QActionGroup(this);
m_format_fio_action = new QAction("FIO", formatGroup);
m_format_fio_action->setCheckable(true);
m_format_legacy_action = new QAction("Legacy", formatGroup);
m_format_legacy_action->setCheckable(true);
m_format_k1_action = new QAction("K1", formatGroup);
m_format_k1_action->setCheckable(true);
// Set k1 and trigger the changed action so we set the codec.
m_format_k1_action->setChecked(true);
formatK1CheckboxChanged();
connect(m_format_fio_action, SIGNAL(triggered()), this, SLOT(formatFioCheckboxChanged()));
connect(m_format_legacy_action, SIGNAL(triggered()), this, SLOT(formatLegacyCheckboxChanged()));
connect(m_format_k1_action, SIGNAL(triggered()), this, SLOT(formatK1CheckboxChanged()));
QMenu *settings = menuBar()->addMenu("Settings");
QMenu *format_menu = settings->addMenu("Key Format");
format_menu->addAction(m_format_k1_action);
format_menu->addAction(m_format_legacy_action);
format_menu->addAction(m_format_fio_action);
// About
menuBar()->addAction("About", this, SLOT(showAbout())); menuBar()->addAction("About", this, SLOT(showAbout()));
} }
MainWindow::~MainWindow()
{
libantelope::ec_shutdown();
}
void MainWindow::switchToGenerate() void MainWindow::switchToGenerate()
{ {
m_stacked->setCurrentIndex(0); m_stacked->setCurrentIndex(0);
@ -63,3 +102,24 @@ void MainWindow::showAbout()
EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE, EOSIOKEYGEN_GUI_TEXT_ABOUT_TITLE,
EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY); EOSIOKEYGEN_GUI_TEXT_ABOUT_BODY);
} }
void MainWindow::formatFioCheckboxChanged()
{
if (m_format_fio_action->isChecked()) {
Settings::setKeyCodec(libantelope::wif_create_legacy_codec("FIO"));
}
}
void MainWindow::formatLegacyCheckboxChanged()
{
if (m_format_legacy_action->isChecked()) {
Settings::setKeyCodec(libantelope::WIF_CODEC_LEG);
}
}
void MainWindow::formatK1CheckboxChanged()
{
if (m_format_k1_action->isChecked()) {
Settings::setKeyCodec(libantelope::WIF_CODEC_K1);
}
}

View file

@ -24,6 +24,8 @@
#ifndef MAIN_WINDOW_H #ifndef MAIN_WINDOW_H
#define MAIN_WINDOW_H #define MAIN_WINDOW_H
#include <QAction>
#include <QPointer>
#include <QMainWindow> #include <QMainWindow>
class QStackedWidget; class QStackedWidget;
@ -32,7 +34,8 @@ class MainWindow : public QMainWindow
{ {
Q_OBJECT Q_OBJECT
public: public:
MainWindow(QWidget *parent = 0); MainWindow(QWidget *parent = 0);
virtual ~MainWindow();
private slots : private slots :
@ -44,9 +47,17 @@ private slots :
void showAbout(); void showAbout();
void formatFioCheckboxChanged();
void formatLegacyCheckboxChanged();
void formatK1CheckboxChanged();
private : private :
QStackedWidget* m_stacked; QStackedWidget* m_stacked;
QPointer<QAction> m_format_fio_action;
QPointer<QAction> m_format_legacy_action;
QPointer<QAction> m_format_k1_action;
}; };
#endif /* MAIN_WINDOW_H */ #endif /* MAIN_WINDOW_H */

View file

@ -28,9 +28,10 @@
#include <QGridLayout> #include <QGridLayout>
#include <QFuture> #include <QFuture>
#include <QtConcurrent> #include <QtConcurrent>
#include <libeosio/WIF.hpp> #include <libantelope/WIF.hpp>
#include <eoskeygen/core/leet.hpp> #include <eoskeygen/core/leet.hpp>
#include <eoskeygen/core/string.hpp> #include <eoskeygen/core/string.hpp>
#include "Settings.hpp"
#include "gui_text.h" #include "gui_text.h"
#include "config.hpp" #include "config.hpp"
#include "helpers.hpp" #include "helpers.hpp"
@ -71,8 +72,8 @@ m_btn_clear ("Clear")
m_layout.addWidget(&m_leet_cb, 0, 2); m_layout.addWidget(&m_leet_cb, 0, 2);
#ifdef EOSIOKEYGEN_HAVE_THREADS #ifdef EOSIOKEYGEN_HAVE_THREADS
m_num_threads.setValue((int) eoskeygen::KeySearch::max_threads()); m_num_threads.setValue((int) antelopekeygen::KeySearch::max_threads());
m_num_threads.setRange(1, (int) eoskeygen::KeySearch::max_threads()); m_num_threads.setRange(1, (int) antelopekeygen::KeySearch::max_threads());
m_num_threads.setSuffix(" Threads"); m_num_threads.setSuffix(" Threads");
m_layout.addWidget(&m_num_threads, 0, 3); m_layout.addWidget(&m_num_threads, 0, 3);
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
@ -120,7 +121,7 @@ void SearchWindow::initSignals()
void SearchWindow::loadDictionaries() void SearchWindow::loadDictionaries()
{ {
QStringList list; QStringList list;
eoskeygen::Dictionary tmpDict; antelopekeygen::Dictionary tmpDict;
std::string base_path(CONFIG_DICT_FULL_PATH); std::string base_path(CONFIG_DICT_FULL_PATH);
// Clear dictionary first. // Clear dictionary first.
@ -145,18 +146,20 @@ void SearchWindow::loadDictionaries()
} }
} }
void SearchWindow::onResult(const struct libeosio::ec_keypair* key, const struct eoskeygen::KeySearch::result& result) void SearchWindow::onResult(const struct libantelope::ec_keypair* key, const struct antelopekeygen::KeySearch::result& result)
{ {
int pos = (int) result.pos; int pos = (int) result.pos;
int len = (int) result.len; int len = (int) result.len;
QString pub = QString::fromStdString(libeosio::wif_pub_encode(key->pub)); libantelope::wif_codec_t codec = Settings::getKeyCodec();
QString pub = QString::fromStdString(libantelope::wif_pub_encode(key->pub, codec.pub));
int pub_prefix_len = (int) codec.pub.length();
QString mid = pub.mid(pos, len); QString mid = pub.mid(pos, len);
QString left = pub.left(pos); QString left = pub.left(pos);
QString right = pub.mid(pos + len, pub.size() - pos); QString right = pub.mid(pos + len, pub.size() - pos);
eoskeygen::Dictionary::search_result_t dict_res = m_dict.search(pub.toStdString()); antelopekeygen::Dictionary::search_result_t dict_res = m_dict.search(pub.toStdString());
QString out = "Public: " + pub.left(3); QString out = "Public: " + pub.left(pub_prefix_len);
for(int i = 3; i < pub.length(); ) { for(int i = pub_prefix_len; i < pub.length(); ) {
if (i == pos) { if (i == pos) {
out += "<font color=red>" + pub.mid(pos, len) + "</font>"; out += "<font color=red>" + pub.mid(pos, len) + "</font>";
@ -177,7 +180,7 @@ void SearchWindow::onResult(const struct libeosio::ec_keypair* key, const struct
out += pub[i++]; out += pub[i++];
} }
out += "<br/>Private: " + QString::fromStdString(libeosio::wif_priv_encode(key->secret)); out += "<br/>Private: " + QString::fromStdString(libantelope::wif_priv_encode(key->secret, codec.pvt));
// As this function could be called from a non-gui thread. we use signals. // As this function could be called from a non-gui thread. we use signals.
emit addOutput("<p>" + out + "</p>"); emit addOutput("<p>" + out + "</p>");
@ -195,12 +198,12 @@ void SearchWindow::search()
} }
const std::string& input = m_txt_search.text().toLocal8Bit().constData(); const std::string& input = m_txt_search.text().toLocal8Bit().constData();
eoskeygen::strlist_t list; antelopekeygen::strlist_t list;
if (m_leet_cb.isChecked()) { if (m_leet_cb.isChecked()) {
list = eoskeygen::l33twords(input); list = antelopekeygen::l33twords(input);
} else { } else {
list = eoskeygen::strlist::splitw(input); list = antelopekeygen::strlist::splitw(input);
} }
// Validate that we atleast got something to search for. // Validate that we atleast got something to search for.
@ -219,10 +222,10 @@ void SearchWindow::search()
m_ksearch.setThreadCount(m_num_threads.value()); m_ksearch.setThreadCount(m_num_threads.value());
#endif /* EOSIOKEYGEN_HAVE_THREADS */ #endif /* EOSIOKEYGEN_HAVE_THREADS */
QFuture<void> future = QtConcurrent::run(&m_ksearch, &eoskeygen::KeySearch::find, m_num_results.value()); QFuture<void> future = QtConcurrent::run(&m_ksearch, &antelopekeygen::KeySearch::find, m_num_results.value());
m_worker.setFuture(future); m_worker.setFuture(future);
m_status.setText("Searching for: " + QString::fromStdString(eoskeygen::strlist::join(list, ", "))); m_status.setText("Searching for: " + QString::fromStdString(antelopekeygen::strlist::join(list, ", ")));
} }
void SearchWindow::output(const std::string& html) void SearchWindow::output(const std::string& html)
@ -252,6 +255,9 @@ void SearchWindow::langFileAdd()
void SearchWindow::searchStarted() void SearchWindow::searchStarted()
{ {
// Set prefix for search
m_ksearch.setPrefix(Settings::getKeyCodec().pub);
m_btn_exec.setText("Cancel"); m_btn_exec.setText("Cancel");
m_txt_search.setEnabled(false); m_txt_search.setEnabled(false);

View file

@ -37,13 +37,13 @@
#include <eoskeygen/key_search.hpp> #include <eoskeygen/key_search.hpp>
#include "MultiSelect.hpp" #include "MultiSelect.hpp"
class SearchWindow : public QWidget, public eoskeygen::IKeySearchResult class SearchWindow : public QWidget, public antelopekeygen::IKeySearchResult
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit SearchWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags()); explicit SearchWindow(QWidget *parent = 0, Qt::WindowFlags flags = Qt::WindowFlags());
void onResult(const struct libeosio::ec_keypair* key, const struct eoskeygen::KeySearch::result& result); void onResult(const struct libantelope::ec_keypair* key, const struct antelopekeygen::KeySearch::result& result);
private : private :
void initSignals(); void initSignals();
@ -76,9 +76,9 @@ private:
// Search worker thread. // Search worker thread.
QFutureWatcher<void> m_worker; QFutureWatcher<void> m_worker;
eoskeygen::KeySearch m_ksearch; antelopekeygen::KeySearch m_ksearch;
eoskeygen::Dictionary m_dict; antelopekeygen::Dictionary m_dict;
// Widgets // Widgets
// ---------------- // ----------------

37
gui/src/Settings.cpp Normal file
View file

@ -0,0 +1,37 @@
/**
* MIT License
*
* Copyright (c) 2020-2021 EOS Sw/eden
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "Settings.hpp"
namespace priv {
libantelope::wif_codec_t key_format = libantelope::WIF_CODEC_K1;
} // namespace priv
void Settings::setKeyCodec(const libantelope::wif_codec_t& format) {
priv::key_format = format;
}
const libantelope::wif_codec_t& Settings::getKeyCodec() {
return priv::key_format;
}

36
gui/src/Settings.hpp Normal file
View file

@ -0,0 +1,36 @@
/**
* MIT License
*
* Copyright (c) 2020-2021 EOS Sw/eden
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef SETTINGS_H
#define SETTINGS_H
#include <libantelope/WIF.hpp>
namespace Settings
{
void setKeyCodec(const libantelope::wif_codec_t& format);
const libantelope::wif_codec_t& getKeyCodec();
};
#endif /* SEARCH_WINDOW_H */

2
lib/CLI11/CMakeLists.txt Normal file
View file

@ -0,0 +1,2 @@
set (LIBCLI11_INCLUDE ${CMAKE_CURRENT_LIST_DIR}/include)
set (LIBCLI11_LICENSE ${CMAKE_CURRENT_LIST_DIR}/LICENSE)

25
lib/CLI11/LICENSE Normal file
View file

@ -0,0 +1,25 @@
CLI11 2.2 Copyright (c) 2017-2022 University of Cincinnati, developed by Henry
Schreiner under NSF AWARD 1414736. All rights reserved.
Redistribution and use in source and binary forms of CLI11, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

File diff suppressed because it is too large Load diff