Random123
Index
Random123.Random123Random123.R123_USE_AESNIRandom123.AESNI1xRandom123.AESNI4xRandom123.AESNIKeyRandom123.ARS1xRandom123.ARS4xRandom123.AbstractAESNI1xRandom123.AbstractAESNI4xRandom123.AbstractR123Random123.Philox2xRandom123.Philox4xRandom123.R123Generator1xRandom123.R123Generator2xRandom123.R123Generator4xRandom123.Threefry2xRandom123.Threefry4xRandom123._aes_128_assistRandom123.random123_rRandom123.set_counter!
Public
#
Random123.Random123 — Module.
The module for Random123 Family.
Provide 8 RNG types:
#
Random123.R123_USE_AESNI — Constant.
True when AES-NI has been enabled.
#
Random123.AESNI1x — Type.
AESNI1x <: AbstractAESNI1x
AESNI1x([seed])
AESNI1x is one kind of AESNI Counter-Based RNGs. It generates one UInt128 number at a time.
seed is an Integer which will be automatically converted to UInt128.
Only available when R123_USE_AESNI.
#
Random123.AESNI4x — Type.
AESNI4x <: AbstractAESNI4x
AESNI4x([seed])
AESNI4x is one kind of AESNI Counter-Based RNGs. It generates four UInt32 numbers at a time.
seed is a Tuple of four Integers which will all be automatically converted to UInt32.
Only available when R123_USE_AESNI.
#
Random123.ARS1x — Type.
ARS1x{R} <: AbstractAESNI1x
ARS1x([seed, R=7])
ARS1x is one kind of ARS Counter-Based RNGs. It generates one UInt128 number at a time.
seed is an Integer which will be automatically converted to UInt128.
R denotes to the Rounds which should be at least 1 and no more than 10. With 7 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
Only available when R123_USE_AESNI.
#
Random123.ARS4x — Type.
ARS4x{R} <: AbstractAESNI4x
ARS4x([seed, R=7])
ARS4x is one kind of ARS Counter-Based RNGs. It generates four UInt32 numbers at a time.
seed is a Tuple of four Integers which will all be automatically converted to UInt32.
R denotes to the Rounds which must be at least 1 and no more than 10. With 7 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
Only available when R123_USE_AESNI.
#
Random123.Philox2x — Type.
Philox2x{T, R} <: R123Generator2x{T}
Philox2x([seed, R])
Philox2x(T[, seed, R])
Philox2x is one kind of Philox Counter-Based RNGs. It generates two numbers at a time.
T is UInt32 or UInt64(default).
seed is an Integer which will be automatically converted to T.
R denotes to the Rounds which must be at least 1 and no more than 16. With 10 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
#
Random123.Philox4x — Type.
Philox4x{T, R} <: R123Generator4x{T}
Philox4x([seed, R])
Philox4x(T[, seed, R])
Philox4x is one kind of Philox Counter-Based RNGs. It generates four numbers at a time.
T is UInt32 or UInt64(default).
seed is a Tuple of two Integers which will both be automatically converted to T.
R denotes to the Rounds which must be at least 1 and no more than 16. With 10 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
#
Random123.Threefry2x — Type.
Threefry2x{T, R} <: R123Generator2x{T}
Threefry2x([seed, R])
Threefry2x(T[, seed, R])
Threefry2x is one kind of Threefry Counter-Based RNGs. It generates two numbers at a time.
T is UInt32 or UInt64(default).
seed is a Tuple of two Integers which will both be automatically converted to T.
R denotes to the Rounds which must be at least 1 and no more than 32. With 20 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
#
Random123.Threefry4x — Type.
Threefry4x{T, R} <: R123Generator4x{T}
Threefry4x([seed, R])
Threefry4x(T[, seed, R])
Threefry2x is one kind of Threefry Counter-Based RNGs. It generates four numbers at a time.
T is UInt32 or UInt64(default).
seed is a Tuple of four Integers which will all be automatically converted to T.
R denotes to the Rounds which must be at least 1 and no more than 32. With 20 rounds (by default), it has a considerable safety margin over the minimum number of rounds with no known statistical flaws, but still has excellent performance.
<a id='Random123.set_counter!-Union{Tuple{T}, Tuple{Random123.R123Generator1x{T}, Integer}} where T<:UInt128' href='#Random123.set_counter!-Union{Tuple{T}, Tuple{Random123.R123Generator1x{T}, Integer}} where T<:UInt128'>#
Random123.set_counter! — Method.
Set the counter of a Random123 RNG.
Internal
#
Random123.AESNIKey — Type.
The key for AESNI.
#
Random123.AbstractAESNI1x — Type.
Abstract RNG that generates one number at a time and is based on AESNI.
#
Random123.AbstractAESNI4x — Type.
Abstract RNG that generates four numbers at a time and is based on AESNI.
#
Random123.AbstractR123 — Type.
The base abstract type for RNGs in Random123 Family.
#
Random123.R123Generator1x — Type.
RNG that generates one number at a time.
#
Random123.R123Generator2x — Type.
RNG that generates two numbers at a time.
#
Random123.R123Generator4x — Type.
RNG that generates four numbers at a time.
#
Random123._aes_128_assist — Method.
Assistant function for AES128. Compiled from the C++ source code:
R123_STATIC_INLINE __m128i AES_128_ASSIST (__m128i temp1, __m128i temp2) {
__m128i temp3;
temp2 = _mm_shuffle_epi32 (temp2 ,0xff);
temp3 = _mm_slli_si128 (temp1, 0x4);
temp1 = _mm_xor_si128 (temp1, temp3);
temp3 = _mm_slli_si128 (temp3, 0x4);
temp1 = _mm_xor_si128 (temp1, temp3);
temp3 = _mm_slli_si128 (temp3, 0x4);
temp1 = _mm_xor_si128 (temp1, temp3);
temp1 = _mm_xor_si128 (temp1, temp2);
return temp1;
}
#
Random123.random123_r — Function.
Do one iteration and return the result tuple of a Random123 RNG object.