Rename into_ -> to_ where &self is used.
This commit is contained in:
parent
08664b1df9
commit
614d784b29
|
@ -66,7 +66,7 @@ impl<E: Engine> AllocatedNum<E> {
|
||||||
/// order, requiring that the representation
|
/// order, requiring that the representation
|
||||||
/// strictly exists "in the field" (i.e., a
|
/// strictly exists "in the field" (i.e., a
|
||||||
/// congruency is not allowed.)
|
/// congruency is not allowed.)
|
||||||
pub fn into_bits_le_strict<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
|
pub fn to_bits_le_strict<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
|
||||||
where
|
where
|
||||||
CS: ConstraintSystem<E>,
|
CS: ConstraintSystem<E>,
|
||||||
{
|
{
|
||||||
|
@ -189,7 +189,7 @@ impl<E: Engine> AllocatedNum<E> {
|
||||||
/// Convert the allocated number into its little-endian representation.
|
/// Convert the allocated number into its little-endian representation.
|
||||||
/// Note that this does not strongly enforce that the commitment is
|
/// Note that this does not strongly enforce that the commitment is
|
||||||
/// "in the field."
|
/// "in the field."
|
||||||
pub fn into_bits_le<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
|
pub fn to_bits_le<CS>(&self, mut cs: CS) -> Result<Vec<Boolean>, SynthesisError>
|
||||||
where
|
where
|
||||||
CS: ConstraintSystem<E>,
|
CS: ConstraintSystem<E>,
|
||||||
{
|
{
|
||||||
|
@ -522,7 +522,7 @@ mod test {
|
||||||
let mut cs = TestConstraintSystem::<Bls12>::new();
|
let mut cs = TestConstraintSystem::<Bls12>::new();
|
||||||
|
|
||||||
let n = AllocatedNum::alloc(&mut cs, || Ok(negone)).unwrap();
|
let n = AllocatedNum::alloc(&mut cs, || Ok(negone)).unwrap();
|
||||||
n.into_bits_le_strict(&mut cs).unwrap();
|
n.to_bits_le_strict(&mut cs).unwrap();
|
||||||
|
|
||||||
assert!(cs.is_satisfied());
|
assert!(cs.is_satisfied());
|
||||||
|
|
||||||
|
@ -550,9 +550,9 @@ mod test {
|
||||||
let n = AllocatedNum::alloc(&mut cs, || Ok(r)).unwrap();
|
let n = AllocatedNum::alloc(&mut cs, || Ok(r)).unwrap();
|
||||||
|
|
||||||
let bits = if i % 2 == 0 {
|
let bits = if i % 2 == 0 {
|
||||||
n.into_bits_le(&mut cs).unwrap()
|
n.to_bits_le(&mut cs).unwrap()
|
||||||
} else {
|
} else {
|
||||||
n.into_bits_le_strict(&mut cs).unwrap()
|
n.to_bits_le_strict(&mut cs).unwrap()
|
||||||
};
|
};
|
||||||
|
|
||||||
assert!(cs.is_satisfied());
|
assert!(cs.is_satisfied());
|
||||||
|
|
Loading…
Reference in New Issue