|
ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
|
A secure borrow whose acquire and release are one call each. More...
#include <secure.h>
Public Member Functions | |
| SecureBorrow (size_t n, size_t align) | |
| ~SecureBorrow () | |
| SecureBorrow (const SecureBorrow &)=delete | |
| SecureBorrow & | operator= (const SecureBorrow &)=delete |
| const pc_span & | span () const |
| The borrowed region; empty if the pool could not satisfy it. | |
A secure borrow whose acquire and release are one call each.
SecureScope + pc_secure_span crosses this module's boundary three times (mark, alloc, release); mark and alloc always happen together, so one of those is structure rather than work. Measured on an ESP32-S3: 129 cycles against 172 for the three-call form.
Releases exactly like SecureScope - the region is wiped BEFORE the position moves, so no later borrow can be handed memory still holding this one's key material.
| SecureBorrow::SecureBorrow | ( | size_t | n, |
| size_t | align | ||
| ) |
Definition at line 117 of file secure.cpp.
References pc_arena_scratch_alloc_aligned(), pc_arena_scratch_mark(), and pc_span_from().
| SecureBorrow::~SecureBorrow | ( | ) |
Definition at line 127 of file secure.cpp.
|
delete |
|
delete |
|
inline |
The borrowed region; empty if the pool could not satisfy it.
Definition at line 161 of file secure.h.
Referenced by bn_expmod_group14(), pc_aes256ctr_crypt(), pc_aes256ctr_get_length(), pc_chacha20_block_ietf(), pc_chacha20_xor(), pc_chachapoly_decrypt(), pc_chachapoly_encrypt(), pc_chachapoly_get_length(), pc_hmac_sha256(), pc_hmac_sha256_final(), pc_hmac_sha256_init(), and pc_poly1305().