I'm trying to perform the modulus of a value in python, but I'm getting errors as it's interpretting the modulus as a string formatting constant, from my knowledge. My initial guess would be to type cast this, but then it hangs.
val = pow(a,n,p)
val = y1*val
val = val % p
Are the two lines of code corresponding to this question. Right now, when I run this, I get: TypeError: not all arguments converted during string formatting At the second line.
If I wrap val into an integer and type cast it...it takes extremely long to calculate.
I'm not too skilled with python, my guess is I'm missing something simple, but what?