diff --git a/docs/solidity/decrypt.md b/docs/solidity/decrypt.md index cea21da7..7d4b8bcf 100644 --- a/docs/solidity/decrypt.md +++ b/docs/solidity/decrypt.md @@ -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); @@ -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); diff --git a/docs/solidity/types.md b/docs/solidity/types.md index 52ea809f..26d06e0f 100644 --- a/docs/solidity/types.md +++ b/docs/solidity/types.md @@ -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