Skip to content

Commit

Permalink
Process vectors
Browse files Browse the repository at this point in the history
  • Loading branch information
davxy committed Jul 27, 2024
1 parent 51b9349 commit 8490f0e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
13 changes: 8 additions & 5 deletions src/ring.rs
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,7 @@ pub(crate) mod testing {
// TODO: RingSuiteExt with a function to get a reference to the ring context ('static)
// ring_ctx = RingSuiteExt::context()
// The suite is then in charge of its construction
// TODO: also dump the verifier pks commitmet

use ark_std::rand::SeedableRng;
let rng = &mut rand_chacha::ChaCha20Rng::from_seed([0x11; 32]);
Expand Down Expand Up @@ -444,11 +445,13 @@ pub(crate) mod testing {
}

fn from_map(map: &common::TestVectorMap) -> Self {
todo!()
// let base = common::TestVector::from_map(map);
// let c = codec::scalar_decode::<S>(&map.item_bytes("proof_c"));
// let s = codec::scalar_decode::<S>(&map.item_bytes("proof_s"));
// Self { base, c, s }
let pedersen = pedersen::testing::TestVector::from_map(map);
let ring_bytes = map.item_bytes("ring-proof");
let ring_proof = RingProof::<S>::deserialize_compressed(&ring_bytes[..]).unwrap();
Self {
pedersen,
ring: ring_proof,
}
}

fn to_map(&self) -> common::TestVectorMap {
Expand Down
16 changes: 8 additions & 8 deletions src/suites/bandersnatch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -311,10 +311,10 @@ mod test_vectors_ring_ed {
testing::test_vectors_generate::<V>(TEST_VECTORS_FILE, "Bandersnatch_SHA-512_ELL2");
}

// #[test]
// fn process() {
// testing::test_vectors_process::<V>(TEST_VECTORS_FILE);
// }
#[test]
fn process() {
testing::test_vectors_process::<V>(TEST_VECTORS_FILE);
}
}

#[cfg(test)]
Expand Down Expand Up @@ -383,8 +383,8 @@ mod test_vectors_ring_sw {
testing::test_vectors_generate::<V>(TEST_VECTORS_FILE, "Bandersnatch_SW_SHA-512_TAI");
}

// #[test]
// fn process() {
// testing::test_vectors_process::<V>(TEST_VECTORS_FILE);
// }
#[test]
fn process() {
testing::test_vectors_process::<V>(TEST_VECTORS_FILE);
}
}

0 comments on commit 8490f0e

Please sign in to comment.