Skip to content

Commit

Permalink
Merge pull request nav-io#142 from gogoex/avoid-caching-salt
Browse files Browse the repository at this point in the history
Avoid caching salt_str to a local static variable
  • Loading branch information
aguycalled authored Feb 14, 2024
2 parents eddf587 + 3672f84 commit 7301604
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/blsct/building_block/generator_deriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ Point GeneratorDeriver<Point>::Derive(
const size_t index,
const std::optional<TokenId>& token_id
) const {
static const std::string salt(salt_str);
std::vector<uint8_t> serialized_p = p.GetVch();

auto num_to_str = [](auto n) {
Expand All @@ -20,7 +19,7 @@ Point GeneratorDeriver<Point>::Derive(
};
std::string hash_preimage =
HexStr(serialized_p) +
salt +
salt_str +
num_to_str(index) +
(token_id.has_value() ? token_id.value().ToString() : "") +
(token_id.has_value() ? "nft" + num_to_str(token_id.value().subid) : "");
Expand Down

0 comments on commit 7301604

Please sign in to comment.