Lightweight Cryptography Primitives
 All Data Structures Files Functions Variables Typedefs Macros Pages
ascon-hash.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_HASH_H
24 #define LWCRYPTO_ASCON_HASH_H
25 
33 #include "ascon-xof.h"
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
43 
57 int ascon_hash(unsigned char *out, const unsigned char *in, size_t inlen);
58 
66 void ascon_hash_init(ascon_hash_state_t *state);
67 
78  (ascon_hash_state_t *state, const unsigned char *in, size_t inlen);
79 
88 void ascon_hash_finalize(ascon_hash_state_t *state, unsigned char *out);
89 
103 int ascon_hasha(unsigned char *out, const unsigned char *in, size_t inlen);
104 
112 void ascon_hasha_init(ascon_hash_state_t *state);
113 
124  (ascon_hash_state_t *state, const unsigned char *in, size_t inlen);
125 
134 void ascon_hasha_finalize(ascon_hash_state_t *state, unsigned char *out);
135 
136 #ifdef __cplusplus
137 }
138 #endif
139 
140 #endif
void ascon_hash_update(ascon_hash_state_t *state, const unsigned char *in, size_t inlen)
Updates an ASCON-HASH state with more input data.
Definition: ascon-hash.c:51
int ascon_hasha(unsigned char *out, const unsigned char *in, size_t inlen)
Hashes a block of input data with ASCON-HASHA.
Definition: ascon-hash.c:61
void ascon_hash_finalize(ascon_hash_state_t *state, unsigned char *out)
Returns the final hash value from an ASCON-HASH hashing operation.
Definition: ascon-hash.c:56
State information for ASCON-XOF and ASCON-XOFA incremental modes.
Definition: ascon-xof.h:54
void ascon_hasha_finalize(ascon_hash_state_t *state, unsigned char *out)
Returns the final hash value from an ASCON-HASHA hashing operation.
Definition: ascon-hash.c:91
void ascon_hasha_update(ascon_hash_state_t *state, const unsigned char *in, size_t inlen)
Updates an ASCON-HASHA state with more input data.
Definition: ascon-hash.c:86
ascon_xof_state_t ascon_hash_state_t
State information for ASCON-HASH and ASCON-HASHA incremental modes.
Definition: ascon-hash.h:42
void ascon_hasha_init(ascon_hash_state_t *state)
Initializes the state for an ASCON-HASHA hashing operation.
Definition: ascon-hash.c:70
int ascon_hash(unsigned char *out, const unsigned char *in, size_t inlen)
Hashes a block of input data with ASCON-HASH.
Definition: ascon-hash.c:26
void ascon_hash_init(ascon_hash_state_t *state)
Initializes the state for an ASCON-HASH hashing operation.
Definition: ascon-hash.c:35