Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@ codegen-units = 1
[patch.crates-io]
zcash_note_encryption = { version = "0.4", git = "https://github.com/QED-it/zcash_note_encryption", branch = "zsa1" }
sapling = { package = "sapling-crypto", version = "0.1.3", git = "https://github.com/QED-it/sapling-crypto", branch = "zsa1" }
orchard = { version = "0.8.0", git = "https://github.com/QED-it/orchard", rev = "e88e2614bdc56119d5e0c9cb5f30fb4cc5c92dc7" }
orchard = { version = "0.8.0", git = "https://github.com/QED-it/orchard", rev = "190a50c31c1db7d329905bef04326445c2d87801" }
16 changes: 8 additions & 8 deletions zcash_primitives/src/transaction/components/orchard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,15 @@ pub fn read_orchard_zsa_bundle<R: Read>(
}
let flags = read_flags(&mut reader)?;
let anchor = read_anchor(&mut reader)?;
let proof_bytes = Vector::read(&mut reader, |r| r.read_u8())?;
let timelimit = reader.read_u32::<LittleEndian>()?;
if timelimit != 0 {
return Err(io::Error::new(
io::ErrorKind::InvalidInput,
"Timelimit field must be set to zero".to_owned(),
));
}
let burn = read_burn(&mut reader)?;
let proof_bytes = Vector::read(&mut reader, |r| r.read_u8())?;
let actions = NonEmpty::from_vec(
actions_without_auth
.into_iter()
Expand All @@ -134,8 +135,6 @@ pub fn read_orchard_zsa_bundle<R: Read>(

let value_balance = Transaction::read_amount(&mut reader)?;

let burn = read_burn(&mut reader)?;

let binding_signature = read_signature::<_, redpallas::Binding>(&mut reader)?;

let authorization = Authorized::from_parts(orchard::Proof::new(proof_bytes), binding_signature);
Expand Down Expand Up @@ -358,15 +357,18 @@ pub fn write_orchard_zsa_bundle<W: Write>(

writer.write_all(&[bundle.flags().to_byte()])?;
writer.write_all(&bundle.anchor().to_bytes())?;

// Timelimit must be zero for NU7
writer.write_u32::<LittleEndian>(0)?;

write_burn(&mut writer, bundle.burn())?;

Vector::write(
&mut writer,
bundle.authorization().proof().as_ref(),
|w, b| w.write_u8(*b),
)?;

// Timelimit must be zero for NU7
writer.write_u32::<LittleEndian>(0)?;

Array::write(
&mut writer,
bundle.actions().iter().map(|a| a.authorization()),
Expand All @@ -375,8 +377,6 @@ pub fn write_orchard_zsa_bundle<W: Write>(

writer.write_all(&bundle.value_balance().to_i64_le_bytes())?;

write_burn(&mut writer, bundle.burn())?;

writer.write_all(&<[u8; 64]>::from(
bundle.authorization().binding_signature(),
))?;
Expand Down
Loading