Toggle navigation
Documentation
The friendly Operating System for the Internet of Things
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
24
extern
"C"
{
25
#endif
26
30
typedef
struct
{
32
uint64_t
state
[8];
34
uint64_t
count
[2];
36
unsigned
char
buf
[128];
37
}
sha512_common_context_t
;
38
44
void
sha512_common_pad
(
sha512_common_context_t
*ctx);
45
53
void
sha512_common_update
(
sha512_common_context_t
*ctx,
const
void
*data,
size_t
len);
54
63
void
sha512_common_final
(
sha512_common_context_t
*ctx,
void
*digest,
size_t
dig_len);
64
65
#ifdef __cplusplus
66
}
67
#endif
68
sha512_common_pad
void sha512_common_pad(sha512_common_context_t *ctx)
SHA-512 initialization.
sha512_common_update
void sha512_common_update(sha512_common_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
sha512_common_final
void sha512_common_final(sha512_common_context_t *ctx, void *digest, size_t dig_len)
SHA-512 finalization.
sha512_common_context_t
Structure to hold the SHA-512 context.
Definition
sha512_common.h:30
sha512_common_context_t::buf
unsigned char buf[128]
data buffer
Definition
sha512_common.h:36
sha512_common_context_t::count
uint64_t count[2]
processed bits counter
Definition
sha512_common.h:34
sha512_common_context_t::state
uint64_t state[8]
global state
Definition
sha512_common.h:32
Generated on Sat Jul 25 2026 21:37:44 by
1.13.2