The CCNOT (Toffoli) gate passes all of its inputs directly to its outputs, unless all of the control lines (B and C) are true, in which case it inverts its main data line (A). CCNOT is complete data[A] = (data[C] & data[B]) ^ data[A];
data[A] = (data[C] & data[B]) ^ data[A];