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 
21 #ifndef HASHES_SHA512_COMMON_H
22 #define HASHES_SHA512_COMMON_H
23 
24 #include <string.h>
25 #include <stdint.h>
26 
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30 
34 typedef struct {
36  uint64_t state[8];
38  uint64_t count[2];
40  unsigned char buf[128];
42 
49 
57 void sha512_common_update(sha512_common_context_t *ctx, const void *data, size_t len);
58 
67 void sha512_common_final(sha512_common_context_t *ctx, void *digest, size_t dig_len);
68 
69 #ifdef __cplusplus
70 }
71 #endif
72 
74 #endif /* HASHES_SHA512_COMMON_H */
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.
Definition: sha512_common.h:34