build: == Dependency change == ChronoSync now depends on ndn-cxx library
diff --git a/src/sync-digest.cc b/src/sync-digest.cc
index 19ec240..d3dde6c 100644
--- a/src/sync-digest.cc
+++ b/src/sync-digest.cc
@@ -17,7 +17,7 @@
*
* Author: Zhenkai Zhu <zhenkai@cs.ucla.edu>
* Chaoyi Bian <bcy@pku.edu.cn>
- * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
+ * Alexander Afanasyev <alexander.afanasyev@ucla.edu>
*/
#include "sync-digest.h"
@@ -25,8 +25,8 @@
#include <boost/assert.hpp>
#include <boost/throw_exception.hpp>
-typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
-typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
+typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;
+typedef boost::error_info<struct tag_errmsg, int> errmsg_info_int;
// for printing, may be disabled in optimized build
@@ -89,7 +89,7 @@
value = lookup_table [(unsigned)ch];
if (value == -1)
BOOST_THROW_EXCEPTION (Sync::Error::DigestCalculationError () << errmsg_info_int ((int)ch));
-
+
return value;
}
};
@@ -146,7 +146,7 @@
if (!m_buffer.empty ()) return;
m_buffer.resize (HASH_FUNCTION_LEN);
-
+
unsigned int tmp;
int ok = EVP_DigestFinal_ex (m_context,
&m_buffer[0], &tmp);
@@ -160,14 +160,14 @@
Digest::getHash () const
{
if (isZero ()) return 0;
-
+
if (sizeof (std::size_t) > m_buffer.size ())
{
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Hash is not zero and length is less than size_t")
<< errmsg_info_int (m_buffer.size ()));
}
-
+
// just getting first sizeof(std::size_t) bytes
// not ideal, but should work pretty well
return *(reinterpret_cast<const std::size_t*> (&m_buffer[0]));
@@ -192,7 +192,7 @@
Digest::update (const uint8_t *buffer, size_t size)
{
// cout << "Update: " << (void*)buffer << " / size: " << size << "\n";
-
+
// cannot update Digest when it has been finalized
if (!m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
@@ -209,7 +209,7 @@
Digest &
Digest::operator << (const Digest &src)
{
- if (src.m_buffer.empty ())
+ if (src.m_buffer.empty ())
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Digest has not been yet finalized"));
@@ -222,7 +222,7 @@
operator << (std::ostream &os, const Digest &digest)
{
BOOST_ASSERT (!digest.m_buffer.empty ());
-
+
std::ostreambuf_iterator<char> out_it (os); // ostream iterator
// need to encode to base64
copy (string_from_binary (digest.m_buffer.begin ()),
@@ -241,7 +241,7 @@
if (str.size () == 0)
BOOST_THROW_EXCEPTION (Error::DigestCalculationError ()
<< errmsg_info_str ("Input is empty"));
-
+
// uint8_t padding = (3 - str.size () % 3) % 3;
// for (uint8_t i = 0; i < padding; i++) str.push_back ('=');
@@ -251,7 +251,7 @@
<< errmsg_info_str ("Digest has been already finalized"));
digest.m_buffer.clear ();
-
+
copy (string_to_binary (str.begin ()),
string_to_binary (str.end ()),
std::back_inserter (digest.m_buffer));
@@ -261,4 +261,3 @@
} // Sync
-