Security: add a public CSPRNG bytes API (VL-SEC-01)

This commit is contained in:
faumaray committed 2026-12-03 18:10:18 +03:00
1 parent 0002e74a7d
commit 54d143be93
3 files changed
+56

No files matched your search

+6
View File
@@ -37,6 +37,12 @@ namespace Void::Security
[[nodiscard]] Void::Result::Result<std::string>
random_token(std::size_t entropy_bytes = default_token_entropy_bytes);
/// Fill `buffer` with cryptographically secure random bytes from the
/// platform CSPRNG. An empty buffer is a successful no-op; on failure the
/// destination is wiped so no partial randomness is left behind.
[[nodiscard]] Void::Result::Result<void>
random_bytes(std::span<unsigned char> buffer);
/// Produce a deterministic lowercase hexadecimal BLAKE2b-256 digest.
/// Store this digest instead of the bearer token itself.
[[nodiscard]] Void::Result::Result<std::string>