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>
2 years ago
Marcin
50ab8ee5ba
Add a CI job to test against the curves repo ( #88 )
2 years ago
Tom Shen
986ab20ac0
Minor Bug Fix ( #87 )
2 years ago
Tom Shen
1f56c46edc
Bug Fix in `domain` and API changes ( #86 )
* Bug Fix in `domain` and API changes
Currently, `domain.query_position_to_coset` is not consistent native code in `ark-ldt`. This commit does the following changes:
* change `query_position_to_coset` to `query_position_to_coset_elements`, and make the return result consistent with native code
* add function `query_position_to_coset` to just return generator and offset instead of coset elements. This is useful when evaluating vanishing poly.
* minor bug fix
* update CHANGELOG
* `query_position_to_coset_elements` use `query_position_to_coset`
* Update CHANGELOG.md
Co-authored-by: Weikeng Chen <w.k@berkeley.edu>
3 years ago
Pratyush Mishra
1cf947c761
Merge nonnative ( #79 )
Co-authored-by: Nicholas Ward <npward@berkeley.edu>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
Co-authored-by: Weikeng Chen <w.k@berkeley.edu>
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Daira Hopwood <daira@jacaranda.org>
Co-authored-by: William Lin <31808623+Will-Lin4@users.noreply.github.com>
Co-authored-by: Dev Ojha <dojha12@gmail.com>
Co-authored-by: Alex Ozdemir <aozdemir@hmc.edu>
3 years ago
Weikeng Chen
a2a5ac491a
Fix BLS12 G2PreparedGadget's AllocVar with a divisive twist ( #77 )
* fix
* tidy up Cargo; add changelog
* fix nostd
* removal of the test
* fmt
3 years ago
Pratyush Mishra
b6e7e94521
Introduce `mul_by_inverse_unchecked`, and use it ( #75 )
3 years ago
Pratyush Mishra
65faa3e699
`impl ToBytesGadget for Vec<UInt8>` ( #76 )
3 years ago
Weikeng Chen
6e59e02a1b
Release v0.3.1 ( #73 )
3 years ago
Weikeng Chen
47ddbaa411
Enforce `mul_by_inverse` ( #70 )
* proposal to fix mul_by_inverse
* update CHANGELOG
* rollback to a secure impl
* update changelog
3 years ago
Weikeng Chen
1ad210462c
Implement the `Sum` trait for `FpVar` ( #71 )
* impl sum for fpvar
* fmt
* grammar
* update the CHANGELOG
3 years ago
Weikeng Chen
3871781225
For reference, add a test for non-zero-affine ( #69 )
* add a test for non-zero-affine for reference
* add some doc
3 years ago
Weikeng Chen
2b8e020aad
Release v0.3.0 ( #66 )
* Release v0.3.0
* fix the pr template
3 years ago
Tom Shen
c3a99ac3f6
Let `Radix2Domain::offset` to be `FpVar` instead of `F` ( #65 )
* restructure code
* done
* add changelog
* add the changelog to mark this as a breaking change
* add the CHANGELOG
* tweak
* add `EqGadget`
* rename generate_interpolate_cache to generate_interpolation_cache
* address the comment
Co-authored-by: weikeng <w.k@berkeley.edu>
3 years ago
Dev Ojha
02ee91d61b
Use batch_inversion_and_mul within native lagrange interpolation ( #63 )
3 years ago
Tom Shen
989f579ca8
Add Univariate Domain, Vanishing Polynomial, Lagrange Interpolation ( #53 )
* add domain and vp
* add lagrange interpolator
* add query position to coset
* nostd
* add test assertion
* fmt
* fix test
* add Add and Sub arithmetic
* add Add and Sub arithmetic
* add unit test for mul/div arithmetic
* add more doc for clarification
* add test for native interpolate
* add test for vp constraints
* fix lagrange interpolate bug
* comment cleanup + fmt
* add CHANGELOG
* fix a compile error
* Update CHANGELOG.md
* Update CHANGELOG.md
* fix comment
* doc fix
* doc update 2
* doc update 3
* pub lagrange_interpolator
* doc fix
* rename `EvaluationDomain` to `Radix2Domain`
* tweak
* tweak
Co-authored-by: weikeng <w.k@berkeley.edu>
3 years ago
dependabot-preview[bot]
d1be6d1d76
Upgrade to GitHub-native Dependabot ( #61 )
Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
3 years ago
Dev Ojha
5debc6f8f1
Rename AllocatedBit to AllocatedBool ( #60 )
* Rename AllocatedBit to AllocatedBool
* Update Changelog
* Fix independent fmt issues
3 years ago
Dev Ojha
47f296ae67
Release v0.2.0 PR ( #59 )
3 years ago
ValarDragon
2348acf3a1
Update changelog for release
3 years ago
Pratyush Mishra
b8a268d550
Check docs in CI
3 years ago
Pratyush Mishra
736b552720
Fix
3 years ago
Pratyush Mishra
73ac661ddf
Update CHANGELOG
3 years ago
Pratyush Mishra
53b2ac48fa
Fix `UInt` docs
3 years ago
dependabot-preview[bot]
fc44ff2de7
Update num-bigint requirement from 0.3 to 0.4
Updates the requirements on [num-bigint](https://github.com/rust-num/num-bigint ) to permit the latest version.
- [Release notes](https://github.com/rust-num/num-bigint/releases )
- [Changelog](https://github.com/rust-num/num-bigint/blob/master/RELEASES.md )
- [Commits](https://github.com/rust-num/num-bigint/compare/num-bigint-0.3.0...num-bigint-0.4.0 )
Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
3 years ago
Elder Ryan
a1e72154bf
fixed link format ( #54 )
3 years ago
Tom Shen
09f3613aac
Add DensePolynomialVar ( #50 )
* add folder structures similar to `ark-poly`
* add evaluate impl for DensePolynomialVar
* add tests
* fix no-std
* use ark_std::rand instead of SeedableRng
* add changelog
Co-authored-by: Weikeng Chen <w.k@berkeley.edu>
3 years ago
Weikeng Chen
b741ffc33d
replace `rand` with `ark_std::rand` and drop `rand_xorshift` ( #51 )
3 years ago
Dev Ojha
1f83ffdff4
Switch to panic='abort' for safety across FFI boundaries ( #47 )
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
3 years ago
Tom Shen
05fee34686
Add Mux gadget ( #48 )
3 years ago
Kobi Gurkan
a8f737bf26
Fix boolean or comment ( #44 )
3 years ago
Pratyush Mishra
d9e0200433
Improve handling of constant bits in scalar mul for SW curves ( #43 )
* We add a double_and_add method that computes 2 * self + other more
efficiently than just doubling + addition; this is not used anywhere
yet, but I am planning on fiddling with it to see if we can leverage
it somehow. (See zcash/zcash#3924 for details)
* We handle constant scalars better:
* We skip the most-significant constant zeroes to avoid unnecessary
doubling
* When intermediate bits of the scalar are constants, instead of
conditionally adding, we directly use the value of the bit to
decide whether to add or not.
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: weikeng <w.k@berkeley.edu>
3 years ago
Pratyush Mishra
5e4114b19c
Better scalar multiplication for Short Weierstrass curves ( #40 )
Co-authored-by: Dev Ojha <ValarDragon@users.noreply.github.com>
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
3 years ago
Dev Ojha
f88d7c6ea3
Make `mul_by_inverse` use one constraint ( #42 )
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
3 years ago
Dev Ojha
bdc9fbbf30
Add changelog and .github issue templates ( #39 )
* Add changelog and .github issue templates
3 years ago
William Lin
2432ff4f88
Implement ToConstraintFieldGadget for Vec<UInt8> ( #36 )
* Implement ToConstraintFieldGadget for Vec<UInt8>
* Add documentation and implementation for slice
* Update documentation
3 years ago
Pratyush Mishra
20bd452cd9
Construct `FpVar` from bits ( #35 )
3 years ago
Pratyush Mishra
0162ef18bc
More efficient scalar multiplication for Short Weierstrass curves ( #33 )
* When a group element is a constant, precompute multiples of powers of two, and perform simple conditional additions (no doubling!).
* For short weierstrass curves, addition with a constant now uses mixed addition, which results in lower constraint weight.
* For short weierstrass curves, scalar multiplication now uses mixed addition, saving 1 constraint per bit of the scalar, along with lower constraint weight (at the cost of a small constant number of constraints to check for edge cases)
3 years ago
Pratyush Mishra
262fac3e83
Loosen restrictions
3 years ago
Pratyush Mishra
a44643ed76
Fix `mul_by_inverse` for constants
3 years ago
Pratyush Mishra
f52b866e59
Fix documentation links ( #28 )
3 years ago
Pratyush Mishra
1e935b0b94
Fix `to_non_unique_bytes` for `BLS12::G1Prepared`
3 years ago
Pratyush Mishra
9cb17dc130
Fix links in `Cargo.toml`s
3 years ago
Pratyush Mishra
0fd45d3d83
Reduce allocations in `UInt`s
4 years ago
jon-chuang
905e7284b2
Reduce density of `ThreeBitCondNegLookup`
4 years ago
Weikeng Chen
68f08b94d2
Add UInt128 for u128 ( #21 )
4 years ago
Nirvan Tyagi
77dfd7dac6
'cargo +stable fmt'
4 years ago
Nirvan Tyagi
45a4c3b326
'cargo fmt'
4 years ago
Nirvan Tyagi
957ac48da4
Apply suggestions from code review
Co-authored-by: Pratyush Mishra <pratyushmishra@berkeley.edu>
4 years ago
Nirvan Tyagi
0abb3a7dfe
CondSelectGadget for UInts
4 years ago