Defalt initialize q to p, e to 0. The following loop will properly assign them.
This commit is contained in:
parent
e6e63f2d32
commit
563778716c
1 changed files with 2 additions and 2 deletions
4
main.c
4
main.c
|
@ -34,7 +34,7 @@ int main() {
|
|||
enter_blink();
|
||||
|
||||
uint64_t p = gen_prime(1 << 15, 1 << 16);
|
||||
uint64_t q = gen_prime(1 << 15, 1 << 16);
|
||||
uint64_t q = p;
|
||||
|
||||
while (p == q) p = gen_prime(1 << 15, 1 << 16);
|
||||
|
||||
|
@ -42,7 +42,7 @@ int main() {
|
|||
uint64_t phi_n = (p - 1) * (q - 1);
|
||||
|
||||
// 'e' is public. E for encrypt.
|
||||
uint64_t e = prand_range(3, phi_n - 1);
|
||||
uint64_t e = 0;
|
||||
while (gcd(e, phi_n) != 1) e = prand_range(3, phi_n - 1);
|
||||
|
||||
// 'd' is our private key. D as in decrypt
|
||||
|
|
Loading…
Add table
Reference in a new issue