mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-08 20:29:23 +00:00
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:
@@ -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],
|
||||
)))
|
||||
|
||||
Reference in New Issue
Block a user