def encode_point(point, point_format=0):
 pLen = len(binrepr(point.curve().p()))
 x = pkcs_i2osp(point.x(), math.ceil((pLen / 8)))
 y = pkcs_i2osp(point.y(), math.ceil((pLen / 8)))
 if (point_format == 0):
  frmt = '\x04'
 elif (point_format == 1):
  frmt = chr((2 + (y % 2)))
  y = ''
 else:
  raise Exception(('No support for point_format %d' % point_format))
 return ((frmt + x) + y)

def encode_point ( point , point_format = 0 ) : pLen = len ( binrepr ( point . curve ( ) . p ( ) ) ) x = pkcs_i2osp ( point . x ( ) , math . ceil ( ( pLen / 8 ) ) ) y = pkcs_i2osp ( point . y ( ) , math . ceil ( ( pLen / 8 ) ) ) if ( point_format == 0 ) : frmt = '\x04' elif ( point_format == 1 ) : frmt = chr ( ( 2 + ( y % 2 ) ) ) y = '' else : raise Exception ( ( 'No support for point_format %d' % point_format ) ) return ( ( frmt + x ) + y )
return a string representation of the point p .