arduino-lorawan icon indicating copy to clipboard operation
arduino-lorawan copied to clipboard

15-byte randomness via noise rssi

Open Kongduino opened this issue 4 years ago • 0 comments

In the radio.c file, there is code filling up a buffer called randbuf with random bytes using the RegRssiWideband register. https://github.com/mcci-catena/arduino-lmic/blob/master/src/lmic/radio.c#L1124-L1134

The problem is this code has a line that prevents contiguous bits to be identical. I have my own library using a variation of this code, without the line prevent identical contiguous bits. I did some tests comparing the distribution of random numbers (between 0 and 255) with the LMIC and my library, and the results are very different. The distribution is way too regular with the LMIC code: look at the scatter plots.

lmic

vs

lorandom

I think this code should be fixed to ensure better randomness.

Kongduino avatar Jun 25 '21 17:06 Kongduino