ó
    &ÝNj¨9  ã                   ó:  • S SK JrJrJrJrJr  S SKrS SKJr  S SKJ	r
  S SKJr  S SKJrJrJr   " S S\R"                  \5      r " S	 S
\R"                  \5      r\" SSS9r " S S\R"                  \5      r\" S\\5      r " S S\\   \R"                  \5      rg)é    )ÚClassVarÚGenericÚOptionalÚTypeÚTypeVarN)Úencoding)Ú
exceptions)ÚEncoder)ÚEncryptedMessageÚStringFixerÚrandomc                   óÖ   • \ rS rSr% Sr\R                  R                  r\	\
   \S'   \R                  4S\S\R                  4S jjrS\4S jrS\
4S	 jrS
\S\4S jrS
\S\4S jrSrg)Ú	PublicKeyé   a%  
The public key counterpart to an Curve25519 :class:`nacl.public.PrivateKey`
for encrypting messages.

:param public_key: [:class:`bytes`] Encoded Curve25519 public key
:param encoder: A class that is able to decode the `public_key`

:cvar SIZE: The size that the public key is required to be
ÚSIZEÚ
public_keyÚencoderc                 ó>  • UR                  U5      U l        [        U R                  [        5      (       d  [        R
                  " S5      e[        U R                  5      U R                  :w  a/  [        R                  " SR                  U R                  5      5      eg )Nz'PublicKey must be created from 32 bytesz,The public key must be exactly {} bytes long)
ÚdecodeÚ_public_keyÚ
isinstanceÚbytesÚexcÚ	TypeErrorÚlenr   Ú
ValueErrorÚformat)Úselfr   r   s      ÚH/home/mande/repo/quber/.venv/lib/python3.13/site-packages/nacl/public.pyÚ__init__ÚPublicKey.__init__$   sz   € ð
 #Ÿ>™>¨*Ó5ˆÔÜ˜$×*Ñ*¬E×2Ñ2Ü—-’-Ð IÓJÐJäˆt×ÑÓ  D§I¡IÓ-Ü—.’.Ø>×EÑEØ—I‘Ióóð ð .ó    Úreturnc                 ó   • U R                   $ ©N©r   ©r   s    r   Ú	__bytes__ÚPublicKey.__bytes__4   ó   € Ø×ÑÐr"   c                 ó*   • [        [        U 5      5      $ r%   )Úhashr   r'   s    r   Ú__hash__ÚPublicKey.__hash__7   s   € Ü”E˜$“KÓ Ð r"   Úotherc                 óœ   • [        XR                  5      (       d  g[        R                  R	                  [        U 5      [        U5      5      $ ©NF)r   Ú	__class__ÚnaclÚbindingsÚsodium_memcmpr   ©r   r/   s     r   Ú__eq__ÚPublicKey.__eq__:   s3   € Ü˜%§¡×0Ñ0ØÜ�}‰}×*Ñ*¬5°«;¼¸e»ÓEÐEr"   c                 ó   • X:X  + $ r%   © r6   s     r   Ú__ne__ÚPublicKey.__ne__?   ó   € ØÒ"Ð"r"   r&   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r3   r4   Úcrypto_box_PUBLICKEYBYTESr   r   ÚintÚ__annotations__r   Ú
RawEncoderr   r
   r    r(   r-   ÚobjectÚboolr7   r;   Ú__static_attributes__r:   r"   r   r   r      sŠ   ‡ ñð Ÿ-™-×AÑA€Dˆ(�3‰-ÓAð
 %-×$7Ñ$7ñàðð ×!Ñ!õð  ˜5ô  ð!˜#ô !ðF˜Fð F tô Fð
#˜Fð # t÷ #r"   r   c                   ót  • \ rS rSr% Sr\R                  R                  r\	\
   \S'   \R                  R                  r\	\
   \S'   \R                  4S\S\R"                  4S jjr\\R                  4S\S\R"                  S	S 4S
 jj5       rS	\4S jrS	\
4S jrS\S	\4S jrS\S	\4S jr\SS j5       rSrg)Ú
PrivateKeyéC   aO  
Private key for decrypting messages using the Curve25519 algorithm.

.. warning:: This **must** be protected and remain secret. Anyone who
    knows the value of your :class:`~nacl.public.PrivateKey` can decrypt
    any message encrypted by the corresponding
    :class:`~nacl.public.PublicKey`

:param private_key: The private key used to decrypt messages
:param encoder: The encoder class used to decode the given keys

:cvar SIZE: The size that the private key is required to be
:cvar SEED_SIZE: The size that the seed used to generate the
                 private key is required to be
r   Ú	SEED_SIZEÚprivate_keyr   c                 óJ  • UR                  U5      n[        U[        5      (       a  [        U5      U R                  :X  d/  [
        R                  " SR                  U R                  5      5      e[        R                  R                  U5      nXl        [        U5      U l        g )Nz>PrivateKey must be created from a {} bytes long raw secret key)r   r   r   r   r   r   r   r   r3   r4   Úcrypto_scalarmult_baseÚ_private_keyr   r   )r   rN   r   Úraw_public_keys       r   r    ÚPrivateKey.__init__W   s{   € ð —n‘n [Ó1ˆô �{¤E×*Ñ*¬s°;Ó/?À4Ç9Á9Ó/Lä—-’-àTß‘&˜Ÿ™Ó#óð ô Ÿ™×=Ñ=¸kÓJˆà'ÔÜ# NÓ3ˆ�r"   Úseedr#   c                 ó0  • UR                  U5      n[        U[        5      (       a  [        U5      U R                  :X  d/  [
        R                  " SR                  U R                  5      5      e[        R                  R                  U5      u  p4U " U5      $ )a  
Generate a PrivateKey using a deterministic construction
starting from a caller-provided seed

.. warning:: The seed **must** be high-entropy; therefore,
    its generator **must** be a cryptographic quality
    random function like, for example, :func:`~nacl.utils.random`.

.. warning:: The seed **must** be protected and remain secret.
    Anyone who knows the seed is really in possession of
    the corresponding PrivateKey.

:param seed: The seed used to generate the private key
:rtype: :class:`~nacl.public.PrivateKey`
z7PrivateKey seed must be a {} bytes long binary sequence)r   r   r   r   rM   r   r   r   r3   r4   Úcrypto_box_seed_keypair)ÚclsrT   r   Úraw_pkÚraw_sks        r   Ú	from_seedÚPrivateKey.from_seedm   sr   € ð, �~‰~˜dÓ#ˆä˜4¤×'Ñ'¬C°«I¸¿¹Ó,FÜ—-’-àMß‘&˜Ÿ™Ó'óð ô Ÿ™×>Ñ>¸tÓD‰ˆá�6‹{Ðr"   c                 ó   • U R                   $ r%   )rQ   r'   s    r   r(   ÚPrivateKey.__bytes__�   s   € Ø× Ñ Ð r"   c                 óT   • [        [        U 5      [        U R                  5      45      $ r%   )r,   Útyper   r   r'   s    r   r-   ÚPrivateKey.__hash__“   s   € Ü”T˜$“Z¤ t§¡Ó!7Ð8Ó9Ð9r"   r/   c                 ój   • [        XR                  5      (       d  gU R                  UR                  :H  $ r1   )r   r2   r   r6   s     r   r7   ÚPrivateKey.__eq__–   s)   € Ü˜%§¡×0Ñ0ØØ�‰ %×"2Ñ"2Ñ2Ð2r"   c                 ó   • X:X  + $ r%   r:   r6   s     r   r;   ÚPrivateKey.__ne__›   r=   r"   c                 óZ   • U " [        [        R                  5      [        R                  S9$ )zf
Generates a random :class:`~nacl.public.PrivateKey` object

:rtype: :class:`~nacl.public.PrivateKey`
©r   )r   rK   r   r   rF   )rW   s    r   ÚgenerateÚPrivateKey.generatež   s    € ñ ”6œ*Ÿ/™/Ó*´H×4GÑ4GÑHÐHr"   )rQ   r   N)r#   rK   )r>   r?   r@   rA   rB   r3   r4   Úcrypto_box_SECRETKEYBYTESr   r   rD   rE   Úcrypto_box_SEEDBYTESrM   r   rF   r   r
   r    ÚclassmethodrZ   r(   r-   rG   rH   r7   r;   rg   rI   r:   r"   r   rK   rK   C   s÷   ‡ ñð  Ÿ-™-×AÑA€Dˆ(�3‰-ÓAØ#Ÿ}™}×AÑA€Iˆx˜‰}ÓAð
 %-×$7Ñ$7ñ4àð4ð ×!Ñ!õ4ð, ð %-×$7Ñ$7ñ àð ð ×!Ñ!ð ð 
ô	 ó ð ðD!˜5ô !ð:˜#ô :ð3˜Fð 3 tô 3ð
#˜Fð # tô #ð óIó óIr"   rK   Ú_BoxÚBox)Úboundc            
       ór  • \ rS rSr% Sr\R                  R                  r\	\
   \S'   \\S'   S\S\4S jrS\4S	 jr\\R&                  4S
\\   S\S\S\4S jj5       rS\R&                  4S\S\\   S\R,                  S\4S jjrS\R&                  4S\S\\   S\R,                  S\4S jjrS\4S jrSrg)rm   é«   a÷  
The Box class boxes and unboxes messages between a pair of keys

The ciphertexts generated by :class:`~nacl.public.Box` include a 16
byte authenticator which is checked as part of the decryption. An invalid
authenticator will cause the decrypt function to raise an exception. The
authenticator is not a signature. Once you've decrypted the message you've
demonstrated the ability to create arbitrary valid message, so messages you
send are repudiable. For non-repudiable messages, sign them after
encryption.

:param private_key: :class:`~nacl.public.PrivateKey` used to encrypt and
    decrypt messages
:param public_key: :class:`~nacl.public.PublicKey` used to encrypt and
    decrypt messages

:cvar NONCE_SIZE: The size that the nonce is required to be.
Ú
NONCE_SIZEÚ_shared_keyrN   r   c                 ó:  • [        U[        5      (       a  [        U[        5      (       d  [        R                  " S5      e[
        R                  R                  UR                  [        R                  S9UR                  [        R                  S95      U l        g )Nz5Box must be created from a PrivateKey and a PublicKeyrf   )r   rK   r   r   r   r3   r4   Úcrypto_box_beforenmÚencoder   rF   rr   )r   rN   r   s      r   r    ÚBox.__init__Â   s}   € Ü˜+¤z×2Ñ2¼*Øœ	÷;
ñ ;
ô —-’-ØGóð ô  Ÿ=™=×<Ñ<Ø×Ñ¤h×&9Ñ&9ÐÐ:Ø×Ñ¤x×':Ñ':ÐÐ;ó
ˆÕr"   r#   c                 ó   • U R                   $ r%   ©rr   r'   s    r   r(   ÚBox.__bytes__Î   r*   r"   rW   Úencodedr   c                 óT   • U R                  U 5      nUR                  U5      Ul        U$ )zK
Alternative constructor. Creates a Box from an existing Box's shared key.
)Ú__new__r   rr   )rW   rz   r   Úboxs       r   r   Ú
Box.decodeÑ   s)   € ð —K‘K Ó$ˆð "Ÿ.™.¨Ó1ˆŒàˆ
r"   NÚ	plaintextÚnoncec                 ó–  • Uc  [        U R                  5      n[        U5      U R                  :w  a#  [        R                  " SU R                  -  5      e[
        R                  R                  UUU R                  5      nUR                  U5      nUR                  U5      n[        R                  " UUUR                  X$-   5      5      $ )aW  
Encrypts the plaintext message using the given `nonce` (or generates
one randomly if omitted) and returns the ciphertext encoded with the
encoder.

.. warning:: It is **VITALLY** important that the nonce is a nonce,
    i.e. it is a number used only once for any given key. If you fail
    to do this, you compromise the privacy of the messages encrypted.

:param plaintext: [:class:`bytes`] The plaintext message to encrypt
:param nonce: [:class:`bytes`] The nonce to use in the encryption
:param encoder: The encoder to use to encode the ciphertext
:rtype: [:class:`nacl.utils.EncryptedMessage`]
ú'The nonce must be exactly %s bytes long)r   rq   r   r   r   r3   r4   Úcrypto_box_easy_afternmrr   ru   r   Ú_from_parts)r   r   r€   r   Ú
ciphertextÚencoded_nonceÚencoded_ciphertexts          r   ÚencryptÚBox.encryptà   s°   € ð( ‰=Ü˜4Ÿ?™?Ó+ˆEäˆu‹:˜Ÿ™Ó(Ü—.’.Ø9¸D¿O¹OÑKóð ô —]‘]×:Ñ:ØØØ×Ñó
ˆ
ð  Ÿ™ uÓ-ˆØ$Ÿ^™^¨JÓ7Ðä×+Ò+ØØØ�N‰N˜5Ñ-Ó.ó
ð 	
r"   r…   c                 ó6  • UR                  U5      nUc  USU R                   nXR                  S n[        U5      U R                  :w  a#  [        R                  " SU R                  -  5      e[
        R                  R                  UUU R                  5      nU$ )a™  
Decrypts the ciphertext using the `nonce` (explicitly, when passed as a
parameter or implicitly, when omitted, as part of the ciphertext) and
returns the plaintext message.

:param ciphertext: [:class:`bytes`] The encrypted message to decrypt
:param nonce: [:class:`bytes`] The nonce used when encrypting the
    ciphertext
:param encoder: The encoder used to decode the ciphertext.
:rtype: [:class:`bytes`]
Nr‚   )	r   rq   r   r   r   r3   r4   Úcrypto_box_open_easy_afternmrr   )r   r…   r€   r   r   s        r   ÚdecryptÚBox.decrypt  s‘   € ð$ —^‘^ JÓ/ˆ
à‰=àÐ0 §¡Ð1ˆEØ#§O¡OÐ$5Ð6ˆJäˆu‹:˜Ÿ™Ó(Ü—.’.Ø9¸D¿O¹OÑKóð ô —M‘M×>Ñ>ØØØ×Ñó
ˆ	ð Ðr"   c                 ó   • U R                   $ )ag  
Returns the Curve25519 shared secret, that can then be used as a key in
other symmetric ciphers.

.. warning:: It is **VITALLY** important that you use a nonce with your
    symmetric cipher. If you fail to do this, you compromise the
    privacy of the messages encrypted. Ensure that the key length of
    your cipher is 32 bytes.
:rtype: [:class:`bytes`]
rx   r'   s    r   Ú
shared_keyÚBox.shared_key1  s   € ð ×ÑÐr"   rx   )r>   r?   r@   rA   rB   r3   r4   Úcrypto_box_NONCEBYTESrq   r   rD   rE   r   rK   r   r    r(   rk   r   rF   r   rl   r
   r   r   r   rˆ   rŒ   r�   rI   r:   r"   r   rm   rm   «   s  ‡ ñð& !%§¡× CÑ C€J�˜‘ÓCØÓð

 Jð 

¸Iô 

ð ˜5ô  ð à<D×<OÑ<OñØ�$‰ZðØ"'ðØ29ðà	ôó ðð" "&Ø$,×$7Ñ$7ñ	)
àð)
ð ˜‰ð)
ð ×!Ñ!ð	)
ð
 
õ)
ð\ "&Ø$,×$7Ñ$7ñ	$àð$ð ˜‰ð$ð ×!Ñ!ð	$ð
 
õ$ðL ˜E÷  r"   Ú_Keyc            	       óÜ   • \ rS rSr% Sr\\S'   \\   \S'   S\4S jr	S\4S jr
\R                  4S	\S
\R                  S\4S jjr\R                  4SSS\S
\R                  S\4S jjrSrg)Ú	SealedBoxiC  a0  
The SealedBox class boxes and unboxes messages addressed to
a specified key-pair by using ephemeral sender's key pairs,
whose private part will be discarded just after encrypting
a single plaintext message.

The ciphertexts generated by :class:`~nacl.public.SecretBox` include
the public part of the ephemeral key before the :class:`~nacl.public.Box`
ciphertext.

:param recipient_key: a :class:`~nacl.public.PublicKey` used to encrypt
    messages and derive nonces, or a :class:`~nacl.public.PrivateKey` used
    to decrypt messages.

.. versionadded:: 1.2
r   rQ   Úrecipient_keyc                 ót  • [        U[        5      (       a*  UR                  [        R                  S9U l        S U l        g [        U[        5      (       aO  UR                  [        R                  S9U l        UR                  R                  [        R                  S9U l        g [        R                  " S5      e)Nrf   z:SealedBox must be created from a PublicKey or a PrivateKey)r   r   ru   r   rF   r   rQ   rK   r   r   r   )r   r•   s     r   r    ÚSealedBox.__init__X  s§   € Ü�m¤Y×/Ñ/Ø,×3Ñ3Ü ×+Ñ+ð  4ð  ˆDÔð !%ˆDÕÜ˜¤z×2Ñ2Ø -× 4Ñ 4Ü ×+Ñ+ð !5ð !ˆDÔð  -×7Ñ7×>Ñ>Ü ×+Ñ+ð  ?ð  ˆDÕô —-’-ØLóð r"   r#   c                 ó   • U R                   $ r%   r&   r'   s    r   r(   ÚSealedBox.__bytes__j  r*   r"   r   r   c                 óz   • [         R                  R                  XR                  5      nUR	                  U5      nU$ )a#  
Encrypts the plaintext message using a random-generated ephemeral
key pair and returns a "composed ciphertext", containing both
the public part of the key pair and the ciphertext proper,
encoded with the encoder.

The private part of the ephemeral key-pair will be scrubbed before
returning the ciphertext, therefore, the sender will not be able to
decrypt the generated ciphertext.

:param plaintext: [:class:`bytes`] The plaintext message to encrypt
:param encoder: The encoder to use to encode the ciphertext
:return bytes: encoded ciphertext
)r3   r4   Úcrypto_box_sealr   ru   )r   r   r   r…   r‡   s        r   rˆ   ÚSealedBox.encryptm  s3   € ô( —]‘]×2Ñ2°9×>NÑ>NÓOˆ
à$Ÿ^™^¨JÓ7Ðà!Ð!r"   r   zSealedBox[PrivateKey]r…   c                 óÂ   • UR                  U5      nU R                  c  [        S5      e[        R                  R                  UU R                  U R                  5      nU$ )aÊ  
Decrypts the ciphertext using the ephemeral public key enclosed
in the ciphertext and the SealedBox private key, returning
the plaintext message.

:param ciphertext: [:class:`bytes`] The encrypted message to decrypt
:param encoder: The encoder used to decode the ciphertext.
:return bytes: The original plaintext
:raises TypeError: if this SealedBox was created with a
    :class:`~nacl.public.PublicKey` rather than a
    :class:`~nacl.public.PrivateKey`.
z4SealedBoxes created with a public key cannot decrypt)r   rQ   r   r3   r4   Úcrypto_box_seal_openr   )r   r…   r   r   s       r   rŒ   ÚSealedBox.decrypt‡  sa   € ð$ —^‘^ JÓ/ˆ
à×ÑÑ$ÜØFóð ô —M‘M×6Ñ6ØØ×ÑØ×Ñó
ˆ	ð Ðr"   )rQ   r   N)r>   r?   r@   rA   rB   r   rE   r   r’   r    r(   r   rF   r
   rˆ   rŒ   rI   r:   r"   r   r”   r”   C  s¢   ‡ ñð" ÓØ˜5‘/Ó!ð dô ð$ ˜5ô  ð %-×$7Ñ$7ñ"àð"ð ×!Ñ!ð"ð 
õ	"ð: %-×$7Ñ$7ñØ%ðàðð ×!Ñ!ðð 
÷	ð r"   r”   )Útypingr   r   r   r   r   Únacl.bindingsr3   r   r	   r   Únacl.encodingr
   Ú
nacl.utilsr   r   r   Ú	Encodabler   rK   rl   rm   r’   r”   r:   r"   r   Ú<module>r¥      sž   ð÷ >Õ =ã Ý Ý "Ý !ß <Ñ <ô)#�×"Ñ" Kô )#ôXbI�×#Ñ# [ô bIñJ ˆv˜UÑ#€ôR ˆ(×
Ñ
˜kô R ñj ˆv�y *Ó-€ôb�˜‘˜x×1Ñ1°;õ br"   