Trait snarkvm_circuit::Adder
source · pub trait Adder {
type Carry;
type Sum;
// Required method
fn adder(&self, other: &Self, carry: &Self) -> (Self::Sum, Self::Carry);
}
Expand description
A single-bit binary adder with a 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) return (sum, carry)