Implement SHA256::ComputeHash for MacOS
#include "Exceptions.hpp"
#include "SHA256.hpp"
+
+#include "openssl/sha.h"
+
namespace xPlat {
bool SHA256::ComputeHash(
/*in*/ std::uint8_t *buffer,
/*in*/ std::uint32_t cbBuffer,
/*inout*/ std::vector<uint8_t>& hash)
{
- // TODO: Implement here...
- throw Exception(Error::NotImplemented);
+ hash.resize(SHA256_DIGEST_LENGTH);
+ ::SHA256(buffer, cbBuffer, hash.data());
+ return true;
}
} // namespace xPlat {
\ No newline at end of file
