@@ -66,6 +66,7 @@ class algorithm
6666
6767 // / Byte-based types.
6868 using byte_t = uint8_t ;
69+ using quart_t = std_array<byte_t , to_half(SHA::chunk_words) * SHA::word_bytes>;
6970 using half_t = std_array<byte_t , SHA::chunk_words * SHA::word_bytes>;
7071 using block_t = std_array<byte_t , SHA::block_words * SHA::word_bytes>;
7172 using digest_t = std_array<byte_t , bytes<SHA::digest>>;
@@ -76,7 +77,7 @@ class algorithm
7677 using iblocks_t = iterable<block_t >;
7778 using digests_t = std::vector<digest_t >;
7879
79- // / Constants .
80+ // / Count types .
8081 // / -----------------------------------------------------------------------
8182
8283 // / count_t is uint64_t (sha160/256) or uint128_t (sha512).
@@ -91,11 +92,14 @@ class algorithm
9192
9293 // / Single hashing.
9394 // / -----------------------------------------------------------------------
95+
9496 template <size_t Size>
9597 static constexpr digest_t hash (const ablocks_t <Size>& blocks) NOEXCEPT;
9698 static constexpr digest_t hash (const block_t & block) NOEXCEPT;
9799 static constexpr digest_t hash (const half_t & half) NOEXCEPT;
98100 static constexpr digest_t hash (const half_t & left, const half_t & right) NOEXCEPT;
101+ static constexpr digest_t hash (const quart_t & left, const quart_t & right) NOEXCEPT;
102+ static constexpr digest_t hash (uint8_t byte) NOEXCEPT;
99103 static digest_t hash (iblocks_t && blocks) NOEXCEPT;
100104
101105 // / Double hashing (sha256/512).
@@ -232,6 +236,8 @@ class algorithm
232236 // / -----------------------------------------------------------------------
233237
234238 INLINE static constexpr void input (buffer_t & buffer, const block_t & block) NOEXCEPT;
239+ INLINE static constexpr void input_left (auto & buffer, const quart_t & quarter) NOEXCEPT;
240+ INLINE static constexpr void input_right (auto & buffer, const quart_t & quarter) NOEXCEPT;
235241 INLINE static constexpr void input_left (auto & buffer, const half_t & half) NOEXCEPT;
236242 INLINE static constexpr void input_right (auto & buffer, const half_t & half) NOEXCEPT;
237243 INLINE static constexpr void inject_left (auto & buffer, const auto & left) NOEXCEPT;
@@ -403,6 +409,7 @@ class algorithm
403409 static digest_t native_hash (const block_t & block) NOEXCEPT;
404410 static digest_t native_hash (const half_t & half) NOEXCEPT;
405411 static digest_t native_hash (const half_t & left, const half_t & right) NOEXCEPT;
412+ static digest_t native_hash (uint8_t byte) NOEXCEPT;
406413
407414 static digest_t native_double_hash (const block_t & block) NOEXCEPT;
408415 static digest_t native_double_hash (const half_t & half) NOEXCEPT;
0 commit comments