def generate_public_and_private():
<EOL>seed = os.urandom(<NUM_LIT:32>)<EOL>public = None<EOL>try:<EOL><INDENT>nacl_key = nacl.signing.SigningKey(seed)<EOL>public = nacl_key.verify_key.encode(encoder=nacl.encoding.RawEncoder())<EOL><DEDENT>except NameError: <EOL><INDENT>raise securesystemslib.exceptions.UnsupportedLibraryError('<STR_LIT>'<EOL>'<STR_LIT>')<EOL><DEDENT>return public, seed<EOL>
<Purpose>
  Generate a pair of ed25519 public and private keys with PyNaCl.  The public
  and private keys returned conform to
  'securesystemslib.formats.ED25519PULIC_SCHEMA' and
  'securesystemslib.formats.ED25519SEED_SCHEMA', respectively, and have the
  form:

  '\xa2F\x99\xe0\x86\x80%\xc8\xee\x11\xb95T\xd9\...'

  An ed25519 seed key is a random 32-byte string.  Public keys are also 32
  bytes.

  >>> public, private = generate_public_and_private()
  >>> securesystemslib.formats.ED25519PUBLIC_SCHEMA.matches(public)
  True
  >>> securesystemslib.formats.ED25519SEED_SCHEMA.matches(private)
  True

<Arguments>
  None.

<Exceptions>
  securesystemslib.exceptions.UnsupportedLibraryError, if the PyNaCl ('nacl')
  module is unavailable.

  NotImplementedError, if a randomness source is not found by 'os.urandom'.

<Side Effects>
  The ed25519 keys are generated by first creating a random 32-byte seed
  with os.urandom() and then calling PyNaCl's nacl.signing.SigningKey().

<Returns>
  A (public, private) tuple that conform to
  'securesystemslib.formats.ED25519PUBLIC_SCHEMA' and
  'securesystemslib.formats.ED25519SEED_SCHEMA', respectively.