sha512.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 
20 #include <inttypes.h>
21 #include <stddef.h>
22 
23 #include "hashes/sha512_common.h"
24 
25 #ifdef __cplusplus
26 extern "C" {
27 #endif
28 
32 #define SHA512_DIGEST_LENGTH (64)
33 
37 #define SHA512_INTERNAL_BLOCK_SIZE (128)
38 
43 
50 
58 static inline void sha512_update(sha512_context_t *ctx, const void *data, size_t len)
59 {
60  sha512_common_update(ctx, data, len);
61 }
62 
71 static inline void sha512_final(sha512_context_t *ctx, void *digest)
72 {
74 }
75 
85 void sha512(const void *data, size_t len, void *digest);
86 
87 #ifdef __cplusplus
88 }
89 #endif
90 
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.
void sha512_init(sha512_context_t *ctx)
SHA-512 initialization.
#define SHA512_DIGEST_LENGTH
Length of SHA512 digests in bytes.
Definition: sha512.h:32
void sha512(const void *data, size_t len, void *digest)
A wrapper function to simplify the generation of a hash.
static void sha512_final(sha512_context_t *ctx, void *digest)
SHA-512 finalization.
Definition: sha512.h:71
static void sha512_update(sha512_context_t *ctx, const void *data, size_t len)
Add bytes into the hash.
Definition: sha512.h:58
sha512_common_context_t sha512_context_t
Context for cipher operations based on sha512.
Definition: sha512.h:42
Adds include for missing inttype definitions.
Common definitions for the SHA-512 hash function.
Structure to hold the SHA-512 context.
Definition: sha512_common.h:30