Class encapsulating the Sitmo random generator.
More...
#include <Sitmo.hpp>
|
|
using | Key = std::array< uint64_t, 5 > |
| | Type of the key.
|
| |
|
using | Word = std::array< uint64_t, 4 > |
| | Encrypted word.
|
| |
|
| | Sitmo (const Sitmo &oth) |
| | Copy constructor. More...
|
| |
|
| Sitmo (const uint32_t &s=0) |
| | Construct from a seed.
|
| |
|
void | setKey (const uint32_t &k0=0, const uint32_t &k1=0, const uint32_t &k2=0, const uint32_t &k3=0) |
| | Sets the key.
|
| |
|
void | seed (const uint32_t &s=0) |
| | Init using the passed seed.
|
| |
|
uint32_t | operator() () |
| | Returns one of the 8 chunks.
|
| |
|
void | discard (uint64_t z) |
| | Advances e’s state ei to ei+z.
|
| |
|
bool | operator== (const Sitmo &y) |
| | Check that the two generators are the same.
|
| |
|
bool | operator!= (const Sitmo &y) |
| | Check that the two generators are different.
|
| |
|
void | set_counter (uint64_t s0=0, uint64_t s1=0, uint64_t s2=0, uint64_t s3=0, unsigned short o_counter=0) |
| | Set the counter.
|
| |
| Sitmo & | operator+= (const uint64_t z) |
| | Increments the counter by a given amount. More...
|
| |
|
Sitmo & | operator++ (int) |
| | Unitary increment.
|
| |
|
| static constexpr uint32_t | max |
| | Maximal output. More...
|
| |
|
| void | encryptCounter (std::array< uint64_t, 4 > &outputState) const |
| | Encrypts the counter, to set the state. More...
|
| |
|
|
std::array< uint64_t, 5 > | key |
| | Key.
|
| |
|
std::array< uint64_t, 4 > | state |
| | State (counter)
|
| |
|
union { |
|
std::array< uint64_t, 4 > state |
| |
|
std::array< uint32_t, 8 > output |
| |
| } | ciphered |
| | Cipher output: 4*64 bit=256 bit output.
|
| |
|
unsigned short | iChunk |
| | Output chunk counter: determines wihch 32 of the 256 random bits in cipheredState is returned.
|
| |
|
|
template<class CharT , class Traits > |
| std::basic_ostream< CharT, Traits > & | operator<< (std::basic_ostream< CharT, Traits > &os, const Sitmo &s) |
| | Output.
|
| |
|
template<class CharT , class Traits > |
| std::basic_istream< CharT, Traits > & | operator>> (std::basic_istream< CharT, Traits > &is, Sitmo &s) |
| | Input.
|
| |
Class encapsulating the Sitmo random generator.
Definition at line 43 of file Sitmo.hpp.
| SUNphi::Sitmo::Sitmo |
( |
const Sitmo & |
oth | ) |
|
Copy constructor.
Other engine
| void SUNphi::Sitmo::encryptCounter |
( |
std::array< uint64_t, 4 > & |
outputState | ) |
const |
|
inlineprivate |
Encrypts the counter, to set the state.
Copy of the state, to be modififed
- Parameters
-
Definition at line 62 of file Sitmo.hpp.
| Sitmo& SUNphi::Sitmo::operator+= |
( |
const uint64_t |
z | ) |
|
|
inline |
Increments the counter by a given amount.
Take note of old value, to check for overflow
Digit to increment
- Parameters
-
Definition at line 291 of file Sitmo.hpp.
| constexpr uint32_t SUNphi::Sitmo::max |
|
static |
Initial value:
Maximal output.
Definition at line 132 of file Sitmo.hpp.
The documentation for this class was generated from the following files: