In mifare_desfire.c line 574 reads
The masking discards the encryption type indicated in the top two bits by an EV1 card.
Rewriting the line as
would correct that but I suggest also renaming the function parameter to settings2. I don't have an EV1 datasheet to confirm it but I suspect that this byte has been renamed in the spec due to these bits.