36 Commits

Author SHA1 Message Date
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
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
rickwebiii
641bf96bd4 Rweber/deps (#295)
Move all deps to [workspace.dependencies]
2023-08-04 17:23:06 -07: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
f05ce704b1 transparent-ciphertexts feature (#280) 2023-07-11 12:16:42 -07: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
60b345cc5e Make gadgets sync (#237)
* Make gadgets send/sync

This lets Application types be send/sync

* Bump curve25519 to appease clippy

* Speed up unsigned tests a tiny bit
2023-05-01 17:45:25 -07:00
Sam Tay
ace6d97140 Add a bfv::Unsigned type (#236)
* Add a bfv::Unsigned type

* Fix decoding from polynomial?

* Add prop test for addition

* Proptest sub, mul, and mixed cipher/plaintexts

* Reduce code dupe

* Add test for 0 - 1

* Add a few more tests
2023-04-24 11:57:33 -07:00
rickwebiii
af4849ddb5 Time shield circuits (#224)
* Time shield/unshield circuits
2023-03-08 19:19:59 -08:00
rickwebiii
c034f761e7 Rweber/zkp (#223)
* Add smart FHE TX benchmark
2023-03-08 17:49:08 -08:00
rickwebiii
6f713d6750 Rweber/zkp (#218)
Private tx range proof
2023-03-02 15:16:45 -08:00
rickwebiii
6604afbf95 ZKP array inputs (#217)
* ZKP array inputs
2023-03-01 13:33:14 -08:00
rickwebiii
48ebc52576 Rweber/zkp (#211)
Metal GPU accelerated scalar multiplication
2023-02-16 14:31:55 -08:00
rickwebiii
38a67b7d97 Can encode negative numbers onto native fields (#198)
* Can encode negative numbers onto native fields
2023-01-05 15:38:18 -08:00
rickwebiii
85e3a60e35 Rweber/zkp (#194)
Add to_unsigned gadget and test
2022-12-08 17:57:31 -08:00
rickwebiii
eac27d6ff5 Runtime now takes a ZKP backend (#192)
Runtime now takes a ZKP backend so we can JIT with NativeField
2022-12-03 11:31:43 -08:00
rickwebiii
72f00391ea Rweber/zkp (#188)
ZKP works E2E
2022-11-29 13:47:29 -08:00
rickwebiii
f79e2312af Rweber/clippy (#189)
Improve Errors (use thiserror and reduce their size). Fix clippy errors.
2022-11-29 13:18:45 -08:00
rickwebiii
3543b88387 Rweber/zkp (#187)
Refactor APIs to support ZKPs
2022-11-22 15:44:00 -08:00
rickwebiii
d847021858 Rweber/zkp (#186)
Add ZKP backend for Bulletproofs
2022-11-18 20:06:48 -08:00
rickwebiii
28ea71118f Rweber/zkp (#185)
Start ZKP compiler and refactor common code.
2022-11-15 12:43:04 -08:00
rickwebiii
0ca0052018 Rweber/release 0.7 (#178)
* 0.7 release

* Fix docs links
2022-10-17 14:56:27 -07:00
rickwebiii
c2b1850fab Rweber/maint (#176)
Fix security vulnerability warning for unmaintained ansi_term.
2022-09-22 11:55:59 -07:00
rickwebiii
b8cbacac69 Downgrade minimum required toolchain (#160) 2022-07-20 12:05:07 +01:00
rickwebiii
37bec208b3 Rweber/crateupdate (#151)
* Update crate info

* Update crates-io.md

* bump

Co-authored-by: ravital <47154865+ravital@users.noreply.github.com>
2022-07-14 11:16:08 -07:00
rickwebiii
123da60636 Rweber/packages (#150)
* No network during build

* Bump packages
2022-07-13 18:47:54 -07:00
rickwebiii
04d0ee90d2 Fixup Cargo.toml files for release 2022-05-16 18:00:39 -07:00
rickwebiii
17ea255f4e Add playground, rename seal->seal_fhe 2022-05-16 16:09:07 -07:00
Rick Weber
2ad081f9c7 Version bump 2022-04-28 16:07:35 -07:00
Rick Weber
4b0b3f38cd It works 2022-04-26 14:59:53 -07:00
Rick Weber
6047fba925 Bump version 2022-04-19 10:44:17 -07:00
Rick Weber
fe23df89d2 hexl feature 2022-04-14 16:39:05 -07:00
Rick Weber
a8d6f9fdc0 Add comment on semver 2022-03-24 10:36:07 -07:00
Rick Weber
43728ccc99 Bump sunscreen 2022-03-23 14:50:14 -07:00
Rick Weber
5639f3c16b Rename sunscreen_compiler to sunscreen 2022-03-22 14:29:35 -07:00