#pragma once #include #include #include namespace sunrise::middleware::crypto::sha256 { /** SHA-256 produces 32 bytes. */ inline constexpr std::size_t kDigestSize = 32; /** One finished SHA-256 digest. */ using Digest = std::array; /** * Hashes one buffer. * @param input Bytes to hash. * @param output Receives the digest only on success. * @return True when Windows completed the hash. */ [[nodiscard]] bool hash(std::span input, Digest& output) noexcept; /** * Hashes two buffers as one concatenated message. * The SRP scrambling parameter is defined over a concatenation, so it needs no scratch copy. * @param first Leading bytes. * @param second Trailing bytes. * @param output Receives the digest only on success. * @return True when Windows completed the hash. */ [[nodiscard]] bool hash_pair(std::span first, std::span second, Digest& output) noexcept; } // namespace sunrise::middleware::crypto::sha256