Skip to content

Commit

Permalink
Interpret domain u64 as little endian (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelsproul authored Sep 30, 2019
1 parent 33716bc commit ddd724a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/amcl_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ lazy_static! {
pub fn hash_on_g2(msg: &[u8], d: u64) -> GroupG2 {
// Converting to BigNum requires 48 bytes, Keccak256 is only 32 bytes
let mut x_real = vec![0 as u8; 16];
x_real.append(&mut hash(&[msg, &d.to_be_bytes(), &[1]].concat()));
x_real.append(&mut hash(&[msg, &d.to_le_bytes(), &[1]].concat()));
let mut x_imaginary = vec![0 as u8; 16];
x_imaginary.append(&mut hash(&[msg, &d.to_be_bytes(), &[2]].concat()));
x_imaginary.append(&mut hash(&[msg, &d.to_le_bytes(), &[2]].concat()));

map_to_g2(&x_real, &x_imaginary)
}
Expand Down

0 comments on commit ddd724a

Please sign in to comment.