U
    ;ßôg›x  ã                   @   s„  d dl mZmZmZmZ ddlmZ ddlmZm	Z	m
Z
mZmZmZmZmZmZmZ ddlmZ ddlmZ ddlmZmZ eƒ Zed	kr¨dd
lmZmZmZmZmZ nddl m!Z!m"Z"mZm#Z#m$Z$ ddddddddddddgZ%dd„ Z&dd„ Z'dd„ Z(dd„ Z)dd„ Z*dd„ Z+dd„ Z,dd„ Z-d d„ Z.d!d„ Z/d"d„ Z0d#d„ Z1d$d%„ Z2d&d'„ Z3d(d)„ Z4d*d+„ Z5d,d-„ Z6d.d/„ Z7d0d1„ Z8d2d3„ Z9d4S )5é    )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functioné   )Úpretty_message)
Úbuffer_from_bytesÚbytes_from_bufferÚderefÚnewÚnullÚpointer_setÚstructÚstruct_bytesÚunwrapÚwrite_to_bufferé   )Ú
rand_bytes)Úbackend)Ú	type_nameÚbyte_clsÚ	winlegacy)Úadvapi32ÚAdvapi32ConstÚhandle_errorÚopen_context_handleÚclose_context_handle)ÚbcryptÚBcryptConstr   Úopen_alg_handleÚclose_alg_handleÚaes_cbc_no_padding_decryptÚaes_cbc_no_padding_encryptÚaes_cbc_pkcs7_decryptÚaes_cbc_pkcs7_encryptÚdes_cbc_pkcs5_decryptÚdes_cbc_pkcs5_encryptÚrc2_cbc_pkcs5_decryptÚrc2_cbc_pkcs5_encryptÚrc4_decryptÚrc4_encryptÚtripledes_cbc_pkcs5_decryptÚtripledes_cbc_pkcs5_encryptc                 C   s€   t | ƒdkrttdt | ƒƒƒ‚|s,tdƒ}nt |ƒdkrJttdt |ƒƒƒ‚t |ƒd dkrlttdt |ƒƒƒ‚|td| ||dƒfS )	aß  
    Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and
    no padding. This means the ciphertext must be an exact multiple of 16 bytes
    long.

    :param key:
        The encryption key - a byte string either 16, 24 or 32 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The initialization vector - either a byte string 16-bytes long or None
        to generate an IV

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A tuple of two byte strings (iv, ciphertext)
    ©é   é   é    úo
            key must be either 16, 24 or 32 bytes (128, 192 or 256 bits)
            long - is %s
            r.   ú:
            iv must be 16 bytes long - is %s
            r   zJ
            data must be a multiple of 16 bytes long - is %s
            ÚaesF©ÚlenÚ
ValueErrorr   r   Ú_encrypt©ÚkeyÚdataÚiv© r<   ú;/tmp/pip-unpacked-wheel-x1gypflw/oscrypto/_win/symmetric.pyr"   -   s$    û
üüc                 C   sL   t | ƒdkrttdt | ƒƒƒ‚t |ƒdkr<ttdt |ƒƒƒ‚td| ||dƒS )a[  
    Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key and no
    padding.

    :param key:
        The encryption key - a byte string either 16, 24 or 32 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector - a byte string 16-bytes long

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r-   r1   r.   r2   r3   F©r5   r6   r   Ú_decryptr8   r<   r<   r=   r!   d   s    ûüc                 C   s^   t | ƒdkrttdt | ƒƒƒ‚|s,tdƒ}nt |ƒdkrJttdt |ƒƒƒ‚|td| ||dƒfS )a™  
    Encrypts plaintext using AES in CBC mode with a 128, 192 or 256 bit key and
    PKCS#7 padding.

    :param key:
        The encryption key - a byte string either 16, 24 or 32 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The initialization vector - either a byte string 16-bytes long or None
        to generate an IV

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A tuple of two byte strings (iv, ciphertext)
    r-   r1   r.   r2   r3   Tr4   r8   r<   r<   r=   r$      s    û
üc                 C   sL   t | ƒdkrttdt | ƒƒƒ‚t |ƒdkr<ttdt |ƒƒƒ‚td| ||dƒS )aG  
    Decrypts AES ciphertext in CBC mode using a 128, 192 or 256 bit key

    :param key:
        The encryption key - a byte string either 16, 24 or 32 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector - a byte string 16-bytes long

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r-   r1   r.   r2   r3   Tr>   r8   r<   r<   r=   r#   ½   s    ûüc                 C   s:   t | ƒdk st | ƒdkr*ttdt | ƒƒƒ‚td| |ddƒS )a×  
    Encrypts plaintext using RC4 with a 40-128 bit key

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The plaintext - a byte string

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    é   r.   úQ
            key must be 5 to 16 bytes (40 to 128 bits) long - is %s
            Úrc4N)r5   r6   r   r7   ©r9   r:   r<   r<   r=   r*   ç   s    üc                 C   s:   t | ƒdk st | ƒdkr*ttdt | ƒƒƒ‚td| |ddƒS )aÓ  
    Decrypts RC4 ciphertext using a 40-128 bit key

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The ciphertext - a byte string

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r@   r.   rA   rB   Nr>   rC   r<   r<   r=   r)     s    üc                 C   sj   t | ƒdk st | ƒdkr*ttdt | ƒƒƒ‚|s8tdƒ}nt |ƒdkrVttdt |ƒƒƒ‚|td| ||dƒfS )ab  
    Encrypts plaintext using RC2 with a 64 bit key

    :param key:
        The encryption key - a byte string 8 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The 8-byte initialization vector to use - a byte string - set as None
        to generate an appropriate one

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A tuple of two byte strings (iv, ciphertext)
    r@   r.   rA   é   ú9
            iv must be 8 bytes long - is %s
            Úrc2Tr4   r8   r<   r<   r=   r(   #  s    ü
üc                 C   sX   t | ƒdk st | ƒdkr*ttdt | ƒƒƒ‚t |ƒdkrHttdt |ƒƒƒ‚td| ||dƒS )a"  
    Decrypts RC2 ciphertext using a 64 bit key

    :param key:
        The encryption key - a byte string 8 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector used for encryption - a byte string

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r@   r.   rA   rD   rE   rF   Tr>   r8   r<   r<   r=   r'   O  s    üüc                 C   s~   t | ƒdkr*t | ƒdkr*ttdt | ƒƒƒ‚|s8tdƒ}nt |ƒdkrVttdt |ƒƒƒ‚d}t | ƒdkrjd}|t|| ||dƒfS )	a„  
    Encrypts plaintext using 3DES in either 2 or 3 key mode

    :param key:
        The encryption key - a byte string 16 or 24 bytes long (2 or 3 key mode)

    :param data:
        The plaintext - a byte string

    :param iv:
        The 8-byte initialization vector to use - a byte string - set as None
        to generate an appropriate one

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A tuple of two byte strings (iv, ciphertext)
    r.   r/   úW
            key must be 16 bytes (2 key) or 24 bytes (3 key) long - is %s
            rD   rE   Útripledes_3keyÚtripledes_2keyTr4   ©r9   r:   r;   Úcipherr<   r<   r=   r,   x  s     ü
üc                 C   sl   t | ƒdkr*t | ƒdkr*ttdt | ƒƒƒ‚t |ƒdkrHttdt |ƒƒƒ‚d}t | ƒdkr\d}t|| ||dƒS )	aC  
    Decrypts 3DES ciphertext in either 2 or 3 key mode

    :param key:
        The encryption key - a byte string 16 or 24 bytes long (2 or 3 key mode)

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector used for encryption - a byte string

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r.   r/   rG   rD   rE   rH   rI   Tr>   rJ   r<   r<   r=   r+   ¨  s    üüc                 C   s^   t | ƒdkrttdt | ƒƒƒ‚|s,tdƒ}nt |ƒdkrJttdt |ƒƒƒ‚|td| ||dƒfS )a‹  
    Encrypts plaintext using DES with a 56 bit key

    :param key:
        The encryption key - a byte string 8 bytes long (includes error
        correction bits)

    :param data:
        The plaintext - a byte string

    :param iv:
        The 8-byte initialization vector to use - a byte string - set as None
        to generate an appropriate one

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A tuple of two byte strings (iv, ciphertext)
    rD   úT
            key must be 8 bytes (56 bits + 8 parity bits) long - is %s
            rE   ÚdesTr4   r8   r<   r<   r=   r&   Õ  s    ü
üc                 C   sL   t | ƒdkrttdt | ƒƒƒ‚t |ƒdkr<ttdt |ƒƒƒ‚td| ||dƒS )aK  
    Decrypts DES ciphertext using a 56 bit key

    :param key:
        The encryption key - a byte string 8 bytes long (includes error
        correction bits)

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector used for encryption - a byte string

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    rD   rL   rE   rM   Tr>   r8   r<   r<   r=   r%     s    üüc                 C   sÂ  d}| dkr(t jt jt jdœt|ƒ }nt jt jt jt jt j	dœ|  }t j
}t|dd}ttdƒ}t|ƒ}t j|_t j|_d|_||_ttd	ƒ}t|ƒ}	||	_t|ƒ|	_t|ƒ| }
d}| td
dgƒkrÚt|ƒdkrÚt j}ttdƒ}t ||
t|
ƒtƒ ||¡}t|ƒ t|ƒ}| d
krFttdt|ƒd ƒ}t |t j|d¡}t|ƒ | dkrºt |t j |d¡}t|ƒ ttdt j!ƒ}t |t j"|d¡}t|ƒ ttdt j#ƒ}t |t j$|d¡}t|ƒ ||fS )a  
    Creates an HCRYPTPROV and HCRYPTKEY for symmetric encryption/decryption. The
    HCRYPTPROV must be released by close_context_handle() and the
    HCRYPTKEY must be released by advapi32.CryptDestroyKey() when done.

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        A byte string of the symmetric key

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :return:
        A tuple of (HCRYPTPROV, HCRYPTKEY)
    Nr3   r-   )rM   rI   rH   rF   rB   F)Zverify_onlyZ
BLOBHEADERr   ÚPLAINTEXTKEYBLOBrF   rB   r@   zHCRYPTKEY *úDWORD *rD   )%r   ZCALG_AES_128ZCALG_AES_192ZCALG_AES_256r5   ZCALG_DESZCALG_3DES_112Z	CALG_3DESZCALG_RC2ZCALG_RC4ZMS_ENH_RSA_AES_PROVr   r   r   r   rN   ZbTypeZCUR_BLOB_VERSIONZbVersionÚreservedZaiKeyAlgÚhdrZ	dwKeySizer   ÚsetZCRYPT_NO_SALTr   ZCryptImportKeyr   r   ZCryptSetKeyParamZKP_EFFECTIVE_KEYLENZKP_IVZCRYPT_MODE_CBCZKP_MODEZPKCS5_PADDINGZ
KP_PADDING)rK   r9   r;   Úcontext_handleZalgorithm_idZproviderZblob_header_pointerZblob_headerÚblob_struct_pointerÚblob_structÚblobÚflagsÚkey_handle_pointerÚresÚ
key_handleÚbufr<   r<   r=   Ú_advapi32_create_handles,  sš    ýüûú



ú
ü
üüür\   c                 C   sø   d}t jt jt jt jt jt jdœ|  }z¾t|ƒ}t j	}t
tdƒ}t|ƒ}t j|_t j|_t|ƒ|_t|ƒ| }| dkr¦ttdt|ƒd ƒ}t |t j|dd¡}	t|	ƒ ttd	ƒ}
t |tƒ ||
tƒ d|t|ƒd¡	}	t|	ƒ t|
ƒW ¢S |ròt|ƒ X dS )
ao  
    Creates a BCRYPT_KEY_HANDLE for symmetric encryption/decryption. The
    handle must be released by bcrypt.BCryptDestroyKey() when done.

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        A byte string of the symmetric key

    :return:
        A BCRYPT_KEY_HANDLE
    N)r3   rM   rI   rH   rF   rB   ZBCRYPT_KEY_DATA_BLOB_HEADERrF   rO   rD   é   r   zBCRYPT_KEY_HANDLE *)r   ZBCRYPT_AES_ALGORITHMZBCRYPT_DES_ALGORITHMZBCRYPT_3DES_112_ALGORITHMZBCRYPT_3DES_ALGORITHMZBCRYPT_RC2_ALGORITHMZBCRYPT_RC4_ALGORITHMr    r   ZBCRYPT_KEY_DATA_BLOBr   r   r   ZBCRYPT_KEY_DATA_BLOB_MAGICZdwMagicZBCRYPT_KEY_DATA_BLOB_VERSION1Z	dwVersionr5   Z	cbKeyDatar   r   ZBCryptSetPropertyZBCRYPT_EFFECTIVE_KEY_LENGTHr   ZBCryptImportKeyr   )rK   r9   Z
alg_handleZalg_constantZ	blob_typerT   rU   rV   r[   rY   rX   r<   r<   r=   Ú_bcrypt_create_key_handle›  sZ    úù	

û
÷r^   c                 C   s°   t |tƒsttdt|ƒƒƒ‚t |tƒs8ttdt|ƒƒƒ‚| dkr\t |tƒs\ttdt|ƒƒƒ‚| dkrˆ|sˆ| dkr€t|ƒd dksˆtdƒ‚td	kr t| ||||ƒS t	| ||||ƒS )
aÒ  
    Encrypts plaintext

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    ú;
            key must be a byte string, not %s
            ú<
            data must be a byte string, not %s
            rB   ú:
            iv must be a byte string, not %s
            r3   r.   r   úpadding must be specifiedr   )
Ú
isinstancer   Ú	TypeErrorr   r   r5   r6   Ú_backendÚ_advapi32_encryptÚ_bcrypt_encrypt©rK   r9   r:   r;   Úpaddingr<   r<   r=   r7   â  s*    
ü
üür7   c              	   C   sö   d}d}zÌt| ||ƒ\}}tt dt|ƒƒ}t  |tƒ ddtƒ |d¡}t|ƒ t	|ƒ}	t
|	ƒ}
t|
|ƒ t|t|ƒƒ t  |tƒ dd|
||	¡}t|ƒ t|
t	|ƒƒ}| dkrÎ|sÎt|ƒt|ƒd krÎ|dd… }|W ¢S |rät  |¡ |rðt|ƒ X dS )aà  
    Encrypts plaintext via CryptoAPI

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    NrO   Tr   r3   r.   iðÿÿÿ)r   ÚCryptDestroyKeyr   r\   r   r5   ZCryptEncryptr   r   r
   r   r   r   r	   )rK   r9   r:   r;   ri   rS   rZ   Úout_lenrY   Ú
buffer_lenÚbufferÚoutputr<   r<   r=   rf   "  sJ    ù	
ù	 
rf   c                 C   sâ   d}zÈt| |ƒ}|dkrd}nt|ƒ}d}|dkr8tj}tt dƒ}t  ||t|ƒtƒ tƒ dtƒ d||¡
}	t	|	ƒ t
|ƒ}
t|
ƒ}|rŒt|ƒntƒ }t  ||t|ƒtƒ ||||
||¡
}	t	|	ƒ t|t
|ƒƒW ¢S |rÜt  |¡ X dS )aÚ  
    Encrypts plaintext via CNG

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The plaintext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the ciphertext
    Nr   TúULONG *)r   ÚBCryptDestroyKeyr^   r5   r   ÚBCRYPT_BLOCK_PADDINGr   ZBCryptEncryptr   r   r
   r   r	   ©rK   r9   r:   r;   ri   rZ   Úiv_lenrW   rk   rY   rl   rm   Z	iv_bufferr<   r<   r=   rg   q  sT    

öörg   c                 C   s    t |tƒsttdt|ƒƒƒ‚t |tƒs8ttdt|ƒƒƒ‚| dkr\t |tƒs\ttdt|ƒƒƒ‚| tddgƒkrx|sxtdƒ‚tdkrt| ||||ƒS t	| ||||ƒS )aè  
    Decrypts AES/RC4/RC2/3DES/DES ciphertext

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    r_   r`   rB   ra   r3   rb   r   )
rc   r   rd   r   r   rR   r6   re   Ú_advapi32_decryptÚ_bcrypt_decryptrh   r<   r<   r=   r?   Ä  s(    
ü
üür?   c           
   	   C   s¶   d}d}zŒt| ||ƒ\}}| dkr>|s>t|ƒd dkr>tdƒ‚t|ƒ}tt dt|ƒƒ}t  |t	ƒ | dkrp|spdndd||¡}	t
|	ƒ t|t|ƒƒW ¢S |r¤t  |¡ |r°t|ƒ X dS )	aö  
    Decrypts AES/RC4/RC2/3DES/DES ciphertext via CryptoAPI

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    Nr3   r.   r   z9Invalid data - ciphertext length must be a multiple of 16rO   FT)r   rj   r   r\   r5   r6   r   r   ZCryptDecryptr   r   r	   r
   )
rK   r9   r:   r;   ri   rS   rZ   rm   rk   rY   r<   r<   r=   rt     s,    ø

rt   c                 C   sâ   d}zÈt| |ƒ}|dkrd}nt|ƒ}d}|dkr8tj}tt dƒ}t  ||t|ƒtƒ tƒ dtƒ d||¡
}	t	|	ƒ t
|ƒ}
t|
ƒ}|rŒt|ƒntƒ }t  ||t|ƒtƒ ||||
||¡
}	t	|	ƒ t|t
|ƒƒW ¢S |rÜt  |¡ X dS )að  
    Decrypts AES/RC4/RC2/3DES/DES ciphertext via CNG

    :param cipher:
        A unicode string of "aes", "des", "tripledes_2key", "tripledes_3key",
        "rc2", "rc4"

    :param key:
        The encryption key - a byte string 5-16 bytes long

    :param data:
        The ciphertext - a byte string

    :param iv:
        The initialization vector - a byte string - unused for RC4

    :param padding:
        Boolean, if padding should be used - unused for RC4

    :raises:
        ValueError - when any of the parameters contain an invalid value
        TypeError - when any of the parameters are of the wrong type
        OSError - when an error is returned by the OS crypto library

    :return:
        A byte string of the plaintext
    Nr   Tro   )r   rp   r^   r5   r   rq   r   ZBCryptDecryptr   r   r
   r   r	   rr   r<   r<   r=   ru   >  sT    

ööru   N):Ú
__future__r   r   r   r   Ú_errorsr   Ú_ffir   r	   r
   r   r   r   r   r   r   r   Úutilr   Ú r   Ú_typesr   r   re   Z	_advapi32r   r   r   r   r   Z_cngr   r   r   r    Ú__all__r"   r!   r$   r#   r*   r)   r(   r'   r,   r+   r&   r%   r\   r^   r7   rf   rg   r?   rt   ru   r<   r<   r<   r=   Ú<module>   sT   0ô7+.*,)0--*oG@OS==