tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
P\¬Qc@sÇddlZddlZddlZddlZddlmZdejfd„ƒYZdejfd„ƒYZdejfd„ƒYZ    d    ejfd
„ƒYZ
d „Z e d krÃe ƒndS( iÿÿÿÿN(t test_supporttTestVectorsTestCasecBsPeZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    RS(csô‡fd†}|tdƒdddƒ|dddƒ|td    ƒdtd
ƒd d ƒ|d jgtddƒD]}t|ƒ^qvƒtdƒd dƒ|tdƒdddƒ|td    ƒdddƒ|td    ƒdddƒdS(Ncs8tj||ƒ}ˆj|jƒjƒ|jƒƒdS(N(thmactHMACt assertEqualt    hexdigesttupper(tkeytdatatdigestth(tself(sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pytmd5test si isHi Theret 9294727A3638BB1C13F48EF8158BFC9DtJefeswhat do ya want for nothing?t 750c783e6ab0b503eaa86e310a5db738iªiÝi2t 56be34521d144c88dbb8c733f0e8b3f6tiiiÍt 697eaf0aca3a3aea3a75164746ffaa79i sTest With Truncationt 56461ef2342edc00f9bab995690efd4ciPs6Test Using Larger Than Block-Size Key - Hash Key Firstt 6b1ab7fe4bd7bf8f0b62e6ce61b9d0cdsITest Using Larger Than Block-Size Key and Larger Than One Block-Size Datat 6f630fad67cda0ee1fb1f562db3aa53e(tchrtjointrange(R R ti((R sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_md5_vectors    s, 1 csô‡fd†}|tdƒdddƒ|dddƒ|td    ƒdtd
ƒd d ƒ|d jgtddƒD]}t|ƒ^qvƒtdƒd dƒ|tdƒdddƒ|td    ƒdddƒ|td    ƒdddƒdS(NcsAtj||dtjƒ}ˆj|jƒjƒ|jƒƒdS(Nt    digestmod(RRthashlibtsha1RRR(RRR    R
(R (sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pytshatest.si isHi Theret(b617318655057264e28bc0b6fb378c8ef146be00Rswhat do ya want for nothing?t(effcdf6ae5eb2fa2d27416d5f184df9c259a7c79iªiÝi2t(125d7342b9ac11cd91a39af48aa17b4f63f175d3RiiiÍt(4c9007f4026250c6bc8414f9bf50c86c2d7235dai sTest With Truncationt(4c1a03424b55e07fe7f27be1d58bb9324a9a5a04iPs6Test Using Larger Than Block-Size Key - Hash Key Firstt(aa4ae5e15272d00e95705637ce8a3b55ed402112sITest Using Larger Than Block-Size Key and Larger Than One Block-Size Datat(e8e99d0f45237d786d6bbaa7965c7808bbff1a91(RRR(R RR((R sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_sha_vectors-s, 1 c    sׇ‡fd†}|dd,dddidtj6d    tj6d
tj6d tj6ƒ|dd dd didtj6dtj6dtj6dtj6ƒ|dd-ddddidtj6dtj6dtj6dtj6ƒ|ddjgtdd.ƒD]}t|ƒ^qõƒddddidtj6dtj6dtj6d tj6ƒ|ddd!dd"did#tj6d$tj6d%tj6d&tj6ƒ|ddd!dd'did(tj6d)tj6d*tj6d+tj6ƒdS(/Ncs<tj||dˆƒ}ˆj|jƒjƒ|ˆƒdS(NR(RRRRtlower(RRt
hexdigestsR
(thashfuncR (sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pythmactestPsRs iRsHi ThereR(t8896fb1128abbdf196832107cd49df33f47b4b1169912ba4f53684b22t@b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7t`afd03944d84895626b0825f4ab46907f15f9dadbe4101ec682aa034c7cebc59cfaea9ea9076ede7f4af152e8b2fa9cb6t€87aa7cdea5ef619d4ff0b4241a1d6cb02379f4e2ce4ec2787ad0b30545e17cdedaa833b7d6b8a702038b274eaea3f4e4be9d914eeb61f1702e696c203a126854Rswhat do ya want for nothing?t8a30e01098bc6dbbf45690f3a7e9e6d0f8bbea2a39e6148008fd05e44t@5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843t`af45d2e376484031617f78d2b58a6b1b9c7ef464f5a01b47e42ec3736322445e8e2240ca5e69e2c78b3239ecfab21649t€164b7a7bfcf819e2e395fbe73b56e0a387bd64222e831fd610270cd7ea2505549758bf75c05a994a6d034f65f8f0e6fdcaeab1a34d4a6b4b636e070a38bce737sªsÝi2t87fb3cb3588c6c1f6ffa9694d7d6ad2649365b0c1f65d69d1ec8333eat@773ea91e36800e46854db8ebd09181a72959098b3ef8c122d9635514ced565fet`88062608d3e6ad8a0aa2ace014c8a86f0aa635d947ac9febe83ef4e55966144b2a5ab39dc13814b94e3ab6e101a34f27t€fa73b0089d56a284efb0f0756c890be9b1b5dbdd8ee81a3655f83e33b2279d39bf3e848279a722c806b485a47e67c807b946a337bee8942674278859e13292fbRiisÍt86c11506874013cac6a2abc1bb382627cec6a90d86efc012de7afec5at@82558a389a443c0ea4cc819899f2083a85f0faa3e578f8077a2e3ff46729665bt`3e8a69b7783c25851933ab6290af6ca77a9981480850009cc5577c6e1f573b4e6801dd23c4a7d679ccf8a386c674cffbt€b0ba465637458c6990e5a8c5f61d4af7e576d97ff94b872de76f8050361ee3dba91ca5c11aa25eb4d679275cc5788063a5f19741120c4f2de2adebeb10a298ddiƒs6Test Using Larger Than Block-Size Key - Hash Key Firstt895e9a0db962095adaebe9b2d6f0dbce2d499f112f2d2b7273fa6870et@60e431591ee0b67f0d8a26aacbf5b77f8e0bc6213728c5140546040f0ee37f54t`4ece084485813e9088d2c63a041bc5b44f9ef1012a2b588f3cd11f05033ac4c60c2ef6ab4030fe8296248df163f44952t€80b24263c7c1a3ebb71493c1dd7be8b49b46d1f41b4aeec1121b013783f8f3526b56d037e05f2598bd0fd2215d6a1e5295e64f73f63f0aec8b915a985d786598s˜This is a test using a larger than block-size key and a larger than block-size data. The key needs to be hashed before being used by the HMAC algorithm.t83a854166ac5d9f023f54d517d0b39dbd946770db9c2b95c9f6f565d1t@9b09ffa71b942fcb27635fbcd5b0e944bfdc63644f0713938a7f51535c3a35e2t`6617178e941f020d351e2f254e8fd32c602420feb0b8fb9adccebb82461e99c5a678cc31e799176d3860e6110c46523et€e37b6a775dc87dbaa4dfa9f96e5e3ffddebd71f8867289865df5a32d20cdc944b6022cac3c4982b10d5eeb55c3e4de15134676fb6de0446065c97440fa8c6a58s sªªªªªªªªªªªªªªªªªªªªi(Rtsha224tsha256tsha384tsha512RtxrangeR(R R)R*tx((R)R sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt_rfc4231_test_casesOsV 
 
 
 
 
 
 
 
 
 
7
 
 
 
 
 
 
 
 
 
cCs|jtjƒdS(N(RIRRC(R ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_sha224_rfc4231¿scCs|jtjƒdS(N(RIRRD(R ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_sha256_rfc4231ÂscCs|jtjƒdS(N(RIRRE(R ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_sha384_rfc4231ÅscCs|jtjƒdS(N(RIRRF(R ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_sha512_rfc4231ÈscCs¸dtfd„ƒY}tjƒtjdtƒ|jtƒ(tjddd|ƒ|jdƒWdQXd|_    |jtƒ(tjddd|ƒ|jd    ƒWdQXWdQXdS(
Nt MockCrazyHashcBs)eZdZd„Zd„Zd„ZRS(s#Ain't no block_size attribute here.cWs%tj|Œ|_|jj|_dS(N(RRt_xt digest_size(R targs((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt__init__ÎscSs|jj|ƒdS(N(ROtupdate(R tv((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRSÑscSs |jjƒS(N(ROR    (R ((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyR    Ós(t__name__t
__module__t__doc__RRRSR    (((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRNÌs        terrortatbRs)Expected warning about missing block_sizeis'Expected warning about small block_size(
tobjecttwarningstcatch_warningst simplefiltertRuntimeWarningt assertRaisesRRtfailt
block_size(R RN((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_legacy_block_size_warningsËs
    (
RURVRR&RIRJRKRLRMRc(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRs    $    "    p                tConstructorTestCasecBs#eZd„Zd„Zd„ZRS(cCs4d}ytjdƒ}Wn|jdƒnXdS(NiRs+Standard constructor call raised exception.(RRRa(R tfailedR
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt test_normalås
cCs1ytjddƒ}Wn|jdƒnXdS(NRs
hash this!s5Constructor call with text argument raised exception.(RRRa(R R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt test_withtextíscCs7ytjddtjƒ}Wn|jdƒnXdS(NRRs4Constructor call with hashlib.sha1 raised exception.(RRRRRa(R R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_withmoduleôs(RURVRfRgRh(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRdãs        tSanityTestCasecBseZd„Zd„ZRS(cCs,tjdƒ}|j|jtjkƒdS(NR(RRt
assertTruet digest_consRtmd5(R R
((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_default_is_md5ýscCs_yDtjdƒ}|jdƒ|jƒ}|jƒ}|jƒ}Wn|jdƒnXdS(Ns my secret keyscompute the hash of this text!s3Exception raised during normal usage of HMAC class.(RRRSR    RtcopyRa(R R
tdigth2((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_exercise_all_methodss   (RURVRmRq(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRiûs    t CopyTestCasecBs#eZd„Zd„Zd„ZRS(cCs‹tjdƒ}|jƒ}|j|j|jkdƒ|jt|jƒt|jƒkdƒ|jt|jƒt|jƒkdƒdS(NRs digest constructors don't match.sTypes of inner don't match.sTypes of outer don't match.(RRRnRjRkttypetinnertouter(R th1Rp((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyttest_attributess !!cCs‘tjdƒ}|jƒ}|jt|ƒt|ƒkdƒ|jt|jƒt|jƒkdƒ|jt|jƒt|jƒkdƒdS(NRs"No real copy of the HMAC instance.s&No real copy of the attribute 'inner'.s&No real copy of the attribute 'outer'.(RRRnRjtidRtRu(R RvRp((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt test_realcopys "!!cCsptjdƒ}|jdƒ|jƒ}|j|jƒ|jƒkdƒ|j|jƒ|jƒkdƒdS(NRssome random texts-Digest of copy doesn't match original digest.s3Hexdigest of copy doesn't match original hexdigest.(RRRSRnRjR    R(R RvRp((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt test_equality's  (RURVRwRyRz(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyRrs         cCstjttttƒdS(N(Rt run_unittestRRdRiRr(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt    test_main1s
t__main__( RRtunittestR\ttestRtTestCaseRRdRiRrR|RU(((sV/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/test/test_hmac.pyt<module>s    Ü"