def load_fips_ecdsa_key_pair_vectors(vector_data):
 vectors = []
 key_data = None
 for line in vector_data:
  line = line.strip()
  if ((not line) or line.startswith('#')):
   continue
  if (line[1:(-1)] in _ECDSA_CURVE_NAMES):
   curve_name = _ECDSA_CURVE_NAMES[line[1:(-1)]]
  elif line.startswith('d = '):
   if (key_data is not None):
    vectors.append(key_data)
   key_data = {'curve': curve_name, 'd': int(line.split('=')[1], 16)}
  elif (key_data is not None):
   if line.startswith('Qx = '):
    key_data['x'] = int(line.split('=')[1], 16)
   elif line.startswith('Qy = '):
    key_data['y'] = int(line.split('=')[1], 16)
 assert (key_data is not None)
 vectors.append(key_data)
 return vectors

def load_fips_ecdsa_key_pair_vectors ( vector_data ) : vectors = [ ] key_data = None for line in vector_data : line = line . strip ( ) if ( ( not line ) or line . startswith ( '#' ) ) : continue if ( line [ 1 : ( - 1 ) ] in _ECDSA_CURVE_NAMES ) : curve_name = _ECDSA_CURVE_NAMES [ line [ 1 : ( - 1 ) ] ] elif line . startswith ( 'd = ' ) : if ( key_data is not None ) : vectors . append ( key_data ) key_data = { 'curve' : curve_name , 'd' : int ( line . split ( '=' ) [ 1 ] , 16 ) } elif ( key_data is not None ) : if line . startswith ( 'Qx = ' ) : key_data [ 'x' ] = int ( line . split ( '=' ) [ 1 ] , 16 ) elif line . startswith ( 'Qy = ' ) : key_data [ 'y' ] = int ( line . split ( '=' ) [ 1 ] , 16 ) assert ( key_data is not None ) vectors . append ( key_data ) return vectors
loads data out of the fips ecdsa keypair vector files .