Add multiple types to lay out NotePlaintext's for sprout and sapling

This commit is contained in:
Deirdre Connolly 2020-02-21 19:35:24 -05:00 committed by Deirdre Connolly
parent 1a10975389
commit 8aefadd00f
3 changed files with 32 additions and 0 deletions

View File

@ -2,3 +2,9 @@
mod memo;
mod sapling;
mod sprout;
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct Diversifier(pub [u8; 11]);
#[derive(Copy, Clone, Debug, PartialEq)]
pub struct NoteCommitmentRandomness(pub [u8; 32]);

View File

@ -5,6 +5,21 @@ use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*};
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};
use super::{Diversifier, Memo, NoteCommitmentRandomness};
pub struct Note {
value: u64,
diversifier: Diversifier,
}
pub struct NotePlaintext {
diversifier: Diversifier,
value: u64,
// TODO: refine as jub-jub appropriate in the base field.
note_committment_randomness: NoteCommitmentRandomness,
memo: Memo,
}
/// A ciphertext component for encrypted output notes.
pub struct EncryptedCiphertext(pub [u8; 580]);

View File

@ -8,6 +8,17 @@ use proptest::{collection::vec, prelude::*};
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};
pub struct Note {}
pub struct NotePlaintext {
value: u64,
// TODO: refine type
rho: [u8; 32],
// TODO: refine as jub-jub appropriate in the base field.
note_committment_randomness: NoteCommitmentRandomness,
memo: Memo,
}
/// A ciphertext component for encrypted output notes.
pub struct EncryptedCiphertext(pub [u8; 601]);