#include "hash.h"
#include "util.h"
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
Go to the source code of this file.
|
| #define | Ch(x, y, z) ((z) ^ ((x) & ((y) ^ (z)))) |
| |
| #define | Maj(x, y, z) (((x) & (y)) | ((z) & ((x) | (y)))) |
| |
| #define | Sigma0(x) (((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10)) |
| |
| #define | Sigma1(x) (((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7)) |
| |
| #define | sigma0(x) (((x) >> 7 | (x) << 25) ^ ((x) >> 18 | (x) << 14) ^ ((x) >> 3)) |
| |
| #define | sigma1(x) (((x) >> 17 | (x) << 15) ^ ((x) >> 19 | (x) << 13) ^ ((x) >> 10)) |
| |
| #define | Round(a, b, c, d, e, f, g, h, k, w) |
| |
|
| static void | secp256k1_sha256_initialize (secp256k1_sha256 *hash) |
| |
| static void | secp256k1_sha256_initialize_midstate (secp256k1_sha256 *hash, uint64_t bytes, const uint32_t state[8]) |
| |
| static void | secp256k1_sha256_transform_impl (uint32_t *s, const unsigned char *buf) |
| | Perform one SHA-256 transformation, processing 16 big endian 32-bit words. More...
|
| |
| static void | secp256k1_sha256_transform (uint32_t *state, const unsigned char *blocks64, size_t n_blocks) |
| |
| static void | secp256k1_hash_ctx_init (secp256k1_hash_ctx *hash_ctx) |
| |
| static void | secp256k1_sha256_write (const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, const unsigned char *data, size_t len) |
| |
| static void | secp256k1_sha256_finalize (const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, unsigned char *out32) |
| |
| static void | secp256k1_sha256_initialize_tagged (const secp256k1_hash_ctx *hash_ctx, secp256k1_sha256 *hash, const unsigned char *tag, size_t taglen) |
| |
| static void | secp256k1_sha256_clear (secp256k1_sha256 *hash) |
| |
| static void | secp256k1_hmac_sha256_initialize (const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, const unsigned char *key, size_t keylen) |
| |
| static void | secp256k1_hmac_sha256_write (const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, const unsigned char *data, size_t size) |
| |
| static void | secp256k1_hmac_sha256_finalize (const secp256k1_hash_ctx *hash_ctx, secp256k1_hmac_sha256 *hash, unsigned char *out32) |
| |
| static void | secp256k1_hmac_sha256_clear (secp256k1_hmac_sha256 *hash) |
| |
| static void | secp256k1_rfc6979_hmac_sha256_initialize (const secp256k1_hash_ctx *hash_ctx, secp256k1_rfc6979_hmac_sha256 *rng, const unsigned char *key, size_t keylen) |
| |
| static void | secp256k1_rfc6979_hmac_sha256_generate (const secp256k1_hash_ctx *hash_ctx, 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) |
| |
◆ Ch
| #define Ch |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| ((z) ^ ((x) & ((y) ^ (z)))) |
◆ Maj
| #define Maj |
( |
|
x, |
|
|
|
y, |
|
|
|
z |
|
) |
| (((x) & (y)) | ((z) & ((x) | (y)))) |
◆ 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)
Definition at line 24 of file hash_impl.h.
◆ Sigma0
| #define Sigma0 |
( |
|
x | ) |
(((x) >> 2 | (x) << 30) ^ ((x) >> 13 | (x) << 19) ^ ((x) >> 22 | (x) << 10)) |
◆ sigma0
| #define sigma0 |
( |
|
x | ) |
(((x) >> 7 | (x) << 25) ^ ((x) >> 18 | (x) << 14) ^ ((x) >> 3)) |
◆ Sigma1
| #define Sigma1 |
( |
|
x | ) |
(((x) >> 6 | (x) << 26) ^ ((x) >> 11 | (x) << 21) ^ ((x) >> 25 | (x) << 7)) |
◆ sigma1
| #define sigma1 |
( |
|
x | ) |
(((x) >> 17 | (x) << 15) ^ ((x) >> 19 | (x) << 13) ^ ((x) >> 10)) |
◆ secp256k1_hash_ctx_init()
◆ secp256k1_hmac_sha256_clear()
◆ secp256k1_hmac_sha256_finalize()
◆ secp256k1_hmac_sha256_initialize()
◆ secp256k1_hmac_sha256_write()
◆ secp256k1_rfc6979_hmac_sha256_clear()
◆ secp256k1_rfc6979_hmac_sha256_finalize()
◆ secp256k1_rfc6979_hmac_sha256_generate()
◆ secp256k1_rfc6979_hmac_sha256_initialize()
◆ secp256k1_sha256_clear()
◆ secp256k1_sha256_finalize()
◆ secp256k1_sha256_initialize()
◆ secp256k1_sha256_initialize_midstate()
| static void secp256k1_sha256_initialize_midstate |
( |
secp256k1_sha256 * |
hash, |
|
|
uint64_t |
bytes, |
|
|
const uint32_t |
state[8] |
|
) |
| |
|
static |
◆ secp256k1_sha256_initialize_tagged()
◆ secp256k1_sha256_transform()
| static void secp256k1_sha256_transform |
( |
uint32_t * |
state, |
|
|
const unsigned char * |
blocks64, |
|
|
size_t |
n_blocks |
|
) |
| |
|
static |
◆ secp256k1_sha256_transform_impl()
| static void secp256k1_sha256_transform_impl |
( |
uint32_t * |
s, |
|
|
const unsigned char * |
buf |
|
) |
| |
|
static |
Perform one SHA-256 transformation, processing 16 big endian 32-bit words.
Definition at line 51 of file hash_impl.h.
◆ secp256k1_sha256_write()