Loading...
Searching...
No Matches
sha512_common.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2023 TU Dresden
3 *
4 * This file is subject to the terms and conditions of the GNU Lesser
5 * General Public License v2.1. See the file LICENSE in the top level
6 * directory for more details.
7 */
8
9#pragma once
10
22
23#include <string.h>
24#include <stdint.h>
25
26#ifdef __cplusplus
27extern "C" {
28#endif
29
33typedef struct {
35 uint64_t state[8];
37 uint64_t count[2];
39 unsigned char buf[128];
41
48
56void sha512_common_update(sha512_common_context_t *ctx, const void *data, size_t len);
57
66void sha512_common_final(sha512_common_context_t *ctx, void *digest, size_t dig_len);
67
68#ifdef __cplusplus
69}
70#endif
71
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