From 151b4c8e122ce178036378f55218d5b1b407b923 Mon Sep 17 00:00:00 2001 From: skaunov Date: Tue, 30 Jan 2024 18:16:35 +0300 Subject: [PATCH] one more approach opened issues for Geometry lib --- rust-arkworks/Cargo.toml | 8 ++++---- rust-arkworks/src/lib.rs | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/rust-arkworks/Cargo.toml b/rust-arkworks/Cargo.toml index 0fa2d16..a8dcebb 100644 --- a/rust-arkworks/Cargo.toml +++ b/rust-arkworks/Cargo.toml @@ -7,10 +7,10 @@ edition = "2021" [dependencies] ark-ec = "~0.4.0" -ark-ff = "0.3.0" -ark-std = "0.3.0" -ark-serialize = "~0.4.0" -ark-serialize-derive = "0.3.0" +# ark-ff = "0.3.0" +# ark-std = "0.3.0" +# ark-serialize = "0.3.0" +# ark-serialize-derive = "0.3.0" thiserror = "1.0.30" secp256k1 = { git = "https://github.com/geometryresearch/ark-secp256k1.git" } rand_core = {version = "0.6", default-features=false, features = ["getrandom"] } diff --git a/rust-arkworks/src/lib.rs b/rust-arkworks/src/lib.rs index 96b7d21..1511e48 100644 --- a/rust-arkworks/src/lib.rs +++ b/rust-arkworks/src/lib.rs @@ -6,6 +6,7 @@ mod tests; pub mod sig { use crate::error::EcError; use crate::hash_to_curve; + use ark_ec::hashing::HashToCurve; use ark_ec::short_weierstrass_jacobian::GroupAffine; use ark_ec::{models::SWModelParameters, AffineCurve, ProjectiveCurve}; use ark_ff::{PrimeField, ToBytes}; @@ -46,7 +47,10 @@ pub mod sig { //let pk_affine_bytes_vec = affine_to_bytes::

(pk); //let m_pk = [message, pk_affine_bytes_vec.as_slice()].concat(); //hash_to_curve::try_and_increment::(m_pk.as_slice()) - Ok(hash_to_curve::hash_to_curve::(message, pk)) + Ok(hash_to_curve::hash_to_curve::(message, pk)); + ark_ec::hashing::map_to_curve_hasher::MapToCurveBasedHasher::<>::hash( + &self, message + ) } fn compute_c_v1(