Add test for librustzcash_sapling_compute_nf.

Rename test: commitments -> notes.
This commit is contained in:
Simon 2018-06-08 14:04:02 -07:00
parent 8ec096bdeb
commit 11552c1579
2 changed files with 16 additions and 2 deletions

View File

@ -2,7 +2,7 @@ use sapling_crypto::jubjub::{FixedGenerators, JubjubParams};
use super::JUBJUB;
mod commitments;
mod notes;
mod key_components;
mod signatures;

View File

@ -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);
}
}