 |
Ethereum
PoC-8
The C++ Implementation of Ethereum
|
Go to the documentation of this file.
140 bytesSec pbkdf2(std::string
const& _pass,
bytes const& _salt,
unsigned _iterations,
unsigned _dkLen = 32);
143 bytesSec scrypt(std::string
const& _pass,
bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p,
unsigned _dkLen);
std::pair< bytes, h128 > encryptSymNoAuth(SecureFixedHash< 16 > const &_k, bytesConstRef _plain)
Encrypts payload with random IV/ctr using AES128-CTR.
bytesSec scrypt(std::string const &_pass, bytes const &_salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen)
Derive key via Scrypt.
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.
SignatureStruct()=default
bytes encryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _plain)
Encrypts payload with specified IV/ctr using AES128-CTR.
PublicCompressed toPublicCompressed(Secret const &_secret)
Convert a secret key into the public key in compressed format.
bytesSec pbkdf2(std::string const &_pass, bytes const &_salt, unsigned _iterations, unsigned _dkLen=32)
Derive key via PBKDF2.
bool decryptSym(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Symmetric decryption.
Generator for non-repeating nonce material. The Nonce class should only be used when a non-repeating ...
Secret const & secret() const
bool isValid() const noexcept
Public toPublic(Secret const &_secret)
Convert a secret key into the public key equivalent.
bool verify(Public const &_k, Signature const &_s, h256 const &_hash)
Verify signature.
Public recover(Signature const &_sig, h256 const &_hash)
Recovers Public key from signed message hash.
bool decryptECIES(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypt payload using ECIES standard with AES128-CTR.
std::vector< byte > bytes
static Secret get()
Returns the next nonce (might be read from a file).
SignatureStruct(Signature const &_s)
bool operator!=(KeyPair const &_c) const
Address const & address() const
Retrieve the associated address of the public key.
Address toAddress(Public const &_public)
Convert a public key to address.
bool agree(Secret const &_s, Public const &_r, Secret &o_s) noexcept
bytesSec decryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _cipher)
Decrypts payload with specified IV/ctr using AES128-CTR.
Signature sign(Secret const &_k, h256 const &_hash)
Returns siganture of message hash.
bytes kdf(Secret const &_z, bytes const &_s1, unsigned kdByteLen)
void encryptECIES(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypt payload using ECIES standard with AES128-CTR.
Public const & pub() const
Retrieve the public key.
std::vector< Secret > Secrets
A vector of secrets.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
DEV_SIMPLE_EXCEPTION(BadHexCharacter)
SecureFixedHash< 32 > Secret
bool operator==(KeyPair const &_c) const
void encrypt(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypts plain text using Public key.
SignatureStruct(h256 const &_r, h256 const &_s, byte _v)
bytesConstRef ref() const
FixedHash< 33 > PublicCompressed
bool decrypt(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Decrypts cipher using Secret key.