Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crypto, rpc: poc mnemonics #2739

Draft
wants to merge 6 commits into
base: development
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ add_library(gridcoin_util STATIC
gridcoin/cpid.cpp
gridcoin/gridcoin.cpp
gridcoin/mrc.cpp
gridcoin/mnemonics.cpp
gridcoin/project.cpp
gridcoin/protocol.cpp
gridcoin/quorum.cpp
Expand Down
4 changes: 4 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ GRIDCOIN_CORE_H = \
gridcoin/cpid.h \
gridcoin/gridcoin.h \
gridcoin/magnitude.h \
gridcoin/mnemonics.h \
gridcoin/mrc.h \
gridcoin/project.h \
gridcoin/protocol.h \
Expand Down Expand Up @@ -250,6 +251,7 @@ GRIDCOIN_CORE_CPP = addrdb.cpp \
gridcoin/contract/registry.cpp \
gridcoin/cpid.cpp \
gridcoin/gridcoin.cpp \
gridcoin/mnemonics.cpp \
gridcoin/mrc.cpp \
gridcoin/project.cpp \
gridcoin/protocol.cpp \
Expand Down Expand Up @@ -367,6 +369,8 @@ crypto_libgridcoin_crypto_base_a_SOURCES = \
crypto/aes.h \
crypto/chacha20.h \
crypto/chacha20.cpp \
crypto/chacha20poly1305.h \
crypto/chacha20poly1305.cpp \
crypto/common.h \
crypto/hmac_sha256.cpp \
crypto/hmac_sha256.h \
Expand Down
4 changes: 4 additions & 0 deletions src/arith_uint256.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,3 +276,7 @@ arith_uint320::arith_uint320(const uint256& b) {
std::memcpy(pn, b.data(), b.size());
}

// Explicit instantiation for base_uint<352> for mnemonic parsing.
template base_uint<352>& base_uint<352>::operator<<=(unsigned int);
template base_uint<352>& base_uint<352>::operator>>=(unsigned int);

4 changes: 4 additions & 0 deletions src/arith_uint256.h
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,10 @@ class base_uint
void SetHex(const std::string& str);
std::string ToString() const;

unsigned char* data() {
return reinterpret_cast<unsigned char*>(pn);
}

unsigned int size() const
{
return sizeof(pn);
Expand Down
1 change: 1 addition & 0 deletions src/crypto/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ set(LIBGRIDCOIN_CRYPTO gridcoin_crypto_base)
add_library(gridcoin_crypto_base STATIC
aes.cpp
chacha20.cpp
chacha20poly1305.cpp
hmac_sha256.cpp
hmac_sha512.cpp
poly1305.cpp
Expand Down
Loading
Loading