Skip to content
Snippets Groups Projects
Commit 45ed2966 authored by Naga Suramouli's avatar Naga Suramouli
Browse files

Merge branch 'undefined' into '2-attach-and-verify-sage-files-in-cryptocore'

Pointdoubling_affine

See merge request !4
parents 7a18fedd 8ccd84a9
No related branches found
No related tags found
1 merge request!4Pointdoubling_affine
def Pointdoubling_affine(x1,y1,a,n,PRECISION):
x1_poly = str_to_poly(x1)
y1_poly = str_to_poly(y1)
#print 'x1_poly =', x1_poly
#print 'y1_poly =', y1_poly
xpoly = (1)
expp = 2^PRECISION-2
for i in reversed(xrange(PRECISION)):
xpoly = xpoly * xpoly
if(expp.digits(base = 2,padto=PRECISION)[i] == 1):
xpoly = y1_poly* xpoly
inv_y1_poly = xpoly
s_poly = (3*x1_poly*x1_poly+a)*2*inv_y1_poly
x2_poly = s_poly*s_poly-2*x1_poly
y2_poly = s_poly*(x1_poly-x2_poly)-y1_poly
print 'x2 =',poly_to_str(x2_poly)
print 'y2 =',poly_to_str(y2_poly)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment