Skip to content

Commit

Permalink
add explicit decryption to docs
Browse files Browse the repository at this point in the history
  • Loading branch information
tremblaythibaultl committed Aug 10, 2023
1 parent 261e63e commit f5e328f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion docs/SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@
- [Getting Started](solidity/getting_started.md)
- [TFHE Library](solidity/library.md)
- [Function specifications](solidity/functions.md)
- [Booleans and control structures](solidity/requires.md)
- [Decryption and control structures](solidity/requires.md)
- ## [Examples](solidity/examples.md)
-
13 changes: 12 additions & 1 deletion docs/solidity/requires.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Booleans and control structures
# Decryption and control structures

## Booleans

Expand Down Expand Up @@ -31,3 +31,14 @@ The require statements described above may lead to important delays during the t
This is why we introduce optimistic encrypted statements (`optReq`).
These require statements are accumulated throughout the execution of the transaction and are only decrypted at the end of execution.
Optimistic requires may be more efficient, but this efficiency comes at the price of paying more gas if it so happens that one of the predicates is false.

## Decryptions
We also allow explicit decryptions requests for any type encrypted type.
The values are decrypted in the same way requires are, that is through the distributed decryption protocol.

### Examples
```solidity
function decryptAmount(euint8 amount) public view returns (uint8) {
return TFHE.decrypt(amount);
}
```

0 comments on commit f5e328f

Please sign in to comment.