forked from adiasg/blockchain-cpp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhash.h
More file actions
32 lines (24 loc) · 667 Bytes
/
hash.h
File metadata and controls
32 lines (24 loc) · 667 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#ifndef HASH_H
#define HASH_H
#include <stdint.h>
#include <stddef.h>
/**
Computes SHA-256 hash of message and stores in digest.
@param digest Array to store computed hash
@param message Message to be hashed
@param len Length of message
*/
void sha256(uint8_t *digest, const uint8_t *message, size_t len);
/**
Computes double SHA-256 hash of message and stores in digest.
@param digest Array to store computed hash
@param message Message to be hashed
@param len Length of message
*/
void hash256(uint8_t *digest, const uint8_t *message, size_t len);
/**
Prints 256-bit hash.
@param hash Array to stored hash
*/
void printHash(uint8_t *hash);
#endif