ProtoCore v0.0.1
Deterministic, zero-heap network stack for embedded targets
Loading...
Searching...
No Matches
SecureBorrow Class Reference

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
 
SecureBorrowoperator= (const SecureBorrow &)=delete
 
const pc_spanspan () const
 The borrowed region; empty if the pool could not satisfy it.
 

Detailed Description

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.

Definition at line 152 of file secure.h.

Constructor & Destructor Documentation

◆ SecureBorrow() [1/2]

SecureBorrow::SecureBorrow ( size_t  n,
size_t  align 
)

◆ ~SecureBorrow()

SecureBorrow::~SecureBorrow ( )

Definition at line 127 of file secure.cpp.

◆ SecureBorrow() [2/2]

SecureBorrow::SecureBorrow ( const SecureBorrow )
delete

Member Function Documentation

◆ operator=()

SecureBorrow & SecureBorrow::operator= ( const SecureBorrow )
delete

◆ span()

const pc_span & SecureBorrow::span ( ) const
inline

The documentation for this class was generated from the following files: