eucrypt_ch6_kecca... 1
eucrypt_ch6_kecca... 2
eucrypt_ch6_kecca... 3
eucrypt_ch6_kecca... 4
eucrypt_ch6_kecca... 5
eucrypt_ch6_kecca... 6
eucrypt_ch6_kecca... 7
eucrypt_ch6_kecca... 8 package SMG_Keccak is
eucrypt_ch6_kecca... 9 pragma Pure(SMG_Keccak);
eucrypt_ch6_kecca... 10
eucrypt_ch6_kecca... 11
eucrypt_ch6_kecca... 12 Keccak_L: constant := 6;
eucrypt_ch6_kecca... 13
eucrypt_ch6_kecca... 14
eucrypt_ch6_kecca... 15
eucrypt_ch6_kecca... 16
eucrypt_ch6_kecca... 17 XY_Length: constant := 5;
eucrypt_ch6_kecca... 18 Z_Length: constant := 2**Keccak_L;
eucrypt_ch6_kecca... 19 Width: constant := XY_Length * XY_Length * Z_Length;
eucrypt_ch6_kecca... 20 N_Rounds: constant := 12 + 2*Keccak_L;
eucrypt_ch6_kecca... 21
eucrypt_ch6_kecca... 22
eucrypt_ch6_kecca... 23 type XYCoord is mod XY_Length;
eucrypt_ch6_kecca... 24 type ZCoord is mod Z_Length;
eucrypt_ch6_kecca... 25 type Round_Index is mod N_Rounds;
eucrypt_ch6_kecca... 26
eucrypt_ch6_kecca... 27 type ZWord is mod 2**Z_Length;
eucrypt_ch6_kecca... 28 type Plane is array(XYCoord) of ZWord;
eucrypt_ch6_kecca... 29 type State is array(XYCoord, XYCoord) of ZWord;
eucrypt_ch6_kecca... 30
eucrypt_ch6_kecca... 31 type Round_Constants is array(Round_Index) of ZWord;
eucrypt_ch6_kecca... 32
eucrypt_ch6_kecca... 33 private
eucrypt_ch6_kecca... 34
eucrypt_ch6_kecca... 35
eucrypt_ch6_kecca... 36
eucrypt_ch6_kecca... 37
eucrypt_ch6_kecca... 38 RC : constant Round_Constants :=
eucrypt_ch6_kecca... 39 (
eucrypt_ch6_kecca... 40 16#0000_0000_0000_0001#,
eucrypt_ch6_kecca... 41 16#0000_0000_0000_8082#,
eucrypt_ch6_kecca... 42 16#8000_0000_0000_808A#,
eucrypt_ch6_kecca... 43 16#8000_0000_8000_8000#,
eucrypt_ch6_kecca... 44 16#0000_0000_0000_808B#,
eucrypt_ch6_kecca... 45 16#0000_0000_8000_0001#,
eucrypt_ch6_kecca... 46 16#8000_0000_8000_8081#,
eucrypt_ch6_kecca... 47 16#8000_0000_0000_8009#,
eucrypt_ch6_kecca... 48 16#0000_0000_0000_008A#,
eucrypt_ch6_kecca... 49 16#0000_0000_0000_0088#,
eucrypt_ch6_kecca... 50 16#0000_0000_8000_8009#,
eucrypt_ch6_kecca... 51 16#0000_0000_8000_000A#,
eucrypt_ch6_kecca... 52 16#0000_0000_8000_808B#,
eucrypt_ch6_kecca... 53 16#8000_0000_0000_008B#,
eucrypt_ch6_kecca... 54 16#8000_0000_0000_8089#,
eucrypt_ch6_kecca... 55 16#8000_0000_0000_8003#,
eucrypt_ch6_kecca... 56 16#8000_0000_0000_8002#,
eucrypt_ch6_kecca... 57 16#8000_0000_0000_0080#,
eucrypt_ch6_kecca... 58 16#0000_0000_0000_800A#,
eucrypt_ch6_kecca... 59 16#8000_0000_8000_000A#,
eucrypt_ch6_kecca... 60 16#8000_0000_8000_8081#,
eucrypt_ch6_kecca... 61 16#8000_0000_0000_8080#,
eucrypt_ch6_kecca... 62 16#0000_0000_8000_0001#,
eucrypt_ch6_kecca... 63 16#8000_0000_8000_8008#
eucrypt_ch6_kecca... 64 );
eucrypt_ch6_kecca... 65
eucrypt_ch6_kecca... 66
eucrypt_ch6_kecca... 67 function Rotate_Left( Value : ZWord;
eucrypt_ch6_kecca... 68 Amount : Natural)
eucrypt_ch6_kecca... 69 return ZWord;
eucrypt_ch6_kecca... 70 pragma Import(Intrinsic, Rotate_Left);
eucrypt_ch6_kecca... 71
eucrypt_ch6_kecca... 72 function Shift_Right( Value : ZWord;
eucrypt_ch6_kecca... 73 Amount : Natural)
eucrypt_ch6_kecca... 74 return ZWord;
eucrypt_ch6_kecca... 75 pragma Import(Intrinsic, Shift_Right);
eucrypt_ch6_kecca... 76
eucrypt_ch6_kecca... 77
eucrypt_ch6_kecca... 78 function Theta ( Input : in State) return State;
eucrypt_ch6_kecca... 79 function Rho ( Input : in State) return State;
eucrypt_ch6_kecca... 80 function Pi ( Input : in State) return State;
eucrypt_ch6_kecca... 81 function Chi ( Input : in State) return State;
eucrypt_ch6_kecca... 82 function Iota ( Round_Const : in ZWord; Input : in State) return State;
eucrypt_ch6_kecca... 83
eucrypt_ch6_kecca... 84
eucrypt_ch6_kecca... 85
eucrypt_ch6_kecca... 86
eucrypt_ch6_kecca... 87 function Keccak_Function(Input: in State) return State;
eucrypt_ch6_kecca... 88
eucrypt_ch6_kecca... 89 end SMG_Keccak;