Move pedersen hash test vectors into Sapling

This commit is contained in:
Kris Nuttycombe 2021-03-04 14:33:52 -07:00 committed by Jack Grigg
parent bc087a5ff7
commit abbf5dfd83
3 changed files with 5 additions and 4 deletions

View File

@ -1,5 +1,8 @@
//! Implementation of the Pedersen hash function used in Sapling.
#[cfg(test)]
pub(crate) mod test_vectors;
use byteorder::{ByteOrder, LittleEndian};
use ff::PrimeField;
use group::Group;
@ -124,7 +127,6 @@ pub mod test {
use group::Curve;
use super::*;
use crate::test_vectors::pedersen_hash_vectors;
pub struct TestVector<'a> {
pub personalization: Personalization,
@ -135,7 +137,7 @@ pub mod test {
#[test]
fn test_pedersen_hash_points() {
let test_vectors = pedersen_hash_vectors::get_vectors();
let test_vectors = test_vectors::get_vectors();
assert!(!test_vectors.is_empty());

View File

@ -1,6 +1,6 @@
//! Test vectors from https://github.com/zcash-hackworks/zcash-test-vectors/blob/master/sapling_pedersen.py
use crate::sapling::pedersen_hash::{test::TestVector, Personalization};
use super::{test::TestVector, Personalization};
pub fn get_vectors<'a>() -> Vec<TestVector<'a>> {
return vec![

View File

@ -1,2 +1 @@
pub(crate) mod note_encryption;
pub(crate) mod pedersen_hash_vectors;