-
+ A773D77D13DC90E23E4BDB7612C9330D5789078FF5F6E0947E90EE4060D4E254AD93758E6D3F487C3C6932FCF9E6FA2A0B479264D4CDE7B160FF4C53DD70E720
ffa/libffa/fz_lomul.ads
(0 . 0)(1 . 54)
760 ------------------------------------------------------------------------------
761 ------------------------------------------------------------------------------
762 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
763 -- --
764 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
765 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
766 -- --
767 -- You do not have, nor can you ever acquire the right to use, copy or --
768 -- distribute this software ; Should you use this software for any purpose, --
769 -- or copy and distribute it to anyone or in any manner, you are breaking --
770 -- the laws of whatever soi-disant jurisdiction, and you promise to --
771 -- continue doing so for the indefinite future. In any case, please --
772 -- always : read and understand any software ; verify any PGP signatures --
773 -- that you use - for any purpose. --
774 -- --
775 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
776 ------------------------------------------------------------------------------
777 ------------------------------------------------------------------------------
778
779 with FZ_Type; use FZ_Type;
780
781
782 -- "Low Multiplication" computes only the bottom half of the product XY.
783 -- Presently, it is used solely in Barrett's Modular Reduction.
784
785 package FZ_LoMul is
786
787 pragma Pure;
788
789 -- Threshhold for Low Mul - at or below this many Words, we use Comba mult.
790 Low_Mul_Thresh : constant Indices := 8;
791
792 -- Multiply. (CAUTION: UNBUFFERED)
793 procedure FZ_Low_Multiply_Unbuffered(X : in FZ;
794 Y : in FZ;
795 XY : out FZ);
796 pragma Inline_Always(FZ_Low_Multiply_Unbuffered);
797
798 -- Comba's multiplier. (CAUTION: UNBUFFERED)
799 procedure FZ_Low_Mul_Comba(X : in FZ;
800 Y : in FZ;
801 XY : out FZ);
802 pragma Inline_Always(FZ_Low_Mul_Comba);
803
804 -- Low Multiplier. (CAUTION: UNBUFFERED)
805 procedure Low_Mul(X : in FZ;
806 Y : in FZ;
807 XY : out FZ)
808 with Pre => X'Length = Y'Length and
809 XY'Length = X'Length and
810 X'Length mod 2 = 0;
811 -- CAUTION: Inlining prohibited for Low_Mul !
812
813 end FZ_LoMul;