ffa_ch11_tuning_a... 1
ffa_ch11_tuning_a... 2
ffa_ch11_tuning_a... 3
ffa_ch11_tuning_a... 4
ffa_ch15_gcd.kv 5
ffa_ch11_tuning_a... 6
ffa_ch11_tuning_a... 7
ffa_ch11_tuning_a... 8
ffa_ch11_tuning_a... 9
ffa_ch11_tuning_a... 10
ffa_ch11_tuning_a... 11
ffa_ch11_tuning_a... 12
ffa_ch11_tuning_a... 13
ffa_ch11_tuning_a... 14
ffa_ch11_tuning_a... 15
ffa_ch11_tuning_a... 16
ffa_ch11_tuning_a... 17
ffa_ch11_tuning_a... 18
ffa_ch11_tuning_a... 19
ffa_ch11_tuning_a... 20 with Words; use Words;
ffa_ch11_tuning_a... 21 with FZ_Type; use FZ_Type;
ffa_ch11_tuning_a... 22
ffa_ch11_tuning_a... 23 with W_Pred;
ffa_ch11_tuning_a... 24
ffa_ch11_tuning_a... 25 with FZ_Lim;
ffa_ch11_tuning_a... 26 with FZ_Basic;
ffa_ch11_tuning_a... 27 with FZ_IO;
ffa_ch11_tuning_a... 28 with FZ_Cmp;
ffa_ch11_tuning_a... 29 with FZ_Pred;
ffa_ch11_tuning_a... 30 with FZ_BitOp;
ffa_ch11_tuning_a... 31 with FZ_Divis;
ffa_ch11_tuning_a... 32 with FZ_ModEx;
ffa_ch13_measure_... 33 with FZ_Measr;
ffa_ch13_measure_... 34 with FZ_QShft;
ffa_ch15_gcd.kv 35 with FZ_LoMul;
ffa_ch11_tuning_a... 36
ffa_ch11_tuning_a... 37
ffa_ch11_tuning_a... 38
ffa_ch11_tuning_a... 39 package FFA is
ffa_ch11_tuning_a... 40
ffa_ch11_tuning_a... 41 pragma Pure;
ffa_ch11_tuning_a... 42
ffa_ch11_tuning_a... 43
ffa_ch14_barrett.kv 44
ffa_ch14_barrett.kv 45
ffa_ch14_barrett.kv 46
ffa_ch15_gcd.kv 47 FFA_K_Version : constant Natural := 254;
ffa_ch14_barrett.kv 48
ffa_ch14_barrett.kv 49
ffa_ch11_tuning_a... 50
ffa_ch11_tuning_a... 51
ffa_ch11_tuning_a... 52
ffa_ch13_measure_... 53 subtype Word is Words.Word;
ffa_ch13_measure_... 54 subtype WBool is Words.WBool;
ffa_ch11_tuning_a... 55
ffa_ch13_measure_... 56 subtype Nibble is Words.Nibble;
ffa_ch11_tuning_a... 57
ffa_ch13_measure_... 58 subtype FZ is FZ_Type.FZ;
ffa_ch13_measure_... 59 subtype Indices is FZ_Type.Indices;
ffa_ch13_measure_... 60 subtype FZBit_Index is FZ_Type.FZBit_Index;
ffa_ch11_tuning_a... 61
ffa_ch13_measure_... 62 subtype Char_Count is FZ_IO.Char_Count;
ffa_ch11_tuning_a... 63
ffa_ch11_tuning_a... 64 Bitness : Positive renames Words.Bitness;
ffa_ch11_tuning_a... 65
ffa_ch11_tuning_a... 66
ffa_ch11_tuning_a... 67
ffa_ch11_tuning_a... 68
ffa_ch11_tuning_a... 69
ffa_ch11_tuning_a... 70
ffa_ch11_tuning_a... 71 function FFA_Word_ZeroP(N : in Word) return WBool
ffa_ch11_tuning_a... 72 renames W_Pred.W_ZeroP;
ffa_ch11_tuning_a... 73
ffa_ch11_tuning_a... 74
ffa_ch11_tuning_a... 75 function FFA_Word_NZeroP(N : in Word) return WBool
ffa_ch11_tuning_a... 76 renames W_Pred.W_NZeroP;
ffa_ch11_tuning_a... 77
ffa_ch11_tuning_a... 78
ffa_ch11_tuning_a... 79 function FFA_Word_Not(N : in WBool) return WBool
ffa_ch11_tuning_a... 80 renames W_Pred.W_Not;
ffa_ch11_tuning_a... 81
ffa_ch11_tuning_a... 82
ffa_ch11_tuning_a... 83 function FFA_Word_OddP(N : in Word) return WBool
ffa_ch11_tuning_a... 84 renames W_Pred.W_OddP;
ffa_ch11_tuning_a... 85
ffa_ch11_tuning_a... 86
ffa_ch11_tuning_a... 87 function FFA_Word_EqP(A : in Word; B : in Word) return WBool
ffa_ch11_tuning_a... 88 renames W_Pred.W_EqP;
ffa_ch11_tuning_a... 89
ffa_ch11_tuning_a... 90
ffa_ch11_tuning_a... 91
ffa_ch11_tuning_a... 92
ffa_ch11_tuning_a... 93
ffa_ch11_tuning_a... 94 FFA_Validity_Rule_Doc : String renames FZ_Lim.FZ_Validity_Rule_Doc;
ffa_ch11_tuning_a... 95
ffa_ch11_tuning_a... 96
ffa_ch11_tuning_a... 97 function FFA_FZ_Valid_Bitness_P(B : in Positive) return Boolean
ffa_ch11_tuning_a... 98 renames FZ_Lim.FZ_Valid_Bitness_P;
ffa_ch11_tuning_a... 99
ffa_ch11_tuning_a... 100
ffa_ch11_tuning_a... 101
ffa_ch11_tuning_a... 102
ffa_ch11_tuning_a... 103
ffa_ch11_tuning_a... 104
ffa_ch11_tuning_a... 105 function FFA_FZ_Bitness(N : in FZ) return Bit_Count
ffa_ch11_tuning_a... 106 renames FZ_Basic.FZ_Bitness;
ffa_ch11_tuning_a... 107
ffa_ch11_tuning_a... 108
ffa_ch11_tuning_a... 109 procedure FFA_FZ_Clear(N : out FZ)
ffa_ch11_tuning_a... 110 renames FZ_Basic.FZ_Clear;
ffa_ch11_tuning_a... 111
ffa_ch11_tuning_a... 112
ffa_ch11_tuning_a... 113 procedure FFA_WBool_To_FZ(V : in WBool; N : out FZ)
ffa_ch11_tuning_a... 114 renames FZ_Basic.WBool_To_FZ;
ffa_ch11_tuning_a... 115
ffa_ch11_tuning_a... 116
ffa_ch11_tuning_a... 117 procedure FFA_FZ_Set_Head(N : out FZ; Source : in Word)
ffa_ch11_tuning_a... 118 renames FZ_Basic.FZ_Set_Head;
ffa_ch11_tuning_a... 119
ffa_ch11_tuning_a... 120
ffa_ch11_tuning_a... 121 function FFA_FZ_Get_Head(N : in FZ) return Word
ffa_ch11_tuning_a... 122 renames FZ_Basic.FZ_Get_Head;
ffa_ch11_tuning_a... 123
ffa_ch11_tuning_a... 124
ffa_ch11_tuning_a... 125 procedure FFA_FZ_Swap(X : in out FZ; Y : in out FZ)
ffa_ch11_tuning_a... 126 with Pre => X'Length = Y'Length;
ffa_ch11_tuning_a... 127
ffa_ch11_tuning_a... 128
ffa_ch11_tuning_a... 129 procedure FFA_FZ_Mux(X : in FZ; Y : in FZ; Result : out FZ; Sel : in WBool)
ffa_ch11_tuning_a... 130 with Pre => X'Length = Y'Length and X'Length = Result'Length;
ffa_ch11_tuning_a... 131
ffa_ch11_tuning_a... 132
ffa_ch11_tuning_a... 133
ffa_ch11_tuning_a... 134
ffa_ch11_tuning_a... 135
ffa_ch11_tuning_a... 136
ffa_ch11_tuning_a... 137 procedure FFA_FZ_Insert_Bottom_Nibble(N : in out FZ;
ffa_ch11_tuning_a... 138 D : in Nibble;
ffa_ch11_tuning_a... 139 Overflow : out WBool)
ffa_ch11_tuning_a... 140 renames FZ_IO.FZ_Insert_Bottom_Nibble;
ffa_ch11_tuning_a... 141
ffa_ch11_tuning_a... 142
ffa_ch11_tuning_a... 143 function FFA_FZ_ASCII_Length(N : in FZ) return Char_Count
ffa_ch11_tuning_a... 144 renames FZ_IO.FZ_ASCII_Length;
ffa_ch11_tuning_a... 145
ffa_ch11_tuning_a... 146
ffa_ch11_tuning_a... 147 procedure FFA_FZ_To_Hex_String(N : in FZ; S : out String)
ffa_ch11_tuning_a... 148 renames FZ_IO.FZ_To_Hex_String;
ffa_ch11_tuning_a... 149
ffa_ch11_tuning_a... 150
ffa_ch11_tuning_a... 151
ffa_ch11_tuning_a... 152
ffa_ch11_tuning_a... 153
ffa_ch11_tuning_a... 154
ffa_ch11_tuning_a... 155 function FFA_FZ_EqP(X : in FZ; Y: in FZ) return WBool
ffa_ch11_tuning_a... 156 renames FZ_Cmp.FZ_EqP;
ffa_ch11_tuning_a... 157
ffa_ch11_tuning_a... 158
ffa_ch11_tuning_a... 159 function FFA_FZ_LessThanP(X : in FZ; Y : in FZ) return WBool
ffa_ch11_tuning_a... 160 renames FZ_Cmp.FZ_LessThanP;
ffa_ch11_tuning_a... 161
ffa_ch11_tuning_a... 162
ffa_ch11_tuning_a... 163 function FFA_FZ_GreaterThanP(X : in FZ; Y : in FZ) return WBool
ffa_ch11_tuning_a... 164 renames FZ_Cmp.FZ_GreaterThanP;
ffa_ch11_tuning_a... 165
ffa_ch11_tuning_a... 166
ffa_ch11_tuning_a... 167
ffa_ch11_tuning_a... 168
ffa_ch11_tuning_a... 169
ffa_ch11_tuning_a... 170
ffa_ch11_tuning_a... 171 function FFA_FZ_ZeroP(N : in FZ) return WBool
ffa_ch11_tuning_a... 172 renames FZ_Pred.FZ_ZeroP;
ffa_ch11_tuning_a... 173
ffa_ch11_tuning_a... 174
ffa_ch11_tuning_a... 175 function FFA_FZ_NZeroP(N : in FZ) return WBool
ffa_ch11_tuning_a... 176 renames FZ_Pred.FZ_NZeroP;
ffa_ch11_tuning_a... 177
ffa_ch11_tuning_a... 178
ffa_ch11_tuning_a... 179 function FFA_FZ_OddP(N : in FZ) return WBool
ffa_ch11_tuning_a... 180 renames FZ_Pred.FZ_OddP;
ffa_ch11_tuning_a... 181
ffa_ch11_tuning_a... 182
ffa_ch11_tuning_a... 183
ffa_ch11_tuning_a... 184
ffa_ch11_tuning_a... 185
ffa_ch11_tuning_a... 186
ffa_ch11_tuning_a... 187 procedure FFA_FZ_And(X : in FZ; Y : in FZ; Result : out FZ)
ffa_ch11_tuning_a... 188 with Pre => X'Length = Y'Length and X'Length = Result'Length;
ffa_ch11_tuning_a... 189
ffa_ch11_tuning_a... 190
ffa_ch11_tuning_a... 191 procedure FFA_FZ_And_W(N : in out FZ; W : in Word)
ffa_ch11_tuning_a... 192 renames FZ_BitOp.FZ_And_W;
ffa_ch11_tuning_a... 193
ffa_ch11_tuning_a... 194
ffa_ch11_tuning_a... 195 procedure FFA_FZ_Or(X : in FZ; Y : in FZ; Result : out FZ)
ffa_ch11_tuning_a... 196 with Pre => X'Length = Y'Length and X'Length = Result'Length;
ffa_ch11_tuning_a... 197
ffa_ch11_tuning_a... 198
ffa_ch11_tuning_a... 199 procedure FFA_FZ_Or_W(N : in out FZ; W : in Word)
ffa_ch11_tuning_a... 200 renames FZ_BitOp.FZ_Or_W;
ffa_ch11_tuning_a... 201
ffa_ch11_tuning_a... 202
ffa_ch11_tuning_a... 203 procedure FFA_FZ_Xor(X : in FZ; Y : in FZ; Result : out FZ)
ffa_ch11_tuning_a... 204 with Pre => X'Length = Y'Length and X'Length = Result'Length;
ffa_ch11_tuning_a... 205
ffa_ch11_tuning_a... 206
ffa_ch11_tuning_a... 207 procedure FFA_FZ_Xor_W(N : in out FZ; W : in Word)
ffa_ch11_tuning_a... 208 renames FZ_BitOp.FZ_Xor_W;
ffa_ch11_tuning_a... 209
ffa_ch11_tuning_a... 210
ffa_ch11_tuning_a... 211 procedure FFA_FZ_Not(N : in FZ; NotN : out FZ)
ffa_ch11_tuning_a... 212 with Pre => N'Length = NotN'Length;
ffa_ch11_tuning_a... 213
ffa_ch11_tuning_a... 214
ffa_ch11_tuning_a... 215
ffa_ch11_tuning_a... 216
ffa_ch11_tuning_a... 217
ffa_ch11_tuning_a... 218
ffa_ch11_tuning_a... 219 procedure FFA_FZ_Add(X : in FZ;
ffa_ch11_tuning_a... 220 Y : in FZ;
ffa_ch11_tuning_a... 221 Sum : out FZ;
ffa_ch11_tuning_a... 222 Overflow : out WBool)
ffa_ch11_tuning_a... 223 with Pre => X'Length = Y'Length and X'Length = Sum'Length;
ffa_ch11_tuning_a... 224
ffa_ch11_tuning_a... 225
ffa_ch11_tuning_a... 226 procedure FFA_FZ_Subtract(X : in FZ;
ffa_ch11_tuning_a... 227 Y : in FZ;
ffa_ch11_tuning_a... 228 Difference : out FZ;
ffa_ch11_tuning_a... 229 Underflow : out WBool)
ffa_ch11_tuning_a... 230 with Pre => X'Length = Y'Length and X'Length = Difference'Length;
ffa_ch11_tuning_a... 231
ffa_ch11_tuning_a... 232
ffa_ch11_tuning_a... 233
ffa_ch11_tuning_a... 234
ffa_ch11_tuning_a... 235
ffa_ch11_tuning_a... 236
ffa_ch11_tuning_a... 237
ffa_ch11_tuning_a... 238 procedure FFA_FZ_IDiv(Dividend : in FZ;
ffa_ch11_tuning_a... 239 Divisor : in FZ;
ffa_ch11_tuning_a... 240 Quotient : out FZ;
ffa_ch11_tuning_a... 241 Remainder : out FZ)
ffa_ch11_tuning_a... 242 renames FZ_Divis.FZ_IDiv;
ffa_ch11_tuning_a... 243
ffa_ch11_tuning_a... 244
ffa_ch11_tuning_a... 245 procedure FFA_FZ_Div(Dividend : in FZ;
ffa_ch11_tuning_a... 246 Divisor : in FZ;
ffa_ch11_tuning_a... 247 Quotient : out FZ)
ffa_ch11_tuning_a... 248 renames FZ_Divis.FZ_Div;
ffa_ch11_tuning_a... 249
ffa_ch11_tuning_a... 250
ffa_ch11_tuning_a... 251 procedure FFA_FZ_Mod(Dividend : in FZ;
ffa_ch11_tuning_a... 252 Divisor : in FZ;
ffa_ch11_tuning_a... 253 Remainder : out FZ)
ffa_ch11_tuning_a... 254 renames FZ_Divis.FZ_Mod;
ffa_ch11_tuning_a... 255
ffa_ch11_tuning_a... 256
ffa_ch11_tuning_a... 257
ffa_ch11_tuning_a... 258
ffa_ch11_tuning_a... 259
ffa_ch11_tuning_a... 260
ffa_ch11_tuning_a... 261 procedure FFA_FZ_Multiply(X : in FZ;
ffa_ch11_tuning_a... 262 Y : in FZ;
ffa_ch11_tuning_a... 263 XY_Lo : out FZ;
ffa_ch11_tuning_a... 264 XY_Hi : out FZ)
ffa_ch11_tuning_a... 265 with Pre => X'Length = Y'Length and
ffa_ch11_tuning_a... 266 XY_Lo'Length = XY_Hi'Length and
ffa_ch11_tuning_a... 267 XY_Lo'Length = ((X'Length + Y'Length) / 2);
ffa_ch11_tuning_a... 268
ffa_ch12_karatsub... 269
ffa_ch12_karatsub... 270 procedure FFA_FZ_Square(X : in FZ;
ffa_ch12_karatsub... 271 XX_Lo : out FZ;
ffa_ch12_karatsub... 272 XX_Hi : out FZ)
ffa_ch12_karatsub... 273 with Pre => XX_Lo'Length = X'Length and
ffa_ch12_karatsub... 274 XX_Hi'Length = X'Length and
ffa_ch12_karatsub... 275 X'Length mod 2 = 0;
ffa_ch12_karatsub... 276
ffa_ch15_gcd.kv 277
ffa_ch15_gcd.kv 278 procedure FFA_FZ_Low_Multiply(X : in FZ;
ffa_ch15_gcd.kv 279 Y : in FZ;
ffa_ch15_gcd.kv 280 XY : out FZ)
ffa_ch15_gcd.kv 281 renames FZ_LoMul.FZ_Low_Multiply_Buffered;
ffa_ch15_gcd.kv 282
ffa_ch11_tuning_a... 283
ffa_ch11_tuning_a... 284
ffa_ch11_tuning_a... 285
ffa_ch11_tuning_a... 286
ffa_ch11_tuning_a... 287
ffa_ch11_tuning_a... 288 procedure FFA_FZ_Modular_Multiply(X : in FZ;
ffa_ch11_tuning_a... 289 Y : in FZ;
ffa_ch11_tuning_a... 290 Modulus : in FZ;
ffa_ch11_tuning_a... 291 Product : out FZ)
ffa_ch11_tuning_a... 292 renames FZ_ModEx.FZ_Mod_Mul;
ffa_ch11_tuning_a... 293
ffa_ch15_gcd.kv 294
ffa_ch15_gcd.kv 295 procedure FFA_FZ_Modular_Square(X : in FZ;
ffa_ch15_gcd.kv 296 Modulus : in FZ;
ffa_ch15_gcd.kv 297 Product : out FZ)
ffa_ch15_gcd.kv 298 renames FZ_ModEx.FZ_Mod_Sqr;
ffa_ch15_gcd.kv 299
ffa_ch11_tuning_a... 300
ffa_ch11_tuning_a... 301 procedure FFA_FZ_Modular_Exponentiate(Base : in FZ;
ffa_ch11_tuning_a... 302 Exponent : in FZ;
ffa_ch11_tuning_a... 303 Modulus : in FZ;
ffa_ch11_tuning_a... 304 Result : out FZ)
ffa_ch11_tuning_a... 305 renames FZ_ModEx.FZ_Mod_Exp;
ffa_ch11_tuning_a... 306
ffa_ch13_measure_... 307
ffa_ch13_measure_... 308
ffa_ch13_measure_... 309
ffa_ch13_measure_... 310
ffa_ch13_measure_... 311
ffa_ch14_barrett.kv 312 function FFA_FZ_Measure(N : in FZ) return FZBit_Index
ffa_ch13_measure_... 313 renames FZ_Measr.FZ_Measure;
ffa_ch13_measure_... 314
ffa_ch13_measure_... 315
ffa_ch13_measure_... 316 procedure FFA_FZ_Quiet_ShiftRight(N : in FZ;
ffa_ch13_measure_... 317 ShiftedN : in out FZ;
ffa_ch13_measure_... 318 Count : in FZBit_Index)
ffa_ch13_measure_... 319 renames FZ_QShft.FZ_Quiet_ShiftRight;
ffa_ch13_measure_... 320
ffa_ch13_measure_... 321
ffa_ch13_measure_... 322 procedure FFA_FZ_Quiet_ShiftLeft(N : in FZ;
ffa_ch13_measure_... 323 ShiftedN : in out FZ;
ffa_ch13_measure_... 324 Count : in FZBit_Index)
ffa_ch13_measure_... 325 renames FZ_QShft.FZ_Quiet_ShiftLeft;
ffa_ch13_measure_... 326
ffa_ch15_gcd.kv 327
ffa_ch15_gcd.kv 328 procedure FFA_FZ_Greatest_Common_Divisor(X : in FZ;
ffa_ch15_gcd.kv 329 Y : in FZ;
ffa_ch15_gcd.kv 330 Result : out FZ)
ffa_ch15_gcd.kv 331 with Pre => X'Length = Y'Length and X'Length = Result'Length;
ffa_ch15_gcd.kv 332
ffa_ch11_tuning_a... 333 end FFA;