/** * @file SHA.h * @author apio (cloudapio.eu) * @brief SHA256 algorithm implementation. * * @copyright Copyright (c) 2024, the Luna authors. * */ #pragma once #include #include /** * @brief A class to calculate a SHA256 hash. * */ class SHA256 { public: /** * @brief Add data to the hash. * * @param data The data to add. * @param size The amount of bytes to add. */ Result append(const u8* data, usize size); /** * @brief Calculate the final hash. * * @return Buffer The calculated hash. */ Result digest(); static Result hash_to_string(const Buffer& buffer); private: Buffer m_message; };