Comment on page
Equality
Checking equality of a TFHE encrypted number is the same whether we are comparing a plaintext or encrypted value
function bid(bytes calldata left, bytes calldata right) public {
euint32 lhs = TFHE.asEuint32(left);
euint32 rhs = TFHE.asEuint32(right);
// returns either 0 (false) or 1 (true) as an encrypted uint32
ebool equal = TFHE.eq(lhs, rhs)
}
function bid(bytes calldata left, uint32 right) public {
euint32 lhs = TFHE.asEuint32(left);
// returns either 0 (false) or 1 (true) as an encrypted uint32
ebool equal = TFHE.eq(lhs, right)
}
Last modified 4mo ago