HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.104.1.lve.el8.x86_64 #1 SMP Tue Feb 10 20:07:30 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.29
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //usr/lib64/python3.6/site-packages/M2Crypto/__pycache__/Rand.cpython-36.pyc
3

���[x�@s�dZddlmZddlmZmZmZer8ddlmZm	Z	ddddd	d
ddgZ
Gd
d�de�Zej
e�dd�Zdd�Zdd�Zdd�Zdd�Zdd�Zdd	�Zdd
�ZdS)z�M2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above.

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.
Copyright (c) 2014-2017 Matej Cepl. All rights reserved.

See LICENCE for the license information.
�)�absolute_import)�m2�py27plus�six)�AnyStr�Tuple�	rand_seed�rand_add�	load_file�	save_file�
rand_bytes�rand_pseudo_bytes�rand_file_name�rand_statusc@seZdZdS)�	RandErrorN)�__name__�
__module__�__qualname__�rr�/usr/lib64/python3.6/Rand.pyrsrcCstj||�dS)aW
    Mixes blob into the PRNG state.

    :param blob: added data
    :param entropy: (the lower bound of) an estimate of how much randomness
        is contained in blob, measured in bytes.

    Thus, if the data at buf are unpredictable to an adversary, this
    increases the uncertainty about the state and makes the PRNG output less
    predictable. Suitable input comes from user interaction (random key
    presses, mouse movements) and certain hardware events.

    Details about sources of randomness and how to estimate their entropy
    can be found in the literature, e.g. RFC 1750.
    N)rr	)ZblobZentropyrrrr	scCstj|�dS)zx
    Equivalent to rand_add() when len(seed) == entropy.

    :param seed: added data (see description at rand_add)
    N)rr)Zseedrrrr-scCstj�S)z�
    Check whether there is enough entropy in PRNG.

    :return: 1 if the PRNG has been seeded with enough
       data, 0 otherwise.
    )rrrrrrr7scCstjtj��S)z�
    Generate a default path for the random seed file.

    :return: string with the filename.
       The seed file is $RANDFILE if that environment variable
       is set, $HOME/.rnd otherwise. If $HOME is not set either,
       an error occurs.
    )rZensure_textrrrrrrrBs
cCstjtj|�|�S)a1
    Read a number of bytes from file filename and adds them to the PRNG.

    If max_bytes is non-negative, up to to max_bytes are read; starting with
    OpenSSL 0.9.5, if max_bytes is -1, the complete file is read.

    :param filename:
    :param max_bytes:
    :return: the number of bytes read.
    )rZrand_load_filerZ
ensure_str)�filenameZ	max_bytesrrrr
OscCs
tj|�S)a=
    Write a number of random bytes (currently 1024) to file.

    The file then can be used to initialize the PRNG by calling load_file() in
    a later session.

    :param filename:
    :return: returns the number of bytes written, and -1 if the bytes
         written were generated without appropriate seed.
    )rZrand_save_file)rrrrr^scCs
tj|�S)a
    Return n cryptographically strong pseudo-random bytes.

    An error occurs if the PRNG has not been seeded with enough randomness
    to ensure an unpredictable byte sequence.

    :param num: number of bytes to be returned
    :return: random bytes
    )rr)�numrrrrmscCs(ddl}tjdkr|jdt�tj|�S)aH
    Return num pseudo-random bytes into buf.

    Pseudo-random byte sequences generated by this method will be unique
    if they are of sufficient length, but are not necessarily
    unpredictable. They can be used for non-cryptographic purposes and for
    certain purposes in cryptographic protocols, but usually not for key
    generation etc.

    Output of the function is mixed into the entropy pool before
    retrieving the new pseudo-random bytes unless disabled at compile
    time (see FAQ).

    :param num: number of bytes to be returned
    :return: random bytes
    rNiz'The underlying OpenSSL method has been z(deprecated. Use Rand.rand_bytes instead.zOThe underlying OpenSSL method has been deprecated. Use Rand.rand_bytes instead.)�warningsrZOPENSSL_VERSION_NUMBER�warn�DeprecationWarningr
)rrrrrr
{s
N)�__doc__Z
__future__rZM2CryptorrrZtypingrr�__all__�
ValueErrorrZ	rand_initr	rrrr
rrr
rrrr�<module>s