Loading...
Searching...
No Matches
sha512_common.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2023 TU Dresden
3 * SPDX-License-Identifier: LGPL-2.1-only
4 */
5
6#pragma once
7
19
20#include <string.h>
21#include <stdint.h>
22
23#ifdef __cplusplus
24extern "C" {
25#endif
26
30typedef struct {
32 uint64_t state[8];
34 uint64_t count[2];
36 unsigned char buf[128];
38
45
53void sha512_common_update(sha512_common_context_t *ctx, const void *data, size_t len);
54
63void sha512_common_final(sha512_common_context_t *ctx, void *digest, size_t dig_len);
64
65#ifdef __cplusplus
66}
67#endif
68
void sha512_common_pad(sha512_common_context_t *ctx)
SHA-512 initialization.
void sha512_common_update(sha512_common_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
void sha512_common_final(sha512_common_context_t *ctx, void *digest, size_t dig_len)
SHA-512 finalization.
Structure to hold the SHA-512 context.
unsigned char buf[128]
data buffer
uint64_t count[2]
processed bits counter
uint64_t state[8]
global state