Skip to content

Commit

Permalink
feat(docs): add second example for decryption.
Browse files Browse the repository at this point in the history
  • Loading branch information
tremblaythibaultl committed Sep 19, 2023
1 parent 55da215 commit 4014a82
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion docs/solidity/decryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@
We allow explicit decryption requests for any encrypted type.
The values are decrypted through the distributed decryption protocol and are stored on-chain.

### Example
### Examples

```solidity
function decryptAmount(euint8 amount) public view returns (uint8) {
return TFHE.decrypt(amount);
}
function revertIfConditionIsFalse(ebool condition) public {
bool plaintextCondition = TFHE.decrypt(condition);
require(plaintextCondition, "Condition was not met");
// ... continue execution if `condition` is true
}
```

## Booleans
Expand Down

0 comments on commit 4014a82

Please sign in to comment.