lettuce 0.1.3

Healthy lattice consructions in pure Rust.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use crate::FieldScalar;

use rand::Rng;

pub fn ternary_sample<E: FieldScalar, R: Rng>(rng: &mut R) -> E {
    if rng.random::<bool>() {
        E::zero()
    } else if rng.random::<bool>() {
        E::one()
    } else {
        E::negone()
    }
}