Skip to content

Commit

Permalink
use reverse_copy for scalars
Browse files Browse the repository at this point in the history
  • Loading branch information
samkim-crypto committed Nov 5, 2024
1 parent 9bdf55e commit 031e780
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions curves/bn254/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -283,10 +283,10 @@ mod target_arch {
input.resize(ALT_BN128_MULTIPLICATION_INPUT_LEN, 0);

let p: G1 = PodG1::from_be_bytes(&input[..64])?.try_into()?;
let fr = BigInteger256::deserialize_uncompressed_unchecked(
&convert_endianness_64(&input[64..96])[..],
)
.map_err(|_| AltBn128Error::InvalidInputData)?;
let mut fr_bytes = [0u8; 32];
reverse_copy(&input[64..96], &mut fr_bytes)?;
let fr = BigInteger256::deserialize_uncompressed_unchecked(fr_bytes.as_slice())
.map_err(|_| AltBn128Error::InvalidInputData)?;

let result_point: G1 = p.mul_bigint(fr).into();

Expand Down

0 comments on commit 031e780

Please sign in to comment.