Skip to content

Commit

Permalink
feat: add domain separators to msg encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
grumbach authored and davidrusu committed Feb 2, 2023
1 parent 6959b0d commit 34348f3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/transaction/output.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,15 +235,19 @@ fn gen_message_for_signing(
) -> Vec<u8> {
// Generate message to sign.
let mut msg: Vec<u8> = Default::default();
msg.extend("public_keys".as_bytes());
for pk in public_keys.iter() {
msg.extend(pk.to_bytes().as_ref());
}
msg.extend("commitments".as_bytes());
for r in input_commitments.iter() {
msg.extend(r.to_bytes().as_ref());
}
msg.extend("output_proofs".as_bytes());
for o in output_proofs.iter() {
msg.extend(o.to_bytes());
}
msg.extend("end".as_bytes());
msg
}

Expand Down

0 comments on commit 34348f3

Please sign in to comment.