142 bytesSec pbkdf2(std::string
const& _pass,
bytes const& _salt,
unsigned _iterations,
unsigned _dkLen = 32);
145 bytesSec scrypt(std::string
const& _pass,
bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p,
unsigned _dkLen);
Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Origi...
void encryptSym(Secret const &_k, bytesConstRef _plain, bytes &o_cipher)
Symmetric encryption.
bytesSec decryptSymNoAuth(SecureFixedHash< 16 > const &_k, h128 const &_iv, bytesConstRef _cipher)
Decrypts payload with specified IV/ctr using AES128-CTR.
bytesSec pbkdf2(std::string const &_pass, bytes const &_salt, unsigned _iterations, unsigned _dkLen=32)
Derive key via PBKDF2.
bool decryptECIES(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypt payload using ECIES standard with AES128-CTR.
bool verify(Public const &_k, Signature const &_s, h256 const &_hash)
Verify signature.
Simple class that represents a "key pair".
Generator for non-repeating nonce material.
std::pair< bytes, h128 > encryptSymNoAuth(SecureFixedHash< 16 > const &_k, bytesConstRef _plain)
Encrypts payload with random IV/ctr using AES128-CTR.
std::vector< Secret > Secrets
A vector of secrets.
bool operator==(KeyPair const &_c) const
void encryptECIES(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypt payload using ECIES standard with AES128-CTR.
Secret const & secret() const
SignatureStruct(h256 const &_r, h256 const &_s, byte _v)
SignatureStruct()=default
Public toPublic(Secret const &_secret)
Convert a secret key into the public key equivalent.
bytesConstRef ref() const
bool decryptSym(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Symmetric decryption.
Public const & pub() const
Retrieve the public key.
bool operator!=(KeyPair const &_c) const
Address ZeroAddress
The zero address.
Public recover(Signature const &_sig, h256 const &_hash)
Recovers Public key from signed message hash.
std::vector< byte > bytes
h256 kdf(Secret const &_priv, h256 const &_hash)
Key derivation.
Fixed-size raw-byte array container type, with an API optimised for storing hashes.
SignatureStruct(Signature const &_s)
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >> u256
h520 Signature
A signature: 65 bytes: r: [0, 32), s: [32, 64), v: 64.
h160s Addresses
A vector of Ethereum addresses.
Address toAddress(Public const &_public)
Convert a public key to address.
Address const & address() const
Retrieve the associated address of the public key.
bytesSec scrypt(std::string const &_pass, bytes const &_salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen)
Derive key via Scrypt.
DEV_SIMPLE_EXCEPTION(BadHexCharacter)
Signature sign(Secret const &_k, h256 const &_hash)
Returns siganture of message hash.
bytesSec decryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _cipher)
Decrypts payload with specified IV/ctr using AES128-CTR.
std::vector< h160 > h160s
void encrypt(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypts plain text using Public key.
bool decrypt(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypts cipher using Secret key.
void agree(Secret const &_s, Public const &_r, Secret &o_s)
bytes encryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _plain)
Encrypts payload with specified IV/ctr using AES128-CTR.
bool isValid() const noexcept
std::unordered_set< h160 > AddressHash
A hash set of Ethereum addresses.