Research Article

Efficient Big Integer Multiplication and Squaring Algorithms for Cryptographic Applications

Algorithm 7

Binary to limited Big-one converter algorithm, .
Input: positive integers   having base 2 digits and positive integer .
Output:   having digits in LCBONS and non-zero .
(1) Set; , .
(2) For from 0 up to do the following:
  (2.1) Set
  (2.2) If then do the following:
  (2.2.1) Set ; .
  (2.3) While do the following:
  (2.3.1) Increase and by 1.
  (2.3.2) If thenSet .
  (2.3.3) If then do the following:
    (2.3.3.1) Set and .
    (2.3.3.2) Decrease by 1.
  (2.4) If then do the following:
  (2.4.1) Set and .
(3) Return .