Commit Graph

44 Commits

Author SHA1 Message Date
Sam Tay
badb8f9c8f ZKP tweaks (#279)
* Export type alias for bulletproof backend fields

Also, keep bulletproof stuff namespaced to a `bulletproofs` module.

* Change sudoku to use pub over const

* Docs updates

* Rename / clean up sudoku

* Export `Proof` type

Basically required for being able to deserialize a proof

* Add zkp/serde workspace example

* Drive by cleaning

* Exports necessary for gadget impls

* Rename compute_inputs to compute_hidden_inputs

* Add prove/verify builders

* Export the builder types

This isnt strictly necessary but it would be weird for these to not show up in the cargo docs

* Clippy fix

* Add helper .compile() & .runtime() methods to fhe prog fns

I do wonder if these should be defined in a separate trait, just so that they don't live next to the more internal functions in documentation.

* Use new swag to simplify the front-facing api docs example

* Add some whitespace

* Switch to an extension trait

* Add an extension to ZkpProgramFn

* Take an owned ZkpBackend, rather than reference

Its typical to have the caller handle cloning, rather than taking a reference, requiring Clone impl, and forcing clone. Plus, as of now the only backend is a zero size null struct, so nothing to be gained by using a reference. It also just looks weird to always pass `&BulletproofsBackend::new()`

* Update sudoku to use new swag

* Target second attribute in multi attribute error

* Enforce ordering zkp inputs: constants,public,private

Honestly this feels a little unnatural to me. Might want to reverse: private, public, constant and then change all the prove/verify methods to that ordering

* Build whitelist example in CI

* Reorder constant->public->private to private->public->constant

* Fix trailing ws

* Fix example

* Make .runtime() more consistent with .compile()

* Get rid of some boilerplate impls

* Add custom zkp type example

* Move example run checks into example tests

Should speed up CI a bit

* Change whitelist -> allowlist
2023-07-18 15:15:51 -04:00
Sam Tay
aadde9d162 Offer a simpler API for runtime creation (#246)
* Offer a simpler API for runtime creation

* Update docs and examples to use `FheRuntime::new`
2023-06-06 18:56:46 -07:00
rickwebiii
3543b88387 Rweber/zkp (#187)
Refactor APIs to support ZKPs
2022-11-22 15:44:00 -08:00
rickwebiii
121e7be325 Rweber/multiprogram (#130)
Allow compiling multiple FHE programs to use the same parameters.
2022-07-06 17:04:43 -07:00
Rick Weber
ad930251dc Add array support 2022-04-12 11:09:59 -07:00
Rick Weber
325ea85354 Fix simple_multiply, AMM comments 2022-04-04 15:37:34 -07:00
Rick Weber
945996f4ba FheProgramNode 2022-04-04 13:38:26 -07:00
Rick Weber
26d7d1438d Remove plain modulus from simple_multiply example 2022-04-04 13:14:13 -07:00
Rick Weber
cc13dee263 Use ? 2022-04-01 15:29:46 -07:00
Rick Weber
72f430fdd1 Use ? 2022-03-31 16:43:38 -07:00
Rick Weber
572d5b246f Update AMM per comments 2022-03-24 11:30:06 -07:00
Rick Weber
5639f3c16b Rename sunscreen_compiler to sunscreen 2022-03-22 14:29:35 -07:00
Rick Weber
fbe6ea356b Fix comment in simple multiply example 2022-02-22 15:24:42 -08:00
Rick Weber
e84f8da88b Remove unneccessary unsafe code. Add more validation and document some stuff 2022-02-18 15:45:57 -08:00
Rick Weber
31fea7a746 Cleanup 2022-02-14 19:07:34 -08:00
Rick Weber
5d37b391a7 Update example; remove dependency 2022-02-14 19:07:19 -08:00
Rick Weber
9ab12b0aa3 AIP 2022-02-14 17:39:06 -08:00
Rick Weber
fc63ba110b Rename noise_margin 2022-02-01 17:22:03 -08:00
Rick Weber
03b120e824 Rename Secret/Public to PrivateKey/PublicKey 2022-02-01 17:14:25 -08:00
Rick Weber
37f9167f04 Rename circuit WIP 2022-02-01 16:20:06 -08:00
Rick Weber
483ee9e296 circuit rename WIP 2022-02-01 15:59:05 -08:00
Rick Weber
4554dc2c05 Rename circuit WIP 2022-02-01 15:50:27 -08:00
Rick Weber
7a54d63a99 Remove Unsigned type; it doesn't support subtraction 2022-01-24 17:14:20 -08:00
Rick Weber
5a9f1d125b Can now add literals 2022-01-21 14:01:09 -08:00
Rick Weber
8b128fa29e Reorganize modules 2022-01-21 11:54:42 -08:00
Rick Weber
e459b8e9b5 WIP 2022-01-19 17:34:26 -08:00
Rick Weber
b352881e5d tests pass again with Cipher type 2022-01-19 15:45:34 -08:00
Rick Weber
74556b4208 CR comments 2021-12-21 13:05:15 -08:00
Rick Weber
88b757fbbc WIP 2021-12-15 22:53:04 -08:00
Rick Weber
58d58f2f71 Update runtime to take only scheme params 2021-12-14 15:46:00 -08:00
Rick Weber
ec9f0cf327 Cleanup docs 2021-12-14 15:31:11 -08:00
Rick Weber
6fcae9ab24 Update API 2021-12-14 15:24:40 -08:00
Rick Weber
d90ad78b1a Codegen circuit interface 2021-12-13 12:45:25 -08:00
Rick Weber
b36bbe6901 WIP 2021-12-13 11:35:48 -08:00
Rick Weber
c4d3ca99be Update example to use encrypt macro 2021-12-10 16:27:35 -08:00
Rick Weber
21ea1e4f91 decrypt! macro works 2021-12-10 15:49:01 -08:00
Rick Weber
872157dc0e decryption WIP 2021-12-10 14:10:56 -08:00
Rick Weber
e9cc28146b WIP 2021-12-09 19:00:01 -08:00
Rick Weber
284b13ccc9 Refactor Type info down to runtime 2021-12-09 16:53:03 -08:00
Rick Weber
87d1505409 Pack integers into multiple coefficients, encoders are dead. 2021-12-08 19:38:19 -08:00
Rick Weber
f87bc9a473 Refactor to lift FHE types into GraphNode<T: FheType> 2021-12-06 20:18:09 -08:00
Rick Weber
8da701aaf0 Require scheme on circuit attribute 2021-12-06 17:09:09 -08:00
Rick Weber
9a25a9dc4c rename sunscreen_frontend to sunscreen_compiler 2021-12-06 13:42:08 -08:00
Rick Weber
41c17c5445 Add example 2021-12-03 18:40:44 -08:00