From 6ae607cc84b671810fca9c24b1c131ca12d922e7 Mon Sep 17 00:00:00 2001 From: Dennis Brentjes Date: Wed, 16 Nov 2016 19:55:11 +0100 Subject: Working implementation of elgamal in 2048 bit multiplicative group. --- node/node.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'node/node.cpp') diff --git a/node/node.cpp b/node/node.cpp index 5bce063..0f2bae5 100644 --- a/node/node.cpp +++ b/node/node.cpp @@ -215,7 +215,19 @@ void Node::start_realtime_phase() { generate_random_message(&cmix_ctx, v.data()); swap_k_for_r(&cmix_ctx, &(*realpre.mutable_m(index))[0], v.data(), data[handle].shared_value, index); } else { - swap_k_for_r(&cmix_ctx, &(*realpre.mutable_m(index))[0], queue.front().data(), data[handle].shared_value, index); + std::string x = to_string(data.at(handle).shared_value, cmix_ctx); + { + std::stringstream ss; + ss << "shared_key: "; + for(auto&& c : x) { + ss << "\\" << std::setw(3) << std::setfill('0') << std::oct << (unsigned int) c; + } + BOOST_LOG_TRIVIAL(trace) << ss.str(); + } + + BOOST_LOG_TRIVIAL(trace) << + + swap_k_for_r(&cmix_ctx, &(*realpre.mutable_m(index))[0], queue.front().data(), data.at(handle).shared_value, index); } *realpre.mutable_h(index) = handle; } -- cgit v1.2.3-70-g09d2