_rdseed16_step/ _rdseed32_step/ _rdseed64_step

Generates random numbers of 16/32/64 bit wide random integers. The corresponding 4th Generation Intel® Core™ instruction is RDSEED.

Syntax

extern int _rdseed16_step(unsigned short *random_val);

extern int _rdseed32_step(unsigned int *random_val);

extern int _rdseed64_step(unsigned __int64 *random_val);

Parameters

*random_val

Random value written to the given memory location

Description

These intrinsics generate random numbers of 16/32/64 bit wide random integers. These intrinsics are mapped to a code-sequence based on the RDSEED instruction. The result code depends on the context in which the intrinsics were used and on the target operating system.

Note

The _rdrand64_step() intrinsic can be used only on systems with the 64-bit registers support.

The generated random value is written to the given memory location and the success status is returned: '1' if the hardware returned a valid random value, and '0' otherwise.

Note

The difference between RDSEED and RDRAND intrinsics is that RDSEED intrinsics meet the NIST SP 800-90B and NIST SP 800-90C standards, while the RDRAND meets the NIST SP 800-90A standard.

Returns

The generated random value is written to the given memory location and the success status is returned. Returns '1' if the hardware returns a random 16/32/64 bit value (success). Returns '0' otherwise (failure).

For more complete information about compiler optimizations, see our Optimization Notice.