Skip to content
Open
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
19 changes: 16 additions & 3 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,16 @@
use core::fmt;
use core::iter;
use std::fmt::Display;
use std::io::Write;

use ff::Field;
use ff::PrimeField;
use nonempty::NonEmpty;
use pasta_curves::pallas;
use pasta_curves::Fq;
use rand::{prelude::SliceRandom, CryptoRng, RngCore};
use std::io;
use std::process;

use crate::{
action::Action,
Expand Down Expand Up @@ -863,9 +868,17 @@ impl<P: fmt::Debug, V> Bundle<InProgress<P, PartiallyAuthorized>, V> {
&mut rng,
|rng, partial, maybe| match maybe {
MaybeSigned::SigningMetadata(parts) if parts.ak == expected_ak => {
MaybeSigned::Signature(
ask.randomize(&parts.alpha).sign(rng, &partial.sigs.sighash),
)
println!("alpha is: {:?}", &parts.alpha);
println!("msg hash is: {}", hex::encode(&partial.sigs.sighash));
// let signature = ask.randomize(&parts.alpha).sign(rng, &partial.sigs.sighash);
let mut input = String::new();
println!("read signature:");
io::stdin().read_line(&mut input).ok().expect("failed to read signature");
println!("read: {}", input.trim());
let bytes :[u8; 64] = hex::decode(input.trim()).unwrap().try_into().unwrap();
let sig: redpallas::Signature<SpendAuth> = redpallas::Signature::from(bytes);
// println!("{:?}", sig);
MaybeSigned::Signature(sig)
}
s => s,
},
Expand Down
1 change: 1 addition & 0 deletions src/bundle/commitments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ pub(crate) fn hash_bundle_txid_data<A: Authorization, V: Copy + Into<i64>>(
let mut nh = hasher(ZCASH_ORCHARD_ACTIONS_NONCOMPACT_HASH_PERSONALIZATION);

for action in bundle.actions().iter() {
// println!("{:?}", &action);
ch.update(&action.nullifier().to_bytes());
ch.update(&action.cmx().to_bytes());
ch.update(&action.encrypted_note().epk_bytes);
Expand Down