Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sign/verify implementations using OpenSSL library. #6

Open
wants to merge 59 commits into
base: crypto-decoupling-openssl-lib
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
daeb170
Decoupling crypto digest to choose crypto algos
Apr 1, 2022
e65b8c0
Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
Apr 12, 2022
4352535
Commit contains changes:-
Apr 12, 2022
4a9a5f3
Review comments addressed.
Apr 13, 2022
29d1c46
UT cases added for Crypto++ and OpenSSL libraries SHA hashing.
Apr 13, 2022
b01edef
Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
Apr 12, 2022
eeb5087
Commit contains changes:-
Apr 12, 2022
99ce505
Review comments addressed.
Apr 13, 2022
bd4288f
Add log messages to apollo
WildFireFlum May 24, 2022
afbff56
Add initial eddsa multisig signer implementation
WildFireFlum May 24, 2022
162dbb9
Make Apollo's BFTConfig support more valid configurations
WildFireFlum May 24, 2022
d8b0223
Add EdDSA logger and thread local sequences to log messages
WildFireFlum May 25, 2022
6d1d2ef
Update license preface of newly added files
WildFireFlum May 25, 2022
8d8f22e
Make relic linkage configurable
WildFireFlum May 30, 2022
2608a8a
Implement generic threshsign benchmark
WildFireFlum Jun 8, 2022
05d2e0f
Make IThresholdFactory interface return smart pointer
WildFireFlum Jun 12, 2022
8a30715
Prepare code for integration with new signer/verifier interface
WildFireFlum Jun 13, 2022
65b5263
Add eddsa key validation
WildFireFlum Jun 14, 2022
e35072a
Pass clang-tidy
WildFireFlum Jun 15, 2022
c9b15a3
Implement eddsa multisig share verification, extract a constant in Ap…
WildFireFlum Jun 22, 2022
babd5b4
Fixed compilation issue.
Jul 5, 2022
9663826
Merge pull request #10 from pkthapa/eddsa-multi-sig-2
arc-vmware Jul 5, 2022
d20c657
Vmwathena compilation fixed.
Jul 5, 2022
5f8a3d4
Merge pull request #11 from pkthapa/compilation-macro-for-digest
pkthapa Jul 7, 2022
4c61da9
Decoupling crypto digest to choose crypto algos
Apr 1, 2022
af2ea71
Committing changes which were not reflected in PR: https://github.com…
Jun 13, 2022
922c79f
Decoupling crypto digest to choose crypto algos
Apr 1, 2022
b7b6fbb
Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
Apr 12, 2022
6acb4ff
Commit contains changes:-
Apr 12, 2022
1b7415d
Review comments addressed.
Apr 13, 2022
5aa4312
Digest generation using OpenSSL library (SHA2_256 & SHA3_256 algos).
Apr 12, 2022
28c9076
Changes in DigestCreator:-
Apr 12, 2022
7f45a97
Separate ISigner and IVerifier interfaces.
Apr 25, 2022
9513594
Changes in Gtest and Apollo test cases:
May 11, 2022
e48cf16
Crypto++ and OpenSSL macros added in CMakeLists.txt
Jun 13, 2022
58ed80d
Implemented benchmarking:-
Jun 14, 2022
091ca2d
Commit has:-
Jun 16, 2022
aaeb654
Vmwathena compilation issue.
Jun 17, 2022
3159c1f
Some changes w.r.t. eddsa signing function.
Jun 17, 2022
60740ae
Update docker image version to 0.45
Jul 4, 2022
23efa57
Addressed review comments.
Jul 5, 2022
49d0f0e
Integration: Single sign/verify with multi/thresh-sign/verify.
Jun 28, 2022
79370f4
Review comments addressed.
Jul 1, 2022
7dce151
Commit includes:
Jul 5, 2022
523de2a
Clang-tidy issue resolved.
Jul 6, 2022
ddf6564
Review comments addressed.
Jul 7, 2022
710423a
Review comments addressed.
Jul 11, 2022
4b8978e
Review comments - 2
Jul 12, 2022
c123a73
Linking error due to boost::algorithm::unhex().
Jul 13, 2022
87f4edd
Review comments addressed - 3
Jul 14, 2022
f1d3f61
Clang tidy-check error resolved.
Jul 14, 2022
15e4022
Prevent writing EOF character to pem file.
Jul 14, 2022
d9fff85
Review comments addressed - 4
Jul 17, 2022
f2927e9
Reconfig CI issue addressed.
Jul 19, 2022
a20433b
Review comments addressed - 5
Jul 20, 2022
974147e
Review comments addressed - 6
Jul 21, 2022
b2ea5fe
Factory class implementation. Not the final version and will be changed.
Jul 22, 2022
3d9a254
WIP: Config flag for signing/verification algorithm.
Jul 25, 2022
9cd5ab7
This commit contains:-
Jul 27, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions bftengine/src/bftengine/RequestHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,37 @@ using namespace concord::performance;

namespace bftEngine {

RequestHandler::RequestHandler(concord::performance::ISystemResourceEntity& resourceEntity,
std::shared_ptr<concordMetrics::Aggregator> aggregator_)
: reconfig_dispatcher_{}, resourceEntity_(resourceEntity) {
reconfig_handler_.push_back(std::make_shared<concord::reconfiguration::ReconfigurationHandler>());
for (const auto& rh : reconfig_handler_) {
reconfig_dispatcher_.addReconfigurationHandler(rh);
}
reconfig_dispatcher_.addReconfigurationHandler(
std::make_shared<concord::reconfiguration::ClientReconfigurationHandler>());
reconfig_dispatcher_.setAggregator(aggregator_);
}

void RequestHandler::setUserRequestHandler(std::shared_ptr<IRequestsHandler> userHdlr) {
if (userHdlr) {
userRequestsHandler_ = userHdlr;
for (const auto& rh : userHdlr->getReconfigurationHandler()) {
reconfig_dispatcher_.addReconfigurationHandler(rh);
}
}
}

void RequestHandler::setReconfigurationHandler(std::shared_ptr<concord::reconfiguration::IReconfigurationHandler> rh,
concord::reconfiguration::ReconfigurationHandlerType type) {
IRequestsHandler::setReconfigurationHandler(rh, type);
reconfig_dispatcher_.addReconfigurationHandler(rh, type);
}

void RequestHandler::setCronTableRegistry(const std::shared_ptr<concord::cron::CronTableRegistry>& reg) {
cron_table_registry_ = reg;
}

void RequestHandler::execute(IRequestsHandler::ExecutionRequestsQueue& requests,
std::optional<Timestamp> timestamp,
const std::string& batchCid,
Expand Down
29 changes: 4 additions & 25 deletions bftengine/src/bftengine/RequestHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,7 @@ class RequestHandler : public IRequestsHandler {
public:
RequestHandler(
concord::performance::ISystemResourceEntity &resourceEntity,
std::shared_ptr<concordMetrics::Aggregator> aggregator_ = std::make_shared<concordMetrics::Aggregator>())
: resourceEntity_(resourceEntity) {
using namespace concord::reconfiguration;
reconfig_handler_.push_back(std::make_shared<ReconfigurationHandler>());
for (const auto &rh : reconfig_handler_) {
reconfig_dispatcher_.addReconfigurationHandler(rh);
}
reconfig_dispatcher_.addReconfigurationHandler(std::make_shared<ClientReconfigurationHandler>());
reconfig_dispatcher_.setAggregator(aggregator_);
}
std::shared_ptr<concordMetrics::Aggregator> aggregator_ = std::make_shared<concordMetrics::Aggregator>());

void execute(ExecutionRequestsQueue &requests,
std::optional<Timestamp> timestamp,
Expand All @@ -47,25 +38,13 @@ class RequestHandler : public IRequestsHandler {
const std::string &batchCid,
concordUtils::SpanWrapper &parent_span) override;

void setUserRequestHandler(std::shared_ptr<IRequestsHandler> userHdlr) {
if (userHdlr) {
userRequestsHandler_ = userHdlr;
for (const auto &rh : userHdlr->getReconfigurationHandler()) {
reconfig_dispatcher_.addReconfigurationHandler(rh);
}
}
}
void setUserRequestHandler(std::shared_ptr<IRequestsHandler> userHdlr);

void setReconfigurationHandler(std::shared_ptr<concord::reconfiguration::IReconfigurationHandler> rh,
concord::reconfiguration::ReconfigurationHandlerType type =
concord::reconfiguration::ReconfigurationHandlerType::REGULAR) override {
IRequestsHandler::setReconfigurationHandler(rh, type);
reconfig_dispatcher_.addReconfigurationHandler(rh, type);
}
concord::reconfiguration::ReconfigurationHandlerType::REGULAR) override;

void setCronTableRegistry(const std::shared_ptr<concord::cron::CronTableRegistry> &reg) {
cron_table_registry_ = reg;
}
void setCronTableRegistry(const std::shared_ptr<concord::cron::CronTableRegistry> &reg);
void setPersistentStorage(const std::shared_ptr<bftEngine::impl::PersistentStorage> &persistent_storage) override;
void onFinishExecutingReadWriteRequests() override { userRequestsHandler_->onFinishExecutingReadWriteRequests(); }
std::shared_ptr<IRequestsHandler> getUserHandler() { return userRequestsHandler_; }
Expand Down
2 changes: 1 addition & 1 deletion kvbc/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ target_link_libraries(kvbc_filter_test
${yaml-cpp_LIBRARIES}
kvbc
concord-kvbc-proto
concordbft_reconfiguration
corebft
logging)

add_executable(order_test order_test.cpp )
Expand Down
2 changes: 1 addition & 1 deletion util/include/crypto/eddsa/EdDSA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ static ByteArrayKeyClass getByteArrayKeyClass(const std::string& key, concord::u
if (KeyFormat::PemFormat == format) {
std::memcpy(resultBytes.data(), extractHexKeyFromPem<ByteArrayKeyClass>(key, keyLength).data(), keyLength);
} else if (KeyFormat::HexaDecimalStrippedFormat == format) {
std::memcpy(resultBytes.data(), concordUtils::unhex(key).data(), keyLength);
std::memcpy(resultBytes.data(), boost::algorithm::unhex(key).data(), keyLength);
pkthapa marked this conversation as resolved.
Show resolved Hide resolved
}
return ByteArrayKeyClass{resultBytes};
}