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
10enum hasherror_t {
11 HASH_ERROR_SUCCESS=0,
12 HASH_ERROR_NULL,
13 HASH_ERROR_INVALID_SALT_SIZE,
14 HASH_ERROR_INPUT_TOO_LONG,
15 HASH_ERROR_STATE_ERROR,
16 HASH_ERROR_UNSUPPORTED
17};
18
20class RUDIMENTS_DLLSPEC hash : virtual public object {
21 public:
24
26 virtual ~hash();
27
29 virtual bool setSalt(const byte_t *salt, size_t size);
30
33 virtual const byte_t *getSalt();
34
36 virtual size_t getSaltSize();
37
41 virtual bool append(const byte_t *data, uint32_t size);
42
46 virtual const byte_t *getHash()=0;
47
49 virtual uint64_t getHashSize();
50
52 virtual hasherror_t getError();
53
62 virtual bool clear();
63
70 virtual bool reset();
71
72 #include <rudiments/private/hash.h>
73};
74
75#endif
Definition hash.h:20
virtual const byte_t * getSalt()
virtual size_t getSaltSize()
virtual bool clear()
virtual ~hash()
virtual const byte_t * getHash()=0
virtual bool reset()
virtual hasherror_t getError()
virtual bool setSalt(const byte_t *salt, size_t size)
virtual bool append(const byte_t *data, uint32_t size)
virtual uint64_t getHashSize()
Definition object.h:10