- BA6B8ED841FF5C8CBADD59934821B311F6F74200C23BCBDA0B3A430C43A151B8242296D255C97C44788C6A5C97AFBE7DAC8339FD369AAFF3B509A70E9BA620F8
+ D6E1B802991B5A601E4253D419E72B22ADD215ACE76B8CDD8449C7587D7C6BBDB3A90074D67DDD33C5B7FA9A2584CAEC81DB4A658B817B7659CD3F92AF3491D7
ffa/libffa/ffa.ads
(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;