opentitan icon indicating copy to clipboard operation
opentitan copied to clipboard

[entropy_src] Statistical Arguments on entropy_src health check definitions

Open martin-lueker opened this issue 6 years ago • 15 comments

I'm approving #1943, pending a more detailed review of the statistical arguments around how to define health checks when merging several (assumedly) independent data streams. Any one with strong opinions on statistics should weigh in on this mathematically motivated point. This discussion should at least include: @zi-v, @martin-lueker, @felixmiller, @cyrilguyot. Everyone should feel free to weigh in.

This deliverables should be at least.

  • a detailed definition of the test definition
  • A formula relating the RCT and APT thresholds, queue depths, and the nominal miniumu entropy/bit to the rate of false positives in the entropy/bit of an given source.
  • Guidelines for setting the thresholds
  • An outline of the assumptions: Notably: "How weak a correlation can we tolerate between analog channels?"
  • Limits of the entropy/bit for the interleaved entropy stream, given our assumptions about the individual entropy streams.
  • A second review of the RTL, confirming that the implementation matches the more clearly defined test.

martin-lueker avatar May 02 '20 01:05 martin-lueker

@martin-lueker, @mwbranstad - is this part of Entropy D2 backlog or already merged?

mateenfaisal avatar Jan 18 '21 23:01 mateenfaisal

Hi Faisal, This is largely a documentation task, and is more relevant to the security review, than the silicon readiness review. I don't think there are any gating factors here for Silicon.

martin-lueker avatar Jan 19 '21 01:01 martin-lueker

Update: Need to add Symbol RepCnt

martin-lueker avatar Feb 09 '21 18:02 martin-lueker

@msfschaffner - we are looking at remaining efforts in V2 review checklist. This item is tagged as both M3 and V2. The Milestone change seems to be the most recent activity. Shall we change the tag to V2S or does part of this work need to be resolved before V2 checklist can be closed out? Please comment tag @andreaskurth once decided as he's actively working on trying to close out remaining V2 items.

johngt avatar Nov 07 '22 14:11 johngt

This appears to be mostly a documentation exercise that we can take care of when signing off to D3. As such, it does not have to go into V2S / M2. Let me relabel that accordingly.

CC @moidx @tjaychen @johannheyszl let me know if you think otherwise.

msfschaffner avatar Nov 07 '22 17:11 msfschaffner

since others are helping with some of the directed M2 tasks of entropy_src, it would be nice if @martin-lueker could help out with the documentation side things just in case it has any impact on V2S/

tjaychen avatar Nov 07 '22 17:11 tjaychen

Hi All, This issue is really intended as a guideline for firmware and software developers defining the health test thresholds and window sizes. The real impacts will come in defining the thresholds:

  1. Boot thresholds to be written to OTP
  2. "FIPS-mode" thresholds written as part of RomExt or even later.

Any changes to the DUT as a result of these documentation would be an optimization, so I agree it can be deferred to D3/M3.

martin-lueker avatar Nov 07 '22 19:11 martin-lueker

My understanding is that this issue is not critical for TO. But it's relevant afterwards when threshold values need to be written to OTP and RomExt. I am thus putting this to backlog rather than M2.5.

vogelpi avatar Feb 24 '23 16:02 vogelpi

@cfrantz @timothytrippel @moidx is this relevant for the current ROM_EXT development?

msfschaffner avatar Nov 07 '23 21:11 msfschaffner

@johannheyszl and I just discussed this, this needs to be addressed by someone having insight into AST and ROM_EXT development. @cfrantz WDYT?

vogelpi avatar Dec 04 '23 10:12 vogelpi

entropy src health tests need threshold values which are written to OTP during provisioning or set by RomExt. Relabeling this issue for those stages.

johannheyszl avatar Jan 12 '24 12:01 johannheyszl

We assume current HW health checks will be fit to process threshold parameters that are later derived for FIPS certification. We also have the SW fallback in the unlikely case this would be not true (see #20952).

Changed the milestone to PROD ROM_ext.

johannheyszl avatar Jan 24 '24 14:01 johannheyszl

I'm currently trying to get first measurements. @vogelpi , when I'm unpacking samples from ENTROPY_SRC_FW_OV_RD_DATA - where does first bits go - in low bits or in high bits? Practically I need to recover a sequence of 1-bit (or 4-bit) samples in time for the test.

vsukhoml avatar May 01 '24 17:05 vsukhoml

Entropy source uses the hw/ip/prim/rtl/prim_packer_fifo.sv primitive for the 1-to-4 packing (in single-channel mode) and the 4-to-32 packing in front of the observe FIFO. This primitive packs the earlier bits into the lower positions. For example, if in 4-channel mode, you received 0 1 2 3 4 5 6 7 8 in this order, you should read the following from the observe FIFO:

MSB - 7 6 5 4 3 2 1 0 - LSB

vogelpi avatar May 02 '24 14:05 vogelpi

@vogelpi thank you! and in 4-channel mode each channel will always be in the same position, right? Would this be affected by health checks if one of the health checks reports issue? I run with very relaxed health checks so they shouldn't be impact output, but it is more as curiosity.

vsukhoml avatar May 02 '24 17:05 vsukhoml