diff --git a/core/CHANGELOG.md b/core/CHANGELOG.md index f9b6263..fb89fc1 100644 --- a/core/CHANGELOG.md +++ b/core/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Restructure `Encryption` module. - Move phoenix-core into a phoenix workspace [#171] - Rename `note` method to `note_type`. +- Update `dusk-poseidon` to v0.39 [#179] +- Update `jubjub-schnorr` to v0.4 [#179] ### Removed @@ -307,6 +309,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Canonical implementation shielded by feature. +[#179]: https://github.com/dusk-network/phoenix/issues/179 [#175]: https://github.com/dusk-network/phoenix/issues/175 [#171]: https://github.com/dusk-network/phoenix/issues/171 [#166]: https://github.com/dusk-network/phoenix/issues/166 diff --git a/core/Cargo.toml b/core/Cargo.toml index 4948acb..ff5a825 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -13,8 +13,8 @@ dusk-bytes = "0.1" dusk-bls12_381 = { version = "0.13", default-features = false } bls12_381-bls = { version = "0.3", default-features = false } dusk-jubjub = { version = "0.14", default-features = false, features = ["zeroize"] } -dusk-poseidon = { version = "0.33", default-features = false } -jubjub-schnorr = { version = "0.3", default-features = false } +dusk-poseidon = "0.39" +jubjub-schnorr = "0.4" subtle = { version = "^2.2.1", default-features = false } ff = { version = "0.13", default-features = false } aes-gcm = "0.10" @@ -31,7 +31,6 @@ rkyv = { version = "0.7", default-features = false, features = ["size_32"] } default = [] # "alloc" is suggested as default feature but would be breaking change alloc = [] rkyv-impl = [ - "dusk-poseidon/rkyv-impl", "dusk-jubjub/rkyv-impl", "jubjub-schnorr/rkyv-impl", "dusk-bls12_381/rkyv-impl", diff --git a/core/src/note.rs b/core/src/note.rs index fde0ffa..bd402e0 100644 --- a/core/src/note.rs +++ b/core/src/note.rs @@ -16,7 +16,7 @@ use dusk_jubjub::{ use crate::aes; -use dusk_poseidon::sponge::hash; +use dusk_poseidon::{Domain, Hash}; use ff::Field; use rand_core::{CryptoRng, RngCore}; @@ -238,7 +238,7 @@ impl Note { let pos = BlsScalar::from(self.pos); - hash(&[pk_prime[0], pk_prime[1], pos]) + Hash::digest(Domain::Other, &[pk_prime[0], pk_prime[1], pos])[0] } /// Return the internal representation of scalars to be hashed @@ -260,7 +260,7 @@ impl Note { /// Return a hash represented by `H(note_type, value_commitment, /// H(StealthAddress), pos, encrypted_data) pub fn hash(&self) -> BlsScalar { - hash(&self.hash_inputs()) + Hash::digest(Domain::Other, &self.hash_inputs())[0] } /// Return the type of the note