Skip to content

Commit

Permalink
adds hash domain to merkle shreds
Browse files Browse the repository at this point in the history
  • Loading branch information
behzadnouri committed Jan 8, 2023
1 parent 8c212f5 commit 46048c3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions ledger/src/shred/merkle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ const_assert_eq!(ShredData::SIZE_OF_PAYLOAD, 1203);

// Defense against second preimage attack:
// https://en.wikipedia.org/wiki/Merkle_tree#Second_preimage_attack
const MERKLE_HASH_PREFIX_LEAF: &[u8] = &[0x00];
const MERKLE_HASH_PREFIX_NODE: &[u8] = &[0x01];
const MERKLE_HASH_PREFIX_LEAF: &[u8] = b"\x00SOLANA_MERKLE_SHREDS_LEAF";
const MERKLE_HASH_PREFIX_NODE: &[u8] = b"\x01SOLANA_MERKLE_SHREDS_NODE";

pub(crate) type MerkleRoot = MerkleProofEntry;
type MerkleProofEntry = [u8; 20];
Expand Down

0 comments on commit 46048c3

Please sign in to comment.