52#ifndef QSC_SPHINCSPLUS_H
53#define QSC_SPHINCSPLUS_H
57QSC_CPLUSPLUS_ENABLED_START
97#if defined(QSC_SPHINCSPLUS_S1S128SHAKERS)
102# define QSC_SPHINCSPLUS_GENERATE_SEED_SIZE 48
108# define QSC_SPHINCSPLUS_SIGN_SEED_SIZE 16
114# define QSC_SPHINCSPLUS_SIGNATURE_SIZE 7856
120# define QSC_SPHINCSPLUS_PRIVATEKEY_SIZE 64
126# define QSC_SPHINCSPLUS_PUBLICKEY_SIZE 32
132# define QSC_SPHINCSPLUS_ALGNAME "SPHINCSPLUS-S1S128SHAKERS"
134#elif defined(QSC_SPHINCSPLUS_S3S192SHAKERS)
140# define QSC_SPHINCSPLUS_GENERATE_SEED_SIZE 72
146# define QSC_SPHINCSPLUS_SIGN_SEED_SIZE 24
152# define QSC_SPHINCSPLUS_SIGNATURE_SIZE 16224
158# define QSC_SPHINCSPLUS_PRIVATEKEY_SIZE 96
164# define QSC_SPHINCSPLUS_PUBLICKEY_SIZE 48
170# define QSC_SPHINCSPLUS_ALGNAME "SPHINCSPLUS-S3S192SHAKERS"
172#elif defined(QSC_SPHINCSPLUS_S5S256SHAKERS)
178# define QSC_SPHINCSPLUS_GENERATE_SEED_SIZE 96
184# define QSC_SPHINCSPLUS_SIGN_SEED_SIZE 32
190# define QSC_SPHINCSPLUS_SIGNATURE_SIZE 29792
196# define QSC_SPHINCSPLUS_PRIVATEKEY_SIZE 128
202# define QSC_SPHINCSPLUS_PUBLICKEY_SIZE 64
208# define QSC_SPHINCSPLUS_ALGNAME "SPHINCSPLUS-S5S256SHAKERS"
210#elif defined(QSC_SPHINCSPLUS_S6S512SHAKERS)
216# define QSC_SPHINCSPLUS_GENERATE_SEED_SIZE 192
222# define QSC_SPHINCSPLUS_SIGN_SEED_SIZE 64
228# define QSC_SPHINCSPLUS_EXTENDED
234# define QSC_SPHINCSPLUS_SIGNATURE_SIZE 113344
240# define QSC_SPHINCSPLUS_PRIVATEKEY_SIZE 256
246# define QSC_SPHINCSPLUS_PUBLICKEY_SIZE 128
252# define QSC_SPHINCSPLUS_ALGNAME "SPHINCSPLUS-S6S512SHAKERS"
255# error "The SPHINCS+ parameter set is invalid!"
298QSC_EXPORT_API bool qsc_sphincsplus_sign(uint8_t* signedmsg,
size_t* smsglen,
const uint8_t* message,
size_t msglen,
const uint8_t* privatekey,
bool (*rng_generate)(uint8_t*,
size_t));
316QSC_EXPORT_API bool qsc_sphincsplus_sign_ex(uint8_t* signedmsg,
size_t* smsglen,
const uint8_t* message,
size_t msglen,
const uint8_t* context,
size_t ctxlen,
const uint8_t* privatekey,
bool (*rng_generate)(uint8_t*,
size_t));
364QSC_CPLUSPLUS_ENABLED_END
Contains common definitions for the Quantum Secure Cryptographic (QSC) library.
#define QSC_EXPORT_API
API export macro for Microsoft compilers when importing from a DLL.
Definition qsccommon.h:645
QSC_EXPORT_API bool qsc_sphincsplus_seeded_sign_ex(uint8_t *signedmsg, size_t *smsglen, const uint8_t *message, size_t msglen, const uint8_t *context, size_t ctxlen, const uint8_t *privatekey, const uint8_t *seed)
Takes the message and a seed as input and returns an array containing the signature followed by the m...
Definition sphincsplus.c:91
QSC_EXPORT_API bool qsc_sphincsplus_generate_keypair(uint8_t *publickey, uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Generates a Sphincs+ public/private key-pair.
Definition sphincsplus.c:5
QSC_EXPORT_API bool qsc_sphincsplus_sign(uint8_t *signedmsg, size_t *smsglen, const uint8_t *message, size_t msglen, const uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Takes the message as input and returns an array containing the signature followed by the message.
Definition sphincsplus.c:41
#define QSC_SPHINCSPLUS_GENERATE_SEED_SIZE
The byte size of the key generation seed.
Definition sphincsplus.h:102
QSC_EXPORT_API bool qsc_sphincsplus_verify_ex(uint8_t *message, size_t *msglen, const uint8_t *context, size_t ctxlen, const uint8_t *signedmsg, size_t smsglen, const uint8_t *publickey)
Verifies a signature-message pair and context parameter with the public key.
Definition sphincsplus.c:131
QSC_EXPORT_API bool qsc_sphincsplus_verify(uint8_t *message, size_t *msglen, const uint8_t *signedmsg, size_t smsglen, const uint8_t *publickey)
Verifies a signature-message pair with the public key.
Definition sphincsplus.c:111
QSC_EXPORT_API bool qsc_sphincsplus_generate_seeded_keypair(uint8_t *publickey, uint8_t *privatekey, const uint8_t seed[QSC_SPHINCSPLUS_GENERATE_SEED_SIZE])
Generates a Sphincs+ public/private key-pair using a seed.
Definition sphincsplus.c:23
QSC_EXPORT_API bool qsc_sphincsplus_sign_ex(uint8_t *signedmsg, size_t *smsglen, const uint8_t *message, size_t msglen, const uint8_t *context, size_t ctxlen, const uint8_t *privatekey, bool(*rng_generate)(uint8_t *, size_t))
Takes the message as input with the additional context parameter and returns an array containing the ...
Definition sphincsplus.c:66