Skip to content

Commit 6046f30

Browse files
committed
update readme
1 parent f0df597 commit 6046f30

File tree

2 files changed

+24
-7
lines changed

2 files changed

+24
-7
lines changed

README.md

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,29 +10,45 @@ Needed an arbitrary width LFSR implementation. The one I've included works for 4
1010

1111
## Usage
1212

13-
### LFSR
13+
### Linear Feedback Shift Register (LFSR / Xorshift)
1414

1515
1. Take files from `src/` and add them to your own project. If you use [hdlmake](https://hdlmake.readthedocs.io/en/master/), you can add this repository itself as a remote module.
1616
1. Other helpful modules are also available in this GitHub organization.
1717
1. Consult the testbench in `test/xorshift_tb.sv` for example usage.
1818
1. Read through the parameter descriptions in `xorshift.sv` and tailor any instantiations to your situation.
1919
1. Please create an issue if you run into a problem or have any questions.
2020

21-
### LHCA
21+
#### Caveats
2222

23-
See `lhca.sv`. It's backed by a ring oscillator as a source of true randomness.
23+
* Does not encompass all values (2 ** WIDTH-1 is missing)
24+
* Predictable values, not suitable for any security-related application
25+
26+
### Ring oscillator
27+
28+
See `src/ring_oscillator.sv`. Because the toggle rate of a ring oscillator depends on logic delays and noise, it can act as a source for truly random n-bit word data.
29+
30+
#### Caveats
31+
32+
* This holds if and only if the sampling clock is lower than the natural oscillating frequency
33+
* The quality of the produced random numbers is poor
34+
* It can be improved by passing it through an LHCA, in which case, it will pass all the [DieHard tests](https://en.wikipedia.org/wiki/Diehard_tests)
35+
36+
### Linear Hybrid Cellular Automata (LHCA)
37+
38+
See `src/lhca.sv`. LFSR generalization suitable for cryptographic applications when sourced with a ring oscillator.
2439

2540
## To-do List
2641

2742
* [x] [Xorshift](https://en.wikipedia.org/wiki/Xorshift) (LFSR)
28-
* [x] [LHCA]()
43+
* [x] [Ring oscillators](https://en.wikipedia.org/wiki/Ring_oscillator)
44+
* [x] [LHCA backed by Ring Oscillators](https://electronics.stackexchange.com/questions/263656/hardware-sources-of-entropy-on-an-fpga)
2945
* [ ] [CBRNG](https://en.wikipedia.org/wiki/Counter-based_random_number_generator_(CBRNG)#Squares_RNG)
30-
* Making Squares RNG arbitrary width seems non-trivial, unfortunately
46+
* Making the Squares RNG arbitrary width seems non-trivial, unfortunately
3147
* More upon request
3248

33-
3449
## Reference Documents
3550

3651
*These documents are not hosted here!*
3752

3853
* [High Speed True Random Number Generators in Xilinx FPGAs](http://forums.xilinx.com/xlnx/attachments/xlnx/EDK/27322/1/HighSpeedTrueRandomNumberGeneratorsinXilinxFPGAs.pdf)
54+
* This is the primary source for the LHCA concept

src/lhca.sv

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ module lhca #(
44
) (
55
input logic clk,
66

7-
// A source of true randomness, makes the LHCA act as a scrambler.
7+
// A source of true randomness, so that the LHCA can act as a scrambler.
8+
// This is different from a seed, in that it should not remain the same.
89
// You can use ring oscillators for this when the oscillation
910
// frequency is significantly higher than the clock frequency.
1011

0 commit comments

Comments
 (0)