ark-r1cs-std 0.6.0

A standard library for constraint system gadgets
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use core::iter;

use crate::alloc::AllocationMode;

pub(crate) fn modes() -> impl Iterator<Item = AllocationMode> {
    use AllocationMode::*;
    [Constant, Input, Witness].into_iter()
}

pub(crate) fn combination<T: Clone>(
    mut i: impl Iterator<Item = T>,
) -> impl Iterator<Item = (AllocationMode, T)> {
    iter::from_fn(move || i.next().map(|t| modes().map(move |mode| (mode, t.clone()))))
        .flat_map(|x| x)
}