+
    @iM                     x   ^ RI t ^ RIHt  ^ RIt^ RIt^ RIHt	 ^ RI
HtHt ^ RIt^RIHt ^RIHtHt ^RIHtHtHtHtHtHtHtHtHtHtHtHt  ! R R]P@                  4      t! ! R	 R
]P@                  4      t" ! R R]P@                  4      t# ! R R]P@                  4      t$ ! R R]P@                  4      t% ! R R]P@                  4      t& ! R R]P@                  4      t' ! R R]P@                  4      t( ! R R]P@                  4      t) ! R R]P@                  4      t* ! R R]P@                  4      t+ ! R R]P@                  4      t,]	PZ                  ^R,          ^23R  l4       t./ t/R!]P`                  9   d   ^]/R"&   ]! R'/ ]/B ]! ].! 4       4      R# 4       4       t1R$ t2R% t3R& t4R#   ] d	    ^ RIt ELi ; i)(    N)hexlify)givensettings)str_idx_as_int)NIST256pNIST224p)remove_integerUnexpectedDERread_lengthencode_bitstringremove_bitstringremove_object
encode_oidremove_constructedremove_implicitremove_octet_stringremove_sequenceencode_implicitc                   b   a  ] tR t^ t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tRtV tR# )TestRemoveIntegerc                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    NassertRaisesr
   r	   selfs   &L/var/www/html/photoedit/myenv/lib/python3.14/site-packages/ecdsa/test_der.pytest_non_minimal_encoding+TestRemoveInteger.test_non_minimal_encoding#   s+    }--./ .---	   4A	c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   Nr   r   s   &r   test_negative_with_high_bit_set1TestRemoveInteger.test_negative_with_high_bit_set'   s*    }--?+ .---r   c                h    \        R 4      w  rV P                  V^4       V P                  VR4       R# s        Nr	   assertEqualr   valrems   &  r   test_minimal_with_high_bit_set0TestRemoveInteger.test_minimal_with_high_bit_set+   s/    !"56d#c"r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s     Nr   r   s   &r   %test_two_zero_bytes_with_high_bit_set7TestRemoveInteger.test_two_zero_bytes_with_high_bit_set1   s+    }--23 .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r   s   &r   test_zero_length_integer*TestRemoveInteger.test_zero_length_integer5   s*    }--;' .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; ir%   Nr   r   s   &r   test_empty_string#TestRemoveInteger.test_empty_string9   s*    }--3 .---r   c                h    \        R 4      w  rV P                  V^ 4       V P                  VR4       R# )s    r%   Nr&   r(   s   &  r   test_encoding_of_zero'TestRemoveInteger.test_encoding_of_zero=   s.    !/2a c"r%   c                h    \        R 4      w  rV P                  V^4       V P                  VR4       R# )s   r%   Nr&   r(   s   &  r   test_encoding_of_127&TestRemoveInteger.test_encoding_of_127C   s.    !/2c"c"r%   c                h    \        R 4      w  rV P                  V^4       V P                  VR4       R# r$   r&   r(   s   &  r   test_encoding_of_128&TestRemoveInteger.test_encoding_of_128I   s/    !"56c"c"r%   c                    V P                  \        4      ;_uu_ 4       p\        R 4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s    Nzwanted type 'integer'r   r
   r	   assertInstr	exceptionr   es   & r   test_wrong_tag TestRemoveInteger.test_wrong_tagO   sF    }--./ . 	-s1;;/?@ .-   AA)	c                    V P                  \        4      ;_uu_ 4       p\        R 4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s    NLength longerrA   rE   s   & r   test_wrong_length#TestRemoveInteger.test_wrong_lengthU   sE    }--./ . 	os1;;'78 .-rI    N)__name__
__module____qualname____firstlineno__r   r!   r+   r.   r1   r5   r8   r;   r>   rG   rL   __static_attributes____classdictcell____classdict__s   @r   r   r       sB     0,#4( ###A9 9r%   r   c                   V   a  ] tR t^\t o R tR tR tR tR tR t	R t
R tR	 tR
tV tR# )TestReadLengthc                <    V P                  R\        R4      4       R# )r       N)r      r'   r   r   s   &r   test_zero_lengthTestReadLength.test_zero_length`   s    W!56r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r
   r   r   s   &r   test_two_byte_zero_length(TestReadLength.test_two_byte_zero_lengthc   *    }--$ .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   Nr`   r   s   &r   test_two_byte_small_length)TestReadLength.test_two_byte_small_lengthg   rc   r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)   Nr`   r   s   &r   test_long_form_with_zero_length.TestReadLength.test_long_form_with_zero_lengthk   s*    }--  .---r   c                <    V P                  R\        R4      4       R# )   s   N)rl      r\   r   s   &r   test_smallest_two_byte_length,TestReadLength.test_smallest_two_byte_lengtho   s    ;{#;<r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr`   r   s   &r   test_zero_padded_length&TestReadLength.test_zero_padded_lengthr   *    }--( .---r   c                <    V P                  R\        R4      4       R# )   s    N)ru      r\   r   s   &r   test_two_three_byte_length)TestReadLength.test_two_three_byte_lengthv   s    ;#?@r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; ir4   r`   r   s   &r   r5    TestReadLength.test_empty_stringy   s*    }-- .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr`   r   s   &r   test_length_overflow#TestReadLength.test_length_overflow}   rs   r   rN   N)rO   rP   rQ   rR   r]   ra   re   ri   rn   rq   rw   r5   r|   rS   rT   rU   s   @r   rX   rX   \   s8     7%%!=)A) )r%   rX   c                   P   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	tV tR
# )TestEncodeBitstringc                   \         P                  ! R4       \        P                  ! \        4      ;_uu_ 4       p\        R4      pRRR4       V P                  \        X4      ^4       V P                  RV^ ,          P                  P                  ^ ,          4       V P                  XR4       R#   + '       g   i     Ls; i)z(This is the old way to use the function.always    Nzunused= needs to be specified    )warningssimplefilterpytestwarnsDeprecationWarningr   r'   lenrB   messageargs)r   r   ders   &  r   test_old_call_convention,TestEncodeBitstring.test_old_call_convention   s    h'\\,--";/C . 	UQ'+U1X-=-=-B-B1-E	
 	12 .-s   B00C 	c                    \         P                  ! 4       ;_uu_ 4        \         P                  ! R4       \        R^ 4      pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)z$This is how it should be called now.error   Nr   r   catch_warningsr   r   r'   r   r   s   & r   test_new_call_convention,TestEncodeBitstring.test_new_call_convention   sN     $$&&!!'*"7A.C ' 	12	 '&   #AA-	c                    \         P                  ! 4       ;_uu_ 4        \         P                  ! R4       \        RR4      pRRR4       V P	                  XR4       R#   + '       g   i     L$; i)zE
Writing bit string with already included the number of unused bits.
r   r   Nr   r   r   s   & r   test_implicit_unused_bits-TestEncodeBitstring.test_implicit_unused_bits   sN    
 $$&&!!'*";5C ' 	12	 '&r   c                B    \        R ^4      pV P                  VR4       R# )s   s   N)r   r'   r   s   & r   test_explicit_unused_bits-TestEncodeBitstring.test_explicit_unused_bits   s    {A.56r%   c                >    V P                  \        R ^ 4      R4       R# )r%   s    N)r'   r   r   s   &r   r5   %TestEncodeBitstring.test_empty_string   s    )#q1?Cr%   c                    V P                  \        4      ;_uu_ 4        \        R ^4       RRR4       R#   + '       g   i     R# ; i)s    Nr   
ValueErrorr   r   s   &r   test_invalid_unused_count-TestEncodeBitstring.test_invalid_unused_count   s,    z**[!, +***	   5A	c                    V P                  \        4      ;_uu_ 4        \        R ^4       RRR4       R#   + '       g   i     R# ; ir4   r   r   s   &r   %test_invalid_unused_with_empty_string9TestEncodeBitstring.test_invalid_unused_with_empty_string   s,    z**S!$ +***r   c                    V P                  \        4      ;_uu_ 4        \        R ^4       RRR4       R#   + '       g   i     R# ; i)r   Nr   r   s   &r   test_non_zero_padding_bits.TestEncodeBitstring.test_non_zero_padding_bits   s,    z**Wa( +***r   rN   N)rO   rP   rQ   rR   r   r   r   r   r5   r   r   r   rS   rT   rU   s   @r   r   r      s3     33	37
D-%) )r%   r   c                   h   a  ] tR t^t o R tR tR tR tR tR t	R t
R tR	 tR
 tR tR tRtV tR# )TestRemoveBitstringc                   \         P                  ! R4       \        P                  ! \        4      ;_uu_ 4       p\        R4      w  r#RRR4       V P                  \        X4      ^4       V P                  RV^ ,          P                  P                  ^ ,          4       V P                  XR4       V P                  XR4       R#   + '       g   i     L; i)z)This is the old way to call the function.r   r   Nz$expect_unused= needs to be specifiedr   r%   )r   r   r   r   r   r   r'   r   rB   r   r   )r   r   bitsrests   &   r   r   ,TestRemoveBitstring.test_old_call_convention   s    h'\\,--)*=>JD . 	UQ'2E!H4D4D4I4I!4L	
 	{+s# .-s   CC	c                   \         P                  ! 4       ;_uu_ 4        \         P                  ! R 4       \        R^ 4      w  rRRR4       V P	                  XR4       V P	                  XR4       R#   + '       g   i     L6; i)r   r   Nr   r%   r   r   r   r   r'   r   r   r   s   &  r   r   ,TestRemoveBitstring.test_new_call_convention   s^    $$&&!!'*)*=qAJD ' 	w's# '&   %A11B	c                   \         P                  ! 4       ;_uu_ 4        \         P                  ! R 4       \        RR4      w  rRRR4       V P	                  XR4       V P	                  XR4       R#   + '       g   i     L6; i)r   r   Nr%   )r   r   r   r   s   &  r   test_implicit_unexpected_unused3TestRemoveBitstring.test_implicit_unexpected_unused   s^    $$&&!!'*)*=tDJD ' 	|,s# '&r   c                j    \        R R4      w  rV P                  VR4       V P                  VR4       R# )s   Nr%   )      )r   r'   )r   retr   s   &  r   test_with_padding%TestRemoveBitstring.test_with_padding   s1    $%8$?	l+s#r%   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r
   r   r   s   &r   test_not_a_bitstring(TestRemoveBitstring.test_not_a_bitstring   -    }--0$7 .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r   s   &r   test_empty_encoding'TestRemoveBitstring.test_empty_encoding   s,    }--[$/ .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; ir4   r   r   s   &r   r5   %TestRemoveBitstring.test_empty_string   s,    }--S$' .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)   Nr   r   s   &r   test_no_length"TestRemoveBitstring.test_no_length   s,    }--Wd+ .---r   c                    V P                  \        4      ;_uu_ 4        \        R ^4       RRR4       R#   + '       g   i     R# ; i)r   Nr   r   s   &r   %test_unexpected_number_of_unused_bits9TestRemoveBitstring.test_unexpected_number_of_unused_bits   s-    }--0!4 .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r   s   &r   $test_invalid_encoding_of_unused_bits8TestRemoveBitstring.test_invalid_encoding_of_unused_bits   s-    }--4d; .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)s   Nr   r   s   &r   %test_invalid_encoding_of_empty_string9TestRemoveBitstring.test_invalid_encoding_of_empty_string   s,    }--_d3 .---r   c                    V P                  \        4      ;_uu_ 4        \        R R4       RRR4       R#   + '       g   i     R# ; i)s   Nr   r   s   &r   test_invalid_padding_bits-TestRemoveBitstring.test_invalid_padding_bits   r   r   rN   N)rO   rP   rQ   rR   r   r   r   r   r   r   r5   r   r   r   r   r   rS   rT   rU   s   @r   r   r      sF     $$$$80(,5<48 8r%   r   c                   2   a  ] tR tRt o R tR tR tRtV tR# )TestStrIdxAsInti  c                >    V P                  ^s\        R^ 4      4       R# )s   rC   Nr'   r   r   s   &r   test_strTestStrIdxAsInt.test_str  s    nUA67r%   c                >    V P                  ^s\        R^ 4      4       R# r   s   strNr   r   s   &r   
test_bytesTestStrIdxAsInt.test_bytes  s    nVQ78r%   c                P    V P                  ^s\        \        R4      ^ 4      4       R# r   )r'   r   	bytearrayr   s   &r   test_bytearrayTestStrIdxAsInt.test_bytearray  s    nYv->BCr%   rN   N)	rO   rP   rQ   rR   r   r   r   rS   rT   rU   s   @r   r   r     s     89D Dr%   r   c                   \   a  ] tR tRt o R tR tR tR tR tR t	R t
R	 tR
 tR tRtV tR# )TestEncodeOidi  c                \    \        ^^RR^^4      pV P                  \        V4      R4       R# )r[   H  ='  s   06072a8648ce3d0201N)r   r'   r   )r   oid_ecPublicKeys   & r   test_pub_key_oidTestEncodeOid.test_pub_key_oid  s,    $Q3q!<13HIr%   c                X    V P                  \        \        P                  4      R 4       R# )s   06052b81040021N)r'   r   r   encoded_oidr   s   &r   test_nist224p_oidTestEncodeOid.test_nist224p_oid  s    !5!568IJr%   c                X    V P                  \        \        P                  4      R 4       R# )s   06082a8648ce3d030107N)r'   r   r   r   r   s   &r   test_nist256p_oidTestEncodeOid.test_nist256p_oid  s!    H(()+B	
r%   c                D    \        ^R^4      pV P                  VR4       R# )rm        7Nr   r'   r   oids   & r   test_large_second_subid%TestEncodeOid.test_large_second_subid  s!    C#56r%   c                B    \        ^R4      pV P                  VR4       R# )rm   r      7Nr   r   s   & r   test_with_two_subids"TestEncodeOid.test_with_two_subids!  s    C 12r%   c                B    \        ^ ^ 4      pV P                  VR4       R# )r       Nr   r   s   & r   test_zero_zeroTestEncodeOid.test_zero_zero%  s    Ao.r%   c                    V P                  \        \        34      ;_uu_ 4        \        ^ R4       RRR4       R#   + '       g   i     R# ; i)r   N)r   	TypeErrorAssertionErrorr   r   s   &r   test_with_wrong_types#TestEncodeOid.test_with_wrong_types)  s1    	>:;;q$ <;;;s	   ;A	c                    V P                  \        4      ;_uu_ 4        \        ^^(4       RRR4       R#   + '       g   i     R# ; i)r[   Nr   r
  r   r   s   &r   "test_with_small_first_large_second0TestEncodeOid.test_with_small_first_large_second-  ,    ~..q" /...r   c                B    \        ^^'4      pV P                  VR4       R# )r[   s   ONr   r   s   & r   test_small_first_max_second)TestEncodeOid.test_small_first_max_second1  s    Bo.r%   c                    V P                  \        4      ;_uu_ 4        \        ^^'4       RRR4       R#   + '       g   i     R# ; i)rv   Nr  r   s   &r   test_with_invalid_first%TestEncodeOid.test_with_invalid_first5  r  r   rN   N)rO   rP   rQ   rR   r   r   r   r   r  r  r  r  r  r  rS   rT   rU   s   @r   r   r     s>     JK

7
3/ / r%   r   c                      a  ] tR tRt o ]R 4       tR tR tR tR t	R t
R tR	 tR
 tR tR tR tR tR tR tRtV tR# )TestRemoveObjecti:  c                0    \        ^^RR^^4      V n        R# )r[   r   r   N)r   r   clss   &r   
setUpClassTestRemoveObject.setUpClass;  s    (AsE1a@r%   c                |    \        V P                  4      w  rV P                  VR 4       V P                  VR4       R# )r%   Nr[   rm   r   r   rm   r[   r   r   r'   r   r   r   s   &  r   r   !TestRemoveObject.test_pub_key_oid?  s5    !$"6"67	s#67r%   c                    \        V P                  R ,           4      w  rV P                  VR 4       V P                  VR4       R# )s   moreNr   r!  r"  s   &  r   test_with_extra_bytes&TestRemoveObject.test_with_extra_bytesD  s:    !$"6"6"@A	w'67r%   c                h    \        R 4      w  rV P                  VR4       V P                  VR4       R# )r   r%   N)rm   r   rv   r   r'   r"  s   &  r   test_with_large_second_subid-TestRemoveObject.test_with_large_second_subidI  s/    !"9:	s#k*r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr   r
   r   r   s   &r   test_with_padded_first_subid-TestRemoveObject.test_with_padded_first_subidO  +    }---. .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   7Nr,  r   s   &r   test_with_padded_second_subid.TestRemoveObject.test_with_padded_second_subidS  s+    }--56 .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   7Nr,  r   s   &r   )test_with_missing_last_byte_of_multi_byte:TestRemoveObject.test_with_missing_last_byte_of_multi_byteW  s+    }--12 .---r   c                h    \        R 4      w  rV P                  VR4       V P                  VR4       R# )r  r%   N)rm   r   r(  r"  s   &  r   r  %TestRemoveObject.test_with_two_subids[  s/    !"56	s#h'r%   c                h    \        R 4      w  rV P                  VR4       V P                  VR4       R# )r  r%   N)r   r   r(  r"  s   &  r   r  TestRemoveObject.test_zero_zero`  s.    !/2	s#f%r%   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; ir4   r,  r   s   &r   r5   "TestRemoveObject.test_empty_stringe  s*    }--# .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)   Nr,  r   s   &r   test_missing_length$TestRemoveObject.test_missing_lengthi  s*    }--'" .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s    Nr,  r   s   &r   test_empty_oidTestRemoveObject.test_empty_oidm  *    }--+& .---r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   Nr,  r   s   &r   test_empty_oid_overflow(TestRemoveObject.test_empty_oid_overflowq  rC  r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   7Nr,  r   s   &r   test_with_wrong_type%TestRemoveObject.test_with_wrong_typeu  r/  r   c                    V P                  \        4      ;_uu_ 4        \        R 4       RRR4       R#   + '       g   i     R# ; i)s   7Nr,  r   s   &r   test_with_too_long_length*TestRemoveObject.test_with_too_long_lengthy  r/  r   rN   N)rO   rP   rQ   rR   classmethodr  r   r%  r)  r-  r1  r4  r  r  r5   r>  rA  rE  rH  rK  rS   rT   rU   s   @r   r  r  :  sd     A A8
8
+/73(
&
#''// /r%   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestRemoveConstructedi~  c                    R p\        V4      w  r#pV P                  V^4       V P                  VR4       V P                  VR4       R# )s      r%   N)r   r'   r   datatagbodyr   s   &    r   test_simple!TestRemoveConstructed.test_simple  sE    ",T24d#{+s#r%   c                    R pV P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s   Nzconstructed tag)r   r
   r   rB   rC   rD   r   rS  rF   s   &  r   test_with_malformed_tag-TestRemoveConstructed.test_with_malformed_tag  sJ    "}--t$ . 	'Q[[)9: .-   AA+	rN   NrO   rP   rQ   rR   rV  rZ  rS   rT   rU   s   @r   rO  rO  ~  s     $; ;r%   rO  c                   `   a  ] tR tRt o ]R 4       tR tR tR tR t	R t
R tR	 tR
 tRtV tR# )TestRemoveImpliciti  c                L    ^V n         RV n        RV n        RV n        RV n        R# )      
   F
   
   
N)exp_tagexp_datadata_applicationdata_context_specificdata_privater  s   &r   r  TestRemoveImplicit.setUpClass  s(    "2$7!.r%   c                    \        V P                  4      w  rpV P                  WP                  4       V P                  W P                  4       V P                  VR 4       R# r4   r   ri  r'   rf  rg  r   rT  rU  r   s   &   r   rV  TestRemoveImplicit.test_simple  sJ    )$*D*DE4ll+}}-s#r%   c                    V P                  \        4      ;_uu_ 4       p\        V P                  R 4       RRR4       V P	                  R\        XP                  4      4       R#   + '       g   i     L7; i)foobarNzinvalid `exp_class` value)r   r   r   ri  rB   rC   rD   rE   s   & r   test_wrong_expected_class,TestRemoveImplicit.test_wrong_expected_class  sM    z**aD66A + 	13q{{3CD +*   A$$A4	c                    V P                  \        4      ;_uu_ 4       p\        V P                  4       R R R 4       V P	                  R\        XP                  4      4       R #   + '       g   i     L7; i)Nz+wanted class context-specific, got 0x46 tag)r   r
   r   rh  rB   rC   rD   rE   s   & r   test_with_wrong_class(TestRemoveImplicit.test_with_wrong_class  sM    }--D112 . 	93q{{;K	
 .-s   A##A3	c                    \        V P                  R 4      w  rpV P                  WP                  4       V P                  W P                  4       V P                  VR4       R# )applicationr%   N)r   rh  r'   rf  rg  rn  s   &   r   test_with_application_class.TestRemoveImplicit.test_with_application_class  sL    )$*?*?O4ll+}}-s#r%   c                    \        V P                  R 4      w  rpV P                  WP                  4       V P                  W P                  4       V P                  VR4       R# )privater%   N)r   rj  r'   rf  rg  rn  s   &   r   test_with_private_class*TestRemoveImplicit.test_with_private_class  sL    )$*;*;YG4ll+}}-s#r%   c                    R p\        V P                  V,           4      w  r#pV P                  W P                  4       V P                  W0P                  4       V P                  WA4       R# )s    Nrm  )r   
extra_datarT  rU  r   s   &    r   test_with_data_following+TestRemoveImplicit.test_with_data_following  sW     
)&&3
4 	ll+}}-*r%   c                    R pV P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s   
Nz#wanted type primitive, got 0xa6 tag)r   r
   r   rB   rC   rD   rY  s   &  r   test_with_constructed(TestRemoveImplicit.test_with_constructed  sJ    "}--D! . 	;S=MN .-r\  c                    R p\        \        ^VR4      R4      w  r#pV P                  V^4       V P                  W14       V P                  VR4       R# )s   some longish stringry  r%   N)r   r   r'   rR  s   &    r   test_encode_decode%TestRemoveImplicit.test_encode_decode  sS    %)At]3]
4 	a $s#r%   rN   N)rO   rP   rQ   rR   rM  r  rV  rr  rv  rz  r~  r  r  r  rS   rT   rU   s   @r   r_  r_    sF     / /$E
$$	+O	$ 	$r%   r_  c                   T   a  ] tR tRt o ]R 4       tR tR tR tR t	R t
R tR	tV tR
# )TestEncodeImpliciti  c                >    R V n         RV n        RV n        RV n        R# )rb  rc  rd  re  N)rS  rh  ri  rj  r  s   &r   r  TestEncodeImplicit.setUpClass  s!    2$7!.r%   c                h    \        ^V P                  4      pV P                  WP                  4       R# )ra  Nr   rS  r'   ri  r   r   s   & r   test_encode_with_default_class1TestEncodeImplicit.test_encode_with_default_class  s&    a+889r%   c                j    \        ^V P                  R4      pV P                  WP                  4       R# )ra  ry  N)r   rS  r'   rh  r  s   & r   "test_encode_with_application_class5TestEncodeImplicit.test_encode_with_application_class  s(    aM:334r%   c                j    \        ^V P                  R4      pV P                  WP                  4       R# )ra  zcontext-specificNr  r  s   & r   'test_encode_with_context_specific_class:TestEncodeImplicit.test_encode_with_context_specific_class  s)    a,>?889r%   c                j    \        ^V P                  R4      pV P                  WP                  4       R# )ra  r}  N)r   rS  r'   rj  r  s   & r   test_encode_with_private_class1TestEncodeImplicit.test_encode_with_private_class  s(    aI6//0r%   c                    V P                  \        4      ;_uu_ 4       p\        ^V P                  R4       RRR4       V P	                  R\        XP                  4      4       R#   + '       g   i     L7; i)ra  rq  Nzinvalid tag classr   r   r   rS  rB   rC   rD   rE   s   & r   test_encode_with_invalid_class1TestEncodeImplicit.test_encode_with_invalid_class  sM    z**aAtyy(3 + 	)3q{{+;< +*s   A%%A5	c                    V P                  \        4      ;_uu_ 4       p\        ^ V P                  4       RRR4       V P	                  R\        XP                  4      4       R#   + '       g   i     L7; i)    NzLong tags not supportedr  rE   s   & r   test_encode_with_too_large_tag1TestEncodeImplicit.test_encode_with_too_large_tag  sK    z**aB		* + 	/Q[[1AB +*rt  rN   N)rO   rP   rQ   rR   rM  r  r  r  r  r  r  r  rS   rT   rU   s   @r   r  r    s<     / /:
5
:
1
=C Cr%   r  c                   ,   a  ] tR tRt o R tR tRtV tR# )TestRemoveOctetStringi  c                l    R p\        V4      w  r#V P                  VR4       V P                  VR4       R# )s   s   r%   N)r   r'   r   rS  rU  r   s   &   r   rV  !TestRemoveOctetString.test_simple  s3    &(.
/s#r%   c                    R pV P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s   Noctetstring)r   r
   r   rB   rC   rD   rY  s   &  r   rZ  -TestRemoveOctetString.test_with_malformed_tag  sI    &}--% . 	mS%56 .-r\  rN   Nr]  rU   s   @r   r  r    s     $7 7r%   r  c                   8   a  ] tR tRt o R tR tR tR tRtV t	R# )TestRemoveSequencei  c                l    R p\        V4      w  r#V P                  VR4       V P                  VR4       R# )s   0rQ  r%   N)r   r'   r  s   &   r   rV  TestRemoveSequence.test_simple  s3    "$T*
{+s#r%   c                    V P                  \        4      ;_uu_ 4       p\        R 4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)r%   NzEmpty stringr   r
   r   rB   rC   rD   rE   s   & r   test_with_empty_string)TestRemoveSequence.test_with_empty_string!  sD    }--C  . 	nc!++&67 .-rI   c                    R pV P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s    Nzwanted type 'sequence'r  rY  s   &  r   test_with_wrong_tag&TestRemoveSequence.test_with_wrong_tag'  sJ    "}--D! . 	.AKK0@A .-r\  c                    R pV P                  \        4      ;_uu_ 4       p\        V4       RRR4       V P                  R\	        XP
                  4      4       R#   + '       g   i     L7; i)s   0NrK   r  rY  s   &  r   test_with_wrong_length)TestRemoveSequence.test_with_wrong_length/  sI    "}--D! . 	os1;;'78 .-r\  rN   N)
rO   rP   rQ   rR   rV  r  r  r  rS   rT   rU   s   @r   r  r    s     $8B9 9r%   r  i   c           	     T   V ! \         P                  ! ^ ^R7      4      pV^8  d    V ! \         P                  ! ^ ^'R7      4      pMV ! \         P                  ! ^ VR7      4      pV ! \         P                  ! \         P                  ! ^ VR7      VR7      4      pW43\        V4      ,           # )z
Hypothesis strategy that returns valid OBJECT IDENTIFIERs as tuples

:param max_value: maximum value of any single sub-identifier
:param max_size: maximum length of the generated OID
)	min_value	max_value)max_size)stintegersliststuple)drawr  r  firstsecondr   s   &&&   r   st_oidr  8  s     qA67EqybkkA<=bkkACD
KK!y9H	
D
 ?U4[((r%   z--fastmax_examplesc                 T    \        V !  p\        V4      w  r#VR 8X  g   Q hW 8X  g   Q hR# r4   )r   r   )idsr   decoded_oidr   s   &   r   	test_oidsr  T  s3     c"K%k2K3;;r%   c                      Rp \         P                  ! \        RR7      ;_uu_ 4        \        V 4       RRR4       R#   + '       g   i     R# ; i)s    &Length longer than the provided buffermatchNs    ABC)r   raisesr
   r   bads    r   1test_remove_octet_string_rejects_truncated_lengthr  \  s1    
&C	},T	U	UC  
V	U	U	U	   =A	c                      Rp \         P                  ! \        RR7      ;_uu_ 4        \        V 4       RRR4       R#   + '       g   i     R# ; i)s    r  r  Ns    ABC)r   r  r
   r   r  s    r   0test_remove_constructed_rejects_truncated_lengthr  b  s3     'C	},T	U	U3 
V	U	U	Ur  c                      Rp \         P                  ! \        RR7      ;_uu_ 4        \        V 4       RRR4       R#   + '       g   i     R# ; i)s    r  r  Ns    ABC)r   r  r
   r   r  s    r   -test_remove_implicit_rejects_truncated_lengthr  i  s3     'C	},T	U	U 
V	U	U	Ur  rN   )5r   binasciir   	unittest2unittestImportErrorsyshypothesis.strategies
strategiesr  
hypothesisr   r   r   _compatr   curvesr   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   TestCaser   rX   r   r   r   r   r  rO  r_  r  r  r  	compositer  HYP_SETTINGSargvr  r  r  r  rN   r%   r   <module>r     s       " &  # &    99)) 99x#)X&& #)L7)(++ 7)tE8(++ E8PDh'' D(H%% (VA/x(( A/H;H-- ;&K$** K$\)C** )CX7H-- 79** 9< c6B ) )(  sxx#$L  
Lvx  ! C  s   F* *F98F9