// Copyright (C) 2015 Jérôme Leclercq // This file is part of the "Nazara Engine - Core module" // For conditions of distribution and use, see copyright notice in Config.hpp #include #include #include namespace Nz { HashSHA1::HashSHA1() { m_state = new SHA_CTX; } HashSHA1::~HashSHA1() { delete m_state; } void HashSHA1::Append(const UInt8* data, unsigned int len) { SHA1_Update(m_state, data, len); } void HashSHA1::Begin() { SHA1_Init(m_state); } ByteArray HashSHA1::End() { UInt8 digest[SHA1_DIGEST_LENGTH]; SHA1_End(m_state, digest); return ByteArray(digest, SHA1_DIGEST_LENGTH); } unsigned int HashSHA1::GetDigestLength() const { return SHA1_DIGEST_LENGTH; } const char* HashSHA1::GetHashName() const { return "SHA1"; } }