+
    BÆÚjJ  ã                   ó´   € R 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HtHt ^RIHt R tR t ! R R	]4      t ! R
 R]4      t ! R R]4      tR# )a  libolm Group session module.

This module contains the group session part of the Olm library. It contains two
classes for creating inbound and outbound group sessions.

Examples:
    >>> outbound = OutboundGroupSession()
    >>> InboundGroupSession(outbound.session_key)
)ÚbytesÚsuper)ÚAnyStrÚOptionalÚTupleÚType)ÚffiÚlib)ÚURANDOMÚto_bytearrayÚto_bytesÚto_unicode_str)Útrack_for_finalizationc                 ó2   € \         P                  ! V 4       R # ©N)r	   Úolm_clear_inbound_group_session©Úsessions   &Úˆ/opt/data/installs/351f81cc06284494/environments/aa258815729c481f8402f54f4c368f83/venv/lib/python3.14/site-packages/olm/group_session.pyÚ_clear_inbound_group_sessionr   &   s   € ä×'Ò'¨Ö0ó    c                 ó2   € \         P                  ! V 4       R # r   )r	   Ú olm_clear_outbound_group_sessionr   s   &r   Ú_clear_outbound_group_sessionr   +   s   € ä×(Ò(¨Ö1r   c                   ó   € ] tR t^0tRtRtR# )ÚOlmGroupSessionErrorz%libolm Group session error exception.© N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   r   r   r   r   0   s   † Ý/r   r   c                   ó¤   a a€ ] tR t^4t oRtRV 3R lltR tRR lt]RR l4       t	R t
RR lt]R 4       t]R	 4       tR
 t]R 4       tRtVtV ;t# )ÚInboundGroupSessionz<Inbound group session for encrypted multiuser communication.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_inbound_group_session_sizeÚ_bufÚolm_inbound_group_sessionÚ_sessionr   r   )ÚclsÚsession_keyÚobjÚ	__class__s   && €r   r(   ÚInboundGroupSession.__new__7   sZ   ø€ ô
 ‹g�o‰o˜cÓ"ˆÜ—7’7˜8¤S×%GÒ%GÓ%IÓJˆŒÜ×4Ò4°S·X±XÓ>ˆŒÜ˜s§L¡LÔ2NÔOØˆ
r   c                ó`  €  \        T4      p \        P                  ! T P                   \        P
                  ! T4      \        T4      4      pY!Jd!   \        ^ \        T4      4       F  p^ Y$&   K	  	  T P                  T4       R#   Y!Jd"   \        ^ \        T4      4       F  p^ Y$&   K	  	  i i ; i)aD  Create a new inbound group session.
Start a new inbound group session, from a key exported from
an outbound group session.

Raises OlmGroupSessionError on failure. The error message of the
exception will be "OLM_INVALID_BASE64" if the session key is not valid
base64 and "OLM_BAD_SESSION_KEY" if the session key is invalid.
N)	r-   r   r	   Úolm_init_inbound_group_sessionr   Úfrom_bufferÚlenÚrangeÚ_check_error)Úselfr/   Úbyte_session_keyÚretÚis   &&   r   Ú__init__ÚInboundGroupSession.__init__B   sª   € ð ô (¨Ó4Ðð	,Ü×4Ò4Ø—‘Ü—’Ð 0Ó1´3Ð7GÓ3HóˆCð
  Ó2Ü˜q¤#Ð&6Ó"7Ö8�AØ*+Ð$Ó'ñ 9à×Ñ˜#Öøð  Ó2Ü˜q¤#Ð&6Ó"7Ö8�AØ*+Ð$Ó'ò 9ð 3ús   Ž?B Â(B-c                óö  € V'       d   \        VR4      MRp\        P                  ! V P                  4      p\        P
                  ! RV4      p \        P                  ! V P                  \        P                  ! V4      \        V4      WC4      pV P                  V4       \        ^ \        V4      4       F  p^ W&&   K	  	  \        P                  ! WC4      #   \        ^ \        T4      4       F  p^ Y&&   K	  	  i ; i)a3  Store an inbound group session.

Stores a group session as a base64 string. Encrypts the session using
the supplied passphrase. Returns a byte object containing the base64
encoded string of the pickled session.

Args:
    passphrase(str, optional): The passphrase to be used to encrypt
        the session.
úutf-8r   r'   )Ú	bytearrayr	   Ú'olm_pickle_inbound_group_session_lengthr-   r   r)   Ú olm_pickle_inbound_group_sessionr5   r6   r8   r7   Úunpack©r9   Ú
passphraseÚbyte_passphraseÚpickle_lengthÚpickle_bufferr;   r<   s   &&     r   ÚpickleÚInboundGroupSession.pickle\   sÑ   € ÷ =Gœ) J°Ô8ÈCˆä×CÒCØ�M‰MóˆäŸš ¨-Ó8ˆð
	+Ü×6Ò6Ø—‘Ü—’ Ó0´#°oÓ2FØóˆCð
 ×Ñ˜cÔ"ô ˜1œc /Ó2Ö3�Ø)*�OÓ&ñ 4ô �zŠz˜-Ó7Ð7øô ˜1œc /Ó2Ö3�Ø)*�OÓ&ò 4úó   ÁAC Ã"C8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)ax  Load a previously stored inbound group session.

Loads an inbound group session from a pickled base64 string and returns
an InboundGroupSession object. Decrypts the session using the supplied
passphrase. Raises OlmSessionError on failure. If the passphrase
doesn't match the one used to encrypt the session 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
        session
    passphrase(str, optional): The passphrase used to encrypt the
        session
úPickle can't be emptyr@   r   r'   )Ú
ValueErrorrA   r   r)   r(   r	   Ú"olm_unpickle_inbound_group_sessionr-   r5   r6   r8   r7   ©r.   rJ   rF   rG   rI   r0   r;   r<   s   &&&     r   Úfrom_pickleÚInboundGroupSession.from_pickle|   sÔ   € ÷$ ÜÐ4Ó5Ð5ç<Fœ) J°Ô8ÈCˆäŸš ¨&Ó1ˆà�k‰k˜#Óˆð	+Ü×8Ò8Ø—‘Ü—’ Ó0Ü�OÓ$ØÜ�F“óˆCð ×Ñ˜SÔ!ô ˜1œc /Ó2Ö3�Ø)*�OÓ&ñ 4ð ˆ
øô ˜1œc /Ó2Ö3�Ø)*�OÓ&ò 4úó   ÁAC Ã"C2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_inbound_group_session_last_errorr-   Údecoder   ©r9   r;   Ú
last_errors   && r   r8   Ú InboundGroupSession._check_error§   sJ   € à”#—-’-“/Ô!Ùä—Z’ZÜ×4Ò4°T·]±]ÓCó
ç
‰&‹(ð 	ô # :Ó.Ð.r   c                ón  € V'       g   \        R4      h\        V4      p\        P                  ! RV4      p\        P
                  ! V P                  V\        V4      4      pV P                  V4       \        P                  ! RV4      p\        P                  ! RV4      p\        P                  ! R4      p\        P                  ! V P                  V\        V4      WeV4      pV P                  V4       \        \        P                  ! Wh4      VR7      p	\        P                  ! V^ V4       W—^ ,          3# )aÝ  Decrypt a message

Returns a tuple of the decrypted plain-text and the message index of
the decrypted message or raises OlmGroupSessionError on failure.
On failure the error message of the exception  will be:

* OLM_INVALID_BASE64         if the message is not valid base64
* OLM_BAD_MESSAGE_VERSION    if the message was encrypted with an
    unsupported version of the protocol
* OLM_BAD_MESSAGE_FORMAT     if the message headers could not be
    decoded
* OLM_BAD_MESSAGE_MAC        if the message could not be verified
* OLM_UNKNOWN_MESSAGE_INDEX  if we do not have a session key
    corresponding to the message's index (i.e., it was sent before
    the session key was shared with us)

Args:
    ciphertext(str): Base64 encoded ciphertext containing the encrypted
        message
    unicode_errors(str, optional): The error handling scheme to use for
        unicode decoding errors. The default is "replace" meaning that
        the character that was unable to decode will be replaced with
        the unicode replacement character (U+FFFD). Other possible
        values are "strict", "ignore" and "xmlcharrefreplace" as well
        as any other name registered with codecs.register_error that
        can handle UnicodeEncodeErrors.
zCiphertext can't be empty.r'   z	uint32_t*)Úerrors)rO   r   r   r)   r	   Ú&olm_group_decrypt_max_plaintext_lengthr-   r6   r8   Úolm_group_decryptr   rD   Úmemset)
r9   Ú
ciphertextÚunicode_errorsÚbyte_ciphertextÚciphertext_bufferÚmax_plaintext_lengthÚplaintext_bufferÚmessage_indexÚplaintext_lengthÚ	plaintexts
   &&&       r   ÚdecryptÚInboundGroupSession.decrypt²   s	  € ÷: ÜÐ9Ó:Ð:ä" :Ó.ˆô  ŸGšG H¨oÓ>Ðä"×IÒIØ�M‰MÐ,¬c°/Ó.Bó 
Ðð 	×ÑÐ.Ô/ÜŸ7š7 8Ð-AÓBÐäŸGšG H¨oÓ>ÐäŸš Ó,ˆÜ×0Ò0Ø�M‰MÐ,¬c°/Ó.BØØó
Ðð 	×ÑÐ*Ô+ä"Ü�JŠJÐ'Ó:Ø!ô
ˆ	ô 	�
Š
Ð# QÐ(<Ô=à¨Õ*Ð*Ð*r   c                ó  € \         P                  ! V P                  4      p\        P                  ! RV4      p\         P
                  ! V P                  VV4      pV P                  V4       \        P                  ! W!4      P                  4       # ©z2str: A base64 encoded identifier for this session.r'   )	r	   Ú#olm_inbound_group_session_id_lengthr-   r   r)   Úolm_inbound_group_session_idr8   rD   rY   ©r9   Ú	id_lengthÚ	id_bufferr;   s   &   r   ÚidÚInboundGroupSession.idò   sm   € ô ×;Ò;¸D¿M¹MÓJˆ	Ü—G’G˜H iÓ0ˆ	Ü×.Ò.Ø�M‰MØØó
ˆð
 	×Ñ˜#ÔÜ�zŠz˜)Ó/×6Ñ6Ó8Ð8r   c                óB   € \         P                  ! V P                  4      # )z4int: The first message index we know how to decrypt.)r	   Ú+olm_inbound_group_session_first_known_indexr-   ©r9   s   &r   Úfirst_known_indexÚ%InboundGroupSession.first_known_index   s   € ô ×>Ò>¸t¿}¹}ÓMÐMr   c                óT  € \         P                  ! V P                  4      p\        P                  ! RV4      p\         P
                  ! V P                  VVV4      pV P                  V4       \        P                  ! W24      P                  4       p\         P                  ! V^ V4       V# )aú  Export an inbound group session

Export the base64-encoded ratchet key for this session, at the given
index, in a format which can be used by import_session().

Raises OlmGroupSessionError on failure. The error message for the
exception will be:

* OLM_UNKNOWN_MESSAGE_INDEX if we do not have a session key
    corresponding to the given index (ie, it was sent before the
    session key was shared with us)

Args:
    message_index(int): The message index at which the session should
        be exported.
r'   )
r	   Ú'olm_export_inbound_group_session_lengthr-   r   r)   Ú olm_export_inbound_group_sessionr8   rD   rY   ra   )r9   rh   Úexport_lengthÚexport_bufferr;   Ú
export_strs   &&    r   Úexport_sessionÚ"InboundGroupSession.export_session  sŒ   € ô& ×CÒCØ�M‰Móˆô Ÿš ¨-Ó8ˆÜ×2Ò2Ø�M‰MØØØó	
ˆð 	×Ñ˜#ÔÜ—Z’Z Ó=×DÑDÓFˆ
ô 	�
Š
�= ! ]Ô3àÐr   c                ó€  € V P                  V 4      p\        V4      p \        P                  ! VP                  \
        P                  ! V4      \        V4      4      pVP                  V4       W1Jd!   \        ^ \        V4      4       F  p^ W5&   K	  	  V#   Y1Jd"   \        ^ \        T4      4       F  p^ Y5&   K	  	  i i ; i)a¿  Create an InboundGroupSession from an exported session key.

Creates an InboundGroupSession with an previously exported session key,
raises OlmGroupSessionError on failure. The error message for the
exception will be:

* OLM_INVALID_BASE64  if the session_key is not valid base64
* OLM_BAD_SESSION_KEY if the session_key is invalid

Args:
    session_key(str): The exported session key with which the inbound
        group session will be created
)
r(   r   r	   Ú olm_import_inbound_group_sessionr-   r   r5   r6   r8   r7   )r.   r/   r0   r:   r;   r<   s   &&    r   Úimport_sessionÚ"InboundGroupSession.import_session+  s½   € ð  �k‰k˜#Óˆä'¨Ó4Ðð	,Ü×6Ò6Ø—‘Ü—’Ð 0Ó1ÜÐ$Ó%óˆCð
 ×Ñ˜SÔ!ð  Ó2Ü˜q¤#Ð&6Ó"7Ö8�AØ*+Ð$Ó'ñ 9ð ˆ
øð	  Ó2Ü˜q¤#Ð&6Ó"7Ö8�AØ*+Ð$Ó'ò 9ð 3ús   žAB Â(B=©r-   r   ©Ú )Úreplace)r   r   r   r    r!   r(   r=   rJ   ÚclassmethodrR   r8   rk   Úpropertyrt   ry   r�   r…   r"   Ú__classdictcell__Ú__classcell__©r1   Ú__classdict__s   @@r   r$   r$   4   s�   ù‡ € ÙF÷	òô48ð@ ó(ó ð(òT	/ô>+ð@ ñ9ó ð9ð ñNó ðNò
#ðJ ñ ó ÷ ð  r   r$   c                   ó–   a a€ ] tR tRt oRtV 3R ltR tR tRR lt]	RR l4       t
R t]R	 4       t]R
 4       t]R 4       tRtVtV ;t# )ÚOutboundGroupSessioniO  z=Outbound group session for encrypted multiuser communication.c                ó  <€ \        4       P                  V 4      p\        P                  ! R \        P
                  ! 4       4      Vn        \        P                  ! VP                  4      Vn        \        VVP                  \        4       V# r&   )r   r(   r   r)   r	   Úolm_outbound_group_session_sizer+   Úolm_outbound_group_sessionr-   r   r   )r.   r0   r1   s   & €r   r(   ÚOutboundGroupSession.__new__R  s`   ø€ ä‹g�o‰o˜cÓ"ˆÜ—7’7˜8¤S×%HÒ%HÓ%JÓKˆŒÜ×5Ò5°c·h±hÓ?ˆŒÜØØ�L‰LÜ)ô	
ð
 ˆ
r   c                óì   €  \        P                  ! T P                   4      p\        T4      p\        P                  ! T P                   \
        P                  ! T4      T4      pT P                  T4       R# )zrCreate a new outbound group session.

Start a new outbound group session. Raises OlmGroupSessionError on
failure.
N)r-   r	   Ú-olm_init_outbound_group_session_random_lengthr
   Úolm_init_outbound_group_sessionr   r5   r8   )r9   Úrandom_lengthÚrandomr;   s   &   r   r=   ÚOutboundGroupSession.__init__^  s`   € ð ô ×IÒIØ�M‰Mó
ˆô ˜Ó'ˆä×1Ò1Ø�M‰Mœ3Ÿ?š?¨6Ó2°Mó
ˆð 	×Ñ˜#Ör   c                óÔ   € V\         P                  ! 4       8w  d   R # \        P                  ! \         P                  ! V P
                  4      4      P                  4       p\        V4      hr   )r	   rV   r   rW   Ú%olm_outbound_group_session_last_errorr-   rY   r   rZ   s   && r   r8   Ú!OutboundGroupSession._check_errorr  sJ   € à”#—-’-“/Ô!Ùä—Z’ZÜ×5Ò5°d·m±mÓDó
ç
‰&‹(ð 	ô # :Ó.Ð.r   c                óö  € V'       d   \        VR4      MRp\        P                  ! V P                  4      p\        P
                  ! RV4      p \        P                  ! V P                  \        P                  ! V4      \        V4      WC4      pV P                  V4       \        ^ \        V4      4       F  p^ W&&   K	  	  \        P                  ! WC4      #   \        ^ \        T4      4       F  p^ Y&&   K	  	  i ; i)a4  Store an outbound group session.

Stores a group session as a base64 string. Encrypts the session using
the supplied passphrase. Returns a byte object containing the base64
encoded string of the pickled session.

Args:
    passphrase(str, optional): The passphrase to be used to encrypt
        the session.
r@   r   r'   )rA   r	   Ú(olm_pickle_outbound_group_session_lengthr-   r   r)   Ú!olm_pickle_outbound_group_sessionr5   r6   r8   r7   rD   rE   s   &&     r   rJ   ÚOutboundGroupSession.pickle}  sÑ   € ÷ =Gœ) J°Ô8ÈCˆÜ×DÒDØ�M‰MóˆäŸš ¨-Ó8ˆð
	+Ü×7Ò7Ø—‘Ü—’ Ó0´#°oÓ2FØóˆCð
 ×Ñ˜cÔ"ô ˜1œc /Ó2Ö3�Ø)*�OÓ&ñ 4ô �zŠz˜-Ó7Ð7øô ˜1œc /Ó2Ö3�Ø)*�OÓ&ò 4úrL   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)ak  Load a previously stored outbound group session.

Loads an outbound group session from a pickled base64 string and
returns an OutboundGroupSession object. Decrypts the session using the
supplied passphrase. Raises OlmSessionError on failure. If the
passphrase doesn't match the one used to encrypt the session 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
        session
    passphrase(str, optional): The passphrase used to encrypt the
rN   r@   r   r'   )rO   rA   r   r)   r(   r	   Ú#olm_unpickle_outbound_group_sessionr-   r5   r6   r8   r7   rQ   s   &&&     r   rR   Ú OutboundGroupSession.from_pickleœ  sÔ   € ÷$ ÜÐ4Ó5Ð5ç<Fœ) J°Ô8ÈCˆäŸš ¨&Ó1ˆà�k‰k˜#Óˆð	+Ü×9Ò9Ø—‘Ü—’ Ó0Ü�OÓ$ØÜ�F“óˆCð ×Ñ˜SÔ!ô ˜1œc /Ó2Ö3�Ø)*�OÓ&ñ 4ð ˆ
øô ˜1œc /Ó2Ö3�Ø)*�OÓ&ò 4úrT   c                ó&  € \        V4      p\        P                  ! V P                  \	        V4      4      p\
        P                  ! RV4      p \        P                  ! V P                  \
        P                  ! V4      \	        V4      WC4      pV P                  V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’Encrypt a message.

Returns the encrypted ciphertext.

Args:
    plaintext(str): A string that will be encrypted using the group
        session.
r'   )r   r	   Ú olm_group_encrypt_message_lengthr-   r6   r   r)   Úolm_group_encryptr5   r8   r7   rD   rY   )r9   rj   Úbyte_plaintextÚmessage_lengthÚmessage_bufferr;   r<   s   &&     r   ÚencryptÚOutboundGroupSession.encryptÇ  sí   € ô & iÓ0ˆÜ×=Ò=Ø�M‰Mœ3˜~Ó.ó
ˆô Ÿš ¨>Ó:ˆð	*Ü×'Ò'Ø—‘Ü—’ Ó/´°^Ó1DØóˆCð
 ×Ñ˜cÔ"ð Ó.Ü˜q¤# nÓ"5Ö6�AØ()�NÓ%ñ 7ô �zŠz˜.Ó9×@Ñ@ÓBÐBøð	 Ó.Ü˜q¤# nÓ"5Ö6�AØ()�NÓ%ò 7ð /ús   ÁAC( Ã((Dc                ó  € \         P                  ! V P                  4      p\        P                  ! RV4      p\         P
                  ! V P                  VV4      pV P                  V4       \        P                  ! W!4      P                  4       # rn   )	r	   Ú$olm_outbound_group_session_id_lengthr-   r   r)   Úolm_outbound_group_session_idr8   rD   rY   rq   s   &   r   rt   ÚOutboundGroupSession.idç  sm   € ô ×<Ò<¸T¿]¹]ÓKˆ	Ü—G’G˜H iÓ0ˆ	ä×/Ò/Ø�M‰MØØó
ˆð
 	×Ñ˜#Ôä�zŠz˜)Ó/×6Ñ6Ó8Ð8r   c                óB   € \         P                  ! V P                  4      # )zŒint: The current message index of the session.

Each message is encrypted with an increasing index. This is the index
for the next message.
)r	   Ú(olm_outbound_group_session_message_indexr-   rx   s   &r   rh   Ú"OutboundGroupSession.message_index÷  s   € ô ×;Ò;¸D¿M¹MÓJÐJr   c                ó  € \         P                  ! V P                  4      p\        P                  ! RV4      p\         P
                  ! V P                  VV4      pV P                  V4       \        P                  ! W!4      P                  4       # )zÀThe base64-encoded current ratchet key for this session.

Each message is encrypted with a different ratchet key. This function
returns the ratchet key that will be used for the next message.
r'   )	r	   Ú%olm_outbound_group_session_key_lengthr-   r   r)   Úolm_outbound_group_session_keyr8   rD   rY   )r9   Ú
key_lengthÚ
key_bufferr;   s   &   r   r/   Ú OutboundGroupSession.session_key  sm   € ô ×>Ò>¸t¿}¹}ÓMˆ
Ü—W’W˜X zÓ2ˆ
ä×0Ò0Ø�M‰MØØó
ˆð
 	×Ñ˜#Ôä�zŠz˜*Ó1×8Ñ8Ó:Ð:r   r‡   rˆ   )r   r   r   r    r!   r(   r=   r8   rJ   r‹   rR   r­   rŒ   rt   rh   r/   r"   r�   rŽ   r�   s   @@r   r’   r’   O  s{   ù‡ € ÙGõ
òò(	/ô8ð> ó(ó ð(òTCð@ ñ9ó ð9ð ñKó ðKð ñ;ó ÷;ð ;r   r’   N)r!   Úbuiltinsr   r   Útypingr   r   r   r   Ú_libolmr   r	   Ú_compatr
   r   r   r   Ú	_finalizer   r   r   Ú	Exceptionr   Úobjectr$   r’   r   r   r   Ú<module>rÃ      sV   ðñ"÷ "ß 0Ó 0÷ ç DÓ DÝ -ò1ò
2ô
0˜9ô 0ôX˜&ô XôvD;˜6ö D;r   