
    i                         S r SSKrSSKrSSKJr  SSKJr   " S S\5      rSS jr	0 4S jr
\S	:X  a  S
 r\R                  " SS9  gg)zgSelf tests

These tests should perform quickly and can ideally be used every time an
application runs.
    N)import_module)StringIOc                       \ rS rSrS rSrg)SelfTestError%   c                 H    [         R                  XU5        Xl        X l        g N)	Exception__init__messageresult)selfr   r   s      S/var/www/html/trading/venv/lib/python3.13/site-packages/Crypto/SelfTest/__init__.pyr   SelfTestError.__init__&   s    4&1    )r   r   N)__name__
__module____qualname____firstlineno__r   __static_attributes__ r   r   r   r   %   s    r   r   c                    Uc  0 n[         R                  " 5       nU c  Uc	  [        US9nUR                  U5        O-Uc  UR                  U R                  US95        O[	        S5      eUc  [        5       US'   OX%S'   [         R                  " SSU0UD6nUR                  U5      nUR                  5       (       d?  Uc0  [        R                  R                  US   R                  5       5        [        SU5      eU$ )a  Execute self-tests.

This raises SelfTestError if any test is unsuccessful.

You may optionally pass in a sub-module of SelfTest if you only want to
perform some of the tests.  For example, the following would test only the
hash modules:

    Crypto.SelfTest.run(Crypto.SelfTest.Hash)

configz5'module' and 'tests' arguments are mutually exclusivestream	verbosityzSelf-test failedr   )unittest	TestSuite	get_testsaddTests
ValueErrorr   TextTestRunnerrunwasSuccessfulsysstderrwritegetvaluer   )	moduler   r   testsr   kwargssuiterunnerr   s	            r   r#   r#   ,   s     ~ E~=V,Eu=NN6++6+:;TUU~#:x!x$$CyCFCFZZF!!>JJVH-6689.77Mr   c                 b    / n/ SQnU H"  n[        SU-   5      nXR                  U S9-  nM$     U$ )N)	CipherHashProtocol	PublicKeyRandomUtil	SignatureIOMathzCrypto.SelfTest.r   )r   r   )r   r*   module_namesnamer)   s        r   r   r   R   sG    E
L
 1D89!!!00  Lr   __main__c                  >    [         R                  " [        5       5      $ r	   )r   r   r   r   r   r   r,   r,   b   s    !!)+..r   r,   )defaultTest)Nr   NNN)__doc__r%   r   	importlibr   Crypto.Util.py3compatr   r
   r   r#   r   r   r,   mainr   r   r   <module>rA      sT   2   # *I #L   z/MMg& r   