Skip to content
This repository has been archived by the owner on Feb 17, 2025. It is now read-only.

Commit

Permalink
Absorbing zero to poseidon sponge removed #19
Browse files Browse the repository at this point in the history
  • Loading branch information
ETatuzova committed Jan 19, 2024
1 parent 4f1e002 commit cbf2d52
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/nil/crypto3/container/merkle/tree.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,8 @@ namespace nil {
using field_type = nil::crypto3::algebra::curves::pallas::base_field_type;
using poseidon_policy = nil::crypto3::hashes::detail::mina_poseidon_policy<field_type>;
hashes::detail::poseidon_sponge_construction<poseidon_policy> sponge;
sponge.absorb({0, first, second});
sponge.absorb(first);
sponge.absorb(second);
return sponge.squeeze();
}

Expand All @@ -495,9 +496,7 @@ namespace nil {
typename T::digest_type generate_poseidon_leaf_hash(const LeafData &leaf) {
using field_type = nil::crypto3::algebra::curves::pallas::base_field_type;
using poseidon_policy = nil::crypto3::hashes::detail::mina_poseidon_policy<field_type>;

hashes::detail::poseidon_sponge_construction<poseidon_policy> sponge;
sponge.absorb(0);
std::size_t cur = 1;
for(std::size_t i = 0; i < leaf.size(); i+=64) {
nil::crypto3::multiprecision::cpp_int first = 0;
Expand Down

0 comments on commit cbf2d52

Please sign in to comment.