nrf52: call nRFCrypto.begin()/end() only once

This commit is contained in:
Florent committed 2026-08-09 14:46:23 -04:00
1 parent 79d2eeaa76
commit b8324f4fa8
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);