tree checksum vpatch file split hunks

all signers: phf

antecedents: vdiff_keccak

press order:

vtools_genesisphf
vdiff_fixes_newline_gccphf
keccakphf
vdiff_keccakphf
vtools_fixes_bitrate_char_arrayphf

patch:

- 7896D8CC732AEF7CBAAE1C872DD824F51C5F6D1D23E42BB57CE03CF7B84664CC2140D4DBB9C70B72E14A1F82A59ACDDA3B7432E90423F0A8E93CF4FE5ABF2E7F
+ DE81A97D5DA86B1A3F934E6AFB04B4AB40AA58163AD292438814FD9CA1DC09D9209C4984099E2E709FBE637CF8046A30B04039E2ABCE74EC565BF2F7881C0E91
vtools/manifest
(2 . 3)(2 . 4)
5 511300 phf vdiff_fixes_newline_gcc Fixes for C99 compatability, support for "No newline at end of file" directive.
6 511300 phf keccak Included diana_coman's keccak implementation.
7 511300 phf vdiff_keccak Vdiff hashing and output using Keccak instead of SHA512.
8 512600 phf vtools_fixes_bitrate_char_array Fixes for keccak from diana_coman, different approach to C interop.
- 680EFB9458A976F700A689A6B0678510172945E94D35207F07BEA280BB87B30EDC889968FBF6C922C8CC5C79B9193986AB66037CC36F47D52B49E91826C22FE4
+ 252A6F237724580F4AF2F1FBF2DFF39DCDD7C1A14AC7C17021D4ED0D0939F6394BF2CBCE3E2ECC3261B8474ECF0D7DE34728467679E557A7C44BAD510D070747
vtools/src/keccak_c.adb
(54 . 28)(54 . 41)
13 end C_Begin;
14
15 procedure C_Hash(Ctx: in C_Context_Access;
16 Input: Interfaces.C.Char_Array;
17 Len: Interfaces.C.Size_T) is
18 Input: Char_Star;
19 Len: Interfaces.C.size_t) is
20 L: Natural := Natural(Len);
21 S: String(1..L);
22 B: Bitstream(1..S'Length*8);
23 Ptr: Char_Star := Input;
24 begin
25 Interfaces.C.To_Ada(Input, S, L, Trim_Nul => False);
26 if Input = null then
27 raise C.Strings.Dereference_Error;
28 end if;
29 for Chr of S loop
30 Chr := Character(Ptr.all);
31 Char_Ptrs.Increment(Ptr);
32 end loop;
33 ToBitstream(S, B);
34 KeccakHash(Ctx.all, B);
35 end C_Hash;
36
37 procedure C_End(Ctx: C_Context_Access;
38 Output: out Interfaces.C.Char_Array;
39 Output: Char_Star;
40 Len: Interfaces.C.Size_T) is
41 L: Natural := Natural(Len);
42 S: String(1..L);
43 B: Bitstream(1..S'Length*8);
44 Count: Interfaces.C.Size_T;
45 Ptr: Char_Star := Output;
46 begin
47 if Output = null then
48 raise C.Strings.Dereference_Error;
49 end if;
50 KeccakEnd(Ctx.all, B);
51 ToString(B, S);
52 Interfaces.C.To_C(S, Output(0..Len), Count, Append_Nul => False);
53 for Chr of S loop
54 Ptr.all := Interfaces.C.char(Chr);
55 Char_Ptrs.Increment(Ptr);
56 end loop;
57 -- Len = Count
58 end C_End;
59
- 33D0A8BFAC503D941796252636419DFBC9917D9D67C2E15E13E85083AFB8ED46CDE57452B61EF275CCFDE07B7891D510467B49868882248A5836BCE52EF7A7D0
+ 9E720F186B11BB3E2D398765619E1E4220659E74BDF9AD4D3BE83EEB51C9A45E5F7A4BFCECE333F5E86B50838874DBC31462EFD45F25294C3661EB069C9E4DB2
vtools/src/keccak_c.ads
(1 . 8)(1 . 17)
64 with Interfaces; use Interfaces;
65 with Interfaces.C; use Interfaces.C;
66 with Interfaces.C.Strings;
67 with Interfaces.C.Pointers;
68 with Ada.Unchecked_Deallocation;
69 with SMG_Keccak; use SMG_Keccak;
70 package Keccak_C is
71 package Char_Ptrs is
72 new Interfaces.C.Pointers (Index => size_t,
73 Element => char,
74 Element_Array => char_array,
75 Default_Terminator => nul);
76 use type Char_Ptrs.Pointer;
77 subtype Char_Star is Char_Ptrs.Pointer;
78 subtype C_Context is Keccak_Context(Block_Len=>Default_Bitrate);
79 type C_Context_Access is access C_Context;
80 procedure C_Get_Size(Size: out Interfaces.C.size_t);
(10 . 11)(19 . 11)
82 function C_Begin return C_Context_Access;
83 pragma Export (C, C_Begin, "keccak_begin");
84 procedure C_Hash(Ctx: C_Context_Access;
85 Input: Interfaces.C.Char_Array;
86 Input: Char_Star;
87 Len: Interfaces.C.Size_T);
88 pragma Export (C, C_Hash, "keccak_hash");
89 procedure C_End(Ctx: C_Context_Access;
90 Output: out Interfaces.C.Char_Array;
91 Output: Char_Star;
92 Len: Interfaces.C.Size_T);
93 pragma Export (C, C_End, "keccak_end");
94 procedure C_Deallocate(Ctx: in out C_Context_Access);
- 8F038C226BD823B585A5081ADBDBBF6A394C552875346AB9474C3A7679A8F7636704EB3230F0588FB250FB3A45D584E68A1DE7FE92EE209C91D2CDAA0FE3E217
+ B45B24D4E1024ED3C006F3B1754CEA63CB7DD34BA653E3AD017BB54800D4B43C5283E7FBA95C434D8F7FE470118C2137DA999D55A6335BD80BE7491AD7FDCA92
vtools/src/smg_keccak.adb
(217 . 7)(217 . 7)
99 ToPos := Block'Last;
100 FromPos := ToPos - SBB + 1;
101 BWord := (others => 0);
102 BWord(Bitword'First .. Bitword'First + SBB - 1) := Block(ToPos..FromPos);
103 BWord(Bitword'First .. Bitword'First + SBB - 1) := Block(FromPos..ToPos);
104 Word := BitsToWord( BWord );
105 S( X, Y ) := S( X, Y ) xor Word;
106 end if;