Guest User

Untitled

a guest
Oct 17th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. Result = a^b mod N
  2. k = length(b);
  3.  
  4. Result = 1;
  5. for i = k-1 to 0 do
  6. Result = (Result X Result) mod N; // SQUARING
  7.  
  8. if b[i] == 1
  9. Result = (Result X a) mod N; // MULTIPLICATION
  10. end if
  11.  
  12. end for
Add Comment
Please, Sign In to add comment