Andreas há 8 anos
ascendente
cometimento
9f512fa8dc
13 ficheiros alterados com 73 adições e 22 eliminações
  1. +4
    -11
      hash.c
  2. +1
    -1
      hash.h
  3. +58
    -0
      hash_address.c
  4. +1
    -1
      hash_address.h
  5. +1
    -1
      test/test_xmssmt.c
  6. +1
    -1
      wots.c
  7. +1
    -1
      wots.h
  8. +1
    -1
      xmss.c
  9. +1
    -1
      xmss.h
  10. +1
    -1
      xmss_commons.c
  11. +1
    -1
      xmss_commons.h
  12. +1
    -1
      xmss_fast.c
  13. +1
    -1
      xmss_fast.h

+ 4
- 11
hash.c Ver ficheiro

@@ -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);


+ 1
- 1
hash.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
hash.h version 20160217
hash.h version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 58
- 0
hash_address.c Ver ficheiro

@@ -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
- 1
hash_address.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
hash_address.h version 20160707
hash_address.h version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
test/test_xmssmt.c Ver ficheiro

@@ -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");



+ 1
- 1
wots.c Ver ficheiro

@@ -1,5 +1,5 @@
/*
wots.c version 20160217
wots.c version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
wots.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
wots.h version 20160217
wots.h version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss.c Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss.c version 20160217
xmss.c version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss.h version 20160217
xmss.h version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss_commons.c Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss_commons.c 20160217
xmss_commons.c 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss_commons.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss_commons.h 20160217
xmss_commons.h 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss_fast.c Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss_fast.c version 20160217
xmss_fast.c version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


+ 1
- 1
xmss_fast.h Ver ficheiro

@@ -1,5 +1,5 @@
/*
xmss_fast.h version 20160217
xmss_fast.h version 20160722
Andreas Hülsing
Joost Rijneveld
Public domain.


Carregando…
Cancelar
Guardar