port NAC to security v2

This commit is based on Lei Pi's commit, which changed certificate version from v1 to v2.
The later changes fix some bugs and refactor algo part of the library to get rid of cryptopp.

Change-Id: I3be7e0341fe85ee69f1b5f1c3ed7421a6c61d0b5
diff --git a/src/schedule.cpp b/src/schedule.cpp
index 14635b4..797467a 100644
--- a/src/schedule.cpp
+++ b/src/schedule.cpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /**
- * Copyright (c) 2014-2015,  Regents of the University of California
+ * Copyright (c) 2014-2018, Regents of the University of California
  *
  * This file is part of ndn-group-encrypt (Group-based Encryption Protocol for NDN).
  * See AUTHORS.md for complete list of ndn-group-encrypt authors and contributors.
@@ -16,7 +16,7 @@
  * You should have received a copy of the GNU General Public License along with
  * ndn-group-encrypt, e.g., in COPYING.md file.  If not, see <http://www.gnu.org/licenses/>.
  *
- * @author Zhiyi Zhang <dreamerbarrychang@gmail.com>
+ * @author Zhiyi Zhang <zhiyi@cs.ucla.edu>
  */
 
 #include "schedule.hpp"
@@ -36,8 +36,10 @@
  * @p negativeR The negative result
  */
 static void
-calIntervalResult(const std::set<RepetitiveInterval>& list, const TimeStamp& ts,
-                  Interval& positiveR, Interval& negativeR)
+calIntervalResult(const std::set<RepetitiveInterval>& list,
+                  const TimeStamp& ts,
+                  Interval& positiveR,
+                  Interval& negativeR)
 {
   Interval tempInterval;
   bool isPositive;
@@ -51,7 +53,7 @@
       if (!negativeR.isValid())
         negativeR = tempInterval;
       else
-        negativeR && tempInterval;
+        negativeR&& tempInterval;
     }
   }
 }
@@ -176,22 +178,21 @@
   Interval whiteNegativeResult;
 
   // get the blackResult
-  calIntervalResult(m_blackIntervalList, ts,
-                    blackPositiveResult, blackNegativeResult);
+  calIntervalResult(m_blackIntervalList, ts, blackPositiveResult, blackNegativeResult);
 
   // if black positive result is not empty, the result must be false
   if (!blackPositiveResult.isEmpty())
     return std::make_tuple(false, blackPositiveResult);
 
   // get the whiteResult
-  calIntervalResult(m_whiteIntervalList, ts,
-                    whitePositiveResult, whiteNegativeResult);
+  calIntervalResult(m_whiteIntervalList, ts, whitePositiveResult, whiteNegativeResult);
 
   if (whitePositiveResult.isEmpty() && !whiteNegativeResult.isValid()) {
     // there is no white interval covering the timestamp
     // return false and a 24-hour interval
-    return std::make_tuple(false, Interval(TimeStamp(ts.date(), boost::posix_time::hours(0)),
-                                           TimeStamp(ts.date(), boost::posix_time::hours(24))));
+    return std::make_tuple(false,
+                           Interval(TimeStamp(ts.date(), boost::posix_time::hours(0)),
+                                    TimeStamp(ts.date(), boost::posix_time::hours(24))));
   }
 
   if (!whitePositiveResult.isEmpty()) {