Input: Positive integer ,
Output:
(1) Use Algorithm 1 to compute .
(2) .
(3) For from downto 0 do
(3.1) Q = 2Q.
(3.2) If = 1 then ;
(3.3) If = −1 then ;
(4) Return (Q).
Algorithm 2: Binary NAF method for scalar multiplication.