Integer Arithmetic

In integer arithmetic, we use a set and few operations. We are familiar with this set and corresponding, but they are reviewed here to create a background for modular arithmetic.

( i ) Set of Integers : The set of integers, denoted by 'Z', contains all integral number ( with no fractions ) from negative infinity to positive infinity. Which is shown as follows


Z = { -∞, ........, -2, -1, 0, 1, 2, ............., +∞ }.


( ii ) Binary operations : In cryptography, we are interested in three binary operations applied to the set of integers. The binary operation takes two integers and create one output. Three common binary operations defined for  integers are addition, subtraction and multiplication. Each of these operations takes two input ( a, b ) and creates one output ( c ) as shown in the following figure.







The following shows the results of the three binary operations on two integers because each input can be either positive or negative, we can have four case for each operation.

Add : 5 + 9 = 14;  ( -5 ) + 9 = 4; 5 + ( -9 ) = -4; ( -5 ) + ( - 9 ) = -14.
Subtract : 5 - 9 = -4;  ( -5 ) - 9 = -14; 5 - ( -9 ) = 14; ( -5 ) - ( - 9 ) = 4.
Multiplication : 5 * 9 = 45;  ( -5 ) * 9 = -45; 5 * ( -9 ) = -45; ( -5 ) * ( - 9 ) = 45.

( iii ) Integer division : In integer arithmetic, if we divide a/n, we can get q and r. The relationship between these four can be shown as follows

a = q * n + r

In this relation, a is called the dividend, q is called quotient, n is called the divisor and r is called the remainder. Note that this is not an operation, because the result of dividing a by n is two integers q and r  we can call it division relation.


Example : Assume that a = 255 and n = 11 we can find q = 23 and r = 2 using the division algorithm.

( iv ) Two restrictions : When we use the above division relationship in cryptography, we impose in two relationships. First we require that the divisor be a positive integer ( n > 0 ), and second we require that he remainder be a non-negative integer ( r ≥ 0 ). The following block diagram illustrate the basic concepts of division algorithm for integers.




Graph of division algorithm



Starting from '0', the graph shows how we can reach the point representing the integer 'a' on the number line. In case of a positive integer 'a', we need to move ( q * n ) units to the right and then move extra 'r' units in the same direction, In case of negative  integer 'a', we need to move ( q- 1) * n units to left ( q is negative in this case ) and then move extra 'r' units int he opposite direction. In both cases the value of  'r' is positive.


Comments

Popular posts from this blog

Euclid's Algorithm to find greatest common divisior

Algebraic System or Algebraic Structure and Group

Symmetric key cryptography