Barrett reduction allows us to quickly calculate the quotient
One of the use case is in GLV decomposition. For simplicity, we consider all the integers below are less than
When
In the glv paper, it considers more general case where
In practice, We use n=lambda=0xAC45A4010001A40200000000FFFFFFFF
is exaclty
Algorithm 1
Assume
Proof
It's easy to see
We prove a general algorithm.
Algorithm 2
Assume
Proof
(In general, algorithm holds as long as
Define
By Algorithm 1, we have
Example 1 If we choose
Example 2 If we choose
Faster Point Multiplication on Elliptic Curves
with Efficient Endomorphisms
Modern Computer Arithmetic
public