From c74bceee9739d2259eedda7031e33d87304916de Mon Sep 17 00:00:00 2001 From: Vincent <vincent.steinmann@etu.hesge.ch> Date: Tue, 22 Jun 2021 19:46:11 +0200 Subject: [PATCH] clean code --- IDEA.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/IDEA.py b/IDEA.py index c58746d..125e4fa 100644 --- a/IDEA.py +++ b/IDEA.py @@ -31,6 +31,12 @@ def Invert_Mod(a): else : return Fast_exp(a, m - 2, m) +def gcd(a,b): + if (b==0): + return a + else: + return gcd(b, a % b) + def Fast_exp(b, e, m): ''' Function of fast exponation @@ -66,12 +72,6 @@ def Split_str(s, p): #Split a string def Shift(k): return k[6:] + k[0:6] -def gcd(a,b): - if (b==0): - return a - else: - return gcd(b, a % b) - def Round(lst_msg,lst_k): step1 = Mult_mod(lst_msg[0],lst_k[0]) step2 = Add_mod(lst_msg[1],lst_k[1]) -- GitLab