Python common 模块,make_mac_tests() 实例源码

我们从Python开源项目中,提取了以下10个代码示例,用于说明如何使用common.make_mac_tests()

项目:hostapd-mana    作者:adde88    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:watchmen    作者:lycclsltt    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:aws-cfn-plex    作者:lordmuffin    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:git_intgrtn_aws_s3    作者:droidlabour    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:MCSManager-fsmodule    作者:Suwings    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:PyMal    作者:cysinfo    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:sslstrip-hsts-openwrt    作者:adde88    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:Encryped-file-system    作者:kittenish    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:isf    作者:w3h    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)
项目:kekescan    作者:xiaoxiaoleo    | 项目源码 | 文件源码
def get_tests(config={}):
    global test_data
    from Crypto.Hash import HMAC, MD5, SHA as SHA1, SHA256
    from common import make_mac_tests
    hashmods = dict(MD5=MD5, SHA1=SHA1, SHA256=SHA256, default=None)
    try:
        from Crypto.Hash import SHA224, SHA384, SHA512
        hashmods.update(dict(SHA224=SHA224, SHA384=SHA384, SHA512=SHA512))
        test_data += hashlib_test_data
    except ImportError:
        import sys
        sys.stderr.write("SelfTest: warning: not testing HMAC-SHA224/384/512 (not available)\n")
    return make_mac_tests(HMAC, "HMAC", test_data, hashmods)