v06
Cette révision appartient à :
Parent
ddddfd9739
révision
9f512fa8dc
15
hash.c
15
hash.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
hash.c version 20160708
|
||||
hash.c version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
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 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);
|
||||
// Use MSB order
|
||||
|
||||
setKeyAndMask(addr, 1);
|
||||
addr_to_byte(byte_addr, addr);
|
||||
prf(bitmask, byte_addr, pub_seed, n);
|
||||
|
2
hash.h
2
hash.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
hash.h version 20160217
|
||||
hash.h version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
58
hash_address.c
Fichier normal
58
hash_address.c
Fichier normal
@ -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
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
@ -38,7 +38,7 @@ int main()
|
||||
// check pub_seed in SK
|
||||
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[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");
|
||||
|
||||
|
2
wots.c
2
wots.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
wots.c version 20160217
|
||||
wots.c version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
2
wots.h
2
wots.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
wots.h version 20160217
|
||||
wots.h version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
2
xmss.c
2
xmss.c
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss.c version 20160217
|
||||
xmss.c version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
2
xmss.h
2
xmss.h
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss.h version 20160217
|
||||
xmss.h version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss_commons.c 20160217
|
||||
xmss_commons.c 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss_commons.h 20160217
|
||||
xmss_commons.h 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss_fast.c version 20160217
|
||||
xmss_fast.c version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
xmss_fast.h version 20160217
|
||||
xmss_fast.h version 20160722
|
||||
Andreas Hülsing
|
||||
Joost Rijneveld
|
||||
Public domain.
|
||||
|
Chargement…
Référencer dans un nouveau ticket
Block a user