#pragma once #include #include #include #include namespace Void::Crypto::Detail { void builtin_secure_wipe(std::span buffer) noexcept; [[nodiscard]] bool builtin_constant_time_equal(std::span lhs, std::span rhs) noexcept; class BuiltinHasher { public: BuiltinHasher() noexcept = default; ~BuiltinHasher() noexcept; BuiltinHasher(BuiltinHasher&& other) noexcept; BuiltinHasher& operator=(BuiltinHasher&& other) noexcept; BuiltinHasher(const BuiltinHasher&) = delete; BuiltinHasher& operator=(const BuiltinHasher&) = delete; [[nodiscard]] bool init(HashAlgorithm algorithm) noexcept; void update(std::span data) noexcept; [[nodiscard]] Digest finalize(); private: struct State; State* m_state{nullptr}; void destroy() noexcept; }; void builtin_hmac_sha256(std::span secret_key, std::span message, std::span output_32) noexcept; void builtin_hkdf_sha256(std::span secret_input, std::span salt, std::span context, std::span secret_output) noexcept; } // namespace Void::Crypto::Detail