tree checksum vpatch file split hunks
all signers: diana_coman
antecedents: eucrypt_oaep_fix_checks eucrypt_ch10_oaep_tmsr eucrypt_ch12_wrapper_rsa_oaep_c_ada
press order:
patch:
(19 . 6)(19 . 7)
5
6 3. smg_keccak
7 Word (64 bits) level implementation of the Keccak sponge according to The Keccak Reference v 3.0.
8 NOTE: Keccak rate has its own type (Keccak_Rate) that makes clear the valid range (1 to width of state). Calling Keccak sponge with a bitrate outside the valid range will CORRECTLY cause the execution to abort with a constraint_error.
9 Implemented in Ada.
10
11 4. smg_serpent
- 88E40423C88BA2AC7D44225B388794D61719746B02412E2DAE4684BCFA72399978D599F9301B4A2BE101B41769D3C5B20DE6FF94E76A01FF767EDC00746B8B96(148 . 7)(148 . 7)
16 ToPos := Block'Last;
17 FromPos := ToPos - SBB + 1;
18 BWord := (others => 0);
19 BWord(Bitword'First .. Bitword'First + SBB - 1) := Block(ToPos..FromPos);
20 BWord(Bitword'First .. Bitword'First + SBB - 1) := Block(FromPos..ToPos);
21 Word := BitsToWord( BWord );
22 S( X, Y ) := S( X, Y ) xor Word;
23 end if;
- D32B0AD7D28C2641A7172DD10F409670EB9D6A925A755FAAAEED545123ABF45DB6B30BAD662C88B1428A656876154C2C5091FCCF82B4924F1863B9A6B9AD2537(466 . 6)(466 . 19)
28
29 end test_oaep;
30
31 procedure test_all_bitrates is
32 Input : constant String := "hello, world";
33 Bin : Bitstream( 0 .. Input'Length * 8 - 1 ) := ( others => 0 );
34 Bout : Bitstream( 0 .. 100 ) := ( others => 0 );
35 begin
36 ToBitstream( Input, Bin );
37 Put_Line("Testing all bitrates:");
38 for Bitrate in Keccak_Rate'Range loop
39 Sponge(Bin, Bout, Bitrate);
40 Put_Line("PASSED: keccak with bitrate " & Integer'Image(Bitrate));
41 end loop;
42 end test_all_bitrates;
43
44 -- end of helper methods
45
46 --variables
(518 . 4)(531 . 7)
48 -- test xor on strings
49 test_xor_strings;
50
51 -- test ALL bitrates of the Keccak sponge
52 test_all_bitrates;
53
54 end SMG_Keccak.Test;