(2 . 7)(2 . 7)
1011 ------------------------------------------------------------------------------
1012 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
1013 -- --
1014 -- (C) 2017 Stanislav Datskovskiy ( www.loper-os.org ) --
1015 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
1016 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
1017 -- --
1018 -- You do not have, nor can you ever acquire the right to use, copy or --
(24 . 7)(24 . 7)
1020
1021 pragma Pure;
1022
1023 -- Modular Multiply: Product := X*Y mod Modulus
1024 -- (Conventional) Modular Multiply: Product := X*Y mod Modulus
1025 procedure FZ_Mod_Mul(X : in FZ;
1026 Y : in FZ;
1027 Modulus : in FZ;
(33 . 14)(33 . 14)
1029 Modulus'Length = X'Length and
1030 Product'Length = Modulus'Length;
1031
1032 -- Modular Square: Product := X*X mod Modulus
1033 -- (Conventional) Modular Squaring: Product := X*X mod Modulus
1034 procedure FZ_Mod_Sqr(X : in FZ;
1035 Modulus : in FZ;
1036 Product : out FZ)
1037 with Pre => Modulus'Length = X'Length and
1038 Product'Length = Modulus'Length;
1039
1040 -- Modular Exponent: Result := Base^Exponent mod Modulus
1041 -- (Barrettronic) Modular Exponent: Result := Base^Exponent mod Modulus
1042 procedure FZ_Mod_Exp(Base : in FZ;
1043 Exponent : in FZ;
1044 Modulus : in FZ;