# Stochastic Cell- and Bit-Discard Technique to Improve Randomness of a TRNG

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

## 2. Existing Issues with the Conventional TRNG

## 3. NIST 800-22a Test Suite

## 4. Proposed Post-Processing Algorithms

#### 4.1. Cell-Discard Algorithm

#### 4.2. Bit-Discard Algorithm

- (1)
- All N bits are composed in the form of 100-by-100.
- (2)
- Calculate the p-value for 100 bits corresponding to each bit string.
- (3)
- Store the distribution values of each p-value from ${F}_{1}$ to ${F}_{10}$ (number of samples that satisfy the p-value of the bit).
- (4)
- Calculate ${\chi}^{2}$, the p-value from the following function: (igamc: see Appendix A)$${\chi}^{2}=\sum _{i=1}^{10}\frac{{\left({F}_{i}-s/10\right)}^{2}}{s/10},p\text{-}\mathrm{value}=igamc\left(\frac{9}{2},\frac{{\chi}^{2}}{2}\right).$$
- (5)
- Bits with a p-value of less than 0.0001 are discarded, and bits with a value of 0.0001 or more are accepted as the final random number.

## 5. TRNG Topology

## 6. Measurements

## 7. Conclusions

## Author Contributions

## Funding

## Conflicts of Interest

## Appendix A

## References

- Liu, Z.; Jin, H.; Hu, Y.-C.; Bailey, M. Practical proactive DDoS-attack mitigation via endpoint-driven in-network traffic control. IEEE/ACM Trans. Netw.
**2018**, 26, 1948–1961. [Google Scholar] [CrossRef] - Cha, B.; Kim, K.; Na, H. Random password generation of OTP system using changed location and angle of fingerprint feature. In Proceedings of the 2008 8th IEEE International Conference on Computer and Information Technology, Sydney, Australia, 8–11 July 2008; pp. 420–425. [Google Scholar]
- Gutterman, Z.; Pinkas, B.; Reinman, T. Analysis of the Linux RNG. In Proceedings of the 2006 IEEE Symposium on Security and Privacy (S&P’06), Berkeley/Oakland, CA, USA, 21–24 May 2006; pp. 371–385. [Google Scholar]
- Forouzan, B.A.; Fegan, S.C. Data Communications and Networking; Huga Media: Berkeley, CA, USA, 2007. [Google Scholar]
- Ziemer, R.E.; Tranter, W.H. Principles of Communications; John Wiley & Sons: Hoboken, NJ, USA, 2014. [Google Scholar]
- Menezes, A.J.; Oorschot, P.C.; Vanstone, S.A. Handbook of Applied Cryptography; CRC Press: Boca Raton, FL, USA, 2016. [Google Scholar]
- Mathew, S.K.; Srinivasan, S.; Anders, M.A.; Kaul, H.; Hsu, S.K.; Sheikh, F.; Agarwal, A.; Satpathy, S.; Krishnamurthy, R.K. 2.4 Gbps 7 mW All-Digital PVT-Variation Tolerant True Random Number Generator for 45nm CMOS High-Performance Microprocessors. IEEE J. Solid-State Circuits
**2012**, 47, 2807–2821. [Google Scholar] [CrossRef] - Poudel, B.; Munir, A. Design and Evaluation of a PVT Variation-Resistant TRNG Circuit. In Proceedings of the 2018 IEEE 36th International Conference on Computer Design (ICCD), Orlando, FL, USA, 7–10 October 2018; pp. 514–521. [Google Scholar]
- Sreekumar, L.; Ramesh, P. Selection of an optimum entropy source design for a true random number generator. Procedia Technol.
**2016**, 25, 598–605. [Google Scholar] [CrossRef] [Green Version] - Muthukumar, A.; Sivasankari, N.; Rampriya, K. Anti-aging true random number generator for secured database storage. In Proceedings of the 2017 4th International Conference on Advanced Computing and Communication Systems (ICACCS), Coimbatore, India, 6–7 January 2017; pp. 1–7. [Google Scholar]
- Cartagena, J.; Gomez, H.; Roa, E. A fully-synthesized TRNG with lightweight cellular-automata based post-processing stage in 130nm CMOS. In Proceedings of the IEEE Nordic Circuits and Systems Conference (NORCAS), Copenhagen, Denmark, 1–2 November 2016; pp. 1–5. [Google Scholar]
- Nam, J.-W.; Ahn, J.-H.; Hong, J.-P. Compact SRAM-Based PUF chip employing body voltage control technique. IEEE Access
**2022**, 10, 22311–22319. [Google Scholar] [CrossRef] - Baek, S.; Yu, G.-H.; Kim, J.; Ngo, C.T.; Eshraghian, J.K.; Hong, J.-P. A reconfigurable SRAM based CMOS PUF with challenge to response pairs. IEEE Access
**2021**, 9, 79947–79960. [Google Scholar] [CrossRef] - Choi, K.-U.; Baek, S.; Heo, J.; Hong, J.-P. A 100% stable sense-amplifier-based physically unclonable function with individually embedded non-volatile memory. IEEE Access
**2020**, 8, 21857–21865. [Google Scholar] [CrossRef] - Kiamehr, S.; Golanbari, M.S.; Tahoori, M.B. Leveraging aging effect to improve SRAM-based true random number generators. In Proceedings of the Design, Automation & Test in Europe Conference & Exhibition (DATE), Lausanne, Switzerland, 27–31 March 2017; pp. 882–885. [Google Scholar]
- Min, L.; Chen, T.; Zang, H. Analysis of fips 140-2 test and chaos-based pseudorandom number generator. Chaotic Model. Simul. (CMSIM)
**2013**, 2, 273–280. [Google Scholar] - Brown, R.G.; Eddelbuettel, D.; Bauer, D. Dieharder; Duke University Physics Department Durham: Durham, NC, USA, 2018. [Google Scholar]
- AIS 31: Functionality Classes and Evaluation Methodology for Physical Random Number Generators, Version 1; Federal Office for Information Security: Bonn, Germany, 2001. Available online: http://www.bsi.bund.de/zerti.z/zert/interpr/ais31e.pdf (accessed on 10 October 2021).
- SP 800-90A Rev. 1; Recommendation for Random Number Generation Using Deterministic Random Bit Generators. National Institute of Standards and Technology: Gaithersburg, MD, USA, 2015.
- SP 800-90B; Recommendation for the Entropy Sources Used for Random Bit Generation. National Institute of Standards and Technology: Gaithersburg, MD, USA, 2018.
- SP 800-90C (Draft); Recommendation for Random Bit Generator (RBG) Constructions. National Institute of Standards and Technology: Gaithersburg, MD, USA, 2016.
- 800-22; A Statistical Test Suite for the Validation of Random Number Generators and Pseudo Random Number Generators for Cryptographic Applications. National Institute of Standards and Technology: Gaithersburg, MD, USA, 2010.
- Dichtl, M.; Golic, J.D. High-speed true random number generation with logic gates only. In Proceedings of the International Workshop on Cryptographic Hardware and Embedded Systems, Vienna, Austria, 10–13 September 2007; Springer: Berlin/Heidelberg, Germany, 2007; pp. 45–62. [Google Scholar]
- Yang, Y.; Jia, S.; Wang, Y.; Zhang, S.; Liu, C. A reliable true random number generator based on novel chaotic ring oscillator. In Proceedings of the 2017 IEEE International Symposium on Circuits and Systems (ISCAS), Baltimore, MD, USA, 28–31 May 2017; pp. 1–4. [Google Scholar]
- Liu, X.; Jia, S.; Zhang, H. A novel high-speed fpga-based true random number generator based on chaotic ring oscillator. In Proceedings of the 2019 IEEE 13th International Conference on ASIC (ASICON), Chongqing, China, 29 October–1 November 2019; pp. 1–4. [Google Scholar]
- Bucci, M.; Germani, L.; Luzzi, R.; Trifiletti, A.; Varanonuovo, M. A high-speed oscillator-based truly random number source for cryptographic applications on a smart card IC. IEEE Trans. Comput.
**2003**, 52, 403–409. [Google Scholar] [CrossRef]

C1 | C2 | C3 | C4 | C5 | C6 | C7 | C8 | C9 | C10 | p-Value | Proportion | Statistical Test | ||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|

50 | 17 | 7 | 5 | 2 | 5 | 4 | 2 | 3 | 5 | 0.000000 | FAIL | 81/100 | FAIL | Frequency (monobit) |

82 | 11 | 3 | 3 | 0 | 1 | 0 | 0 | 0 | 0 | 0.000000 | FAIL | 54/100 | FAIL | Block Frequency (within a block) |

14 | 12 | 13 | 11 | 6 | 10 | 7 | 6 | 10 | 11 | 0.616305 | PASS | 99/100 | PASS | Runs |

13 | 13 | 11 | 8 | 10 | 12 | 10 | 11 | 5 | 7 | 0.719747 | PASS | 99/100 | PASS | Longest Run |

10 | 7 | 11 | 14 | 9 | 4 | 13 | 13 | 8 | 11 | 0.474986 | PASS | 99/100 | PASS | Rank |

17 | 13 | 10 | 8 | 12 | 7 | 7 | 9 | 7 | 10 | 0.401199 | PASS | 97/100 | PASS | FFT |

6 | 10 | 15 | 11 | 12 | 10 | 5 | 11 | 10 | 10 | 0.616305 | PASS | 100/100 | PASS | Linear Complexity |

18 | 13 | 8 | 8 | 15 | 8 | 9 | 4 | 8 | 9 | 0.085587 | PASS | 96/100 | PASS | Non-overlapping Template |

17 | 10 | 10 | 15 | 4 | 9 | 10 | 6 | 11 | 8 | 0.153763 | PASS | 99/100 | PASS | Overlapping Template |

10 | 13 | 12 | 8 | 9 | 10 | 9 | 14 | 6 | 9 | 0.816537 | PASS | 99/100 | PASS | Universal |

100 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0.000000 | FAIL | 1/100 | FAIL | Serial |

82 | 4 | 3 | 4 | 1 | 3 | 0 | 3 | 0 | 0 | 0.000000 | FAIL | 53/100 | FAIL | Approximate Entropy |

49 | 12 | 8 | 9 | 3 | 7 | 3 | 2 | 3 | 4 | 0.000000 | FAIL | 80/100 | FAIL | Cumulative sums |

1 | 4 | 4 | 5 | 7 | 4 | 6 | 4 | 6 | 2 | 0.559523 | PASS | 43/43 | PASS | Random excursions |

2 | 3 | 5 | 5 | 6 | 4 | 4 | 4 | 3 | 7 | 0.811993 | PASS | 43/43 | PASS | Random excursions variants |

Test | p-Value | Proportion |
---|---|---|

Frequency (monobit) | 0.000000(FAIL) | 94/100 (FAIL) |

Block Frequency | 0.337692 (PASS) | 96/100 (PASS) |

Runs | 0.599313 (PASS) | 96/100 (PASS) |

Longest Runs | 0.019951 (PASS) | 99/100 (PASS) |

Rank | 0.639667 (PASS) | 99/100 (PASS) |

FFT | 0.256891 (PASS) | 96/100 (PASS) |

Linear Complexity | 0.254129 (PASS) | 94/100 (FAIL) |

Non overlapping Template | FAIL (sub-test 148) | |

Overlapping Template | 0.153763 (PASS) | 99/100 (PASS) |

Universal | 0.351900 (PASS) | 96/100 (PASS) |

Serial | 0.315716 (PASS) | 96/100 (PASS) |

Approximate Entropy | 0.329154 (PASS) | 96/100 (PASS) |

Cumulative sums | 0.000000 (FAIL) | 93/100 (FAIL) |

Random excursions | PASS (sub-test 8) | |

Random excursions variants | PASS (sub-test 18) |

Test | p-Value | Proportion |
---|---|---|

Frequency (monobit) | 0.000000 (FAIL) | 88/100 (FAIL) |

Block Frequency | 0.000000 (FAIL) | 76/100 (FAIL) |

Runs | 0.816305 (PASS) | 98/100 (PASS) |

Longest Runs | 0.611325 (PASS) | 100/100 (PASS) |

Rank | 0.647689 (PASS) | 98/100 (PASS) |

FFT | 0.509921 (PASS) | 98/100 (PASS) |

Linear Complexity | 0.535311 (PASS) | 100/100 (PASS) |

Non overlapping Template | PASS (sub-test 148) | |

Overlapping Template | 0.256713 (PASS) | 100/100 (PASS) |

Universal | 0.732523 (PASS) | 99/100 (PASS) |

Serial | 0.000000 (FAIL) | 66/100 (FAIL) |

Approximate Entropy | 0.000000 (FAIL) | 72/100 (FAIL) |

Cumulative sums | 0.123551 (PASS) | 98/100 (PASS) |

Random excursions | PASS (sub-test 8) | |

Random excursions variants | PASS (sub-test 18) |

Test | p-Value | Proportion |
---|---|---|

Frequency (monobit) | 0.000000 (FAIL) | 92/100 (FAIL) |

Block Frequency | 0.000000 (FAIL) | 88/100 (FAIL) |

Runs | 0.421350 (PASS) | 99/100 (PASS) |

Longest Runs | 0.121661 (PASS) | 98/100 (PASS) |

Rank | 0.511202 (PASS) | 96/100 (PASS) |

FFT | 0.660332 (PASS) | 100/100 (PASS) |

Linear Complexity | 0.115230 (PASS) | 100/100 (PASS) |

Non overlapping Template | PASS (sub-test 148) | |

Overlapping Template | 0.011225 (PASS) | 98/100 (PASS) |

Universal | 0.672251 (PASS) | 97/100 (PASS) |

Serial | 0.844125 (PASS) | 96/100 (PASS) |

Approximate Entropy | 0.010203 (PASS) | 97/100 (PASS) |

Cumulative sums | 0.886615 (PASS) | 96/100 (PASS) |

Random excursions | PASS (sub-test 8) | |

Random excursions variants | PASS (sub-test 18) |

Test | p-Value | Proportion |
---|---|---|

Frequency (monobit) | 0.946308 (PASS) | 100/100 (PASS) |

Block Frequency | 0.153763 (PASS) | 99/100 (PASS) |

Runs | 0.514124 (PASS) | 99/100 (PASS) |

Longest Runs | 0.851383 (PASS) | 99/100 (PASS) |

Rank | 0.834308 (PASS) | 100/100 (PASS) |

FFT | 0.366918 (PASS) | 100/100 (PASS) |

Linear Complexity | 0.997823 (PASS) | 99/100 (PASS) |

Non overlapping Template | PASS (sub-test 148) | |

Overlapping Template | 0.739918 (PASS) | 100/100 (PASS) |

Universal | 0.834308 (PASS) | 99/100 (PASS) |

Serial | 0.514124 (PASS) | 98/100 (PASS) |

Approximate Entropy | 0.637119 (PASS) | 98/100 (PASS) |

Cumulative sums | 0.289667 (PASS) | 100/100 (PASS) |

Random excursions | PASS (sub-test 8) | |

Random excursions variants | PASS (sub-test 18) |

Performance | Chip-1 | Chip-2 | Chip-3 | Chip-4 | Chip-5 | |
---|---|---|---|---|---|---|

Intrinsic TRNG | Hamming Weight | 0.5278 | 0.5215 | 0.5370 | 0.5441 | 0.5445 |

Number of entire bits | ${10}^{8}$ | ${10}^{8}$ | ${10}^{8}$ | ${10}^{8}$ | ${10}^{8}$ | |

NIST test results | 5-Fail | 5-Fail | 5-Fail | 5-Fail | 5-Fail | |

Applying | Hamming Weight | 0.5069 | 0.5070 | 0.5070 | 0.5065 | 0.5072 |

Cell discard | Discarded bits | $1.5\times {10}^{7}$ | $2.1\times {10}^{7}$ | $2.1\times {10}^{7}$ | $2.1\times {10}^{7}$ | $2.5\times {10}^{7}$ |

Algorithm | NIST test results | 4-Fail | 4-Fail | 4-Fail | 4-Fail | 4-Fail |

Applying | Hamming Weight | 0.5015 | 0.5025 | 0.5030 | 0.5026 | 0.5033 |

Bit discard | Discarded bits | $1.4\times {10}^{7}$ | $1.5\times {10}^{7}$ | $1.6\times {10}^{7}$ | $1.6\times {10}^{7}$ | $1.5\times {10}^{7}$ |

Algorithm | NIST test results | 2-Fail | 2-Fail | 2-Fail | 3-Fail | 3-Fail |

Applying | Hamming Weight | 0.5008 | 0.5003 | 0.5004 | 0.5006 | 0.5008 |

Cell and Bit discard | Discarded bits | $2.7\times {10}^{7}$ | $2.5\times {10}^{7}$ | $2.8\times {10}^{7}$ | $2.8\times {10}^{7}$ | $2.85\times {10}^{7}$ |

Algorithm | (27%) | (25%) | (28%) | (28%) | (28.5%) | |

NIST test results | PASS | PASS | PASS | PASS | PASS |

Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |

© 2022 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Nam, J.-W.; Kim, J.; Hong, J.-P.
Stochastic Cell- and Bit-Discard Technique to Improve Randomness of a TRNG. *Electronics* **2022**, *11*, 1735.
https://doi.org/10.3390/electronics11111735

**AMA Style**

Nam J-W, Kim J, Hong J-P.
Stochastic Cell- and Bit-Discard Technique to Improve Randomness of a TRNG. *Electronics*. 2022; 11(11):1735.
https://doi.org/10.3390/electronics11111735

**Chicago/Turabian Style**

Nam, Jae-Won, Jaewoo Kim, and Jong-Phil Hong.
2022. "Stochastic Cell- and Bit-Discard Technique to Improve Randomness of a TRNG" *Electronics* 11, no. 11: 1735.
https://doi.org/10.3390/electronics11111735