23 #ifndef LWCRYPTO_KNOT_H
24 #define LWCRYPTO_KNOT_H
64 #define KNOT_AEAD_128_KEY_SIZE 16
70 #define KNOT_AEAD_128_TAG_SIZE 16
75 #define KNOT_AEAD_128_NONCE_SIZE 16
80 #define KNOT_AEAD_192_KEY_SIZE 24
85 #define KNOT_AEAD_192_TAG_SIZE 24
90 #define KNOT_AEAD_192_NONCE_SIZE 24
95 #define KNOT_AEAD_256_KEY_SIZE 32
100 #define KNOT_AEAD_256_TAG_SIZE 32
105 #define KNOT_AEAD_256_NONCE_SIZE 32
110 #define KNOT_HASH_256_SIZE 32
115 #define KNOT_HASH_384_SIZE 48
120 #define KNOT_HASH_512_SIZE 64
184 (
unsigned char *c,
unsigned long long *clen,
185 const unsigned char *m,
unsigned long long mlen,
186 const unsigned char *ad,
unsigned long long adlen,
187 const unsigned char *nsec,
188 const unsigned char *npub,
189 const unsigned char *k);
214 (
unsigned char *m,
unsigned long long *mlen,
216 const unsigned char *c,
unsigned long long clen,
217 const unsigned char *ad,
unsigned long long adlen,
218 const unsigned char *npub,
219 const unsigned char *k);
243 (
unsigned char *c,
unsigned long long *clen,
244 const unsigned char *m,
unsigned long long mlen,
245 const unsigned char *ad,
unsigned long long adlen,
246 const unsigned char *nsec,
247 const unsigned char *npub,
248 const unsigned char *k);
273 (
unsigned char *m,
unsigned long long *mlen,
275 const unsigned char *c,
unsigned long long clen,
276 const unsigned char *ad,
unsigned long long adlen,
277 const unsigned char *npub,
278 const unsigned char *k);
303 (
unsigned char *c,
unsigned long long *clen,
304 const unsigned char *m,
unsigned long long mlen,
305 const unsigned char *ad,
unsigned long long adlen,
306 const unsigned char *nsec,
307 const unsigned char *npub,
308 const unsigned char *k);
333 (
unsigned char *m,
unsigned long long *mlen,
335 const unsigned char *c,
unsigned long long clen,
336 const unsigned char *ad,
unsigned long long adlen,
337 const unsigned char *npub,
338 const unsigned char *k);
362 (
unsigned char *c,
unsigned long long *clen,
363 const unsigned char *m,
unsigned long long mlen,
364 const unsigned char *ad,
unsigned long long adlen,
365 const unsigned char *nsec,
366 const unsigned char *npub,
367 const unsigned char *k);
392 (
unsigned char *m,
unsigned long long *mlen,
394 const unsigned char *c,
unsigned long long clen,
395 const unsigned char *ad,
unsigned long long adlen,
396 const unsigned char *npub,
397 const unsigned char *k);
411 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
425 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
439 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
453 (
unsigned char *out,
const unsigned char *in,
unsigned long long inlen);
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
int knot_aead_192_384_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 KNOT-AEAD-192-384.
Definition: knot-aead.c:380
int knot_hash_256_384(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with KNOT-HASH-256-384.
Definition: knot-hash.c:122
int knot_aead_128_256_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 KNOT-AEAD-128-256.
Definition: knot-aead.c:168
Meta-information about a hash algorithm that is related to an AEAD.
Definition: aead-common.h:204
int knot_aead_256_512_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 KNOT-AEAD-256-512.
Definition: knot-aead.c:423
aead_hash_algorithm_t const knot_hash_256_256_algorithm
Meta-information block for the KNOT-HASH-256-256 algorithm.
Definition: knot-hash.c:27
aead_cipher_t const knot_aead_128_256_cipher
Meta-information block for the KNOT-AEAD-128-256 cipher.
Definition: knot-aead.c:27
aead_hash_algorithm_t const knot_hash_256_384_algorithm
Meta-information block for the KNOT-HASH-256-384 algorithm.
Definition: knot-hash.c:40
int knot_aead_128_384_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 KNOT-AEAD-128-384.
Definition: knot-aead.c:251
int knot_aead_128_384_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 KNOT-AEAD-128-384.
Definition: knot-aead.c:294
aead_cipher_t const knot_aead_256_512_cipher
Meta-information block for the KNOT-AEAD-256-512 cipher.
Definition: knot-aead.c:57
aead_cipher_t const knot_aead_128_384_cipher
Meta-information block for the KNOT-AEAD-128-384 cipher.
Definition: knot-aead.c:37
int knot_aead_256_512_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 KNOT-AEAD-256-512.
Definition: knot-aead.c:463
aead_hash_algorithm_t const knot_hash_512_512_algorithm
Meta-information block for the KNOT-HASH-512-512 algorithm.
Definition: knot-hash.c:66
int knot_aead_192_384_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 KNOT-AEAD-192-384.
Definition: knot-aead.c:340
aead_cipher_t const knot_aead_192_384_cipher
Meta-information block for the KNOT-AEAD-192-384 cipher.
Definition: knot-aead.c:47
int knot_aead_128_256_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 KNOT-AEAD-128-256.
Definition: knot-aead.c:208
int knot_hash_512_512(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with KNOT-HASH-512-512.
Definition: knot-hash.c:167
int knot_hash_384_384(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with KNOT-HASH-384-384.
Definition: knot-hash.c:145
int knot_hash_256_256(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with KNOT-HASH-256-256.
Definition: knot-hash.c:100
aead_hash_algorithm_t const knot_hash_384_384_algorithm
Meta-information block for the KNOT-HASH-384-384 algorithm.
Definition: knot-hash.c:53