Skip to content

Commit

Permalink
Add single signature scheme configuration flag (#2980)
Browse files Browse the repository at this point in the history
  • Loading branch information
WildFireFlum committed Apr 3, 2023
1 parent 61cc49c commit e123656
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bftengine/include/bftengine/ReplicaConfig.hpp
Expand Up @@ -170,6 +170,12 @@ class ReplicaConfig : public concord::serialize::SerializableFactory<ReplicaConf

// Keys Management
CONFIG_PARAM(keyExchangeOnStart, bool, false, "whether to perform initial key exchange");
CONFIG_PARAM(singleSignatureScheme,
bool,
true,
"whether to use a single signature scheme to identify the replica in the network."
"When set to false, a replica may use a signature scheme which differs from its "
"main signature scheme to sign consensus protocol messages.");
CONFIG_PARAM(keyViewFilePath, std::string, ".", "TODO");
// Configuration Management
// Keys Management
Expand Down Expand Up @@ -614,7 +620,8 @@ inline std::ostream& operator<<(std::ostream& os, const ReplicaConfig& rc) {
rc.useUnifiedCertificates,
rc.kvBlockchainVersion,
replicaMsgSignAlgo,
operatorMsgSignAlgo);
operatorMsgSignAlgo,
rc.singleSignatureScheme);
os << ", ";
for (auto& [param, value] : rc.config_params_) os << param << ": " << value << "\n";
return os;
Expand Down
3 changes: 3 additions & 0 deletions tests/simpleKVBC/TesterReplica/setup.cpp
Expand Up @@ -97,6 +97,7 @@ std::unique_ptr<TestSetup> TestSetup::ParseArgs(int argc, char** argv) {
std::string byzantineStrategies;
bool is_separate_communication_mode = false;
int addAllKeysAsPublic = 0;
int singleSignatureScheme = 1;
int stateTransferMsgDelayMs = 0;
std::unordered_set<ReplicaId> byzantineReplicaIds{};

Expand Down Expand Up @@ -142,6 +143,7 @@ std::unique_ptr<TestSetup> TestSetup::ParseArgs(int argc, char** argv) {
// direct options - assign directly ro a non-null flag
{"publish-master-key-on-startup", no_argument, (int*)&replicaConfig.publishReplicasMasterKeyOnStartup, 1},
{"add-all-keys-as-public", no_argument, &addAllKeysAsPublic, 1},
{"no-single-signature-scheme", no_argument, &singleSignatureScheme, 0},
{0, 0, 0, 0}};
int o = 0;
int optionIndex = 0;
Expand Down Expand Up @@ -355,6 +357,7 @@ std::unique_ptr<TestSetup> TestSetup::ParseArgs(int argc, char** argv) {
}
}

replicaConfig.singleSignatureScheme = singleSignatureScheme;
if (keysFilePrefix.empty()) throw std::runtime_error("missing --key-file-prefix");

// If -p and -t are set, enable clientTransactionSigningEnabled. If only one of them is set, throw an error
Expand Down

0 comments on commit e123656

Please sign in to comment.