From 42f4a5fed096b3779eeb0490566d4e6be278c5be Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 01:49:34 +0700 Subject: [PATCH 01/18] move trait Scalar --- crates/proof-of-sql/src/base/scalar/mod.rs | 76 +---------------- crates/proof-of-sql/src/base/scalar/scalar.rs | 81 +++++++++++++++++++ 2 files changed, 83 insertions(+), 74 deletions(-) create mode 100644 crates/proof-of-sql/src/base/scalar/scalar.rs diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index 1759554f3..d5ce765bd 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -14,77 +14,5 @@ pub mod test_scalar; #[cfg(test)] mod test_scalar_test; use num_bigint::BigInt; - -/// A trait for the scalar field used in Proof of SQL. -pub trait Scalar: - Clone - + core::fmt::Debug - + core::fmt::Display - + PartialEq - + Default - + for<'a> From<&'a str> - + Sync - + Send - + num_traits::One - + core::iter::Sum - + core::iter::Product - + Sub - + Copy - + core::ops::MulAssign - + core::ops::AddAssign - + num_traits::Zero - + for<'a> core::convert::From<&'a Self> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a bool> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a i8> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a i16> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a i32> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a i64> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a i128> // Required for `Column` to implement `MultilinearExtension` - + for<'a> core::convert::From<&'a u8> // Required for `Column` to implement `MultilinearExtension` - + core::convert::TryInto - + core::convert::TryInto - + core::convert::TryInto - + core::convert::TryInto - + core::convert::TryInto - + core::convert::TryInto - + core::convert::Into<[u64; 4]> - + core::convert::From<[u64; 4]> - + core::cmp::Ord - + core::ops::Neg - + num_traits::Zero - + core::ops::AddAssign - + ark_serialize::CanonicalSerialize //This enables us to put `Scalar`s on the transcript - + ark_std::UniformRand //This enables us to get `Scalar`s as challenges from the transcript - + num_traits::Inv> // Note: `inv` should return `None` exactly when the element is zero. - + core::ops::SubAssign - + super::ref_into::RefInto<[u64; 4]> - + for<'a> core::convert::From<&'a String> - + super::encode::VarInt - + core::convert::From - + core::convert::From - + core::convert::From - + core::convert::From - + core::convert::From - + core::convert::From - + core::convert::From - + core::convert::Into - + TryFrom -{ - /// The value (p - 1) / 2. This is "mid-point" of the field - the "six" on the clock. - /// It is the largest signed value that can be represented in the field with the natural embedding. - const MAX_SIGNED: Self; - /// The 0 (additive identity) element of the field. - const ZERO: Self; - /// The 1 (multiplicative identity) element of the field. - const ONE: Self; - /// 1 + 1 - const TWO: Self; - /// Compare two `Scalar`s as signed numbers. - fn signed_cmp(&self, other: &Self) -> Ordering { - match *self - *other { - x if x.is_zero() => Ordering::Equal, - x if x > Self::MAX_SIGNED => Ordering::Less, - _ => Ordering::Greater, - } - } -} +pub mod scalar; +pub use scalar::Scalar; \ No newline at end of file diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs new file mode 100644 index 000000000..138cf241d --- /dev/null +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -0,0 +1,81 @@ +pub use error::ScalarConversionError; +use alloc::string::String; +use core::{cmp::Ordering, ops::Sub}; +pub use mont_scalar::Curve25519Scalar; +pub(crate) use mont_scalar::MontScalar; +use num_bigint::BigInt; +// use crate::base::encode::varint_trait::VarInt; + +/// A trait for the scalar field used in Proof of SQL. +pub trait Scalar: + Clone + + core::fmt::Debug + + core::fmt::Display + + PartialEq + + Default + + for<'a> From<&'a str> + + Sync + + Send + + num_traits::One + + core::iter::Sum + + core::iter::Product + + Sub + + Copy + + core::ops::MulAssign + + core::ops::AddAssign + + num_traits::Zero + + for<'a> core::convert::From<&'a Self> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a bool> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a i8> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a i16> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a i32> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a i64> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a i128> // Required for `Column` to implement `MultilinearExtension` + + for<'a> core::convert::From<&'a u8> // Required for `Column` to implement `MultilinearExtension` + + core::convert::TryInto + + core::convert::TryInto + + core::convert::TryInto + + core::convert::TryInto + + core::convert::TryInto + + core::convert::TryInto + + core::convert::Into<[u64; 4]> + + core::convert::From<[u64; 4]> + + core::cmp::Ord + + core::ops::Neg + + num_traits::Zero + + core::ops::AddAssign + + ark_serialize::CanonicalSerialize //This enables us to put `Scalar`s on the transcript + + ark_std::UniformRand //This enables us to get `Scalar`s as challenges from the transcript + + num_traits::Inv> // Note: `inv` should return `None` exactly when the element is zero. + + core::ops::SubAssign + + super::ref_into::RefInto<[u64; 4]> + + for<'a> core::convert::From<&'a String> + + super::encode::VarInt + + core::convert::From + + core::convert::From + + core::convert::From + + core::convert::From + + core::convert::From + + core::convert::From + + core::convert::From + + core::convert::Into + + TryFrom +{ + /// The value (p - 1) / 2. This is "mid-point" of the field - the "six" on the clock. + /// It is the largest signed value that can be represented in the field with the natural embedding. + const MAX_SIGNED: Self; + /// The 0 (additive identity) element of the field. + const ZERO: Self; + /// The 1 (multiplicative identity) element of the field. + const ONE: Self; + /// 1 + 1 + const TWO: Self; + /// Compare two `Scalar`s as signed numbers. + fn signed_cmp(&self, other: &Self) -> Ordering { + match *self - *other { + x if x.is_zero() => Ordering::Equal, + x if x > Self::MAX_SIGNED => Ordering::Less, + _ => Ordering::Greater, + } + } +} \ No newline at end of file From 221e25d385fa41abc00aa962c3b9ab2f6d94f511 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 01:59:03 +0700 Subject: [PATCH 02/18] update VarInt --- crates/proof-of-sql/src/base/scalar/scalar.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 138cf241d..843a0d2fd 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -4,7 +4,7 @@ use core::{cmp::Ordering, ops::Sub}; pub use mont_scalar::Curve25519Scalar; pub(crate) use mont_scalar::MontScalar; use num_bigint::BigInt; -// use crate::base::encode::varint_trait::VarInt; +use crate::base::encode::varint_trait::VarInt; /// A trait for the scalar field used in Proof of SQL. pub trait Scalar: @@ -50,7 +50,7 @@ pub trait Scalar: + core::ops::SubAssign + super::ref_into::RefInto<[u64; 4]> + for<'a> core::convert::From<&'a String> - + super::encode::VarInt + + VarInt + core::convert::From + core::convert::From + core::convert::From From fd1f519d49d51f3465e63b7c44ecb25ec0a9630a Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 02:18:49 +0700 Subject: [PATCH 03/18] update scalar --- crates/proof-of-sql/src/base/scalar/mod.rs | 5 ++--- crates/proof-of-sql/src/base/scalar/scalar.rs | 9 ++++----- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index d5ce765bd..63ba5ca52 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -1,11 +1,11 @@ //! This module contains the definition of the `Scalar` trait, which is used to represent the scalar field used in Proof of SQL. mod error; pub use error::ScalarConversionError; +pub use super::ref_into::RefInto; +pub use super::encode::VarInt; mod mont_scalar; #[cfg(test)] mod mont_scalar_test; -use alloc::string::String; -use core::{cmp::Ordering, ops::Sub}; pub use mont_scalar::Curve25519Scalar; pub(crate) use mont_scalar::MontScalar; /// Module for a test Scalar @@ -13,6 +13,5 @@ pub(crate) use mont_scalar::MontScalar; pub mod test_scalar; #[cfg(test)] mod test_scalar_test; -use num_bigint::BigInt; pub mod scalar; pub use scalar::Scalar; \ No newline at end of file diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 843a0d2fd..5585f05f9 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -1,10 +1,9 @@ -pub use error::ScalarConversionError; use alloc::string::String; use core::{cmp::Ordering, ops::Sub}; -pub use mont_scalar::Curve25519Scalar; -pub(crate) use mont_scalar::MontScalar; use num_bigint::BigInt; -use crate::base::encode::varint_trait::VarInt; +use crate::base::scalar::ScalarConversionError; +use crate::base::encode::VarInt; +use crate::base::scalar::RefInto; /// A trait for the scalar field used in Proof of SQL. pub trait Scalar: @@ -48,7 +47,7 @@ pub trait Scalar: + ark_std::UniformRand //This enables us to get `Scalar`s as challenges from the transcript + num_traits::Inv> // Note: `inv` should return `None` exactly when the element is zero. + core::ops::SubAssign - + super::ref_into::RefInto<[u64; 4]> + + RefInto<[u64; 4]> + for<'a> core::convert::From<&'a String> + VarInt + core::convert::From From 3b22ecd16d3aff11a28cd8aba79daa1d769a2123 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 02:52:29 +0700 Subject: [PATCH 04/18] rename scalar file --- .../proof-of-sql/src/base/scalar/{scalar.rs => scalar_trait.rs} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename crates/proof-of-sql/src/base/scalar/{scalar.rs => scalar_trait.rs} (100%) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs similarity index 100% rename from crates/proof-of-sql/src/base/scalar/scalar.rs rename to crates/proof-of-sql/src/base/scalar/scalar_trait.rs From d2c86e6dfd8bf7c7e339d22b942be08c328a2708 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 02:52:52 +0700 Subject: [PATCH 05/18] update scalar mod --- crates/proof-of-sql/src/base/scalar/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index 63ba5ca52..d7a584af2 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -13,5 +13,5 @@ pub(crate) use mont_scalar::MontScalar; pub mod test_scalar; #[cfg(test)] mod test_scalar_test; -pub mod scalar; -pub use scalar::Scalar; \ No newline at end of file +pub mod scalar_trait; +pub use scalar_trait::Scalar; \ No newline at end of file From 9ef11928b235b4dac36635f56e6ba30e9a4c9128 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 02:57:08 +0700 Subject: [PATCH 06/18] add doc for module --- crates/proof-of-sql/src/base/scalar/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index d7a584af2..fb34e09b3 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -1,4 +1,6 @@ //! This module contains the definition of the `Scalar` trait, which is used to represent the scalar field used in Proof of SQL. +pub mod scalar_trait; +pub use scalar_trait::Scalar; mod error; pub use error::ScalarConversionError; pub use super::ref_into::RefInto; @@ -12,6 +14,4 @@ pub(crate) use mont_scalar::MontScalar; #[cfg(test)] pub mod test_scalar; #[cfg(test)] -mod test_scalar_test; -pub mod scalar_trait; -pub use scalar_trait::Scalar; \ No newline at end of file +mod test_scalar_test; \ No newline at end of file From 1f91f2e27cad1c0ec3f6ffd9b912416676016c8e Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 03:02:04 +0700 Subject: [PATCH 07/18] typo --- crates/proof-of-sql/src/base/scalar/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index fb34e09b3..a7acf4996 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -1,4 +1,4 @@ -//! This module contains the definition of the `Scalar` trait, which is used to represent the scalar field used in Proof of SQL. +/// This module contains the definition of the `Scalar` trait, which is used to represent the scalar field used in Proof of SQL. pub mod scalar_trait; pub use scalar_trait::Scalar; mod error; From 0c84add883eb0fa77e69b7b4fbe7576712f38f9b Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 03:05:27 +0700 Subject: [PATCH 08/18] update --- crates/proof-of-sql/src/base/mod.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/proof-of-sql/src/base/mod.rs b/crates/proof-of-sql/src/base/mod.rs index f8fccd6a3..0eff4ccdb 100644 --- a/crates/proof-of-sql/src/base/mod.rs +++ b/crates/proof-of-sql/src/base/mod.rs @@ -10,6 +10,7 @@ pub mod math; pub(crate) mod polynomial; pub(crate) mod proof; pub(crate) mod ref_into; +/// TODO: add docs pub mod scalar; mod serialize; pub(crate) use serialize::{impl_serde_for_ark_serde_checked, impl_serde_for_ark_serde_unchecked}; From 754bf8ed2557ca087375449499b7def566b84884 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 03:13:32 +0700 Subject: [PATCH 09/18] fix formatting --- crates/proof-of-sql/src/base/scalar/mod.rs | 3 +-- crates/proof-of-sql/src/base/scalar/scalar_trait.rs | 7 ++++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index a7acf4996..02049b94c 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -3,8 +3,7 @@ pub mod scalar_trait; pub use scalar_trait::Scalar; mod error; pub use error::ScalarConversionError; -pub use super::ref_into::RefInto; -pub use super::encode::VarInt; +pub use super::{encode::VarInt, ref_into::RefInto}; mod mont_scalar; #[cfg(test)] mod mont_scalar_test; diff --git a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs index 5585f05f9..e9195377a 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs @@ -1,9 +1,10 @@ use alloc::string::String; use core::{cmp::Ordering, ops::Sub}; use num_bigint::BigInt; -use crate::base::scalar::ScalarConversionError; -use crate::base::encode::VarInt; -use crate::base::scalar::RefInto; +use crate::base::{ + encode::VarInt, + scalar::{RefInto, ScalarConversionError}, +}; /// A trait for the scalar field used in Proof of SQL. pub trait Scalar: From 4bf354b0f69bca834e76d61cbd9dabbd88fa545b Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 03:16:24 +0700 Subject: [PATCH 10/18] fix format --- crates/proof-of-sql/src/base/scalar/mod.rs | 2 +- crates/proof-of-sql/src/base/scalar/scalar_trait.rs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index 02049b94c..6de540862 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -2,8 +2,8 @@ pub mod scalar_trait; pub use scalar_trait::Scalar; mod error; -pub use error::ScalarConversionError; pub use super::{encode::VarInt, ref_into::RefInto}; +pub use error::ScalarConversionError; mod mont_scalar; #[cfg(test)] mod mont_scalar_test; diff --git a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs index e9195377a..7cef88da9 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs @@ -1,10 +1,10 @@ -use alloc::string::String; -use core::{cmp::Ordering, ops::Sub}; -use num_bigint::BigInt; use crate::base::{ encode::VarInt, scalar::{RefInto, ScalarConversionError}, }; +use alloc::string::String; +use core::{cmp::Ordering, ops::Sub}; +use num_bigint::BigInt; /// A trait for the scalar field used in Proof of SQL. pub trait Scalar: From e85630b798fde82688515e30fcc1707460f64dd7 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Fri, 11 Oct 2024 03:19:24 +0700 Subject: [PATCH 11/18] add blank line --- crates/proof-of-sql/src/base/scalar/mod.rs | 2 +- crates/proof-of-sql/src/base/scalar/scalar_trait.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index 6de540862..1e1c90b44 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -13,4 +13,4 @@ pub(crate) use mont_scalar::MontScalar; #[cfg(test)] pub mod test_scalar; #[cfg(test)] -mod test_scalar_test; \ No newline at end of file +mod test_scalar_test; diff --git a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs index 7cef88da9..4b4696ef9 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar_trait.rs @@ -78,4 +78,4 @@ pub trait Scalar: _ => Ordering::Greater, } } -} \ No newline at end of file +} From ec0e64002aeb644b5c8455d26f3ce2b24ed270fd Mon Sep 17 00:00:00 2001 From: winrhcp Date: Mon, 14 Oct 2024 21:42:11 +0700 Subject: [PATCH 12/18] rename --- crates/proof-of-sql/src/base/scalar/mod.rs | 4 ++-- .../src/base/scalar/{scalar_trait.rs => scalar.rs} | 0 2 files changed, 2 insertions(+), 2 deletions(-) rename crates/proof-of-sql/src/base/scalar/{scalar_trait.rs => scalar.rs} (100%) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index 1e1c90b44..d6f3a06ce 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -1,6 +1,6 @@ /// This module contains the definition of the `Scalar` trait, which is used to represent the scalar field used in Proof of SQL. -pub mod scalar_trait; -pub use scalar_trait::Scalar; +pub mod scalar; +pub use scalar::Scalar; mod error; pub use super::{encode::VarInt, ref_into::RefInto}; pub use error::ScalarConversionError; diff --git a/crates/proof-of-sql/src/base/scalar/scalar_trait.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs similarity index 100% rename from crates/proof-of-sql/src/base/scalar/scalar_trait.rs rename to crates/proof-of-sql/src/base/scalar/scalar.rs From f61a492ccb5882b65b6c20cd07dc00ec8c79f09c Mon Sep 17 00:00:00 2001 From: winrhcp Date: Mon, 14 Oct 2024 21:56:59 +0700 Subject: [PATCH 13/18] add allow module_inception --- crates/proof-of-sql/src/base/scalar/scalar.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 4b4696ef9..3fd30031d 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -1,3 +1,5 @@ +#[allow(clippy::module_inception)] + use crate::base::{ encode::VarInt, scalar::{RefInto, ScalarConversionError}, From 03b734cf01b0f4a99b68612d388fec336f95e4a7 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Mon, 14 Oct 2024 21:58:37 +0700 Subject: [PATCH 14/18] typo --- crates/proof-of-sql/src/base/scalar/scalar.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 3fd30031d..244aa3f7d 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -1,4 +1,4 @@ -#[allow(clippy::module_inception)] +#![allow(clippy::module_inception)] use crate::base::{ encode::VarInt, From b277abc12d86c2136ed75f4718a767e1dc955154 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Sat, 19 Oct 2024 14:02:06 +0700 Subject: [PATCH 15/18] Update crates/proof-of-sql/src/base/mod.rs Co-authored-by: Jay White --- crates/proof-of-sql/src/base/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/proof-of-sql/src/base/mod.rs b/crates/proof-of-sql/src/base/mod.rs index 0eff4ccdb..ad5573639 100644 --- a/crates/proof-of-sql/src/base/mod.rs +++ b/crates/proof-of-sql/src/base/mod.rs @@ -10,7 +10,7 @@ pub mod math; pub(crate) mod polynomial; pub(crate) mod proof; pub(crate) mod ref_into; -/// TODO: add docs +/// This module contains the `Scalar` trait as well as the main, generic, implementations of it. pub mod scalar; mod serialize; pub(crate) use serialize::{impl_serde_for_ark_serde_checked, impl_serde_for_ark_serde_unchecked}; From 40ae005fa25d4c0d2ae0ca462e55fce24cfaa16b Mon Sep 17 00:00:00 2001 From: winrhcp Date: Sat, 19 Oct 2024 14:07:28 +0700 Subject: [PATCH 16/18] Update crates/proof-of-sql/src/base/scalar/mod.rs Co-authored-by: Jay White --- crates/proof-of-sql/src/base/scalar/mod.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/proof-of-sql/src/base/scalar/mod.rs b/crates/proof-of-sql/src/base/scalar/mod.rs index d6f3a06ce..c4af60f39 100644 --- a/crates/proof-of-sql/src/base/scalar/mod.rs +++ b/crates/proof-of-sql/src/base/scalar/mod.rs @@ -2,7 +2,6 @@ pub mod scalar; pub use scalar::Scalar; mod error; -pub use super::{encode::VarInt, ref_into::RefInto}; pub use error::ScalarConversionError; mod mont_scalar; #[cfg(test)] From 03dde115d3f6d90b2989b0a31f7ffbedaac2c0ed Mon Sep 17 00:00:00 2001 From: winrhcp Date: Sat, 19 Oct 2024 14:16:24 +0700 Subject: [PATCH 17/18] update ref_into --- crates/proof-of-sql/src/base/scalar/scalar.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 244aa3f7d..73cb21e67 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -2,7 +2,8 @@ use crate::base::{ encode::VarInt, - scalar::{RefInto, ScalarConversionError}, + ref_into::RefInto, + scalar::ScalarConversionError, }; use alloc::string::String; use core::{cmp::Ordering, ops::Sub}; From 4dfba04b325098458d02e819e761f2b5e37cef22 Mon Sep 17 00:00:00 2001 From: winrhcp Date: Sat, 19 Oct 2024 14:18:21 +0700 Subject: [PATCH 18/18] format --- crates/proof-of-sql/src/base/scalar/scalar.rs | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/crates/proof-of-sql/src/base/scalar/scalar.rs b/crates/proof-of-sql/src/base/scalar/scalar.rs index 73cb21e67..38c77cdea 100644 --- a/crates/proof-of-sql/src/base/scalar/scalar.rs +++ b/crates/proof-of-sql/src/base/scalar/scalar.rs @@ -1,10 +1,6 @@ #![allow(clippy::module_inception)] -use crate::base::{ - encode::VarInt, - ref_into::RefInto, - scalar::ScalarConversionError, -}; +use crate::base::{encode::VarInt, ref_into::RefInto, scalar::ScalarConversionError}; use alloc::string::String; use core::{cmp::Ordering, ops::Sub}; use num_bigint::BigInt;