Skip to main content

condition

Function condition 

Source
pub fn condition(raw: &[u8], n_output: usize, mode: ConditioningMode) -> Vec<u8> 
Expand description

Apply the specified conditioning mode to raw entropy bytes.

This is the single gateway for all entropy conditioning. No other code in the crate should perform SHA-256, Von Neumann debiasing, or any other form of whitening/post-processing on entropy data.

  • Raw: returns the input unchanged (truncated or zero-padded to n_output)
  • VonNeumann: debiases then truncates/pads to n_output
  • Sha256: chained SHA-256 hashing to produce exactly n_output bytes