The Laws of Cryptography:
Testing Two Exponentiation Algorithms

by Neal R. Wagner

Copyright © 2001 by Neal R. Wagner. All rights reserved.

NOTE: This site is obsolete. See book draft (in PDF):

The code below the two algorithms for carrying out integer exponentiation that were presented in the text. Each function has additional debug statements to provide extra output. The non-debug code is given in purple.

Here are results of test runs, with a few extra blanks to improve readability:


Revision date: 2002-02-16. (Please use ISO 8601, the International Standard.)