int xmss_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen, const xmss_params *params)
int xmss_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen, const xmss_params *params)
@@ -474,8 +474,8 @@ int xmss_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig
*/
*/
int xmss_sign_open(unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk, const xmss_params *params)
int xmss_sign_open(unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk, const xmss_params *params)
{
{
uint n = params->n;
uint m = params->m;
unsigned int n = params->n;
unsigned int m = params->m;
unsigned long long i, m_len;
unsigned long long i, m_len;
unsigned long idx=0;
unsigned long idx=0;
@@ -564,9 +564,9 @@ fail:
*/
*/
int xmssmt_keypair(unsigned char *pk, unsigned char *sk, xmssmt_params *params)
int xmssmt_keypair(unsigned char *pk, unsigned char *sk, xmssmt_params *params)
int xmssmt_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen, const xmssmt_params *params)
int xmssmt_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen, const xmssmt_params *params)
{
{
uint n = params->n;
uint m = params->m;
uint tree_h = params->xmss_par.h;
uint idx_len = params->index_len;
unsigned int n = params->n;
unsigned int m = params->m;
unsigned int tree_h = params->xmss_par.h;
unsigned int idx_len = params->index_len;
unsigned long long idx_tree;
unsigned long long idx_tree;
unsigned long long idx_leaf;
unsigned long long idx_leaf;
unsigned long long i;
unsigned long long i;
@@ -686,7 +686,7 @@ int xmssmt_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *s
*sig_msg_len += tree_h*n;
*sig_msg_len += tree_h*n;
// Now loop over remaining layers...
// Now loop over remaining layers...
uint j;
unsigned int j;
for(j = 1; j < params->d; j++){
for(j = 1; j < params->d; j++){
// Prepare Address
// Prepare Address
idx_leaf = (idx_tree & ((1 << tree_h)-1));
idx_leaf = (idx_tree & ((1 << tree_h)-1));
@@ -723,11 +723,11 @@ int xmssmt_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *s
*/
*/
int xmssmt_sign_open(unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk, const xmssmt_params *params)
int xmssmt_sign_open(unsigned char *msg, unsigned long long *msglen, const unsigned char *sig_msg, unsigned long long sig_msg_len, const unsigned char *pk, const xmssmt_params *params)