2015-08-11 11:23:30 +01:00
|
|
|
/*
|
2016-09-22 15:31:41 +01:00
|
|
|
xmss.h version 20160722
|
2015-08-11 11:23:30 +01:00
|
|
|
Andreas Hülsing
|
2016-02-16 15:31:18 +00:00
|
|
|
Joost Rijneveld
|
2015-08-11 11:23:30 +01:00
|
|
|
Public domain.
|
|
|
|
*/
|
|
|
|
|
2015-08-11 11:08:27 +01:00
|
|
|
#include "wots.h"
|
|
|
|
|
|
|
|
#ifndef XMSS_H
|
|
|
|
#define XMSS_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Generates a XMSS key pair for a given parameter set.
|
2016-07-11 10:15:16 +01:00
|
|
|
* Format sk: [(32bit) idx || SK_SEED || SK_PRF || PUB_SEED || root]
|
2015-08-11 11:08:27 +01:00
|
|
|
* Format pk: [root || PUB_SEED] omitting algo oid.
|
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
int xmss_keypair(unsigned char *pk, unsigned char *sk);
|
2015-08-11 11:08:27 +01:00
|
|
|
/**
|
|
|
|
* Signs a message.
|
2017-06-02 16:29:14 +01:00
|
|
|
* Returns
|
2015-08-11 11:08:27 +01:00
|
|
|
* 1. an array containing the signature followed by the message AND
|
|
|
|
* 2. an updated secret key!
|
2017-06-02 16:29:14 +01:00
|
|
|
*
|
2015-08-11 11:08:27 +01:00
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
int xmss_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen);
|
2015-08-11 11:08:27 +01:00
|
|
|
/**
|
|
|
|
* Verifies a given message signature pair under a given public key.
|
2017-06-02 16:29:14 +01:00
|
|
|
*
|
|
|
|
* Note: msg and msglen are pure outputs which carry the message in case verification succeeds. The (input) message is assumed to be within sig_msg which has the form (sig||msg).
|
2015-08-11 11:08:27 +01:00
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
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);
|
2015-08-11 11:08:27 +01:00
|
|
|
|
2015-08-12 13:37:49 +01:00
|
|
|
/*
|
|
|
|
* Generates a XMSSMT key pair for a given parameter set.
|
2016-07-11 10:15:16 +01:00
|
|
|
* Format sk: [(ceil(h/8) bit) idx || SK_SEED || SK_PRF || PUB_SEED || root]
|
2015-08-12 13:37:49 +01:00
|
|
|
* Format pk: [root || PUB_SEED] omitting algo oid.
|
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
int xmssmt_keypair(unsigned char *pk, unsigned char *sk);
|
2015-08-12 13:37:49 +01:00
|
|
|
/**
|
|
|
|
* Signs a message.
|
2017-06-02 16:29:14 +01:00
|
|
|
* Returns
|
2015-08-12 13:37:49 +01:00
|
|
|
* 1. an array containing the signature followed by the message AND
|
|
|
|
* 2. an updated secret key!
|
2017-06-02 16:29:14 +01:00
|
|
|
*
|
2015-08-12 13:37:49 +01:00
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
int xmssmt_sign(unsigned char *sk, unsigned char *sig_msg, unsigned long long *sig_msg_len, const unsigned char *msg, unsigned long long msglen);
|
2015-08-12 13:37:49 +01:00
|
|
|
/**
|
|
|
|
* Verifies a given message signature pair under a given public key.
|
|
|
|
*/
|
2017-06-02 13:10:24 +01:00
|
|
|
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);
|
2015-08-11 11:08:27 +01:00
|
|
|
#endif
|
|
|
|
|