diff options
| author | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-16 19:55:11 +0100 |
|---|---|---|
| committer | Dennis Brentjes <d.brentjes@gmail.com> | 2016-11-16 19:55:11 +0100 |
| commit | 6ae607cc84b671810fca9c24b1c131ca12d922e7 (patch) | |
| tree | e078e5e30cf2f979a1dbd0baefd18a9f58191f07 /node | |
| parent | f93d52bbd0053574fb35d72b85c4b299dc1f3ee5 (diff) | |
| download | cmix-6ae607cc84b671810fca9c24b1c131ca12d922e7.tar.gz cmix-6ae607cc84b671810fca9c24b1c131ca12d922e7.tar.bz2 cmix-6ae607cc84b671810fca9c24b1c131ca12d922e7.zip | |
Working implementation of elgamal in 2048 bit multiplicative group.
Diffstat (limited to 'node')
| -rw-r--r-- | node/node.cpp | 14 | ||||
| -rw-r--r-- | node/node_node.cpp | 12 |
2 files changed, 23 insertions, 3 deletions
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; } diff --git a/node/node_node.cpp b/node/node_node.cpp index f24ff0a..e0ee237 100644 --- a/node/node_node.cpp +++ b/node/node_node.cpp @@ -115,8 +115,6 @@ cmix_proto::PrePost fill_precomputation_post_message(CMixContext& ctx, T const& BOOST_LOG_TRIVIAL(trace) << ss.str(); } - *prepost.mutable_r_epirs(i) = rs.Get(i); - *prepost.mutable_m_epirs(i) = ms.Get(i); } return prepost; @@ -132,6 +130,16 @@ cmix_proto::RealPre fill_realtime_pre_message(CMixContext& ctx, T const& hs, T c realpre.add_m(); realpre.mutable_m(i)->resize(len); + std::string x = to_string(data.at(hs.Get(i)).shared_value, 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(); + } + swap_k_for_r( &ctx, &(*realpre.mutable_m(i))[0], |
