winderica
3cb9fdef00
`FpVar::{is_eq, is_neq}` only need two constraints ( #133 )
Co-authored-by: Pratyush Mishra <pratyush795@gmail.com>
1 year ago
Michele Orrù
529c8dc29e
Import AdditiveGroup. ( #122 )
Co-authored-by: mmagician <marcin.gorny.94@protonmail.com>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
1 year ago
Michele Orrù
6d64f379a2
Fix with latest arkworks version. ( #95 )
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
2 years ago
Weikeng Chen
b7874406ec
Upgrade to work with latest `ark-ff` ( #90 )
Co-authored-by: Sun <huachuang20@gmail.com>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
3 years ago
Dev Ojha
5debc6f8f1
Rename AllocatedBit to AllocatedBool ( #60 )
* Rename AllocatedBit to AllocatedBool
* Update Changelog
* Fix independent fmt issues
4 years ago
Weikeng Chen
b741ffc33d
replace `rand` with `ark_std::rand` and drop `rand_xorshift` ( #51 )
4 years ago
Kobi Gurkan
a8f737bf26
Fix boolean or comment ( #44 )
4 years ago
Pratyush Mishra
20bd452cd9
Construct `FpVar` from bits ( #35 )
4 years ago
Pratyush Mishra
f52b866e59
Fix documentation links ( #28 )
4 years ago
Pratyush Mishra
0fd45d3d83
Reduce allocations in `UInt`s
4 years ago
Pratyush Mishra
636f93a3e5
Update to `arkworks` libraries ( #3 )
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
4 years ago
Pratyush Mishra
99e489cac7
`R1CSVar`: `Option::None` -> `ConstraintSystemRef::None` ( #281 )
4 years ago
Pratyush Mishra
13332bcc1d
Add doctests for `Boolean` and `UInt8`.
4 years ago
Pratyush Mishra
370fbcdd3b
Document `r1cs-std`
4 years ago
Weikeng Chen
c21d0b2796
Add `ToConstraintFieldGadget` ( #278 )
4 years ago
Pratyush Mishra
40ce981801
Fix integer conversions and log2
4 years ago
Pratyush Mishra
5e00793999
Switch to `tracing`-based constraint debugging
4 years ago
Pratyush Mishra
d2d1b61d08
Refactor NIZK/MT verification to return a bit
4 years ago
Pratyush Mishra
6cca9327be
Refactor bit iteration infrastructure:
* `to_bits` -> `to_bits_le`
* `BitIterator` -> `BitIteratorLE` + `BitIteratorBE`
* `found_one`/`seen_one` -> `BitIteratorBE::without_leading_zeros`
4 years ago
Pratyush Mishra
7b0f71a10e
Refactor `bit` variables in `r1cs-std`
4 years ago
Weikeng Chen
61c70ed644
Prepare Zexe for recursion ( #241 )
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
4 years ago
Pratyush Mishra
75c55f7bee
Change `from_repr` to output `Option<Self>`
4 years ago
Bruno França
bbb7d75ec8
Implement `conditional_check_verify` for `NIZK`s ( #195 )
* Implement `ToBitsGadget` for `UInt8` and `Vec<UInt8>`
* Add `kary_or` function to `Boolean`.
5 years ago
Kobi Gurkan
5cc094be6b
Adds alloc_constant to AllocGadget ( #189 )
* adds alloc constant to AllocGadget
* fmt
* fmt
* more alloc constant impls
* fmt
* even more impls
* fixes type
* fixes alloc_constant in gm17
* uses alloc_constant from field gadget in group gadgets
* fmt
* handle most comments
5 years ago
Pratyush Mishra
33a9da08f8
Switch to `stable` cargo formatting options
5 years ago
Pratyush Mishra
b1913a9ca7
Change default `to_bits` and `to_bytes` functions to the safe versions
5 years ago
ValarDragon
20af44e3c9
fix fmt check
5 years ago
ValarDragon
23c6bb4bd0
Rename arguments to CondSelectGadget for code clarity
5 years ago
Pratyush Mishra
0df0a15e1b
Blake PRF & R1CS Boolean Refactor ( #132 )
* refactor(r1cs-std/boolean): expose enforcing value less than functionality
* fix(r1cs-std/boolean): ensure num_bits is calculated correctly from the arg
* feat(primitives/blake2s): allow creating Blake2s with custom params
5 years ago
Pratyush Mishra
8bf042a029
Refactor `algebra` API, split into `algebra` and `algebra-core`. ( #100 )
5 years ago
Marek Kotewicz
9621bd34a4
r1cs-std works with no-std ( #92 )
5 years ago
François Garillot
b26867f267
Runs rustfmt on the repo
5 years ago
Pratyush Mishra
a3e1cd6cf2
Make libraries compile
5 years ago
Pratyush Mishra
40cf13b7b8
num_traits:: -> algebra::
5 years ago
François Garillot
722a901ae7
[RFC] Convert identity functions in Field, Group, and {Projective,Affine}Curve traits with One/Zero traits from num_traits.
- contributes to #50 ,
- depends on #53 and builds on it,
- due to coherence & requirements of `num_traits::{Zero, One}` to implement `std::ops::Add<Self, ..>` and (resp.) `std::ops::Mul<Self, ..>`, I've had to replace the afferent `impl<'a, P: ..> (Add|Mul)<&'a Self> for Group(Affine|Projective)<P>` by direct implementations on `Self`,
- I did not have to fight the borrow checker for this conversion => I think this hints arithmetic operations are called in contexts where the operand is owned,
- hence should this end up on a merge track, we may want to open an issue to convert the `impl<'a, P:..> (Neg|Sub|..)<&'a Self> for ..<P>` trait usage to direct `impl<P:..> (Neg|Sub|..)<Self> for ..<P>`
- the `impl AddAssign for GroupAffine<P>` in curves/models/short_weierstrass_jacobian.rs is provided to fit trait bounds, and without any guarantee of suitability for any particular purpose
- and that, even though I don't think it's used.
5 years ago
Pratyush Mishra
2a8974e442
Boolean conditional select
5 years ago
François Garillot
b42d5f8d36
Simplify a few "if" structures
5 years ago
François Garillot
53a51eb4dc
Use built-in iteration functions more
5 years ago
François Garillot
d71bc5a675
Prefer to return error rather than ? them,
avoid return when it cant be early (in a simple if-else)
5 years ago
François Garillot
10c6e85c1a
Remove a few unnecessary `.into_iter()` explicit calls, and some cloning.
See https://rust-lang.github.io/rust-clippy/master/#explicit_into_iter_loop
5 years ago
Kobi Gurkan
581f3df55f
Adds Bowe-Hopwood hash
5 years ago
Pratyush Mishra
0a507b0a5f
Upgrade ff-fft, gm17, and r1cs-std
5 years ago
Pratyush Mishra
c610ecbcc5
Update r1cs-std tests
5 years ago
Pratyush Mishra
e00d667330
Move snark-gadgets to r1cs-std
5 years ago