2021-07-07 14:23:18 +02:00
|
|
|
#ifndef HASHLIB_SHA256_H
|
|
|
|
#define HASHLIB_SHA256_H
|
|
|
|
|
2022-02-05 16:19:24 +01:00
|
|
|
#include "crypto/hash/sha256.h"
|
2021-07-07 14:23:18 +02:00
|
|
|
|
|
|
|
#include "./hash-library/sha256.h"
|
|
|
|
|
|
|
|
class HashLibSHA256 : public SHA256 {
|
|
|
|
public:
|
2021-11-01 19:16:43 +01:00
|
|
|
String compute(const void *data, size_t num_bytes);
|
|
|
|
String compute(const String &text);
|
2021-07-07 14:23:18 +02:00
|
|
|
|
|
|
|
void add(const void *data, size_t num_bytes);
|
2021-11-01 19:16:43 +01:00
|
|
|
String get_hash();
|
2021-07-07 14:23:18 +02:00
|
|
|
void get_hash(unsigned char *buffer, size_t buffer_len);
|
|
|
|
|
|
|
|
void reset();
|
|
|
|
|
|
|
|
static void set_as_active_implementation();
|
|
|
|
static void unset_as_active_implementation();
|
|
|
|
|
|
|
|
HashLibSHA256();
|
|
|
|
~HashLibSHA256();
|
|
|
|
|
|
|
|
protected:
|
2022-01-09 15:29:03 +01:00
|
|
|
static Ref<SHA256> _creation_func();
|
2021-07-07 14:23:18 +02:00
|
|
|
|
|
|
|
_SHA256 hasher;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|