Misplaced Pages

Barrett reduction

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.
Reduction algorithm developed by P.D. Barrett

In modular arithmetic, Barrett reduction is a reduction algorithm introduced in 1986 by P.D. Barrett.

A naive way of computing

c = a mod n {\displaystyle c=a\,{\bmod {\,}}n\,}

would be to use a fast division algorithm. Barrett reduction is an algorithm designed to optimize this operation assuming n {\displaystyle n} is constant, and a < n 2 {\displaystyle a<n^{2}} , replacing divisions by multiplications.

Historically, for values a , b < n {\displaystyle a,b<n} , one computed a b mod n {\displaystyle ab\,{\bmod {\,}}n\,} by applying Barrett reduction to the full product a b {\displaystyle ab} . Recently, it was shown that the full product is unnecessary if we can perform precomputation on one of the operands.

General idea

We call a function [ ] : R Z {\displaystyle \left:\mathbb {R} \to \mathbb {Z} } an integer approximation if | [ z ] z | 1 {\displaystyle |\left-z|\leq 1} . For a modulus n {\displaystyle n} and an integer approximation [ ] {\displaystyle \left} , we define mod [ ] n : Z ( Z / n Z ) {\displaystyle {\text{mod}}^{\left}\,n:\mathbb {Z} \to (\mathbb {Z} /n\mathbb {Z} )} as

a mod [ ] n = a [ a / n ] n {\displaystyle a\,{\text{mod}}^{\left}\,n=a-\leftn} .

Common choices of [ ] {\displaystyle \left} are floor, ceiling, and rounding functions.

Generally, Barrett multiplication starts by specifying two integer approximations [ ] 0 , [ ] 1 {\displaystyle \left_{0},\left_{1}} and computes a reasonably close approximation of a b mod n {\displaystyle ab\,{\bmod {\,}}n} as

a b [ a [ b R n ] 0 R ] 1 n {\displaystyle ab-\left_{0}}{R}}\right]_{1}n} ,

where R {\displaystyle R} is a fixed constant, typically a power of 2, chosen so that multiplication and division by R {\displaystyle R} can be performed efficiently.

The case b = 1 {\displaystyle b=1} was introduced by P.D. Barrett for the floor-function case [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\lfloor \,\rfloor } . The general case for b {\displaystyle b} can be found in NTL. The integer approximation view and the correspondence between Montgomery multiplication and Barrett multiplication was discovered by Hanno Becker, Vincent Hwang, Matthias J. Kannwischer, Bo-Yin Yang, and Shang-Yi Yang.

Single-word Barrett reduction

Barrett initially considered an integer version of the above algorithm when the values fit into machine words. We illustrate the idea for the floor-function case with b = 1 {\displaystyle b=1} and R = 2 k {\displaystyle R=2^{k}} .

When calculating a mod n {\displaystyle a\,{\bmod {\,}}n} for unsigned integers, the obvious analog would be to use division by n {\displaystyle n} :

func reduce(a uint) uint {
    q:= a / n  // Division implicitly returns the floor of the result.
    return a - q * n
}

However, division can be expensive and, in cryptographic settings, might not be a constant-time instruction on some CPUs, subjecting the operation to a timing attack. Thus Barrett reduction approximates 1 / n {\displaystyle 1/n} with a value m / 2 k {\displaystyle m/2^{k}} because division by 2 k {\displaystyle 2^{k}} is just a right-shift, and so it is cheap.

In order to calculate the best value for m {\displaystyle m} given 2 k {\displaystyle 2^{k}} consider:

m 2 k = 1 n m = 2 k n {\displaystyle {\frac {m}{2^{k}}}={\frac {1}{n}}\;\Longleftrightarrow \;m={\frac {2^{k}}{n}}}

For m {\displaystyle m} to be an integer, we need to round 2 k / n {\displaystyle {2^{k}}/{n}} somehow. Rounding to the nearest integer will give the best approximation but can result in m / 2 k {\displaystyle m/2^{k}} being larger than 1 / n {\displaystyle 1/n} , which can cause underflows. Thus m = 2 k / n {\displaystyle m=\lfloor {2^{k}}/{n}\rfloor } is used for unsigned arithmetic.

Thus we can approximate the function above with the following:

func reduce(a uint) uint {
    q := (a * m) >> k // ">> k" denotes bitshift by k.
    return a - q * n
}

However, since m / 2 k 1 / n {\displaystyle m/2^{k}\leq 1/n} , the value of q in that function can end up being one too small, and thus a is only guaranteed to be within [ 0 , 2 n ) {\displaystyle [0,2n)} rather than [ 0 , n ) {\displaystyle [0,n)} as is generally required. A conditional subtraction will correct this:

func reduce(a uint) uint {
    q := (a * m) >> k
    a -= q * n
    if a >= n {
        a -= n
    }
    return a
}

Single-word Barrett multiplication

Suppose b {\displaystyle b} is known. This allows us to precompute b R n {\displaystyle \left\lfloor {\frac {bR}{n}}\right\rfloor } before we receive a {\displaystyle a} . Barrett multiplication computes a b {\displaystyle ab} , approximates the high part of a b {\displaystyle ab} with a b R n R n {\displaystyle \left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n} , and subtracts the approximation. Since a b R n R n {\displaystyle \left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n} is a multiple of n {\displaystyle n} , the resulting value a b a b R n R n {\displaystyle ab-\left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n} is a representative of a b mod n {\displaystyle ab\,{\bmod {\,}}n} .

Correspondence between Barrett and Montgomery multiplications

Recall that unsigned Montgomery multiplication computes a representative of a b mod n {\displaystyle ab\,{\bmod {\,}}n} as

a ( b R mod n ) + ( a ( b R mod n ) n 1 mod R ) n R {\displaystyle {\frac {a\left(bR\,{\bmod {\,}}n\right)+\left(a\left(-bR\,{\bmod {\,}}n\right)n^{-1}\,{\bmod {\,}}R\right)n}{R}}} .

In fact, this value is equal to a b a b R n R n {\displaystyle ab-\left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n} .

We prove the claim as follows.

a b a b R n R n = a b a b R n ( a b R n mod R ) R n = ( a b R n a b R n + ( a b R n mod R ) ) n R = ( a b R n a b R ( b R mod n ) n + ( a b R n mod R ) ) n R = ( a ( b R mod n ) n + ( a b R n mod R ) ) n R = ( a ( b R mod n ) n + ( a ( b R mod n ) n 1 mod R ) ) n R = a ( b R mod n ) + ( a ( b R mod n ) n 1 mod R ) n R . {\displaystyle {\begin{aligned}&&&ab-\left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n\\&=&&ab-{\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor -\left(a\left\lfloor {\frac {bR}{n}}\right\rfloor \,{\bmod {\,}}R\right)}{R}}\,n\\&=&&\left({\frac {abR}{n}}-a\left\lfloor {\frac {bR}{n}}\right\rfloor +\left(a\left\lfloor {\frac {bR}{n}}\right\rfloor \,{\bmod {\,}}R\right)\right){\frac {n}{R}}\\&=&&\left({\frac {abR}{n}}-a{\frac {bR-\left(bR\,{\bmod {\,}}n\right)}{n}}+\left(a\left\lfloor {\frac {bR}{n}}\right\rfloor \,{\bmod {\,}}R\right)\right){\frac {n}{R}}\\&=&&\left({\frac {a\left(bR\,{\bmod {\,}}n\right)}{n}}+\left(a\left\lfloor {\frac {bR}{n}}\right\rfloor \,{\bmod {\,}}R\right)\right){\frac {n}{R}}\\&=&&\left({\frac {a\left(bR\,{\bmod {\,}}n\right)}{n}}+\left(a\left(-bR\,{\bmod {\,}}n\right)n^{-1}\,{\bmod {\,}}R\right)\right){\frac {n}{R}}\\&=&&{\frac {a\left(bR\,{\bmod {\,}}n\right)+\left(a\left(-bR\,{\bmod {\,}}n\right)n^{-1}\,{\bmod {\,}}R\right)n}{R}}.\end{aligned}}}

Generally, for integer approximations [ ] 0 , [ ] 1 {\displaystyle \left_{0},\left_{1}} , we have

a b [ a [ b R n ] 0 R ] 1 n = a ( b R mod [ ] 0 n ) + ( a ( b R mod [ ] 0 q ) n 1 mod [ ] 1 R ) n R {\displaystyle ab-\left_{0}}{R}}\right]_{1}\,n={\frac {a\left(bR\,{\text{mod}}^{\left_{0}}\,n\right)+\left(a\left(-bR\,{\text{mod}}^{\left_{0}}\,q\right)n^{-1}\,{\text{mod}}^{\left_{1}}\,R\right)n}{R}}} .

Range of Barrett multiplication

We bound the output with a b a b R n R n = a ( b R mod n ) + ( a ( b R mod n ) n 1 mod R ) n R a n + R n R = n ( 1 + a R ) {\displaystyle ab-\left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rfloor }{R}}\right\rfloor \,n={\frac {a\left(bR\,{\bmod {\,}}n\right)+\left(a\left(-bR\,{\bmod {\,}}n\right)n^{-1}\,{\bmod {\,}}R\right)n}{R}}\leq {\frac {an+Rn}{R}}=n\left(1+{\frac {a}{R}}\right)} .

Similar bounds hold for other kinds of integer approximation functions. For example, if we choose [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\left\lfloor \,\right\rceil } , the rounding half up function, then we have

| a b a b R n R n | = | a ( b R mod ± n ) + ( a ( b R mod ± n ) n 1 mod ± R ) n R | | a | n 2 + R 2 n R = n 2 ( 1 + | a | R ) . {\displaystyle \left|ab-\left\lfloor {\frac {a\left\lfloor {\frac {bR}{n}}\right\rceil }{R}}\right\rceil \,n\right|=\left|{\frac {a\left(bR\,{\text{mod}}^{\pm }\,n\right)+\left(a\left(-bR\,{\text{mod}}^{\pm }\,n\right)n^{-1}\,{\text{mod}}^{\pm }\,R\right)n}{R}}\right|\leq {\frac {|a|{\frac {n}{2}}+{\frac {R}{2}}n}{R}}={\frac {n}{2}}\left(1+{\frac {|a|}{R}}\right).}

It is common to select R such that a R < 1 {\displaystyle {\frac {a}{R}}<1} (or | a | R < 1 {\displaystyle {\frac {\left|a\right|}{R}}<1} in the [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\left\lfloor \,\right\rceil }   case) so that the output remains within 0 {\displaystyle 0} and 2 n {\displaystyle 2n} ( n {\displaystyle -n} and n {\displaystyle n} resp.), and therefore only one check is performed to obtain the final result between 0 {\displaystyle 0} and n {\displaystyle n} . Furthermore, one can skip the check and perform it once at the end of an algorithm at the expense of larger inputs to the field arithmetic operations.

Barrett multiplication non-constant operands

The Barrett multiplication previously described requires a constant operand b to pre-compute [ b R n ] 0 {\displaystyle \left_{0}} ahead of time. Otherwise, the operation is not efficient. It is common to use Montgomery multiplication when both operands are non-constant as it has better performance. However, Montgomery multiplication requires a conversion to and from Montgomery domain which means it is expensive when a few modular multiplications are needed.

To perform Barrett multiplication with non-constant operands, one can set a {\displaystyle a} as the product of the operands and set b {\displaystyle b} to 1 {\displaystyle 1} . This leads to

a [ a [ R n ] 0 R ] 1 n = a ( R mod [ ] 0 n ) + ( a ( R mod [ ] 0 q ) n 1 mod [ ] 1 R ) n R {\displaystyle a-\left_{0}}{R}}\right]_{1}\,n={\frac {a\left(R\,{\text{mod}}^{\left_{0}}\,n\right)+\left(a\left(-R\,{\text{mod}}^{\left_{0}}\,q\right)n^{-1}\,{\text{mod}}^{\left_{1}}\,R\right)n}{R}}}

A quick check on the bounds yield the following in [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\left\lfloor \,\right\rfloor } case

a a R n R n = a ( R mod n ) + ( a ( R mod n ) n 1 mod R ) n R a ( R mod n ) + R n R = n ( 1 + a ( R mod n ) R n ) {\displaystyle {\begin{aligned}a-\left\lfloor {\frac {a\,\left\lfloor {\frac {R}{n}}\right\rfloor }{R}}\right\rfloor \,n&={\frac {a\left(R\,{\bmod {\,}}n\right)+\left(a\left(-R\,{\bmod {\,}}n\right)n^{-1}\,{\bmod {\,}}R\right)n}{R}}\\&\leq {\frac {a(R\,{\bmod {\,}}n)+Rn}{R}}=n\left(1+{\frac {a(R\,{\bmod {\,}}n)}{Rn}}\right)\end{aligned}}}

and the following in [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\left\lfloor \,\right\rceil } case

| a a R n R n | = | a ( R mod ± n ) + ( a ( R mod ± n ) n 1 mod ± R ) n R | | a ( R mod ± n ) | + R 2 n R = n 2 ( 1 + | a ( R mod ± n ) | R n ) {\displaystyle {\begin{aligned}\left|a-\left\lfloor {\frac {a\left\lfloor {\frac {R}{n}}\right\rceil }{R}}\right\rceil \,n\right|&=\left|{\frac {a\left(R\,{\text{mod}}^{\pm }\,n\right)+\left(a\left(-R\,{\text{mod}}^{\pm }\,n\right)n^{-1}\,{\text{mod}}^{\pm }\,R\right)n}{R}}\right|\\&\leq {\frac {|a(R\,{\text{mod}}^{\pm }\,n)|+{\frac {R}{2}}n}{R}}={\frac {n}{2}}\left(1+{\frac {|a(R\,{\text{mod}}^{\pm }\,n)|}{Rn}}\right)\end{aligned}}}

Setting R > | a | {\displaystyle R>|a|} will always yield one check on the output. However, a tighter constraint on R {\displaystyle R} might be possible since R mod [ ] 0 n {\displaystyle R\,{\text{mod}}^{\left_{0}}\,n} is a constant that is sometimes significantly smaller than n {\displaystyle n} .

A small issue arises with performing the following product a [ R n ] 0 {\displaystyle a\,\left_{0}} since a {\displaystyle a} is already a product of two operands. Assuming n {\displaystyle n} fits in w {\displaystyle w} bits, then a {\displaystyle a} would fit in 2 w {\displaystyle 2w} bits and [ R n ] 0 {\displaystyle \left_{0}} would fit in w {\displaystyle w} bits. Their product would require a 2 w × w {\displaystyle 2w\times w} multiplication which might require fragmenting in systems that cannot perform the product in one operation.

An alternative approach is to perform the following Barrett reduction:

a [ [ a R 0 ] 2 [ R n ] 0 R 1 ] 1 n = a ( R mod [ ] 0 n ) + ( a mod [ ] 2 R 0 ) ( R R mod [ ] 0 n ) + ( [ a R 0 ] 2 [ R n ] 0 mod [ ] 1 R 1 ) R 0 n R {\displaystyle a-\left_{2}\,\left_{0}}{R_{1}}}\right]_{1}\,n={\frac {a\left(R\,{\text{mod}}^{\left_{0}}\,n\right)+\left(a\,{\text{mod}}^{\left_{2}}\,R_{0}\right)\left(R-R\,{\text{mod}}^{\left_{0}}\,n\right)+\left(\left_{2}\,\left_{0}\,{\text{mod}}^{\left_{1}}\,R_{1}\right)R_{0}n}{R}}}

where R 0 = 2 k β {\displaystyle R_{0}=2^{k-\beta }} , R 1 = 2 α + β {\displaystyle R1=2^{\alpha +\beta }} , R = R 0 R 1 = 2 k + α {\displaystyle R=R_{0}\cdot R_{1}=2^{k+\alpha }} , and k {\displaystyle k} is the bit-length of n {\displaystyle n} .

Bound check in the case [ ] 0 = [ ] 1 = [ ] 2 = {\displaystyle \left_{0}=\left_{1}=\left_{2}=\left\lfloor \,\right\rfloor } yields the following

a a R 0 R n R n a ( R mod n ) + R 0 R R 0 ( R mod n ) + R n R = n ( 1 + a ( R mod n ) R n + R 0 n R mod n R 1 n ) {\displaystyle {\begin{aligned}a-\left\lfloor {\frac {\left\lfloor {\frac {a}{R_{0}}}\right\rfloor \,\left\lfloor {\frac {R}{n}}\right\rfloor }{R}}\right\rfloor \,n&\leq {\frac {a\left(R\,{\bmod {\,}}n\right)+R_{0}R-R_{0}\left(R\,{\bmod {\,}}n\right)+Rn}{R}}\\&=n\left(1+{\frac {a(R\,{\bmod {\,}}n)}{Rn}}+{\frac {R_{0}}{n}}-{\frac {R\,{\bmod {\,}}n}{R_{1}n}}\right)\end{aligned}}}

and for the case [ ] 0 = [ ] 1 = [ ] 2 = {\displaystyle \left_{0}=\left_{1}=\left_{2}=\left\lfloor \,\right\rceil } yields the following

| a a R 0 R n R n | | a ( R mod ± n ) | + R 0 R / 2 + R 0 | ( R mod ± n ) | / 2 + R n / 2 R = n 2 ( 1 + 2 | a ( R mod ± n ) | R n + R 0 n + | R mod ± n | R 1 n ) {\displaystyle {\begin{aligned}\left|a-\left\lfloor {\frac {\left\lfloor {\frac {a}{R_{0}}}\right\rceil \left\lfloor {\frac {R}{n}}\right\rceil }{R}}\right\rceil \,n\right|&\leq {\frac {|a\left(R\,{\text{mod}}^{\pm }\,n\right)|+R_{0}R/2+R_{0}|(R\,{\text{mod}}^{\pm }\,n)|/2+Rn/2}{R}}\\&={\frac {n}{2}}\left(1+{\frac {2|a(R\,{\text{mod}}^{\pm }\,n)|}{Rn}}+{\frac {R_{0}}{n}}+{\frac {|R\,{\text{mod}}^{\pm }\,n|}{R_{1}n}}\right)\end{aligned}}}

For any modulus and assuming | a | < 2 k + γ {\displaystyle |a|<2^{k+\gamma }} , the bound inside the parenthesis in both cases is less than or equal:

1 + ( 2 k + γ ) ( n ) ( 2 k + α ) ( n ) + 2 k β n + ϵ 1 + 2 k + γ 2 k + α + 2 k β 2 k 1 + ϵ = 1 + 2 γ α + 2 1 β + ϵ {\displaystyle 1+{\frac {(2^{k+\gamma })(n)}{(2^{k+\alpha })(n)}}+{\frac {2^{k-\beta }}{n}}+\epsilon \leq 1+{\frac {2^{k+\gamma }}{2^{k+\alpha }}}+{\frac {2^{k-\beta }}{2^{k-1}}}+\epsilon =1+2^{\gamma -\alpha }+2^{1-\beta }+\epsilon } where ϵ = 1 R 1 {\displaystyle \epsilon =-{\frac {1}{R_{1}}}} in the {\displaystyle \left\lfloor \,\right\rfloor } case and ϵ = 1 2 R 1 {\displaystyle \epsilon ={\frac {1}{2R_{1}}}} in the {\displaystyle \left\lfloor \,\right\rceil } case.

Setting β = 2 {\displaystyle \beta =2} and α = γ + 1 {\displaystyle \alpha =\gamma +1} (or α = γ + 2 {\displaystyle \alpha =\gamma +2} in the {\displaystyle \left\lfloor \,\right\rceil } case) will always yield one check. In some cases, testing the bounds might yield a lower α {\displaystyle \alpha } and/or β {\displaystyle \beta } values.

Small Barrett reduction

It is possible to perform a Barrett reduction with one less multiplication as follows

a [ a R ] 1 n {\displaystyle a-\left_{1}\,n} where R = 2 k {\displaystyle R=2^{k}} and k {\displaystyle k} is the bit-length of n {\displaystyle n}

Every modulus can be written in the form n = 2 k c = R c {\displaystyle n=2^{k}-c=R-c} for some integer c {\displaystyle c} .

a [ a R ] 1 n = a a ( a mod [ ] 1 R ) R n = a R a n + ( a mod [ ] 1 R ) n R = a c + ( a mod [ ] 1 R ) n R = n ( a mod [ ] 1 R R + a c R n ) = n ( a mod [ ] 1 R R + a R 2 c R ) {\displaystyle {\begin{aligned}a-\left_{1}\,n&=a-{\frac {a-(a\,{\text{mod}}^{\left_{1}}\,R)}{R}}n\\&={\frac {aR-an+(a\,{\text{mod}}^{\left_{1}}\,R)n}{R}}\\&={\frac {ac+(a\,{\text{mod}}^{\left_{1}}\,R)n}{R}}\\&=n\left({\frac {a\,{\text{mod}}^{\left_{1}}\,R}{R}}+{\frac {ac}{Rn}}\right)\\&=n\left({\frac {a\,{\text{mod}}^{\left_{1}}\,R}{R}}+{\frac {a}{{\frac {R^{2}}{c}}-R}}\right)\end{aligned}}}

Therefore, reducing any a < R 2 c R {\displaystyle a<{\frac {R^{2}}{c}}-R} for [ ] 1 = {\displaystyle \left_{1}=\left\lfloor \,\right\rfloor } or any | a | < ( R 2 c R ) / 2 {\displaystyle |a|<\left({\frac {R^{2}}{c}}-R\right)/\,2} for [ ] 1 = {\displaystyle \left_{1}=\left\lfloor \,\right\rceil } yields one check.

From the analysis of the constraint, it can be observed that the bound of a {\displaystyle a} is larger when c {\displaystyle c} is smaller. In other words, the bound is larger when n {\displaystyle n} is closer to R {\displaystyle R} .

Barrett Division

Barrett reduction can be used to compute floor, round or ceil division [ a n ] {\displaystyle \left} without performing expensive long division. Furthermore it can be used to compute [ a b n ] {\displaystyle \left} . After pre-computing the constants, the steps are as follows:

1. Compute the approximate quotient q ~ = [ a [ b R n ] 0 R ] 1 {\displaystyle {\tilde {q}}=\left_{0}}{R}}\right]_{1}}

2. Compute the Barrett remainder r ~ = a b q ~ n {\displaystyle {\tilde {r}}=ab-{\tilde {q}}n}

3. Compute the quotient error e = ( r ~ r ) / n {\displaystyle e=({\tilde {r}}-r)/n} where r = a mod [ ] n {\displaystyle r=a\,{\text{mod}}^{\left}\,n} . This is done by subtracting a multiple of n {\displaystyle n} to r ~ {\displaystyle {\tilde {r}}} until r {\displaystyle r} is obtained.

4. Compute the quotient q = q ~ + e {\displaystyle q={\tilde {q}}+e}

If the constraints for the Barrett reduction are chosen such that there is one check, then the absolute value of e {\displaystyle e} in step 3 cannot be more than 1. Using [ ] 0 = [ ] 1 = {\displaystyle \left_{0}=\left_{1}=\left\lfloor \,\right\rceil } and appropriate constraints, the error e {\displaystyle e} can be obtained from the sign of r ~ {\displaystyle {\tilde {r}}} .

Multi-word Barrett reduction

Barrett's primary motivation for considering reduction was the implementation of RSA, where the values in question will almost certainly exceed the size of a machine word. In this situation, Barrett provided an algorithm that approximates the single-word version above but for multi-word values. For details see section 14.3.3 of the Handbook of Applied Cryptography.

Barrett algorithm for polynomials

It is also possible to use Barrett algorithm for polynomial division, by reversing polynomials and using X-adic arithmetic.

See also

References

  1. ^ Barrett, P. (1986). "Implementing the Rivest Shamir and Adleman Public Key Encryption Algorithm on a Standard Digital Signal Processor". Advances in Cryptology – CRYPTO' 86. Lecture Notes in Computer Science. Vol. 263. pp. 311–323. doi:10.1007/3-540-47721-7_24. ISBN 978-3-540-18047-0.
  2. ^ Shoup, Victor. "Number Theory Library".
  3. ^ Becker, Hanno; Hwang, Vincent; Kannwischer, Matthias J.; Yang, Bo-Yin; Yang, Shang-Yi (2021), "Neon NTT: Faster Dilithium, Kyber, and Saber on Cortex-A72 and Apple M1", Transactions on Cryptographic Hardware and Embedded Systems, 2022 (1): 221–244, doi:10.46586/tches.v2022.i1.221-244
  4. Menezes, Alfred; Oorschot, Paul; Vanstone, Scott (1997). Handbook of Applied Cryptography (5th ed.). CRC Press. doi:10.1201/9780429466335. ISBN 0-8493-8523-7.
  5. "Barrett reduction for polynomials". www.corsix.org. Retrieved 2022-09-07.

Sources

Categories: