(2 . 7)(2 . 7)
537 ------------------------------------------------------------------------------
538 -- This file is part of 'Finite Field Arithmetic', aka 'FFA'. --
539 -- --
540 -- (C) 2018 Stanislav Datskovskiy ( www.loper-os.org ) --
541 -- (C) 2019 Stanislav Datskovskiy ( www.loper-os.org ) --
542 -- http://wot.deedbot.org/17215D118B7239507FAFED98B98228A001ABFFC7.html --
543 -- --
544 -- You do not have, nor can you ever acquire the right to use, copy or --
(255 . 10)(255 . 10)
546 -- Result is initially zero (and will stay zero if Modulus = 1)
547 FZ_Clear(XReduced);
548
549 -- (1) Ns := X >> Jm
550 -- (1) Xs := X >> Jm
551 FZ_Quiet_ShiftRight(N => X, ShiftedN => Xs, Count => Bar.J);
552
553 -- (2) Z := X * Bm
554 -- (2) Z := Xs * Bm
555 FZ_Multiply_Unbuffered(X => Bar.B, Y => Xs, XY => Z);
556
557 -- (3) Zs := Z >> 2Wm - Jm (already thrown lower Wm, so only Wm - Jm now)