@@ -132,25 +132,25 @@ final class Idemia: CardCommandsInternal {
132132
133133 // MARK: - Authentication & Signing
134134
135- func authenticate ( for hash : Data , withPin1 pin1 : SecureData ) async throws -> Data {
135+ func authenticate ( for hash : any DataType , withPin1 pin1 : SecureData ) async throws -> Data {
136136 _ = try await select ( file : kAIDOberthur )
137137 try await verifyCode ( . pin1 , code : pin1 )
138138 try await setSecEnv ( mode : 0xA4 , algo : [ 0xFF , 0x20 , 0x08 , 0x00 ] , keyRef : AUTHKEY )
139139 var paddedHash = Data ( repeating : 0x00 , count : max ( 48 , hash . count ) - hash . count )
140- paddedHash . append ( hash )
140+ paddedHash . append ( contentsOf : hash )
141141 return try await reader . sendAPDU ( ins : 0x88 , data : paddedHash , leByte : 0x00 )
142142 }
143143
144- func calculateSignature ( for hash : Data , withPin2 pin2 : SecureData ) async throws -> Data {
144+ func calculateSignature ( for hash : any DataType , withPin2 pin2 : SecureData ) async throws -> Data {
145145 _ = try await select ( file : kAIDQSCD )
146146 try await verifyCode ( . pin2 , code : pin2 )
147147 try await setSecEnv ( mode : 0xB6 , algo : [ 0xFF , 0x15 , 0x08 , 0x00 ] , keyRef : SIGNKEY )
148148 var paddedHash = Data ( repeating : 0x00 , count : max ( 48 , hash . count ) - hash . count )
149- paddedHash . append ( hash )
149+ paddedHash . append ( contentsOf : hash )
150150 return try await reader . sendAPDU ( ins : 0x2A , p1Byte : 0x9E , p2Byte : 0x9A , data : paddedHash , leByte : 0x00 )
151151 }
152152
153- func decryptData ( _ hash : Data , withPin1 pin1 : SecureData ) async throws -> Data {
153+ func decryptData ( _ hash : any DataType , withPin1 pin1 : SecureData ) async throws -> Data {
154154 _ = try await select ( file : kAIDOberthur )
155155 try await verifyCode ( . pin1 , code : pin1 )
156156 try await setSecEnv ( mode : 0xB8 , algo : [ 0xFF , 0x30 , 0x04 , 0x00 ] , keyRef : AUTHKEY )
0 commit comments