Skip to content

Commit

Permalink
Remove enc, R and nonce from note hash (#124)
Browse files Browse the repository at this point in the history
  • Loading branch information
xevisalle authored Feb 2, 2023
1 parent 804eed2 commit 04c423a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Changed

- Remove `enc`, `R` and `nonce` from note hash [#123]

## [0.18.1] - 2023-01-20

## Added
Expand Down
10 changes: 1 addition & 9 deletions src/note.rs
Original file line number Diff line number Diff line change
Expand Up @@ -244,25 +244,17 @@ impl Note {
}

/// Return the internal representation of scalars to be hashed
pub fn hash_inputs(&self) -> [BlsScalar; 12] {
pub fn hash_inputs(&self) -> [BlsScalar; 6] {
let value_commitment = self.value_commitment().to_hash_inputs();
let pk_r = self.stealth_address().pk_r().as_ref().to_hash_inputs();
let R = self.stealth_address().R().to_hash_inputs();
let cipher = self.encrypted_data.cipher();

[
BlsScalar::from(self.note_type as u64),
value_commitment[0],
value_commitment[1],
self.nonce,
pk_r[0],
pk_r[1],
R[0],
R[1],
BlsScalar::from(self.pos),
cipher[0],
cipher[1],
cipher[2],
]
}

Expand Down

0 comments on commit 04c423a

Please sign in to comment.