#include #include #include "../xmss_fast.h" #define MLEN 3491 #define SIGNATURES 1024 unsigned char mi[MLEN]; unsigned long long smlen; unsigned long long mlen; int main() { int r; unsigned long long i,j; int m = 32; int n = 32; int h = 20; int d = 5; int w = 16; int k = 2; xmssmt_params p; xmssmt_params *params = &p; if (xmssmt_set_params(params, m, n, h, d, w, k)) { return 1; } unsigned char stack[2*d * (h-k-1)*n]; unsigned char stacklevels[2*d * (h-k-1)]; unsigned char auth[2*d * h*n]; unsigned char keep[2*d * (h >> 1)*n]; treehash_inst treehash[2*d * (h-k)]; unsigned char th_nodes[2*d * (h-k)*n]; unsigned char retain[2*d * ((1 << k) - k - 1)*n]; unsigned char wots_sigs[d * params->xmss_par.wots_par.keysize]; bds_state states[2*d]; // first d are 'regular' states, second d are 'next' for (i = 0; i < 2*d; i++) { for(j=0;j> 1)*n, treehash + i*(h-k), retain + i*((1 << k) - k - 1)*n, 0 ); } unsigned char sk[(params->index_len+2*n+m)]; unsigned char pk[2*n]; unsigned long long signature_length = params->index_len + m + (d*params->xmss_par.wots_par.keysize) + h*n; unsigned char mo[MLEN+signature_length]; unsigned char sm[MLEN+signature_length]; FILE *urandom = fopen("/dev/urandom", "r"); for(i=0;iindex_len+m+n+i]) printf("pk.pub_seed != sk.pub_seed %llu",i); } printf("pk checked\n"); unsigned int idx_len = params->index_len; // check index unsigned long long idx = 0; for(i = 0; i < idx_len; i++){ idx |= ((unsigned long long)sk[i]) << 8*(idx_len - 1 - i); } if(idx) printf("\nidx != 0: %llu\n",idx); for(i=0;i