Disabling Concrete-CSPRNG in TFHE-rs

Hi Zama,

I am currently trying to use Zama’s TFHE-rs library in a development sdk that has zk-proof package RISC0. Unfortunately it is unable to compile due to Concrete CSPRNG. I do not care much about proving FHE for now as I know this is anything but a simple task. I want TFHE-rs to be able to run in this SDK. From my little understanding of FHE, the key generation requires concrete-CSPRNG.

So my question is, is there a way to disable key generation and simply import a key from a seed or local file? Alternatively, is there a way to replace this Pseudoramdon Number Generator with an alternative PRNG that can compile with Risc0? I understand this may lead to less cryptographically secure FHE, but this is simply for testing purpose of the SDK.

To be clear, the SDK I am using allows you to disable the actual proving using Risc0 (as in, I am not trying to prove FHE in any form), but Risc0 is deeply embedded in the SDK and can’t really be removed easily.

Hello @Henry I think someone made it work.

I’ll try to find the link

From: Discord

Hi! Since many of you have been asking about using TFHE-rs inside zkVMs such as Risc 0 or Succinct’s SP1, here is a complete answer.
zkVMs are able to prove the correct execution of a program compiled to the RISCV-32 instruction set. TFHE-rs does not officially support RISCV-32 as a compilation target and as such can’t be used out of the box with these zkVMs. However, as GitHub - turbofakesmile/VFHE demonstrates, it’s possible to do some tinkering to get it to work (at your own risk :slightly_smiling_face:).