def METHOD_NAME(
    s: KeyImageSync,
    tds: MoneroKeyImageSyncStepRequest,
    progress: ProgressLayout,
) -> MoneroKeyImageSyncStepAck:
    from trezor import log
    from trezor.messages import MoneroExportedKeyImage, MoneroKeyImageSyncStepAck
    from apps.monero.xmr import chacha_poly, crypto, key_image
    assert s.creds is not None
    if not tds.tdis:
        raise DataError("Empty")
    kis = []
    buff = bytearray(32 * 3)
    buff_mv = memoryview(buff)
    if s.current_output is not None and s.num_outputs > 0:
        progress.report(1000 * (s.current_output + 1) // s.num_outputs)
    for td in tds.tdis:
        s.current_output += 1
        if s.current_output >= s.num_outputs:
            raise DataError("Too many outputs")
        if __debug__:
            log.debug(__name__, "ki_sync, step i: %d", s.current_output)
        # Update the control hash
        s.hasher.update(key_image.compute_hash(td))
        # Compute keyimage + signature
        ki, sig = key_image.export_key_image(s.creds, s.subaddresses, td)
        # Serialize into buff
        crypto.encodepoint_into(buff_mv[0:32], ki)
        crypto.encodeint_into(buff_mv[32:64], sig[0][0])
        crypto.encodeint_into(buff_mv[64:], sig[0][1])
        # Encrypt with enc_key
        nonce, ciph, _ = chacha_poly.encrypt(s.enc_key, buff)
        kis.append(MoneroExportedKeyImage(iv=nonce, blob=ciph))
    return MoneroKeyImageSyncStepAck(kis=kis)