ffrgdZddlmZddlmZGddeZeZejZej Z ej Z ej Z ej Z ej Z ddlmZmZmZmZdS)) StrongRandom getrandbits randrangerandintchoiceshufflesample)Random) is_native_intc:eZdZd dZdZdZdZdZdZdZ dS) rNcx| | d|_dS| | ||_dS|||j|_dStd)Nz(Cannot specify both 'rng' and 'randfunc') _randfuncread ValueError)selfrngrandfuncs v/builddir/build/BUILD/imunify360-venv-2.3.5/opt/imunify360/venv/lib64/python3.11/site-packages/Crypto/Random/random.py__init__zStrongRandom.__init__ sR   !DNNN  !ck%DNNN  #/ XDNNNGHH Hc |jtjj|_d|zdz }|t |t |dzS)z%Return an integer with k random bits.N)rr newr bytes_to_longceil_div)rkmasks rrzStrongRandom.getrandbits*sP > !#Z\\.DNQ!|mDNN8Aq>>$B$BCCCCrc jt|dkr|\}}}nWt|dkr|\}}d}n>"& UD$$ YY!^^ MUDDD YY!^^GTEDDLPSTXPYPY|[\\ \e$$ DM$,?,? Dd## DBCC C 199GHH Hte|T22 ??K ??*tttUYUYUYZ[[ [ ;  k!2!233A;q!!rct|rt|std|||dz}||cxkr|ksnJ|S)z0Return a random integer N such that a <= N <= b.z"randint requires integer argumentsr)r r$r)rabNs rrzStrongRandom.randintSsiQ B}Q'7'7 B@AA A NN1ac " "A{{{{{{{{{{rct|dkrtd||t|S)zrReturn a random element from a (non-empty) sequence. If the seqence is empty, raises IndexError. r zempty sequence)r# IndexErrorr)rseqs rrzStrongRandom.choice[s? s88q==-.. .4>>#c((++,,rctt|dz ddD]2}|d|dz}||||c||<||<3dS)zShuffle the sequence in place.rr N)ranger#r)rxijs rrzStrongRandom.shuffledsg s1vvaxB'' $ $Aq!A#&&A1qtJAaD!A$$ $ $rct|}||krtdg}i}t|D]E}d}|||vr||}|||v|||d||<F|S)zNReturn a k-length list of unique elements chosen from the population sequence.zsample larger than populationNr)r#rr5rappend)r populationrr*retvalselectedr7r+s rrzStrongRandom.samplens*oo {??<== =q  AA)qH}}NN;//)qH}} MM*Q- ( ( (HQKK r)NN) __name__ __module__ __qualname__rrrrrrrrrrrsIIIIDDD"""B---$$$rr)rr long_to_bytesr%N)__all__Cryptor Crypto.Util.py3compatr objectr_rrrrrrrCrypto.Util.numberrrrBr%rArrrIs2 a ` `//////^^^^^6^^^@\^^n L *  * LKKKKKKKKKKKKKr