plonk_gadgets/lib.rs
1// This Source Code Form is subject to the terms of the Mozilla Public
2// License, v. 2.0. If a copy of the MPL was not distributed with this
3// file, You can obtain one at http://mozilla.org/MPL/2.0/.
4//
5// Copyright (c) DUSK NETWORK. All rights reserved.
6
7//! # Plonk Gadgets
8//! This library cointains the gadgets that the Dusk-Network protocol needs to build it's ZK-Circuits.
9//! The library **contains generic gadgets** which are used across Dusk's tech stack, all of the other
10//! gadgets used which depend on foreign types are placed on the libraries where this types are defined.
11//!
12//!
13//! ## WARNING
14//! This implementation is not audited. Use under your own responsability.
15//!
16//! ## Content
17//! This library provides:
18//!
19//! - Scalar gadgets: `is_non-zero`, `maybe_equals`, `conditionally_select_one`, `conditionally_select_zero`.
20//! - Range gadgets: `range_check`, `max_bound`.
21
22#![doc(
23 html_logo_url = "https://lh3.googleusercontent.com/SmwswGxtgIANTbDrCOn5EKcRBnVdHjmYsHYxLq2HZNXWCQ9-fZyaea-bNgdX9eR0XGSqiMFi=w128-h128-e365"
24)]
25#![doc(html_favicon_url = "https://dusk.network/lib/img/favicon-16x16.png")]
26// We need to perform bitshifting sometimes.
27#![allow(clippy::suspicious_arithmetic_impl)]
28// We have cases where we just have `Variables` which don't have any descriptive name.
29#![allow(clippy::many_single_char_names)]
30#![deny(missing_debug_implementations)]
31#![deny(missing_docs)]
32#![deny(unsafe_code)]
33#![no_std]
34
35extern crate alloc;
36
37pub(crate) mod allocated_scalar;
38pub mod errors;
39pub mod range;
40pub mod scalar;
41
42pub use crate::errors::Error;
43pub use allocated_scalar::AllocatedScalar;
44pub use range as RangeGadgets;
45pub use scalar as ScalarGadgets;