Barrett reduction: Difference between revisions
Gareth Jones (talk | contribs) →Naive idea: missing s |
Gareth Jones (talk | contribs) inline ref |
||
Line 1: | Line 1: | ||
In [[modular arithmetic]], '''Barrett reduction''' is a reduction [[algorithm]] introduced in 1986 by P.D. Barrett. A naive way of computing |
In [[modular arithmetic]], '''Barrett reduction''' is a reduction [[algorithm]] introduced in 1986 by P.D. Barrett.<ref>{{cite doi|10.1007/3-540-47721-7_24}}</ref> A naive way of computing |
||
:<math>c = a \pmod n. \, </math> |
:<math>c = a \pmod n. \, </math> |
||
Line 33: | Line 33: | ||
[[Montgomery reduction]] is another similar algorithm. |
[[Montgomery reduction]] is another similar algorithm. |
||
==References== |
|||
{{Reflist}} |
|||
== Sources == |
== Sources == |
||
* [[P.D. Barrett]], "Implementing the Rivest Shamir and Adleman Public Key Encryption Algorithm on a Standard Digital Signal Processor," Advances in Cryptology — CRYPTO'86, Springer, 1986. [http://www.springerlink.com/content/c4f3rqbt5dxxyad4/] |
|||
*Chapter 14 of [[Alfred J. Menezes]], Paul C. van Oorschot, and [[Scott A. Vanstone]]. [http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf Handbook of Applied Cryptography]. CRC Press, 1996. ISBN 0-8493-8523-7. |
*Chapter 14 of [[Alfred J. Menezes]], Paul C. van Oorschot, and [[Scott A. Vanstone]]. [http://www.cacr.math.uwaterloo.ca/hac/about/chap14.pdf Handbook of Applied Cryptography]. CRC Press, 1996. ISBN 0-8493-8523-7. |
||
*Bosselaers, ''et al.'', "Comparison of Three Modular Reduction Functions," Advances in Cryptology-Crypto'93, 1993. [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.40.3779] |
*Bosselaers, ''et al.'', "Comparison of Three Modular Reduction Functions," Advances in Cryptology-Crypto'93, 1993. [http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.40.3779] |
Revision as of 03:22, 12 August 2013
In modular arithmetic, Barrett reduction is a reduction algorithm introduced in 1986 by P.D. Barrett.[1] A naive way of computing
would be to use a fast division algorithm. Barrett reduction is an algorithms designed to optimize this operation assuming is constant, and , replacing divisions by multiplications.
Naive idea
Let the inverse of as a floating point. Then
- where denotes the floor function,
assuming m was computed with sufficient accuracy.
Barrett algorithm
Barrett algorithm is a 2-adic analog which avoids the use of floating point. Assume n is odd and Let k be the smallest integer such that . We precompute m such that .
Let and . Then
and if then . So is either equal to or
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
Montgomery reduction is another similar algorithm.
References
- ^ Attention: This template ({{cite doi}}) is deprecated. To cite the publication identified by doi:10.1007/3-540-47721-7_24, please use {{cite journal}} (if it was published in a bona fide academic journal, otherwise {{cite report}} with
|doi=10.1007/3-540-47721-7_24
instead.
Sources
- Chapter 14 of Alfred J. Menezes, Paul C. van Oorschot, and Scott A. Vanstone. Handbook of Applied Cryptography. CRC Press, 1996. ISBN 0-8493-8523-7.
- Bosselaers, et al., "Comparison of Three Modular Reduction Functions," Advances in Cryptology-Crypto'93, 1993. [1]
- W. Hasenplaugh, G. Gaubatz, V. Gopal, "Fast Modular Reduction", ARITH 18