Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
hash_impl.h File Reference
#include "hash.h"
#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
Include dependency graph for hash_impl.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define Ch(x, y, z)
#define Maj(x, y, z)
#define Sigma0(x)
#define Sigma1(x)
#define sigma0(x)
#define sigma1(x)
#define Round(a, b, c, d, e, f, g, h, k, w)

Functions

static void secp256k1_sha256_initialize (secp256k1_sha256 *hash)
static void secp256k1_sha256_transform (uint32_t *s, const unsigned char *buf)
 Perform one SHA-256 transformation, processing 16 big endian 32-bit words.
static void secp256k1_sha256_write (secp256k1_sha256 *hash, const unsigned char *data, size_t len)
static void secp256k1_sha256_finalize (secp256k1_sha256 *hash, unsigned char *out32)
static void secp256k1_sha256_initialize_tagged (secp256k1_sha256 *hash, const unsigned char *tag, size_t taglen)
static void secp256k1_sha256_clear (secp256k1_sha256 *hash)
static void secp256k1_hmac_sha256_initialize (secp256k1_hmac_sha256 *hash, const unsigned char *key, size_t keylen)
static void secp256k1_hmac_sha256_write (secp256k1_hmac_sha256 *hash, const unsigned char *data, size_t size)
static void secp256k1_hmac_sha256_finalize (secp256k1_hmac_sha256 *hash, unsigned char *out32)
static void secp256k1_hmac_sha256_clear (secp256k1_hmac_sha256 *hash)
static void secp256k1_rfc6979_hmac_sha256_initialize (secp256k1_rfc6979_hmac_sha256 *rng, const unsigned char *key, size_t keylen)
static void secp256k1_rfc6979_hmac_sha256_generate (secp256k1_rfc6979_hmac_sha256 *rng, unsigned char *out, size_t outlen)
static void secp256k1_rfc6979_hmac_sha256_finalize (secp256k1_rfc6979_hmac_sha256 *rng)
static void secp256k1_rfc6979_hmac_sha256_clear (secp256k1_rfc6979_hmac_sha256 *rng)

Macro Definition Documentation

◆ Ch

#define Ch ( x,
y,
z )
Value:
((z) ^ ((x) & ((y) ^ (z))))

Definition at line 17 of file hash_impl.h.

◆ Maj

#define Maj ( x,
y,
z )
Value:
(((x) & (y)) | ((z) & ((x) | (y))))

Definition at line 18 of file hash_impl.h.

◆ Round

#define Round ( a,
b,
c,
d,
e,
f,
g,
h,
k,
w )
Value:
do { \
uint32_t t1 = (h) + Sigma1(e) + Ch((e), (f), (g)) + (k) + (w); \
uint32_t t2 = Sigma0(a) + Maj((a), (b), (c)); \
(d) += t1; \
(h) = t1 + t2; \
} while(0)
#define Maj(x, y, z)
Definition hash_impl.h:18
#define Sigma0(x)
Definition hash_impl.h:19
#define Sigma1(x)
Definition hash_impl.h:20
#define Ch(x, y, z)
Definition hash_impl.h:17

Definition at line 24 of file hash_impl.h.

◆ Sigma0

#define Sigma0 ( x)
Value:
(((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10))

Definition at line 19 of file hash_impl.h.

◆ sigma0

#define sigma0 ( x)
Value:
(((x) >> 7 | (x) << 25) ^ ((x) >> 18 | (x) << 14) ^ ((x) >> 3))

Definition at line 21 of file hash_impl.h.

◆ Sigma1

#define Sigma1 ( x)
Value:
(((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7))

Definition at line 20 of file hash_impl.h.

◆ sigma1

#define sigma1 ( x)
Value:
(((x) >> 17 | (x) << 15) ^ ((x) >> 19 | (x) << 13) ^ ((x) >> 10))

Definition at line 22 of file hash_impl.h.

Function Documentation

◆ secp256k1_hmac_sha256_clear()

void secp256k1_hmac_sha256_clear ( secp256k1_hmac_sha256 * hash)
static

Definition at line 218 of file hash_impl.h.

Here is the call graph for this function:

◆ secp256k1_hmac_sha256_finalize()

void secp256k1_hmac_sha256_finalize ( secp256k1_hmac_sha256 * hash,
unsigned char * out32 )
static

Definition at line 210 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_hmac_sha256_initialize()

void secp256k1_hmac_sha256_initialize ( secp256k1_hmac_sha256 * hash,
const unsigned char * key,
size_t keylen )
static

Definition at line 178 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_hmac_sha256_write()

void secp256k1_hmac_sha256_write ( secp256k1_hmac_sha256 * hash,
const unsigned char * data,
size_t size )
static

Definition at line 206 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_rfc6979_hmac_sha256_clear()

void secp256k1_rfc6979_hmac_sha256_clear ( secp256k1_rfc6979_hmac_sha256 * rng)
static

Definition at line 287 of file hash_impl.h.

Here is the call graph for this function:

◆ secp256k1_rfc6979_hmac_sha256_finalize()

void secp256k1_rfc6979_hmac_sha256_finalize ( secp256k1_rfc6979_hmac_sha256 * rng)
static

Definition at line 283 of file hash_impl.h.

◆ secp256k1_rfc6979_hmac_sha256_generate()

void secp256k1_rfc6979_hmac_sha256_generate ( secp256k1_rfc6979_hmac_sha256 * rng,
unsigned char * out,
size_t outlen )
static

Definition at line 252 of file hash_impl.h.

Here is the call graph for this function:

◆ secp256k1_rfc6979_hmac_sha256_initialize()

void secp256k1_rfc6979_hmac_sha256_initialize ( secp256k1_rfc6979_hmac_sha256 * rng,
const unsigned char * key,
size_t keylen )
static

Definition at line 222 of file hash_impl.h.

Here is the call graph for this function:

◆ secp256k1_sha256_clear()

void secp256k1_sha256_clear ( secp256k1_sha256 * hash)
static

Definition at line 174 of file hash_impl.h.

Here is the call graph for this function:

◆ secp256k1_sha256_finalize()

void secp256k1_sha256_finalize ( secp256k1_sha256 * hash,
unsigned char * out32 )
static

Definition at line 145 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_sha256_initialize()

void secp256k1_sha256_initialize ( secp256k1_sha256 * hash)
static

Definition at line 31 of file hash_impl.h.

Here is the caller graph for this function:

◆ secp256k1_sha256_initialize_tagged()

void secp256k1_sha256_initialize_tagged ( secp256k1_sha256 * hash,
const unsigned char * tag,
size_t taglen )
static

Definition at line 163 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_sha256_transform()

void secp256k1_sha256_transform ( uint32_t * s,
const unsigned char * buf )
static

Perform one SHA-256 transformation, processing 16 big endian 32-bit words.

Definition at line 44 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ secp256k1_sha256_write()

void secp256k1_sha256_write ( secp256k1_sha256 * hash,
const unsigned char * data,
size_t len )
static

Definition at line 126 of file hash_impl.h.

Here is the call graph for this function:
Here is the caller graph for this function: