Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
sundae-gift.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_SUNDAE_GIFT_H
24 #define LWCRYPTO_SUNDAE_GIFT_H
25 
26 #include "aead-common.h"
27 
49 #ifdef __cplusplus
50 extern "C" {
51 #endif
52 
56 #define SUNDAE_GIFT_KEY_SIZE 16
57 
61 #define SUNDAE_GIFT_TAG_SIZE 16
62 
66 #define SUNDAE_GIFT_0_NONCE_SIZE 0
67 
71 #define SUNDAE_GIFT_64_NONCE_SIZE 8
72 
76 #define SUNDAE_GIFT_96_NONCE_SIZE 12
77 
81 #define SUNDAE_GIFT_128_NONCE_SIZE 16
82 
87 
92 
97 
102 
124  (unsigned char *c, unsigned long long *clen,
125  const unsigned char *m, unsigned long long mlen,
126  const unsigned char *ad, unsigned long long adlen,
127  const unsigned char *nsec,
128  const unsigned char *npub,
129  const unsigned char *k);
130 
153  (unsigned char *m, unsigned long long *mlen,
154  unsigned char *nsec,
155  const unsigned char *c, unsigned long long clen,
156  const unsigned char *ad, unsigned long long adlen,
157  const unsigned char *npub,
158  const unsigned char *k);
159 
182  (unsigned char *c, unsigned long long *clen,
183  const unsigned char *m, unsigned long long mlen,
184  const unsigned char *ad, unsigned long long adlen,
185  const unsigned char *nsec,
186  const unsigned char *npub,
187  const unsigned char *k);
188 
212  (unsigned char *m, unsigned long long *mlen,
213  unsigned char *nsec,
214  const unsigned char *c, unsigned long long clen,
215  const unsigned char *ad, unsigned long long adlen,
216  const unsigned char *npub,
217  const unsigned char *k);
218 
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 
271  (unsigned char *m, unsigned long long *mlen,
272  unsigned char *nsec,
273  const unsigned char *c, unsigned long long clen,
274  const unsigned char *ad, unsigned long long adlen,
275  const unsigned char *npub,
276  const unsigned char *k);
277 
300  (unsigned char *c, unsigned long long *clen,
301  const unsigned char *m, unsigned long long mlen,
302  const unsigned char *ad, unsigned long long adlen,
303  const unsigned char *nsec,
304  const unsigned char *npub,
305  const unsigned char *k);
306 
330  (unsigned char *m, unsigned long long *mlen,
331  unsigned char *nsec,
332  const unsigned char *c, unsigned long long clen,
333  const unsigned char *ad, unsigned long long adlen,
334  const unsigned char *npub,
335  const unsigned char *k);
336 
337 #ifdef __cplusplus
338 }
339 #endif
340 
341 #endif
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
int sundae_gift_64_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 SUNDAE-GIFT-64.
Definition: sundae-gift.c:275
int sundae_gift_128_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 SUNDAE-GIFT-128.
Definition: sundae-gift.c:331
aead_cipher_t const sundae_gift_0_cipher
Meta-information block for the SUNDAE-GIFT-0 cipher.
Definition: sundae-gift.c:28
aead_cipher_t const sundae_gift_128_cipher
Meta-information block for the SUNDAE-GIFT-128 cipher.
Definition: sundae-gift.c:58
int sundae_gift_64_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 SUNDAE-GIFT-64.
Definition: sundae-gift.c:289
int sundae_gift_96_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 SUNDAE-GIFT-96.
Definition: sundae-gift.c:303
int sundae_gift_96_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 SUNDAE-GIFT-96.
Definition: sundae-gift.c:317
int sundae_gift_0_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 SUNDAE-GIFT-0.
Definition: sundae-gift.c:261
aead_cipher_t const sundae_gift_64_cipher
Meta-information block for the SUNDAE-GIFT-64 cipher.
Definition: sundae-gift.c:38
int sundae_gift_128_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 SUNDAE-GIFT-12896.
Definition: sundae-gift.c:345
int sundae_gift_0_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 SUNDAE-GIFT-0.
Definition: sundae-gift.c:247
aead_cipher_t const sundae_gift_96_cipher
Meta-information block for the SUNDAE-GIFT-96 cipher.
Definition: sundae-gift.c:48