diff --git a/src/tests/mod.rs b/src/tests/mod.rs index 420f23fc6..ad5ca41fd 100644 --- a/src/tests/mod.rs +++ b/src/tests/mod.rs @@ -2,7 +2,7 @@ use sapling_crypto::jubjub::{FixedGenerators, JubjubParams}; use super::JUBJUB; -mod commitments; +mod notes; mod key_components; mod signatures; diff --git a/src/tests/commitments.rs b/src/tests/notes.rs similarity index 98% rename from src/tests/commitments.rs rename to src/tests/notes.rs index e7116c476..c9fde9a28 100644 --- a/src/tests/commitments.rs +++ b/src/tests/notes.rs @@ -1,7 +1,8 @@ use librustzcash_sapling_compute_cm; +use librustzcash_sapling_compute_nf; #[test] -fn commitments() { +fn notes() { #![allow(dead_code)] struct TestVector { sk: [u8; 32], @@ -655,5 +656,18 @@ fn commitments() { &mut result )); assert_eq!(&result, &tv.note_cm); + + // Compute nullifier and compare with test vector + assert!(librustzcash_sapling_compute_nf( + &tv.default_d, + &tv.default_pk_d, + tv.note_v, + &tv.note_r, + &tv.ak, + &tv.nk, + tv.note_pos, + &mut result + )); + assert_eq!(&result, &tv.note_nf); } }