Fabcoin Core  0.16.2
P2P Digital Currency
Classes | Namespaces | Typedefs | Functions | Variables
Common.h File Reference
#include <mutex>
#include <libdevcore/Common.h>
#include <libdevcore/FixedHash.h>
#include <libdevcore/Exceptions.h>
Include dependency graph for Common.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dev::SignatureStruct
 
class  dev::KeyPair
 Simple class that represents a "key pair". More...
 
class  dev::crypto::Nonce
 Generator for non-repeating nonce material. More...
 

Namespaces

 dev
 Adapted from code found on http://stackoverflow.com/questions/180947/base64-decode-snippet-in-c Originally by RenĂ© Nyffenegger.
 
 dev::crypto
 
 dev::crypto::ecdh
 

Typedefs

using dev::Secret = SecureFixedHash< 32 >
 
using dev::Public = h512
 A public key: 64 bytes. More...
 
using dev::Signature = h520
 A signature: 65 bytes: r: [0, 32), s: [32, 64), v: 64. More...
 
using dev::Address = h160
 An Ethereum address: 20 bytes. More...
 
using dev::Addresses = h160s
 A vector of Ethereum addresses. More...
 
using dev::AddressHash = std::unordered_set< h160 >
 A hash set of Ethereum addresses. More...
 
using dev::Secrets = std::vector< Secret >
 A vector of secrets. More...
 

Functions

Public dev::toPublic (Secret const &_secret)
 Convert a secret key into the public key equivalent. More...
 
Address dev::toAddress (Public const &_public)
 Convert a public key to address. More...
 
Address dev::toAddress (Secret const &_secret)
 Convert a secret key into address of public key equivalent. More...
 
Address dev::toAddress (Address const &_from, u256 const &_nonce)
 
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::encryptSym (Secret const &_k, bytesConstRef _plain, bytes &o_cipher)
 Symmetric encryption. More...
 
bool dev::decryptSym (Secret const &_k, bytesConstRef _cipher, bytes &o_plaintext)
 Symmetric decryption. 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)
 Encrypt payload using ECIES standard with AES128-CTR. More...
 
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)
 Decrypt payload using ECIES standard with AES128-CTR. More...
 
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...
 
bytesSec dev::pbkdf2 (std::string const &_pass, bytes const &_salt, unsigned _iterations, unsigned _dkLen=32)
 Derive key via PBKDF2. More...
 
bytesSec dev::scrypt (std::string const &_pass, bytes const &_salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen)
 Derive key via Scrypt. More...
 
 dev::crypto::DEV_SIMPLE_EXCEPTION (InvalidState)
 
h256 dev::crypto::kdf (Secret const &_priv, h256 const &_hash)
 Key derivation. More...
 
void dev::crypto::ecdh::agree (Secret const &_s, Public const &_r, Secret &o_s)
 

Variables

Address dev::ZeroAddress = Address()
 The zero address. More...