SHA256.h
Go to the documentation of this file.
1 /* LibTomCrypt, modular cryptographic library -- Tom St Denis
2  *
3  * LibTomCrypt is a library that provides various cryptographic
4  * algorithms in a highly modular and flexible manner.
5  *
6  * The library is free for all purposes without any express
7  * guarantee it works.
8  */
9 #include <cstdint>
10 #ifdef __cplusplus
11 extern "C"
12 {
13 #endif
14 typedef uint8_t ulong8;
15 typedef uint32_t ulong32;
16 typedef uint64_t ulong64;
17 
18 struct sha256_state {
21  unsigned char buf[64];
22 };
23 
24 /* error codes [will be expanded in future releases] */
25 enum
26 {
27  CRYPT_OK = 0, /* Result OK */
28  CRYPT_FAIL_TESTVECTOR, /* Algorithm failed test vectors */
29  CRYPT_INVALID_ARG, /* Generic invalid argument */
30  CRYPT_HASH_OVERFLOW /* Hash applied to too many bits */
31 };
32 
33 typedef union Hash_state
34 {
36  void* data;
37 } hash_state;
38 
39 int sha256_init(hash_state* md);
40 int sha256_process(hash_state* md, const ulong8* in, ulong32 inlen);
41 int sha256_done(hash_state* md, ulong8* hash);
42 #ifdef __cplusplus
43 }
44 #endif
sha256_init
int sha256_init(hash_state *md)
Definition: SHA256.cpp:163
Hash_state::data
void * data
Definition: SHA256.h:36
sha256_done
int sha256_done(hash_state *md, ulong8 *hash)
Hash_state
Definition: SHA256.h:33
ulong64
uint64_t ulong64
Definition: SHA256.h:16
sha256_state::state
ulong32 state[8]
Definition: SHA256.h:20
ulong32
uint32_t ulong32
Definition: SHA256.h:15
sha256_state::length
ulong64 length
Definition: SHA256.h:19
ulong8
uint8_t ulong8
Definition: SHA256.h:14
sha256_state::curlen
ulong32 curlen
Definition: SHA256.h:20
sha256_state::buf
unsigned char buf[64]
Definition: SHA256.h:21
Hash_state::sha256
struct sha256_state sha256
Definition: SHA256.h:35
CRYPT_HASH_OVERFLOW
@ CRYPT_HASH_OVERFLOW
Definition: SHA256.h:30
hash_state
union Hash_state hash_state
sha256_process
int sha256_process(hash_state *md, const ulong8 *in, ulong32 inlen)
Definition: SHA256.cpp:195
CRYPT_OK
@ CRYPT_OK
Definition: SHA256.h:27
CRYPT_FAIL_TESTVECTOR
@ CRYPT_FAIL_TESTVECTOR
Definition: SHA256.h:28
CRYPT_INVALID_ARG
@ CRYPT_INVALID_ARG
Definition: SHA256.h:29
sha256_state
Definition: SHA256.h:18


sick_visionary_ros
Author(s): SICK AG TechSupport 3D Snapshot
autogenerated on Thu Feb 8 2024 03:48:29