Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor after ecc gadget changes #116

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
algebra = {features = ["tweedle"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
primitives = {features = ["tweedle", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
algebra = {features = ["tweedle"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
primitives = {features = ["tweedle", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}

cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", tag = "0.2.0-alpha2" }
r1cs-core = {git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", branch = "fix_ecc_gadget_arithmetic" }
r1cs-core = {git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
#ouroboros = {path = "../ouroboros"}
demo-circuit = {path = "../demo-circuit"}

Expand Down
12 changes: 6 additions & 6 deletions demo-circuit/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@ edition = "2018"
include = ["Cargo.toml", "src"]

[dependencies]
algebra = {features = ["tweedle", "ed25519"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
primitives = {features = ["tweedle", "signature", "vrf"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
r1cs-crypto = {features = ["tweedle", "signature", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
r1cs-core = {git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
r1cs-std = {features = ["tweedle", "nonnative"], git = "https://github.com/HorizenOfficial/ginger-lib.git", tag = "0.5.0-alpha1"}
algebra = {features = ["tweedle", "ed25519"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
primitives = {features = ["tweedle", "signature", "vrf"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
r1cs-crypto = {features = ["tweedle", "signature", "merkle_tree"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
r1cs-core = {git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}
r1cs-std = {features = ["tweedle", "nonnative"], git = "https://github.com/HorizenOfficial/ginger-lib.git", branch = "fix_ecc_gadget_arithmetic"}

cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", tag = "0.2.0-alpha2" }
cctp_primitives = { git = "https://github.com/HorizenOfficial/zendoo-cctp-lib.git", branch = "fix_ecc_gadget_arithmetic" }

derivative = "=2.2.0"
lazy_static = "=1.4.0"
Expand Down
3 changes: 1 addition & 2 deletions demo-circuit/src/blaze_csw/constraints/data_structures.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1184,10 +1184,9 @@ impl ScPublicKeyGadget {
)?;
}

Ok(ECPointSimulationGadget::new(
Ok(ECPointSimulationGadget::from_coords(
sw_pk_x_coordinate_g,
sw_pk_y_coordinate_g,
Boolean::Constant(false),
))
}

Expand Down
2 changes: 1 addition & 1 deletion demo-circuit/src/blaze_csw/constraints/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,7 +1083,7 @@ mod test {

// Change the first bit
let (mut public_key, secret_key) = get_test_key_pair();
public_key[0] ^= 1;
*public_key.last_mut().unwrap() ^= 128;

let (sys_data, last_wcert, utxo_data, ft_data) = generate_test_csw_prover_data(
CswType::UTXO,
Expand Down
8 changes: 4 additions & 4 deletions demo-circuit/src/constants/old_circuit_keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ const CSW_NO_CONST_VK_DIGEST: &str =
"bc6c5f7327a3668513351b35191112e9053d2df9643b0708da32230338dd5451";

const THRESHOLD_V1_PK_DIGEST: &str =
"b9701b189eb1e265dd128b236a3ec4979984b76a288101aac7c4074062bdf349";
"bcc672e39e2cb4fbeaac3b0f5e859f35264a41e37276f06f81169e53d1933e7f";
const THRESHOLD_V1_VK_DIGEST: &str =
"00f26e9ab058d46bc39f0c0383c22981a64a3c946e22dda5eae3c4c050f401a3";
"aece7e4216fa5590ceb206ef580d3a8aec040306fdb134d2f63128d7bd40f622";

// Base: zendoo-sc-cryptolib v0.6.0
const THRESHOLD_V2_PK_DIGEST: &str =
"d3a70ab2990ae2b625b632d684049c19cd019237f49c419d9feb013b7cd5a373";
"6d36fdf04efa4b148291bbe8fb3b80eb3a32602f6e97b3f7b805751647e210ca";
//"8e5987aba3c5a7ec44bc8b666ba2c720b4cbc857336dbbb052a7fe84b78119e2";
const THRESHOLD_V2_VK_DIGEST: &str =
"0792d70d039a46dd6a29b2f87897e39c0ffc31c1f5d19b5db01a50a72a3f94db";
"073a78e7f8ffc53a38dbf21cd08e80656a71c86073db262933fb2c7cd976fa7b";
// "43478bf7f66e2e64f5d55e00ba8352a627bfafb9eebdb475501d4837d43734a9";

// Common parameters to be used for regression
Expand Down
2 changes: 1 addition & 1 deletion demo-circuit/src/naive_threshold_sig/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ impl ConstraintSynthesizer<FieldElement> for NaiveThresholdSignature {
cs.ns(|| "hash public keys"),
pks_g
.iter()
.map(|pk| pk.pk.x.clone())
.map(|pk| pk.pk.get_x_coord().clone())
.collect::<Vec<_>>()
.as_slice(),
)?;
Expand Down