-
Notifications
You must be signed in to change notification settings - Fork 158
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
TFHE-rs for Web Assembly #427
Comments
Hi @patriciaOrtuno28! As you noticed Concrete does not offer Web Assembly support as of now, and I cannot really say when it will be set up: this will probably take some time. However, Concrete relies on Concrete-core, which itself is now able to target various platforms. It comes with a Web Assembly API for operations performed on the Client side (encryption, decryption, key creation basically) in the |
Hi! Okey, that's really helpful. As Concrete relies on Concrete core, I understand I could use concrete-core-wasm on the frontend for key generation, encryption and decryption and I could have a Rust API working with Concrete boolean (v0.1.0) to manage operations? |
Yes I hope this would be possible, although maybe not very easy to set up. If you try it out we'll be interested to know what are the issues you have, and we'll be happy to help. 🙂 |
I already have the API working with Concrete Boolean, connected to a MongoDB database. |
Hi @agnesLeroy, sorry for the delay. I already have the backend working with Concrete Boolean as I mentioned, and I've been working on the Frontend to achieve the 3 layer arquitecture.
The node package can be built and compiled without an issue. The problem is that it has been designed for a node API. After the last definition of the exported functions, there is this line: Having explained the problem, I was wondering if anyone has tried to apply this crate to a Frontend, and how they got around the 'fs' issue for the browser. Thank you in advance. |
I can say it is feasible to at least get the encryption/decryption methods compiled and working. (I worked it out last summer - sadly in a private repo.) The bootstrapping on the other hand is going to require a lot of reimplementing x86_64 dependencies and optimizations, but doing that work in the browser is going to be impractical anyway. |
Hi! I just need the encryption and decryption, nothing else. Could you possibly share how you got around the 'fs' library not being available for the browser issue? Or any tip on how to achieve it. Thank you in advance! |
It seems I actually did publish the WebAssembly part of a Concrete project to my personal account: https://github.com/wyatt-howe/concrete-web. I'm no longer familiar with the latest version of Concrete, and the linked project predates the official WebAssembly API (so I never had that 'fs' library issue). Again, it's old, and works for arithmetic circuits only (I didn't realize there's now a "Concrete Boolean"!), but perhaps it is useful still. |
Hi! Sorry for the delay. I can't access the repository, I think it's private. |
Hello, did you try to build the wasm package for the "--target web" version and not "--target node-js" using wasm-pack (explained here )? Using the web is more adapted for the frontend. |
I didn't know that was an option. Thank you! It works fine with a React App. |
Hi, I'm building on top of the Internet Computer blockchain which is a Wasm environment, and to get these libraries working we'll need a clean wasm32-unknown-unknown compilation. As you work towards Wasm compatibility, please don't assume a browser environment. Like I said, a clean wasm32-unknown-unknown with no dependencies on the browser would be required for us in the Internet Computer ecosystem. |
Reproducing the reply from the Zama discourse (https://community.zama.ai/t/wasm32-unknown-unknown/342/2) here. Edit: the binding to come is focused on the client side only (encryption, decryption, keygen and serialization).
|
this is issue is ancient and the question has resurfaced here #1034 Closing this issue in favor of the more recent one |
Hi!
I'm opening this issue to ask about the progress of the migration of Concrete's libraries to Web Assembly. I intend to use it with wasm-bindgen, but, at the moment, Concrete only supports x86_64 arch from what I've seen.
Thank you in advance.
The text was updated successfully, but these errors were encountered: