Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
skinny-aead.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_SKINNY_AEAD_H
24 #define LWCRYPTO_SKINNY_AEAD_H
25 
26 #include "aead-common.h"
27 
61 #ifdef __cplusplus
62 extern "C" {
63 #endif
64 
68 #define SKINNY_AEAD_KEY_SIZE 16
69 
73 #define SKINNY_AEAD_M1_TAG_SIZE 16
74 
78 #define SKINNY_AEAD_M1_NONCE_SIZE 16
79 
83 #define SKINNY_AEAD_M2_TAG_SIZE 16
84 
88 #define SKINNY_AEAD_M2_NONCE_SIZE 12
89 
93 #define SKINNY_AEAD_M3_TAG_SIZE 8
94 
98 #define SKINNY_AEAD_M3_NONCE_SIZE 16
99 
103 #define SKINNY_AEAD_M4_TAG_SIZE 8
104 
108 #define SKINNY_AEAD_M4_NONCE_SIZE 12
109 
113 #define SKINNY_AEAD_M5_TAG_SIZE 16
114 
118 #define SKINNY_AEAD_M5_NONCE_SIZE 12
119 
123 #define SKINNY_AEAD_M6_TAG_SIZE 8
124 
128 #define SKINNY_AEAD_M6_NONCE_SIZE 12
129 
134 
139 
144 
149 
154 
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 
359  (unsigned char *c, unsigned long long *clen,
360  const unsigned char *m, unsigned long long mlen,
361  const unsigned char *ad, unsigned long long adlen,
362  const unsigned char *nsec,
363  const unsigned char *npub,
364  const unsigned char *k);
365 
389  (unsigned char *m, unsigned long long *mlen,
390  unsigned char *nsec,
391  const unsigned char *c, unsigned long long clen,
392  const unsigned char *ad, unsigned long long adlen,
393  const unsigned char *npub,
394  const unsigned char *k);
395 
418  (unsigned char *c, unsigned long long *clen,
419  const unsigned char *m, unsigned long long mlen,
420  const unsigned char *ad, unsigned long long adlen,
421  const unsigned char *nsec,
422  const unsigned char *npub,
423  const unsigned char *k);
424 
448  (unsigned char *m, unsigned long long *mlen,
449  unsigned char *nsec,
450  const unsigned char *c, unsigned long long clen,
451  const unsigned char *ad, unsigned long long adlen,
452  const unsigned char *npub,
453  const unsigned char *k);
454 
477  (unsigned char *c, unsigned long long *clen,
478  const unsigned char *m, unsigned long long mlen,
479  const unsigned char *ad, unsigned long long adlen,
480  const unsigned char *nsec,
481  const unsigned char *npub,
482  const unsigned char *k);
483 
507  (unsigned char *m, unsigned long long *mlen,
508  unsigned char *nsec,
509  const unsigned char *c, unsigned long long clen,
510  const unsigned char *ad, unsigned long long adlen,
511  const unsigned char *npub,
512  const unsigned char *k);
513 
514 #ifdef __cplusplus
515 }
516 #endif
517 
518 #endif
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
aead_cipher_t const skinny_aead_m5_cipher
Meta-information block for the SKINNY-AEAD-M5 cipher.
Definition: skinny-aead.c:68
int skinny_aead_m6_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 SKINNY-AEAD-M6.
Definition: skinny-aead.c:748
aead_cipher_t const skinny_aead_m6_cipher
Meta-information block for the SKINNY-AEAD-M6 cipher.
Definition: skinny-aead.c:78
int skinny_aead_m1_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 SKINNY-AEAD-M1.
Definition: skinny-aead.c:273
int skinny_aead_m3_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 SKINNY-AEAD-M3.
Definition: skinny-aead.c:420
int skinny_aead_m1_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 SKINNY-AEAD-M1.
Definition: skinny-aead.c:302
int skinny_aead_m2_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 SKINNY-AEAD-M2.
Definition: skinny-aead.c:361
int skinny_aead_m6_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 SKINNY-AEAD-M6.
Definition: skinny-aead.c:777
int skinny_aead_m5_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 SKINNY-AEAD-M5.
Definition: skinny-aead.c:689
int skinny_aead_m5_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 SKINNY-AEAD-M5.
Definition: skinny-aead.c:718
int skinny_aead_m3_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 SKINNY-AEAD-M3.
Definition: skinny-aead.c:391
aead_cipher_t const skinny_aead_m1_cipher
Meta-information block for the SKINNY-AEAD-M1 cipher.
Definition: skinny-aead.c:28
aead_cipher_t const skinny_aead_m2_cipher
Meta-information block for the SKINNY-AEAD-M2 cipher.
Definition: skinny-aead.c:38
aead_cipher_t const skinny_aead_m3_cipher
Meta-information block for the SKINNY-AEAD-M3 cipher.
Definition: skinny-aead.c:48
int skinny_aead_m2_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 SKINNY-AEAD-M2.
Definition: skinny-aead.c:332
aead_cipher_t const skinny_aead_m4_cipher
Meta-information block for the SKINNY-AEAD-M4 cipher.
Definition: skinny-aead.c:58
int skinny_aead_m4_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 SKINNY-AEAD-M4.
Definition: skinny-aead.c:450
int skinny_aead_m4_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 SKINNY-AEAD-M4.
Definition: skinny-aead.c:479