snarkvm_circuit_environment/
lib.rs

1// Copyright 2024 Aleo Network Foundation
2// This file is part of the snarkVM library.
3
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at:
7
8// http://www.apache.org/licenses/LICENSE-2.0
9
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15
16#![forbid(unsafe_code)]
17#![allow(clippy::type_complexity)]
18
19extern crate snarkvm_circuit_environment_witness;
20
21pub use snarkvm_circuit_environment_witness::rename_selfs;
22
23pub mod canary_circuit;
24pub use canary_circuit::*;
25
26pub mod circuit;
27pub use circuit::*;
28
29pub mod environment;
30pub use environment::*;
31
32pub mod helpers;
33pub use helpers::*;
34
35pub mod macros;
36#[allow(unused_imports)]
37pub use macros::*;
38
39pub mod testnet_circuit;
40pub use testnet_circuit::*;
41
42pub mod traits;
43pub use traits::*;
44
45pub mod prelude {
46    pub use crate::{
47        CircuitType,
48        Count,
49        Environment,
50        LinearCombination,
51        Mode,
52        OutputMode,
53        Variable,
54        count,
55        count_is,
56        count_less_than,
57        output_mode,
58        rename_selfs,
59        traits::*,
60        witness,
61        witness_mode,
62    };
63    pub use console::{
64        Parser,
65        ParserResult,
66        TypeName,
67        prelude::{
68            Debug,
69            Display,
70            Error,
71            Formatter,
72            FromStr,
73            One as _,
74            Result,
75            Zero as _,
76            bail,
77            ensure,
78            fmt,
79            has_duplicates,
80        },
81        traits::{
82            Double as _,
83            FromBits as _,
84            Inverse as _,
85            Square as _,
86            SquareRoot as _,
87            ToBits as _,
88            string_parser,
89            types::{
90                integer_magnitude::Magnitude,
91                integer_type::{CheckedPow, IntegerProperties, IntegerType, WrappingDiv, WrappingPow, WrappingRem},
92            },
93        },
94    };
95    pub use snarkvm_fields::{self, Field as _, PrimeField, Zero as _};
96
97    #[cfg(debug_assertions)]
98    pub use snarkvm_curves::AffineCurve as _;
99
100    pub use core::ops::{
101        Add,
102        AddAssign,
103        BitAnd,
104        BitAndAssign,
105        BitOr,
106        BitOrAssign,
107        BitXor,
108        BitXorAssign,
109        Deref,
110        Div,
111        DivAssign,
112        Mul,
113        MulAssign,
114        Neg,
115        Not,
116        Rem,
117        RemAssign,
118        Shl,
119        ShlAssign,
120        Shr,
121        ShrAssign,
122        Sub,
123        SubAssign,
124    };
125    pub use indexmap::IndexMap;
126    pub use itertools::Itertools;
127    pub use nom::{
128        branch::alt,
129        bytes::complete::tag,
130        character::complete::{alpha1, alphanumeric1, char, one_of},
131        combinator::{map, map_res, opt, recognize},
132        multi::{many0, many1},
133        sequence::{pair, terminated},
134    };
135    pub use num_traits::{self, Inv, One as NumOne, Pow, Unsigned};
136    pub use once_cell::unsync::OnceCell;
137}