Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
ascon-hmac.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2021 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_ASCON_HMAC_H
24 #define LWCRYPTO_ASCON_HMAC_H
25 
26 #include "ascon-hash.h"
27 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
53 #define ASCON_HMAC_SIZE ASCON_HASH_SIZE
54 
60 
71 void ascon_hmac
72  (unsigned char *out,
73  const unsigned char *key, size_t keylen,
74  const unsigned char *in, size_t inlen);
75 
88 void ascon_hmac_init
89  (ascon_hmac_state_t *state, const unsigned char *key, size_t keylen);
90 
101  (ascon_hmac_state_t *state, const unsigned char *in, size_t inlen);
102 
115  (ascon_hmac_state_t *state, const unsigned char *key, size_t keylen,
116  unsigned char *out);
117 
128 void ascon_hmaca
129  (unsigned char *out,
130  const unsigned char *key, size_t keylen,
131  const unsigned char *in, size_t inlen);
132 
145 void ascon_hmaca_init
146  (ascon_hmac_state_t *state, const unsigned char *key, size_t keylen);
147 
158  (ascon_hmac_state_t *state, const unsigned char *in, size_t inlen);
159 
172  (ascon_hmac_state_t *state, const unsigned char *key, size_t keylen,
173  unsigned char *out);
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 
179 #endif
void ascon_hmaca_finalize(ascon_hmac_state_t *state, const unsigned char *key, size_t keylen, unsigned char *out)
Finalizes an incremental ASCON-HMACA state.
void ascon_hmac(unsigned char *out, const unsigned char *key, size_t keylen, const unsigned char *in, size_t inlen)
Computes a HMAC value using ASCON-HASH.
void ascon_hmaca_init(ascon_hmac_state_t *state, const unsigned char *key, size_t keylen)
Initializes an incremental HMAC state using ASCON-HASHA.
void ascon_hmac_finalize(ascon_hmac_state_t *state, const unsigned char *key, size_t keylen, unsigned char *out)
Finalizes an incremental ASCON-HMAC state.
State information for ASCON-XOF and ASCON-XOFA incremental modes.
Definition: ascon-xof.h:54
void ascon_hmaca_update(ascon_hmac_state_t *state, const unsigned char *in, size_t inlen)
Updates an incremental ASCON-HMACA state with more input data.
void ascon_hmac_init(ascon_hmac_state_t *state, const unsigned char *key, size_t keylen)
Initializes an incremental HMAC state using ASCON-HASH.
void ascon_hmaca(unsigned char *out, const unsigned char *key, size_t keylen, const unsigned char *in, size_t inlen)
Computes a HMAC value using ASCON-HASHA.
ASCON-HASH and ASCON-HASHA hash algorithms.
ascon_xof_state_t ascon_hmac_state_t
State information for the ASCON-HMAC and ASCON-HMACA incremental modes.
Definition: ascon-hmac.h:59
void ascon_hmac_update(ascon_hmac_state_t *state, const unsigned char *in, size_t inlen)
Updates an incremental ASCON-HMAC state with more input data.