58QSC_CPLUSPLUS_ENABLED_START
96#define QSC_CHACHA_BLOCK_SIZE 64U
102#define QSC_CHACHA_KEY128_SIZE 16U
108#define QSC_CHACHA_KEY256_SIZE 32U
114#define QSC_CHACHA_NONCE_SIZE 12U
120#define QSC_CHACHA_ROUND_COUNT 20U
265QSC_CPLUSPLUS_ENABLED_END
QSC_EXPORT_API void qsc_chacha_dispose(qsc_chacha_state *ctx)
Dispose of the ChaCha20 cipher state.
Definition chacha.c:648
QSC_EXPORT_API void qsc_chacha_transform(qsc_chacha_state *ctx, uint8_t *output, const uint8_t *input, size_t length)
Process a block of input data using the ChaCha20 cipher.
Definition chacha.c:709
QSC_EXPORT_API void qsc_chacha_poly1305_encrypt(qsc_chacha_poly1305_state *ctx, uint8_t *output, const uint8_t *input, size_t length)
Encrypt data using the ChaCha-Poly1305 authenticated encryption mode.
Definition chacha.c:990
QSC_EXPORT_API void qsc_chacha_poly1305_set_associated(qsc_chacha_poly1305_state *ctx, const uint8_t *data, size_t datalen)
Set the associated data (AAD) for ChaCha-Poly1305 authenticated encryption.
Definition chacha.c:917
QSC_EXPORT_API void qsc_chacha_poly1305_dispose(qsc_chacha_poly1305_state *ctx)
Dispose of an ChaCha-Poly1305 state.
Definition chacha.c:977
QSC_EXPORT_API void qsc_chacha_initialize(qsc_chacha_state *ctx, const qsc_chacha_keyparams *keyparams)
Initialize the ChaCha20 cipher state with the secret key and nonce.
Definition chacha.c:658
QSC_EXPORT_API bool qsc_chacha_poly1305_decrypt(qsc_chacha_poly1305_state *ctx, uint8_t *output, const uint8_t *input, size_t length)
Decrypt data using the ChaCha-Poly1305 authenticated encryption mode.
Definition chacha.c:938
QSC_EXPORT_API void qsc_chacha_poly1305_initialize(qsc_chacha_poly1305_state *ctx, const qsc_chacha_keyparams *keyparams)
Initialize the ChaCha-Poly1305 state for authenticated encryption or decryption.
Definition chacha.c:1015
Poly1305 function definitions Contains the public api and documentation for the Poly1305 implementat...
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
Key parameters for the ChaCha20 cipher.
Definition chacha.h:141
uint8_t * nonce
Definition chacha.h:144
const uint8_t * key
Definition chacha.h:142
size_t keylen
Definition chacha.h:143
qsc_poly1305_state pstate
Definition chacha.h:184
size_t aadlen
Definition chacha.h:185
qsc_chacha_state cstate
Definition chacha.h:183
size_t msglen
Definition chacha.h:186
Internal state structure for the ChaCha20 cipher.
Definition chacha.h:129
uint32_t state[16U]
Definition chacha.h:130
Contains the Poly1305 internal state.
Definition poly1305.h:116