commaai / panda

code powering the comma.ai panda
MIT License
1.52k stars 757 forks source link

validate_checksum function improvement #1903

Closed MarinkoMagla closed 5 months ago

MarinkoMagla commented 5 months ago

This function is under “TODO” inside panda/board/drivers/spi.h file. The function verifies the integrity of a data block by XORing all its bytes with an initial checksum value, returning true if the result is zero, indicating no corruption. The improvement can be made by casting the bulk to uint32_t and xor-ing the bytes afterwards.

validate_cheksum

adeebshihadeh commented 5 months ago

ChatGPT?

MarinkoMagla commented 5 months ago

It is a snip and a comment from the file from this repo.