|
@@ -72,16 +72,8 @@ constexpr static u64 InitializationHashes[8] = {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
-template<size_t Bytes>
|
|
|
-struct SHA2Digest {
|
|
|
- u8 data[Bytes];
|
|
|
- constexpr static size_t Size = Bytes;
|
|
|
- const u8* immutable_data() const { return data; }
|
|
|
- size_t data_length() const { return Bytes; }
|
|
|
-};
|
|
|
-
|
|
|
// FIXME: I want template<size_t BlockSize> but the compiler gets confused
|
|
|
-class SHA256 final : public HashFunction<512, SHA2Digest<256 / 8>> {
|
|
|
+class SHA256 final : public HashFunction<512, 256> {
|
|
|
public:
|
|
|
using HashFunction::update;
|
|
|
|
|
@@ -131,7 +123,7 @@ private:
|
|
|
constexpr static auto Rounds = 64;
|
|
|
};
|
|
|
|
|
|
-class SHA384 final : public HashFunction<1024, SHA2Digest<384 / 8>> {
|
|
|
+class SHA384 final : public HashFunction<1024, 384> {
|
|
|
public:
|
|
|
using HashFunction::update;
|
|
|
|
|
@@ -181,7 +173,7 @@ private:
|
|
|
constexpr static auto Rounds = 80;
|
|
|
};
|
|
|
|
|
|
-class SHA512 final : public HashFunction<1024, SHA2Digest<512 / 8>> {
|
|
|
+class SHA512 final : public HashFunction<1024, 512> {
|
|
|
public:
|
|
|
using HashFunction::update;
|
|
|
|