1#![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#[macro_use]
24pub mod macros;
25
26pub(crate) use ark_std::vec::Vec;
27
28#[doc(hidden)]
29pub mod r1cs_var;
30pub use r1cs_var::*;
31
32pub mod boolean;
34
35pub mod fields;
37
38pub mod groups;
40
41pub mod pairing;
43
44pub mod alloc;
46
47pub mod cmp;
49
50pub mod convert;
52
53pub mod eq;
55
56pub mod poly;
58
59pub mod select;
62
63#[cfg(test)]
64pub(crate) mod test_utils;
65
66pub mod uint8;
68#[macro_use]
71pub mod uint;
72
73pub mod uint16 {
74 pub type UInt16<F> = super::uint::UInt<16, u16, F>;
75}
76pub mod uint32 {
77 pub type UInt32<F> = super::uint::UInt<32, u32, F>;
78}
79pub mod uint64 {
80 pub type UInt64<F> = super::uint::UInt<64, u64, F>;
81}
82pub mod uint128 {
83 pub type UInt128<F> = super::uint::UInt<128, u128, F>;
84}
85
86#[allow(missing_docs)]
87pub mod prelude {
88 pub use crate::{
89 alloc::*,
90 boolean::Boolean,
91 convert::{ToBitsGadget, ToBytesGadget},
92 eq::*,
93 fields::{FieldOpsBounds, FieldVar},
94 groups::{CurveVar, GroupOpsBounds},
95 pairing::PairingVar,
96 select::*,
97 uint128::UInt128,
98 uint16::UInt16,
99 uint32::UInt32,
100 uint64::UInt64,
101 uint8::UInt8,
102 R1CSVar,
103 };
104}
105
106pub trait Assignment<T> {
108 fn get(self) -> Result<T, ark_relations::r1cs::SynthesisError>;
110}
111
112impl<T> Assignment<T> for Option<T> {
113 fn get(self) -> Result<T, ark_relations::r1cs::SynthesisError> {
114 self.ok_or(ark_relations::r1cs::SynthesisError::AssignmentMissing)
115 }
116}