Equity
Bitcoin Protocol Library
|
Namespaces | |
Ecc | |
ECC library. | |
Typedefs | |
typedef std::array< uint8_t, RIPEMD160_HASH_SIZE > | Ripemd160Hash |
A RIPEMD-160 hash. | |
typedef std::array< uint8_t, SHA1_HASH_SIZE > | Sha1Hash |
A SHA-1 hash. | |
typedef std::array< uint8_t, SHA256_HASH_SIZE > | Sha256Hash |
A SHA-256 hash. | |
typedef std::vector< Sha256Hash > | Sha256HashList |
A vector of SHA-256 hashes. | |
typedef std::array< uint8_t, CHECKSUM_SIZE > | Checksum |
A 4-byte checksum from the first 4 bytes of doubleSha256(input) | |
typedef std::array< uint8_t, SHA512_HASH_SIZE > | Sha512Hash |
A SHA-512 hash. | |
typedef std::vector< Sha512Hash > | Sha512HashList |
A vector of SHA-512 hashes. | |
Functions | |
Sha512Hash | hmacSha512 (uint8_t const *key, size_t keySize, uint8_t const *message, size_t messageSize) |
Computes an HMAC of the message using SHA-512. More... | |
std::vector< uint8_t > | pbkdf2HmacSha512 (uint8_t const *password, size_t passwordSize, uint8_t const *salt, size_t saltSize, int count, size_t size) |
Returns the result of a PBKDF2 operation using SHA-512. More... | |
std::vector< uint8_t > | pbkdf2HmacSha512 (std::vector< uint8_t > const &password, std::vector< uint8_t > const &salt, int count, size_t size) |
Returns the result of a PBKDF2 operation using SHA-512. More... | |
Ripemd160Hash | ripemd160 (std::vector< uint8_t > const &input) |
Computes the RIPEMD-160 hash of the input. | |
Ripemd160Hash | ripemd160 (uint8_t const *input, size_t length) |
Computes the RIPEMD-160 hash of the input. | |
template<size_t N> | |
Ripemd160Hash | ripemd160 (std::array< uint8_t, N > const &input) |
Computes the RIPEMD-160 hash of an std::array input. | |
Sha1Hash | sha1 (std::vector< uint8_t > const &input) |
Returns the SHA-1 hash of the input. | |
Sha1Hash | sha1 (uint8_t const *input, size_t length) |
Returns the SHA-1 hash of the input. | |
template<size_t N> | |
Sha1Hash | sha1 (std::array< uint8_t, N > const &input) |
Returns the SHA-1 hash of the input. | |
Sha256Hash | sha256 (std::vector< uint8_t > const &input) |
Computes the SHA-256 hash of the input. More... | |
Sha256Hash | sha256 (uint8_t const *input, size_t length) |
Computes the SHA-256 hash of the input. More... | |
Sha256Hash | doubleSha256 (std::vector< uint8_t > const &input) |
Computes the double-SHA-256 hash of the input. More... | |
Sha256Hash | doubleSha256 (uint8_t const *input, size_t length) |
Computes the double-SHA-256 hash of the input. More... | |
Checksum | checksum (std::vector< uint8_t > const &input) |
Computes the double-SHA-256 checksum of the input. More... | |
Checksum | checksum (uint8_t const *input, size_t length) |
Computes the double-SHA-256 checksum of the input. More... | |
template<size_t N> | |
Sha256Hash | sha256 (std::array< uint8_t, N > const &input) |
Computes the SHA-256 hash of an std::array of uint8_t. More... | |
Sha512Hash | sha512 (std::vector< uint8_t > const &input) |
Computes the SHA-512 hash of the input. More... | |
Sha512Hash | sha512 (uint8_t const *input, size_t length) |
Computes the SHA-512 hash of the input. More... | |
template<size_t N> | |
Sha512Hash | sha512 (std::array< uint8_t, N > const &input) |
Computes the SHA-512 hash of an std::array of uint8_t. More... | |
Variables | |
size_t const | RIPEMD160_HASH_SIZE = 160 / 8 |
The sized of a RIPEMD-160 hash in bytes. | |
size_t const | SHA1_HASH_SIZE = 160 / 8 |
Size of a SHA-1 HASH in bytes. | |
size_t const | SHA256_HASH_SIZE = 256 / 8 |
Size of a SHA-256 hash in bytes. | |
size_t const | CHECKSUM_SIZE = 4 |
Size of a checksum in bytes. | |
size_t const | SHA512_HASH_SIZE = 512 / 8 |
Size of a SHA-512 hash in bytes. | |
Crypto library.
The primary purpose of this library is to provide a generic interface wrapping a specific implementation.
Checksum Crypto::checksum | ( | std::vector< uint8_t > const & | input | ) |
Computes the double-SHA-256 checksum of the input.
input | data to hash |
Checksum Crypto::checksum | ( | uint8_t const * | input, |
size_t | length | ||
) |
Computes the double-SHA-256 checksum of the input.
input | data to hash |
length | length of the data |
Sha256Hash Crypto::doubleSha256 | ( | std::vector< uint8_t > const & | input | ) |
Computes the double-SHA-256 hash of the input.
input | data to hash |
Sha256Hash Crypto::doubleSha256 | ( | uint8_t const * | input, |
size_t | length | ||
) |
Computes the double-SHA-256 hash of the input.
input | data to hash |
length | length of the data |
Sha512Hash Crypto::hmacSha512 | ( | uint8_t const * | key, |
size_t | keySize, | ||
uint8_t const * | message, | ||
size_t | messageSize | ||
) |
Computes an HMAC of the message using SHA-512.
key | key |
keySize | size of the key |
message | message to generate the HMAC for |
messageSize | size of the message |
std::vector< uint8_t > Crypto::pbkdf2HmacSha512 | ( | uint8_t const * | password, |
size_t | passwordSize, | ||
uint8_t const * | salt, | ||
size_t | saltSize, | ||
int | count, | ||
size_t | size | ||
) |
Returns the result of a PBKDF2 operation using SHA-512.
password | password |
passwordSize | length of the password |
salt | salt |
saltSize | length of the salt |
count | number of iterations |
size | desired size of the returned value |
|
inline |
Returns the result of a PBKDF2 operation using SHA-512.
password | password |
salt | salt |
count | number of iterations |
size | desired size of the returned value |
Sha256Hash Crypto::sha256 | ( | std::vector< uint8_t > const & | input | ) |
Computes the SHA-256 hash of the input.
input | data to hash |
Sha256Hash Crypto::sha256 | ( | uint8_t const * | input, |
size_t | length | ||
) |
Computes the SHA-256 hash of the input.
input | data to hash |
length | length of the data |
Sha256Hash Crypto::sha256 | ( | std::array< uint8_t, N > const & | input | ) |
Computes the SHA-256 hash of an std::array of uint8_t.
input | data to hash |
Sha512Hash Crypto::sha512 | ( | std::vector< uint8_t > const & | input | ) |
Computes the SHA-512 hash of the input.
input | data to hash |
Sha512Hash Crypto::sha512 | ( | uint8_t const * | input, |
size_t | length | ||
) |
Computes the SHA-512 hash of the input.
input | data to hash |
length | length of the data |
Sha512Hash Crypto::sha512 | ( | std::array< uint8_t, N > const & | input | ) |
Computes the SHA-512 hash of an std::array of uint8_t.
input | data to hash |