From 7ee347e13ced7f1a84e7b325e65616b169e238a0 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Thu, 1 Dec 2016 18:24:41 +0100 Subject: Use the new protobuf arena allocator. Run script now takes a parameter tool to for instance "benchmark" --- node/node.cpp | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-) (limited to 'node/node.cpp') 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 arena; + cmix_proto::PrePre& prepre = arena.get(); size_t len = get_group_element_array_size(&cmix_ctx); std::vector 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 arena; + cmix_proto::RealPre& realpre = arena.get(); size_t len = get_group_element_array_size(&cmix_ctx); -- cgit v1.2.3-70-g09d2