Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
forkae.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_FORKAE_H
24 #define LWCRYPTO_FORKAE_H
25 
26 #include "aead-common.h"
27 
69 #ifdef __cplusplus
70 extern "C" {
71 #endif
72 
76 #define FORKAE_PAEF_64_192_KEY_SIZE 16
77 
81 #define FORKAE_PAEF_64_192_TAG_SIZE 8
82 
86 #define FORKAE_PAEF_64_192_NONCE_SIZE 6
87 
91 #define FORKAE_PAEF_128_192_KEY_SIZE 16
92 
96 #define FORKAE_PAEF_128_192_TAG_SIZE 16
97 
101 #define FORKAE_PAEF_128_192_NONCE_SIZE 6
102 
106 #define FORKAE_PAEF_128_256_KEY_SIZE 16
107 
111 #define FORKAE_PAEF_128_256_TAG_SIZE 16
112 
116 #define FORKAE_PAEF_128_256_NONCE_SIZE 14
117 
121 #define FORKAE_PAEF_128_288_KEY_SIZE 16
122 
126 #define FORKAE_PAEF_128_288_TAG_SIZE 16
127 
131 #define FORKAE_PAEF_128_288_NONCE_SIZE 13
132 
136 #define FORKAE_SAEF_128_192_KEY_SIZE 16
137 
141 #define FORKAE_SAEF_128_192_TAG_SIZE 16
142 
146 #define FORKAE_SAEF_128_192_NONCE_SIZE 7
147 
151 #define FORKAE_SAEF_128_256_KEY_SIZE 16
152 
156 #define FORKAE_SAEF_128_256_TAG_SIZE 16
157 
161 #define FORKAE_SAEF_128_256_NONCE_SIZE 15
162 
167 
172 
177 
182 
187 
192 
215  (unsigned char *c, unsigned long long *clen,
216  const unsigned char *m, unsigned long long mlen,
217  const unsigned char *ad, unsigned long long adlen,
218  const unsigned char *nsec,
219  const unsigned char *npub,
220  const unsigned char *k);
221 
245  (unsigned char *m, unsigned long long *mlen,
246  unsigned char *nsec,
247  const unsigned char *c, unsigned long long clen,
248  const unsigned char *ad, unsigned long long adlen,
249  const unsigned char *npub,
250  const unsigned char *k);
251 
274  (unsigned char *c, unsigned long long *clen,
275  const unsigned char *m, unsigned long long mlen,
276  const unsigned char *ad, unsigned long long adlen,
277  const unsigned char *nsec,
278  const unsigned char *npub,
279  const unsigned char *k);
280 
304  (unsigned char *m, unsigned long long *mlen,
305  unsigned char *nsec,
306  const unsigned char *c, unsigned long long clen,
307  const unsigned char *ad, unsigned long long adlen,
308  const unsigned char *npub,
309  const unsigned char *k);
310 
333  (unsigned char *c, unsigned long long *clen,
334  const unsigned char *m, unsigned long long mlen,
335  const unsigned char *ad, unsigned long long adlen,
336  const unsigned char *nsec,
337  const unsigned char *npub,
338  const unsigned char *k);
339 
363  (unsigned char *m, unsigned long long *mlen,
364  unsigned char *nsec,
365  const unsigned char *c, unsigned long long clen,
366  const unsigned char *ad, unsigned long long adlen,
367  const unsigned char *npub,
368  const unsigned char *k);
369 
392  (unsigned char *c, unsigned long long *clen,
393  const unsigned char *m, unsigned long long mlen,
394  const unsigned char *ad, unsigned long long adlen,
395  const unsigned char *nsec,
396  const unsigned char *npub,
397  const unsigned char *k);
398 
422  (unsigned char *m, unsigned long long *mlen,
423  unsigned char *nsec,
424  const unsigned char *c, unsigned long long clen,
425  const unsigned char *ad, unsigned long long adlen,
426  const unsigned char *npub,
427  const unsigned char *k);
428 
451  (unsigned char *c, unsigned long long *clen,
452  const unsigned char *m, unsigned long long mlen,
453  const unsigned char *ad, unsigned long long adlen,
454  const unsigned char *nsec,
455  const unsigned char *npub,
456  const unsigned char *k);
457 
481  (unsigned char *m, unsigned long long *mlen,
482  unsigned char *nsec,
483  const unsigned char *c, unsigned long long clen,
484  const unsigned char *ad, unsigned long long adlen,
485  const unsigned char *npub,
486  const unsigned char *k);
487 
510  (unsigned char *c, unsigned long long *clen,
511  const unsigned char *m, unsigned long long mlen,
512  const unsigned char *ad, unsigned long long adlen,
513  const unsigned char *nsec,
514  const unsigned char *npub,
515  const unsigned char *k);
516 
540  (unsigned char *m, unsigned long long *mlen,
541  unsigned char *nsec,
542  const unsigned char *c, unsigned long long clen,
543  const unsigned char *ad, unsigned long long adlen,
544  const unsigned char *npub,
545  const unsigned char *k);
546 
547 #ifdef __cplusplus
548 }
549 #endif
550 
551 #endif
Meta-information about an AEAD cipher.
Definition: aead-common.h:185
Definitions that are common across AEAD schemes.
int forkae_paef_128_192_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 PAEF-ForkSkinny-128-192.
int forkae_saef_128_192_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 SAEF-ForkSkinny-128-192.
aead_cipher_t const forkae_paef_128_256_cipher
Meta-information block for the PAEF-ForkSkinny-128-256 cipher.
Definition: forkae.c:47
aead_cipher_t const forkae_saef_128_256_cipher
Meta-information block for the SAEF-ForkSkinny-128-256 cipher.
Definition: forkae.c:77
aead_cipher_t const forkae_paef_128_192_cipher
Meta-information block for the PAEF-ForkSkinny-128-192 cipher.
Definition: forkae.c:37
int forkae_saef_128_256_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 SAEF-ForkSkinny-128-256.
int forkae_paef_128_256_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 PAEF-ForkSkinny-128-256.
int forkae_saef_128_192_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 SAEF-ForkSkinny-128-192.
int forkae_paef_128_288_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 PAEF-ForkSkinny-128-288.
int forkae_paef_64_192_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 PAEF-ForkSkinny-64-192.
int forkae_paef_128_288_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 PAEF-ForkSkinny-128-288.
int forkae_saef_128_256_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 SAEF-ForkSkinny-128-256.
aead_cipher_t const forkae_saef_128_192_cipher
Meta-information block for the SAEF-ForkSkinny-128-192 cipher.
Definition: forkae.c:67
aead_cipher_t const forkae_paef_128_288_cipher
Meta-information block for the PAEF-ForkSkinny-128-288 cipher.
Definition: forkae.c:57
aead_cipher_t const forkae_paef_64_192_cipher
Meta-information block for the PAEF-ForkSkinny-64-192 cipher.
Definition: forkae.c:27
int forkae_paef_64_192_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 PAEF-ForkSkinny-64-192.
int forkae_paef_128_256_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 PAEF-ForkSkinny-128-256.
int forkae_paef_128_192_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 PAEF-ForkSkinny-128-192.