xref: /netbsd-src/external/apache2/argon2/dist/phc-winner-argon2/src/genkat.h (revision 0090dad1538a6131df82f874b870c800d894ee40)
1 /*
2  * Argon2 reference source code package - reference C implementations
3  *
4  * Copyright 2015
5  * Daniel Dinu, Dmitry Khovratovich, Jean-Philippe Aumasson, and Samuel Neves
6  *
7  * You may use this work under the terms of a Creative Commons CC0 1.0
8  * License/Waiver or the Apache Public License 2.0, at your option. The terms of
9  * these licenses can be found at:
10  *
11  * - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
12  * - Apache 2.0        : http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * You should have received a copy of both of these licenses along with this
15  * software. If not, they may be obtained at the above URLs.
16  */
17 
18 #ifndef ARGON2_KAT_H
19 #define ARGON2_KAT_H
20 
21 #include "core.h"
22 
23 /*
24  * Initial KAT function that prints the inputs to the file
25  * @param  blockhash  Array that contains pre-hashing digest
26  * @param  context Holds inputs
27  * @param  type Argon2 type
28  * @pre blockhash must point to INPUT_INITIAL_HASH_LENGTH bytes
29  * @pre context member pointers must point to allocated memory of size according
30  * to the length values
31  */
32 void initial_kat(const uint8_t *blockhash, const argon2_context *context,
33                  argon2_type type);
34 
35 /*
36  * Function that prints the output tag
37  * @param  out  output array pointer
38  * @param  outlen digest length
39  * @pre out must point to @a outlen bytes
40  **/
41 void print_tag(const void *out, uint32_t outlen);
42 
43 /*
44  * Function that prints the internal state at given moment
45  * @param  instance pointer to the current instance
46  * @param  pass current pass number
47  * @pre instance must have necessary memory allocated
48  **/
49 void internal_kat(const argon2_instance_t *instance, uint32_t pass);
50 
51 #endif
52