Skip to content

Commit

Permalink
docs() rewrite some parts
Browse files Browse the repository at this point in the history
  • Loading branch information
immortal-tofu committed Sep 26, 2023
1 parent 511a7cb commit fc43e69
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions docs/solidity/decrypt.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
We allow explicit decryption requests for any encrypted type.
The values are decrypted through the distributed decryption protocol and are stored on-chain.

### Example

```solidity
function getTotalSupply() public view returns (uint32) {
return TFHE.decrypt(totalSupply);
Expand All @@ -28,6 +30,8 @@ The result of this encryption is sent back to the caller as `bytes memory`.
It is also possible to provide a default value to the `reencrypt` function.
In this case, if the provided ciphertext is not initialized (i.e., if the ciphertext handle is `0`), the function will return an encryption of the provided default value.

### Example

```solidity
function balanceOf(bytes32 publicKey) public view returns (bytes memory) {
return TFHE.reencrypt(balances[msg.sender], publicKey, 0);
Expand Down
8 changes: 4 additions & 4 deletions docs/solidity/types.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ The `euint` types are _wrappers_ over these handles.

When a user sends an encrypted integer, this ciphertext must be checked to prevent arbitrary data from being sent. So, to check user input received as `bytes`, there are several methods.

- `TFHE.asEbool()` will verify and returns a `ebool`
- `TFHE.asEuint8()` will verify and returns a `euint8`
- `TFHE.asEuint16()` will verify and returns a `euint16`
- `TFHE.asEuint32()` will verify and returns a `euint32`
- `TFHE.asEbool()` will verify the provided ciphertext and returns a `ebool`
- `TFHE.asEuint8()` will verify the provided ciphertext and returns a `euint8`
- `TFHE.asEuint16()` will verify the provided ciphertext and returns a `euint16`
- `TFHE.asEuint32()` will verify the provided ciphertext and returns a `euint32`

### Example

Expand Down

0 comments on commit fc43e69

Please sign in to comment.