docs: def ecdh(self, identity, pubkey):
          """Get shared session key using Elliptic Curve Diffie-Hellman."""
          curve_name = identity.get_curve_name(ecdh=True)
          log.debug('"%s" shared session key (%s) for %r from %s',
                    identity.to_string(), curve_name, pubkey, self)
          try:
              result = self._defs.get_ecdh_session_key(
                  self.conn,
                  identity=self._identity_proto(identity),
                  peer_public_key=pubkey,
                  ecdsa_curve_name=curve_name)
              log.debug('result: %s', result)
              assert len(result.session_key) in {65, 33}  # NIST256 or Curve25519
              assert result.session_key[:1] == b'\x04'
              return bytes(result.session_key)
          except self._defs.TrezorFailure as e:
              msg = '{} error: {}'.format(self, e)
              log.debug(msg, exc_info=True)
              raise interface.DeviceError(msg)