Skip to content
Snippets Groups Projects
Commit c74bceee authored by vincent.steinman's avatar vincent.steinman
Browse files

clean code

parent 4a9a05a0
No related branches found
No related tags found
No related merge requests found
...@@ -31,6 +31,12 @@ def Invert_Mod(a): ...@@ -31,6 +31,12 @@ def Invert_Mod(a):
else : else :
return Fast_exp(a, m - 2, m) 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): def Fast_exp(b, e, m):
''' '''
Function of fast exponation Function of fast exponation
...@@ -66,12 +72,6 @@ def Split_str(s, p): #Split a string ...@@ -66,12 +72,6 @@ def Split_str(s, p): #Split a string
def Shift(k): def Shift(k):
return k[6:] + k[0:6] 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): def Round(lst_msg,lst_k):
step1 = Mult_mod(lst_msg[0],lst_k[0]) step1 = Mult_mod(lst_msg[0],lst_k[0])
step2 = Add_mod(lst_msg[1],lst_k[1]) step2 = Add_mod(lst_msg[1],lst_k[1])
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment