Trait ark_r1cs_std::bits::ToBitsGadget [−][src]
pub trait ToBitsGadget<F: Field> { fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>; fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError> { ... } fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError> { ... } fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError> { ... } }
Expand description
Specifies constraints for conversion to a little-endian bit representation
of self
.
Required methods
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
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>
fn to_non_unique_bits_le(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
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>
fn to_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
Outputs the canonical big-endian bit-wise representation of self
.
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
fn to_non_unique_bits_be(&self) -> Result<Vec<Boolean<F>>, SynthesisError>
Outputs a possibly non-unique big-endian bit-wise representation of
self
.
Implementations on Foreign Types
Outputs self
.
Interprets self
as an integer, and outputs the little-endian
bit-wise decomposition of that integer.
Implementors
impl<BF, P> ToBitsGadget<<P as CubicExtParameters>::BasePrimeField> for CubicExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'a> &'a BF: FieldOpsBounds<'a, P::BaseField, BF>,
P: CubicExtVarParams<BF>,
impl<BF, P> ToBitsGadget<<P as QuadExtParameters>::BasePrimeField> for QuadExtVar<BF, P> where
BF: FieldVar<P::BaseField, P::BasePrimeField>,
for<'b> &'b BF: FieldOpsBounds<'b, P::BaseField, BF>,
P: QuadExtVarParams<BF>,
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>,
for<'a> &'a F: FieldOpsBounds<'a, P::BaseField, F>,
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>,
for<'b> &'b F: FieldOpsBounds<'b, P::BaseField, F>,