-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SOT-177: Add Montgomery term #81
base: main
Are you sure you want to change the base?
Conversation
This technique replaces division by $n$ with division by a power of $2$, , which is easily performed on a computer since numbers are | ||
represented in binary form. | ||
|
||
To achieve this, we need to convert all the numbers we use into Montgomery space. The $n$-residue of $a$ in Montgomery space is given |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
achieve what ?
To compute this product, we need to determine $r^{-1}$, which satisfies the property: | ||
|
||
$r \cdot r^{-1} = 1 \mod n$ | ||
$\iff r \cdot r^{-1} - n \cdot n' = 1$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
n' ?
We show how to compute $9 * 11 \mod 13$ ($= 8$). We have: | ||
|
||
- $r = 2^4 = 16$ | ||
- Using the Extended Euclid algorithm, we determine that $16 ** 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Using the Extended Euclid algorithm, we determine that $16 ** 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ | |
- Using the Extended Euclid algorithm, we determine that $16 * 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ |
We show how to compute $x = 7^{10} \mod 13$ ($=4$). We have: | ||
|
||
- $r = 2^4 = 16$ | ||
- Using the Extended Euclid algorithm, we determine that $16 ** 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Using the Extended Euclid algorithm, we determine that $16 ** 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ | |
- Using the Extended Euclid algorithm, we determine that $16 * 9 − 13 * 11 = 1$, thus, $r^{-1} = 9, n' = 11$ |
Therefore, we can find $r^{-1}$ and $n'$ using the | ||
[Extended Euclid algorithm](https://en.wikipedia.org/wiki/Extended_Euclidean_algorithm). We can express $\bar{R}$ as follows: | ||
|
||
$\bar R = \bar a \cdot \bar b \cdot r^{-1} \mod n$ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use array to align equations
Check List