pub trait ToBytesGadget<F: Field> {
// Required method
fn to_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>;
// Provided method
fn to_non_unique_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError> { ... }
}
Expand description
Specifies constraints for conversion to a little-endian byte representation
of self
.
Required Methods§
Sourcefn to_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
fn to_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
Outputs a canonical, little-endian, byte decomposition of self
.
This is the correct default for 99% of use cases.
Provided Methods§
Sourcefn to_non_unique_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
fn to_non_unique_bytes_le(&self) -> Result<Vec<UInt8<F>>, SynthesisError>
Outputs a possibly non-unique byte decomposition of self
.
If you’re not absolutely certain that your usecase can get away with a
non-canonical representation, please use self.to_bytes_le(cs)
instead.