Implemented checksum based on BLAKE2s hash function.
[slunkcrypt.git] / frontend / src / blake2.h
blob1f6d4db3bcee9f08f05227db30092da4417fe029
1 /*
2 BLAKE2 reference source code package - reference C implementations
3 Copyright 2012, Samuel Neves <sneves@dei.uc.pt>. You may use this under the
4 terms of the CC0, the OpenSSL Licence, or the Apache Public License 2.0, at
5 your option. The terms of these licenses can be found at:
6 - CC0 1.0 Universal : http://creativecommons.org/publicdomain/zero/1.0
7 - OpenSSL license : https://www.openssl.org/source/license.html
8 - Apache 2.0 : http://www.apache.org/licenses/LICENSE-2.0
9 More information about the BLAKE2 hash function can be found at
10 https://blake2.net.
13 #ifndef BLAKE2_H
14 #define BLAKE2_H
16 #define BLAKE2S_BLOCKBYTES 64
18 typedef struct _blake2s_t
20 uint32_t h[8], t[2], f[2];
21 uint8_t buf[BLAKE2S_BLOCKBYTES];
22 size_t buflen;
23 uint8_t last_node;
25 blake2s_t;
27 void blake2s_init(blake2s_t*const S);
28 void blake2s_update(blake2s_t*const S, const void* const pin, size_t inlen);
29 uint64_t blake2s_final(blake2s_t*const S);
31 uint64_t blake2s_compute(const void* const pin, const size_t inlen);
33 #endif