Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update README.md #12

Merged
merged 3 commits into from
Jul 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[package]
name = "zbc-fhe-tool"
name = "fhevm-tfhe-cli"
version = "0.1.1"
authors = ["Zama <hello@zama.ai>"]
edition = "2021"
license = "Unlicense"
homepage = "https://github.com/zama-ai/zbc-fhe-tool"
repository = "https://github.com/zama-ai/zbc-fhe-tool"
homepage = "https://github.com/zama-ai/fhevm-tfhe-cli"
repository = "https://github.com/zama-ai/fhevm-tfhe-cli"
publish = false

[dependencies]
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM rust:1.67 as builder

WORKDIR /usr/local/app/zbc-fhe-tool
WORKDIR /usr/local/app/fhevm-tfhe-cli
ADD . .
RUN cargo build --release --features tfhe/$(./scripts/get_arch.sh)

FROM debian:bullseye-slim
WORKDIR /usr/local/app
RUN apt-get install libc6 -y
COPY --from=builder /usr/local/app/zbc-fhe-tool/target/release/zbc-fhe-tool /usr/local/bin
COPY --from=builder /usr/local/app/fhevm-tfhe-cli/target/release/fhevm-tfhe-cli /usr/local/bin
ENV RUST_LOG=info

CMD ["zbc-fhe-tool"]
CMD ["fhevm-tfhe-cli"]
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# ZBC FHE tool
# TFHE-CLI

The ZBC FHE tool allows developers to use __tfhe-rs__ features through a user-friendly CLI.
The TFHE-CLI tool allows developers to use __tfhe-rs__ features through a user-friendly CLI.

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

# Quick start

If you want to generate fhe keys for your evmos node:

On x86:
```bash
$> mkdir -p res && docker run -v $PWD:/usr/local/app ghcr.io/zama-ai/zbc-fhe-tool:v0.1.1 zbc-fhe-tool generate-keys -d res
$ mkdir -p res && docker run -v $PWD:/usr/local/app ghcr.io/zama-ai/fhevm-tfhe-cli:v0.1.1 fhevm-tfhe-cli generate-keys -d res
```

On arm64:
```bash
$> mkdir -p res && docker run -v $PWD:/usr/local/app ghcr.io/zama-ai/zbc-fhe-tool:v0.1.1-arm64 zbc-fhe-tool generate-keys -d res
$ mkdir -p res && docker run -v $PWD:/usr/local/app ghcr.io/zama-ai/fhevm-tfhe-cli:v0.1.1-arm64 fhevm-tfhe-cli generate-keys -d res
```

Typical output:
Expand All @@ -24,52 +24,52 @@ Typical output:
# Generated cks size: 41130 bytes
# Generated sks size: 100729006 bytes
# Generated pks size: 16553 bytes
$> ls res
$ ls res
# cks pks sks
```

# Running operations

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

Please replace `ZBC_FHE_TOOL` with either:
Please replace `FHEVM_TFHE_CLI` with either:
* "`cargo run --features tfhe/aarch64-unix --release -- `" - for ARM CPUs when running locally on the host
* "`cargo run --features tfhe/x86_64-unix --release -- `" - for x86 CPUs when running locally on the host
* "`docker run -v $LOCAL_DIR:/usr/local/app ghcr.io/zama-ai/zbc-fhe-tool:$TAG zbc-fhe-tool`"
* "`docker run -v $LOCAL_DIR:/usr/local/app ghcr.io/zama-ai/fhevm-tfhe-cli:$TAG fhevm-tfhe-cli`"
* replace LOCAL_DIR with a local directory of choice in order to persist output from the tool when using Docker
* replace TAG with a known tagged version

For more information on Docker, see below.

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

## Key generation

```bash
mkdir -p /path/to/keys/directory
ZBC_FHE_TOOL generate-keys -d /path/to/keys/directory
FHEVM_TFHE_CLI generate-keys -d /path/to/keys/directory
```

## Public encryption

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

## Decryption

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

# Using published Docker images

One needs to docker login to ghcr.io to download the published image.
One needs to login to ghcr.io to download the published image.

<br />
<details>
Expand Down