-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsha1.hpp
27 lines (25 loc) · 1.65 KB
/
sha1.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://ru.wikipedia.org/wiki/SHA1
// wrapper for SHA1 from http://ftp.gnu.org/gnu/coreutils/coreutils-8.21.tar.xz
// Alexey Potehin <[email protected]>, http://www.gnuplanet.ru/doc/cv
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#ifndef SHA1_HPP_INCLUDE
#define SHA1_HPP_INCLUDE
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#include <stdint.h>
#include "sha1.h"
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
class sha1_t
{
public:
typedef uint8_t sha1_item_t[SHA1_DIGEST_SIZE];
sha1_t();
void open(sha1_item_t *psha1_item);
void update(const void * const p, uint64_t size);
void close();
private:
struct sha1_ctx ctx;
sha1_item_t *psha1_item;
};
//-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
#endif