# Your first encrypted computation.

> Add and multiply encrypted values, then decrypt the result and check it against the same calculation in the clear.

- Canonical page: https://www.poulpy.dev/docs/quickstart/
- Poulpy version: 0.9.0
- Source revision: [`7dd13e6aa9808982f5355fb6acb70ca434de4e35`](https://github.com/poulpy-fhe/poulpy/tree/7dd13e6aa9808982f5355fb6acb70ca434de4e35)
- Documentation reviewed: 2026-10-08

This walkthrough runs Poulpy’s maintained `ckks_hello` example. Using the portable CPU backend, it computes **(a + b) × b / 32** on encrypted vectors. No AVX instructions or GPU are required.

## 1. Get the source

You need [Git](https://git-scm.com/downloads), [Rust installed through rustup](https://rustup.rs/), and your platform’s build tools, which provide the system linker. On Linux, install your distribution’s build tools; on macOS, install the Xcode command line tools; on Windows, use the Visual Studio C++ build tools or WSL.

```sh
git clone https://github.com/poulpy-fhe/poulpy.git
cd poulpy
git checkout 7dd13e6aa9808982f5355fb6acb70ca434de4e35
```

Run the following commands from this directory. Rustup selects the nightly toolchain pinned in the repository’s [`rust-toolchain.toml`](https://github.com/poulpy-fhe/poulpy/blob/7dd13e6aa9808982f5355fb6acb70ca434de4e35/rust-toolchain.toml) and downloads it if needed.

## 2. Run the example

```sh
cargo run --locked --release -p poulpy-cpu-portable --features enable-ckks --example ckks_hello
```

The first run downloads and compiles the dependencies. Later runs reuse the compiled files.

When the encrypted calculation matches the expected result, the example finishes with:

```text
ok: z = (a + b) * b verified on 512 slots
```

It also reports the encoding scale, remaining ciphertext budget, and maximum error. CKKS produces an approximate numerical result; the example checks that its error stays below its chosen tolerance.

## 3. Follow the computation

Open [`ckks_hello.rs`](https://github.com/poulpy-fhe/poulpy/blob/7dd13e6aa9808982f5355fb6acb70ca434de4e35/poulpy-cpu-portable/examples/ckks_hello.rs). The example has four stages:

1. **Prepare the keys.** Create a secret key, a multiplication key, and the scratch memory used by the operations.
2. **Encode and encrypt.** Pack the input vectors into plaintexts and encrypt them.
3. **Compute on ciphertexts.** Add the encrypted vectors, multiply by the second vector, and rescale. The call `ckks_div_pow2_assign(..., 5)` divides the result by 32.
4. **Decrypt and verify.** Decode and compare against `(a + b) × b / 32`. The success message above abbreviates the calculation.

Change the input values in the example and run the same command again to see the verification use your new inputs.

The fixed randomness seeds and small parameters in these examples are for learning and reproducible checks. For application parameters, continue with the [parameter guide](https://www.poulpy.dev/docs/parameters/) and [security responsibilities](https://www.poulpy.dev/docs/security/).

## Choose your next step

- **Build outside the library checkout:** download the [standalone application](https://www.poulpy.dev/docs/application/).
- **Separate client and evaluator:** follow the [serialized example](https://www.poulpy.dev/docs/client-evaluator/).
- **Explore more operations:** continue with [CKKS](https://www.poulpy.dev/docs/ckks/) for numerical computation or [Binary FHE](https://www.poulpy.dev/docs/binary-fhe/) for Boolean and integer computation.
- **Resolve a build or runtime error:** see [Troubleshooting](https://www.poulpy.dev/docs/troubleshooting/).
