-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsha512.hpp
28 lines (26 loc) · 1.69 KB
/
sha512.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
28
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
// http://ru.wikipedia.org/wiki/SHA-2
// wrapper for SHA512 from http://ftp.gnu.org/gnu/coreutils/coreutils-8.21.tar.xz
// Alexey Potehin <[email protected]>, http://www.gnuplanet.ru/doc/cv
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef SHA512_HPP_INCLUDE
#define SHA512_HPP_INCLUDE
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdint.h>
#include <config.h>
#include "sha512.h"
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
class sha512_t
{
public:
typedef uint8_t sha512_item_t[512 / 8];
sha512_t();
void open(sha512_item_t *psha512_item);
void update(const void * const p, uint64_t size);
void close();
private:
struct sha512_ctx ctx;
sha512_item_t *psha512_item;
};
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif