aboutsummaryrefslogtreecommitdiff
path: root/src/crc.rs
Commit message (Collapse)AuthorAge
* Split struct Crc into trait Crc and struct Stm32CrcRobin Krahl2019-02-21
| | | | | | | | | | There are different ways to implement the CRC check: For testing, we might want to calulate the CRC in the software. On STM32 MCUs, we want to use the CRC peripheral. This patch splits the struct Crc into the Crc trait and the Stm32Crc struct implementing Crc using the CRC peripheral. The Nitrokey struct can now accept any Crc implementation.
* Validate CRC of incoming dataRobin Krahl2019-02-19
The data sent with Set_Report requests contains a CRC which we so far ignored. This patch adds a Crc struct that uses the CRC peripheral to calculate the CRC for some data and uses it to validate the CRC of the received data.