Add SHA-1 hashing support
All checks were successful
Builds / ExectOS (amd64, release) (push) Successful in 33s
Builds / ExectOS (amd64, debug) (push) Successful in 35s
Builds / ExectOS (i686, debug) (push) Successful in 56s
Builds / ExectOS (i686, release) (push) Successful in 54s

This commit is contained in:
2026-02-19 18:49:29 +01:00
parent 94a8917c5c
commit d1553ff84a
6 changed files with 378 additions and 1 deletions

View File

@@ -19,6 +19,7 @@
#include <rtl/llist.hh>
#include <rtl/math.hh>
#include <rtl/memory.hh>
#include <rtl/sha1.hh>
#include <rtl/string.hh>
#include <rtl/widestr.hh>

View File

@@ -0,0 +1,37 @@
/**
* PROJECT: ExectOS
* COPYRIGHT: See COPYING.md in the top level directory
* FILE: xtoskrnl/includes/rtl/sha1.hh
* DESCRIPTION: SHA1 computation support
* DEVELOPERS: Rafal Kupiec <belliash@codingworkshop.eu.org>
*/
#ifndef __XTOSKRNL_RTL_SHA1_HH
#define __XTOSKRNL_RTL_SHA1_HH
#include <xtos.hh>
/* Runtime Library */
namespace RTL
{
class SHA1
{
public:
STATIC XTAPI XTSTATUS ComputeDigest(IN PCUCHAR Buffer,
IN SIZE_T BufferSize,
OUT PUCHAR Digest);
private:
STATIC XTAPI VOID ComputeHash(IN OUT PRTL_SHA1_CONTEXT Context,
OUT PUCHAR Digest);
STATIC XTAPI VOID HashData(IN OUT PRTL_SHA1_CONTEXT Context,
IN PCUCHAR Data,
IN ULONG Length);
STATIC XTAPI XTSTATUS InitializeContext(OUT PRTL_SHA1_CONTEXT Context);
STATIC XTAPI VOID TransformData(IN OUT PULONG State,
IN PCUCHAR Buffer);
};
}
#endif /* __XTOSKRNL_RTL_SHA1_HH */