ark_r1cs_std_zypher/
lib.rs1#![cfg_attr(not(feature = "std"), no_std)]
2#![deny(
5 warnings,
6 unused,
7 future_incompatible,
8 nonstandard_style,
9 rust_2018_idioms
10)]
11#![allow(clippy::op_ref)]
12
13#[macro_use]
14extern crate ark_std;
15
16#[macro_use]
17extern crate ark_ff;
18
19#[macro_use]
20extern crate ark_relations;
21
22#[doc(hidden)]
23#[macro_use]
24extern crate derivative;
25
26#[macro_use]
28pub mod macros;
29
30pub(crate) use ark_std::vec::Vec;
31
32#[doc(hidden)]
33pub mod r1cs_var;
34pub use r1cs_var::*;
35
36pub mod boolean;
38
39pub mod fields;
41
42pub mod groups;
44
45pub mod pairing;
47
48pub mod alloc;
50
51pub mod cmp;
53
54pub mod convert;
56
57pub mod eq;
59
60pub mod poly;
62
63pub mod select;
66
67#[cfg(test)]
68pub(crate) mod test_utils;
69
70pub mod uint8;
72#[macro_use]
75pub mod uint;
76
77pub mod uint16 {
78 pub type UInt16<F> = super::uint::UInt<16, u16, F>;
79}
80pub mod uint32 {
81 pub type UInt32<F> = super::uint::UInt<32, u32, F>;
82}
83pub mod uint64 {
84 pub type UInt64<F> = super::uint::UInt<64, u64, F>;
85}
86pub mod uint128 {
87 pub type UInt128<F> = super::uint::UInt<128, u128, F>;
88}
89
90#[allow(missing_docs)]
91pub mod prelude {
92 pub use crate::{
93 alloc::*,
94 boolean::Boolean,
95 convert::{ToBitsGadget, ToBytesGadget},
96 eq::*,
97 fields::{FieldOpsBounds, FieldVar},
98 groups::{CurveVar, GroupOpsBounds},
99 pairing::PairingVar,
100 select::*,
101 uint128::UInt128,
102 uint16::UInt16,
103 uint32::UInt32,
104 uint64::UInt64,
105 uint8::UInt8,
106 R1CSVar,
107 };
108}
109
110pub trait Assignment<T> {
112 fn get(self) -> Result<T, ark_relations::r1cs::SynthesisError>;
114}
115
116impl<T> Assignment<T> for Option<T> {
117 fn get(self) -> Result<T, ark_relations::r1cs::SynthesisError> {
118 self.ok_or(ark_relations::r1cs::SynthesisError::AssignmentMissing)
119 }
120}