Add msrv definitions to common and crypto

This will effectively add msrv protections to the entire project as almost
everything grabs from these.

Doesn't add msrv to coins as coins/bitcoin is still frozen.

Doesn't add msrv to services since cargo msrv doesn't play nice with anything
importing the runtime.
This commit is contained in:
Luke Parker
2023-08-02 14:17:57 -04:00
parent aab8a417db
commit 38ad1d4bc4
16 changed files with 20 additions and 2 deletions

View File

@@ -54,7 +54,9 @@ field!(
impl Scalar {
/// Perform a wide reduction to obtain a non-biased Scalar.
pub fn wide_reduce(bytes: [u8; 114]) -> Scalar {
let wide = U1024::from_le_slice(&[bytes.as_ref(), &[0; 14]].concat());
let mut bytes_128 = [0; 128];
bytes_128[.. 114].copy_from_slice(&bytes);
let wide = U1024::from_le_slice(&bytes_128);
Scalar(Residue::new(&U448::from_le_slice(
&wide.rem(&WIDE_REDUCTION_MODULUS).to_le_bytes()[.. 56],
)))