Related Concepts
Definition
Barrett’s algorithm is a process allowing the computation of the quantity \(u {\rm mod}\,\,n\) without resorting to trial division. The method is efficient in settings where u changes frequently for a relatively invariant n (which is the case in cryptography). Let N denote the size of n in bits, \(u < {2}^{2N}\) and \(q = \lfloor u/n\rfloor \). Define:
Note that the constant \(\left \lfloor \frac{{2}^{2N}} {n} \right \rfloor \) can be computed once for all and reused for many different u values. All other operations necessary for the computation of q′ are simple multiplications and bit-shifts.
It is easy to prove that \(u - nq' < u - n(q + 2) = (u {\rm mod}\,\,n) + 2n\). Hence, one multiplication and (at most) two subtractions will suffice to determine \(u...
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Recommended Reading
Barrett PD (1987) Implementing the Rivest Shamir and Adleman public key encryption algorithm on a standard digital signal processor. In: Odlyzko AM (ed) Advances in Cryptology. Proc. Crypto 86, LNCS 263. Springer, Berlin, Heidelberg, pp 311–323
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2011 Springer Science+Business Media, LLC
About this entry
Cite this entry
Naccache, D. (2011). Barrett’s Algorithm. In: van Tilborg, H.C.A., Jajodia, S. (eds) Encyclopedia of Cryptography and Security. Springer, Boston, MA. https://doi.org/10.1007/978-1-4419-5906-5_501
Download citation
DOI: https://doi.org/10.1007/978-1-4419-5906-5_501
Publisher Name: Springer, Boston, MA
Print ISBN: 978-1-4419-5905-8
Online ISBN: 978-1-4419-5906-5
eBook Packages: Computer ScienceReference Module Computer Science and Engineering