mirror of
https://github.com/Qortal/pirate-librustzcash.git
synced 2025-02-19 04:45:48 +00:00
Take self directly in into_* functions
This commit is contained in:
parent
fe93f2ff6b
commit
9016548698
@ -404,7 +404,7 @@ pub fn blake2s<E: Engine, CS: ConstraintSystem<E>>(
|
|||||||
)?;
|
)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(h.iter().flat_map(|b| b.into_bits()).collect())
|
Ok(h.into_iter().flat_map(|b| b.into_bits()).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
@ -72,8 +72,10 @@ impl UInt32 {
|
|||||||
Ok(UInt32 { bits, value })
|
Ok(UInt32 { bits, value })
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn into_bits_be(&self) -> Vec<Boolean> {
|
pub fn into_bits_be(self) -> Vec<Boolean> {
|
||||||
self.bits.iter().rev().cloned().collect()
|
let mut ret = self.bits;
|
||||||
|
ret.reverse();
|
||||||
|
ret
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn from_bits_be(bits: &[Boolean]) -> Self {
|
pub fn from_bits_be(bits: &[Boolean]) -> Self {
|
||||||
@ -101,8 +103,8 @@ impl UInt32 {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Turns this `UInt32` into its little-endian byte order representation.
|
/// Turns this `UInt32` into its little-endian byte order representation.
|
||||||
pub fn into_bits(&self) -> Vec<Boolean> {
|
pub fn into_bits(self) -> Vec<Boolean> {
|
||||||
self.bits.clone()
|
self.bits
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Converts a little-endian byte order representation of bits into a
|
/// Converts a little-endian byte order representation of bits into a
|
||||||
|
@ -508,7 +508,7 @@ impl<E: JubjubEngine> MontgomeryPoint<E> {
|
|||||||
/// a point in the birationally equivalent twisted
|
/// a point in the birationally equivalent twisted
|
||||||
/// Edwards curve.
|
/// Edwards curve.
|
||||||
pub fn into_edwards<CS>(
|
pub fn into_edwards<CS>(
|
||||||
&self,
|
self,
|
||||||
mut cs: CS,
|
mut cs: CS,
|
||||||
params: &E::Params,
|
params: &E::Params,
|
||||||
) -> Result<EdwardsPoint<E>, SynthesisError>
|
) -> Result<EdwardsPoint<E>, SynthesisError>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user