Merge pull request #3154 from fdlamotte/nrf52_hwcrypto_init

nrf52: call nRFCrypto.begin()/end() only once
This commit is contained in:
ripplebiz authored and GitHub committed 2026-08-12 12:14:21 +10:00
commit 3dfbcf93b8
4 files changed
+13 -16

No files matched your search

-2
View File
@@ -93,9 +93,7 @@ public:
void random(uint8_t* dest, size_t sz) override {
#ifdef USE_CC310_HW_CRYPTO
// CC310 TRNG is higher quality and environment-independent vs radio RSSI noise.
nRFCrypto.begin();
nRFCrypto.Random.generate(dest, (uint16_t)sz);
nRFCrypto.end();
#else
for (int i = 0; i < sz; i++) {
dest[i] = _radio->randomByte() ^ (::random(0, 256) & 0xFF);