Crypto++  8.8
Free C++ class library of cryptographic schemes
Classes | Macros | Functions | Variables
secblock.h File Reference

Classes and functions for secure memory allocations. More...

Go to the source code of this file.

Classes

class  AllocatorBase< T >
 Base class for all allocators used by SecBlock. More...
 
class  AllocatorWithCleanup< T, T_Align16 >
 Allocates a block of memory with cleanup. More...
 
struct  AllocatorWithCleanup< T, T_Align16 >::rebind< V >
 Template class member Rebind. More...
 
class  NullAllocator< T >
 NULL allocator. More...
 
class  FixedSizeAllocatorWithCleanup< T, S, A, T_Align16 >
 Static secure memory block with cleanup. More...
 
class  FixedSizeAllocatorWithCleanup< T, S, A, true >
 Static secure memory block with cleanup. More...
 
class  FixedSizeAllocatorWithCleanup< T, S, A, false >
 Static secure memory block with cleanup. More...
 
class  SecBlock< T, A >
 Secure memory block with allocator and cleanup. More...
 
class  SecByteBlock
 SecBlock<byte> typedef. More...
 
class  SecWordBlock
 SecBlock<word> typedef. More...
 
class  AlignedSecByteBlock
 SecBlock using AllocatorWithCleanup<byte, true> typedef. More...
 
class  FixedSizeSecBlock< T, S, A >
 Fixed size stack-based SecBlock. More...
 
class  FixedSizeAlignedSecBlock< T, S, T_Align16 >
 Fixed size stack-based SecBlock with 16-byte alignment. More...
 
class  SecBlockWithHint< T, S, A >
 Stack-based SecBlock that grows into the heap. More...
 

Macros

#define CRYPTOPP_INHERIT_ALLOCATOR_TYPES(T_type)
 

Functions

template<class T , class A >
A::pointer StandardReallocate (A &alloc, T *oldPtr, typename A::size_type oldSize, typename A::size_type newSize, bool preserve)
 Reallocation function. More...
 
template<class T , bool A, class V , bool B>
bool operator== (const ::AllocatorWithCleanup< T, A > &, const ::AllocatorWithCleanup< V, B > &)
 
template<class T , bool A, class V , bool B>
bool operator!= (const ::AllocatorWithCleanup< T, A > &, const ::AllocatorWithCleanup< V, B > &)
 
template<class T , class A >
void swap (::SecBlock< T, A > &a, ::SecBlock< T, A > &b)
 Swap two SecBlocks. More...
 

Variables

 AllocatorWithCleanup< byte >
 
 AllocatorWithCleanup< word16 >
 
 AllocatorWithCleanup< word32 >
 
 AllocatorWithCleanup< word64 >
 
 AllocatorWithCleanup< word128, true >
 
 AllocatorWithCleanup< word, true >
 

Detailed Description

Classes and functions for secure memory allocations.

Definition in file secblock.h.

Macro Definition Documentation

◆ CRYPTOPP_INHERIT_ALLOCATOR_TYPES

#define CRYPTOPP_INHERIT_ALLOCATOR_TYPES (   T_type)
Value:
typedef typename AllocatorBase<T_type>::value_type value_type;\
typedef typename AllocatorBase<T_type>::size_type size_type;\
typedef typename AllocatorBase<T_type>::difference_type difference_type;\
typedef typename AllocatorBase<T_type>::pointer pointer;\
typedef typename AllocatorBase<T_type>::const_pointer const_pointer;\
typedef typename AllocatorBase<T_type>::reference reference;\
typedef typename AllocatorBase<T_type>::const_reference const_reference;

Definition at line 129 of file secblock.h.

Function Documentation

◆ StandardReallocate()

template<class T , class A >
A::pointer StandardReallocate ( A &  alloc,
T *  oldPtr,
typename A::size_type  oldSize,
typename A::size_type  newSize,
bool  preserve 
)

Reallocation function.

Template Parameters
Tthe class or type
Athe class or type's allocator
Parameters
allocthe allocator
oldPtrthe previous allocation
oldSizethe size of the previous allocation
newSizethe new, requested size
preserveflag that indicates if the old allocation should be preserved
Note
oldSize and newSize are the count of elements, and not the number of bytes.

Definition at line 149 of file secblock.h.

◆ swap()

template<class T , class A >
void swap ( ::SecBlock< T, A > &  a,
::SecBlock< T, A > &  b 
)
inline

Swap two SecBlocks.

Template Parameters
Tclass or type
AAllocatorBase derived class for allocation and cleanup
Parameters
athe first SecBlock
bthe second SecBlock

Definition at line 1289 of file secblock.h.