Changeset View
Changeset View
Standalone View
Standalone View
src/secp256k1/src/testrand_impl.h
/********************************************************************** | /********************************************************************** | ||||
* Copyright (c) 2013-2015 Pieter Wuille * | * Copyright (c) 2013-2015 Pieter Wuille * | ||||
* Distributed under the MIT software license, see the accompanying * | * Distributed under the MIT software license, see the accompanying * | ||||
* file COPYING or http://www.opensource.org/licenses/mit-license.php.* | * file COPYING or http://www.opensource.org/licenses/mit-license.php.* | ||||
**********************************************************************/ | **********************************************************************/ | ||||
#ifndef SECP256K1_TESTRAND_IMPL_H | #ifndef SECP256K1_TESTRAND_IMPL_H | ||||
#define SECP256K1_TESTRAND_IMPL_H | #define SECP256K1_TESTRAND_IMPL_H | ||||
#include <stdint.h> | #include <stdint.h> | ||||
#include <string.h> | #include <string.h> | ||||
#include "testrand.h" | #include "testrand.h" | ||||
#include "hash.h" | #include "hash.h" | ||||
static secp256k1_rfc6979_hmac_sha256_t secp256k1_test_rng; | static secp256k1_rfc6979_hmac_sha256 secp256k1_test_rng; | ||||
static uint32_t secp256k1_test_rng_precomputed[8]; | static uint32_t secp256k1_test_rng_precomputed[8]; | ||||
static int secp256k1_test_rng_precomputed_used = 8; | static int secp256k1_test_rng_precomputed_used = 8; | ||||
static uint64_t secp256k1_test_rng_integer; | static uint64_t secp256k1_test_rng_integer; | ||||
static int secp256k1_test_rng_integer_bits_left = 0; | static int secp256k1_test_rng_integer_bits_left = 0; | ||||
SECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16) { | SECP256K1_INLINE static void secp256k1_rand_seed(const unsigned char *seed16) { | ||||
secp256k1_rfc6979_hmac_sha256_initialize(&secp256k1_test_rng, seed16, 16); | secp256k1_rfc6979_hmac_sha256_initialize(&secp256k1_test_rng, seed16, 16); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |