Commit 6f8e77c9 authored by Naga Suramouli's avatar Naga Suramouli
Browse files

Upload New File

parent ba8e3448
def Pointvalidation_Jacobi_Mont(x,y,a,b,PRECISION):
r=(2^PRECISION).__xor__(n); rpoly = str_to_poly(r)
r2poly = rpoly * rpoly; r2 = poly_to_str(r2poly)
rinvpoly = rpoly^-1; rinv = poly_to_str(rinvpoly)
x_poly = str_to_poly(x)
y_poly = str_to_poly(y)
x_poly_MD = x_poly * r2poly * rinvpoly
y_poly_MD = y_poly * r2poly * rinvpoly
L_poly_MD = L_poly * r2poly * rinvpoly
R_poly_MD = R_poly * r2poly * rinvpoly
temp1_poly_MD = x_poly_MD * rinvpoly
temp2_poly_MD = y_poly_MD * rinvpoly
temp3_poly_MD = a_poly_MD * rinvpoly
temp4_poly_MD = b_poly_MD * rinvpoly
temp5_poly_MD = temp1_poly_MD * temp1_poly_MD * rinvpoly
temp6_poly_MD = temp5_poly_MD * temp1_poly_MD * rinvpoly
temp7_poly_MD = temp2_poly_MD * temp2_poly_MD * rinvpoly
temp8_poly_MD = temp1_poly_MD * temp2_poly_MD * rinvpoly
temp9_poly_MD = temp3_poly_MD * temp5_poly_MD * rinvpoly
L_poly_MD = temp7_poly_MD + temp8_poly_MD * rinvpoly
R_poly_MD = temp4_poly_MD + temp9_poly_MD + temp6_poly_MD * rinvpoly
print 'L_MD=',poly_to_str(L_poly_MD)
print 'R_MD=',poly_to_str(R_poly_MD)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment