Question: please help my understand why this code is failing, below i will provide source code and picture of my error. if you can provide fixes

please help my understand why this code is failing, below i will provide source code and picture of my error. if you can provide fixes that would be greatly appreciated. project due very soon! thank you!please help my understand why this code is failing, below i will

source code:

def powMod_sm(base, exp, n): exp_b=bin(exp) value=base for i in range(3, len(exp_b)): value=(value**2)%n if exp_b[i:i+1]=='1: ': value = (value * base)% n return value # using the euclidean Algorithm def computeGCD(x, y): while y: x, y = y, x % y return x #Extended euclidean Algorithm method to calculate gcd and get the coefficient def extendedGCD(a, b): if a == 0: return b, 0, 1 gcd, x1, y1 = extendedGCD(b % a, a) x = y1 - (b // a)* x1 y = x1 return gcd, x, y # calculating the modular inverse using EEA def mod_Inv(b, n): gcd, _, t = extendedGCD(n, b) if gcd==1: i = t % n elif gcd!=1: print("Inverse is undefined") return i #miller-rabin Primality test def mrt(p): if p == 2 or p == 3: return True if p

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!