+
    üÐj´  ã                   óÖ   € R t ^ RIt^ RIt^ RIt]! ]RR4      t]P                  t ! R R]	4      t
 ! R R]	4      t ! R R4      t]! 4       t]P                  t]P                  tA. R	OtR# )
zQ
Cryptographically secure random implementation, with fallback on normal random.
NÚgetrandbitsc                   ó   € ] tR t^tRtRtR# )ÚSecureRandomNotAvailablez<
Exception raised when no secure random algorithm is found.
© N©Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__Ú__static_attributes__r   ó    Ú:/usr/lib/python3/dist-packages/twisted/python/randbytes.pyr   r      ó   † õr   r   c                   ó   € ] tR t^tRtRtR# )ÚSourceNotAvailablezI
Internal exception used when a specific random source is not available.
r   Nr   r   r   r   r   r      r   r   r   c                   ó´   a € ] tR t^t o RtRt]tV 3R lR ltRV 3R lR lltV 3R lR lt	]
P                  t]! RR4      tV 3R	 lR
 ltV 3R lR ltRtV tR# )ÚRandomFactoryzå
Factory providing L{secureRandom} and L{insecureRandom} methods.

You shouldn't have to instantiate this class, use the module level
functions instead: it is an implementation detail and could be removed or
changed arbitrarily.
c                ó&   <€ V ^8„  d   QhRS[ RS[/# ©é   ÚnbytesÚreturn©ÚintÚbytes)ÚformatÚ__classdict__s   "€r   Ú__annotate__ÚRandomFactory.__annotate__-   s   ø€ ÷ (ñ (¡ð (©ñ (r   c                óx   €  \         P                  ! V4      #   \        \        3 d   p\	        T4      hRp?ii ; i)z?
Wrapper around C{os.urandom} that cleanly manage its absence.
N)ÚosÚurandomÚAttributeErrorÚNotImplementedErrorr   )Úselfr   Úes   && r   Ú
_osUrandomÚRandomFactory._osUrandom-   s7   € ð	(Ü—:’:˜fÓ%Ð%øÜÔ 3Ð4ô 	(Ü$ QÓ'Ð'ûð	(ús   ‚ ˜9©4´9c                ó,   <€ V ^8„  d   QhRS[ RS[RS[/# )r   r   Úfallbackr   )r   Úboolr   )r   r   s   "€r   r   r   6   s'   ø€ ÷ Pñ P¡3ð P±$ð PÁ5ñ Pr   c                óÊ   €  V P                  V4      #   \         d     Mi ; iT'       d/   \        P                  ! R\        ^R7       T P                  T4      # \        R4      h)a#  
Return a number of secure random bytes.

@param nbytes: number of bytes to generate.
@type nbytes: C{int}
@param fallback: Whether the function should fallback on non-secure
    random or not.  Default to C{False}.
@type fallback: C{bool}

@return: a string of random bytes.
@rtype: C{str}
zPurandom unavailable - proceeding with non-cryptographically secure random source)ÚcategoryÚ
stacklevelz!No secure random source available)r'   r   ÚwarningsÚwarnÚRuntimeWarningÚinsecureRandomr   )r%   r   r*   s   &&&r   ÚsecureRandomÚRandomFactory.secureRandom6   sd   € ð	Ø—?‘? 6Ó*Ð*øÜ!ô 	Ùð	ú÷ Ü�MŠMðMä'Øõ	ð ×&Ñ& vÓ.Ð.ä*Ð+NÓOÐOó   ‚ “! !c                ó&   <€ V ^8„  d   QhRS[ RS[/# r   r   )r   r   s   "€r   r   r   S   s   ø€ ÷ Hñ H¡ð H©ñ Hr   c                ó¨   € V P                   e;   V P                  V^,          4      pRV^,          ,          V,          p\        V4      # \        R4      h)z#
Wrapper around C{os.getrandbits}.
z%%0%dxz#random.getrandbits is not available)r   Ú_fromhexr   )r%   r   ÚnÚhexBytess   &&  r   Ú	_randBitsÚRandomFactory._randBitsS   sN   € ð ×ÑÒ'Ø× Ñ  ¨!¥Ó,ˆAØ  F¨Q¥JÕ/°1Õ4ˆHÜ˜HÓ%Ð%Ü Ð!FÓGÐGr   r   c                ó&   <€ V ^8„  d   QhRS[ RS[/# r   r   )r   r   s   "€r   r   r   `   s   ø€ ÷ Vñ V¡#ð V©%ñ Vr   c           
     ó°   € RP                  \        V4       Uu. uF-  p\        \        P                  ! V P
                  4      .4      NK/  	  up4      # u upi )z&
Wrapper around the C{random} module.
r   )ÚjoinÚranger   ÚrandomÚchoiceÚ_BYTES)r%   r   Úis   && r   Ú_randModuleÚRandomFactory._randModule`   s>   € ð �x‰xÄeÈFÄmÓTÁmÀœ¤§¢¨d¯k©kÓ :Ð;Ö<ÁmÑTÓUÐUùÒTs   ™3Ac                ó&   <€ V ^8„  d   QhRS[ RS[/# r   r   )r   r   s   "€r   r   r   f   s   ø€ ÷ (ñ (¡Sð (©Uñ (r   c                ój   €  V P                  V4      #   \         d     Mi ; iT P                  T4      # )z¢
Return a number of non secure random bytes.

@param nbytes: number of bytes to generate.
@type nbytes: C{int}

@return: a string of random bytes.
@rtype: C{str}
)r;   r   rE   )r%   r   s   &&r   r2   ÚRandomFactory.insecureRandomf   s9   € ð	Ø—>‘> &Ó)Ð)øÜ!ô 	Ùð	úà×Ñ Ó'Ð'r5   r   N)F)r   r   r	   r
   r   ÚrandomSourcesr   r'   r3   r;   r   Ú	maketransÚ
_maketransrC   rE   r2   r   Ú__classdictcell__)r   s   @r   r   r      se   ø‡ € ñð €Mà€K÷(ð (÷Pò P÷:Hð Hð —‘€JÙ˜˜SÓ!€F÷Vð V÷(ö (r   r   )r3   r2   r   )r   r!   rA   r/   Úgetattrr   r   Úfromhexr8   ÚRuntimeErrorr   r   r   Úfactoryr3   r2   Ú__all__r   r   r   Ú<module>rS      s{   ðñ
ó
 
Û Û á�f˜m¨TÓ2€à�=‰=€ô˜|ô ô˜ô ÷U(ñ U(ñp ‹/€à×#Ñ#€à×'Ñ'€àò I‚r   