Compare commits

...
Author SHA1 Message Date
t3hn3rd 111ebe9e74 feature: SHA-1 Hashing
continuous-integration/drone/push Build is passing
- Add SHA-1 hashing implementation with Init/Update/Final API and inline test in kernel,
  following the same interface as MD5 & the fpc rtl.
2026-03-05 23:36:07 +00:00
t3hn3rd 9fa1c859ac Merge pull request 'feature: preemptive process management & TCP/IP barebones' (#41) from feature/process-management into develop
continuous-integration/drone/push Build is passing
Reviewed-on: #41
Reviewed-by: Aaron Hance <[email protected]>
2026-03-04 20:04:24 +00:00
2 changed files with 234 additions and 1 deletions

No files matched your search

File diff suppressed because it is too large. Load diff
+24 -1
View File
@@ -70,7 +70,8 @@ uses
video, vesa, doublebuffer, color, lvgl, desktop, uidebug,
vterminal,
graphicsrefresh, usbhotplug,
fifo, cfifo, cfifols, lifo, circ, minh, maxh, prio;
fifo, cfifo, cfifols, lifo, circ, minh, maxh, prio,
sha1;
procedure kmain(mbinfo: Pmultiboot_info_t; mbmagic: uint32); stdcall;
@@ -105,6 +106,9 @@ var
dds : uint32;
keyboard_layout : array [0..1] of TKeyInfo;
i : uint32;
sha1ctx : TSHA1Context;
sha1dig : TSHA1Digest;
sha1msg : array[0..9] of uint8;
begin
{ Init the base system unit }
@@ -268,6 +272,25 @@ begin
maxh.UnitTest;
prio.UnitTest;
{ SHA1 test: hash 'Helloworld' }
sha1msg[0] := $48; { H }
sha1msg[1] := $65; { e }
sha1msg[2] := $6C; { l }
sha1msg[3] := $6C; { l }
sha1msg[4] := $6F; { o }
sha1msg[5] := $77; { w }
sha1msg[6] := $6F; { o }
sha1msg[7] := $72; { r }
sha1msg[8] := $6C; { l }
sha1msg[9] := $64; { d }
SHA1Init(@sha1ctx);
SHA1Update(@sha1ctx, @sha1msg[0], 10);
SHA1Final(@sha1ctx, @sha1dig);
syslog.log('SHA1', 'Helloworld = ');
for i := 0 to 19 do
syslog.writehexpair(sha1dig[i]);
syslog.writestringln('');
{ Register timer-driven tasks }
graphicsrefresh.init;
usbhotplug.init;