randomgen.aes.AESCounter.seed¶
-
AESCounter.seed(seed=
None
, counter=None
, key=None
)¶ Seed the generator
This method is called when
AESCounter
is initialized. It can be called again to re-Seed the generator For details, seeAESCounter
.- Parameters:¶
- seed=
None
¶ Random seed initializing the pseudo-random number generator. Can be an integer in [0, 2**128), a SeedSequence instance or
None
(the default). If seed isNone
, then data is read from/dev/urandom
(or the Windows analog) if available. If unavailable, a hash of the time and process ID is used.- counter=
None
¶ Counter to use in the AESCounter state. Can be either a Python int in [0, 2**128) or a 2-element uint64 array. If not provided, the counter is initialized at 0.
- key=
None
¶ Key to use in the AESCounter state. Unlike seed, which is run through another RNG before use, the value in key is directly set. Can be either a Python int in [0, 2**128) or a 2-element uint64 array. key and seed cannot both be used.
- seed=
- Raises:¶
ValueError – If values are out of range for the PRNG.
Notes
The two representation of the counter and key are related through array[i] = (value // 2**(64*i)) % 2**64.