Added NzInputStream
Added NzFile::Read(buffer, size) NzFile::Read(nullptr, size) now acts as a skip function (ex: SetCursorPos(GetCursorPos() + size)
This commit is contained in:
@@ -761,15 +761,18 @@ void SHA256_End(SHA_CTX* context, nzUInt8* digest)
|
||||
|
||||
|
||||
/*** SHA-224: *********************************************************/
|
||||
void SHA224_Init(SHA_CTX* context) {
|
||||
void SHA224_Init(SHA_CTX* context)
|
||||
{
|
||||
SHA256_Internal_Init(context, sha224_initial_hash_value);
|
||||
}
|
||||
|
||||
void SHA224_Internal_Transform(SHA_CTX* context, const nzUInt32* data) {
|
||||
void SHA224_Internal_Transform(SHA_CTX* context, const nzUInt32* data)
|
||||
{
|
||||
SHA256_Internal_Transform(context, data);
|
||||
}
|
||||
|
||||
void SHA224_Update(SHA_CTX* context, const nzUInt8 *data, std::size_t len) {
|
||||
void SHA224_Update(SHA_CTX* context, const nzUInt8 *data, std::size_t len)
|
||||
{
|
||||
SHA256_Update(context, data, len);
|
||||
}
|
||||
|
||||
@@ -807,7 +810,8 @@ void SHA512_Internal_Init(SHA_CTX* context, const nzUInt64* ihv)
|
||||
context->s512.bitcount[0] = context->s512.bitcount[1] = 0;
|
||||
}
|
||||
|
||||
void SHA512_Init(SHA_CTX* context) {
|
||||
void SHA512_Init(SHA_CTX* context)
|
||||
{
|
||||
SHA512_Internal_Init(context, sha512_initial_hash_value);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
#ifndef NAZARA_HASH_SHA2_INTERNAL_HPP
|
||||
#define NAZARA_HASH_SHA2_INTERNAL_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
/* Digest lengths for SHA-1/224/256/384/512 */
|
||||
#define SHA1_DIGEST_LENGTH 20
|
||||
#define SHA1_DIGEST_STRING_LENGTH (SHA1_DIGEST_LENGTH * 2 + 1)
|
||||
@@ -54,8 +56,6 @@
|
||||
#define SHA512_DIGEST_LENGTH 64
|
||||
#define SHA512_DIGEST_STRING_LENGTH (SHA512_DIGEST_LENGTH * 2 + 1)
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
|
||||
union SHA_CTX
|
||||
{
|
||||
/* SHA-1 uses this part of the union: */
|
||||
|
||||
Reference in New Issue
Block a user