Modular Arithmetic Reduction on Rational Numbers

This section describes how to perform Modular Arithmetic Reduction on Rational Numbers, which is equivalent to perform modular multiplication of the numerator and the multiplicative inverse of the denominator.

Before we do any testing on the point addition operation reduced by modular arithmetic of prime number p, we need to describe how to perform modular reduction on rational numbers:

Modular reduction on a rational number can be expressed as:
   d = r (mod p), where r is a rational number

Since any rational number can be expressed as 
a result of the division operation of two integers: 
   r = i/j (i is the numerator and j is denominator)

We can rewrite the rational number reduction expression as: 
   d = i/j (mod p) or
   d = i * (1/j) (mod p)

If we introduce t as 1/j, we can calculate d in 2 steps:
Which is equivalent of:
   t = 1/j (mod p)                                (13)
   d = i * t (mod p)                              (14)

If we convert (13) into a multiplication operation, we have:
   j * t = 1 (mod p)                              (15)
   d = i * t (mod p)                              (14)
 
Since modular reduction is associative to multiplication, 
we can reduce i, j and t first so that: 
   j * t = 1 (mod p)                              (15)
   d = i * t (mod p)                              (14)
where 0 <= i, j, t, d < p

In modular arithmetic, we say t is the multiplicative inverse of j, if:

 
   j * t = 1 (mod p)                              (15)

So performing modular reduction on a rational number reduction:

   d = r (mod p), where r is a rational number, or 
   d = i/j (mod p) (i is the numerator and j is denominator)

Is equivalent to perform modular multiplication of the numerator and the multiplicative inverse of the denominator:

   j * t = 1 (mod p)                              (15)
   d = i * t (mod p)                              (14)
   where 0 <= i, j, t, d < p

For example:

Given r = 1/4, what is d = r (mod 23)?
   d = r (mod 23)
   d = 1/4 (mod 23)
   d = 6, because 4*6 = 1 (mod 23)

Given r = 2/3, what is d = r (mod 23)?
   d = r (mod 23)
   d = 2/3 (mod 23)
   d = 2 * 1/3 (mod 23)
   d = 2 * 8 (mod 23), because 3*8 = 1 (mod 23)
   d = 16 

Actually, calculating the modular multiplicative inverse of an integer is not that easy when the modulo p is large. We need to use the "extended Euclidean algorithm" to get it done as described in "Elliptic Curve Cryptography: finite fields and discrete logarithms" by Andrea Corbellini at andrea.corbellini.name/2015/05/23 /elliptic-curve-cryptography-finite-fields-and-discrete-logarithms/.

Last update: 2019.

Table of Contents

 About This Book

 Geometric Introduction to Elliptic Curves

 Algebraic Introduction to Elliptic Curves

 Abelian Group and Elliptic Curves

 Discrete Logarithm Problem (DLP)

 Finite Fields

 Generators and Cyclic Subgroups

Reduced Elliptic Curve Groups

 Converting Elliptic Curve Groups

 Elliptic Curves in Integer Space

 Python Program for Integer Elliptic Curves

 Elliptic Curves Reduced by Modular Arithmetic

 Python Program for Reduced Elliptic Curves

 Point Pattern of Reduced Elliptic Curves

 Integer Points of First Region as Element Set

 Reduced Point Additive Operation

Modular Arithmetic Reduction on Rational Numbers

 Reduced Point Additive Operation Improved

 What Is Reduced Elliptic Curve Group

 Reduced Elliptic Curve Group - E23(1,4)

 Reduced Elliptic Curve Group - E97(-1,1)

 Reduced Elliptic Curve Group - E127(-1,3)

 Reduced Elliptic Curve Group - E1931(443,1045)

 What Is Hasse's Theorem

 Finite Elliptic Curve Group, Eq(a,b), q = p^n

 Elliptic Curve Subgroups

 tinyec - Python Library for ECC

 EC (Elliptic Curve) Key Pair

 ECDH (Elliptic Curve Diffie-Hellman) Key Exchange

 ECDSA (Elliptic Curve Digital Signature Algorithm)

 ECES (Elliptic Curve Encryption Scheme)

 Terminology

 References

 Full Version in PDF/EPUB