ffyGldZddlZddlZddlmZmZddlmZddlm Z ddl m Z ddl m Z mZdd lmZdd lmZd ed d dfddddddddedddfdedddfdddd d!d"d#d$gZd%d&d'd(e ed)d*fd+d,d-d(e ed.d*fd/d0d1d(e ed2d*fd3d4d5d(e ed6d*fgZd7d8d9d:eed;d*fdeed?d*fd@d8dAdBeed?d*fd@dCdDdEeedFd*fgZGdGdHejZGdIdJejZGdKdLeZGdMdNeZGdOdPejZifdQZedRkrdSZ ej!dTUdSdS)Vz)Self-test suite for Crypto.Hash._Poly1305N) unhexlifyhexlify)make_mac_tests)list_test_cases)Poly1305)AESChaCha20)tobytes)strxor_c@85d6be7857556d337f4452fe42d506a80103808afb0db2fd4abff6af4149f51bs"Cryptographic Forum Research Group a8061dc1305136c6c22b8baf0c0127a9RFC7539)@746869732069732033322d62797465206b657920666f7220506f6c7931333035@0000000000000000000000000000000000000000000000000000000000000000 49ec78090e481ec6c26b33b91ccc0307zIhttps://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-00#section-7 A)r48656c6c6f20776f726c6421 a6f745008f81c916a20dcc74eef2b2f0zIhttps://tools.ietf.org/html/draft-agl-tls-chacha20poly1305-00#section-7 B)r 6b657920666f7220506f6c7931333035Generated with pure Python)rFF f7e4e0ef4c46d106219da3d1bdaeb3ffr)rFF00 7471eceeb22988fc936da1d6e838b70er)r"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 32590bc07cb2afaccca3f67f122975fer)rڀ00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000zRFC7539 A.3 #1@0000000000000000000000000000000036e5f6b5c5e06070f0efca96227a863eswAny submission to the IETF intended by the Contributor for publication as all or part of an IETF Internet-Draft or RFC and any statement made within the context of an IETF activity is considered an "IETF Contribution". Such statements include oral statements in IETF sessions, as well as written and electronic communications made at any time or place, which are addressed to 36e5f6b5c5e06070f0efca96227a863ezRFC7539 A.3 #2@36e5f6b5c5e06070f0efca96227a863e00000000000000000000000000000000 f3477e7cd95417af89a6b8794c310cf0zRFC7539 A.3 #3)@1c9240a5eb55d38af333888604f6b5f0473917c1402b80099dca5cbc207075c02754776173206272696c6c69672c20616e642074686520736c6974687920746f7665730a446964206779726520616e642067696d626c6520696e2074686520776162653a0a416c6c206d696d737920776572652074686520626f726f676f7665732c0a416e6420746865206d6f6d65207261746873206f757467726162652e 4541669a7eaaee61e708dc7cbcc5eb62zRFC7539 A.3 #4)@0200000000000000000000000000000000000000000000000000000000000000 FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 03000000000000000000000000000000zRFC7539 A.3 #5)@02000000000000000000000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 02000000000000000000000000000000r)zRFC7539 A.3 #6)@0100000000000000000000000000000000000000000000000000000000000000`FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF11000000000000000000000000000000 05000000000000000000000000000000zRFC7539 A.3 #7)r,`FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFBFEFEFEFEFEFEFEFEFEFEFEFEFEFEFE01010101010101010101010101010101rzRFC7539 A.3 #8)r' FDFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF FAFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFzRFC7539 A.3 #9)^01 00 00 00 00 00 00 00 04 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00zE3 35 94 D7 50 5E 43 B9 00 00 00 00 00 00 00 0033 94 D7 50 5E 43 79 CD 01 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 0001 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00z/14 00 00 00 00 00 00 00 55 00 00 00 00 00 00 00zRFC7539 A.3 #10)r2zE3 35 94 D7 50 5E 43 B9 00 00 00 00 00 00 00 0033 94 D7 50 5E 43 79 CD 01 00 00 00 00 00 00 0000 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 13000000000000000000000000000000zRFC7539 A.3 #11@ec074c835580741701425b623235add6851fc40c3467ac0be05cc20404f3f700f3f6 f4c633c3044fc145f84f335cb81953dez)http://cr.yp.to/mac/poly1305-20050329.pdf fb447350c4e868c52ac3275cf9d4327e)ciphernonce@75deaa25c09f208e1dc4ce6b5cad3fbfa0f3080000f46400d0c7e9076c834403r dd3fab2251f11ac759f0887129cc2ee7 61ee09218d29b0aaed7e154a2c5509cc@6acb5f61a7176dd320c5c1eb2edcdc7448443d0bb0d21109c89a100b5ce2c208@663cea190ffb83d89593f3f476b6bc24d7e679107ea26adb8caf6652d0656136 0ee1c16bb73f0f4fd19881753c01cdbe ae212a55399729595dea458bc621ff0e@e1a5668a4d5b66a5f68cc5424ed5982d12976a08c4426d0ce8a82407c4f48207~ab0812724a7f1e342742cbed374d94d136c6b8795d45b3819830f2c04491faf0990c62e48b8018b2c3e4a0fa3134cb67fa83e158c994d961c4cb21095c1bf9 5154ad0d2cb26e01274fc51148491f1b 9ae831e743978d3a23527c7128149e3arFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF 13cc5bbadc36b03a5163928f0bcb65aazRFC7539 A.4 #1000000000000000000000000@0000000000000000000000000000000000000000000000000000000000000001 0baf33c1d6df211bdd50a6767e98e00azRFC7539 A.4 #2000000000000000000000002z^1c 92 40 a5 eb 55 d3 8a f3 33 88 86 04 f6 b5 f047 39 17 c1 40 2b 80 09 9d ca 5c bc 20 70 75 c0 e8b4c6db226cd8939e65e02eebf834cezRFC7539 A.4 #3a}f3 33 88 86 00 00 00 00 00 00 4e 91 00 00 00 0064 a0 86 15 75 86 1a f4 60 f0 62 c7 9b e6 43 bd5e 80 5c fd 34 5c f3 89 f1 08 67 0a c7 6c 8c b24c 6c fc 18 75 5d 43 ee a0 9e e9 4e 38 2d 26 b0bd b7 b7 3c 32 1b 01 00 d4 f0 3b 7f 35 58 94 cf33 2f 83 0e 71 0b 97 ce 98 c8 a8 4a bd 0b 94 8114 ad 17 6e 00 8d 33 bd 60 f9 82 b1 ff 37 c8 5597 97 a0 6e f4 f0 ef 61 c1 86 32 4e 2b 35 06 3836 06 90 7b 6a 7c 02 b0 f9 f6 15 7b 53 c8 67 e4b9 16 6c 76 7b 80 4d 46 a5 9b 52 16 cd e7 a4 e990 40 c5 a4 04 33 22 5e e2 82 a1 b0 a0 6c 52 3eaf 45 34 d7 f8 3f a1 15 5b 00 47 71 8c bc 54 6a0d 07 2b 04 b3 56 4e ea 1b 42 22 73 f5 48 27 1a0b b2 31 60 53 fa 76 99 19 55 eb d6 31 59 43 4ece bb 4e 46 6d ae 5a 10 73 a6 72 76 27 09 7a 1049 e6 17 d9 1d 36 10 94 fa 68 f0 ff 77 98 71 3030 5b ea ba 2e da 04 df 99 7b 71 4d 6c 6f 2c 29a6 ad 5c b4 02 2b 02 70 9b 00 00 00 00 00 00 000c 00 00 00 00 00 00 00 09 01 00 00 00 00 00 00z/ee ad 9d 67 89 0c bb 22 39 23 36 fe a1 85 1f 38z RFC7539 A.5000000000102030405060708cTeZdZdZdZdZdZdZdZdZ dZ d Z d Z d Z d Zd S)Poly1305Test_AES cFd}tj|jt}||jd|t |jd|| }|t |dtj|j|j|t}| }||j|j|||dS)Ndrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrkeyr8)rSr9datar8) rnewrSr assertEqual digest_sizelenr9updatedigest)selfrUh1d1h2d2s /builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/SelfTest/Hash/test_Poly1305.pytest_new_positivez"Poly1305Test_AES.test_new_positive;s \dhs 3 3 3 ,,, RX+++ YYt__ # # % % R"%%% \dhbhT# N N N YY[[ 28,,, R     cddlm}|ttj|jddt|ttj|j||ttj|jdt|ttjdt|ttj|jdt dS) Nr)DES3rRs111111111111111rSr9r8 22222222222222222222222222222222d2222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222rSrUr8) Crypto.Cipherre assertRaises ValueErrorrrVrSr TypeError)r\res ratest_new_negativez"Poly1305Test_AES.test_new_negativeJs&&&&&& *hl" cRRR *hlNNN *hl Z]^^^ )X\yMMM )X\txjY\]]]]]rccddg}tj|jt}||d|d|}tj|jt|j}||d|dz|}|||dS)Ns s,rRrrrSr8r9)rrVrSr rZr[r9rW)r\piecesr]r^r_r`s ra test_updatezPoly1305Test_AES.test_updateSs/ \dhs 3 3 3 &)##F1I... YY[[ \dhs"( C C C &)fQi'((( YY[[ R     rcctj|jt}|t |jddS)NrRstring)rrVrSr rlrnrZ)r\hs ratest_update_negativez%Poly1305Test_AES.test_update_negative^s8 LTXc 2 2 2 )QXy99999rcctj|jt}|}||||t|tddS)NrRsdigest) rrVrSr r[rW assertTrue isinstancetype)r\rvr[s ra test_digestzPoly1305Test_AES.test_digestbsm LTXc 2 2 2 V,,,  64 ??;;<<<<>>>>rcctj|jt}|}||t |d}|t|j|dS)NrR) rrVrSr r[verifyr rlrm)r\rvr wrong_macs ra test_verifyzPoly1305Test_AES.test_verifysc LTXc 2 2 2hhjj  S#&&  *ah :::::rcctj|jt}|}|||t|jddS)NrR4556)rrVrSr r hexverifyrlrm)r\rvrs ratest_hexverifyzPoly1305Test_AES.test_hexverifysW LTXc 2 2 2kkmm C *ak6:::::rccd}tj|j|t}|}t |j}t |}tj|j|t|j}tj||t|j}d|dd<d|dd<||||||t |}tj|jt}tj|jt|j}||||d|dd<|||dS) NrjrSrUr8r9rrRrq) rrVrSr r[ bytearrayr9rWrZ)r\rUh0d_refkey_badata_bar]r_s ratest_bytearrayzPoly1305Test_AES.test_bytearraysk \dhT# > > > 48$$D// \dhT#RX N N N \f73bh O O Orr   e,,, e,,,D// \dhs 3 3 3 \dhs"( C C C $ '  biikk22222rccd}d}d}||fD]s}||j}||}tj|j|t}tj||t|j}|jsd|dd<d|dd<|||||}tj|jt}tj|jt|j }|||||jsd|dd<|||udS) Nrc t|SN) memoryviewrUs ra get_mv_roz3Poly1305Test_AES.test_memoryview..get_mv_rosd## #rcc:tt|Sr)rrrs ra get_mv_rwz3Poly1305Test_AES.test_memoryview..get_mv_rwsioo.. .rcrjrrrrRrq) rSrrVr r9readonlyrWr[rZ) r\rUrrget_mvkey_mvdata_mvr]r_s ratest_memoryviewz Poly1305Test_AES.test_memoryviews $ $ $ / / /!), 7 7FVDH%%FfTllG$(cBBBB&ws$&H...B# %% $rr   RYY[["))++ 6 6 6fTllG$(3777B$(3bhGGGB IIdOOO IIg   # &%   RYY[["))++ 6 6 6 63 7 7rcN)__name__ __module__ __qualname__rSrbrorsrwr|rrrrrrrcrarNrN7s C ! ! !^^^ ! ! !:::===888 ? ? ?;;;;;; 333:#7#7#7#7#7rcrNceZdZdZdZdZdS)Poly1305Test_ChaCha20rOcd}tj|jt}||jd|t |jdtj|jtd}|t |jd||jddS)NrQrRrT s88888888rq)rrVrSr rWrXrYr9)r\rUr]r_s rarbz'Poly1305Test_ChaCha20.test_new_positives \dhx 8 8 8 ,,, RX+++ \dhx J J J RX*** 8,,,,,rccl|ttj|jdt dS)Ns1111111rg)rlrmrrVrSr )r\s raroz'Poly1305Test_ChaCha20.test_new_negatives, *hlYabbbbbrcN)rrrrSrbrorrcrarrs< C - - -cccccrcrc$eZdZedZdS) Poly1305_Newct|}t|dkr |d|d<||d<tjdi|S)NrrrUrSr)dictrYrrV)rSrUkwds_kwdss rarVzPoly1305_New.newsHT  t99>> GE&Me |$$e$$$rcNrrr staticmethodrVrrcrarrs-%%\%%%rcrc$eZdZedZdS)Poly1305_Basiccddlm}t|dkr |d}nd}||dd|dd|S)Nr) Poly1305_MACrrT)Crypto.Hash.Poly1305rrY)rSrUrrrs rarVzPoly1305_Basic.newsW555555 t99>>q'CCC|CHc"##h444rcNrrrcrarrs-55\555rcrceZdZdZdS)Poly1305AES_MCctd}d}tdD]o}|t|dz}|ddd}|dkr|t|dz}t j||t |}|}p|d| dS) Ns fb447350c4e868c52ac3275cf9d4327ercirr)rSr9r8rU CDFA436DDD629C7DC20E1128530BAED2) rranger r rrVr r[rWrupper)r\tagrmsg_lenrSr9auths rarunTestzPoly1305AES_MC.runTests;<<X  Gd+++C"IE{{GCFOO+: G GE ^L*m D DDE ^L*6H I IIE ~ !!E _- . ..E _2 3 33E Lrc__main__cBtjtSr)unittest TestSuiterrrcrarsH&y{{33rcsuite) defaultTest)"__doc__jsonrbinasciirrcommonrCrypto.SelfTest.st_commonr Crypto.Hashrrkr r Crypto.Util.py3compatr Crypto.Util.strxorr decoderrrTestCaserNrobjectrrrrrrmainrrcrars5D0/ ''''''''""""""555555 ''''''''))))))'''''' K566==??*         K   0FHH*9> K   0FHH*9<      Ek` K*3 *L M MOO  K *3 *L M MOO  K +*3 *L M MOO  K ) +3 *L M MOO /! J *YYy%9%9;;  *YY/?%@%@BB  :*YY/?%@%@BB  : :& :YY/I%J%JLL1/1hU7U7U7U7U7x(U7U7U7pcccccH-ccc0%%%%%6%%% 5 5 5 5 5V 5 5 5WWWWWX&WWW$ z 3 3EHMg&&&&&&rc