Loading...
Searching...
No Matches
sha2xx_common.h
Go to the documentation of this file.
1/*-
2 * SPDX-FileCopyrightText: 2005 Colin Percival
3 * SPDX-FileCopyrightText: 2013 Christian Mehlis & René Kijewski
4 * SPDX-FileCopyrightText: 2016 Martin Landsmann <martin.landsmann@haw-hamburg.de>
5 * SPDX-FileCopyrightText: 2016 OTA keys S.A.
6 * SPDX-FileCopyrightText: 2020 HAW Hamburg
7 * SPDX-License-Identifier: BSD-2-Clause
8 */
9
10#pragma once
11
27
28#include <string.h>
29#include <stdint.h>
30
31#ifdef __cplusplus
32extern "C" {
33#endif
34
38typedef struct {
40 uint32_t state[8];
42 uint32_t count[2];
44 unsigned char buf[64];
46
53
61void sha2xx_update(sha2xx_context_t *ctx, const void *data, size_t len);
62
71void sha2xx_final(sha2xx_context_t *ctx, void *digest, size_t dig_len);
72
73#ifdef __cplusplus
74}
75#endif
76
void sha2xx_pad(sha2xx_context_t *ctx)
SHA-2XX initialization.
void sha2xx_final(sha2xx_context_t *ctx, void *digest, size_t dig_len)
SHA-2XX finalization.
void sha2xx_update(sha2xx_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
Structure to hold the SHA-2XX context.
unsigned char buf[64]
data buffer
uint32_t state[8]
global state
uint32_t count[2]
processed bits counter