def construct(**kwargs):
 point_x = kwargs.pop('point_x', None)
 point_y = kwargs.pop('point_y', None)
 if ('point' in kwargs):
  raise TypeError('Unknown keyword: point')
 if (None not in (point_x, point_y)):
  kwargs['point'] = EccPoint(point_x, point_y)
  eq1 = pow(Integer(point_y), 2, _curve.p)
  x = Integer(point_x)
  eq2 = pow(x, 3, _curve.p)
  x *= (-3)
  eq2 += x
  eq2 += _curve.b
  eq2 %= _curve.p
  if (eq1 != eq2):
   raise ValueError('The point is not on the curve')
 d = kwargs.get('d', None)
 if ((d is not None) and ('point' in kwargs)):
  pub_key = (_curve.G * d)
  if ((pub_key.x != point_x) or (pub_key.y != point_y)):
   raise ValueError('Private and public ECC keys do not match')
 return EccKey(**kwargs)

def construct ( ** kwargs ) : point_x = kwargs . pop ( 'point_x' , None ) point_y = kwargs . pop ( 'point_y' , None ) if ( 'point' in kwargs ) : raise TypeError ( 'Unknown keyword: point' ) if ( None not in ( point_x , point_y ) ) : kwargs [ 'point' ] = EccPoint ( point_x , point_y ) eq1 = pow ( Integer ( point_y ) , 2 , _curve . p ) x = Integer ( point_x ) eq2 = pow ( x , 3 , _curve . p ) x *= ( - 3 ) eq2 += x eq2 += _curve . b eq2 %= _curve . p if ( eq1 != eq2 ) : raise ValueError ( 'The point is not on the curve' ) d = kwargs . get ( 'd' , None ) if ( ( d is not None ) and ( 'point' in kwargs ) ) : pub_key = ( _curve . G * d ) if ( ( pub_key . x != point_x ) or ( pub_key . y != point_y ) ) : raise ValueError ( 'Private and public ECC keys do not match' ) return EccKey ( ** kwargs )
construct(tuple:|):dsaobj construct a dsa object from a 4- or 5-tuple of numbers .