46 operator Signature()
const {
return *
reinterpret_cast<h520 const*
>(
this); }
bool operator==(KeyPair const &_c) const
Definition: Common.h:175
Secret const & secret() const
Definition: Common.h:167
Public const & pub() const
Retrieve the public key.
Definition: Common.h:170
Address m_address
Definition: Common.h:181
Public m_public
Definition: Common.h:180
Address const & address() const
Retrieve the associated address of the public key.
Definition: Common.h:173
bool operator!=(KeyPair const &_c) const
Definition: Common.h:176
Secret m_secret
Definition: Common.h:179
bytesConstRef ref() const
Definition: FixedHash.h:392
Generator for non-repeating nonce material. The Nonce class should only be used when a non-repeating ...
Definition: Common.h:200
static Secret get()
Returns the next nonce (might be read from a file).
Definition: Common.h:203
Secret m_value
Definition: Common.h:215
std::mutex x_value
Definition: Common.h:214
uint8_t byte
Definition: Common.h:25
bool agree(Secret const &_s, Public const &_r, Secret &o_s) noexcept
Definition: Common.cpp:276
bytes kdf(Secret const &_z, bytes const &_s1, unsigned kdByteLen)
Definition: Common.cpp:292
FixedHash< 33 > PublicCompressed
Definition: Common.h:27
SecureFixedHash< 32 > Secret
Definition: Common.h:19
h512 CompactSignature
Definition: Common.h:36
h520 Signature
Definition: Common.h:31
Address toAddress(Public const &_public)
Convert a public key to address.
Definition: Common.cpp:95
Public recover(Signature const &_sig, h256 const &_hash)
Recovers Public key from signed message hash.
Definition: Common.cpp:169
h512 toCompact(const Signature &_s)
Definition: Common.cpp:214
h512 Public
Definition: Common.h:23
bytesSec decryptSymNoAuth(SecureFixedHash< 16 > const &_k, h128 const &_iv, bytesConstRef _cipher)
Decrypts payload with specified IV/ctr using AES128-CTR.
Definition: Common.h:131
bool verify(Public const &_k, Signature const &_s, h256 const &_hash)
Verify signature.
Definition: Common.cpp:220
DEV_SIMPLE_EXCEPTION(BadHexCharacter)
bool decryptECIES(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypt payload using ECIES standard with AES128-CTR.
Definition: Common.cpp:123
bytes encryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _plain)
Encrypts payload with specified IV/ctr using AES128-CTR.
Definition: Common.cpp:139
bytesSec decryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _cipher)
Decrypts payload with specified IV/ctr using AES128-CTR.
Definition: Common.cpp:154
FixedHash< 65 > h520
Definition: FixedHash.h:451
std::vector<::byte > bytes
Definition: Common.h:46
Public toPublic(Secret const &_secret)
Convert a secret key into the public key equivalent.
Definition: Common.cpp:57
void encrypt(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypts plain text using Public key.
Definition: Common.cpp:99
Signature sign(Secret const &_k, h256 const &_hash)
Returns siganture of message hash.
Definition: Common.cpp:195
bool decrypt(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypts cipher using Secret key.
Definition: Common.cpp:105
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
Definition: Common.h:98
std::pair< bytes, h128 > encryptSymNoAuth(SecureFixedHash< 16 > const &_k, bytesConstRef _plain)
Encrypts payload with random IV/ctr using AES128-CTR.
Definition: Common.cpp:134
PublicCompressed toPublicCompressed(Secret const &_secret)
Convert a secret key into the public key in compressed format.
Definition: Common.cpp:85
FixedHash< 32 > h256
Definition: FixedHash.h:453
std::vector< Secret > Secrets
A vector of secrets.
Definition: Common.h:75
void encryptECIES(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypt payload using ECIES standard with AES128-CTR.
Definition: Common.cpp:113
FixedHash< 64 > h512
Definition: FixedHash.h:452
std::hash for asio::adress
Definition: FixedHash.h:483
CompactSignatureStruct(h256 const &_r, h256 const &_vs)
Definition: Common.h:64
CompactSignatureStruct()=default
CompactSignatureStruct(const Signature &_s)
Definition: Common.h:63
CompactSignatureStruct(const CompactSignature &_s)
Definition: Common.h:62
h256 r
Definition: Common.h:51
SignatureStruct(Signature const &_s)
Definition: Common.h:40
SignatureStruct(const CompactSignature &_s)
Definition: Common.h:42
bool isValid() const noexcept
Definition: Common.cpp:43
SignatureStruct()=default
h256 s
Definition: Common.h:52
SignatureStruct(h256 const &_r, h256 const &_s, byte _v)
Definition: Common.h:41
::byte v
Definition: Common.h:53