#ifndef HASH_RIPEMD128_2019_04_10_H #define HASH_RIPEMD128_2019_04_10_H #include #include #if(__cplusplus >= 201703L) namespace al::crypto::stream::hash { #else namespace al { namespace crypto { namespace stream { namespace hash { #endif class hash_ripemd256 : public al::crypto::stream::hash::hash_ripemd_128_256_base<256U> // NOLINT(cppcoreguidelines-special-member-functions,hicpp-special-member-functions) { private: using base_class_type = al::crypto::stream::hash::hash_ripemd_128_256_base<256U>; public: hash_ripemd256() = default; hash_ripemd256(const hash_ripemd256& other) = default; ~hash_ripemd256() override = default; auto initialize() -> void override { base_class_type::initialize(); base_class_type::transform_context[4U] = UINT32_C(0x76543210); base_class_type::transform_context[5U] = UINT32_C(0xFEDCBA98); base_class_type::transform_context[6U] = UINT32_C(0x89ABCDEF); base_class_type::transform_context[7U] = UINT32_C(0x01234567); } private: auto transform() -> void override { base_class_type::aaa = base_class_type::transform_context[4U]; base_class_type::bbb = base_class_type::transform_context[5U]; base_class_type::ccc = base_class_type::transform_context[6U]; base_class_type::ddd = base_class_type::transform_context[7U]; // Do the transformation rounds. transform_round(); // Combine the results. base_class_type::transform_context[0U] += base_class_type::aa; base_class_type::transform_context[1U] += base_class_type::bb; base_class_type::transform_context[2U] += base_class_type::cc; base_class_type::transform_context[3U] += base_class_type::dd; base_class_type::transform_context[4U] += base_class_type::aaa; base_class_type::transform_context[5U] += base_class_type::bbb; base_class_type::transform_context[6U] += base_class_type::ccc; base_class_type::transform_context[7U] += base_class_type::ddd; base_class_type::message_buffer.fill(0U); base_class_type::message_index = 0U; } auto swap_left_right(std::uint32_t& x, std::uint32_t& y) const -> void override { std::swap(x, y); } }; #if(__cplusplus >= 201703L) } // namespace al::crypto::stream::hash #else } // namespace hash } // namespace stream } // namespace crypto } // namespace al #endif #endif // HASH_RIPEMD128_2019_04_10_H