TARAXA
Common.h File Reference
#include <libdevcore/Address.h>
#include <libdevcore/Common.h>
#include <libdevcore/Exceptions.h>
#include <libdevcore/FixedHash.h>
#include <mutex>
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dev::SignatureStruct
 
struct  dev::CompactSignatureStruct
 
class  dev::KeyPair
 
class  dev::crypto::Nonce
 Generator for non-repeating nonce material. The Nonce class should only be used when a non-repeating nonce is required and, in its current form, not recommended for signatures. This is primarily because the key-material for signatures is encrypted on disk whereas the seed for Nonce is not. Thus, Nonce's primary intended use at this time is for networking where the key is also stored in plaintext. More...
 

Namespaces

 dev
 
 dev::crypto
 
 dev::crypto::ecdh
 
 dev::crypto::ecies
 

Typedefs

using dev::Secret = SecureFixedHash< 32 >
 
using dev::Public = h512
 
using dev::PublicCompressed = FixedHash< 33 >
 
using dev::Signature = h520
 
using dev::CompactSignature = h512
 
using dev::Secrets = std::vector< Secret >
 A vector of secrets. More...
 

Functions

h512 dev::toCompact (const Signature &_s)
 
Public dev::toPublic (Secret const &_secret)
 Convert a secret key into the public key equivalent. More...
 
Public dev::toPublic (PublicCompressed const &_publicCompressed)
 Convert a compressed public key into the uncompressed equivalent. More...
 
PublicCompressed dev::toPublicCompressed (Secret const &_secret)
 Convert a secret key into the public key in compressed format. More...
 
Address dev::toAddress (Public const &_public)
 Convert a public key to address. More...
 
Address dev::toAddress (Secret const &_secret)
 
void dev::encrypt (Public const &_k, bytesConstRef _plain, bytes &o_cipher)
 Encrypts plain text using Public key. More...
 
bool dev::decrypt (Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
 Decrypts cipher using Secret key. More...
 
void dev::encryptECIES (Public const &_k, bytesConstRef _plain, bytes &o_cipher)
 Encrypt payload using ECIES standard with AES128-CTR. More...
 
void dev::encryptECIES (Public const &_k, bytesConstRef _sharedMacData, bytesConstRef _plain, bytes &o_cipher)
 
bool dev::decryptECIES (Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
 Decrypt payload using ECIES standard with AES128-CTR. More...
 
bool dev::decryptECIES (Secret const &_k, bytesConstRef _sharedMacData, bytesConstRef _cipher, bytes &o_plaintext)
 
std::pair< bytes, h128dev::encryptSymNoAuth (SecureFixedHash< 16 > const &_k, bytesConstRef _plain)
 Encrypts payload with random IV/ctr using AES128-CTR. More...
 
bytes dev::encryptAES128CTR (bytesConstRef _k, h128 const &_iv, bytesConstRef _plain)
 Encrypts payload with specified IV/ctr using AES128-CTR. More...
 
bytesSec dev::decryptAES128CTR (bytesConstRef _k, h128 const &_iv, bytesConstRef _cipher)
 Decrypts payload with specified IV/ctr using AES128-CTR. More...
 
bytes dev::encryptSymNoAuth (SecureFixedHash< 16 > const &_k, h128 const &_iv, bytesConstRef _plain)
 Encrypts payload with specified IV/ctr using AES128-CTR. More...
 
bytes dev::encryptSymNoAuth (SecureFixedHash< 32 > const &_k, h128 const &_iv, bytesConstRef _plain)
 
bytesSec dev::decryptSymNoAuth (SecureFixedHash< 16 > const &_k, h128 const &_iv, bytesConstRef _cipher)
 Decrypts payload with specified IV/ctr using AES128-CTR. More...
 
bytesSec dev::decryptSymNoAuth (SecureFixedHash< 32 > const &_k, h128 const &_iv, bytesConstRef _cipher)
 
Public dev::recover (Signature const &_sig, h256 const &_hash)
 Recovers Public key from signed message hash. More...
 
Signature dev::sign (Secret const &_k, h256 const &_hash)
 Returns siganture of message hash. More...
 
bool dev::verify (Public const &_k, Signature const &_s, h256 const &_hash)
 Verify signature. More...
 
bool dev::verify (PublicCompressed const &_key, h512 const &_signature, h256 const &_hash)
 
 dev::crypto::DEV_SIMPLE_EXCEPTION (InvalidState)
 
h256 dev::crypto::kdf (Secret const &_priv, h256 const &_hash)
 Key derivation. More...
 
bool dev::crypto::ecdh::agree (Secret const &_s, Public const &_r, Secret &o_s) noexcept
 
bytes dev::crypto::ecies::kdf (Secret const &_z, bytes const &_s1, unsigned kdByteLen)