DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
hash_ctxt.h
Go to the documentation of this file.
1
#ifndef BASE_HASH_CTXT_H
2
#define BASE_HASH_CTXT_H
3
4
#include "
hash.h
"
5
6
#include <cstdint>
7
8
#if defined(CONF_OPENSSL)
9
#include <openssl/md5.h>
10
#include <openssl/sha.h>
11
#else
12
#include <engine/external/md5/md5.h>
13
#endif
14
15
#if defined(CONF_OPENSSL)
16
// SHA256_CTX is defined in <openssl/sha.h>
17
#else
18
struct
SHA256_CTX
19
{
20
uint64_t
length
;
21
uint32_t state[8];
22
uint32_t curlen;
23
unsigned
char
buf[64];
24
};
25
typedef
md5_state_t MD5_CTX;
26
#endif
27
28
void
sha256_init
(SHA256_CTX *ctxt);
29
void
sha256_update
(SHA256_CTX *ctxt,
const
void
*data,
size_t
data_len);
30
SHA256_DIGEST
sha256_finish
(SHA256_CTX *ctxt);
31
32
void
md5_init
(MD5_CTX *ctxt);
// NOLINT(readability-redundant-declaration, readability-inconsistent-declaration-parameter-name)
33
void
md5_update
(MD5_CTX *ctxt,
const
void
*data,
size_t
data_len);
34
MD5_DIGEST
md5_finish
(MD5_CTX *ctxt);
35
36
#endif
// BASE_HASH_CTXT_H
hash.h
sha256_update
void sha256_update(SHA256_CTX *ctxt, const void *data, size_t data_len)
Definition
hash_openssl.cpp:14
sha256_finish
SHA256_DIGEST sha256_finish(SHA256_CTX *ctxt)
Definition
hash_openssl.cpp:19
md5_update
void md5_update(MD5_CTX *ctxt, const void *data, size_t data_len)
Definition
hash_openssl.cpp:31
md5_finish
MD5_DIGEST md5_finish(MD5_CTX *ctxt)
Definition
hash_openssl.cpp:36
md5_init
void md5_init(MD5_CTX *ctxt)
Definition
hash_openssl.cpp:26
sha256_init
void sha256_init(SHA256_CTX *ctxt)
Definition
hash_openssl.cpp:9
MD5_DIGEST
Definition
hash.h:17
SHA256_DIGEST
Definition
hash.h:12
length
float length(const vector2_base< T > &a)
Definition
vmath.h:113
src
base
hash_ctxt.h
Generated by
1.18.0