Crate fhe_util

source ·
Expand description

Utilities for the fhe.rs library.

Functions§

  • Define catch_unwind to silence the panic in unit tests.
  • Computes the modular multiplicative inverse of a modulo p. Returns None if a is not invertible modulo p.
  • Returns whether the modulus p is prime; this function is 100% accurate.
  • Sample a vector of independent centered binomial distributions of a given variance. Returns an error if the variance is strictly larger than 16.
  • Transcodes a vector of u64 of input_nbits-bit numbers into a vector of u64 of output_nbits-bit numbers.
  • Transcodes a vector of u8 into a vector of u64 of nbits-bit numbers.
  • Transcodes a vector of u64 of nbits-bit numbers into a vector of bytes.
  • Compute the sample variance of a list of values. Panics if the length of value is < 2.