Skip to content

Commit

Permalink
simplify vec to arr
Browse files Browse the repository at this point in the history
  • Loading branch information
moshababo committed Mar 26, 2024
1 parent f19333c commit 03bca11
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions node/libs/crypto/src/bn254/hash.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,8 @@ pub(crate) fn hash_to_point(msg: &[u8]) -> (G1Affine, u8) {
)
.unwrap();
let x_num = hash_num % prime_field_modulus;

let mut arr = [0u64; 4];
arr.copy_from_slice(x_num.to_u64_digits().as_slice());
let mut x = Fq::from_repr(FqRepr(arr)).unwrap();
let x_arr: [u64; 4] = x_num.to_u64_digits().try_into().unwrap();
let mut x = Fq::from_repr(FqRepr(x_arr)).unwrap();

for i in 0..255 {
let p = get_point_from_x(x);
Expand Down

0 comments on commit 03bca11

Please sign in to comment.