ASCON Suite
ascon-aead-common.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2022 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 ASCON_AEAD_COMMON_H
24 #define ASCON_AEAD_COMMON_H
25 
26 /* Common utilities for supporting the implementation of AEAD modes */
27 
28 #include <ascon/aead.h>
29 #include <ascon/permutation.h>
30 #include <ascon/utility.h>
31 
48  (unsigned char *plaintext, size_t plaintext_len,
49  const unsigned char *tag1, const unsigned char *tag2, size_t size);
50 
62  (ascon_state_t *state, const unsigned char *data,
63  size_t len, uint8_t first_round, int last_permute);
64 
76  (ascon_state_t *state, const unsigned char *data,
77  size_t len, uint8_t first_round, int last_permute);
78 
92 unsigned char ascon_aead_encrypt_8
93  (ascon_state_t *state, unsigned char *dest,
94  const unsigned char *src, size_t len, uint8_t first_round,
95  unsigned char partial);
96 
110 unsigned char ascon_aead_encrypt_16
111  (ascon_state_t *state, unsigned char *dest,
112  const unsigned char *src, size_t len, uint8_t first_round,
113  unsigned char partial);
114 
128 unsigned char ascon_aead_decrypt_8
129  (ascon_state_t *state, unsigned char *dest,
130  const unsigned char *src, size_t len, uint8_t first_round,
131  unsigned char partial);
132 
146 unsigned char ascon_aead_decrypt_16
147  (ascon_state_t *state, unsigned char *dest,
148  const unsigned char *src, size_t len, uint8_t first_round,
149  unsigned char partial);
150 
151 #endif
ASCON-128 encryption algorithm and related family members.
void ascon_aead_absorb_16(ascon_state_t *state, const unsigned char *data, size_t len, uint8_t first_round, int last_permute)
Absorbs data into an ASCON state with a 16-byte rate.
unsigned char ascon_aead_encrypt_16(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Encrypts a block of data with an ASCON state and a 16-byte rate.
unsigned char ascon_aead_encrypt_8(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Encrypts a block of data with an ASCON state and an 8-byte rate.
int ascon_aead_check_tag(unsigned char *plaintext, size_t plaintext_len, const unsigned char *tag1, const unsigned char *tag2, size_t size)
Check an authentication tag in constant time.
unsigned char ascon_aead_decrypt_8(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Decrypts a block of data with an ASCON state and an 8-byte rate.
void ascon_aead_absorb_8(ascon_state_t *state, const unsigned char *data, size_t len, uint8_t first_round, int last_permute)
Absorbs data into an ASCON state with an 8-byte rate.
unsigned char ascon_aead_decrypt_16(ascon_state_t *state, unsigned char *dest, const unsigned char *src, size_t len, uint8_t first_round, unsigned char partial)
Decrypts a block of data with an ASCON state and a 16-byte rate.
Direct access to the ASCON permutation primitive.
ascon_state_t state
[snippet_key]
Definition: snippets.c:2
unsigned char data[8]
[snippet_key]
Definition: snippets.c:14
Structure of the internal state of the ASCON permutation.
Definition: permutation.h:63
System utilities of use to applications that use ASCON.