diff --git a/applications/main/nfc/plugins/supported_cards/saflok.c b/applications/main/nfc/plugins/supported_cards/saflok.c index 55edd2efab..1b40d5de8d 100644 --- a/applications/main/nfc/plugins/supported_cards/saflok.c +++ b/applications/main/nfc/plugins/supported_cards/saflok.c @@ -62,8 +62,8 @@ void generate_saflok_key(const uint8_t* uid, uint8_t* key) { uint8_t carry_sum = 0; for(int i = KEY_LENGTH - 1; i >= 0; i--, magickal_index--) { - uint16_t keysum = temp_key[i] + magic_table[magickal_index]; - temp_key[i] = (keysum & 0xFF) + carry_sum; + uint16_t keysum = temp_key[i] + magic_table[magickal_index] + carry_sum; + temp_key[i] = (keysum & 0xFF); carry_sum = keysum >> 8; }