1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 12:28:09 +00:00

ecdsa: rand -> rnd

This commit is contained in:
Pavol Rusnak 2017-04-02 02:52:50 +02:00
parent 900f4b0756
commit a8aacac6be
No known key found for this signature in database
GPG Key ID: 91F3B339B9A02A3D
2 changed files with 3 additions and 3 deletions

View File

@ -685,7 +685,7 @@ void init_rfc6979(const uint8_t *priv_key, const uint8_t *hash, rfc6979_state *s
}
// generate next number from deterministic random number generator
void generate_rfc6979(uint8_t rand[32], rfc6979_state *state)
void generate_rfc6979(uint8_t rnd[32], rfc6979_state *state)
{
uint8_t buf[32 + 1];
@ -694,7 +694,7 @@ void generate_rfc6979(uint8_t rand[32], rfc6979_state *state)
buf[sizeof(state->v)] = 0x00;
hmac_sha256(state->k, sizeof(state->k), buf, sizeof(state->v) + 1, state->k);
hmac_sha256(state->k, sizeof(state->k), state->v, sizeof(state->v), state->v);
memcpy(rand, buf, 32);
memcpy(rnd, buf, 32);
MEMSET_BZERO(buf, sizeof(buf));
}

View File

@ -92,7 +92,7 @@ int ecdsa_sig_to_der(const uint8_t *sig, uint8_t *der);
// Private
void init_rfc6979(const uint8_t *priv_key, const uint8_t *hash, rfc6979_state *rng);
void generate_rfc6979(uint8_t rand[32], rfc6979_state *rng);
void generate_rfc6979(uint8_t rnd[32], rfc6979_state *rng);
void generate_k_rfc6979(bignum256 *k, rfc6979_state *rng);
void generate_k_random(bignum256 *k, const bignum256 *prime);