I'd like to host my electronic raffle system on a Pi 2 or Pi 3. However, in some jurisdictions, the random number generator must be certified by an independent testing lab.

Have you ever seen any lab tests or certification of the RNG in the BCM 2835? Or have some idea where I could buy the pre-existing results of such testing? It would really surprise me if I need to commission all-new testing of commodity hardware to verify that it is in fact random.

For reference, here are the tests required in my local jurisdiction:

a) Chi-square test;
b) Equi-distribution (frequency) test;
c) Gap test;
d) Overlaps test;
e) Poker test;
f) Coupon collector's test;
g) Permutation test;
h) Kolmogorov-Smirnov test;
i) Adjacency criterion tests;
j) Order statistic test;
k) Runs tests (patterns of occurrences should not be recurrent);
l) Interplay correlation test;
m) Serial  correlation  test  potency 
n) Tests on subsequences; and 
o) Poisson distribution

CLARIFICATION: I will accept results from any accredited testing lab, that include at least a few of the tests listed above.

  • "here are the tests required in my local jurisdiction" -> That's great but since there is no indication of what counts as having passed a test this question as written is not answerable. You could probably do most of these yourself. Would that count in "your local jurisdiction"? Then what would count? How is anyone else supposed to know?
    – goldilocks
    Commented Oct 5, 2016 at 21:57
  • My questions are the two sentences with question marks after them.
    – Autumn
    Commented Oct 6, 2016 at 15:06
  • What counts as a "lab test" or "certification" in your "local jurisdiction"? Again, no one can answer this as currently written. If you are just fishing for as many possible answers as you can so you can cherry pick the ones that apply and waste everyone else's time, guess again. Please read "What types of questions should I avoid asking?" and 'What does it matter that my question is “unclear” or “too broad”, etc?'.
    – goldilocks
    Commented Oct 6, 2016 at 15:14
  • Petunia's answer below almost certainly answers it, if s/he adds links to the results of the DIEHARD testing.
    – Autumn
    Commented Oct 6, 2016 at 15:15
  • What counts as an "accredited testing lab" in your "local jurisdiction"? If you are serious about this question, obviously this is information you will need to pin down first. Beyond that, this isn't a search engine, but there are at least a few available elsewhere online.
    – goldilocks
    Commented Oct 6, 2016 at 16:31

2 Answers 2


To require a question be "answered" according to your standard is the perrogative of the board, of course, we know you wish to have high standards, but sometimes people need to be told they are 'barking up the wrong tree' and aimed elsewhere. Running a lottery is a neat geeky thing to do with a rng, for sure, but folks still need to be careful that what they are attempting may be a criminal act. And that others are not led unsuspectingly to follow. So here I go off on that....

The following comment also may be helpful to the OP and to others. The OP failed to state his jurisdiction(s) of interest. In many places lotteries of the type described by the OP are highly regulated or outright illegal. They are illegal in California, for example. Whether the activity is a prohibited 'lottery' or whether the lottery regulations are being complied with may be a legal question requiring (almost certainly) the assistance of a lawyer. As a california attorney (and geek with grey hair) I can pretty much assure that the OP would have to be exceedingly careful not to violate California law with his activity. Other places may differ, but consult a lawyer in each jurisdiction. It is likely the 'system' would need to be certified in various ways, otherwise it might not be gaming at all, it might just be an illegal scheme or fraud.

As a geek I applaud the creativity of the OP and advise that DIEHARD statistical testing of the rpi3 hardware RNG have been reported and these tests are most strenuous and time consuming -and geeky - and the rpi3 has come out looking pretty good, imho. I'm not a certifying authority though.

Testing Raspberry Pi Hardware RNG

The OP may also wish to be alerted to assuring the HWRNG is active in his version of ?. I believe it is active in the current raspbian, but earlier versions and pi models apparently needed some geek to get them up and running. So Check this carefully. Finally, the default linux rng isn't actually so bad even without a hardware TRNG. So, consider that.

  • A reference to the DIEHARD statistical testing would be appreciated, I couldn't find anything about it with Google. Local certification requirements are way out of scope, but thanks for your cautionary comments.
    – Autumn
    Commented Oct 6, 2016 at 15:11

This guide here provides very clear instructions on how to generate numbers with the RNG.

In terms of the tests you have proposed I have not found any source which gives the information you are after. I would imagine it is possible to write some code that would perform such tests, or there may be code out there you can use as a starting point. Although, the link earlier in my answer suggests the RNG is cytopgraphic-grade. Surely that should certify it?

  • That's useful and informative, but I don't think my government's gaming board will accept a github link in lieu of lab certification. The best quote I have so far is $7000... which is actually pretty reasonable, but still expensive if the certification exists. I think I'll have to try to contact Broadcom.
    – Autumn
    Commented Apr 13, 2016 at 16:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.