65 Commits

Author SHA1 Message Date
Ryan Orendorff
564ee875bc Remove docs publishing github action (#396) 2025-05-06 17:56:10 +00:00
rickwebiii
08b1660346 add some documentation (#391)
Co-authored-by: Rick Weber <rick@sunscreen.tech>
2025-01-17 23:50:05 +00:00
rickwebiii
a46a20d2f1 Parallelize cbs pfksk generation (#355) 2024-02-22 14:04:39 -08:00
Sam Tay
cb20e8d030 Decrypt statements (#348) 2024-02-20 22:55:49 +00:00
Ryan Orendorff
dc8fdeab81 Sunscreen's TFHE implementation (#349)
Co-authored-by: Sam Tay <samctay@pm.me>
2024-02-16 22:29:35 +00:00
Sam Tay
191536e5e7 Avoid extra CI builds (#340) 2024-02-08 00:22:36 +00:00
Sam Tay
18ea59b542 Proof linking (#339) 2024-02-03 20:01:24 +00:00
Ryan Orendorff
bc7cfb2ce2 Linked prove and verify functions (#328) 2023-10-25 16:20:20 -06:00
rickwebiii
f6131d47c8 Rweber/zint (#317) 2023-09-19 15:11:41 -07:00
rickwebiii
1b5e50e47c Tune workflow (#315)
Use 8-core runner for beefy tasks and shitty ones for shitty tasks
2023-09-11 17:22:41 -07:00
rickwebiii
08fbebf5ea Rweber/zq (#313)
Replace ark-ff in logproof with Sunscreen Ring traits.
2023-09-12 00:03:08 +00:00
rickwebiii
aa17f7fd24 Rweber/emscripten (#309) 2023-08-28 14:43:09 +00:00
Ryan Orendorff
69891249f4 Add deterministic linux hash, gh actions workflow (#308) 2023-08-24 13:00:31 -06:00
Sam Tay
8eb8936f51 Add ZKP compiler docs (#302)
* Enable folding

* Move troubleshooting.md

* Merge in zkp docs

* Convert all absolute links to relative

* Fix CI
2023-08-22 18:35:53 -04:00
Ryan Orendorff
9af787075a Add restore-keys to github actions (#297) 2023-08-10 10:17:37 -06:00
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
5faf981178 Hackathon; or, various compiler improvements (#272)
* Misc doc fixes

* Fix sunscreen zkp exports

* Fix broken api doc reference

* Add starter zkp example

* Use ZkpRuntime::new in sudoku example

* Use ? over unwrap in zkp examples

* Refactor pattern matching

No functionality changes

* Disallow `mut` args in fhe/zkp programs

* Play around with allowing cipher|plain values

* Allow user-declared plain|cipher values

NOTE: Not fully implemented. Will not work on Rational types until we
factor out literal->plaintext into a proper trait.

This allows, e.g.

```rust
fn simple_sum(a: Cipher<Signed>, b: Cipher<Signed>) -> Cipher<Signed> {
    let mut sum = fhe_var(0);
    sum = sum + a;
    sum = sum + b;
    fhe_out(sum)
}
````

* Refactor array::output()

* More targeted compiler error messages on invalid return values

* Add option for var.into() rather than fhe_out(var)

* Fix incorrect macro invocation

* Add trait for inserting const as plaintext

* Impl all arithmetic operations for indeterminate nodes

* Offer an `fhe_var!` macro

* Offer a zkp_var! macro

* Offer a (safe) debug impl for zkp program nodes

* Fix tests

* Add test for fhe_var!

* Simplify tf out of sudoku

* Simplify fhe input() codegen

* Marginally better compiler error messages on invalid fhe program arg types

* Fix error for fhe program argument attributes

* Throw appropriate compiler error on generics

* Silence clippy warnings in generated code

These I think are typically ignored by default when consuming proc macros but might as well be explicit

* Fixup quote_spanned invocations

Unsure how important this is, but see here: https://docs.rs/quote/latest/quote/macro.quote_spanned.html#syntax

* Automatically call `.into()` on fhe prog return values

* Factor fhe_program_impl

* Further factor fhe_program_impl

So that token generation happens in helper methods, and the ultimate output() func is readable

* Fix doctests

* Fix clippy warnings

* Remove TODOs

* Add missing example runs to CI

* Oops: fix 232 > 64

* Allow arbitrary expressions in fhe_var!

* Use custom "into" to support impls on []

* Support explicit #[private] params

* Remove `backend = "bulletproofs"` attribute

* Address PR reveiw
2023-07-05 17:07:21 -05:00
mliu24
4fbac668d0 Update rust.yml (#266)
added test coverage to debugger branch for matthew and bryan
2023-06-26 17:06:25 -07:00
Sam Tay
c2ad1138c2 Fix broken doc links (#252)
* Fix broken doc links

* Fail CI on api doc warnings

* Fix broken api docs
2023-06-12 12:46:08 -07:00
rickwebiii
d847021858 Rweber/zkp (#186)
Add ZKP backend for Bulletproofs
2022-11-18 20:06:48 -08:00
Sam Tay
c525ee6d5d Separate clippy into separate job 2022-10-31 15:30:34 -07:00
Sam Tay
3452643546 Run clippy in CI 2022-10-31 15:30:34 -07:00
rickwebiii
4c8bddbc28 Website (#156)
* website deployment

* site
2022-07-15 12:32:48 -07:00
rickwebiii
3ed8f5b154 Break up caches (#155)
* Break up caches

* Typo
2022-07-15 11:44:40 -07:00
rickwebiii
414bf675dd Playground (#142)
Playground changes
2022-07-06 12:55:32 -07:00
rickwebiii
afc11c0e5d Prod (#141) 2022-07-05 17:22:28 -07:00
rickwebiii
1557bb039a Playground (#140)
Add playground deployment, dockerization and works with Elastic Beanstalk
2022-07-05 17:20:38 -07:00
rickwebiii
7ef8b5aad8 Remove tools from playground 2022-06-24 11:26:07 -07:00
rickwebiii
cdbab1bf89 Update s3 bucket 2022-05-18 17:39:50 -07:00
rickwebiii
e9911e1f9c Add default region 2022-05-18 15:26:44 -07:00
rickwebiii
4151022498 fix 2022-05-18 14:44:17 -07:00
rickwebiii
b2d48fea81 Fix 2022-05-18 14:37:34 -07:00
rickwebiii
905d69bd09 Add docs deployment 2022-05-18 14:36:29 -07:00
rickwebiii
c9966eda35 Playground works 2022-05-18 10:35:57 -07:00
rickwebiii
17ea255f4e Add playground, rename seal->seal_fhe 2022-05-16 16:09:07 -07:00
rickwebiii
4daba168ec Update CI 2022-05-10 22:41:03 -07:00
rickwebiii
38ae171ca3 playground 2022-05-10 22:37:08 -07:00
rickwebiii
b1bfe7fabc key pair 2022-05-10 18:58:25 -07:00
rickwebiii
fe5e328275 WIP 2022-05-10 18:51:47 -07:00
rickwebiii
d00fc7bf02 WIP 2022-05-10 18:41:23 -07:00
rickwebiii
c8c3b8d02f WIP 2022-05-10 18:31:20 -07:00
rickwebiii
403e65f083 Build playground 2022-05-10 16:56:16 -07:00
rickwebiii
5991d40f2a Fix frontend build 2022-05-10 16:50:14 -07:00
rickwebiii
911184382e playground workflow 2022-05-10 16:48:15 -07:00
rickwebiii
50ccf64d7c Cache 2022-05-02 21:48:34 -07:00
rickwebiii
54c79835a8 Update cwd 2022-05-02 21:24:03 -07:00
rickwebiii
aa6dab33e0 Readd API docs check 2022-05-02 19:17:11 -07:00
rickwebiii
9ff458cf00 Remove artifacts 2022-05-02 19:14:40 -07:00
Rick Weber
99283cbc6b Fix 2022-05-02 17:45:36 -07:00
Rick Weber
b189e807e6 Add caching 2022-05-02 17:41:40 -07:00