|
Void Sentry
An AI-driven, real-time Sentry Turret platform leveraging asynchronous I/O and computer vision to deliver high-precision autonomous motion tracking on resource-constrained embedded hardware.
|
Guards the PIN. The 5th consecutive wrong PIN starts a lockout of min(60 s * 2^k, 3600 s), k = lockouts since the last success; the failure count then resets. Lockout state lives in RAM only. More...
#include <pin_guard.h>
Public Member Functions | |
| PinGuard (const PinRecord &rec=PinRecord{}) | |
| bool | set_pin (const char *pin, size_t len, const uint8_t(&salt)[kSaltLen]) |
| Stores hash = sha256(salt || pin). False (nothing changed) if the PIN is not 4-8 digits. | |
| PinResult | check (const char *pin, size_t len, uint32_t now_ms) |
Checks a PIN. While locked out nothing is evaluated. Wrap-safe in now_ms. | |
| const PinRecord & | record () const |
Static Public Attributes | |
| static constexpr uint32_t | kMaxFailures = 5 |
| static constexpr uint32_t | kBaseLockoutMs = 60000 |
| static constexpr uint32_t | kMaxLockoutMs = 3600000 |
Guards the PIN. The 5th consecutive wrong PIN starts a lockout of min(60 s * 2^k, 3600 s), k = lockouts since the last success; the failure count then resets. Lockout state lives in RAM only.