Question
i posted a while ago asking for help with code and although the code isnt getting errors anymore its still not outputting anything. please help
i posted a while ago asking for help with code and although the code isnt getting errors anymore its still not outputting anything. please help get this code working. im not entirely sure how why its not working but the output only gives me a cursor.
source:
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
input
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started