fixed bug in address for WOTS Key
This commit is contained in:
parent
9d9b782ff9
commit
077e57f60e
2
hash.c
2
hash.c
@ -16,7 +16,7 @@ Public domain.
|
||||
#define SET_KEY_BIT(a,b) (a[15] = (a[15] & 253) | (b << 1))
|
||||
#define SET_BLOCK_BIT(a,b) (a[15] = (a[15] & 254) | b)
|
||||
|
||||
#define WOTS_SELECT_KEY(a) (a[15] = (a[15] & 253) | 1)
|
||||
#define WOTS_SELECT_KEY(a) (a[15] = (a[15] & 254) | 1)
|
||||
#define WOTS_SELECT_BLOCK(a) (a[15] = (a[15] & 254) | 0)
|
||||
|
||||
/**
|
||||
|
8
prg.c
8
prg.c
@ -74,14 +74,6 @@ void prg_with_counter(unsigned char *r, const unsigned char *key, unsigned int n
|
||||
{
|
||||
if(n == 64)
|
||||
{
|
||||
// for(i = 0; i < 12; i++)
|
||||
// {
|
||||
// nonce[i] = addr[i];
|
||||
// }
|
||||
// uint32_t counter;
|
||||
// counter = (((uint32_t)addr[12]) << 24)|(((uint32_t)addr[13]) << 16)|(((uint32_t)addr[14]) << 8)|addr[15];
|
||||
// // TODO: WRONG! Uses only 32 byte of key. However, does not compile with HMAC-SHA512
|
||||
// CRYPTO_chacha_20_keystream(r, rlen, key, nonce, counter);
|
||||
unsigned int length;
|
||||
HMAC(EVP_sha512(), key, n, addr, 16, r, &length);
|
||||
if(length != 64)
|
||||
|
Loading…
Reference in New Issue
Block a user