nrf52: call nRFCrypto.begin()/end() only once
This commit is contained in:
1 parent
79d2eeaa76
commit
b8324f4fa8
4 files changed
+13
-16
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user