aboutsummaryrefslogtreecommitdiff
path: root/node/node.cpp
diff options
context:
space:
mode:
authorDennis Brentjes <d.brentjes@gmail.com>2016-12-01 18:24:41 +0100
committerDennis Brentjes <d.brentjes@gmail.com>2016-12-01 18:24:41 +0100
commit7ee347e13ced7f1a84e7b325e65616b169e238a0 (patch)
tree316fbdba8a8526a3093157d2462ac8a55d6ca20b /node/node.cpp
parentbc39d05453340257fff986edfdd728f2a89d13ad (diff)
downloadcmix-7ee347e13ced7f1a84e7b325e65616b169e238a0.tar.gz
cmix-7ee347e13ced7f1a84e7b325e65616b169e238a0.tar.bz2
cmix-7ee347e13ced7f1a84e7b325e65616b169e238a0.zip
Use the new protobuf arena allocator.
Run script now takes a parameter tool to for instance "benchmark"
Diffstat (limited to 'node/node.cpp')
-rw-r--r--node/node.cpp26
1 files changed, 4 insertions, 22 deletions
diff --git a/node/node.cpp b/node/node.cpp
index c17fe4f..aadc123 100644
--- a/node/node.cpp
+++ b/node/node.cpp
@@ -24,26 +24,6 @@ Node::Node(ListenSettings const& listen_settings, NodeNetworkSettings network_se
{
initialize_keypair(&cmix_ctx);
- std::string x = to_string(cmix_ctx.keypair.sec, cmix_ctx);
- std::string y = to_string(cmix_ctx.keypair.pub, cmix_ctx);
- {
- std::stringstream ss;
- ss << "sec: ";
- for(auto&& c : x) {
- ss << "\\" << std::setw(3) << std::setfill('0') << std::oct << (unsigned int) c;
- }
- BOOST_LOG_TRIVIAL(trace) << ss.str();
- }
-
- {
- std::stringstream ss;
- ss << "pub: ";
- for(auto&& c : y) {
- ss << "\\" << std::setw(3) << std::setfill('0') << std::oct << (unsigned int) c;
- }
- BOOST_LOG_TRIVIAL(trace) << ss.str();
- }
-
GOOGLE_PROTOBUF_VERIFY_VERSION;
if(network_settings.is_first) {
@@ -183,7 +163,8 @@ void Node::start_precomputation() {
}
BOOST_LOG_TRIVIAL(trace) << ss.str();
- cmix_proto::PrePre prepre;
+ ArenaMessage<cmix_proto::PrePre> arena;
+ cmix_proto::PrePre& prepre = arena.get();
size_t len = get_group_element_array_size(&cmix_ctx);
std::vector<char*> r_er(cmix_ctx.nr_participants, nullptr);
@@ -222,7 +203,8 @@ void Node::start_precomputation() {
void Node::start_realtime_phase() {
- cmix_proto::RealPre realpre;
+ ArenaMessage<cmix_proto::RealPre> arena;
+ cmix_proto::RealPre& realpre = arena.get();
size_t len = get_group_element_array_size(&cmix_ctx);