23QSC_CPLUSPLUS_ENABLED_START
63#define QSC_POLY1305_BLOCK_SIZE 16
69#define QSC_POLY1305_KEY_SIZE 32
75#define QSC_POLY1305_MAC_SIZE 16
169QSC_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 common.h:520
#define QSC_POLY1305_BLOCK_SIZE
The natural block size of the message input in bytes.
Definition poly1305.h:63
QSC_EXPORT_API int32_t qsc_poly1305_verify(const uint8_t *code, const uint8_t *message, size_t msglen, const uint8_t *key)
Verify a MAC code. Tests the code against the message and returns MQC_STATUS_SUCCESS or MQC_STATUS_FA...
Definition poly1305.c:257
QSC_EXPORT_API void qsc_poly1305_compute(uint8_t *output, const uint8_t *message, size_t msglen, const uint8_t *key)
Compute the MAC code and return the result in the mac byte array.
Definition poly1305.c:56
QSC_EXPORT_API void qsc_poly1305_update(qsc_poly1305_state *ctx, const uint8_t *message, size_t msglen)
Update the poly1305 generator with a length of message input. Absorbs the input message into the ctx.
Definition poly1305.c:206
QSC_EXPORT_API void qsc_poly1305_reset(qsc_poly1305_state *ctx)
Reset the ctx values to zero.
Definition poly1305.c:193
QSC_EXPORT_API void qsc_poly1305_initialize(qsc_poly1305_state *ctx, const uint8_t *key)
Initialize the ctx with the secret key.
Definition poly1305.c:166
QSC_EXPORT_API void qsc_poly1305_finalize(qsc_poly1305_state *ctx, uint8_t *mac)
Finalize the message ctx and returns the MAC code. Absorb the last block of message and create the MA...
Definition poly1305.c:79
QSC_EXPORT_API void qsc_poly1305_blockupdate(qsc_poly1305_state *ctx, const uint8_t *message)
Update the poly1305 generator with a single block of message input. Absorbs block sized lengths of in...
Definition poly1305.c:5
QSC_EXPORT_API void qsc_poly1305_dispose(qsc_poly1305_state *ctx)
Dispose of the ctx resetting all values to zero.
Definition poly1305.c:69
Contains the Poly1305 internal state.
Definition poly1305.h:82
uint32_t k[4]
Definition poly1305.h:84
size_t fnl
Definition poly1305.h:88
uint32_t s[4]
Definition poly1305.h:86
uint8_t buf[QSC_POLY1305_BLOCK_SIZE]
Definition poly1305.h:87
uint32_t h[5]
Definition poly1305.h:83
uint32_t r[5]
Definition poly1305.h:85
size_t rmd
Definition poly1305.h:89