eucrypt_ch8_bit_k... 1
eucrypt_ch8_bit_k... 2
eucrypt_ch8_bit_k... 3
eucrypt_ch8_bit_k... 4
eucrypt_ch8_bit_k... 5
eucrypt_ch8_bit_k... 6
eucrypt_ch8_bit_k... 7 package SMG_Bit_Keccak is
eucrypt_ch8_bit_k... 8 pragma Pure(SMG_Bit_Keccak);
eucrypt_ch8_bit_k... 9
eucrypt_ch8_bit_k... 10
eucrypt_ch8_bit_k... 11 Keccak_L: constant := 6;
eucrypt_ch8_bit_k... 12
eucrypt_ch8_bit_k... 13
eucrypt_ch8_bit_k... 14
eucrypt_ch8_bit_k... 15
eucrypt_ch8_bit_k... 16 XY_Length: constant := 5;
eucrypt_ch8_bit_k... 17 Z_Length: constant := 2 ** Keccak_L;
eucrypt_ch8_bit_k... 18 Width: constant := XY_Length * XY_Length * Z_Length;
eucrypt_ch8_bit_k... 19 N_Rounds: constant := 12 + 2 * Keccak_L;
eucrypt_ch8_bit_k... 20
eucrypt_ch8_bit_k... 21
eucrypt_ch8_bit_k... 22 type XYCoord is mod XY_Length;
eucrypt_ch8_bit_k... 23 type ZCoord is mod Z_Length;
eucrypt_ch8_bit_k... 24 type Round_Index is mod N_Rounds;
eucrypt_ch8_bit_k... 25
eucrypt_ch8_bit_k... 26 type Bit is mod 2;
eucrypt_ch8_bit_k... 27 type Bitstream is array( Natural range <> ) of Bit;
eucrypt_ch8_bit_k... 28 type Bitword is array( ZCoord ) of Bit;
eucrypt_ch8_bit_k... 29
eucrypt_ch8_bit_k... 30 type State is array( XYCoord, XYCoord ) of Bitword;
eucrypt_ch8_bit_k... 31
eucrypt_ch8_bit_k... 32 type Round_Constants is array(Round_Index) of Bitword;
eucrypt_ch8_bit_k... 33
eucrypt_ch8_bit_k... 34
eucrypt_ch8_bit_k... 35
eucrypt_ch8_bit_k... 36
eucrypt_ch8_bit_k... 37 subtype Keccak_Rate is Positive range 1..Width;
eucrypt_ch8_bit_k... 38
eucrypt_ch8_bit_k... 39
eucrypt_ch8_bit_k... 40
eucrypt_ch8_bit_k... 41
eucrypt_ch8_bit_k... 42
eucrypt_ch8_bit_k... 43
eucrypt_ch8_bit_k... 44
eucrypt_ch8_bit_k... 45 procedure Sponge(Input : in Bitstream;
eucrypt_ch8_bit_k... 46 Block_Len : in Keccak_Rate;
eucrypt_ch8_bit_k... 47 Output : out Bitstream);
eucrypt_ch8_bit_k... 48
eucrypt_ch8_bit_k... 49 private
eucrypt_ch8_bit_k... 50
eucrypt_ch8_bit_k... 51
eucrypt_ch8_bit_k... 52
eucrypt_ch8_bit_k... 53 procedure Next_Pos( X : in out XYCoord;
eucrypt_ch8_bit_k... 54 Y : in out XYCoord;
eucrypt_ch8_bit_k... 55 Z : in out ZCoord
eucrypt_ch8_bit_k... 56 );
eucrypt_ch8_bit_k... 57
eucrypt_ch8_bit_k... 58 procedure First_Pos( X : out XYCoord;
eucrypt_ch8_bit_k... 59 Y : out XYCoord;
eucrypt_ch8_bit_k... 60 Z : out ZCoord
eucrypt_ch8_bit_k... 61 );
eucrypt_ch8_bit_k... 62
eucrypt_ch8_bit_k... 63
eucrypt_ch8_bit_k... 64 function BWRotate_Left( Input: in Bitword;
eucrypt_ch8_bit_k... 65 Count: in Natural)
eucrypt_ch8_bit_k... 66 return Bitword;
eucrypt_ch8_bit_k... 67
eucrypt_ch8_bit_k... 68
eucrypt_ch8_bit_k... 69
eucrypt_ch8_bit_k... 70
eucrypt_ch8_bit_k... 71
eucrypt_ch8_bit_k... 72 procedure SqueezeBlock( Block: out Bitstream; S: in State);
eucrypt_ch8_bit_k... 73
eucrypt_ch8_bit_k... 74
eucrypt_ch8_bit_k... 75
eucrypt_ch8_bit_k... 76
eucrypt_ch8_bit_k... 77
eucrypt_ch8_bit_k... 78 procedure AbsorbBlock( Block: in Bitstream; S: in out State );
eucrypt_ch8_bit_k... 79
eucrypt_ch8_bit_k... 80
eucrypt_ch8_bit_k... 81 RC : constant Round_Constants :=
eucrypt_ch8_bit_k... 82 (
eucrypt_ch8_bit_k... 83
eucrypt_ch8_bit_k... 84 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 85 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 86 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 87 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1),
eucrypt_ch8_bit_k... 88
eucrypt_ch8_bit_k... 89 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 90 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 91 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 92 1,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,1,0),
eucrypt_ch8_bit_k... 93
eucrypt_ch8_bit_k... 94 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 95 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 96 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 97 1,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,1,0),
eucrypt_ch8_bit_k... 98
eucrypt_ch8_bit_k... 99
eucrypt_ch8_bit_k... 100 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 101 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 102 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 103 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0),
eucrypt_ch8_bit_k... 104
eucrypt_ch8_bit_k... 105
eucrypt_ch8_bit_k... 106 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 107 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 108 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 109 1,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,1,1),
eucrypt_ch8_bit_k... 110
eucrypt_ch8_bit_k... 111
eucrypt_ch8_bit_k... 112 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 113 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 114 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 115 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1),
eucrypt_ch8_bit_k... 116
eucrypt_ch8_bit_k... 117
eucrypt_ch8_bit_k... 118 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 119 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 120 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 121 1,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,1),
eucrypt_ch8_bit_k... 122
eucrypt_ch8_bit_k... 123
eucrypt_ch8_bit_k... 124 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 125 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 126 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 127 1,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,1),
eucrypt_ch8_bit_k... 128
eucrypt_ch8_bit_k... 129
eucrypt_ch8_bit_k... 130 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 131 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 132 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 133 0,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,1,0),
eucrypt_ch8_bit_k... 134
eucrypt_ch8_bit_k... 135
eucrypt_ch8_bit_k... 136 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 137 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 138 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 139 0,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,0,0),
eucrypt_ch8_bit_k... 140
eucrypt_ch8_bit_k... 141
eucrypt_ch8_bit_k... 142 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 143 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 144 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 145 1,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,1),
eucrypt_ch8_bit_k... 146
eucrypt_ch8_bit_k... 147
eucrypt_ch8_bit_k... 148 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 149 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 150 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 151 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,1,0),
eucrypt_ch8_bit_k... 152
eucrypt_ch8_bit_k... 153
eucrypt_ch8_bit_k... 154 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 155 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 156 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 157 1,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,1,1),
eucrypt_ch8_bit_k... 158
eucrypt_ch8_bit_k... 159
eucrypt_ch8_bit_k... 160 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 161 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 162 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 163 0,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,1,1),
eucrypt_ch8_bit_k... 164
eucrypt_ch8_bit_k... 165
eucrypt_ch8_bit_k... 166 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 167 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 168 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 169 1,0,0,0, 0,0,0,0, 1,0,0,0, 1,0,0,1),
eucrypt_ch8_bit_k... 170
eucrypt_ch8_bit_k... 171
eucrypt_ch8_bit_k... 172 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 173 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 174 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 175 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,1),
eucrypt_ch8_bit_k... 176
eucrypt_ch8_bit_k... 177
eucrypt_ch8_bit_k... 178 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 179 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 180 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 181 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,1,0),
eucrypt_ch8_bit_k... 182
eucrypt_ch8_bit_k... 183
eucrypt_ch8_bit_k... 184 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 185 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 186 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 187 0,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,0),
eucrypt_ch8_bit_k... 188
eucrypt_ch8_bit_k... 189
eucrypt_ch8_bit_k... 190 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 191 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 192 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 193 1,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,1,0),
eucrypt_ch8_bit_k... 194
eucrypt_ch8_bit_k... 195
eucrypt_ch8_bit_k... 196 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 197 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 198 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 199 0,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,1,0),
eucrypt_ch8_bit_k... 200
eucrypt_ch8_bit_k... 201
eucrypt_ch8_bit_k... 202 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 203 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 204 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 205 1,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,1),
eucrypt_ch8_bit_k... 206
eucrypt_ch8_bit_k... 207
eucrypt_ch8_bit_k... 208 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 209 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 210 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 211 1,0,0,0, 0,0,0,0, 1,0,0,0, 0,0,0,0),
eucrypt_ch8_bit_k... 212
eucrypt_ch8_bit_k... 213
eucrypt_ch8_bit_k... 214 (0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 215 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 216 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 217 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,1),
eucrypt_ch8_bit_k... 218
eucrypt_ch8_bit_k... 219
eucrypt_ch8_bit_k... 220 (1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 221 0,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 222 1,0,0,0, 0,0,0,0, 0,0,0,0, 0,0,0,0,
eucrypt_ch8_bit_k... 223 1,0,0,0, 0,0,0,0, 0,0,0,0, 1,0,0,0)
eucrypt_ch8_bit_k... 224 );
eucrypt_ch8_bit_k... 225
eucrypt_ch8_bit_k... 226
eucrypt_ch8_bit_k... 227 function Theta ( Input : in State ) return State;
eucrypt_ch8_bit_k... 228 function Rho ( Input : in State ) return State;
eucrypt_ch8_bit_k... 229 function Pi ( Input : in State ) return State;
eucrypt_ch8_bit_k... 230 function Chi ( Input : in State ) return State;
eucrypt_ch8_bit_k... 231 function Iota ( Round_Const : in Bitword; Input : in State ) return State;
eucrypt_ch8_bit_k... 232
eucrypt_ch8_bit_k... 233
eucrypt_ch8_bit_k... 234
eucrypt_ch8_bit_k... 235
eucrypt_ch8_bit_k... 236 function Keccak_Function(Input: in State) return State;
eucrypt_ch8_bit_k... 237
eucrypt_ch8_bit_k... 238 end SMG_Bit_Keccak;
eucrypt_ch8_bit_k... 239