Better randomization from NTP code.
This commit is contained in:
parent
ad0ac8fb21
commit
49494a3cc3
3
ntp.h
3
ntp.h
@ -186,7 +186,8 @@ bool NTPClient::forceUpdate() {
|
||||
// this is NTP time (seconds since Jan 1 1900):
|
||||
unsigned long secsSince1900 = highWord << 16 | lowWord;
|
||||
|
||||
random16_set_seed(secsSince1900 & 0xFFFF);
|
||||
random16_add_entropy(this->_packetBuffer[44]<<8 | this->_packetBuffer[45]);
|
||||
random16_add_entropy(this->_packetBuffer[46]<<8 | this->_packetBuffer[47]);
|
||||
|
||||
this->_currentEpoc = secsSince1900 - SEVENZYYEARS;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user