57QSC_CPLUSPLUS_ENABLED_START
97#define QSC_POLY1305_BLOCK_SIZE 16
103#define QSC_POLY1305_KEY_SIZE 32
109#define QSC_POLY1305_MAC_SIZE 16
203QSC_CPLUSPLUS_ENABLED_END
#define QSC_POLY1305_BLOCK_SIZE
The natural block size of the message input in bytes.
Definition poly1305.h:97
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:281
QSC_EXPORT_API void qsc_poly1305_initialize(qsc_poly1305_state *ctx, const uint8_t key[QSC_POLY1305_KEY_SIZE])
Initialize the ctx with the secret key.
Definition poly1305.c:181
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:59
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:227
#define QSC_POLY1305_KEY_SIZE
The Poly1305 key size in bytes.
Definition poly1305.h:103
QSC_EXPORT_API void qsc_poly1305_reset(qsc_poly1305_state *ctx)
Reset the ctx values to zero.
Definition poly1305.c:211
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:90
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:75
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:605
Contains the Poly1305 internal state.
Definition poly1305.h:116
size_t fnl
Definition poly1305.h:122
uint32_t r[5U]
Definition poly1305.h:119
uint8_t buf[QSC_POLY1305_BLOCK_SIZE]
Definition poly1305.h:121
uint32_t s[4U]
Definition poly1305.h:120
uint32_t h[5U]
Definition poly1305.h:117
uint32_t k[4U]
Definition poly1305.h:118
size_t rmd
Definition poly1305.h:123