130 bytesSec pbkdf2(std::string
const& _pass,
bytes const& _salt,
unsigned _iterations,
unsigned _dkLen = 32);
133 bytesSec scrypt(std::string
const& _pass,
bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p,
unsigned _dkLen);
bytesConstRef ref() const
bool agree(Secret const &_s, Public const &_r, Secret &o_s) noexcept
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.
Generator for non-repeating nonce material. The Nonce class should only be used when a non-repeating ...
secure_vector< byte > bytesSec
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.
SecureFixedHash< 32 > Secret
void encryptECIES(Public const &_k, bytesConstRef _plain, bytes &o_cipher)
Encrypt payload using ECIES standard with AES128-CTR.
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.
bool decryptSym(Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
Symmetric decryption.
Secret const & secret() const
bytes kdf(Secret const &_z, bytes const &_s1, unsigned kdByteLen)
Public recover(Signature const &_sig, h256 const &_hash)
Recovers Public key from signed message hash.
std::vector< byte > bytes
bool operator!=(KeyPair const &_c) const
SignatureStruct(Signature const &_s)
Address toAddress(Public const &_public)
Convert a public key to address.
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.
boost::multiprecision::number< boost::multiprecision::cpp_int_backend< 256, 256, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void > > u256
bool operator==(KeyPair const &_c) const
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.
Address const & address() const
Retrieve the associated address of the public key.
bytes encryptAES128CTR(bytesConstRef _k, h128 const &_iv, bytesConstRef _plain)
Encrypts payload with specified IV/ctr using AES128-CTR.
Public const & pub() const
Retrieve the public key.
bool isValid() const noexcept