+
    '(j0                     v    ^ RI Ht ^ RIHtHt ^ RIHtHt ^ RIH	t	H
t
HtHt R tR t ! R R]4      tRR
 ltR	# )    )Integer)SHA512SHAKE256)bchris_bytes)EccKey	construct_import_ed25519_public_key_import_ed448_public_keyc                    \        V 4      ^ 8X  d   \        V 4      w  rRpM;\        V 4      ^98X  d   \        V 4      w  rRpM\        R\        V 4      ,          4      h\	        W1VR7      # )a  Create a new Ed25519 or Ed448 public key object,
starting from the key encoded as raw ``bytes``,
in the format described in RFC8032.

Args:
  encoded (bytes):
    The EdDSA public key to import.
    It must be 32 bytes for Ed25519, and 57 bytes for Ed448.

Returns:
  :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

Raises:
  ValueError: when the given key cannot be parsed.
Ed25519Ed448zNot an EdDSA key (%d bytes))curvepoint_xpoint_y)lenr
   r   
ValueErrorr	   )encodedxy
curve_names   &   K/home/ubuntu/cf-venv/lib/python3.14/site-packages/Crypto/Signature/eddsa.pyimport_public_keyr   )   s`    " 7|r)'2
	W	'0
6WEFF:!<<    c                |    \        V 4      ^ 8X  d   RpM\        V 4      ^98X  d   RpM\        R4      h\        WR7      # )a  Create a new Ed25519 or Ed448 private key object,
starting from the key encoded as raw ``bytes``,
in the format described in RFC8032.

Args:
  encoded (bytes):
    The EdDSA private key to import.
    It must be 32 bytes for Ed25519, and 57 bytes for Ed448.

Returns:
  :class:`Crypto.PublicKey.EccKey` : a new ECC key object.

Raises:
  ValueError: when the given key cannot be parsed.
ed25519ed448z8Incorrect length. Only EdDSA private keys are supported.)seedr   )r   r   r	   )r   r   s   & r   import_private_keyr   E   s?    " 7|r
	W	
STT
 '44r   c                   T   a  ] tR t^ct o RtR tR tR tR tR t	R t
R tR	 tR
tV tR# )EdDSASigSchemez`An EdDSA signature object.
Do not instantiate directly.
Use :func:`Crypto.Signature.eddsa.new`.
c                ~    Wn         W n        VP                  4       V n        VP                  P
                  V n        R# )zmCreate a new EdDSA object.

Do not instantiate this object directly,
use `Crypto.Signature.DSS.new` instead.
N)_key_context_export_eddsa_public_A_curveorder_order)selfkeycontexts   &&&r   __init__EdDSASigScheme.__init__i   s/     	**,jj&&r   c                6    V P                   P                  4       # )zJReturn ``True`` if this signature object can be used
for signing messages.)r#   has_private)r*   s   &r   can_signEdDSASigScheme.can_signu   s     yy$$&&r   c                   V P                   P                  4       '       g   \        R4      hV P                   P                  R8X  dL   \	        V\
        P                  4      pV'       g   \        V4      '       g   \        R4      hV P                  pMqV P                   P                  R8X  dL   \	        V\        P                  4      pV'       g   \        V4      '       g   \        R4      hV P                  pM\        R4      hV! W4      # )a  Compute the EdDSA signature of a message.

Args:
  msg_or_hash (bytes or a hash object):
    The message to sign (``bytes``, in case of *PureEdDSA*) or
    the hash that was carried out over the message (hash object, for *HashEdDSA*).

    The hash object must be :class:`Crypto.Hash.SHA512` for Ed25519,
    and :class:`Crypto.Hash.SHAKE256` object for Ed448.

:return: The signature as ``bytes``. It is always 64 bytes for Ed25519, and 114 bytes for Ed448.
:raise TypeError: if the EdDSA key has no private half
zPrivate key is needed to signr   -'msg_or_hash' must be bytes of a SHA-512 hashr   .'msg_or_hash' must be bytes of a SHAKE256 hashIncorrect curve for EdDSA)r#   r0   	TypeErrorr   
isinstancer   
SHA512Hashr   _sign_ed25519r   SHAKE256_XOF_sign_ed448r   )r*   msg_or_hashpheddsa_sign_methods   &&  r   signEdDSASigScheme.sign{   s     yy$$&&;<<99??i'K):):;B(;// OPP $ 2 2YY__'K)>)>?B(;// PQQ $ 0 0 899 11r   c                   V P                   '       g	   V'       dS   \        V4      pR \        V4      ,           \        \        V P                   4      4      ,           V P                   ,           pMRpV'       d   VP	                  4       MTp\
        P                  ! W@P                  P                  ,           V,           4      P	                  4       p\        P                  ! VR4      V P                  ,          p\        WpP                  P                  P                  ,          R7      P                  4       p\
        P                  ! WH,           V P                   ,           V,           4      P	                  4       p	\        P                  ! V	R4      V P                  ,          p
WzV P                  P"                  ,          ,           V P                  ,          pWP%                  ^ R4      ,           # )    SigEd25519 no Ed25519 collisionsr   littlepoint)r$   intr   r   digestr   newr#   _prefixr   
from_bytesr)   r   r'   Gr%   r&   dto_bytes)r*   r=   r>   flagdom2PHMr_hashrR_pkk_hashkss   &&&         r   r:   EdDSASigScheme._sign_ed25519   s>   ===Br7D6dCDMM*+,.2mm<D D&(k  "k
 D99#4#44s:;BBDvx04;;>A		 0 0 2 223HHJDK$''1C78??Avx04;;>TYY[[ DKK/jjX...r   c                   \        V4      pR \        V4      ,           \        \        V P                  4      4      ,           V P                  ,           pV'       d    VP	                  4       P                  ^@4      MTp\        P                  ! W@P                  P                  ,           V,           4      P                  ^r4      p\        P                  ! VR4      V P                  ,          p\        WpP                  P                  P                  ,          R7      P!                  4       p\        P                  ! WH,           V P"                  ,           V,           4      P                  ^r4      p	\        P                  ! V	R4      V P                  ,          p
WzV P                  P$                  ,          ,           V P                  ,          pWP'                  ^9R4      ,           # )   SigEd448rD   rE   )rG   r   r   r$   copyreadr   rI   r#   rJ   r   rK   r)   r   r'   rL   r%   r&   rM   rN   )r*   r=   r>   rO   dom4rQ   rR   rS   rT   rU   rV   rW   s   &&&         r   r<   EdDSASigScheme._sign_ed448   s=   2wT$Z'C&'(*.--8 .0k %%b)[
 dYY%6%66<=BB3Gvx04;;>A		 0 0 2 223HHJdkDGG3c9:??Dvx04;;>TYY[[ DKK/jjX...r   c                   V P                   P                  R8X  dL   \        V\        P                  4      pV'       g   \        V4      '       g   \        R4      hV P                  pMqV P                   P                  R8X  dL   \        V\        P                  4      pV'       g   \        V4      '       g   \        R4      hV P                  pM\        R4      hV! WV4      # )a'  Check if an EdDSA signature is authentic.

Args:
  msg_or_hash (bytes or a hash object):
    The message to verify (``bytes``, in case of *PureEdDSA*) or
    the hash that was carried out over the message (hash object, for *HashEdDSA*).

    The hash object must be :class:`Crypto.Hash.SHA512` object for Ed25519,
    and :class:`Crypto.Hash.SHAKE256` for Ed448.

  signature (``bytes``):
    The signature that needs to be validated.
    It must be 64 bytes for Ed25519, and 114 bytes for Ed448.

:raise ValueError: if the signature is not authentic
r   r4   r   r5   r6   )r#   r   r8   r   r9   r   r7   _verify_ed25519r   r;   _verify_ed448r   )r*   r=   	signaturer>   eddsa_verify_methods   &&&  r   verifyEdDSASigScheme.verify   s    $ 99??i'K):):;B(;// OPP"&"6"6YY__'K)>)>?B(;// PQQ"&"4"4 899";2>>r   c                   \        V4      ^@8w  d   \        R4      hV P                  '       g	   V'       dS   \        V4      pR\	        V4      ,           \	        \        V P                  4      4      ,           V P                  ,           pMRpV'       d   VP                  4       MTp \        VR,          4      P                  p\        P                  ! TR,          R4      pYP                  8  d   \        R4      h\        P                  ! YRR,          ,           T P                  ,           T,           4      P                  4       p	\        P                  ! T	R4      T P                  ,          p
T^,          T P                  P                  P                   ,          p^T,          T
^,          T P                  P                  ,          ,           pY8w  d   \        R	4      hR
#   \         d    \        R4      hi ; i)@   'The signature is not authentic (length)rC   r   :N    N"The signature is not authentic (R):ri   NNrD   "The signature is not authentic (S)The signature is not authenticN)r   r   r$   rG   r   rH   r   pointQr   rK   r)   r   rI   r&   r#   r'   rL   )r*   r=   rb   r>   rO   rP   rQ   RrW   rU   rV   point1point2s   &&&&         r   r`   EdDSASigScheme._verify_ed25519   s|   y>RFGG===Br7D6dCDMM*+,.2mm<D D&(k  "k
	C!)C.188A y~x8{{?ABBDS>1DGG;cABIIKvx04;;>Q))+++ QQ!1!111=>>   	CABB	Cs   %G G5c                   \        V4      ^r8w  d   \        R4      h\        V4      pR\        V4      ,           \        \        V P                  4      4      ,           V P                  ,           pV'       d    VP                  4       P                  ^@4      MTp \        VR,          4      P                  p\        P                  ! TR,          R4      pYP                  8  d   \        R4      h\        P                  ! YRR,          ,           T P                  ,           T,           4      P                  ^r4      p	\        P                  ! T	R4      T P                  ,          p
T^,          T P                  P                   P"                  ,          p^T,          T
^,          T P                  P                  ,          ,           pY8w  d   \        R4      hR	#   \         d    \        R4      hi ; i)
r   rh   rZ   :N9   Nrj   :rt   NNrD   rk   rl   N)r   r   rG   r   r$   r[   r\   r   rm   r   rK   r)   r   rI   r&   r#   r'   rL   )r*   r=   rb   r>   rO   r]   rQ   rn   rW   rU   rV   ro   rp   s   &&&&         r   ra   EdDSASigScheme._verify_ed448  sy   y>S FGG2wT$Z'C&'(*.--8 .0k %%b)[
	C!)C.188A y~x8{{?ABBds^3dgg=CDII#Nvx04;;>Q))+++ QQ!1!111=>>   	CABB	Cs   G G()r&   r$   r#   r)   N)__name__
__module____qualname____firstlineno____doc__r-   r1   r@   r:   r<   rd   r`   ra   __static_attributes____classdictcell__)__classdict__s   @r   r!   r!   c   s:     

''!2F/6/0!?F!?F? ?r   r!   Nc                    \        V \        4      '       d   V P                  R9  d   \        R4      hVR8w  d   \        R4      hVf   RpM\	        V4      ^8  d   \        R4      h\        W4      # )aq  Create a signature object :class:`EdDSASigScheme` that
can perform or verify an EdDSA signature.

Args:
    key (:class:`Crypto.PublicKey.ECC` object):
        The key to use for computing the signature (*private* keys only)
        or for verifying one.
        The key must be on the curve ``Ed25519`` or ``Ed448``.

    mode (string):
        This parameter must be ``'rfc8032'``.

    context (bytes):
        Up to 255 bytes of `context <https://datatracker.ietf.org/doc/html/rfc8032#page-41>`_,
        which is a constant byte string to segregate different protocols or
        different applications of the same key.
z&EdDSA can only be used with EdDSA keysrfc8032zMode must be 'rfc8032'r   z3Context for EdDSA must not be longer than 255 bytes)r   r   )r8   r   r   r   r   r!   )r+   moder,   s   &&&r   rI   rI   9  sj    & c6""cii7K&KABBy122	W	NOO#''r   )N)Crypto.Math.Numbersr   Crypto.Hashr   r   Crypto.Util.py3compatr   r   Crypto.PublicKey.ECCr   r	   r
   r   r   r   objectr!   rI    r   r   <module>r      s8   > ( ( 0< <=85<S?V S?l(r   