def pub2point(pub_hex): x = int(pub_hex[2:66], 16) if len(pub_hex) < 70: y = bit.format.x_to_y(x, int(pub_hex[:2], 16) % 2) else: y = int(pub_hex[66:], 16) return ec.Point(x, y)
def sym_point(this_point): # find the symmetrical point from Order of the Curve parity = 0 if this_point.y % 2 == 1 else 1 # flip the parity to get other Point other_y = bit.format.x_to_y(this_point.x, parity) return ec.Point(this_point.x, other_y)