@@ -67,8 +67,9 @@ class sha3_base final {
6767 [[nodiscard(" Digest is the function return value" )]] BOOST_CRYPT_GPU_ENABLED_CONSTEXPR
6868 auto get_digest () noexcept -> compat::expected<return_type, state>;
6969
70+ template <compat::size_t Extent>
7071 [[nodiscard]] BOOST_CRYPT_GPU_ENABLED_CONSTEXPR
71- auto get_digest (compat::span<compat::byte> data) noexcept -> state;
72+ auto get_digest (compat::span<compat::byte, Extent > data) noexcept -> state;
7273
7374 template <concepts::writable_output_range Range>
7475 [[nodiscard]] BOOST_CRYPT_GPU_ENABLED auto get_digest (Range&& data) noexcept -> state;
@@ -357,8 +358,9 @@ auto sha3_base<digest_size, is_xof>::get_digest() noexcept -> compat::expected<r
357358}
358359
359360template <compat::size_t digest_size, bool is_xof>
361+ template <compat::size_t Extent>
360362[[nodiscard]] BOOST_CRYPT_GPU_ENABLED_CONSTEXPR auto
361- sha3_base<digest_size, is_xof>::get_digest(compat::span<compat::byte> data) noexcept -> state
363+ sha3_base<digest_size, is_xof>::get_digest(compat::span<compat::byte, Extent > data) noexcept -> state
362364{
363365 if (!computed_ || corrupted_)
364366 {
@@ -398,6 +400,11 @@ template <concepts::writable_output_range Range>
398400{
399401 using value_type = compat::range_value_t <Range>;
400402
403+ if (!computed_ || corrupted_)
404+ {
405+ return state::state_error;
406+ }
407+
401408 auto data_span {compat::span<value_type>(compat::forward<Range>(data))};
402409
403410 #if defined(__clang__) && __clang_major__ >= 19
@@ -407,7 +414,7 @@ template <concepts::writable_output_range Range>
407414
408415 if constexpr (is_xof)
409416 {
410- return get_digest (compat::span<compat::byte>(compat::as_writable_bytes (data_span).data ()));
417+ xof_digest_impl (compat::span<compat::byte>(compat::as_writable_bytes (data_span).data ()));
411418 }
412419 else
413420 {
@@ -416,7 +423,7 @@ template <concepts::writable_output_range Range>
416423 return state::insufficient_output_length;
417424 }
418425
419- return get_digest (
426+ sha_digest_impl (
420427 compat::span<compat::byte, digest_size>(
421428 compat::as_writable_bytes (data_span).data (),
422429 digest_size
@@ -427,6 +434,8 @@ template <concepts::writable_output_range Range>
427434 #if defined(__clang__) && __clang_major__ >= 19
428435 #pragma clang diagnostic pop
429436 #endif
437+
438+ return state::success;
430439}
431440
432441} // namespace boost::crypt::hash_detail
0 commit comments