aboutsummaryrefslogtreecommitdiff
path: root/src/crypto/sha2.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/crypto/sha2.h')
-rw-r--r--src/crypto/sha2.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/crypto/sha2.h b/src/crypto/sha2.h
index 001bfc647c..088d5e194c 100644
--- a/src/crypto/sha2.h
+++ b/src/crypto/sha2.h
@@ -16,9 +16,11 @@ private:
size_t bytes;
public:
+ static const size_t OUTPUT_SIZE = 32;
+
CSHA256();
CSHA256& Write(const unsigned char *data, size_t len);
- void Finalize(unsigned char *hash);
+ void Finalize(unsigned char hash[OUTPUT_SIZE]);
CSHA256& Reset();
};
@@ -30,9 +32,11 @@ private:
size_t bytes;
public:
+ static const size_t OUTPUT_SIZE = 64;
+
CSHA512();
CSHA512& Write(const unsigned char *data, size_t len);
- void Finalize(unsigned char *hash);
+ void Finalize(unsigned char hash[OUTPUT_SIZE]);
CSHA512& Reset();
};
@@ -43,12 +47,14 @@ private:
CSHA512 inner;
public:
+ static const size_t OUTPUT_SIZE = 64;
+
CHMAC_SHA512(const unsigned char *key, size_t keylen);
CHMAC_SHA512& Write(const unsigned char *data, size_t len) {
inner.Write(data, len);
return *this;
}
- void Finalize(unsigned char *hash);
+ void Finalize(unsigned char hash[OUTPUT_SIZE]);
};
#endif