raw
ffa_ch5_egypt.kv        1 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 2 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 3 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
ffa_ch5_egypt.kv 4 -- --
ffa_ch5_egypt.kv 5 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
ffa_ch5_egypt.kv 6 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
ffa_ch5_egypt.kv 7 -- --
ffa_ch5_egypt.kv 8 -- You do not have, nor can you ever acquire the right to use, copy or --
ffa_ch5_egypt.kv 9 -- distribute this software ; Should you use this software for any purpose, --
ffa_ch5_egypt.kv 10 -- or copy and distribute it to anyone or in any manner, you are breaking --
ffa_ch5_egypt.kv 11 -- the laws of whatever soi-disant jurisdiction, and you promise to --
ffa_ch5_egypt.kv 12 -- continue doing so for the indefinite future. In any case, please --
ffa_ch5_egypt.kv 13 -- always : read and understand any software ; verify any PGP signatures --
ffa_ch5_egypt.kv 14 -- that you use - for any purpose. --
ffa_ch5_egypt.kv 15 -- --
ffa_ch5_egypt.kv 16 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
ffa_ch5_egypt.kv 17 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 18 ------------------------------------------------------------------------------
ffa_ch5_egypt.kv 19
ffa_ch5_egypt.kv 20 with FZ_Type; use FZ_Type;
ffa_ch5_egypt.kv 21
ffa_ch5_egypt.kv 22
ffa_ch5_egypt.kv 23 package FZ_Divis is
ffa_ch5_egypt.kv 24
ffa_ch5_egypt.kv 25 pragma Pure;
ffa_ch5_egypt.kv 26
ffa_ch5_egypt.kv 27 -- Dividend is divided by Divisor, producing Quotient and Remainder.
ffa_ch5_egypt.kv 28 -- WARNING: NO div0 test here! Caller must test.
ffa_ch5_egypt.kv 29 procedure FZ_IDiv(Dividend : in FZ;
ffa_ch5_egypt.kv 30 Divisor : in FZ;
ffa_ch5_egypt.kv 31 Quotient : out FZ;
ffa_ch5_egypt.kv 32 Remainder : out FZ);
ffa_ch5_egypt.kv 33 pragma Precondition(Dividend'Length = Divisor'Length and
ffa_ch5_egypt.kv 34 Quotient'Length = Remainder'Length and
ffa_ch5_egypt.kv 35 Dividend'Length = Quotient'Length);
ffa_ch5_egypt.kv 36
ffa_ch5_egypt.kv 37 -- Exactly same thing as IDiv, but keep only the Quotient
ffa_ch5_egypt.kv 38 procedure FZ_Div(Dividend : in FZ;
ffa_ch5_egypt.kv 39 Divisor : in FZ;
ffa_ch5_egypt.kv 40 Quotient : out FZ);
ffa_ch5_egypt.kv 41 pragma Precondition(Dividend'Length = Divisor'Length and
ffa_ch5_egypt.kv 42 Dividend'Length = Quotient'Length);
ffa_ch5_egypt.kv 43
ffa_ch7_turbo_egy... 44 -- Modulus. Permits the asymmetric Dividend and Divisor in FZ_Mod_Exp.
ffa_ch5_egypt.kv 45 procedure FZ_Mod(Dividend : in FZ;
ffa_ch5_egypt.kv 46 Divisor : in FZ;
ffa_ch5_egypt.kv 47 Remainder : out FZ);
ffa_ch7_turbo_egy... 48 pragma Precondition(Dividend'Length >= Divisor'Length and
ffa_ch7_turbo_egy... 49 Divisor'Length = Remainder'Length);
ffa_ch5_egypt.kv 50
ffa_ch5_egypt.kv 51 end FZ_Divis;