pub trait FullAdder<'a, F: Field> where
Self: Sized, {
fn add<CS: ConstraintSystem<F>>(
cs: CS,
a: &'a Self,
b: &'a Self,
carry: &'a Self
) -> Result<(Self, Self), SynthesisError>;
}
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)