Commit Graph

10 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
48ebc52576 Rweber/zkp (#211)
Metal GPU accelerated scalar multiplication
2023-02-16 14:31:55 -08:00
rickwebiii
3543b88387 Rweber/zkp (#187)
Refactor APIs to support ZKPs
2022-11-22 15:44:00 -08:00
Sam Tay
e2e5da3f60 Manually fix the rest of the clippy warnings 2022-10-31 15:30:34 -07:00
Sam Tay
4b53103953 Auto fix clippy warnings 2022-10-31 15:30:34 -07:00
rickwebiii
989fe1c578 Update mean/variance example to use serialization (#173)
* Update mean/variance example to use serialization

* cargo fmt
2022-09-02 15:38:03 -07:00
rickwebiii
3d5385fdd9 Cargo fmt 2022-08-09 16:08:57 -07:00
rickwebiii
7d4495859d Remove unwraps 2022-08-09 16:08:28 -07:00
rickwebiii
18c9b62b1d Add mean_variance example 2022-08-09 14:38:13 -07:00