Primitive Component: XoShiRo256++

prim_xoshiro256pp is a PRNG with 256-bit state. For more information refer to this page.


OutputDwintWidth of the PRNG output. Must be a multiple of 64.
DefaultSeedlogicInitial 256-bit state of the PRNG, must be nonzero.

Signal Interfaces

seed_en_iinputExternal seed input enable
seed_i[256]inputExternal seed input
xoshiro_en_iinputPRNG enable
entropy_i[256]inputEntropy input
data_o[OutputDw]outputPRNG output
all_zero_ooutputImpossible all-zero state

Theory of Operations

seed_en_i    |                |
------------>|  xoshiro256++  |
seed_i       |                |  data_o
=====/======>|                |=====/=======>
 [256]       |                |  [OutputDw]
xoshiro_en_i |                |
------------>|    OutputDw    |
entropy_i    |   DefaultSeed  |  all_zero_o
=====/======>|                |------------->
 [256]       |                |
             |                |

Xoshiro256++ PRNG consists of:

  • A 256-bit state
  • A single-cycle state-update function.
  • A state output function.

The basic xoshiro256++ PRNG has a 64-bit output. This implementation supports an output size of any multiple of 64 bits. The output size is controlled using the OutputDW parameter.

The xoshiro256++ module has an enable input and an additional entropy input that is XORed into the PRNG state (connect to zero if this feature is unused). As the PRNG may jump into the all-zero state (e.g. due to an active attack), the PRNG state-update function contains a lockup protection which re-seeds the state with DefaultSeed and raises the alert signal all_zero_o, once this condition is detected.

When the seed enable signal seed_en_i is raised, the internal state of xoshiro256++ is updated with the value provided at the 256-bit input ‘seed_i’. The state is internally updated in every clock cycle whenever the enable signal xoshiro_en_i is raised. The timing diagram below visualizes this process.