,
/// A commitment to the net value created or consumed by this action.
cv_net: ValueCommitment,
/// The authorization for this action.
authorization: A,
}
-impl Action {
+impl Action {
/// Constructs an `Action` from its constituent parts.
pub fn from_parts(
nf: Nullifier,
rk: redpallas::VerificationKey ,
cv_net: ValueCommitment,
authorization: A,
) -> Self {
@@ -63,7 +63,7 @@ impl Action {
}
/// Returns the encrypted note ciphertext.
- pub fn encrypted_note(&self) -> &TransmittedNoteCiphertext {
&self.encrypted_note
}
@@ -83,7 +83,7 @@ impl Action {
}
/// Transitions this action from one authorization state to another.
- pub fn map(self, step: impl FnOnce(A) -> U) -> Action {
+ pub fn map(self, step: impl FnOnce(A) -> U) -> Action {
Action {
nf: self.nf,
rk: self.rk,
@@ -95,7 +95,7 @@ impl Action {
}
/// Transitions this action from one authorization state to another.
- pub fn try_map(self, step: impl FnOnce(A) -> Result) -> Result ,
}
- impl {
fn encrypt_note {
let encryptor =
- NoteEncryption:: ) {
let rho = Rho::from_nf_old(nf_old);
let note = Note::new(self.recipient, self.value, self.asset, rho, &mut rng);
let cm_new = note.commitment();
let cmx = cm_new.into();
- let encryptor = NoteEncryption:: (cv_net, nf_old, rng);
crate::pczt::Output {
cmx,
@@ -532,7 +532,7 @@ impl ActionInfo {
)
}
- fn build_for_pczt (&cv_net, spend.nullifier, &mut rng);
crate::pczt::Action {
cv_net,
@@ -648,7 +648,7 @@ impl Builder {
/// Returns an error if the given Merkle path does not have the required anchor for
/// the given note.
///
- /// [`OrchardDomain`]: crate::domain::OrchardDomain
+ /// [`OrchardDomain`]: crate::primitives::OrchardDomain
/// [`MerkleHashOrchard`]: crate::tree::MerkleHashOrchard
pub fn add_spend(
&mut self,
@@ -774,7 +774,7 @@ impl Builder {
/// Builds a bundle containing the given spent notes and outputs along with their
/// metadata, for inclusion in a PCZT.
- pub fn build_for_pczt (&mut rng))
.collect:: ,
}
impl ,
}
- impl {
/// Generate an unauthorized action having spend and output values less than MAX_NOTE_VALUE / n_actions.
pub fn arb_unauthorized_action_n(
n_actions: usize,
flags: Flags,
- ) -> impl Strategy {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("TransmittedNoteCiphertext")
.field("epk_bytes", &self.epk_bytes)
diff --git a/src/orchard_flavor.rs b/src/orchard_flavor.rs
index f0459abf0..0cc898690 100644
--- a/src/orchard_flavor.rs
+++ b/src/orchard_flavor.rs
@@ -1,7 +1,7 @@
//! Defines types and traits for the variations ("flavors") of the Orchard protocol (Vanilla and ZSA).
#[cfg(feature = "circuit")]
-use crate::{circuit::OrchardCircuit, domain::OrchardDomainCommon};
+use crate::{circuit::OrchardCircuit, primitives::OrchardPrimitives};
/// Represents the "Vanilla" variation ("flavor") of the Orchard protocol.
#[derive(Debug, Clone, Default, PartialEq, Eq)]
@@ -13,7 +13,7 @@ pub struct OrchardZSA;
/// A trait binding the common functionality between different Orchard protocol flavors.
#[cfg(feature = "circuit")]
-pub trait OrchardFlavor: OrchardDomainCommon + OrchardCircuit {}
+pub trait OrchardFlavor: OrchardPrimitives + OrchardCircuit {}
#[cfg(feature = "circuit")]
impl OrchardFlavor for OrchardVanilla {}
diff --git a/src/pczt.rs b/src/pczt.rs
index 20d654925..ed635bb80 100644
--- a/src/pczt.rs
+++ b/src/pczt.rs
@@ -12,12 +12,12 @@ use zip32::ChildIndex;
use crate::{
bundle::Flags,
- domain::OrchardDomainCommon,
keys::{FullViewingKey, SpendingKey},
note::{
AssetBase, ExtractedNoteCommitment, Nullifier, RandomSeed, Rho, TransmittedNoteCiphertext,
},
primitives::redpallas::{self, Binding, SpendAuth},
+ primitives::OrchardPrimitives,
tree::MerklePath,
value::{NoteValue, ValueCommitTrapdoor, ValueCommitment, ValueSum},
Address, Anchor, Proof,
@@ -376,8 +376,8 @@ pub struct PcztTransmittedNoteCiphertext {
pub out_ciphertext: [u8; 80],
}
-impl ) -> Self {
PcztTransmittedNoteCiphertext {
epk_bytes: transmitted.epk_bytes,
enc_ciphertext: transmitted.enc_ciphertext.as_ref().to_vec(),
@@ -386,11 +386,11 @@ impl {
fn from(ciphertext: PcztTransmittedNoteCiphertext) -> Self {
TransmittedNoteCiphertext {
epk_bytes: ciphertext.epk_bytes,
- enc_ciphertext: D::NoteCiphertextBytes::from_slice(&ciphertext.enc_ciphertext)
+ enc_ciphertext: P::NoteCiphertextBytes::from_slice(&ciphertext.enc_ciphertext)
.expect("Failed to parse enc_ciphertext: data may be corrupt or incorrect size"),
out_ciphertext: ciphertext.out_ciphertext,
}
diff --git a/src/pczt/prover.rs b/src/pczt/prover.rs
index a11f7b035..0977acc5c 100644
--- a/src/pczt/prover.rs
+++ b/src/pczt/prover.rs
@@ -5,15 +5,14 @@ use rand::{CryptoRng, RngCore};
use crate::{
builder::SpendInfo,
- circuit::{Circuit, Instance, ProvingKey, Witnesses},
+ circuit::{Circuit, Instance, OrchardCircuit, ProvingKey, Witnesses},
note::Rho,
- orchard_flavor::OrchardFlavor,
Note, Proof,
};
impl super::Bundle {
/// Adds a proof to this PCZT bundle.
- pub fn create_proof