- def display_param1(self, data):
- if (self.opcode == OPCODE_CHECK_MAC) or (self.opcode == OPCODE_DEV_REV) or \
- (self.opcode == OPCODE_HMAC) or (self.opcode == OPCODE_MAC) or \
- (self.opcode == OPCODE_NONCE) or (self.opcode == OPCODE_RANDOM) or \
- (self.opcode == OPCODE_SHA):
- self.put(data[0], data[1], self.out_ann, [3, ['Mode: %02X' % data[2]]])
- elif self.opcode == OPCODE_DERIVE_KEY:
- self.put(data[0], data[1], self.out_ann, [3, ['Random: %s' % data[2]]])
- elif self.opcode == OPCODE_GEN_DIG:
- self.put(data[0], data[1], self.out_ann, [3, ['Zone: %s' % ZONES[data[2]]]])
- elif self.opcode == OPCODE_LOCK:
- self.put(data[0], data[1], self.out_ann, [3, ['Zone: {}, Summary: {}'.format(
- 'DATA/OTP' if data[2] else 'CONFIG',
- 'Ignored' if data[2] & 0x80 else 'Used')]])
- elif self.opcode == OPCODE_PAUSE:
- self.put(data[0], data[1], self.out_ann, [3, ['Selector: %02X' % data[2]]])
- elif self.opcode == OPCODE_READ:
- self.put(data[0], data[1], self.out_ann, [3, ['Zone: {}, Length: {}'.format(ZONES[data[2] & 0x03],
- '32 bytes' if data[2] & 0x90 else '4 bytes')]])
- elif self.opcode == OPCODE_WRITE:
- self.put(data[0], data[1], self.out_ann, [3, ['Zone: {}, Encrypted: {}, Length: {}'.format(ZONES[data[2] & 0x03],
- 'Yes' if data[2] & 0x40 else 'No', '32 bytes' if data[2] & 0x90 else '4 bytes')]])
+ def put_param1(self, s):
+ op = self.opcode
+ if op in (OPCODE_CHECK_MAC, OPCODE_COUNTER, OPCODE_DEV_REV, \
+ OPCODE_ECDH, OPCODE_GEN_KEY, OPCODE_HMAC, OPCODE_MAC, \
+ OPCODE_NONCE, OPCODE_RANDOM, OPCODE_SHA, OPCODE_SIGN, \
+ OPCODE_VERIFY):
+ self.putx(s, [3, ['Mode: %02X' % s[2]]])
+ elif op == OPCODE_DERIVE_KEY:
+ self.putx(s, [3, ['Random: %s' % s[2]]])
+ elif op == OPCODE_PRIVWRITE:
+ self.putx(s, [3, ['Encrypted: {}'.format('Yes' if s[2] & 0x40 else 'No')]])
+ elif op == OPCODE_GEN_DIG:
+ self.putx(s, [3, ['Zone: %s' % ZONES[s[2]]]])
+ elif op == OPCODE_LOCK:
+ self.putx(s, [3, ['Zone: {}, Summary: {}'.format(
+ 'DATA/OTP' if s[2] else 'CONFIG',
+ 'Ignored' if s[2] & 0x80 else 'Used')]])
+ elif op == OPCODE_PAUSE:
+ self.putx(s, [3, ['Selector: %02X' % s[2]]])
+ elif op == OPCODE_READ:
+ self.putx(s, [3, ['Zone: {}, Length: {}'.format(ZONES[s[2] & 0x03],
+ '32 bytes' if s[2] & 0x90 else '4 bytes')]])
+ elif op == OPCODE_WRITE:
+ self.putx(s, [3, ['Zone: {}, Encrypted: {}, Length: {}'.format(ZONES[s[2] & 0x03],
+ 'Yes' if s[2] & 0x40 else 'No', '32 bytes' if s[2] & 0x90 else '4 bytes')]])