Fixes an issue where the ATR parser incorrectly treated Yn as an absolute value, rather than a bitmask.
This came up parsing the YubiKey 5C's USB CCID ATR, where Y1 = 0b1111, which was incorrectly interpreted as containing 7 bytes, when there are actually only 3 bytes (for TA1, TB1 and TC1).
This also makes the Atr::protocols a HashSet, to deal with ATRs that repeat the same protocol multiple times.
[x] cargo test has been run and passes
[x] documentation has been updated with relevant examples (if relevant)
Fixes an issue where the ATR parser incorrectly treated Yn as an absolute value, rather than a bitmask.
This came up parsing the YubiKey 5C's USB CCID ATR, where Y1 =
0b1111
, which was incorrectly interpreted as containing 7 bytes, when there are actually only 3 bytes (for TA1, TB1 and TC1).This also makes the
Atr::protocols
aHashSet
, to deal with ATRs that repeat the same protocol multiple times.