File indexing completed on 2025-01-18 09:29:24
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef BOOST_BEAST_DETAIL_SHA1_HPP
0011 #define BOOST_BEAST_DETAIL_SHA1_HPP
0012
0013 #include <boost/beast/core/detail/config.hpp>
0014 #include <cstdint>
0015 #include <cstddef>
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027 namespace boost {
0028 namespace beast {
0029 namespace detail {
0030
0031 namespace sha1 {
0032
0033 static std::size_t constexpr BLOCK_INTS = 16;
0034 static std::size_t constexpr BLOCK_BYTES = 64;
0035 static std::size_t constexpr DIGEST_BYTES = 20;
0036
0037 }
0038
0039 struct sha1_context
0040 {
0041 static unsigned int constexpr block_size = sha1::BLOCK_BYTES;
0042 static unsigned int constexpr digest_size = 20;
0043
0044 std::size_t buflen;
0045 std::size_t blocks;
0046 std::uint32_t digest[5];
0047 std::uint8_t buf[block_size];
0048 };
0049
0050 BOOST_BEAST_DECL
0051 void
0052 init(sha1_context& ctx) noexcept;
0053
0054 BOOST_BEAST_DECL
0055 void
0056 update(
0057 sha1_context& ctx,
0058 void const* message,
0059 std::size_t size) noexcept;
0060
0061 BOOST_BEAST_DECL
0062 void
0063 finish(
0064 sha1_context& ctx,
0065 void* digest) noexcept;
0066
0067 }
0068 }
0069 }
0070
0071 #ifdef BOOST_BEAST_HEADER_ONLY
0072 #include <boost/beast/core/detail/sha1.ipp>
0073 #endif
0074
0075 #endif