From 7405a6284af9da152e96dd686006dc47adc75b9e Mon Sep 17 00:00:00 2001 From: collin Date: Fri, 17 Jul 2020 13:56:13 -0700 Subject: [PATCH] rename gadgets, remove unused files --- compiler/src/value/field/mod.rs | 2 -- compiler/src/value/field/to_string.rs | 5 ----- gadgets/src/arithmetic/add.rs | 2 +- gadgets/src/arithmetic/div.rs | 2 +- gadgets/src/arithmetic/mul.rs | 2 +- gadgets/src/arithmetic/neg.rs | 2 +- gadgets/src/arithmetic/pow.rs | 2 +- gadgets/src/arithmetic/sub.rs | 2 +- gadgets/src/big_integer/mod.rs | 1 - gadgets/src/big_integer/to_decimal.rs | 1 - gadgets/src/lib.rs | 2 -- 11 files changed, 6 insertions(+), 17 deletions(-) delete mode 100644 compiler/src/value/field/to_string.rs delete mode 100644 gadgets/src/big_integer/mod.rs delete mode 100644 gadgets/src/big_integer/to_decimal.rs diff --git a/compiler/src/value/field/mod.rs b/compiler/src/value/field/mod.rs index edd2019e9b..3be1984e7e 100644 --- a/compiler/src/value/field/mod.rs +++ b/compiler/src/value/field/mod.rs @@ -4,5 +4,3 @@ pub mod input; pub mod field_type; pub use self::field_type::*; - -pub mod to_string; diff --git a/compiler/src/value/field/to_string.rs b/compiler/src/value/field/to_string.rs deleted file mode 100644 index 7ebe8e6489..0000000000 --- a/compiler/src/value/field/to_string.rs +++ /dev/null @@ -1,5 +0,0 @@ -// use snarkos_utilities::BigInteger; -// -// pub fn format_bigint(int: &BigInteger) -> String { -// -// } diff --git a/gadgets/src/arithmetic/add.rs b/gadgets/src/arithmetic/add.rs index a7a864190f..522da0819b 100644 --- a/gadgets/src/arithmetic/add.rs +++ b/gadgets/src/arithmetic/add.rs @@ -7,7 +7,7 @@ use snarkos_models::{ }, }; -/// Returns addition of two gadgets in the constraint system +/// Returns addition of `self` + `other` in the constraint system. pub trait Add where Self: std::marker::Sized, diff --git a/gadgets/src/arithmetic/div.rs b/gadgets/src/arithmetic/div.rs index 6d407d34d1..097ae5962e 100644 --- a/gadgets/src/arithmetic/div.rs +++ b/gadgets/src/arithmetic/div.rs @@ -1,6 +1,6 @@ use snarkos_models::{curves::Field, gadgets::r1cs::ConstraintSystem}; -/// Returns division of two gadgets in the constraint system +/// Returns division of `self` / `other` in the constraint system. pub trait Div where Self: std::marker::Sized, diff --git a/gadgets/src/arithmetic/mul.rs b/gadgets/src/arithmetic/mul.rs index fa4430a6f6..207fa8b212 100644 --- a/gadgets/src/arithmetic/mul.rs +++ b/gadgets/src/arithmetic/mul.rs @@ -1,6 +1,6 @@ use snarkos_models::{curves::Field, gadgets::r1cs::ConstraintSystem}; -/// Returns multiplication of two gadgets in the constraint system +/// Returns multiplication of `self` * `other` in the constraint system. pub trait Mul where Self: std::marker::Sized, diff --git a/gadgets/src/arithmetic/neg.rs b/gadgets/src/arithmetic/neg.rs index 976bdc2f87..9eabb4d83f 100644 --- a/gadgets/src/arithmetic/neg.rs +++ b/gadgets/src/arithmetic/neg.rs @@ -6,7 +6,7 @@ use snarkos_models::{ gadgets::{r1cs::ConstraintSystem, utilities::boolean::Boolean}, }; -/// Returns a negated representation of the given signed integer. +/// Returns a negated representation of `self` in the constraint system. pub trait Neg where Self: std::marker::Sized, diff --git a/gadgets/src/arithmetic/pow.rs b/gadgets/src/arithmetic/pow.rs index 6892ceb8e2..9cb07f95b1 100644 --- a/gadgets/src/arithmetic/pow.rs +++ b/gadgets/src/arithmetic/pow.rs @@ -1,6 +1,6 @@ use snarkos_models::{curves::Field, gadgets::r1cs::ConstraintSystem}; -/// Exponentiation for a signed integer gadget +/// Returns exponentiation of `self` ** `other` in the constraint system. pub trait Pow where Self: std::marker::Sized, diff --git a/gadgets/src/arithmetic/sub.rs b/gadgets/src/arithmetic/sub.rs index f83c7c7126..370b375908 100644 --- a/gadgets/src/arithmetic/sub.rs +++ b/gadgets/src/arithmetic/sub.rs @@ -1,6 +1,6 @@ use snarkos_models::{curves::Field, gadgets::r1cs::ConstraintSystem}; -/// Subtraction for a signed integer gadget +/// Returns subtraction of `self` - `other` in the constraint system. pub trait Sub where Self: std::marker::Sized, diff --git a/gadgets/src/big_integer/mod.rs b/gadgets/src/big_integer/mod.rs deleted file mode 100644 index 7ad825d704..0000000000 --- a/gadgets/src/big_integer/mod.rs +++ /dev/null @@ -1 +0,0 @@ -pub mod to_decimal; diff --git a/gadgets/src/big_integer/to_decimal.rs b/gadgets/src/big_integer/to_decimal.rs deleted file mode 100644 index 46db65e685..0000000000 --- a/gadgets/src/big_integer/to_decimal.rs +++ /dev/null @@ -1 +0,0 @@ -// (12AB655E9A2CA55660B44D1E5C37B00159AA76FED00000010A11800000000000)₁₆ = (1 × 16⁶³) + (2 × 16⁶²) + (10 × 16⁶¹) + (11 × 16⁶⁰) + (6 × 16⁵⁹) + (5 × 16⁵⁸) + (5 × 16⁵⁷) + (14 × 16⁵⁶) + (9 × 16⁵⁵) + (10 × 16⁵⁴) + (2 × 16⁵³) + (12 × 16⁵²) + (10 × 16⁵¹) + (5 × 16⁵⁰) + (5 × 16⁴⁹) + (6 × 16⁴⁸) + (6 × 16⁴⁷) + (0 × 16⁴⁶) + (11 × 16⁴⁵) + (4 × 16⁴⁴) + (4 × 16⁴³) + (13 × 16⁴²) + (1 × 16⁴¹) + (14 × 16⁴⁰) + (5 × 16³⁹) + (12 × 16³⁸) + (3 × 16³⁷) + (7 × 16³⁶) + (11 × 16³⁵) + (0 × 16³⁴) + (0 × 16³³) + (1 × 16³²) + (5 × 16³¹) + (9 × 16³⁰) + (10 × 16²⁹) + (10 × 16²⁸) + (7 × 16²⁷) + (6 × 16²⁶) + (15 × 16²⁵) + (14 × 16²⁴) + (13 × 16²³) + (0 × 16²²) + (0 × 16²¹) + (0 × 16²⁰) + (0 × 16¹⁹) + (0 × 16¹⁸) + (0 × 16¹⁷) + (1 × 16¹⁶) + (0 × 16¹⁵) + (10 × 16¹⁴) + (1 × 16¹³) + (1 × 16¹²) + (8 × 16¹¹) + (0 × 16¹⁰) + (0 × 16⁹) + (0 × 16⁸) + (0 × 16⁷) + (0 × 16⁶) + (0 × 16⁵) + (0 × 16⁴) + (0 × 16³) + (0 × 16²) + (0 × 16¹) + (0 × 16⁰) = (8444461749428370424248824938781546531375899335154063827935233455917409239040)₁₀ diff --git a/gadgets/src/lib.rs b/gadgets/src/lib.rs index 3d2103c0ba..6d7eacfe77 100644 --- a/gadgets/src/lib.rs +++ b/gadgets/src/lib.rs @@ -3,8 +3,6 @@ extern crate thiserror; pub mod arithmetic; -pub mod big_integer; - pub mod bits; pub mod errors;