2 // Copyright (c) 2016-2019 Vinnie Falco (vinnie dot falco at gmail dot com)
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // Official repository: https://github.com/boostorg/beast
10 #ifndef BOOST_BEAST_DETAIL_SHA1_HPP
11 #define BOOST_BEAST_DETAIL_SHA1_HPP
13 #include <boost/beast/core/detail/config.hpp>
17 // Based on https://github.com/vog/sha1
20 Steve Reid (Original C Code)
21 Bruce Guenter (Small changes to fit into bglibs)
22 Volker Grabsch (Translation to simpler C++ Code)
23 Eugene Hopkinson (Safety improvements)
24 Vincent Falco (beast adaptation)
33 static std::size_t constexpr BLOCK_INTS = 16;
34 static std::size_t constexpr BLOCK_BYTES = 64;
35 static std::size_t constexpr DIGEST_BYTES = 20;
41 static unsigned int constexpr block_size = sha1::BLOCK_BYTES;
42 static unsigned int constexpr digest_size = 20;
46 std::uint32_t digest[5];
47 std::uint8_t buf[block_size];
52 init(sha1_context& ctx) noexcept;
59 std::size_t size) noexcept;
65 void* digest) noexcept;
71 #ifdef BOOST_BEAST_HEADER_ONLY
72 #include <boost/beast/core/detail/sha1.ipp>