build: require boost >= 1.71.0
Refs: #5276
Change-Id: Ifc719cf5e4b8704e0408cab1f9ab849006061dfc
diff --git a/src/detail/crypto-helpers.cpp b/src/detail/crypto-helpers.cpp
index 16e56a5..0834ad8 100644
--- a/src/detail/crypto-helpers.cpp
+++ b/src/detail/crypto-helpers.cpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2017-2022, Regents of the University of California.
+ * Copyright (c) 2017-2023, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -362,33 +362,10 @@
// }
}
-#ifndef NDNCERT_HAVE_TESTS
-static
-#endif
-uint32_t
+static uint32_t
loadBigU32(const uint8_t* src) noexcept
{
-#if BOOST_VERSION >= 107100
return boost::endian::endian_load<uint32_t, 4, boost::endian::order::big>(src);
-#else
- uint32_t dest;
- std::memcpy(reinterpret_cast<uint8_t*>(&dest), src, sizeof(dest));
- return boost::endian::big_to_native(dest);
-#endif
-}
-
-#ifndef NDNCERT_HAVE_TESTS
-static
-#endif
-void
-storeBigU32(uint8_t* dest, uint32_t src) noexcept
-{
-#if BOOST_VERSION >= 107100
- boost::endian::endian_store<uint32_t, 4, boost::endian::order::big>(dest, src);
-#else
- boost::endian::native_to_big_inplace(src);
- std::memcpy(dest, reinterpret_cast<const uint8_t*>(&src), sizeof(src));
-#endif
}
static void
@@ -404,7 +381,7 @@
else {
counter += increment;
}
- storeBigU32(&iv[8], counter);
+ boost::endian::endian_store<uint32_t, 4, boost::endian::order::big>(&iv[8], counter);
}
Block
diff --git a/src/detail/crypto-helpers.hpp b/src/detail/crypto-helpers.hpp
index 235c6b5..1cf8df4 100644
--- a/src/detail/crypto-helpers.hpp
+++ b/src/detail/crypto-helpers.hpp
@@ -1,6 +1,6 @@
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
- * Copyright (c) 2017-2021, Regents of the University of California.
+ * Copyright (c) 2017-2023, Regents of the University of California.
*
* This file is part of ndncert, a certificate management system based on NDN.
*
@@ -139,7 +139,7 @@
*
* The TLV spec: https://github.com/named-data/ndncert/wiki/NDNCERT-Protocol-0.3#242-aes-gcm-encryption.
*
- * @param tlv_type The TLV TYPE of the encoded block, either ApplicationParameters or Content.
+ * @param tlvType The TLV TYPE of the encoded block, either ApplicationParameters or Content.
* @param key The AES key used for encryption.
* @param payload The plaintext payload.
* @param payloadSize The size of the plaintext payload.
@@ -173,14 +173,6 @@
const uint8_t* associatedData, size_t associatedDataSize,
std::vector<uint8_t>& decryptionIv, const std::vector<uint8_t>& encryptionIv);
-#ifdef NDNCERT_HAVE_TESTS
-uint32_t
-loadBigU32(const uint8_t* src) noexcept;
-
-void
-storeBigU32(uint8_t* dest, uint32_t src) noexcept;
-#endif
-
} // namespace ndncert
#endif // NDNCERT_DETAIL_CRYPTO_HELPERS_HPP