@@ -1,4 +1,9 @@ | |||||
#include "params.h" | |||||
/* | |||||
hash.c version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#include "prg.h" | #include "prg.h" | ||||
#include <stddef.h> | #include <stddef.h> | ||||
@@ -1,8 +1,12 @@ | |||||
/* | |||||
hash.h version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#ifndef HASH_H | #ifndef HASH_H | ||||
#define HASH_H | #define HASH_H | ||||
#include "params.h" | |||||
int prf_m(unsigned char *out, const unsigned char *in, size_t inlen, const unsigned char *key, int keylen); | int prf_m(unsigned char *out, const unsigned char *in, size_t inlen, const unsigned char *key, int keylen); | ||||
int hash_m(unsigned char *out,const unsigned char *in,unsigned long long inlen, const unsigned char *key, const int keylen, const int m); | int hash_m(unsigned char *out,const unsigned char *in,unsigned long long inlen, const unsigned char *key, const int keylen, const int m); | ||||
int hash_2n_n(unsigned char *out,const unsigned char *in, const unsigned char *pub_seed, unsigned char addr[16], const int n); | int hash_2n_n(unsigned char *out,const unsigned char *in, const unsigned char *pub_seed, unsigned char addr[16], const int n); | ||||
@@ -1,13 +0,0 @@ | |||||
#define TREE_HEIGHT 10 | |||||
#define WOTS_LOGW 4 // -> w = 16 | |||||
#define SK_RAND_SEED_BYTES 32 | |||||
#define MESSAGE_HASH_SEED_BYTES 32 | |||||
#define WOTS_W (1 << WOTS_LOGW) | |||||
#define WOTS_L1 ((256+WOTS_LOGW-1)/WOTS_LOGW) | |||||
#define WOTS_L 67 // for WOTS_W == 16 | |||||
#define WOTS_LOG_L 7 // for WOTS_W == 16 | |||||
#define WOTS_SIGBYTES (WOTS_L*HASH_BYTES) | |||||
#define HASH_BYTES 32 |
@@ -1,5 +1,10 @@ | |||||
/* | |||||
prg.c version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#include "chacha.h" | #include "chacha.h" | ||||
//#include "params.h" | |||||
#include "prg.h" | #include "prg.h" | ||||
const unsigned char zero_nonce[12] = {0}; | const unsigned char zero_nonce[12] = {0}; | ||||
@@ -1,3 +1,9 @@ | |||||
/* | |||||
prg.h version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#ifndef PRG_H | #ifndef PRG_H | ||||
#define PRG_H | #define PRG_H | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
@@ -1,3 +1,7 @@ | |||||
/* | |||||
This code was taken from the SPHINCS reference implementation and is public domain. | |||||
*/ | |||||
#include <sys/types.h> | #include <sys/types.h> | ||||
#include <sys/stat.h> | #include <sys/stat.h> | ||||
#include <fcntl.h> | #include <fcntl.h> | ||||
@@ -1,7 +1,6 @@ | |||||
#include <stdio.h> | #include <stdio.h> | ||||
#include "../wots.h" | #include "../wots.h" | ||||
#include "../randombytes.h" | #include "../randombytes.h" | ||||
#include "../params.h" | |||||
static void hexdump(unsigned char *a, size_t len) | static void hexdump(unsigned char *a, size_t len) | ||||
{ | { | ||||
@@ -1,5 +1,5 @@ | |||||
/* | /* | ||||
wots.c version 2015xxxx | |||||
wots.c version 20150811 | |||||
Andreas Hülsing | Andreas Hülsing | ||||
Public domain. | Public domain. | ||||
*/ | */ | ||||
@@ -1,7 +1,12 @@ | |||||
/* | |||||
wots.h version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#ifndef WOTS_H | #ifndef WOTS_H | ||||
#define WOTS_H | #define WOTS_H | ||||
#include "params.h" | |||||
/** | /** | ||||
* WOTS parameter set | * WOTS parameter set | ||||
* | * | ||||
@@ -1,3 +1,9 @@ | |||||
/* | |||||
xmss.c version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#include "xmss.h" | #include "xmss.h" | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <string.h> | #include <string.h> | ||||
@@ -1,3 +1,9 @@ | |||||
/* | |||||
xmss.h version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#include "wots.h" | #include "wots.h" | ||||
#ifndef XMSS_H | #ifndef XMSS_H | ||||
@@ -1,3 +1,9 @@ | |||||
/* | |||||
xmss_commons.c version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#include "xmss_commons.h" | #include "xmss_commons.h" | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <stdio.h> | #include <stdio.h> | ||||
@@ -1,3 +1,8 @@ | |||||
/* | |||||
xmss_commons.h version 20150811 | |||||
Andreas Hülsing | |||||
Public domain. | |||||
*/ | |||||
#ifndef XMSS_COMMONS_H | #ifndef XMSS_COMMONS_H | ||||
#define XMSS_COMMONS_H | #define XMSS_COMMONS_H | ||||
@@ -1,3 +1,8 @@ | |||||
/* | |||||
This code was taken from the SPHINCS reference implementation. | |||||
Public domain. | |||||
*/ | |||||
#include "zerobytes.h" | #include "zerobytes.h" | ||||
unsigned char *zerobytes(unsigned char *r,unsigned long long n) | unsigned char *zerobytes(unsigned char *r,unsigned long long n) | ||||