Point_validation_affine.sage 578 Bytes
Newer Older
Naga Suramouli's avatar
Naga Suramouli committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
def Pointvalidation_affine(x,y,a,b,n,PRECISION):

x_poly= str_to_poly(x)
y_poly=str_to_poly(y)

print 'x_poly=',x_poly
print 'y_poly=',y_poly

#Calculation of resultant coordinates
L_poly = ( (y_poly ) *(y_poly ) ) + ( (x_poly ) * (y_poly ) ) 

R_poly = ( (x_poly ) * (x_poly ) * (x_poly ) )  + ((x_poly ) * (x_poly ) * a ) + b

L_poly-R_poly = 0

print 'L=',poly_to_str(L_poly)
print 'R=',poly_to_str(R_poly)
print 'L-R=', poly_to_str(L_poly-R_poly)

  
    
 #where the equation should satisfy with the parameters to validate point on curve
     # y.y + xy = x.x.x +a.x.x + b