# Build outside the library checkout.

> Download a complete Cargo project, compute on encrypted vectors, and verify the result.

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

## Download and run

Install Git, rustup, and the native build tools from [Quickstart](https://www.poulpy.dev/docs/quickstart/#1-get-the-source). Download the [complete example project](https://www.poulpy.dev/examples/poulpy-app.tar.gz), then extract it:

```sh
tar -xzf poulpy-app.tar.gz
cd poulpy-app
cargo run --locked --release --bin poulpy-website-example
```

The archive contains `Cargo.toml`, `Cargo.lock`, `rust-toolchain.toml`, shared setup code, and both executable examples. Its four Poulpy dependencies point to the exact [guide revision](https://www.poulpy.dev/docs/versions/); Cargo fetches that snapshot automatically. Rustup reads the pinned nightly from this directory.

The [manifest](https://www.poulpy.dev/examples/poulpy-app/Cargo.toml), [main program](https://www.poulpy.dev/examples/poulpy-app/src/main.rs), and [shared setup](https://www.poulpy.dev/examples/poulpy-app/src/lib.rs) are also available individually.

## What the program checks

The program computes `z = (a + b) × b` on 512 packed complex slots. It encodes real inputs with zero imaginary parts, encrypts both vectors, adds, multiplies with a relinearization key, then decrypts and decodes.

```text
fresh ct: log_delta=45 log_budget=111
after mul: log_delta=45 log_budget=66
max |want - have| = ...
ok: z = (a + b) * b verified on 512 slots
```

It checks every real output against the cleartext calculation with absolute error below `1e-9`, and checks the imaginary residual against the same tolerance. The exact error is diagnostic output, not a precision guarantee for other workloads.

Unlike the upstream quickstart's additional division by 32, this standalone program verifies the expression shown here directly.

## Read the files in order

| File | Responsibility |
| --- | --- |
| `src/lib.rs` | Shared backend, layout parameters, and key-layout helpers |
| `src/main.rs` | Setup → encode/encrypt → evaluate → decrypt/check |
| `src/bin/client_evaluator.rs` | Separate command-line client and evaluator with serialized objects |
| `Cargo.lock` | Reproducible dependency resolution |

The constants and fixed seeds in `main.rs` are for a reproducible learning example, not an application security profile. The [parameter worksheet](https://www.poulpy.dev/docs/parameters/#a-worked-learning-configuration) explains the configuration and the analysis needed before changing its purpose.

## Make one change

Change the generated input vectors in `main.rs`, keeping their magnitudes bounded, and rerun the program. Keep the cleartext reference calculation and tolerance check. When changing the computation itself, inspect the resulting scale and budget and update the required keys.

Then follow the [client/evaluator example](https://www.poulpy.dev/docs/client-evaluator/) to see what crosses a process boundary. Use [Troubleshooting](https://www.poulpy.dev/docs/troubleshooting/) if the toolchain, backend, or metadata rejects a configuration.
