CRACK Solution

Sum Times Three

CRACK checksum times 3

In-game screenshot of Sum Times Three
In-game view
FamilyCRACK Graph0.265 DifficultyEasy Ring03 IDllama_mul_sum

Prerequisites

RECTIFIER

Unlocks

CLOCK GATE

Accepted input ACE
Techniquechecksum times 3 Rulenonzero SampleACE

Walkthrough

Recover the accepted input below, then submit it to the CRACK verifier.

Reject Samples

  • AC
  • ACES
  • ace
  • BCE
Verifier Listing
; llama_mul_sum: checksum times three. The three input bytes are summed, the
; total is multiplied by 3, and the product is checked against the stored target.
; Technique: additive checksum * 3. r0 = 1 on accept. Accept rule: nonzero.
;
; sample "ACE": 65 + 67 + 69 = 201; 201 * 3 = 603. In 8-bit math the product
; wraps mod 256: 603 & 0xFF = 0x5B, the byte the check compares against. The sum
; 201 fits in a byte, so the running total never overflows before the multiply.

        len   r2
        cmp   r2, 3
        jnz   bad           ; fixed-length puzzle: exactly 3 bytes

        mov   r3, 0         ; r3 = running sum
        mov   r7, 0         ; r7 = index
loop:   cmp   r7, r2
        jge   tally         ; summed all three -> multiply
        ldb   r0, [r7]
        add   r3, r0        ; sum += input[r7]
        inc   r7
        jmp   loop

tally:  mov   r0, r3
        mul   r0, 3         ; total * 3 (mod 256)
        cmp   r0, 0x5b      ; 603 & 0xFF
        jnz   bad

        mov   r0, 1
        ret
bad:    mov   r0, 0
        ret