Trait snarkvm_wasm::FullAdder[][src]

pub trait FullAdder<'a, F> where
    F: Field
{ fn add<CS>(
        cs: CS,
        a: &'a Self,
        b: &'a Self,
        carry: &'a Self
    ) -> Result<(Self, Self), SynthesisError>
    where
        CS: ConstraintSystem<F>
; }
Expand description

Single bit binary adder with carry bit https://en.wikipedia.org/wiki/Adder_(electronics)#Full_adder sum = (a XOR b) XOR carry carry = a AND b OR carry AND (a XOR b) Returns (sum, carry)

Required methods

fn add<CS>(
    cs: CS,
    a: &'a Self,
    b: &'a Self,
    carry: &'a Self
) -> Result<(Self, Self), SynthesisError> where
    CS: ConstraintSystem<F>, 
[src]

Implementors

impl<'a, F> FullAdder<'a, F> for Boolean where
    F: Field
[src]

pub fn add<CS>(
    cs: CS,
    a: &'a Boolean,
    b: &'a Boolean,
    carry: &'a Boolean
) -> Result<(Boolean, Boolean), SynthesisError> where
    CS: ConstraintSystem<F>, 
[src]