//! Scalar arithmetic tests. #![cfg(feature = "arithmetic")] use bign256::{Scalar, U256}; use elliptic_curve::ops::{Invert, Reduce}; use proptest::prelude::*; prop_compose! { fn scalar()(bytes in any::<[u8; 32]>()) -> Scalar { >::reduce_bytes(&bytes.into()) } } proptest! { #[test] fn invert_and_invert_vartime_are_equivalent(w in scalar()) { let inv: Option = w.invert().into(); let inv_vartime: Option = w.invert_vartime().into(); prop_assert_eq!(inv, inv_vartime); } }