This is a python 3.6 and above implementation of the NIST Test Suite for Random Number Generators (RNGs). The idea behind this work is to make a script oriented object-oriented framework for said tests. This is born from my research since I required to use the tests inside a python research project and I found existing implementation to be not well suited to that task without extensive modifications.
The NIST reference paper can be found at SP800-22r1a.
This work is inspired by the great work of David Johnston (C) 2017, which can be found on github.
Features
All the test in the NIST paper vectorized and optimized the best I could
Class structure for each test allowing for easy debug and use, both in script and inside broader applications
Utility functions to pack the sequence in 8-bits using numpy and to run the tests in multiple ways
Cache system both at function level and at test level to improve performance
Built-in measurement of time required to perform each test
Default Test class and Result class to allow eventual extension to additional tests
License
BSD 3-Clause License
For additional information check the provided license file.
How to install
If you only need to use the framework, just download the pip package nistrng and import the package in your scripts:
pip install nistrng
If you want to improve/modify/extends the framework, or even just try my own simple benchmarks at home, download or clone the git repository. You are welcome to open issues or participate in the project, especially if further optimization is achieved.
How to use
For a simple use case, refer to benchmark provided in the repository. For advanced use, refer to the built-in documentation and to the provided source code in the repository.
Current issues
Currently the slow speed of both the Serial and Approximate Entropy tests is an open issue. Any solution or improvement is welcome.
Changelog
fixed function run in order which presented a small bug preventing it to run at all
Release files for nistrng 1.1.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nistrng-1.1.1.tar.gz | 18.1 kB | Details |
Release files / nistrng-1.1.1.tar.gz
| Download URL | nistrng-1.1.1.tar.gz |
|---|---|
| Size | 18.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a41dfc39040d984f41c95407431d0eef4be7fb6f866a67d76ecd3fec69999463
|
|
BLAKE2b-256 checksum How to use checksums |
e8aa24b71abe431232599bf386a8a5f1a2a55c94208ec5670a9a854d6a53e2fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.32.2 CPython/3.6.8
|