Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
multiple fixes for 2K and 4K cards (dotnet#2028)
* multiple fixes for 2K and 4K cards The last 8 sectors of a 4K card have 16 blocks per sector. There are still only 4 sets of access control bits, so they apply to groups of blocks: (0-4, 5-9, 10-14, and 15). Added some helper functions to map block numbers of sector and group, and use these in the sector trailer encode/decode functions instead of blocknumber%4. Fixed the spelling error of EncodeSectorAndClockTailer() by renaming to EncodeSectorAndBlockTailer() and adding a synonym for the old name. Fixed an error in FormatNdef for 2K and 4K cards - it was writing block 3 a second time rather than writing block 67. Renamed the first parameter of SetCapacity from ATAQ to ATQA. fixed CRC byte for MAD directory in sector 16 write all four blocks in sector 16 re-factor writing of all NFC sector trailers Rename blockNumber to blockGroup in DecodeSectorTailer Treat KeyA in AuthenticateBlockKeyA the same as KeyB in AuthenticateBlockKeyB * addressing review comments
- Loading branch information