Commit Graph

666 Commits

Author SHA1 Message Date
Sam Tay
0ccc76f784 Fix a few more links 2023-11-17 10:29:36 -05:00
rickwebiii
90ac4ebee6 fix broken doc links 2023-11-17 14:15:10 +03:00
rickwebiii
5662da53f9 API docs typo (#332) 2023-10-26 23:53:08 +00:00
Ryan Orendorff
bc7cfb2ce2 Linked prove and verify functions (#328) 2023-10-25 16:20:20 -06:00
Ryan Orendorff
f341e89d02 Remove unused imports (#331) 2023-10-25 14:42:51 -06:00
Sexosexosexo
150fd11dd4 Fix ToUInt: 2^n doesn't fit n bits (#323) 2023-10-25 16:24:59 -04:00
Ryan Orendorff
5ac9ad4e46 SDLP commit to w_shared (#329) 2023-10-20 16:10:12 +00:00
Ryan Orendorff
66740aad5f Bump sunscreen_bulletproofs (#327) 2023-10-18 22:50:41 +00:00
Ryan Orendorff
85f68eb3ce SDLP and R1CS BP shared inputs (#324) 2023-10-18 16:16:46 -06:00
rickwebiii
59da8edb8c Rweber/asserts (#326) 2023-10-18 12:59:30 -07:00
Ryan Orendorff
82a7f2b801 Address clippy comments (#325) 2023-10-17 16:52:09 -06:00
Ryan Orendorff
5d843565f7 Use same jit_prover ordering as specified in lib (#322) 2023-10-10 17:04:57 -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
Sam Tay
d9f64f4283 Bump all versions to 0.8.1 (#314) v0.8.1 2023-09-11 21:39:56 +00:00
Sam Tay
cbfa03bafe Fix odd type inference issue (#312) 2023-09-06 14:02:16 -04:00
rickwebiii
8681347d6a Rweber/zq (#310)
Update refify to be proc macro.
2023-08-29 14:11:52 -07: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
f0cdbe8a76 Bump mdbook (#307) 2023-08-23 15:04:14 +00:00
Sam Tay
9b4de3ca09 Fix missing version in dependencies (#306)
* Fix missing version in dependencies

* Fix crates.io metadata
v0.8.0
2023-08-22 22:27:47 -04:00
Sam Tay
cbbe0bafbe Bump all versions to 0.8.0 (#305) 2023-08-22 19:40:54 -04:00
Sam Tay
1c825db46e Make sure docs.rs builds with bulletproofs (#304) 2023-08-22 18:39:26 -04: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
e90c11910c Add deterministic encryption (#303)
* Add deterministic encryption

* Add deterministic encryption flag, runtime

* Fix clippy

* Address PR comments
2023-08-21 17:57:43 -06:00
Sam Tay
4018eab87d Bump playground (#301) 2023-08-18 10:42:54 -04:00
Sam Tay
5b3ee93b3b Fixup api docs a bit (#300)
* Fixup api docs a bit

* FieldSpec should live in types::zkp along with Field
2023-08-17 13:48:00 -04:00
Ryan Orendorff
c0ef426ca0 Export components used in BFV, prove BFV is valid in SDLP (#285) 2023-08-10 12:13:29 -06:00
Ryan Orendorff
9af787075a Add restore-keys to github actions (#297) 2023-08-10 10:17:37 -06:00
rickwebiii
480453fe13 Update dependencies (#296)
Update dependencies
2023-08-04 22:44:23 -07:00
rickwebiii
641bf96bd4 Rweber/deps (#295)
Move all deps to [workspace.dependencies]
2023-08-04 17:23:06 -07:00
rickwebiii
7049199a29 Rweber/zq (#293)
Add Barret reduction for Ring type
2023-08-04 14:36:32 -07:00
Sam Tay
8fe63d6e88 Fix benchmark (#289) 2023-08-01 16:24:25 -04:00
Ryan Orendorff
fc892c1727 Clippy fixes (#286) 2023-07-24 15:30:02 -06:00
Sam Tay
b8521c70e4 Fix doc comment (#284) 2023-07-18 20:26:19 -04: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
951ea237ee Playground bump (#281)
* Bump playground

* Re-bump playground

To up node version

* Bump playground again

* Ensure playground loads with zkp backends
2023-07-17 22:23:32 -04:00
rickwebiii
3c50ee477b Rweber/field spec (#283)
Rename NativeField<BackendField> to Field<FieldSpec>
2023-07-17 18:18:50 -07:00
rickwebiii
f05ce704b1 transparent-ciphertexts feature (#280) 2023-07-11 12:16:42 -07:00
Sam Tay
363734ff38 Properly factor inserting literal plaintexts (#278)
Throughout the const arthimetic operations. Not sure why I didnt do this in the initial PR
2023-07-10 13:39:14 -05:00
Ryan Orendorff
8dfaf33452 Switch SEAL submodule to sunscreen org (#277) 2023-07-10 10:57:56 -06:00
Ryan Orendorff
95721487a8 Mixed bounds in logproof (#276)
This enables some small performance increase for smaller proofs (up to approximately 75%). Additionally this enables the prover and verifier to agree on which components may or may not be interesting by specifying a
bounds of zero.
2023-07-07 12:37:12 -06:00
Ryan Orendorff
300c5eb019 Fix assert_poly_expansion for k > 1 (#275)
* Fix assert_poly_expansion for k > 1

The polynomial expansion was using a flattened tensor product when a normal kronecker product should have been used. This fixes that error.

As a consequence, it is now also possible to create a matrix from a
vector of vectors. This was implemented to make it easier to create the test cases for k > 1.
2023-07-07 11:52:32 -06:00
Ryan Orendorff
a91c7291fb Add CSV stdout for logproof bench (#274) 2023-07-06 10:36:27 -06: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
Sam Tay
036b782a69 Misc typos / Fix lib exports (#265)
* Misc doc fixes

* Fix sunscreen zkp exports

* Fix broken api doc reference
2023-06-27 19:43:20 -06:00
Ryan Orendorff
8d9af63de0 Fix bounds (b, b_1, b_2) on logproof (#262)
The prior bounds for the short discrete log proof were not quite
accurate for some inputs. Specifically, the following changes were made
to match the paper:

- b: log2(B) + 1 -> ⌈log2(B)⌉ + 1
- b₁: log2(mdB + d||f||_inf) -> ⌈log2(mdB + d||f||_inf)⌉
- b₂ log2(q) + 1 -> ⌈log2(q)⌉

Specifically, b₂ was correct unless q was a power of 2, which
essentially never happens in practice.
2023-06-27 10:35:08 -07:00
Ryan Orendorff
c7052bbfda Build to_2s_complement by individual elements. (#264)
This change is a no-op on the result; it is a precursor to having
bounds that can vary on each element in the input array.
2023-06-26 19:42:51 -07: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