(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