@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
hash.c version 20160708 | |||||
hash.c version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -115,17 +115,10 @@ int hash_f(unsigned char *out, const unsigned char *in, const unsigned char *pub | |||||
unsigned char byte_addr[32]; | unsigned char byte_addr[32]; | ||||
unsigned int i; | unsigned int i; | ||||
setKeyAndMask(addr, 0); | |||||
printf("\naddr before: "); | |||||
for(i = 0; i< 8; i++){ | |||||
printf("%08x",addr[i]); | |||||
} | |||||
addr_to_byte(byte_addr, addr); | |||||
printf("\naddr after: "); | |||||
hexdump(byte_addr,32); | |||||
printf("\n"); | |||||
setKeyAndMask(addr, 0); | |||||
addr_to_byte(byte_addr, addr); | |||||
prf(key, byte_addr, pub_seed, n); | prf(key, byte_addr, pub_seed, n); | ||||
// Use MSB order | |||||
setKeyAndMask(addr, 1); | setKeyAndMask(addr, 1); | ||||
addr_to_byte(byte_addr, addr); | addr_to_byte(byte_addr, addr); | ||||
prf(bitmask, byte_addr, pub_seed, n); | prf(bitmask, byte_addr, pub_seed, n); | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
hash.h version 20160217 | |||||
hash.h version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -0,0 +1,58 @@ | |||||
/* | |||||
hash_address.c version 20160722 | |||||
Andreas Hülsing | |||||
Joost Rijneveld | |||||
Public domain. | |||||
*/ | |||||
#include <stdint.h> | |||||
void setLayerADRS(uint32_t adrs[8], uint32_t layer){ | |||||
adrs[0] = layer; | |||||
} | |||||
void setTreeADRS(uint32_t adrs[8], uint64_t tree){ | |||||
adrs[1] = (uint32_t) (tree >> 32); | |||||
adrs[2] = (uint32_t) tree; | |||||
} | |||||
void setType(uint32_t adrs[8], uint32_t type){ | |||||
adrs[3] = type; | |||||
int i; | |||||
for(i = 4; i < 8; i++){ | |||||
adrs[i] = 0; | |||||
} | |||||
} | |||||
void setKeyAndMask(uint32_t adrs[8], uint32_t keyAndMask){ | |||||
adrs[7] = keyAndMask; | |||||
} | |||||
// OTS | |||||
void setOTSADRS(uint32_t adrs[8], uint32_t ots){ | |||||
adrs[4] = ots; | |||||
} | |||||
void setChainADRS(uint32_t adrs[8], uint32_t chain){ | |||||
adrs[5] = chain; | |||||
} | |||||
void setHashADRS(uint32_t adrs[8], uint32_t hash){ | |||||
adrs[6] = hash; | |||||
} | |||||
// L-tree | |||||
void setLtreeADRS(uint32_t adrs[8], uint32_t ltree){ | |||||
adrs[4] = ltree; | |||||
} | |||||
// Hash Tree & L-tree | |||||
void setTreeHeight(uint32_t adrs[8], uint32_t treeHeight){ | |||||
adrs[5] = treeHeight; | |||||
} | |||||
void setTreeIndex(uint32_t adrs[8], uint32_t treeIndex){ | |||||
adrs[6] = treeIndex; | |||||
} |
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
hash_address.h version 20160707 | |||||
hash_address.h version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -38,7 +38,7 @@ int main() | |||||
// check pub_seed in SK | // check pub_seed in SK | ||||
for (i = 0; i < n; i++) { | for (i = 0; i < n; i++) { | ||||
if (pk[n+i] != sk[params->index_len+2*n+i]) printf("pk.pub_seed != sk.pub_seed %llu",i); | if (pk[n+i] != sk[params->index_len+2*n+i]) printf("pk.pub_seed != sk.pub_seed %llu",i); | ||||
if (pk[i] != sk[4+3*n+i]) printf("pk.root != sk.root %llu",i); | |||||
if (pk[i] != sk[params->index_len+3*n+i]) printf("pk.root != sk.root %llu",i); | |||||
} | } | ||||
printf("pk checked\n"); | printf("pk checked\n"); | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
wots.c version 20160217 | |||||
wots.c version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
wots.h version 20160217 | |||||
wots.h version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss.c version 20160217 | |||||
xmss.c version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss.h version 20160217 | |||||
xmss.h version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss_commons.c 20160217 | |||||
xmss_commons.c 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss_commons.h 20160217 | |||||
xmss_commons.h 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss_fast.c version 20160217 | |||||
xmss_fast.c version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
xmss_fast.h version 20160217 | |||||
xmss_fast.h version 20160722 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Joost Rijneveld | Joost Rijneveld | ||||
Public domain. | Public domain. | ||||