Repository navigation
Memory Container
This D port does not use the C++ STL. Containers and ownership come from memutils.
| Type | Role |
|---|---|
Vector!T |
Growable array (ThreadMem allocator by default) |
SecureVector!T |
Same, but the backing store is wiped on free (SecureMem) |
Unique!T |
Unique owner of a class (or T* with a custom allocator). Destructor frees |
RefCounted!T |
Shared owner used for X509Certificate, some ASN.1 objects |
Unique!AutoSeededRNG rng = new AutoSeededRNG;
SecureVector!ubyte key = rng.randomVec(32);
Vector!ubyte wire;SecureVector is for primitive bytes/ints. Higher-level Botan
objects already wipe themselves; put those in Vector or Unique.
Do not put Pipe / filters by value in a Vector (they hold
pointers to other filters); store Unique!Filter or pointers.
On Linux/FreeBSD a small mlock pool is tried first for SecureMem,
then the heap. Windows uses VirtualLock when the process is
allowed to.
Tests built with memutils’ debugger (HasDebugAllocations) snapshot
live bytes. checkMemutilsRepeat fails a unittest if a new of a
class is not Unique-wrapped (lockless growth). Always Unique-wrap
new TLSClient, new AES128, getAead(...), loadKey(...), etc.
See architecture/libstate-factory.md for how the factory hands
back algorithm objects.
Botan 3.13.0 (D)
TLS / PKI
Keys and primitives
- Public Key Cryptography
- AEAD Modes
- The Low Level Interface
- Pipe and Filter Message Processing
- Key Derivation Functions
- PBKDF Algorithms
- Password Hashing
- Random Number Generators
- Memory Container
- BigInt
Other