- 364F816604E2EE0FC4A07429824E32292032806456AFC794D306EE7F9A41180D9A517FB2563311F1F526F9B6512597E974321DCA2AC61251D36DA4033F18578D+ BA6B8ED841FF5C8CBADD59934821B311F6F74200C23BCBDA0B3A430C43A151B8242296D255C97C44788C6A5C97AFBE7DAC8339FD369AAFF3B509A70E9BA620F8ffa/libffa/ffa.ads(2 . 7)(2 . 7)
435 ------------------------------------------------------------------------------
436 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
437 -- --
438 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
439 -- (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) --
440 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
441 -- --
442 -- You do not have, nor can you ever acquire the right to use, copy or --
(32 . 6)(32 . 7)
444 with FZ_ModEx;
445 with FZ_Measr;
446 with FZ_QShft;
447 with FZ_LoMul;
448
449
450 -- FFA Exports
(43 . 7)(44 . 7)
452 --- Current 'deg. Kelvin' Version of FFA
453 ----------------------------------------------------------------------------
454
455 FFA_K_Version : constant Natural := 255;
456 FFA_K_Version : constant Natural := 254;
457
458 ----------------------------------------------------------------------------
459 --- Fundamental Types and Sizes
(273 . 6)(274 . 12)
461 XX_Hi'Length = X'Length and
462 X'Length mod 2 = 0;
463
464 -- Low-Only Multiplier. Preserves the inputs.
465 procedure FFA_FZ_Low_Multiply(X : in FZ;
466 Y : in FZ;
467 XY : out FZ)
468 renames FZ_LoMul.FZ_Low_Multiply_Buffered;
469
470 ----------------------------------------------------------------------------
471 --- Modular Operations on FZ
472 ----------------------------------------------------------------------------
(284 . 6)(291 . 12)
474 Product : out FZ)
475 renames FZ_ModEx.FZ_Mod_Mul;
476
477 -- Modular Squaring: Product := X*X mod Modulus
478 procedure FFA_FZ_Modular_Square(X : in FZ;
479 Modulus : in FZ;
480 Product : out FZ)
481 renames FZ_ModEx.FZ_Mod_Sqr;
482
483 -- Modular Exponent: Result := Base^Exponent mod Modulus
484 procedure FFA_FZ_Modular_Exponentiate(Base : in FZ;
485 Exponent : in FZ;
(311 . 4)(324 . 10)
487 Count : in FZBit_Index)
488 renames FZ_QShft.FZ_Quiet_ShiftLeft;
489
490 -- Find Greatest Common Divisor (GCD) of X and Y.
491 procedure FFA_FZ_Greatest_Common_Divisor(X : in FZ;
492 Y : in FZ;
493 Result : out FZ)
494 with Pre => X'Length = Y'Length and X'Length = Result'Length;
495
496 end FFA;