+static uint8_t calcSumNibbleXor( uint8_t* bytes, uint8_t len, uint32_t mask) {
+ uint8_t sum = 0;
+ for (uint8_t i = 0; i < len; i++) {
+ sum ^= NIBBLE_LOW(bytes[i]);
+ sum ^= NIBBLE_HIGH(bytes[i]);
+ }
+ sum &= mask;
+ return sum;
+}
+static uint8_t calcSumByteXor( uint8_t* bytes, uint8_t len, uint32_t mask) {
+ uint8_t sum = 0;
+ for (uint8_t i = 0; i < len; i++)
+ sum ^= bytes[i];
+ sum &= mask;
+ return sum;
+}