Fields
bits: Vec<Boolean>
value: Option<i8>
Implementations
sourceimpl Int8
impl Int8
sourcepub fn alloc_input_fe<F, CS>(
cs: CS,
value: <Int8 as Integer>::IntegerType
) -> Result<Self, SynthesisError> where
F: PrimeField,
CS: ConstraintSystem<F>,
pub fn alloc_input_fe<F, CS>(
cs: CS,
value: <Int8 as Integer>::IntegerType
) -> Result<Self, SynthesisError> where
F: PrimeField,
CS: ConstraintSystem<F>,
Allocates the unsigned integer gadget by first converting
the little-endian byte representation of the unsigned integer to
F
elements, (thus reducing the number of input allocations),
and then converts this list of F
gadgets into the unsigned integer gadget
sourceimpl Int8
impl Int8
sourcepub fn alloc_fe<F, CS>(
cs: CS,
value: <Int8 as Integer>::IntegerType
) -> Result<Self, SynthesisError> where
F: PrimeField,
CS: ConstraintSystem<F>,
pub fn alloc_fe<F, CS>(
cs: CS,
value: <Int8 as Integer>::IntegerType
) -> Result<Self, SynthesisError> where
F: PrimeField,
CS: ConstraintSystem<F>,
Allocates the unsigned integer gadget by first converting
the little-endian byte representation of the unsigned integer to
F
elements, (thus reducing the number of input allocations),
and then converts this list of F
gadgets into the unsigned integer gadget
Trait Implementations
sourceimpl<F: PrimeField> Add<F, Int8> for Int8
impl<F: PrimeField> Add<F, Int8> for Int8
type ErrorType = SignedIntegerError
fn add<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> AllocGadget<<Int8 as Integer>::IntegerType, F> for Int8
impl<F: Field> AllocGadget<<Int8 as Integer>::IntegerType, F> for Int8
fn alloc<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<<Int8 as Integer>::IntegerType>, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_input<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<<Int8 as Integer>::IntegerType>, CS: ConstraintSystem<F>>(
cs: CS,
value_gen: Fn
) -> Result<Self, SynthesisError>
fn alloc_constant<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
_cs: CS,
_f: Fn
) -> Result<Self, SynthesisError>
fn alloc_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
fn alloc_input_checked<Fn: FnOnce() -> Result<T, SynthesisError>, T: Borrow<V>, CS: ConstraintSystem<F>>(
cs: CS,
f: Fn
) -> Result<Self, SynthesisError>
sourceimpl<F: PrimeField> ComparatorGadget<F> for Int8
impl<F: PrimeField> ComparatorGadget<F> for Int8
fn greater_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn less_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn greater_than_or_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl<F: PrimeField> CondSelectGadget<F> for Int8
impl<F: PrimeField> CondSelectGadget<F> for Int8
fn conditionally_select<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
first: &Self,
second: &Self
) -> Result<Self, SynthesisError>
fn cost() -> usize
sourceimpl<F: Field> ConditionalEqGadget<F> for Int8
impl<F: Field> ConditionalEqGadget<F> for Int8
fn conditional_enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self,
condition: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<F: PrimeField> Div<F, Int8> for Int8
impl<F: PrimeField> Div<F, Int8> for Int8
type ErrorType = SignedIntegerError
fn div<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> EqGadget<F> for Int8
impl<F: Field> EqGadget<F> for Int8
sourcefn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
fn is_eq<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
Output a Boolean
value representing whether self.value() == other.value()
. Read more
fn enforce_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<F: PrimeField> EvaluateEqGadget<F> for Int8
impl<F: PrimeField> EvaluateEqGadget<F> for Int8
fn evaluate_equal<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl<F: PrimeField> EvaluateLtGadget<F> for Int8
impl<F: PrimeField> EvaluateLtGadget<F> for Int8
fn less_than<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Boolean, SynthesisError>
sourceimpl Integer for Int8
impl Integer for Int8
type IntegerType = i8
type UnsignedGadget = UInt8
type UnsignedIntegerType = u8
const SIZE: usize
fn constant(value: i8) -> Self
fn one() -> Self
fn zero() -> Self
fn new(bits: Vec<Boolean>, value: Option<Self::IntegerType>) -> Self
sourcefn is_constant(&self) -> bool
fn is_constant(&self) -> bool
Returns true if all bits in this Int
are constant
fn to_bits_le(&self) -> Vec<Boolean>
fn to_bits_be(&self) -> Vec<Boolean>
fn from_bits_le(bits: &[Boolean]) -> Self
fn get_value(&self) -> Option<String>
sourcefn result_is_constant(first: &Self, second: &Self) -> bool
fn result_is_constant(first: &Self, second: &Self) -> bool
Returns true if both Int
objects have constant bits
sourceimpl<F: PrimeField> Mul<F, Int8> for Int8
impl<F: PrimeField> Mul<F, Int8> for Int8
Bitwise multiplication of two signed integer objects.
type ErrorType = SignedIntegerError
fn mul<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourcefn mul_unsafe<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
fn mul_unsafe<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
Overflowing mul gadget. Used to calculate exponents in pow gadget.
sourceimpl<F: PrimeField> Neg<F> for Int8
impl<F: PrimeField> Neg<F> for Int8
type ErrorType = SignedIntegerError
fn neg<CS: ConstraintSystem<F>>(&self, cs: CS) -> Result<Self, Self::ErrorType>
sourceimpl PartialOrd<Int8> for Int8
impl PartialOrd<Int8> for Int8
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl<F: PrimeField> Pow<F, Int8> for Int8
impl<F: PrimeField> Pow<F, Int8> for Int8
type ErrorType = SignedIntegerError
fn pow<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field + PrimeField> RippleCarryAdder<F, Int8> for Int8
impl<F: Field + PrimeField> RippleCarryAdder<F, Int8> for Int8
fn add_bits<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Vec<Boolean>, SynthesisError>
sourceimpl<F: PrimeField> Sub<F, Int8> for Int8
impl<F: PrimeField> Sub<F, Int8> for Int8
type ErrorType = SignedIntegerError
fn sub<CS: ConstraintSystem<F>>(
&self,
cs: CS,
other: &Self
) -> Result<Self, Self::ErrorType>
sourceimpl<F: Field> ToBytesGadget<F> for Int8
impl<F: Field> ToBytesGadget<F> for Int8
fn to_bytes<CS: ConstraintSystem<F>>(
&self,
_cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
sourcefn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
fn to_bytes_strict<CS: ConstraintSystem<F>>(
&self,
cs: CS
) -> Result<Vec<UInt8>, SynthesisError>
Additionally checks if the produced list of booleans is ‘valid’.
impl Eq for Int8
Auto Trait Implementations
impl RefUnwindSafe for Int8
impl Send for Int8
impl Sync for Int8
impl Unpin for Int8
impl UnwindSafe for Int8
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
impl<F, T> ConditionalOrEqualsGadget<F> for T where
F: Field,
T: ConditionalEqGadget<F> + CondSelectGadget<F>,
fn conditional_enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self,
should_enforce: &Boolean
) -> Result<(), SynthesisError>
fn cost() -> usize
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcepub fn equivalent(&self, key: &K) -> bool
pub fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
impl<F, T> OrEqualsGadget<F> for T where
F: Field,
T: ConditionalOrEqualsGadget<F>,
fn enforce_equal_or<CS: ConstraintSystem<F>>(
cs: CS,
cond: &Boolean,
var: &Self,
first: &Self,
second: &Self
) -> Result<(), SynthesisError>
fn cost() -> usize
impl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more