Update documentation
parent
033f204a86
commit
0c82df181c
25
secblock.h
25
secblock.h
|
|
@ -74,7 +74,7 @@ public:
|
|||
#if defined(__SUNPRO_CC)
|
||||
// https://github.com/weidai11/cryptopp/issues/770
|
||||
// and https://stackoverflow.com/q/53999461/608639
|
||||
CRYPTOPP_CONSTEXPR size_type max_size(size_type n) const {return (~(size_type)0)/n;}
|
||||
CRYPTOPP_CONSTEXPR size_type max_size(size_type n) const {return SIZE_MAX/n;}
|
||||
#endif
|
||||
|
||||
#if defined(CRYPTOPP_CXX11_VARIADIC_TEMPLATES) || defined(CRYPTOPP_DOXYGEN_PROCESSING)
|
||||
|
|
@ -753,16 +753,28 @@ public:
|
|||
{m_alloc.deallocate(m_ptr, STDMIN(m_size, m_mark));}
|
||||
|
||||
#ifdef __BORLANDC__
|
||||
/// \brief Cast operator
|
||||
/// \returns block pointer cast to non-const <tt>T *</tt>
|
||||
operator T *() const
|
||||
{return (T*)m_ptr;}
|
||||
#else
|
||||
/// \brief Cast operator
|
||||
/// \returns block pointer cast to <tt>const void *</tt>
|
||||
operator const void *() const
|
||||
{return m_ptr;}
|
||||
|
||||
/// \brief Cast operator
|
||||
/// \returns block pointer cast to non-const <tt>void *</tt>
|
||||
operator void *()
|
||||
{return m_ptr;}
|
||||
|
||||
/// \brief Cast operator
|
||||
/// \returns block pointer cast to <tt>const T *</tt>
|
||||
operator const T *() const
|
||||
{return m_ptr;}
|
||||
|
||||
/// \brief Cast operator
|
||||
/// \returns block pointer cast to non-const <tt>T *</tt>
|
||||
operator T *()
|
||||
{return m_ptr;}
|
||||
#endif
|
||||
|
|
@ -938,8 +950,9 @@ public:
|
|||
/// \sa operator!=()
|
||||
bool operator==(const SecBlock<T, A> &t) const
|
||||
{
|
||||
return m_size == t.m_size &&
|
||||
VerifyBufsEqual(reinterpret_cast<const byte*>(m_ptr), reinterpret_cast<const byte*>(t.m_ptr), m_size*sizeof(T));
|
||||
return m_size == t.m_size && VerifyBufsEqual(
|
||||
reinterpret_cast<const byte*>(m_ptr),
|
||||
reinterpret_cast<const byte*>(t.m_ptr), m_size*sizeof(T));
|
||||
}
|
||||
|
||||
/// \brief Bitwise compare two SecBlocks
|
||||
|
|
@ -1110,6 +1123,12 @@ inline bool operator!=(const CryptoPP::AllocatorWithCleanup<T, A>&, const Crypto
|
|||
NAMESPACE_END
|
||||
|
||||
NAMESPACE_BEGIN(std)
|
||||
|
||||
/// \brief Swap two SecBlocks
|
||||
/// \tparam T class or type
|
||||
/// \tparam A AllocatorBase derived class for allocation and cleanup
|
||||
/// \param a the first SecBlock
|
||||
/// \param b the second SecBlock
|
||||
template <class T, class A>
|
||||
inline void swap(CryptoPP::SecBlock<T, A> &a, CryptoPP::SecBlock<T, A> &b)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue