Skip to content

Commit 52a2c58

Browse files
committed
Use mask for LitEID
Signed-off-by: Raul Metsma <raul@metsma.ee>
1 parent affadb3 commit 52a2c58

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/electronic-id.cpp

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,14 +77,6 @@ const std::map<byte_vector, ElectronicIDConstructor, VectorComparator> SUPPORTED
7777
{{0x3b, 0xdc, 0x96, 0x00, 0x80, 0xb1, 0xfe, 0x45, 0x1f, 0x83, 0x00, 0x12,
7878
0x42, 0x8f, 0x54, 0x65, 0x49, 0x44, 0x32, 0x0f, 0x90, 0x00, 0x12},
7979
constructor<LatEIDIDEMIAV2>},
80-
// LitEID
81-
{{0x3B, 0x9D, 0x18, 0x81, 0x31, 0xFC, 0x35, 0x80, 0x31, 0xC0, 0x69,
82-
0x4D, 0x54, 0x43, 0x4F, 0x53, 0x73, 0x02, 0x05, 0x05, 0xD3},
83-
constructor<ElectronicID::Type::LitEID>},
84-
// LitEID v2.0
85-
{{0x3B, 0x9D, 0x18, 0x81, 0x31, 0xFC, 0x35, 0x80, 0x31, 0xC0, 0x69,
86-
0x4D, 0x54, 0x43, 0x4F, 0x53, 0x73, 0x02, 0x06, 0x04, 0xD1},
87-
constructor<ElectronicID::Type::LitEID>},
8880
// HrvEID
8981
{{0x3b, 0xff, 0x13, 0x00, 0x00, 0x81, 0x31, 0xfe, 0x45, 0x00, 0x31, 0xb9, 0x64,
9082
0x04, 0x44, 0xec, 0xc1, 0x73, 0x94, 0x01, 0x80, 0x82, 0x90, 0x00, 0x12},
@@ -111,7 +103,7 @@ struct MaskedATREntry
111103
{
112104
}
113105

114-
bool operator==(const byte_vector& atr) const
106+
constexpr bool operator==(const byte_vector& atr) const
115107
{
116108
return std::equal(atr.cbegin(), atr.cend(), pattern.cbegin(), pattern.cend(),
117109
[mask_ptr = mask.data()](byte_type a, byte_type p) mutable {
@@ -137,6 +129,12 @@ const std::vector<MaskedATREntry> MASKED_ATRS = {
137129
{{0x3b, 0x98, 0x13, 0x40, 0x0a, 0xa5, 0x03, 0x01, 0x01, 0x01, 0xad, 0x13, 0x11},
138130
{0xff, 0xff, 0x00, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00},
139131
constructor<ElectronicID::Type::BelEID>},
132+
// LitEID
133+
{{0x3B, 0x9D, 0x18, 0x81, 0x31, 0xFC, 0x35, 0x80, 0x31, 0xC0, 0x69,
134+
0x4D, 0x54, 0x43, 0x4F, 0x53, 0x73, 0x02, 0x05, 0x05, 0xD3},
135+
{0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF,
136+
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00},
137+
constructor<ElectronicID::Type::LitEID>},
140138
// LuxtrustV2
141139
{{0x3B, 0x7D, 0x00, 0x00, 0x00, 0x80, 0x31, 0x80, 0x65, 0xB0, 0x00, 0x00, 0x00, 0x00, 0x83,
142140
0x00, 0x90, 0x00},

0 commit comments

Comments
 (0)