Skip to content

Commit

Permalink
Revert "Simplify the scalar conversion"
Browse files Browse the repository at this point in the history
This reverts commit f50ff9d.
  • Loading branch information
upbqdn committed Apr 25, 2023
1 parent f50ff9d commit 962a91c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/scalar_mul/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,13 +144,13 @@ pub(crate) fn test_non_adjacent_form_for_scalar<Scalar: NonAdjacentForm>(w: usiz
}

// Check that the reconstructed scalar is not negative, and convert it to little-endian bytes.
let reconstructed_scalar: [u8; 32] = reconstructed_scalar
let reconstructed_scalar = reconstructed_scalar
.to_biguint()
.expect("The reconstructed scalar is negative.")
.to_bytes_le()
.try_into()
.expect("Could not convert the reconstructed scalar to bytes.");
.to_bytes_le();

let reconstructed_scalar_bytes: [u8; 32] = reconstructed_scalar.try_into().unwrap();

// Check that the reconstructed scalar matches the original one.
assert_eq!(reconstructed_scalar, scalar.inner_to_bytes());
assert_eq!(reconstructed_scalar_bytes, scalar.inner_to_bytes());
}

0 comments on commit 962a91c

Please sign in to comment.