William Stafford Parsons

WSP-TRNG: A Classical TRNG Algorithm With Quantum-Level Entropy Generated Internally

WSP-TRNG is a truly-random integer generator with a temporal precision theory that guarantees randomness captured internally from quantum-level entropy.

Library

Source

wsp_trng.c
wsp_trng.h

Reference

wsp_trng_64_randomize() is the 64-bit randomization function.

The return value data type is uint64_t.

It returns the 64-bit unsigned integer random number result.

wsp_trng_32_randomize() is the 32-bit randomization function.

The return value data type is uint32_t.

It returns the 32-bit unsigned integer random number result.

wsp_trng_16_randomize() is the 16-bit randomization function.

The return value data type is uint16_t.

It returns the 16-bit unsigned integer random number result.

wsp_trng_8_randomize() is the 8-bit randomization function.

The return value data type is uint8_t.

It returns the 8-bit unsigned integer random number result.

Example

#include <stdio.h> #include "wsp_trng.h" int main(void) { unsigned char i = 0; while (i != 10) { i++; printf("8-bit result %u is %u.\n", i, wsp_trng_8_randomize()); } i = 0; while (i != 10) { i++; printf("16-bit result %u is %u.\n", i, wsp_trng_16_randomize()); } i = 0; while (i != 10) { i++; printf("32-bit result %u is %u.\n", i, wsp_trng_32_randomize()); } i = 0; while (i != 10) { i++; printf("64-bit result %u is %u.\n", i, wsp_trng_64_randomize()); } return 0; }

Requirements

It adheres to the C99 standard draft (ISO/IEC 9899:1999), although it's convertible to other programming languages and standards.

It requires a POSIX-compatible system with adherence to POSIX.1-2001, POSIX.1-2008 and SUSv2.

The system must have resilience to the year 2038 problem for implementations with long-term usage intent.

The clock_gettime() implementation must support high-resolution, system-wide clock reads with guaranteed nanosecond time precision using CLOCK_REALTIME. If this is unavailable or not guaranteed by the implementation, the std::chrono library in C++ may offer a sensible alternative.

The CPU should spend at least a few nanoseconds processing each %, * and / operation.

Explanation

WSP-TRNG is designed as an efficient and error-resistant alternative to extracting classical bits of quantum randomness from collapsed qubits.

It's compatible with both 32-bit and 64-bit POSIX systems with the exception of wsp_trng_64_randomize() for 64-bit POSIX systems.

The aforementioned library code in POSIX C is only intended to demonstrate an example using the following TRNG system and should be subject to heavy scrutiny of local system clock reliability before implementing into any critical system.

In quantum computing, the probability of capturing a result of either 0 or 1 after collapsing a superpositioned qubit is calculated with deterministic mathematical formulas.

These formulas depend on tangible quantum wave functions, which leverage entropic oscillations from external physical interactions.

The result is considered to be a reliable and scientifically-proven source of true randomness, which led to the creation of quantum random number generators (QRNGs).

As an alternative, the aforementioned TRNG library is capable of generating the same level of single-bit quantum entropy by combining classical and quantum computing methodologies.

It uses a computationally-expensive sequence of simulated qubit collapsing algorithms that rely on temporal mechanics to generate 64-bit, random binary numbers.

Time is clearly-defined as a simple measurement within the constraints of classical computing and physics.

Time changes at a constant, linear interval with a huge amount of precision relative to the third dimension.

In rare cases when the aforementioned CPU requirement isn't met, oscillation calculations should be amplified in _wsp_trng_16_oscillate() with manual changes to the code library. This may only be necessary on high-end devices with extremely-fast CPU speed to guarantee additional assurance of true randomness.

Otherwise, it's impossible for this TRNG to capture non-random, predetermined bits due to the verified temporal precision of the system clock on each implemented device far exceeding the fastest processing time of repeating computations between each random bit capture.

The conditional statement if (oscillation == 0) captures an additional random bit in rare instances to ensure oscillation doesn't pollute entropy without unintentionally removing CPU oscillations with compiler optimization liberties.

The aforementioned TRNG algorithm produces bits that are as random as possible while setting the standard of true entropy within the constraints of time. Theoretical randomness and denying the existence of free will beyond these computations is the topic of an irrelevant philisophical discussion.

It usually fails statistical randomness tests for 8-bit, 16-bit, 32-bit and 64-bit numbers after a few KB of output, which means it's a solid basis for researching new and improved computational analyses of random number quality. If generating random-looking numbers which consistently pass statistical tests is a priority instead of true randomness, then implementing a deterministic PRNG that re-seeds with WSP-TRNG is a sensible alternative.

System clock failures are handled by abruptly stopping with exit(EXIT_FAILURE), but alternate error handling methods may be appropriate in specific implementations, such as falling back to reading /dev/random, querying a trusted QRNG API or using a seeded PRNG.

A TNRG algorithm is computationally-expensive and slower compared to a pseudo-random number generation algorithm, therefore this TRNG is only appropriate when true randomness is an absolute requirement regardless of speed.

Games

Contrivity

Contrivity

Spawn into the hostile quantum laboratory and destroy oscillations.