security: Add helpers for Command Interest
refs: #1238
Change-Id: I5a42f888b83bcc6dc51ea02045e438a4905ed145
diff --git a/src/util/random.cpp b/src/util/random.cpp
index 6bbe203..c63e916 100644
--- a/src/util/random.cpp
+++ b/src/util/random.cpp
@@ -21,5 +21,17 @@
return rng.GenerateWord32();
}
+uint64_t
+generateWord64()
+{
+ static CryptoPP::AutoSeededRandomPool rng;
+
+ uint64_t random;
+
+ rng.GenerateBlock(reinterpret_cast<unsigned char*>(&random), 8);
+
+ return random;
+}
+
} // namespace random
} // namespace ndn
diff --git a/src/util/random.hpp b/src/util/random.hpp
index bb5a3a6..f7dbc22 100644
--- a/src/util/random.hpp
+++ b/src/util/random.hpp
@@ -14,6 +14,9 @@
uint32_t
generateWord32();
+uint64_t
+generateWord64();
+
} // namespace random
} // namespace ndn