This is intended to be a gadget library for bellpepper.
MIT
A library of gadgets compatible with bellpepper and bellperson
License: Apache License 2.0
This is intended to be a gadget library for bellpepper.
MIT
In #33 I had to have the triplet bellpepper
, bellpepper-core
and arecibo
as dependencies, and I got a bit lost in how they are managed.
Looking at a some projects having those as dependency, it seems that most of them have adopted the "fork" approach that let's us quickly pull updates (lurk-rs, circom-scotia, arecibo, ...) while others (such as this one) have opted for a fixed crate version.
I think we would probably gain to try and unify the way we import those dependencies.
As @huitseeker suggested I tried various triplets of dependencies and it seems that the one that worked for me is bellpepper = 0.4.1
bellpepper-core
as fork and arecibo
as fork. We could use this as a global approach.
There might be an issue with the field emulation library. The tests associated with bls12-381 emulation with pasta fields pass. However, when I changed the field from bls12-381's base field to BN254's base field (and adjusted EmulatedFieldParams trait appropriately), the tests fail in the following manner (similar errors for other tests).
---- fields::bn_fp::tests::test_random_add stdout ----
fail: "a+b = c/a = b/check limbs equality/right shift to get carry 0/enforce equality between input value and weighted sum of higher order bits"
Some("a+b = c/a = b/check limbs equality/right shift to get carry 0/enforce equality between input value and weighted sum of higher order bits")
fail: "a+b = c/a = b/check limbs equality/right shift to get carry 0/enforce equality between input value and weighted sum of higher order bits"
thread 'fields::bn_fp::tests::test_random_add' panicked at crates/bls12381/src/fields/bn_fp.rs:279:9:
assertion failed: cs.is_satisfied()
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
Here's what the trait implementation looks like:
use halo2curves::bn256::Fq as BnFp;
pub struct Bn254FpParams;
impl EmulatedFieldParams for Bn254FpParams {
fn num_limbs() -> usize {
4
}
fn bits_per_limb() -> usize {
64
}
fn modulus() -> BigInt {
BigInt::parse_bytes(
b"30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47",
16,
)
.unwrap()
}
fn is_modulus_pseudo_mersenne() -> bool {
false
}
fn pseudo_mersenne_params() -> Option<PseudoMersennePrime> {
None
}
}
pub type Bn254Fp<F> = EmulatedFieldElement<F, Bn254FpParams>;
bellpepper-gadgets/.github/workflows/rust.yml
Lines 72 to 97 in 68172e9
actions-rs is obsolete for our toolchain and should be phased out
We have tests for constraint counts in Nova:
https://github.com/lurk-lab/arecibo/blob/605f89990666cae63ff534245ea701199fe0df82/src/circuit.rs#L462-L502
https://github.com/lurk-lab/arecibo/blob/605f89990666cae63ff534245ea701199fe0df82/src/supernova/circuit.rs#L836
https://github.com/lurk-lab/arecibo/blob/605f89990666cae63ff534245ea701199fe0df82/src/supernova/test.rs#L568
and in Lurk for MemoSet:
https://github.com/lurk-lab/lurk-rs/blob/f9f87545a3ffa0cf921fa2557021a7b9040b7ad5/src/coprocessor/memoset/mod.rs#L791
That count the number of expected constraints in a circuit. We should add one for the recently added keccak/sha3 gadgets (see #14) ideally using expect_test
As said in lurk-lab/arecibo#347, we have in arecibo
a few gadget utilities that have been written. So far, they are only available to this arecibo
crate. While working in bellpepper-gadgets
or any other gadget repositories, a few of those utilities could come in handy.
There are already cases where they have been copied so I believe that migrating them will prove useful.
The bls12_381
crate does not export some internal items that are used in the bellpepper-bls12381
gadget. Currently this fork lives (temporarily) at wrinqle/bls12_381
We should get rid of this git dependency, doing one of:
lurk-lab
github organizationbls12_381
native dependency with something like blst
(or anything else that exposes enough internals) instead (this would be a non-trivial change: we make use of many internal functions for some tests)This repo lacks our CoC:
https://github.com/lurk-lab/lurk-rs/blob/master/CODE_OF_CONDUCT.md
And our dependabot config:
https://github.com/lurk-lab/lurk-rs/blob/master/.github/dependabot.yml
Some dependencies specified in Cargo.toml
are not needed.
Check the unused dependencies sanity check workflow for details.
This issue was raised by the workflow at https://github.com/lurk-lab/ci-workflows/tree/main/.github/workflows/unused-deps.yml
.
Note
If this is a false positive, please refer to thecargo-udeps
docs on how to ignore the dependencies.
The conditionally_select
method of EmulatedFieldElement
unwraps the boolean condition which is None
when running with TestCS
. This happens at
The fix involves replacing unwrap
with unwarp_or_default
Similar to what we have for the rest of our infrastructure.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.