Trait ark_r1cs_std::bits::ToBitsGadget [−][src]
Specifies constraints for conversion to a little-endian bit representation
of self
.
Required methods
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs the canonical little-endian bit-wise representation of self
.
This is the correct default for 99% of use cases.
Provided methods
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs a possibly non-unique little-endian bit-wise representation of
self
.
If you’re not absolutely certain that your usecase can get away with a
non-canonical representation, please use self.to_bits()
instead.
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs the canonical big-endian bit-wise representation of self
.
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs a possibly non-unique big-endian bit-wise representation of
self
.
Implementations on Foreign Types
impl<F: Field> ToBitsGadget<F> for [Boolean<F>]
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs self
.
impl<F: Field> ToBitsGadget<F> for [UInt8<F>]
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Interprets self
as an integer, and outputs the little-endian
bit-wise decomposition of that integer.
impl<F: Field, T> ToBitsGadget<F> for Vec<T> where
[T]: ToBitsGadget<F>,
[src]
[T]: ToBitsGadget<F>,
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Implementors
impl<BF, P> ToBitsGadget<<P as CubicExtParameters>::BasePrimeField> for CubicExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
[src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
fn to_bits_le(&self) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
[src]
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
impl<BF, P> ToBitsGadget<<P as QuadExtParameters>::BasePrimeField> for QuadExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'b BF: FieldOpsBounds<'b, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
[src]
BF: FieldVar<P::BaseField, P::BasePrimeField>,
&'b BF: FieldOpsBounds<'b, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
fn to_bits_le(&self) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
[src]
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<P::BasePrimeField>>, SynthesisError>
impl<F: Field> ToBitsGadget<F> for Boolean<F>
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
impl<F: Field> ToBitsGadget<F> for UInt8<F>
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
impl<F: PrimeField> ToBitsGadget<F> for FpVar<F>
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
impl<F: PrimeField> ToBitsGadget<F> for AllocatedFp<F>
[src]
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
Outputs the unique bit-wise decomposition of self
in little-endian
form.
This method enforces that the output is in the field, i.e.
it invokes Boolean::enforce_in_field_le
on the bit decomposition.
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
[src]
impl<P, F> ToBitsGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for ProjectiveVar<P, F> where
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
[src]
P: SWModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'a F: FieldOpsBounds<'a, P::BaseField, F>,
fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
impl<P, F> ToBitsGadget<<<P as ModelParameters>::BaseField as Field>::BasePrimeField> for AffineVar<P, F> where
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'b F: FieldOpsBounds<'b, P::BaseField, F>,
[src]
P: TEModelParameters,
F: FieldVar<P::BaseField, <P::BaseField as Field>::BasePrimeField>,
&'b F: FieldOpsBounds<'b, P::BaseField, F>,
fn to_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
fn to_non_unique_bits_le(
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>
[src]
&self
) -> Result<Vec<Boolean<<P::BaseField as Field>::BasePrimeField>>, SynthesisError>