You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -928,7 +928,7 @@ class UInt32 extends CircuitValue {
928
928
* let a = UInt32.from(3); // ... 000011
929
929
* let b = UInt32.from(5); // ... 000101
930
930
*
931
-
* let c = a.and(b, 2); // ... 000001
931
+
* let c = a.and(b); // ... 000001
932
932
* c.assertEquals(1);
933
933
* ```
934
934
*/
@@ -1670,6 +1670,106 @@ class UInt8 extends Struct({
1670
1670
return{ quotient, remainder };
1671
1671
}
1672
1672
1673
+
/**
1674
+
* Bitwise XOR gadget on {@link Field} elements. Equivalent to the [bitwise XOR `^` operator in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_XOR).
1675
+
* A XOR gate works by comparing two bits and returning `1` if two bits differ, and `0` if two bits are equal.
1676
+
*
1677
+
* This gadget builds a chain of XOR gates recursively.
1678
+
*
1679
+
* You can find more details about the implementation in the [Mina book](https://o1-labs.github.io/proof-systems/specs/kimchi.html?highlight=gates#xor-1)
* Bitwise AND gadget on {@link UInt8} elements. Equivalent to the [bitwise AND `&` operator in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_AND).
1729
+
* The AND gate works by comparing two bits and returning `1` if both bits are `1`, and `0` otherwise.
1730
+
*
1731
+
* It can be checked by a double generic gate that verifies the following relationship between the values below.
1732
+
*
1733
+
* The generic gate verifies:\
1734
+
* `a + b = sum` and the conjunction equation `2 * and = sum - xor`\
1735
+
* Where:\
1736
+
* `a + b = sum`\
1737
+
* `a ^ b = xor`\
1738
+
* `a & b = and`
1739
+
*
1740
+
* You can find more details about the implementation in the [Mina book](https://o1-labs.github.io/proof-systems/specs/kimchi.html?highlight=gates#and)
* Bitwise OR gadget on {@link UInt8} elements. Equivalent to the [bitwise OR `|` operator in JavaScript](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Bitwise_OR).
1758
+
* The OR gate works by comparing two bits and returning `1` if at least one bit is `1`, and `0` otherwise.
0 commit comments