diff options
author | vnugent <public@vaughnnugent.com> | 2023-12-20 18:33:32 -0500 |
---|---|---|
committer | vnugent <public@vaughnnugent.com> | 2023-12-20 18:33:32 -0500 |
commit | 43542a261ec0789c7e48551ea5f9eaefa8c4b772 (patch) | |
tree | 35d136732bf2a44780a156da6f9963d1ebb2201d /lib/Utils.Cryptography/monocypher/blake2b.h | |
parent | 546abea662263ef112c571c29706c47e875e09c4 (diff) |
monocypher vendor and wrapper started, and partial public api updates
Diffstat (limited to 'lib/Utils.Cryptography/monocypher/blake2b.h')
-rw-r--r-- | lib/Utils.Cryptography/monocypher/blake2b.h | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Utils.Cryptography/monocypher/blake2b.h b/lib/Utils.Cryptography/monocypher/blake2b.h new file mode 100644 index 0000000..4167aca --- /dev/null +++ b/lib/Utils.Cryptography/monocypher/blake2b.h @@ -0,0 +1,43 @@ +/* +* Copyright (c) 2023 Vaughn Nugent +* +* vnlib_monocypher is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published +* by the Free Software Foundation, either version 2 of the License, +* or (at your option) any later version. +* +* vnlib_monocypher is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +* General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with vnlib_monocypher. If not, see http://www.gnu.org/licenses/. +*/ + +#pragma once +#ifndef VN_MONOCYPHER_BLAKE2_H + +#include <stdint.h> +#include "util.h" + +#define ERR_HASH_LEN_INVALID -16 +#define ERR_KEY_LEN_INVALID -17 +#define ERR_KEY_PTR_INVALID -18 + +#define MC_MAX_HASH_SIZE 64 +#define MC_MAX_KEY_SIZE 64 + +#define BLAKE2B_RESULT_SUCCESS 0 + +VNLIB_EXPORT uint32_t VNLIB_CC Blake2GetContextSize(void); + +VNLIB_EXPORT int32_t VNLIB_CC Blake2Init(void* context, uint32_t hashlen, const void* key, uint32_t keylen); + +VNLIB_EXPORT int32_t VNLIB_CC Blake2Update(void* context, const void* data, uint32_t datalen); + +VNLIB_EXPORT int32_t VNLIB_CC Blake2Final(void* context, void* hash, uint32_t hashlen); + +VNLIB_EXPORT int32_t VNLIB_CC Blake2GetHashSize(void* context); + +#endif |