zama-ai / fhevm-tfhe-cli

TFHE-rs CLI tool for the fhEVM
Other
4 stars 2 forks source link

TFHE-CLI

The TFHE-CLI tool allows developers to use tfhe-rs features through a user-friendly CLI.

This tool can be used locally or through a docker image.

Docker images versioning

Registry and image name: docker pull ghcr.io/zama-ai/fhevm-tfhe-cli

Tags:

Build

Local

# for x86 CPUs
cargo build --features tfhe/x86_64-unix --release

# for ARM64
cargo build --features tfhe/aarch64-unix --release

Docker

Either download latest image:

docker pull ghcr.io/zama-ai/fhevm-tfhe-cli:latest

or build it locally:

docker build -t fhevm-tfhe-cli:latest .

Running operations

Make sure you either have Docker or the Rust toolchain installed on your host machine.

Please replace FHEVM_TFHE_CLI with either:

For more information on Docker, see below.

For more information on supported operations and their variations, please see the built-in help:

FHEVM_TFHE_CLI help

Key generation

mkdir -p /path/to/keys/directory
FHEVM_TFHE_CLI generate-keys -d /path/to/keys/directory

It will generate 3 keys in /path/to/keys/directory:

Public encryption

# Encryption requires the public key `pks`.
FHEVM_TFHE_CLI public-encrypt-integer32 -c ./ciphertext -p /path/to/keys/directory/pks -v 42

Decryption

# Decryption requires the secret key `cks`.
FHEVM_TFHE_CLI decrypt-ciphertext -c ./ciphertext -s /path/to/keys/directory/cks