def load_plain_keyfile(filename):
 with open(filename, 'rb') as f:
  key = f.read()
  if (len(key) == 32):
   return key
  if (len(key) == 64):
   return key.decode('hex')
  return sha256(key)
 raise IOError('Could not read keyfile.')

def load_plain_keyfile ( filename ) : with open ( filename , 'rb' ) as f : key = f . read ( ) if ( len ( key ) == 32 ) : return key if ( len ( key ) == 64 ) : return key . decode ( 'hex' ) return sha256 ( key ) raise IOError ( 'Could not read keyfile.' )
a "plain" keyfile is a file containing only the key .