Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alex v committed Nov 25, 2024
1 parent 644476f commit 9b278d1
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -1311,6 +1311,8 @@ libnaviokernel_la_SOURCES = \
blsct/set_mem_proof/set_mem_proof_prover.cpp \
blsct/set_mem_proof/set_mem_proof_setup.cpp \
blsct/signature.cpp \
blsct/tokens/predicate_exec.cpp \
blsct/tokens/predicate_parser.cpp \
blsct/wallet/txfactory_global.cpp \
blsct/wallet/verification.cpp \
chain.cpp \
Expand Down
8 changes: 4 additions & 4 deletions src/blsct/eip_2333/bls12_381_keygen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -189,10 +189,10 @@ MclScalar BLS12_381_KeyGen::derive_child_SK_hash(const MclScalar& parent_SK, con
auto ret = parent_SK;
for (auto i = 0; i < 8; i++) {
const uint8_t* pos = hash.begin() + i * 4;
uint32_t index = (uint8_t)(pos[0]) << 24 |
(uint8_t)(pos[1]) << 16 |
(uint8_t)(pos[2]) << 8 |
(uint8_t)(pos[3]);
uint32_t index = (static_cast<uint32_t>(pos[0]) << 24) |
(static_cast<uint32_t>(pos[1]) << 16) |
(static_cast<uint32_t>(pos[2]) << 8) |
(static_cast<uint32_t>(pos[3]));

auto comp_PK = parent_SK_to_lamport_PK(ret, index);
ret = HKDF_mod_r(std::vector<uint8_t>(comp_PK.cbegin(), comp_PK.cend()));
Expand Down
2 changes: 1 addition & 1 deletion src/blsct/tokens/predicate_exec.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ bool ExecutePredicate(const ParsedPredicate& predicate, CCoinsViewCache& view, c
if (fDisconnect)
view.EraseToken(hash);
else {
auto info = predicate.GetTokenInfo();
blsct::TokenInfo info = predicate.GetTokenInfo();
view.AddToken(hash, std::move(info));
}

Expand Down
10 changes: 10 additions & 0 deletions src/test/fuzz/rpc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,16 @@ const std::vector<std::string> RPC_COMMANDS_SAFE_FOR_FUZZING{
"waitforblock",
"waitforblockheight",
"waitfornewblock",
"gettoken",
"listtokens",
"createtoken",
"createnft",
"sendtokentoblsctaddress",
"sendnfttoblsctaddress",
"minttoken",
"mintnft",
"gettokenbalance",
"getnftbalance"
};

std::string ConsumeScalarRPCArgument(FuzzedDataProvider& fuzzed_data_provider, bool& good_data)
Expand Down

0 comments on commit 9b278d1

Please sign in to comment.