-
+ 7271E109FDFAD61859FABD2CCCACA71A7BAF037467E29DB9B82FF29ECF68FFAEAC3EBEBDFF7AF690087ACC97F3106A4C1F74ECB82E0D46A206A3318A71018315
ffa/libffa/fz_modex.ads
(0 . 0)(1 . 45)
170 ------------------------------------------------------------------------------
171 ------------------------------------------------------------------------------
172 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
173 -- --
174 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
175 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
176 -- --
177 -- You do not have, nor can you ever acquire the right to use, copy or --
178 -- distribute this software ; Should you use this software for any purpose, --
179 -- or copy and distribute it to anyone or in any manner, you are breaking --
180 -- the laws of whatever soi-disant jurisdiction, and you promise to --
181 -- continue doing so for the indefinite future. In any case, please --
182 -- always : read and understand any software ; verify any PGP signatures --
183 -- that you use - for any purpose. --
184 -- --
185 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
186 ------------------------------------------------------------------------------
187 ------------------------------------------------------------------------------
188
189 with FZ_Type; use FZ_Type;
190
191
192 package FZ_ModEx is
193
194 pragma Pure;
195
196 -- Modular Multiply: Product := X*Y mod Modulus
197 procedure FZ_Mod_Mul(X : in FZ;
198 Y : in FZ;
199 Modulus : in FZ;
200 Product : out FZ);
201 pragma Precondition(X'Length = Y'Length and
202 Modulus'Length = X'Length and
203 Product'Length = Modulus'Length);
204
205 -- Modular Exponent: Result := Base^Exponent mod Modulus
206 procedure FZ_Mod_Exp(Base : in FZ;
207 Exponent : in FZ;
208 Modulus : in FZ;
209 Result : out FZ);
210 pragma Precondition(Base'Length = Exponent'Length and
211 Base'Length = Result'Length and
212 Base'Length = Modulus'Length);
213
214 end FZ_ModEx;