Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
drygascon.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 Southern Storm Software, Pty Ltd.
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a
5  * copy of this software and associated documentation files (the "Software"),
6  * to deal in the Software without restriction, including without limitation
7  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8  * and/or sell copies of the Software, and to permit persons to whom the
9  * Software is furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20  * DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef LWCRYPTO_DRYGASCON_H
24 #define LWCRYPTO_DRYGASCON_H
25 
26 #include "aead-common.h"
27 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
57 #define DRYGASCON128_MINKEY_SIZE 16
58 
62 #define DRYGASCON128_FASTKEY_SIZE 32
63 
68 #define DRYGASCON128_SAFEKEY_SIZE 56
69 
73 #define DRYGASCON128_KEY_SIZE DRYGASCON128_FASTKEY_SIZE
74 
78 #define DRYGASCON128_TAG_SIZE 16
79 
83 #define DRYGASCON128_NONCE_SIZE 16
84 
88 #define DRYGASCON128_HASH_SIZE 32
89 
93 #define DRYGASCON256_KEY_SIZE 32
94 
98 #define DRYGASCON256_TAG_SIZE 32
99 
103 #define DRYGASCON256_NONCE_SIZE 16
104 
108 #define DRYGASCON256_HASH_SIZE 64
109 
114 
119 
124 
129 
134 
139 
144 
172  (unsigned char *c, unsigned long long *clen,
173  const unsigned char *m, unsigned long long mlen,
174  const unsigned char *ad, unsigned long long adlen,
175  const unsigned char *nsec,
176  const unsigned char *npub,
177  const unsigned char *k);
178 
207  (unsigned char *m, unsigned long long *mlen,
208  unsigned char *nsec,
209  const unsigned char *c, unsigned long long clen,
210  const unsigned char *ad, unsigned long long adlen,
211  const unsigned char *npub,
212  const unsigned char *k);
213 
241  (unsigned char *c, unsigned long long *clen,
242  const unsigned char *m, unsigned long long mlen,
243  const unsigned char *ad, unsigned long long adlen,
244  const unsigned char *nsec,
245  const unsigned char *npub,
246  const unsigned char *k);
247 
276  (unsigned char *m, unsigned long long *mlen,
277  unsigned char *nsec,
278  const unsigned char *c, unsigned long long clen,
279  const unsigned char *ad, unsigned long long adlen,
280  const unsigned char *npub,
281  const unsigned char *k);
282 
307  (unsigned char *c, unsigned long long *clen,
308  const unsigned char *m, unsigned long long mlen,
309  const unsigned char *ad, unsigned long long adlen,
310  const unsigned char *nsec,
311  const unsigned char *npub,
312  const unsigned char *k);
313 
339  (unsigned char *m, unsigned long long *mlen,
340  unsigned char *nsec,
341  const unsigned char *c, unsigned long long clen,
342  const unsigned char *ad, unsigned long long adlen,
343  const unsigned char *npub,
344  const unsigned char *k);
345 
368  (unsigned char *c, unsigned long long *clen,
369  const unsigned char *m, unsigned long long mlen,
370  const unsigned char *ad, unsigned long long adlen,
371  const unsigned char *nsec,
372  const unsigned char *npub,
373  const unsigned char *k);
374 
398  (unsigned char *m, unsigned long long *mlen,
399  unsigned char *nsec,
400  const unsigned char *c, unsigned long long clen,
401  const unsigned char *ad, unsigned long long adlen,
402  const unsigned char *npub,
403  const unsigned char *k);
404 
417  (unsigned char *out, const unsigned char *in, unsigned long long inlen);
418 
431  (unsigned char *out, const unsigned char *in, unsigned long long inlen);
432 
433 #ifdef __cplusplus
434 }
435 #endif
436 
437 #endif
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
aead_cipher_t const drygascon256_cipher
Meta-information block for the DryGASCON256 cipher.
Definition: drygascon.c:67
int drygascon256_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with DRYGASCON256.
Definition: drygascon.c:531
int drygascon128k32_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 DryGASCON128 with 32 bytes key.
Definition: drygascon.c:342
Meta-information about a hash algorithm that is related to an AEAD.
Definition: aead-common.h:204
aead_hash_algorithm_t const drygascon128_hash_algorithm
Meta-information block for DryGASCON128-HASH.
Definition: drygascon.c:77
aead_cipher_t const drygascon128_cipher
Meta-information block for the DryGASCON128 cipher (default to 32 bytes key).
Definition: drygascon.c:37
aead_cipher_t const drygascon128k56_cipher
Meta-information block for the DryGASCON128 cipher with 56 bytes key.
Definition: drygascon.c:47
aead_cipher_t const drygascon128k16_cipher
Meta-information block for the DryGASCON128 cipher with 16 bytes key.
Definition: drygascon.c:57
int drygascon128_hash(unsigned char *out, const unsigned char *in, unsigned long long inlen)
Hashes a block of input data with DRYGASCON128.
Definition: drygascon.c:493
aead_cipher_t const drygascon128k32_cipher
Meta-information block for the DryGASCON128 cipher with 32 bytes key.
Definition: drygascon.c:27
int drygascon128k56_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 DryGASCON128 with 56 bytes key.
Definition: drygascon.c:354
int drygascon128k16_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 DryGASCON128 with 16 bytes key.
Definition: drygascon.c:293
aead_hash_algorithm_t const drygascon256_hash_algorithm
Meta-information block for DryGASCON256-HASH.
Definition: drygascon.c:90
int drygascon128k32_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 DryGASCON128 with 32 bytes key.
Definition: drygascon.c:305
int drygascon256_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 DryGASCON256.
Definition: drygascon.c:418
int drygascon128k56_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 DryGASCON128 with 56 bytes key.
Definition: drygascon.c:317
int drygascon128k16_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 DryGASCON128 with 16 bytes key.
Definition: drygascon.c:330
int drygascon256_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 DryGASCON256.
Definition: drygascon.c:366