Skip to content

Commit f6df807

Browse files
authored
Update ark-snark to ark-algebra (#366)
* fix * ready for review * small change * update serialization * derive is not needed here * point to the master branch of algebra
1 parent 8bb375e commit f6df807

File tree

5 files changed

+19
-9
lines changed

5 files changed

+19
-9
lines changed

Cargo.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,11 @@ lto = "thin"
2929
incremental = true
3030
debug-assertions = true
3131
debug = true
32+
33+
[patch.crates-io]
34+
ark-ff = { git = "https://github.com/arkworks-rs/algebra" }
35+
ark-ec = { git = "https://github.com/arkworks-rs/algebra" }
36+
ark-test-curves = { git = "https://github.com/arkworks-rs/algebra" }
37+
ark-std = { git = "https://github.com/arkworks-rs/std" }
38+
ark-serialize = { git = "https://github.com/arkworks-rs/algebra" }
39+
ark-poly = { git = "https://github.com/arkworks-rs/algebra" }

relations/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ keywords = ["zero-knowledge", "cryptography", "zkSNARK", "SNARK", "constraint-sy
1010
categories = ["cryptography"]
1111
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
1212
license = "MIT/Apache-2.0"
13-
edition = "2018"
13+
edition = "2021"
1414

1515
[dependencies]
1616
ark-ff = { version = "^0.3.0", default-features = false }

relations/src/r1cs/constraint_system.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ impl<F: Field> ConstraintSystem<F> {
315315
) -> (usize, Option<Vec<F>>),
316316
) {
317317
// `transformed_lc_map` stores the transformed linear combinations.
318-
let mut transformed_lc_map = BTreeMap::new();
318+
let mut transformed_lc_map = BTreeMap::<_, LinearCombination<F>>::new();
319319
let mut num_times_used = self.lc_num_times_used(false);
320320

321321
// This loop goes through all the LCs in the map, starting from

snark/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,10 @@ keywords = ["zero-knowledge", "cryptography", "zkSNARK", "SNARK"]
1010
categories = ["cryptography"]
1111
include = ["Cargo.toml", "src", "README.md", "LICENSE-APACHE", "LICENSE-MIT"]
1212
license = "MIT/Apache-2.0"
13-
edition = "2018"
13+
edition = "2021"
1414

1515
[dependencies]
1616
ark-ff = { version = "^0.3.0", default-features = false }
1717
ark-std = { version = "^0.3.0", default-features = false }
18+
ark-serialize = { version = "^0.3.0", default-features = false }
1819
ark-relations = { version = "^0.3.0", path = "../relations", default-features = false }

snark/src/lib.rs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,27 +10,28 @@
1010
)]
1111
#![forbid(unsafe_code)]
1212

13-
use ark_ff::{PrimeField, ToBytes};
13+
use ark_ff::PrimeField;
1414
use ark_relations::r1cs::ConstraintSynthesizer;
15+
use ark_serialize::{CanonicalDeserialize, CanonicalSerialize};
16+
use ark_std::fmt::Debug;
1517
use ark_std::rand::{CryptoRng, RngCore};
16-
use core::fmt::Debug;
1718

1819
/// The basic functionality for a SNARK.
1920
pub trait SNARK<F: PrimeField> {
2021
/// The information required by the prover to produce a proof for a specific
2122
/// circuit *C*.
22-
type ProvingKey: Clone;
23+
type ProvingKey: Clone + CanonicalSerialize + CanonicalDeserialize;
2324

2425
/// The information required by the verifier to check a proof for a specific
2526
/// circuit *C*.
26-
type VerifyingKey: Clone + ToBytes;
27+
type VerifyingKey: Clone + CanonicalSerialize + CanonicalDeserialize;
2728

2829
/// The proof output by the prover.
29-
type Proof: Clone;
30+
type Proof: Clone + CanonicalSerialize + CanonicalDeserialize;
3031

3132
/// This contains the verification key, but preprocessed to enable faster
3233
/// verification.
33-
type ProcessedVerifyingKey: Clone;
34+
type ProcessedVerifyingKey: Clone + CanonicalSerialize + CanonicalDeserialize;
3435

3536
/// Errors encountered during setup, proving, or verification.
3637
type Error: 'static + ark_std::error::Error;

0 commit comments

Comments
 (0)