47QSC_CPLUSPLUS_ENABLED_START
85#define QSC_CHACHA_BLOCK_SIZE 64ULL
91#define QSC_CHACHA_KEY128_SIZE 16ULL
97#define QSC_CHACHA_KEY256_SIZE 32ULL
103#define QSC_CHACHA_NONCE_SIZE 12ULL
109#define QSC_CHACHA_ROUND_COUNT 20ULL
251QSC_CPLUSPLUS_ENABLED_END
QSC_EXPORT_API void qsc_chacha_dispose(qsc_chacha_state *ctx)
Dispose of the ChaCha20 cipher state.
Definition chacha.c:643
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:697
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:988
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:927
QSC_EXPORT_API void qsc_chacha_poly1305_dispose(qsc_chacha_poly1305_state *ctx)
Dispose of an ChaCha-Poly1305 state.
Definition chacha.c:961
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:650
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:936
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:974
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
Poly1305 function definitions Contains the public api and documentation for the Poly1305 implementat...
Key parameters for the ChaCha20 cipher.
Definition chacha.h:130
uint8_t * nonce
Definition chacha.h:133
const uint8_t * key
Definition chacha.h:131
size_t keylen
Definition chacha.h:132
qsc_poly1305_state pstate
Definition chacha.h:173
size_t aadlen
Definition chacha.h:174
qsc_chacha_state cstate
Definition chacha.h:172
size_t msglen
Definition chacha.h:175
Internal state structure for the ChaCha20 cipher.
Definition chacha.h:118
uint32_t state[16]
Definition chacha.h:119
Contains the Poly1305 internal state.
Definition poly1305.h:82