Include ed25519 and sha512 C language implementation.
[brdnet.git] / sha512.pas
blob39e31e5c26272232f4f3c3376f8446d102c94cfa
1 unit sha512;
2 {$mode objfpc}{$H+}
3 interface
5 {$PACKRECORDS C}
6 {$L ed25519/sha512.o}
8 type
9 tsha512context = record
10 length : QWORD;
11 state : array[0..7] of QWORD;
12 curlen : LongWord;
13 buf : array[0..127] of byte;
14 end;
15 tsha512digest = array [0..63] of byte;
17 function sha512init(out md:tsha512context):longint;
18 cdecl; external name 'sha512_init';
19 function sha512update(var md:tsha512context; const buf; buflen:LongWord):longint;
20 cdecl; external name 'sha512_update';
21 function sha512final(var md:tsha512context; out digest:tsha512digest):longint;
22 cdecl; external name 'sha512_final';
24 implementation
26 end.