mirror of
https://github.com/serai-dex/serai.git
synced 2025-12-09 04:39:24 +00:00
Remove must_use spam
This commit is contained in:
@@ -217,7 +217,6 @@ impl PrimeFieldBits for FieldElement {
|
||||
|
||||
impl FieldElement {
|
||||
/// Interpret the value as a little-endian integer, square it, and reduce it into a FieldElement.
|
||||
#[must_use]
|
||||
pub fn from_square(value: [u8; 32]) -> Self {
|
||||
let value = U256::from_le_bytes(value);
|
||||
Self(reduce(U512::from(value.mul_wide(&value))))
|
||||
@@ -259,7 +258,6 @@ impl FieldElement {
|
||||
/// The result is only a valid square root if the Choice is true.
|
||||
/// RFC 8032 simply fails if there isn't a square root, leaving any return value undefined.
|
||||
/// Ristretto explicitly returns 0 or sqrt((SQRT_M1 * u) / v).
|
||||
#[must_use]
|
||||
pub fn sqrt_ratio_i(u: Self, v: Self) -> (Choice, Self) {
|
||||
let i = SQRT_M1;
|
||||
|
||||
|
||||
@@ -223,13 +223,11 @@ impl Scalar {
|
||||
}
|
||||
|
||||
/// Perform wide reduction on a 64-byte array to create a Scalar without bias.
|
||||
#[must_use]
|
||||
pub fn from_bytes_mod_order_wide(bytes: &[u8; 64]) -> Self {
|
||||
Self(DScalar::from_bytes_mod_order_wide(bytes))
|
||||
}
|
||||
|
||||
/// Derive a Scalar without bias from a digest via wide reduction.
|
||||
#[must_use]
|
||||
pub fn from_hash<D: Digest<OutputSize = U64> + HashMarker>(hash: D) -> Self {
|
||||
let mut output = [0u8; 64];
|
||||
output.copy_from_slice(&hash.finalize());
|
||||
|
||||
Reference in New Issue
Block a user