hyb
2026-01-30 15bc7727b58bf9ca0c8f21702fa893daac232b8d
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
Ë
ž¬`i@"ãóŽ—ddlZddlZddlZddlZddlZddlZddlmZddlmZ    ddl    Z    dZ
d„Z d„Z iiifd„Zy#e $rdZ
YŒwxYw)    éN)Ú    unhexlify)ÚFileNotFoundErrorTFcó:—d}g}Gd„dt«}d}d}d}        |dz }|j«}
|
s||j|«    |S|
j«}
|
j    d«s|
sd}    ŒT|
j    d«r'||j|«d}|j|
«ŒŒ|    r(|dz }d    }    ||j|«|d
||fz|«}t j d |
«} | s|xj|
gz c_nœ| jd«j«} | jd «j«} |j| d«}|€7t| «d zdk7rd | z} t|| tj| ««nt|| || ««Œ‚)z×Load and parse a test vector file
 
    Return a list of objects, one per group of adjacent
    KV lines or for a single line in the form "[.*]".
 
    For a group of lines, the object has one attribute per line.
    rcó—eZdZd„Zy)ú_load_tests.<locals>.TestVectorcó.—||_||_g|_y)N)ÚdescÚcountÚothers)ÚselfÚ descriptionr
s   õiH:\项目\archive\测试组\脚本\Change_password\venv_build\Lib\site-packages\Crypto/SelfTest/loader.pyÚ__init__z(_load_tests.<locals>.TestVector.__init__=s€Ø#ˆDŒI؈DŒJ؈DKóN)Ú__name__Ú
__module__Ú __qualname__r©rrÚ
TestVectorr<s„ó    rrNTéú#ú[Fz%s (#%d)z([A-Za-z0-9]+) = ?(.*)éÚ0)ÚobjectÚreadlineÚappendÚstripÚ
startswithÚreÚmatchr ÚgroupÚlowerÚgetÚlenÚsetattrÚbinasciir)Ú    dir_compsÚfile_inr Ú conversionsÚ line_numberÚresultsrÚ test_vectorr
Ú    new_groupÚlineÚresÚtokenÚdataÚ
conversions               rÚ _load_testsr40s§€ð€KØ€Gô”Vôð €KØ €EØ€Ià
ؐqш Ø×ÑÓ!ˆÙØÐ&Ø—‘˜{Ô+Ø ðL €NðKz‰z‹|ˆð ?‰?˜3Ô ¡t؈IØ à ?‰?˜3Ô ØÐ&Ø—‘˜{Ô+؈KØ N‰N˜4Ô  Ø á Ø Q‰JˆE؈IØÐ&Ø—‘˜{Ô+Ù$ Z°;ÀÐ2FÑ%FÈÓNˆKäh‰hÐ/°Ó6ˆÙØ × Ò  4 &Ñ (Ö à—I‘I˜a“L×&Ñ&Ó(ˆEØ—9‘9˜Q“<×%Ñ%Ó'ˆDà$Ÿ™¨°Ó5ˆJØÐ!ܐt“9˜q‘= AÒ%Ø ™:Dܘ  U¬H×,>Ñ,>¸tÓ,DÕEä˜  U©J°tÓ,<Ô=ñS rcó2—d}    ts<ttjt    j
tj«|«‚|›d|›d}tj jtj«}tj jt    j j|g|¢­Ž|«}t|«5}t||||«}ddd«|S#1swY|SxYw#t$r#tjd|ztd¬«Y|SwxYw)a²Load and parse a test vector file, formatted using the NIST style.
 
    Args:
        dir_comps (list of strings):
          The path components under the ``pycryptodome_test_vectors`` package.
          For instance ``("Cipher", "AES")``.
        file_name (string):
          The name of the file with the test vectors.
        description (string):
          A description applicable to the test vectors in the file.
        conversions (dictionary):
          The dictionary contains functions.
          Values in the file that have an entry in this dictionary
          will be converted usign the matching function.
          Otherwise, values will be considered as hexadecimal and
          converted to binary.
 
    Returns:
        A list of test vector objects.
 
    The file is formatted in the following way:
 
    - Lines starting with "#" are comments and will be ignored.
    - Each test vector is a sequence of 1 or more adjacent lines, where
      each lines is an assignement.
    - Test vectors are separated by an empty line, a comment, or
      a line starting with "[".
 
    A test vector object has the following attributes:
 
    - desc (string): description
    - counter (int): the order of the test vector in the file (from 1)
    - others (list): zero or more lines of the test vector that were not assignments
    - left-hand side of each assignment (lowercase): the value of the
      assignement, either converted or bytes.
    Nz test (ú)ú%Warning: skipping extended tests for r©Ú
stacklevel)Útest_vectors_availablerÚerrnoÚENOENTÚosÚstrerrorÚpathÚdirnameÚpycryptodome_test_vectorsÚ__file__ÚjoinÚopenr4ÚwarningsÚwarnÚ UserWarning)r(Ú    file_namer r*r,Úinit_dirÚfull_file_namer)s        rÚload_test_vectorsrKusï€ðL€Gð$Ý%Ü#¤E§L¡LÜ$&§K¡K´· ± Ó$=Ø$-ó/ð /ò)4²YÐ?ˆ ä—7‘7—?‘?Ô#<×#EÑ#EÓFˆÜŸ™Ÿ™¤b§g¡g§l¡l°8Ð&H¸iÒ&HÈ)ÓTˆÜ .Ó !ð    P WÜ! )¨W°kÀ;ÓOˆG÷    Pð €N÷    Pð €Nûô ò$܏ ‰ Ð=À ÑKÜ!Ø!"ö    $ð €Nð $ús0„CC*ÃCÃC*ÃC'Ã"C*Ã'C*Ã*(DÄDc óÊ—g}    ts<ttjt    j
tj«|«‚tj jtj«}tj jt    j j|g|¢­Ž|«}t|«5}    tj|    «}
ddd«Gd„dt"«} hd£} | t%|j'««z} i} |j)«D]\}}|
«| |<Œ
dD]9}i}|j)«D]\}}||«||<Œ|dD]}| «}| j)«D]\}}t+|||«Œ|j)«D]\}}t+|||«Œ|d    |_|d
|_| D]!}||vsŒ    t+||t1||««Œ#||_|j)«D]\}}t+||||««Œ|ddk7|_|ddk(|_|j?d«|_ ||_|jC|«Œ Œ<|S#1swYŒ¢xYw#t$r$tjd|zt d¬«|cYSwxYw#t2j4$r t7d |›d |j,›d |›d«‚wxYw)Nr7rr8có —eZdZy)ú0load_test_vectors_wycheproof.<locals>.TestVectorN)rrrrrrrrNÇs„Ø rr>ÚctÚivÚaadÚikmÚkeyÚmsgÚokmÚsigÚtagÚinfoÚsaltÚlabelÚpublicÚsharedÚ
testGroupsÚtestsÚtcIdÚcommentzError decoding attribute 'z' (tcId=z, file r6ÚresultÚinvalidÚ
acceptableÚflags)"r:rr;r<r=r>r?r@rArBrCrDÚjsonÚloadrErFrGrÚsetÚkeysÚitemsr&Úidr`rr'ÚErrorÚ
ValueErrorÚfilenameÚvalidÚwarningr$rdr)r(rHr Úroot_tagÚ    group_tagÚunit_tagrarIrJr)Útv_treerÚ unit_attr_hexÚ common_rootÚkÚvr"Ú common_groupÚtestÚtvÚattrs                     rÚload_test_vectors_wycheproofr|²sØ€ð€FðÝ%Ü#¤E§L¡LÜ$&§K¡K´· ± Ó$=Ø$-ó/ð /ô—7‘7—?‘?Ô#<×#EÑ#EÓFˆÜŸ™Ÿ™¤b§g¡g§l¡l°8Ð&H¸iÒ&HÈ)ÓTˆÜ .Ó !ð    ) WÜ—i‘i Ó(ˆG÷    )ô ”Vô ò €Mð”S˜Ÿ™›Ó)Ñ)€Mà€KØ—‘Ó ò$‰ˆˆ1Ù˜7›ˆ AŠð$ð˜Ñ&ó!ˆàˆ Ø—O‘OÓ%ò    '‰DˆAˆqÙ ›hˆL˜ŠOð    'ð˜'‘Nó    ˆDÙ“ˆBà#×)Ñ)Ó+ò "‘1ܘ˜A˜qÕ!ð "à$×*Ñ*Ó,ò "‘1ܘ˜A˜qÕ!ð "ð˜‘LˆBŒEؘi™ˆBŒJØ%ò xØ˜4’<ðxÜ  D¬)°D¸±JÓ*?Õ@ð xð $ˆBŒKà Ÿ™Ó(ò (‘1ܘ˜A™q ›wÕ'ð (ð˜H‘~¨Ñ2ˆBŒHؘh™¨<Ñ7ˆBŒJØ—x‘x Ó(ˆBŒHà#ˆBŒKà M‰M˜"Ö ò7    ð !ðF €M÷w    )ñ    )ûô ò܏ ‰ Ð=À ÑKÜ!Ø!"õ    $ðŠ ð    ûôR$Ÿ>™>òxÝ(Ò_cÐeg×ejÓejÒluÐ)vÓwÐwðxús6„B8I?Â<I2ÃI?ÇJ/É2I<É7I?É?*J,Ê+J,Ê/3K"    )r=r rer;r'rErÚCrypto.Util.py3compatrrAr:Ú ImportErrorr4rKr|rrrú<module>rsaðó>
Û    Û Û ÛÛÝÝ3ð#Û$Ø!Ðò
BòJ:ð|+-¸ÀRôGøðMò#Ø"Òð#ús¦:ºAÁA