+
    BÆÚja.  ã                   óš   € R t ^ RIt^ RIHtHt ^ RIHtHtHtH	t	 ^ RI
HtHt ^RIHtHt ^RIHt  R t ! R R	]4      t ! R
 R]4      tR# )a<  libolm Account module.

This module contains the account part of the Olm library. It contains a single
Account class which handles the creation of new accounts as well as the storing
and restoring of them.

Examples:
    >>> acc = Account()
    >>> account.identity_keys()
    >>> account.generate_one_time_keys(1)

N)ÚbytesÚsuper)ÚAnyStrÚDictÚOptionalÚType)ÚffiÚlib)ÚURANDOMÚto_bytearray)Útrack_for_finalizationc                 ó2   € \         P                  ! V 4       R # ©N)r	   Úolm_clear_account)Úaccounts   &Ú‚/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/olm/account.pyÚ_clear_accountr   .   s   € ä×Ò˜'Ö"ó    c                   ó   € ] tR t^3tRtRtR# )ÚOlmAccountErrorzlibolm Account error exception.© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r   r   3   s   † Ý)r   r   c                   óÄ   a a€ ] tR t^7t oRtV 3R ltR tR tRR lt]	RR l4       t
]R 4       tR t]R	 4       tR
 tR t]R 4       tR tR tR t]R 4       tRtVtV ;t# )ÚAccountzlibolm Account class.c                ó  <€ \        4       P                  V 4      p\        P                  ! R \        P
                  ! 4       4      Vn        \        P                  ! VP                  4      Vn        \        WP                  \        4       V# )úchar[])r   Ú__new__r   Únewr	   Úolm_account_sizeÚ_bufÚolm_accountÚ_accountr   r   )ÚclsÚobjÚ	__class__s   & €r   r!   ÚAccount.__new__:   sU   ø€ ä‹g�o‰o˜cÓ"ˆÜ—7’7˜8¤S×%9Ò%9Ó%;Ó<ˆŒÜ—’ s§x¡xÓ0ˆŒÜ˜s§L¡L´.ÔAØˆ
r   c                óè   €  \        P                  ! T P                   4      p\        T4      pT P	                  \        P
                  ! T P                   \        P                  ! T4      T4      4       R# )zöCreate a new Olm account.

Creates a new account and its matching identity key pair.

Raises OlmAccountError on failure. If there weren't enough random bytes
for the account creation the error message for the exception will be
NOT_ENOUGH_RANDOM.
N)r&   r	   Ú olm_create_account_random_lengthr
   Ú_check_errorÚolm_create_accountr   Úfrom_buffer©ÚselfÚrandom_lengthÚrandoms   &  r   Ú__init__ÚAccount.__init__B   sW   € ð ô ×<Ò<¸T¿]¹]ÓKˆÜ˜Ó'ˆà×ÑÜ×"Ò" 4§=¡=´#·/²/À&Ó2IØ#0ó2ö	3r   c                óÔ   € V\         P                  ! 4       8w  d   R # \        P                  ! \         P                  ! V P
                  4      4      P                  4       p\        V4      hr   )r	   Ú	olm_errorr   ÚstringÚolm_account_last_errorr&   Údecoder   )r1   ÚretÚ
last_errors   && r   r-   ÚAccount._check_errorY   sD   € à”#—-’-“/Ô!Ùä—Z’Z¤×!;Ò!;¸D¿M¹MÓ!JÓL×SÑSÓUˆ
ä˜jÓ)Ð)r   c           	     óô  € V'       d   \        VR4      MRp\        P                  ! V P                  4      p\        P
                  ! RV4      p V P                  \        P                  ! V P                  \        P                  ! V4      \        V4      VV4      4       \        ^ \        V4      4       F  p^ W%&   K	  	  \        P                  ! WC4      #   \        ^ \        T4      4       F  p^ Y%&   K	  	  i ; i)aG  Store an Olm account.

Stores an account as a base64 string. Encrypts the account using the
supplied passphrase. Returns a byte object containing the base64
encoded string of the pickled account. Raises OlmAccountError on
failure.

Args:
    passphrase(str, optional): The passphrase to be used to encrypt
        the account.
úutf-8r   r    )Ú	bytearrayr	   Úolm_pickle_account_lengthr&   r   r"   r-   Úolm_pickle_accountr/   ÚlenÚrangeÚunpack)r1   Ú
passphraseÚbyte_keyÚpickle_lengthÚpickle_bufferÚis   &&    r   ÚpickleÚAccount.pickleb   sÈ   € ÷ 6@”9˜Z¨Ô1ÀSˆä×5Ò5°d·m±mÓDˆÜŸš ¨-Ó8ˆð
	 Ø×ÑÜ×&Ò& t§}¡}Ü'*§¢°xÓ'@Ü'*¨8£}Ø'4Ø'4ó	6ô7ô ˜1œc (›mÖ,�Ø�“ñ -ô �zŠz˜-Ó7Ð7øô ˜1œc (›mÖ,�Ø�“ò -ús   ÁAC Ã"C7c           	     óê  € V'       g   \        R4      hV'       d   \        VR4      MRp\        P                  ! RV4      pV P	                  V 4      p \
        P                  ! VP                  \        P                  ! V4      \        V4      V\        V4      4      pVP                  V4       \        ^ \        V4      4       F  p^ W7&   K	  	  V#   \        ^ \        T4      4       F  p^ Y7&   K	  	  i ; i)a]  Load a previously stored olm account.

Loads an account from a pickled base64-encoded string and returns an
Account object. Decrypts the account using the supplied passphrase.
Raises OlmAccountError on failure. If the passphrase doesn't match the
one used to encrypt the account then the error message for the
exception will be "BAD_ACCOUNT_KEY". If the base64 couldn't be decoded
then the error message will be "INVALID_BASE64".

Args:
    pickle(bytes): Base64 encoded byte string containing the pickled
        account
    passphrase(str, optional): The passphrase used to encrypt the
        account.
zPickle can't be emptyr?   r   r    )Ú
ValueErrorr@   r   r"   r!   r	   Úolm_unpickle_accountr&   r/   rC   r-   rD   )r'   rK   rF   rG   rI   r(   r;   rJ   s   &&&     r   Úfrom_pickleÚAccount.from_pickle‚   sÌ   € ÷$ ÜÐ4Ó5Ð5ç5?”9˜Z¨Ô1ÀSˆäŸš ¨&Ó1ˆà�k‰k˜#Óˆð		 Ü×*Ò*¨3¯<©<Ü+.¯?ª?¸8Ó+DÜ+.¨x«=Ø+8Ü+.¨v«;ó	8ˆCð
 ×Ñ˜SÔ!ä˜1œc (›mÖ,�Ø�“ñ -ð ˆ
øô ˜1œc (›mÖ,�Ø�“ò -ús   ÁAC Ã"C2c                óD  € \         P                  ! V P                  4      p\        P                  ! RV4      pV P                  \         P                  ! V P                  VV4      4       \        P                  ! \        P                  ! W!4      P                  R4      4      # )z6dict: Public part of the identity keys of the account.r    r?   )r	   Ú olm_account_identity_keys_lengthr&   r   r"   r-   Úolm_account_identity_keysÚjsonÚloadsrE   r:   ©r1   Ú
out_lengthÚ
out_buffers   &  r   Úidentity_keysÚAccount.identity_keysª   st   € ô ×9Ò9¸$¿-¹-ÓHˆ
Ü—W’W˜X zÓ2ˆ
à×ÑÜ×)Ò)¨$¯-©-¸Ø*4ó6ô	7ô �zŠzœ#Ÿ*š* ZÓ<×CÑCÀGÓLÓMÐMr   c           	     ó  € \        V4      p\        P                  ! V P                  4      p\        P
                  ! RV4      p V P                  \        P                  ! V P                  \        P                  ! V4      \        V4      VV4      4       W!Jd!   \        ^ \        V4      4       F  p^ W%&   K	  	  \        P                  ! YC4      P                  4       #   Y!Jd"   \        ^ \        T4      4       F  p^ Y%&   K	  	  i i ; i)zÓSigns a message with this account.

Signs a message with the private ed25519 identity key of this account.
Returns the signature.
Raises OlmAccountError on failure.

Args:
    message(str): The message to sign.
r    )r   r	   Úolm_account_signature_lengthr&   r   r"   r-   Úolm_account_signr/   rC   rD   rE   r:   )r1   ÚmessageÚbytes_messagerX   rY   rJ   s   &&    r   ÚsignÚAccount.sign¶   sß   € ô % WÓ-ˆÜ×5Ò5°d·m±mÓDˆ
Ü—W’W˜X zÓ2ˆ
ð
	)Ø×ÑÜ×$Ò$ T§]¡]Ü%(§_¢_°]Ó%CÜ%(¨Ó%7¸Ø%/ó1ô2ð Ó+Ü˜q¤# mÓ"4Ö5�AØ'(�MÓ$ñ 6ô �zŠz˜*Ó1×8Ñ8Ó:Ð:øð	 Ó+Ü˜q¤# mÓ"4Ö5�AØ'(�MÓ$ò 6ð ,ús   ÁAC Ã(Dc                óB   € \         P                  ! V P                  4      # )z?int: The maximum number of one-time keys the account can store.)r	   Ú'olm_account_max_number_of_one_time_keysr&   ©r1   s   &r   Úmax_one_time_keysÚAccount.max_one_time_keysÓ   s   € ô ×:Ò:¸4¿=¹=ÓIÐIr   c                óF   € \         P                  ! V P                  4       R# )z9Mark the current set of one-time keys as being published.N)r	   Ú"olm_account_mark_keys_as_publishedr&   re   s   &r   Úmark_keys_as_publishedÚAccount.mark_keys_as_publishedÙ   s   € ô 	×.Ò.¨t¯}©}Ö=r   c           	     óê   € \         P                  ! V P                  V4      p\        V4      pV P	                  \         P
                  ! V P                  V\        P                  ! V4      V4      4       R# )zñGenerate a number of new one-time keys.

If the total number of keys stored by this account exceeds
max_one_time_keys() then the old keys are discarded.
Raises OlmAccountError on error.

Args:
    count(int): The number of keys to generate.
N)r	   Ú0olm_account_generate_one_time_keys_random_lengthr&   r
   r-   Ú"olm_account_generate_one_time_keysr   r/   )r1   Úcountr2   r3   s   &&  r   Úgenerate_one_time_keysÚAccount.generate_one_time_keysÞ   s[   € ô ×LÒLØ�M‰M˜5ó"ˆä˜Ó'ˆà×ÑÜ×2Ò2Ø—‘˜u¤c§o¢o°fÓ&=¸}óNö	Or   c                óD  € \         P                  ! V P                  4      p\        P                  ! RV4      pV P                  \         P                  ! V P                  VV4      4       \        P                  ! \        P                  ! W!4      P                  R4      4      # )z<dict: The public part of the one-time keys for this account.r    r?   )r	   Ú olm_account_one_time_keys_lengthr&   r   r"   r-   Úolm_account_one_time_keysrU   rV   rE   r:   rW   s   &  r   Úone_time_keysÚAccount.one_time_keysñ   st   € ô ×9Ò9¸$¿-¹-ÓHˆ
Ü—W’W˜X zÓ2ˆ
à×ÑÜ×)Ò)¨$¯-©-¸Ø*4ó6ô	7ô �zŠzœ#Ÿ*š* ZÓ<×CÑCÀGÓLÓMÐMr   c                óz   € V P                  \        P                  ! V P                  VP                  4      4       R# )aY  Remove used one-time keys.

Removes the one-time keys that the session used from the account.
Raises OlmAccountError on failure. If the account doesn't have any
matching one-time keys then the error message of the exception will be
"BAD_MESSAGE_KEY_ID".

Args:
    session(Session): An Olm Session object that was created with this
    account.
N)r-   r	   Úolm_remove_one_time_keysr&   Ú_session)r1   Úsessions   &&r   Úremove_one_time_keysÚAccount.remove_one_time_keysþ   s0   € ð 	×Ñœ#×6Ò6°t·}±}Ø7>×7GÑ7GóIö 	Jr   c                óæ   € \         P                  ! V P                  4      p\        V4      pV P	                  \         P
                  ! V P                  \        P                  ! V4      V4      4       R# )aÚ  Generate a new fallback key

This will overwrite the existing fallback key, make sure that you upload
the fallback key before rotating again. Internally there are two slots
for the private part of the fallback key. Rotating without uploading
means that we'll remove a fallback key that may be still used on the
server side but has been removed on our side.

When we receive pre-key messages that use such a removed fallback key we
won't be able to create a new Olm session.
N)r	   Ú/olm_account_generate_fallback_key_random_lengthr&   r
   r-   Ú!olm_account_generate_fallback_keyr   r/   r0   s   &  r   Úgenerate_fallback_keyÚAccount.generate_fallback_key  sW   € ô ×KÒKØ�M‰Mó
ˆô ˜Ó'ˆà×ÑÜ×1Ò1Ø—‘œsŸš¨vÓ6¸óö	
r   c                óF   € \         P                  ! V P                  4       R# )zäForget about the old fallback key.

This should be called once you are reasonably certain that you will not
receive any more messages that use the old fallback key (e.g. 5 minutes
after the new fallback key has been published).
N)r	   Ú#olm_account_forget_old_fallback_keyr&   re   s   &r   Úforget_old_fallback_keyÚAccount.forget_old_fallback_key&  s   € ô 	×/Ò/°·±Ö>r   c                ó,  € \         P                  ! V P                  4      p\        P                  ! RV4      p\         P
                  ! V P                  W!4      pV P                  V4       \        P                  ! W!4      p\        P                  ! V4      # )a]  The public part of the current fallback for this account.

The fallback key can be uploaded alongside of the one-time keys. It can
be used instead of a one-time key to establish a new Olm Session. The
fallback key comes into play if all one-time keys have been used up due
to the client being offline and not replenishing the pool of one-time
keys.
r    )
r	   Ú+olm_account_unpublished_fallback_key_lengthr&   r   r"   Ú$olm_account_unpublished_fallback_keyr-   rE   rU   rV   )r1   rX   rY   r;   Úfallback_keys   &    r   r‰   ÚAccount.fallback_key/  si   € ô ×DÒDÀTÇ]Á]ÓSˆ
Ü—W’W˜X zÓ2ˆ
ä×6Ò6°t·}±}ÀjÓ]ˆØ×Ñ˜#Ôä—z’z *Ó9ˆä�zŠz˜,Ó'Ð'r   )r&   )Ú )r   r   r   r   r   r!   r4   r-   rK   ÚclassmethodrP   ÚpropertyrZ   ra   rf   rj   rp   ru   r{   r€   r„   r‰   r   Ú__classdictcell__Ú__classcell__)r)   Ú__classdict__s   @@r   r   r   7   s­   ù‡ € Ùõò3ò.*ô8ð@ ó%ó ð%ðN ñ	Nó ð	Nò;ð: ñJó ðJò
>ò
Oð& ñ
Nó ð
NòJò 
ò0?ð ñ(ó ÷(ð (r   r   )r   rU   Úbuiltinsr   r   Útypingr   r   r   r   Ú_libolmr   r	   Ú_compatr
   r   Ú	_finalizer   rz   ÚSessionr   Ú	Exceptionr   Úobjectr   r   r   r   Ú<module>r™      sG   ðñ"ó ç !ß /Ó /÷ ç *Ý -ð 	ò#ô
*�iô *ôJ(ˆfö J(r   