mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-21 20:39:32 -05:00
Use hardware TRNG integrated into RT1051 MCU as an entropy source for builds complied for RT1051.
16 lines
412 B
C++
16 lines
412 B
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "bsp/trng/trng.hpp"
|
|
#include <random>
|
|
#include <memory>
|
|
|
|
namespace bsp::trng
|
|
{
|
|
std::uint32_t getRandomValue()
|
|
{
|
|
const auto trueRandomSource = std::make_unique<std::random_device>();
|
|
return (*trueRandomSource)();
|
|
}
|
|
} // namespace bsp::trng
|