- 3236467E5470CA5B3B1384473445491EE52C0151D36A450CA1B9E496A9FE53A5AFE490B065FCDDD7A6E7DC6BBBDD902643B7C3BC4CFE5984F84E69AE5D8A7B2E
+ B9880001CD7A0ADC289E3F1EBC71B48EFF6CB1079EEB5A21BF32A81BA4E0E0F3F9917FFFDD02E0C1AC2F06553610FA0F396408680C411C8DB3B6A80A8E1E978D
ffa/libffa/fz_modex.adb
(42 . 22)(42 . 14)
131 XY_Lo : FZ renames XY(1 .. L);
132 XY_Hi : FZ renames XY(L + 1 .. XY'Last);
133
134 -- A zero-padded double-wide copy of Modulus, to satisfy Ch.5's FZ_Mod
135 M : FZ(XY'Range);
136
137 begin
138 -- Place the Modulus in a double-width M, as FZ_Mod currently demands
139 M(Modulus'Range) := Modulus;
140 M(L + 1 .. M'Last) := (others => 0);
141
142 -- XY_Lo:XY_Hi := X * Y
143 FZ_Mul_Egyptian(X, Y, XY_Lo, XY_Hi);
144
145 -- XY := XY mod M
146 FZ_Mod(XY, M, XY);
147 -- Product := XY mod M
148 FZ_Mod(XY, Modulus, Product);
149
150 -- The bottom half of XY is our modular product; top half is always 0
151 Product := XY_Lo;
152 end FZ_Mod_Mul;
153 pragma Inline_Always(FZ_Mod_Mul);
154