(33 . 6)(33 . 7)
67 with FZ_Measr;
68 with FZ_QShft;
69 with FZ_LoMul;
70 with FZ_Prime;
71
72
73 -- FFA Exports
(44 . 7)(45 . 7)
75 --- Current 'deg. Kelvin' Version of FFA
76 ----------------------------------------------------------------------------
77
78 FFA_K_Version : constant Natural := 254;
79 FFA_K_Version : constant Natural := 253;
80
81 ----------------------------------------------------------------------------
82 --- Fundamental Types and Sizes
(330 . 4)(331 . 17)
84 Result : out FZ)
85 with Pre => X'Length = Y'Length and X'Length = Result'Length;
86
87 -- Constant-Time Miller-Rabin Test on N using the given Witness.
88 -- Witness will be used as-is if it conforms to the valid bounds,
89 -- i.e. 2 <= Witness <= N - 2; otherwise will be transformed into a
90 -- valid Witness via modular arithmetic.
91 -- Outputs ONE if N WAS FOUND composite; ZERO if NOT FOUND.
92 -- Handles degenerate cases of N that M-R per se cannot eat:
93 -- N=0, N=1: ALWAYS 'FOUND COMPOSITE'; 2, 3 - ALWAYS 'NOT FOUND'.
94 -- If N is Even and not equal to 2, N is ALWAYS 'FOUND COMPOSITE.'
95 -- For ALL other N, the output is equal to that of the M-R test.
96 function FFA_FZ_MR_Composite_On_Witness(N : in FZ;
97 Witness : in FZ) return WBool
98 renames FZ_Prime.FZ_MR_Composite_On_Witness;
99
100 end FFA;