Skip to content
Snippets Groups Projects
Commit 1572f1f8 authored by Julia Chomicka's avatar Julia Chomicka
Browse files

rename parameters in C implementation

parent 22a343e4
No related merge requests found
......@@ -19,9 +19,9 @@ int gcd(int a, int b) {
/*function that searches for d using inverted modulo*/
int inverse_Modulo(int e, int n) {
int inverse_Modulo(int e, int p_1_q_1) {
int d = 1;
while ((e * d) % n != 1)
while ((e * d) % p_1_q_1 != 1)
d++;
return d;
}
......@@ -29,12 +29,12 @@ int inverse_Modulo(int e, int n) {
/* message encryption/decryption: modular exponentiation,
calculating x^e mod n by repeatedly multiplying x and taking the result modulo n*/
int mod_Exp(int x, int e, int p_1_q_1) {
int mod_Exp(int x, int e, int n) {
int c = 1;
int e_prim = 0;
while (e_prim < e) {
e_prim++;
c = (x * c) % p_1_q_1;
c = (x * c) % n;
}
return c;
}
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment