Rudiments
hash.h
1 // Copyright (c) 1999-2018 David Muse
2 // See the COPYING file for more information.
3 
4 #ifndef RUDIMENTS_HASH_H
5 #define RUDIMENTS_HASH_H
6 
7 #include <rudiments/private/hashincludes.h>
8 
10 enum hasherror_t {
11  HASH_ERROR_SUCCESS=0,
12  HASH_ERROR_NULL,
13  HASH_ERROR_INPUT_TOO_LONG,
14  HASH_ERROR_STATE_ERROR,
15  HASH_ERROR_UNSUPPORTED
16 };
17 
19 class RUDIMENTS_DLLSPEC hash {
20  public:
22  hash() {};
23 
25  virtual ~hash() {};
26 
30  virtual bool append(const unsigned char *data,
31  uint32_t size)=0;
32 
36  virtual const unsigned char *getHash()=0;
37 
39  virtual uint64_t getHashSize()=0;
40 
44  virtual bool clear()=0;
45 
47  virtual hasherror_t getError()=0;
48 };
49 
50 #endif
Definition: hash.h:19
virtual uint64_t getHashSize()=0
virtual bool append(const unsigned char *data, uint32_t size)=0
virtual ~hash()
Definition: hash.h:25
virtual hasherror_t getError()=0
virtual bool clear()=0
hash()
Definition: hash.h:22
virtual const unsigned char * getHash()=0