Skip to content

Commit

Permalink
fix: roll back the "simple_svdw_map_to_curve" func signature
Browse files Browse the repository at this point in the history
  • Loading branch information
duguorong009 committed Dec 13, 2023
1 parent 2f5d8f8 commit 14f9d71
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/hash_to_curve.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,14 @@ fn hash_to_field<F: FromUniformBytes<64>>(

// Implementation of <https://datatracker.ietf.org/doc/html/rfc9380#name-simplified-swu-method>
#[allow(clippy::too_many_arguments)]
pub(crate) fn simple_svdw_map_to_curve<C>(u: C::Base, z: C::Base, a: C::Base, b: C::Base) -> C
pub(crate) fn simple_svdw_map_to_curve<C>(u: C::Base, z: C::Base) -> C
where
C: CurveExt,
{
let zero = C::Base::ZERO;
let one = C::Base::ONE;
let a = C::a();
let b = C::b();

//1. tv1 = u^2
let tv1 = u.square();
Expand Down Expand Up @@ -168,7 +170,7 @@ where
let mut us = [C::Base::ZERO; 2];
hash_to_field("SSWU", curve_id, domain_prefix, message, &mut us);

let [q0, q1]: [C; 2] = us.map(|u| simple_svdw_map_to_curve::<C>(u, z, C::a(), C::b()));
let [q0, q1]: [C; 2] = us.map(|u| simple_svdw_map_to_curve::<C>(u, z));

let r = q0 + &q1;
debug_assert!(bool::from(r.is_on_curve()));
Expand Down

0 comments on commit 14f9d71

Please sign in to comment.