def findScalarMul(decimal,P,a,p): R=P; binary="{0:b}".format(decimal); for i in range(1,len(binary)): if binary[i]=='1': R=Addition.doubleP(R,a,p); R=Addition.addP(P,R,a,p); else: R=Addition.doubleP(R,a,p); return R;
def findOrder(P,a,p): R=P; order=1; Result=Addition.doubleP(P,a,p) while Result!='O': #print Result; order=order+1; R=Result; Result=Addition.addP(P,R,a,p); order=order+1; return order;
def findOrder(P, a, p): R = P order = 1 Result = Addition.doubleP(P, a, p) while Result != 'O': #print Result; order = order + 1 R = Result Result = Addition.addP(P, R, a, p) order = order + 1 return order