fixed bug in address for WOTS Key

This commit is contained in:
Andreas 2015-11-09 13:36:06 +01:00
parent 9d9b782ff9
commit 077e57f60e
2 changed files with 1 additions and 9 deletions

2
hash.c
View File

@ -16,7 +16,7 @@ Public domain.
#define SET_KEY_BIT(a,b) (a[15] = (a[15] & 253) | (b << 1)) #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 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) #define WOTS_SELECT_BLOCK(a) (a[15] = (a[15] & 254) | 0)
/** /**

8
prg.c
View File

@ -74,14 +74,6 @@ void prg_with_counter(unsigned char *r, const unsigned char *key, unsigned int n
{ {
if(n == 64) 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; unsigned int length;
HMAC(EVP_sha512(), key, n, addr, 16, r, &length); HMAC(EVP_sha512(), key, n, addr, 16, r, &length);
if(length != 64) if(length != 64)