a  zes@sJddlZddlZddlZz ddlZWney:dZYn0dddZdS)NTcsfddS)aDecorator raising SkipTest if a hashing algorithm is not available The hashing algorithm could be missing or blocked by a strict crypto policy. If 'openssl' is True, then the decorator checks that OpenSSL provides the algorithm. Otherwise the check falls back to built-in implementations. The usedforsecurity flag is passed to the constructor. ValueError: [digital envelope routines: EVP_DigestInit_ex] disabled for FIPS ValueError: unsupported hash type md4 cs|ttr\jd}|dur@fdd}jd|_j|_n|j}t|}|_St fdd}|S)N setUpClasscst|dS)N)superr)cls func_or_classO/opt/bitninja-python-dojo/embedded/lib/python3.9/test/support/hashlib_helper.pyrsz:requires_hashdigest..decorator..setUpClassz .setUpClasscsbz.rtdurtjdntjdWn$tyRtddYn0|i|S)N)usedforsecurityz hash digest 'z' is not available.)_hashlibnewhashlib ValueErrorunittestZSkipTest)argskwargs) digestnameropensslr rrwrapper&s   z7requires_hashdigest..decorator..wrapper) isinstancetype__dict__get __qualname__ __module____func__ classmethodr functoolswraps)rrr decoratorrrr rrrs       z&requires_hashdigest..decoratorr)rrr rrrrequires_hashdigest s r )NT)rr rr ImportErrorr rrrrs