Skip to content

Commit

Permalink
[dynamic fields] Improve hashing generation (MystenLabs#7937)
Browse files Browse the repository at this point in the history
- Improved ID generation by hashing

Thanks for the fix @embe221ed and @otter-sec !
  • Loading branch information
tnowacki authored Feb 2, 2023
1 parent 816028a commit 7514161
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/sui-framework/src/natives/dynamic_field.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ pub fn hash_type_and_key(
// hash(parent || k || K)
let mut hasher = Sha3_256::default();
hasher.update(parent);
hasher.update(k_bytes.len().to_le_bytes());
hasher.update(k_bytes);
hasher.update(k_tag_bytes);
let hash = hasher.finalize();
Expand Down

0 comments on commit 7514161

Please sign in to comment.