Skip to content

Commit

Permalink
Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
Browse files Browse the repository at this point in the history
  • Loading branch information
Pankaj authored and arc-vmware committed Jun 13, 2022
1 parent 7de3f2b commit 770e674
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bftengine/src/bftengine/ReplicaImp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,8 +1340,12 @@ void ReplicaImp::sendPartialProof(SeqNumInfo &seqNumInfo) {
else
commitSigner = CryptoManager::instance().thresholdSignerForOptimisticCommit(seqNum);

<<<<<<< HEAD
Digest tmpDigest;
Digest digestHelper;
=======
Digest tmpDigest, digestHelper;
>>>>>>> Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
digestHelper.calcCombination(ppDigest, getCurrentView(), seqNum, tmpDigest);

const auto &span_context = pp->spanContext<std::remove_pointer<decltype(pp)>::type>();
Expand Down Expand Up @@ -4118,8 +4122,12 @@ ReplicaImp::ReplicaImp(const LoadedReplicaData &ld,
else
commitSigner = CryptoManager::instance().thresholdSignerForOptimisticCommit(seqNum);

<<<<<<< HEAD
Digest tmpDigest;
Digest digestHelper;
=======
Digest tmpDigest, digestHelper;
>>>>>>> Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
digestHelper.calcCombination(ppDigest, getCurrentView(), seqNum, tmpDigest);

PartialCommitProofMsg *p = new PartialCommitProofMsg(
Expand Down
3 changes: 3 additions & 0 deletions util/include/evp_hash.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ class EVPHash {
};

EVPHash& operator=(EVPHash&& other) noexcept {
if (nullptr != ctx_) { // Prevent memory leak.
EVP_MD_CTX_destroy(ctx_);
}
*this = EVPHash{std::move(other)};
return *this;
}
Expand Down

0 comments on commit 770e674

Please sign in to comment.