> For the complete documentation index, see [llms.txt](https://docs.fairmath.xyz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fairmath.xyz/fhe-computer/isa/fhe.md).

# fhe

`fhe` dialect includes operations for encrypted data computations. This dialect is further divided into subgroups based on the encryption scheme, such as `fhe.bgv` and `fhe.ckks`, allowing tailored operations for each scheme. Within each subgroup, operations like addition, multiplication, and rotations are defined.

### Examples

<pre data-overflow="wrap"><code>//Adds two ciphertexts using the BGV scheme.
%result = fhe.bgv.add %lhs, %rhs, %ctx : (RLWECiphertext, RLWECiphertext, BGVCryptoContext) -> RLWECiphertext

<strong>//Rotates coefficients of a CKKS ciphertext by the specified offset. 
</strong>%rot = fhe.ckks.rotate %ciphertext, %offset, %ctx, %key : (RLWECiphertext, i32, CKKSCryptoContext, RLWEGaloisKey) -> RLWECiphertext

</code></pre>
