-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsha3_256.hpp
27 lines (25 loc) · 1.75 KB
/
sha3_256.hpp
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
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// http://en.wikipedia.org/wiki/SHA-3
// wrapper for SHA3_256 for module of GNU/Linux kernel written by Jeff Garzik <[email protected]> from https://lwn.net/Articles/518415/
// Alexey Potehin <[email protected]>, http://www.gnuplanet.ru/doc/cv
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef SHA3_256_HPP_INCLUDE
#define SHA3_256_HPP_INCLUDE
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdint.h>
#include "sha3.h"
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
class sha3_256_t
{
public:
typedef uint8_t sha3_256_item_t[SHA3_256_DIGEST_SIZE];
sha3_256_t();
void open(sha3_256_item_t *psha3_256_item);
void update(const void * const p, uint64_t size);
void close();
private:
struct sha3_state ctx;
sha3_256_item_t *psha3_256_item;
};
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif