Skip to content

Commit

Permalink
Add DSTs to Tributary TX sig_hash functions
Browse files Browse the repository at this point in the history
Prevents conflicts with other systems/other parts of the Tributary.
  • Loading branch information
kayabaNerve committed Aug 21, 2023
1 parent 0087605 commit 64bdc50
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
8 changes: 7 additions & 1 deletion coordinator/tributary/src/tendermint/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,13 @@ impl Transaction for TendermintTx {
let signature = &vote.sig.signature;
<Ristretto as Ciphersuite>::F::from_bytes_mod_order_wide(
&Blake2b512::digest(
[genesis.as_ref(), &self.hash(), signature.R.to_bytes().as_ref()].concat(),
[
b"Tributary Slash Vote",
genesis.as_ref(),
&self.hash(),
signature.R.to_bytes().as_ref(),
]
.concat(),
)
.into(),
)
Expand Down
8 changes: 7 additions & 1 deletion coordinator/tributary/src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,13 @@ pub trait Transaction: 'static + Send + Sync + Clone + Eq + Debug + ReadWrite {
TransactionKind::Signed(Signed { signature, .. }) => {
<Ristretto as Ciphersuite>::F::from_bytes_mod_order_wide(
&Blake2b512::digest(
[genesis.as_ref(), &self.hash(), signature.R.to_bytes().as_ref()].concat(),
[
b"Tributary Signed Transaction",
genesis.as_ref(),
&self.hash(),
signature.R.to_bytes().as_ref(),
]
.concat(),
)
.into(),
)
Expand Down

0 comments on commit 64bdc50

Please sign in to comment.