From 5b1f6236497093e48e1ca9a5a585f2548f9cf55e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Meusel?= Date: Thu, 27 Jun 2024 09:54:20 +0200 Subject: [PATCH] add RandomNumberGenerator::random_array<>() --- src/lib/rng/rng.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/lib/rng/rng.h b/src/lib/rng/rng.h index b96e2f4633e..1ee3db9f714 100644 --- a/src/lib/rng/rng.h +++ b/src/lib/rng/rng.h @@ -208,6 +208,16 @@ class BOTAN_PUBLIC_API(2, 0) RandomNumberGenerator { return result; } + /** + * Create a std::array of @p bytes random bytes + */ + template + std::array random_array() { + std::array result; + random_vec(result); + return result; + } + /** * Return a random byte * @return random byte