]> Git Repo - secp256k1.git/blame - src/hash.h
Implement endomorphism optimization for secp256k1_ecmult_const
[secp256k1.git] / src / hash.h
CommitLineData
b37fbc28
PW
1/**********************************************************************
2 * Copyright (c) 2014 Pieter Wuille *
3 * Distributed under the MIT software license, see the accompanying *
4 * file COPYING or http://www.opensource.org/licenses/mit-license.php.*
5 **********************************************************************/
6
7#ifndef _SECP256K1_HASH_
8#define _SECP256K1_HASH_
9
10#include <stdlib.h>
11#include <stdint.h>
12
13typedef struct {
14 uint32_t s[32];
ae55e850 15 uint32_t buf[16]; /* In big endian */
b37fbc28
PW
16 size_t bytes;
17} secp256k1_sha256_t;
18
19static void secp256k1_sha256_initialize(secp256k1_sha256_t *hash);
20static void secp256k1_sha256_write(secp256k1_sha256_t *hash, const unsigned char *data, size_t size);
21static void secp256k1_sha256_finalize(secp256k1_sha256_t *hash, unsigned char *out32);
22
23typedef struct {
24 secp256k1_sha256_t inner, outer;
25} secp256k1_hmac_sha256_t;
26
27static void secp256k1_hmac_sha256_initialize(secp256k1_hmac_sha256_t *hash, const unsigned char *key, size_t size);
28static void secp256k1_hmac_sha256_write(secp256k1_hmac_sha256_t *hash, const unsigned char *data, size_t size);
29static void secp256k1_hmac_sha256_finalize(secp256k1_hmac_sha256_t *hash, unsigned char *out32);
30
31typedef struct {
32 unsigned char v[32];
33 unsigned char k[32];
34 int retry;
35} secp256k1_rfc6979_hmac_sha256_t;
36
3e6f1e20 37static void secp256k1_rfc6979_hmac_sha256_initialize(secp256k1_rfc6979_hmac_sha256_t *rng, const unsigned char *key, size_t keylen);
b37fbc28
PW
38static void secp256k1_rfc6979_hmac_sha256_generate(secp256k1_rfc6979_hmac_sha256_t *rng, unsigned char *out, size_t outlen);
39static void secp256k1_rfc6979_hmac_sha256_finalize(secp256k1_rfc6979_hmac_sha256_t *rng);
40
41#endif
This page took 0.025495 seconds and 4 git commands to generate.