#include <cstddef>#include <promeki/core/namespace.h>#include <promeki/core/platform.h>#include <promeki/core/error.h>
Go to the source code of this file.
Functions | |
| PROMEKI_NAMESPACE_BEGIN void | secureZero (void *ptr, size_t size) |
| Securely zeros a memory region, guaranteed not to be optimized away. | |
| Error | secureLock (void *ptr, size_t size) |
| Locks a memory region into physical RAM, preventing it from being swapped to disk. | |
| Error | secureUnlock (void *ptr, size_t size) |
| Unlocks a memory region previously locked with secureLock(). | |
See LICENSE file in the project root folder for license information.
Locks a memory region into physical RAM, preventing it from being swapped to disk.
Also marks the region as excluded from core dumps on Linux (MADV_DONTDUMP).
| ptr | Pointer to the memory region to lock. |
| size | Size of the region in bytes. |
Unlocks a memory region previously locked with secureLock().
Reverses the effects of secureLock(), allowing the OS to swap the pages and include them in core dumps again.
| ptr | Pointer to the memory region to unlock. |
| size | Size of the region in bytes. |