ó
    ð›‘h´S  ã                   ó\  • S SK r S SKrS SKrS SKJr  S SKJrJrJrJ	r	J
r
Jr  S SKJr  S SK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Jr  S S	KJrJr  S S
KJrJ r   S SK!J"r"  S SK#J$r$  S SK%J&r&  Sr' " S S\(5      r)\ RT                  " \)5         " S S\5      r+\RT                  " \+5        g)é    N)ÚMutableMapping)ÚOptionalÚUnionÚDictÚAnyÚListÚIterator)ÚLock)ÚAccount)ÚLocalAccount)Úencode_typed_data)ÚecsignÚecrecover_to_pubÚchecksum_encodeÚsha3)Úv_r_s_to_signatureÚsignature_to_v_r_s)ÚISecurityModuleÚIEthereumKey)Úmnemonic_to_private_key)Úparse_keyfile)ÚCryptosignKey)ÚEthereumKeyÚSecurityModuleMemoryc                   óì  • \ rS rSrSr  S"S\\\\4   S\	S\
\   S\
\   SS4
S	 jjr\S\
S
   4S j5       r\S\
\   4S j5       r\S\4S j5       rS#S\	S\\\4   4S jjr\S\	4S j5       rS#S\	S\\\4   4S jjrS\S\4S jrS\S\S\4S jrS$S\\\4   S\4S jjrS\\\4   S\S\	4S jr\S\\\4   SS 4S j5       r\S\SS 4S j5       r\S%S\S\SS 4S jj5       r\S\SS 4S  j5       rS!r g)&r   é3   zI
Base class to implement :class:`autobahn.wamp.interfaces.IEthereumKey`.
NÚkey_or_addressÚcan_signÚsecurity_moduleÚkey_noÚreturnc                 óà   • U(       a-  [        U5      [        :X  d   eXl        UR                  U l        O([        U5      [
        [        4;   d   eS U l        Xl        X l        X0l        X@l	        g ©N)
Útyper   Ú_keyÚaddressÚ_addressÚstrÚbytesÚ	_can_signÚ_security_moduleÚ_key_no)Úselfr   r   r   r    s        ÚXC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\autobahn/xbr/_secmod.pyÚ__init__ÚEthereumKey.__init__8   s_   € ö ä˜Ó'¬<Ó7Ð7Ð7Ø&ŒIØ*×2Ñ2ˆD�Mä˜Ó'¬C´¨<Ó7Ð7Ð7ØˆDŒIØ*ŒMØ!ŒØ /ÔØ�ó    r   c                 ó   • U R                   $ )zC
Implements :meth:`autobahn.wamp.interfaces.IKey.security_module`.
)r+   ©r-   s    r.   r   ÚEthereumKey.security_moduleH   s   € ð
 ×$Ñ$Ð$r1   c                 ó   • U R                   $ )z:
Implements :meth:`autobahn.wamp.interfaces.IKey.key_no`.
)r,   r3   s    r.   r    ÚEthereumKey.key_noO   s   € ð
 �|‰|Ðr1   c                 ó   • g)z<
Implements :meth:`autobahn.wamp.interfaces.IKey.key_type`.
Úethereum© r3   s    r.   Úkey_typeÚEthereumKey.key_typeV   s   € ð
 r1   Úbinaryc                 ó   • [        5       e)z>
Implements :meth:`autobahn.wamp.interfaces.IKey.public_key`.
©ÚNotImplementedError©r-   r<   s     r.   Ú
public_keyÚEthereumKey.public_key]   s   € ô "Ó#Ð#r1   c                 ó   • U R                   $ )z<
Implements :meth:`autobahn.wamp.interfaces.IKey.can_sign`.
)r*   r3   s    r.   r   ÚEthereumKey.can_signc   s   € ð
 �~‰~Ðr1   c                 ón   • U(       a#  [         R                  " U R                  SS 5      $ U R                  $ )zC
Implements :meth:`autobahn.wamp.interfaces.IEthereumKey.address`.
é   N)ÚbinasciiÚa2b_hexr'   r@   s     r.   r&   ÚEthereumKey.addressj   s-   € ö Ü×#Ò# D§M¡M°!°"Ð$5Ó6Ð6à—=‘=Ð r1   Údatac                 ó   • [        5       e)z8
Implements :meth:`autobahn.wamp.interfaces.IKey.sign`.
r>   )r-   rJ   s     r.   ÚsignÚEthereumKey.signs   ó   € ô
 "Ó#Ð#r1   Ú	signaturec                 ó   • [        5       e)z;
Implements :meth:`autobahn.wamp.interfaces.IKey.recover`.
r>   )r-   rJ   rO   s      r.   ÚrecoverÚEthereumKey.recoverz   rN   r1   c                 ó  • U R                   (       a=  U R                   R                  (       a  U R                   R                  (       a   S5       e [        U5      n[	        X0R
                  R                  5      n[        U6 nU(       a  [        R                  " U5      $ [        R                  " [        R                  " U5      R                  5       5      $ ! [         a   n[        R                  " U5      s SnA$ SnAff = f)zK
Implements :meth:`autobahn.wamp.interfaces.IEthereumKey.sign_typed_data`.
ú)security module must be open and unlockedN)r+   Úis_openÚ	is_lockedr   r   r%   Úkeyr   ÚtxaioÚcreate_future_successrG   Úb2a_hexÚdecodeÚ	ExceptionÚcreate_future_error)r-   rJ   r<   Úmsg_hashÚsignature_vrsrO   Úes          r.   Úsign_typed_dataÚEthereumKey.sign_typed_data�   sÎ   € ð × × Ø×(Ñ(×0×0¸×9NÑ9N×9X×9Xð  Fð  [Fó  FÐXð	Yä(¨Ó.ˆHô # 8¯Y©Y¯]©]Ó;ˆMô +¨MÐ:ˆIö Ü×2Ò2°9Ó=Ð=ä×2Ò2´8×3CÒ3CÀIÓ3N×3UÑ3UÓ3WÓXÐXøô ó 	0Ü×,Ò,¨QÓ/Õ/ûð	0ús   Á2C Ã
DÃ!C<Ã6DÃ<Dc                 ó´  • U R                   (       a=  U R                   R                  (       a  U R                   R                  (       a   S5       e [        U5      n[	        U5      n[        U/UQ76 n[        U5      SS n[        U5      n[        R                  " XpR                  :H  5      $ ! [         a   n[        R                  " U5      s SnA$ SnAff = f)zM
Implements :meth:`autobahn.wamp.interfaces.IEthereumKey.verify_typed_data`.
rT   iìÿÿÿN)r+   rU   rV   r   r   r   r   r   rX   rY   r'   r\   r]   )	r-   rJ   rO   r^   r_   rA   Úaddress_bytesr&   r`   s	            r.   Úverify_typed_dataÚEthereumKey.verify_typed_dataœ   sÁ   € ð × × Ø×(Ñ(×0×0¸×9NÑ9N×9X×9Xð  Fð  [Fó  FÐXð		IÜ(¨Ó.ˆHÜ.¨yÓ9ˆMÜ)¨(ÐC°]ÒCˆJÜ  Ó,¨S¨TÐ2ˆMÜ% mÓ4ˆGô ×.Ò.¨w¿-¹-Ñ/GÓHÐHøô ó 	0Ü×,Ò,¨QÓ/Õ/ûð	0ús   Á;B- Â-
CÂ7CÃCÃCr&   c                 ó   • [        USS9$ )z¯
Create a public key from an address, which can be used to verify signatures.

:param address: The Ethereum address (20 octets).
:return: New instance of :class:`EthereumKey`
F©r   r   )r   )Úclsr&   s     r.   Úfrom_addressÚEthereumKey.from_address­   s   € ô ¨'¸EÑBÐBr1   rW   c                 ó  • [        U5      [        :w  a#  [        SR                  [        U5      5      5      e[	        U5      S:w  a#  [        SR                  [	        U5      5      5      e[
        R                  " U5      n[        USS9$ )z¾
Create a private key from seed bytes, which can be used to sign and create signatures.

:param key: The Ethereum private key seed (32 octets).
:return: New instance of :class:`EthereumKey`
z&invalid seed type {} (expected binary)é    z$invalid seed length {} (expected 32)Trh   )r$   r)   Ú
ValueErrorÚformatÚlenr   Úfrom_keyr   )ri   rW   Úaccounts      r.   Ú
from_bytesÚEthereumKey.from_bytes·   so   € ô �‹9œÓÜÐE×LÑLÌTÐRUËYÓWÓXÐXäˆs‹8�r‹>ÜÐC×JÑJÌ3ÈsË8ÓTÓUÐUä '× 0Ò 0°Ó 5ˆÜ¨'¸DÑAÐAr1   Ú
seedphraseÚindexc                 óÂ   • SR                  U5      n[        XS9n[        U5      [        :X  d   e[	        U5      S:X  d   e[
        R                  " U5      n[        USS9$ )aT  
Create a private key from the given BIP-39 mnemonic seed phrase and index,
which can be used to sign and create signatures.

:param seedphrase: The BIP-39 seedphrase ("Mnemonic") from which to derive the account.
:param index: The account index in account hierarchy defined by the seedphrase.
:return: New instance of :class:`EthereumKey`
zm/44'/60'/0'/0/{})Ústr_derivation_pathrm   Trh   )ro   r   r$   r)   rp   r   rq   r   )ri   ru   rv   Úderivation_pathrW   rr   s         r.   Úfrom_seedphraseÚEthereumKey.from_seedphraseÈ   s]   € ð .×4Ñ4°UÓ;ˆä% jÑVˆÜ�C‹yœEÓ!Ð!Ð!Ü�3‹x˜2‹~Ðˆ~ä '× 0Ò 0°Ó 5ˆÜ¨'¸DÑAÐAr1   Úkeyfilec                 óà  • [         R                  R                  U5      (       a$  [         R                  R                  U5      (       d  [	        SR                  U5      5      e[        U5      nUR                  SS5      nUcD  UR                  SS5      nUc  [	        SR                  U5      5      e[        R                  U5      $ [        R                  [        R                  " U5      5      $ )aš  
Create a public or private key from reading the given public or private key file.

Here is an example key file that includes an Ethereum private key ``private-key-eth``, which
is loaded in this function, and other fields, which are ignored by this function:

.. code-block::

    This is a comment (all lines until the first empty line are comments indeed).

    creator: oberstet@intel-nuci7
    created-at: 2022-07-05T12:29:48.832Z
    user-id: oberstet@intel-nuci7
    public-key-ed25519: 7326d9dc0307681cc6940fde0e60eb31a6e4d642a81e55c434462ce31f95deed
    public-adr-eth: 0x10848feBdf7f200Ba989CDf7E3eEB3EC03ae7768
    private-key-ed25519: f750f42b0430e28a2e272c3cedcae4dcc4a1cf33bc345c35099d3322626ab666
    private-key-eth: 4d787714dcb0ae52e1c5d2144648c255d660b9a55eac9deeb80d9f506f501025

:param keyfile: Path (relative or absolute) to a public or private keys file.
:return: New instance of :class:`EthereumKey`
úkeyfile "{}" is not a fileúprivate-key-ethNzpublic-adr-ethzBneither "private-key-eth" nor "public-adr-eth" found in keyfile {})ÚosÚpathÚexistsÚisfileÚRuntimeErrorro   r   Úgetr   rj   rs   rG   rH   )ri   r|   rJ   Úprivkey_eth_hexÚpub_adr_eths        r.   Úfrom_keyfileÚEthereumKey.from_keyfileÜ   s¿   € ô. �w‰w�~‰~˜g×&Ñ&¬b¯g©g¯n©n¸W×.EÑ.EÜÐ;×BÑBÀ7ÓKÓLÐLô ˜WÓ%ˆàŸ(™(Ð#4°dÓ;ˆØÑ"ØŸ(™(Ð#3°TÓ:ˆKØÑ"Ü"Ð#g×#nÑ#nÐovÓ#wÓxÐxä"×/Ñ/°Ó<Ð<ä×)Ñ)¬(×*:Ò*:¸?Ó*KÓLÐLr1   )r'   r*   r%   r,   r+   )NN)F)T)r   )!Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r   r(   r)   Úboolr   r   Úintr/   Úpropertyr   r    r:   rA   r   r&   rL   rQ   r   r   ra   re   Úclassmethodrj   rs   rz   rˆ   Ú__static_attributes__r9   r1   r.   r   r   3   s  † ñð
 ?CØ)-ñ u¨\¸3ÀÐ-EÑ'Fð ÐRVð Ø"*¨?Ñ";ðà! #™ðà26õð  ð% Ð*;Ñ!<ó %ó ð%ð ð˜ ™ó ó ðð ð˜#ó ó ðñ$ ð $°%¸¸U¸
Ñ2Cõ $ð ð˜$ó ó ðñ!˜dð !¨u°S¸%°ZÑ/@õ !ð$˜ð $ 5ô $ð$˜Eð $¨eð $¸ô $ñY D¨¨c¨¡Nð YÀEõ Yð6I d¨3°¨8¡nð IÀð IÈ4ô Ið" ðC 5¨¨e¨Ñ#4ð C¸ó Có ðCð ðB˜Uð B }ó Bó ðBð  ñB¨ð B°Sð BÀô Bó ðBð& ð,M 3ð ,M¨=ó ,Mó ó,Mr1   r   c            
       óä  • \ rS rSrSrS(S\\\\\	4         4S jjr
S\4S jrS\S\4S	 jrS\\   4S
 jrS\S\\\	4   4S jrS\S\\\	4   SS4S jrS\SS4S jrS rS r\S\4S j5       r\S\4S j5       r\S\4S j5       rS rS rS\S\4S jrS\4S jrS\S\4S jr S\S\4S jr!S\S\4S jr"\#  S)S\S\S \SS 4S! jj5       r$\#S*S"\S#\SS 4S$ jj5       r%\#S%\SS 4S& j5       r&S'r'g)+r   i  zG
A transient, memory-based implementation of :class:`ISecurityModule`.
NÚkeysc                 ó®   • [        5       U l        SU l        SU l        0 U l        0 U l        U(       a#  [        U5       H  u  p#X0R                  U'   M     g g )NFT)r
   Ú_mutexÚ_is_openÚ
_is_lockedÚ_keysÚ	_countersÚ	enumerate)r-   r•   ÚirW   s       r.   r/   ÚSecurityModuleMemory.__init__  sJ   € Ü“fˆŒØˆŒØˆŒØCEˆŒ
Ø)+ˆŒÞÜ# Dž/‘�Ø #—
‘
˜1“ò *ð r1   r!   c                 ó\   • U R                   (       d   S5       e[        U R                  5      $ )z,
Implements :meth:`ISecurityModule.__len__`
úsecurity module not open)r˜   rp   rš   r3   s    r.   Ú__len__ÚSecurityModuleMemory.__len__  s$   € ð �}�}Ð8Ð8Ó8ˆ}ä�4—:‘:‹Ðr1   r    c                 óN   • U R                   (       d   S5       eXR                  ;   $ ©Nr    ©r˜   rš   ©r-   r    s     r.   Ú__contains__Ú!SecurityModuleMemory.__contains__&  s!   € Ø�}�}Ð8Ð8Ó8ˆ}àŸ™Ñ#Ð#r1   c              #   óh   #   • U R                   (       d   S5       eU R                   Sh  v•N   g N7f)z-
Implements :meth:`ISecurityModule.__iter__`
r    Nr¥   r3   s    r.   Ú__iter__ÚSecurityModuleMemory.__iter__+  s&   é € ð �}�}Ð8Ð8Ó8ˆ}à—:‘:×Óùs   ‚(2ª0«2c                 ó¢   • U R                   (       d   S5       eXR                  ;   a  U R                  U   $ [        SR                  U5      5      e)z0
Implements :meth:`ISecurityModule.__getitem__`
r    zkey_no {} not found)r˜   rš   Ú
IndexErrorro   r¦   s     r.   Ú__getitem__Ú SecurityModuleMemory.__getitem__3  sF   € ð �}�}Ð8Ð8Ó8ˆ}à—Z‘ZÓØ—:‘:˜fÑ%Ð%äÐ2×9Ñ9¸&ÓAÓBÐBr1   rW   c                 ó€   • U R                   (       d   S5       eUS:¼  d   eXR                  ;   a   X R                  U'   g )Nr    r   r¥   )r-   r    rW   s      r.   Ú__setitem__Ú SecurityModuleMemory.__setitem__>  s9   € Ø�}�}Ð8Ð8Ó8ˆ}à˜‹{Ðˆ{Ø—Z‘ZÓàØ �
‰
�6Òr1   c                 ó€   • U R                   (       d   S5       eXR                  ;   a  U R                  U	 g [        5       er¤   )r˜   rš   r­   r¦   s     r.   Ú__delitem__Ú SecurityModuleMemory.__delitem__G  s2   € Ø�}�}Ð8Ð8Ó8ˆ}à—Z‘ZÓØ—
‘
˜6Ñ"ä“,Ðr1   c                 ól   • U R                   (       a   S5       eSU l         [        R                  " S5      $ )z)
Implements :meth:`ISecurityModule.open`
zsecurity module already openTN)r˜   rX   rY   r3   s    r.   ÚopenÚSecurityModuleMemory.openO  s/   € ð —=—=Ð@Ð"@Ó@Ð àˆŒÜ×*Ò*¨4Ó0Ð0r1   c                 óz   • U R                   (       d   S5       eSU l         SU l        [        R                  " S5      $ )z*
Implements :meth:`ISecurityModule.close`
r    FTN©r˜   r™   rX   rY   r3   s    r.   ÚcloseÚSecurityModuleMemory.closeX  s5   € ð �}�}Ð8Ð8Ó8ˆ}àˆŒØˆŒÜ×*Ò*¨4Ó0Ð0r1   c                 ó   • U R                   $ )z,
Implements :meth:`ISecurityModule.is_open`
)r˜   r3   s    r.   rU   ÚSecurityModuleMemory.is_openb  s   € ð
 �}‰}Ðr1   c                 ó   • g)z-
Implements :meth:`ISecurityModule.can_lock`
Tr9   r3   s    r.   Úcan_lockÚSecurityModuleMemory.can_locki  s   € ð
 r1   c                 ó   • U R                   $ )z.
Implements :meth:`ISecurityModule.is_locked`
)r™   r3   s    r.   rV   ÚSecurityModuleMemory.is_lockedp  s   € ð
 �‰Ðr1   c                 ó’   • U R                   (       d   S5       eU R                  (       a   eSU l        [        R                  " S5      $ )z)
Implements :meth:`ISecurityModule.lock`
r    TNrº   r3   s    r.   ÚlockÚSecurityModuleMemory.lockw  s;   € ð �}�}Ð8Ð8Ó8ˆ}Ø—?—?Ð"Ð"àˆŒÜ×*Ò*¨4Ó0Ð0r1   c                 ó’   • U R                   (       d   S5       eU R                  (       d   eSU l        [        R                  " S5      $ )z+
Implements :meth:`ISecurityModule.unlock`
r    FNrº   r3   s    r.   ÚunlockÚSecurityModuleMemory.unlock�  s:   € ð �}�}Ð8Ð8Ó8ˆ}Ø��ÐˆàˆŒÜ×*Ò*¨4Ó0Ð0r1   r:   c                 óÖ  • U R                   (       d   S5       e[        U R                  5      nUS:X  a>  [        [        R
                  R                  [        R                  " S5      5      SU US9nOUUS:X  a5  [        [        R                  " [        R                  " S5      5      SU US9nO[        SR                  U5      5      eX0R                  U'   [        R                  " U5      $ )	Nr    Ú
cryptosignrm   T)rW   r   r   r    r8   )r   r   r   r    zinvalid key_type "{}")r˜   rp   rš   r   ÚnaclÚsigningÚ
SigningKeyr€   Úurandomr   r   rq   rn   ro   rX   rY   )r-   r:   r    rW   s       r.   Ú
create_keyÚSecurityModuleMemory.create_key‹  s½   € Ø�}�}Ð8Ð8Ó8ˆ}ä�T—Z‘Z“ˆØ�|Ó#Ü¤D§L¡L×$;Ñ$;¼B¿JºJÀr»NÓ$KØ)-Ø04Ø'-ñ/‰Cð ˜Ó#Ü¬W×-=Ò-=¼b¿jºjÈ»nÓ-MØ'+Ø.2Ø%+ñ-‰Cô
 Ð4×;Ñ;¸HÓEÓFÐFØ �
‰
�6ÑÜ×*Ò*¨6Ó2Ð2r1   c                 óÂ   • U R                   (       d   S5       eXR                  ;   a#  U R                  U	 [        R                  " U5      $ [        R                  " S 5      $ r¤   )r˜   rš   rX   rY   r¦   s     r.   Ú
delete_keyÚSecurityModuleMemory.delete_keyž  sL   € Ø�}�}Ð8Ð8Ó8ˆ}à—Z‘ZÓØ—
‘
˜6Ð"Ü×.Ò.¨vÓ6Ð6ä×.Ò.¨tÓ4Ð4r1   Úoctetsc                 óŠ   • U R                   (       d   S5       e[        R                  " U5      n[        R                  " U5      $ )z/
Implements :meth:`ISecurityModule.get_random`
r    )r˜   r€   rÏ   rX   rY   )r-   rÕ   rJ   s      r.   Ú
get_randomÚSecurityModuleMemory.get_random§  s5   € ð �}�}Ð8Ð8Ó8ˆ}ä�zŠz˜&Ó!ˆÜ×*Ò*¨4Ó0Ð0r1   Ú
counter_noc                 óþ   • U R                   (       d   S5       eU R                  R                  5         U R                  R	                  US5      nU R                  R                  5         [        R                  " U5      $ )z0
Implements :meth:`ISecurityModule.get_counter`
r    r   )r˜   r—   Úacquirer›   r…   ÚreleaserX   rY   ©r-   rÙ   Úress      r.   Úget_counterÚ SecurityModuleMemory.get_counter°  s]   € ð �}�}Ð8Ð8Ó8ˆ}à�‰×ÑÔØ�n‰n× Ñ  ¨QÓ/ˆØ�‰×ÑÔÜ×*Ò*¨3Ó/Ð/r1   c                 óN  • U R                   (       d   S5       eU R                  R                  5         XR                  ;  a  SU R                  U'   U R                  U==   S-  ss'   U R                  U   nU R                  R	                  5         [
        R                  " U5      $ )z6
Implements :meth:`ISecurityModule.increment_counter`
r    r   é   )r˜   r—   rÛ   r›   rÜ   rX   rY   rÝ   s      r.   Úincrement_counterÚ&SecurityModuleMemory.increment_counter»  s�   € ð �}�}Ð8Ð8Ó8ˆ}à�‰×ÑÔØŸ^™^Ó+Ø)*ˆD�N‰N˜:Ñ&Ø�‰�zÓ" aÑ'Ó"Ø�n‰n˜ZÑ(ˆØ�‰×ÑÔÜ×*Ò*¨3Ó/Ð/r1   ru   Únum_eth_keysÚnum_cs_keysc                 ó  • / n[        U5       H)  n[        R                  X5      nUR                  U5        M+     [        U5       H-  n[        R                  " XU-   5      nUR                  U5        M/     [        US9nU$ )a«  
Create a new memory-backed security module with

1. ``num_eth_keys`` keys of type :class:`EthereumKey`, followed by
2. ``num_cs_keys`` keys of type :class:`CryptosignKey`

computed from a (common) BIP44 seedphrase.

:param seedphrase: BIP44 seedphrase to use.
:param num_eth_keys: Number of Ethereum keys to derive.
:param num_cs_keys: Number of Cryptosign keys to derive.
:return: New memory-backed security module instance.
©r•   )Úranger   rz   Úappendr   r   )ri   ru   rå   ræ   r•   r�   rW   Úsms           r.   rz   Ú$SecurityModuleMemory.from_seedphraseÉ  sy   € ð  9;ˆô �|Ö$ˆAÜ×-Ñ-¨jÓ<ˆCØ�K‰K˜Öñ %ô
 �{Ö#ˆAÜ×/Ò/°
ÀÑ<LÓMˆCØ�K‰K˜Öñ $ô
 " tÑ,ˆØˆ	r1   ÚconfigÚprofilec                 óÊ  • / n[         R                  " 5       nUR                  U5        UR                  U5      (       d  [	        SR                  X!5      5      eUR                  US5      (       d  [	        SR                  X!5      5      e[        R                  R                  [        R                  R                  U5      UR                  US5      5      n[        R                  R                  U5      (       a$  [        R                  R                  U5      (       d  [	        SR                  XRU5      5      e[        U5      nUR                  SS5      nUR                  [         R#                  [$        R&                  " U5      5      5        UR                  SS5      nUR                  [(        R"                  " [$        R&                  " U5      5      5        [+        US9n	U	$ )	a;  
Create a new memory-backed security module with keys referred from a profile in
the given configuration file.

:param config: Path (relative or absolute) to an INI configuration file.
:param profile: Name of the profile within the given INI configuration file.
:return: New memory-backed security module instance.
z1profile "{}" not found in configuration file "{}"ÚprivkeyzCmissing option "privkey" in profile "{}" of configuration file "{}"zEprivkey "{}" is not a file in profile "{}" of configuration file "{}"r   Núprivate-key-ed25519rè   )ÚconfigparserÚConfigParserÚreadÚhas_sectionr„   ro   Ú
has_optionr€   r�   ÚjoinÚdirnamer…   r‚   rƒ   r   rê   r   rs   rG   rH   r   r   )
ri   rí   rî   r•   Úcfgrð   rJ   r†   Úprivkey_ed25519_hexrë   s
             r.   Úfrom_configÚ SecurityModuleMemory.from_configé  su  € ð 9;ˆä×'Ò'Ó)ˆØ�‰�Ôà�‰˜w×'Ñ'ÜÐR×YÑYÐZaÓjÓkÐkà�~‰~˜g y×1Ñ1ÜÐd×kÑkÐlsÓ|Ó}Ð}ä—'‘'—,‘,œrŸw™wŸ™¨vÓ6¸¿¹ÀÈÓ8SÓTˆÜ�w‰w�~‰~˜g×&Ñ&¬b¯g©g¯n©n¸W×.EÑ.EÜÐf×mÑmÐnuð  AGó   Hó  Ið  Iô
 ˜WÓ%ˆð Ÿ(™(Ð#4°dÓ;ˆØ�‰”K×*Ñ*¬8×+;Ò+;¸OÓ+LÓMÔNð #Ÿh™hÐ'<¸dÓCÐØ�‰”M×,Ò,¬X×-=Ò-=Ð>QÓ-RÓSÔTô " tÑ,ˆØˆ	r1   r|   c                 ó”  • / n[         R                  R                  U5      (       a$  [         R                  R                  U5      (       d  [	        SR                  U5      5      e[        U5      nUR                  SS5      nUc  [	        SR                  U5      5      eUR                  [        R                  [        R                  " U5      5      5        UR                  SS5      nUc  [	        SR                  U5      5      eUR                  [        R                  " [        R                  " U5      5      5        [        US9nU$ )zé
Create a new memory-backed security module with keys referred from a profile in
the given configuration file.

:param keyfile: Path (relative or absolute) to a private keys file.
:return: New memory-backed security module instance.
r~   r   Nz)"private-key-eth" not found in keyfile {}rñ   z-"private-key-ed25519" not found in keyfile {}rè   )r€   r�   r‚   rƒ   r„   ro   r   r…   rê   r   rs   rG   rH   r   r   )ri   r|   r•   rJ   r†   rú   rë   s          r.   rˆ   Ú!SecurityModuleMemory.from_keyfile  s
  € ð 9;ˆä�w‰w�~‰~˜g×&Ñ&¬b¯g©g¯n©n¸W×.EÑ.EÜÐ;×BÑBÀ7ÓKÓLÐLô
 ˜WÓ%ˆð Ÿ(™(Ð#4°dÓ;ˆØÑ"ÜÐJ×QÑQÐRYÓZÓ[Ð[Ø�‰”K×*Ñ*¬8×+;Ò+;¸OÓ+LÓMÔNð #Ÿh™hÐ'<¸dÓCÐØÑ&ÜÐN×UÑUÐV]Ó^Ó_Ð_Ø�‰”M×,Ò,¬X×-=Ò-=Ð>QÓ-RÓSÔTô " tÑ,ˆØˆ	r1   )r›   r™   r˜   rš   r—   r#   )râ   râ   )Údefault)(rŠ   r‹   rŒ   r�   rŽ   r   r   r   r   r   r/   r�   r¡   r�   r§   r	   rª   r®   r±   r´   r·   r»   r‘   rU   rÀ   rV   rÅ   rÈ   r(   rÐ   rÓ   r)   r×   rß   rã   r’   rz   rû   rˆ   r“   r9   r1   r.   r   r     sñ  † ññ$˜X d¨5°ÀÐ1KÑ+LÑ&MÑNõ $ð˜ô ð$ 3ð $¨4ô $ð
˜( 3™-ô ð	C #ð 	C¨%°¸{Ð0JÑ*Kô 	Cð! #ð !¨E°-ÀÐ2LÑ,Mð !ÐRVô !ð #ð ¨$ô ò1ò1ð ð˜ó ó ðð ð˜$ó ó ðð ð˜4ó ó ðò1ò1ð3 3ð 3¨3ô 3ð&5 ô 5ð1 ð 1¨ô 1ð	0 cð 	0¨cô 	0ð0¨Cð 0°Cô 0ð ØBCØ+,ñ¨ð ¸Cð Ø%(ðØ1Gôó ðð> ñ' ð '¨sð 'ÐCYô 'ó ð'ðR ð  3ð  Ð+Aó  ó ó r1   r   ),rG   r€   rò   Úcollections.abcr   Útypingr   r   r   r   r   r	   Ú	threadingr
   rX   rÌ   Úeth_account.accountr   Úeth_account.signers.localr   Úpy_eth_sig_utils.eip712r   Úpy_eth_sig_utils.utilsr   r   r   r   Úpy_eth_sig_utils.signingr   r   Úautobahn.wamp.interfacesr   r   Úautobahn.xbr._mnemonicr   Úautobahn.utilr   Úautobahn.wamp.cryptosignr   Ú__all__Úobjectr   Úregisterr   r9   r1   r.   Ú<module>r     s†   ðó4 Û 	Û Ý *ß =× =Ý ã Û å 'Ý 2å 5ß RÓ Rß Kç BÝ :Ý 'Ý 2à
3€ôVM�&ô VMðr × Ò �kÔ "ôe˜>ô eðP	 × Ò Ð-Õ .r1   