snarkvm_circuit_environment/
lib.rs

1// Copyright (c) 2019-2025 Provable Inc.
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_console_network as console;
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            ToBitsRaw as _,
89            string_parser,
90            types::{
91                integer_magnitude::Magnitude,
92                integer_type::{CheckedPow, IntegerProperties, IntegerType, WrappingDiv, WrappingPow, WrappingRem},
93            },
94        },
95    };
96    pub use snarkvm_fields::{self, Field as _, PrimeField, Zero as _};
97
98    #[cfg(debug_assertions)]
99    pub use snarkvm_curves::AffineCurve as _;
100
101    pub use core::ops::{
102        Add,
103        AddAssign,
104        BitAnd,
105        BitAndAssign,
106        BitOr,
107        BitOrAssign,
108        BitXor,
109        BitXorAssign,
110        Deref,
111        Div,
112        DivAssign,
113        Mul,
114        MulAssign,
115        Neg,
116        Not,
117        Rem,
118        RemAssign,
119        Shl,
120        ShlAssign,
121        Shr,
122        ShrAssign,
123        Sub,
124        SubAssign,
125    };
126    pub use indexmap::IndexMap;
127    pub use itertools::Itertools;
128    pub use nom::{
129        branch::alt,
130        bytes::complete::tag,
131        character::complete::{alpha1, alphanumeric1, char, one_of},
132        combinator::{map, map_res, opt, recognize},
133        multi::{many0, many1},
134        sequence::{pair, terminated},
135    };
136    pub use num_traits::{self, Inv, One as NumOne, Pow, Unsigned};
137}