Coder Social home page Coder Social logo

fhevm-tfhe-cli's Introduction

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:

  • v0.2.1: based on tfhe-rs 0.3.1
  • v0.2.2: based on tfhe-rs 0.4.0
  • v0.2.3: based on tfhe-rs 0.4.1
  • v0.2.4: based on tfhe-rs 0.5.1

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:

  • "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/fhevm-tfhe-cli:latest fhevm-tfhe-cli"
    • replace LOCAL_DIR with a local directory of choice in order to persist output from the tool when using Docker

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:

  • cks: the private key, used for data decryption, that should never be shared publicly.
  • pks: the public key, used for data encryption, that could be shared publicly.
  • sks: the evaluation key, used for performing operations, that could be shared publicly.

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

fhevm-tfhe-cli's People

Contributors

leventdem avatar dartdart26 avatar tremblaythibaultl avatar david-zk avatar aquint-zama avatar

Stargazers

Prabhat avatar Rusty avatar  avatar

Watchers

Daniel Demmler avatar Dragoș Rotaru avatar Nikita Frolov avatar lodge avatar  avatar  avatar  avatar

fhevm-tfhe-cli's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.