+
    i#  c                  s   ^ RI Ht ^ RIt^ RIHt ^ RIHt ^ RIHtH	t	H
t
Ht ^ RIHtHtHtHtHt ^ RIHt  ! R R	]P(                  4      t ! R
 R]P(                  4      t ! R R4      t ! R R]4      t ! R R]4      tR# )    )annotationsN)Callable)utils)AlreadyFinalized
InvalidKeyUnsupportedAlgorithm_Reasons)cipherscmacconstant_timehasheshmac)KeyDerivationFunctionc                  s    ] tR t^tRtRtR# )ModeZctr N)__name__
__module____qualname____firstlineno__ZCounterMode__static_attributes__r       O/usr/lib64/python3.14/site-packages/cryptography/hazmat/primitives/kdf/kbkdf.pyr   r      s    Kr   r   c                  s"    ] tR t^tRtRtRtRtR# )CounterLocationZbefore_fixedZafter_fixedZmiddle_fixedr   N)r   r   r   r   BeforeFixed
AfterFixedMiddleFixedr   r   r   r   r   r      s     KJ Kr   r   c                  sP    ] tR t^%tR R lt]R R l4       tR R ltR R ltR	t	R
# )_KBKDFDeriverc               s@    V ^8  d   QhRRRRRRRRRR	R
RRR	RRRRRR/
# )   prfr   moder   lengthintrlenllen
int | Nonelocationr   break_locationlabelbytes | Nonecontextfixedr   Zformat   "r   __annotate___KBKDFDeriver.__annotate__&   sz     J! J!J! J! 	J!
 J! J! "J! #J! J! J! J!r   c                	s   \        V\        4      '       g   \        R 4      h\        V\        4      '       g   \        R4      hVf    V\        P                  J d   \        R4      hVe!   V\        P                  8w  d   \        R4      hVe"   \        V\        4      '       g   \        R4      hVe   V^ 8  d   \        R4      hV'       g	   V	'       d   V
'       d   \        R4      hVe   V P                  V4      '       g   \        R4      hVf   V
f   \        R	4      hVe"   \        V\        4      '       g   \        R
4      hV^ 8X  d   \        R4      hVf   RpV	f   Rp	\        P                  ! RV4       \        P                  ! RV	4       Wn
        W n        W0n        W@n        WPn        W`n        Wpn        Wn        Wn        RV n        Wn        R# )zmode must be of type Modez(location must be of type CounterLocationNzPlease specify a break_locationzJbreak_location is ignored when location is not CounterLocation.MiddleFixedz!break_location must be an integerz)break_location must be a positive integerz9When supplying fixed data, label and context are ignored.zrlen must be between 1 and 4zPlease specify an llenzllen must be an integerzllen must be non-zeror   r&   r(   F)
isinstancer   	TypeErrorr   r   
ValueErrorr    _valid_byte_lengthr   Z_check_bytes_prf_mode_length_rlen_llen	_location_break_location_label_context_used_fixed_data)selfr   r   r   r!   r"   r$   r%   r&   r(   r)   s   &&&&&&&&&&&r   __init__Z_KBKDFDeriver.__init__&   s    $%%788(O44FGG!h/2M2M&M>?? &O777/ 
 %j.M.M?@@%.1*<HIIW%K  <t66t<<;<<<EM566JtS$9$956619455=E?G7E*9g.	


!-
 r   c                    V ^8  d   QhRRRR/# )r   valuer    returnZboolr   r*   r+   r   r,   r-   s   s     ( (# ($ (r   c                	s    \        V \        4      '       g   \        R 4      h\        P                  ! ^V 4      p^\        V4      u;8*  ;'       d    ^8*  # u # )zvalue must be of type int)r.   r    r/   r   int_to_byteslen)r@   Z	value_bin   & r   r1   Z _KBKDFDeriver._valid_byte_lengthr   sJ    %%%788&&q%0	C	N''a''''r   c               s$    V ^8  d   QhRRRRRR/# )r   key_materialutils.Bufferprf_output_sizer    rA   bytesr   r*   r+   r   r,   r-   z   s$     00 00(00;>00	00r   c                	s
   V P                   '       d   \        h\        P                  ! R V4       RV n         V P                  ) V,          ) pR.p\        P
                  ! ^V P                  4      pV\        ^\        V4      ^,          4      ^,
          8  d   \        R4      hV P                  4       pV P                  \        P                  8X  d   RpTpMV P                  \        P                  8X  d   TpRpMb\        V P                   \"        4      '       d&   V P                   \        V4      8  d   \        R4      hVRV P                    pW`P                   R p\%        ^V^,           4       Fs  p	V P'                  V4      p
\        P
                  ! WP                  4      pW{,           V,           pV
P)                  V4       VP+                  V
P-                  4       4       Ku  	  RP/                  V4      RV P                   # )rE   Tr   zThere are too many iterations.z"break_location offset > len(fixed)N)r;   r   r   Z_check_bytesliker4   rB   r5   ZpowrC   r0   _generate_fixed_inputr7   r   r   r   r.   r8   r    Zranger2   ZupdateZappendZfinalizejoin)r=   rE   rG   ZroundsZoutputZr_binr)   Zdata_before_ctrZdata_after_ctrZiZhZcounterZ
input_datas   &&&          r   deriveZ_KBKDFDeriver.derivez   s    :::""~|<
 LL=O34 ""1djj1C3u:>*Q..=>>**,>>_888!O"N^^999#O N$$c &&U3 !EFF#$:d&:&:;O"#7#7#9:Nq&1*%A		,'A((JJ7G(2^CJHHZ MM!**,' & xx$,,//r   c               s    V ^8  d   QhRR/# )r   rA   rH   r   r*   r+   r   r,   r-      s     F Fu Fr   c                	s4   V P                   '       d-   \        V P                   \        4      '       d   V P                   # \        P                  ! V P
                  ^,          V P                  4      pRP                  V P                  RV P                  V.4      # )i   r   s    )
r<   r.   rH   r   rB   r4   r6   rJ   r9   r:   )r=   Zl_valrD   r   rI   Z#_KBKDFDeriver._generate_fixed_input   sk    
4+;+;U C C###""4<<!#3TZZ@xxgt}}eDEEr   )r8   r:   r<   r9   r4   r6   r7   r3   r2   r5   r;   N)
r   r   r   r   r>   Zstaticmethodr1   rK   rI   r   r   r   r   r   r   %   s/    J!X ( (00dF Fr   r   c                  sR    ] tR t^tRRR/R R llltR R ltR R ltR	 R
 ltRtR# )	KBKDFHMACNr%   c               sD    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRRRR	/# )r   	algorithmzhashes.HashAlgorithmr   r   r   r    r!   r"   r#   r$   r   r&   r'   r(   r)   backend
typing.Anyr%   r   r*   r+   r   r,   KBKDFHMAC.__annotate__   sx     ,
 ,
',
 ,
 	,

 ,
 ,
 ",
 ,
 ,
 ,
 ,
 #,
r   c               	s:   \        V\        P                  4      '       g   \        R \        P
                  4      h^ RIHp VP                  V4      '       g   \        R\        P
                  4      hWn	        \        V P                  VVVVVVVVV	4
      V n        R# )z5Algorithm supplied is not a supported hash algorithm.rN   z5Algorithm supplied is not a supported hmac algorithm.N)r.   r   ZHashAlgorithmr   r   ZUNSUPPORTED_HASH,cryptography.hazmat.backends.openssl.backendrN   Zhmac_supported
_algorithmr   r2   _deriver)r=   rM   r   r   r!   r"   r$   r&   r(   r)   rN   r%   ossls   &&&&&&&&&&&$ r   r>   ZKBKDFHMAC.__init__   s     )V%9%9::&G)) 
	
 ""9--&G)) 
 $%II
r   c               r?   )r   rE   rH   rA   z	hmac.HMACr   r*   r+   r   r,   rP      s     8 8 89 8r   c                	sB    \         P                  ! WP                  4      # N)r   ZHMACrS   r=   rE      &&r   r2   ZKBKDFHMAC._prf   s    yy77r   c               r?   r   rE   rF   rA   rH   r   r*   r+   r   r,   rP      s     O O< OE Or   c                	s`    V P                   P                  WP                  P                  4      # rV   )rT   rK   rS   Zdigest_sizerW   rX   r   rK   ZKBKDFHMAC.derive   s!    }}##L//2M2MNNr   c               $    V ^8  d   QhRRRRRR/# r   rE   rH   expected_keyrA   ZNoner   r*   r+   r   r,   rP      !      5  $ r   c                	j    \         P                  ! V P                  V4      V4      '       g   \        hR # rV   r
   Zbytes_eqrK   r   r=   rE   r\      &&&r   verifyZKBKDFHMAC.verify   *    %%dkk,&?NN Or   )rS   rT   rV   	r   r   r   r   r>   r2   rK   rb   r   r   r   r   rL   rL      s,    ,
 &*,
 ,
\8O r   rL   c                  sR    ] tR t^tRRR/R R llltR R ltR R ltR	 R
 ltRtR# )	KBKDFCMACNr%   c               s@    V ^8  d   QhRRRRRRRRRR	R
RRRRRRRRR/
# )r   r   r   r   r    r!   r"   r#   r$   r   r&   r'   r(   r)   rN   rO   r%   r   r*   r+   r   r,   KBKDFCMAC.__annotate__   sp     %
 %
 %
 	%

 %
 %
 "%
 %
 %
 %
 %
 #%
r   c               	s   \        V\        P                  4      '       d!   \        V\        P                  4      '       g   \	        R \
        P                  4      hWn        RV n        \        V P                  VVVVVVVVV	4
      V n        R# )7Algorithm supplied is not a supported cipher algorithm.N)Z
issubclassr   ZBlockCipherAlgorithmZCipherAlgorithmr   r   UNSUPPORTED_CIPHERrS   _cipherr   r2   rT   )r=   rM   r   r   r!   r"   r$   r&   r(   r)   rN   r%   s   &&&&&&&&&&&$r   r>   ZKBKDFCMAC.__init__   s     w33
 
Iw'>'>??&I++ 
 $<@%II
r   c               r?   )r   _rH   rA   z	cmac.CMACr   r*   r+   r   r,   rf     s     ' 'e '	 'r   c                	sB    \         P                  ! V P                  4      # rV   )r	   ZCMACri   )r=   rj   rX   r   r2   ZKBKDFCMAC._prf  s     yy&&r   c               r?   rY   r   r*   r+   r   r,   rf     s     P P< PE Pr   c                	s   V P                  V4      V n        ^ RIHp VP	                  V P                  4      '       g   \        R\        P                  4      hV P                  P                  WP                  P                  ^,          4      # )r    rQ   rg   )rS   ri   rR   rN   Zcmac_algorithm_supportedr   r   rh   rT   rK   Z
block_size)r=   rE   rU   s   && r   rK   ZKBKDFCMAC.derive  sm    |4	
 ,,T\\::&I++ 
 }}##L,,2I2IQ2NOOr   c               rZ   r[   r   r*   r+   r   r,   rf   -  r]   r   c                	r^   rV   r_   r`   ra   r   rb   ZKBKDFCMAC.verify-  rc   r   )rS   ri   rT   rV   rd   r   r   r   re   re      s,    %
 &*%
 %
N'
P" r   re   )Z
__future__r   ZtypingZcollections.abcr   Zcryptographyr   Zcryptography.exceptionsr   r   r   r   Zcryptography.hazmat.primitivesr   r	   r
   r   r   Z"cryptography.hazmat.primitives.kdfr   ZEnumr   r   r   rL   re   r   r   r   <module>rk      sy   
 #  $    E5:: !ejj !MF MF`7% 7t@% @r   