o
    Œõ±j
  ã                	   @   sì   d dl Z d dlZ d dlZe e¡Zdd„ Zdddddd	œZg d
¢g d
¢g d
¢g d
¢dœZdgdgdgdgdœZ	da
eD ],Zz
e j ee ¡ W n	 eyP   Y q;w e j ee ¡durge	D ]	Ze	e  e¡ q]q;dd„ Zdd„ Zdd„ ZdS )é    Nc                 C   s   t | |gd�} t| |ƒS )N)Úfromlist)Ú
__import__Úgetattr)ÚmoduleÚname© r   ú…/root/aizidognhua/tmp/workspace/projects/ec89d86c-575f-41c9-af57-ac45cbdbf775/venv/lib/python3.10/site-packages/unicrypto/__init__.pyÚimport_from   s   
r	   ÚmbedtlsÚcryptographyÚ
CryptodomezCrypto.Cipher.Salsa20zCrypto.Random.OSRNG)r
   r   ÚpyCryptodomexÚpyCryptodomeÚpyCrypto)r   r   r   r   r
   Úpure)ÚDESÚTDESÚAESÚRC4r   c                 C   s,   t  d|| f ¡ d| ¡ | f }t|| ƒS )Nzsymmetric using "%s" for "%s"zunicrypto.backends.%s.%s)ÚloggerÚdebugÚlowerr	   )Ú
ciphernameÚcryptolibnameÚ
moduleNamer   r   r   Úget_cipher_by_name1   s   
r   c                 C   s€   t d u r9| tvrtd|  ƒ‚ttt|  ƒ tt|  ƒ¡ƒ}d }t|  D ]
}||v r-|} nq#|d u r8td|  ƒ‚nt }t| |ƒS )NzCipher "%s" is not supported!z.Could not find any modules to load cipher "%s")Úoverride_libraryÚ	preftableÚ	ExceptionÚlistÚsetÚintersectionÚavailable_modulesr   )r   Úpossible_prefmoduleÚselected_moduler   r   r   r   Úget_preferred_cipher7   s   þÿ
r%   c                 C   s   | a d S )N)r   )Úlibnamer   r   r   Úuse_libraryL   s   r'   )Ú	importlibÚimportlib.utilÚloggingÚ	getLoggerÚ__name__r   r	   Úpref_to_moduler   r"   r   ÚprefnameÚutilÚ	find_specÚModuleNotFoundErrorÚkÚappendr   r%   r'   r   r   r   r   Ú<module>   sF    
úüüÿ€