23 #ifndef LWCRYPTO_GASCON_H
24 #define LWCRYPTO_GASCON_H
54 #define GASCON128_KEY_SIZE 16
59 #define GASCON128_NONCE_SIZE 16
64 #define GASCON128_TAG_SIZE 16
69 #define GASCON80PQ_KEY_SIZE 20
74 #define GASCON80PQ_NONCE_SIZE 16
79 #define GASCON80PQ_TAG_SIZE 16
84 #define GASCON_HASH_SIZE 32
92 unsigned char state[40];
147 (
unsigned char *c,
unsigned long long *clen,
148 const unsigned char *m,
unsigned long long mlen,
149 const unsigned char *ad,
unsigned long long adlen,
150 const unsigned char *nsec,
151 const unsigned char *npub,
152 const unsigned char *k);
177 (
unsigned char *m,
unsigned long long *mlen,
179 const unsigned char *c,
unsigned long long clen,
180 const unsigned char *ad,
unsigned long long adlen,
181 const unsigned char *npub,
182 const unsigned char *k);
206 (
unsigned char *c,
unsigned long long *clen,
207 const unsigned char *m,
unsigned long long mlen,
208 const unsigned char *ad,
unsigned long long adlen,
209 const unsigned char *nsec,
210 const unsigned char *npub,
211 const unsigned char *k);
236 (
unsigned char *m,
unsigned long long *mlen,
238 const unsigned char *c,
unsigned long long clen,
239 const unsigned char *ad,
unsigned long long adlen,
240 const unsigned char *npub,
241 const unsigned char *k);
265 (
unsigned char *c,
unsigned long long *clen,
266 const unsigned char *m,
unsigned long long mlen,
267 const unsigned char *ad,
unsigned long long adlen,
268 const unsigned char *nsec,
269 const unsigned char *npub,
270 const unsigned char *k);
295 (
unsigned char *m,
unsigned long long *mlen,
297 const unsigned char *c,
unsigned long long clen,
298 const unsigned char *ad,
unsigned long long adlen,
299 const unsigned char *npub,
300 const unsigned char *k);
316 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
338 unsigned long long inlen);
368 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
390 unsigned long long inlen);
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
void gascon_xof_squeeze(gascon_hash_state_t *state, unsigned char *out, unsigned long long outlen)
Squeezes output data from an GASCON-XOF state.
unsigned char mode
Definition: gascon128.h:94
void gascon_hash_finalize(gascon_hash_state_t *state, unsigned char *out)
Returns the final hash value from an GASCON-HASH hashing operation.
int gascon128_aead_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k)
Decrypts and authenticates a packet with GASCON-128.
Definition: gascon128.c:310
Meta-information about a hash algorithm that is related to an AEAD.
Definition: aead-common.h:204
unsigned long long align
Definition: gascon128.h:96
void gascon_hash_update(gascon_hash_state_t *state, const unsigned char *in, unsigned long long inlen)
Updates an GASCON-HASH state with more input data.
aead_hash_algorithm_t const gascon_hash_algorithm
Meta-information block for the GASCON-HASH algorithm.
unsigned char count
Definition: gascon128.h:93
int gascon_xof(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with GASCON-XOF and generates a fixed-length 32 byte output...
void gascon_hash_init(gascon_hash_state_t *state)
Initializes the state for an GASCON-HASH hashing operation.
int gascon128a_aead_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k)
Encrypts and authenticates a packet with GASCON-128a.
Definition: gascon128.c:351
int gascon80pq_aead_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k)
Encrypts and authenticates a packet with GASCON-80pq.
Definition: gascon128.c:430
aead_cipher_t const gascon128a_cipher
Meta-information block for the GASCON-128a cipher.
Definition: gascon128.c:52
void gascon_xof_init(gascon_hash_state_t *state)
Initializes the state for an GASCON-XOF hashing operation.
int gascon_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with GASCON-HASH.
aead_cipher_t const gascon80pq_cipher
Meta-information block for the GASCON-80pq cipher.
Definition: gascon128.c:62
void gascon_xof_absorb(gascon_hash_state_t *state, const unsigned char *in, unsigned long long inlen)
Aborbs more input data into an GASCON-XOF state.
aead_cipher_t const gascon128_cipher
Meta-information block for the GASCON-128 cipher.
Definition: gascon128.c:42
aead_hash_algorithm_t const gascon_xof_algorithm
Meta-information block for the GASCON-XOF algorithm.
State information for GASCON-HASH and GASCON-XOF incremental modes.
Definition: gascon128.h:89
int gascon80pq_aead_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k)
Decrypts and authenticates a packet with GASCON-80pq.
Definition: gascon128.c:468
int gascon128a_aead_decrypt(unsigned char *m, unsigned long long *mlen, unsigned char *nsec, const unsigned char *c, unsigned long long clen, const unsigned char *ad, unsigned long long adlen, const unsigned char *npub, const unsigned char *k)
Decrypts and authenticates a packet with GASCON-128a.
Definition: gascon128.c:389
int gascon128_aead_encrypt(unsigned char *c, unsigned long long *clen, const unsigned char *m, unsigned long long mlen, const unsigned char *ad, unsigned long long adlen, const unsigned char *nsec, const unsigned char *npub, const unsigned char *k)
Encrypts and authenticates a packet with GASCON-128.
Definition: gascon128.c:272