diff --git a/Cargo.lock b/Cargo.lock index 1350ab8563..2af5348a4b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -479,7 +479,6 @@ dependencies = [ "pest-ast", "pest_derive", "rand", - "rand_xorshift", "sha2", "snarkos-algorithms", "snarkos-curves", diff --git a/compiler/Cargo.toml b/compiler/Cargo.toml index 5dd6c0c6b5..78b7fdd6c5 100644 --- a/compiler/Cargo.toml +++ b/compiler/Cargo.toml @@ -21,5 +21,4 @@ pest = { version = "2.0" } pest-ast = { version = "0.3.3" } pest_derive = { version = "2.0" } rand = { version = "0.7" } -rand_xorshift = { version = "0.2" } sha2 = { version = "0.8" } diff --git a/compiler/src/constraints/group.rs b/compiler/src/constraints/group.rs index 3da055b9f0..aa7c9ba552 100644 --- a/compiler/src/constraints/group.rs +++ b/compiler/src/constraints/group.rs @@ -16,7 +16,7 @@ pub(crate) fn group_from_input, CS: Const if let InputValue::Group(group_string) = input { Some(group_string) } else { - return Err(GroupError::InvalidGroup(input.to_string())); + return Err(GroupError::Invalid(input.to_string())); } } None => None, diff --git a/compiler/src/errors/constraints/group.rs b/compiler/src/errors/constraints/group.rs index 238938d8d0..78020fd31e 100644 --- a/compiler/src/errors/constraints/group.rs +++ b/compiler/src/errors/constraints/group.rs @@ -2,8 +2,8 @@ use snarkos_errors::gadgets::SynthesisError; #[derive(Debug, Error)] pub enum GroupError { - #[error("Expected group element parameter, got {}", _0)] - InvalidGroup(String), + #[error("Expected affine point, got {}", _0)] + Invalid(String), #[error("{}", _0)] SynthesisError(SynthesisError), diff --git a/compiler/src/group/edwards_bls12.rs b/compiler/src/group/edwards_bls12.rs index d3e3c78d4e..35562a5db3 100644 --- a/compiler/src/group/edwards_bls12.rs +++ b/compiler/src/group/edwards_bls12.rs @@ -88,10 +88,8 @@ impl EdwardsGroupType { pub fn edwards_affine_from_str(string: String) -> Result { // 0 or (0, 1) match Fq::from_str(&string).ok() { - Some(x) => { - EdwardsAffine::get_point_from_x(x, false).ok_or(GroupError::InvalidGroup(string)) - } - None => EdwardsAffine::from_str(&string).map_err(|_| GroupError::InvalidGroup(string)), + Some(x) => EdwardsAffine::get_point_from_x(x, false).ok_or(GroupError::Invalid(string)), + None => EdwardsAffine::from_str(&string).map_err(|_| GroupError::Invalid(string)), } }