- 8B4ED2ECAE1C6FEE1CC25F280351F57E4329D048617754F580CCC2DF61734EDE8D64D26DFF20F29810A345B3E376ED6455F78E792EB02AF14D1E5C6C757771FD
+ 130484EDCB794A78DB04EEB6293A21EF5EA70AC04C55A7641E67FAC4879935FB1A51624081D583AE47BC30948610EAA6A3D6639CE53D0BE53D7F315406D22E9A
vtools/src/keccak_c.adb
(18 . 20)(18 . 30)
13 procedure C_Hash(Ctx: in C_Context_Access;
14 Input: Char_Star;
15 Len: Interfaces.C.size_t) is
16 Buffer_Size: constant Natural := 2048;
17 Byte_Size: constant Natural := 8;
18 N: Natural := 0;
19 I: Natural := 0;
20 L: Natural := Natural(Len);
21 S: String(1..L);
22 B: Bitstream(1..S'Length*8);
23 Buf: String(1..Buffer_Size);
24 B: Bitstream(1..Buf'Length*Byte_Size);
25 Ptr: Char_Star := Input;
26 begin
27 if Input = null then
28 raise Strings.Dereference_Error;
29 end if;
30 for Chr of S loop
31 Chr := Character(Ptr.all);
32 Char_Ptrs.Increment(Ptr);
33 while L > I loop
34 N := 0;
35 for Chr of Buf loop
36 exit when L <= I;
37 Chr := Character(Ptr.all);
38 Char_Ptrs.Increment(Ptr);
39 N := N + 1;
40 I := I + 1;
41 end loop;
42 ToBitstream(Buf(1..N), B(1..N*Byte_Size));
43 KeccakHash(Ctx.all, B(1..N*Byte_Size));
44 end loop;
45 ToBitstream(S, B);
46 KeccakHash(Ctx.all, B);
47 end C_Hash;
48
49 procedure C_End(Ctx: C_Context_Access;