From 1572f1f82c60ea7f3157728690217984a1fdf970 Mon Sep 17 00:00:00 2001 From: Julia Chomicka <juliachomicka@wp.pl> Date: Sat, 1 Jun 2024 19:44:02 +0200 Subject: [PATCH] rename parameters in C implementation --- rsa-c/rsa-c/rsa.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rsa-c/rsa-c/rsa.c b/rsa-c/rsa-c/rsa.c index c2d62b4..9d20f79 100644 --- a/rsa-c/rsa-c/rsa.c +++ b/rsa-c/rsa-c/rsa.c @@ -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; } -- GitLab