gen/genacorn.c
static void generate_keystream(void)
{
    // ks = s12 ^ state->s4_l ^
    //      maj(s235, state->s2_l, state->s5_l) ^
    //      ch(state->s6_l, s111, s66);
    ks = s12;
    s12 = -1;
    insn_printf("eor r%d,r%d", ks, s4_l);

    // ks ^= maj(s235, state->s2_l, state->s5_l)
    insn_printf("mov r%d,r%d", temp_reg, s235); // ks ^= (s235 & s2_l)
    insn_printf("and r%d,r%d", temp_reg, s2_l);
    insn_printf("eor r%d,r%d", ks, temp_reg);
    insn_printf("and r%d,r%d", s235, s5_l);     // ks ^= (s235 & s5_l)
    insn_printf("eor r%d,r%d", ks, s235);
    insn_printf("mov r%d,r%d", temp_reg, s2_l); // ks ^= (s2_l & s5_l)
    insn_printf("and r%d,r%d", temp_reg, s5_l);
    insn_printf("eor r%d,r%d", ks, temp_reg);
    release_reg(&s235);

    // ks ^= ch(state->s6_l, s111, s66)
    insn_printf("and r%d,r%d", s111, s6_l);
    insn_printf("eor r%d,r%d", ks, s111);
    insn_printf("mov r%d,r%d", temp_reg, s6_l);
    insn_printf("com r%d", temp_reg);
    insn_printf("and r%d,r%d", s66, temp_reg);
    insn_printf("eor r%d,r%d", ks, s66);
    release_reg(&s111);
    release_reg(&s66);
}
// Generate the next 8 keystream bits.
Generate the next 8 keystream bits.
Generate the next 8 keystream bits .
static void generate_keystream(void)
{
    ks = s12;
    s12 = -1;
    insn_printf("eor r%d,r%d", ks, s4_l);
    insn_printf("mov r%d,r%d", temp_reg, s235); 
    insn_printf("and r%d,r%d", temp_reg, s2_l);
    insn_printf("eor r%d,r%d", ks, temp_reg);
    insn_printf("and r%d,r%d", s235, s5_l);     
    insn_printf("eor r%d,r%d", ks, s235);
    insn_printf("mov r%d,r%d", temp_reg, s2_l); 
    insn_printf("and r%d,r%d", temp_reg, s5_l);
    insn_printf("eor r%d,r%d", ks, temp_reg);
    release_reg(&s235);
    insn_printf("and r%d,r%d", s111, s6_l);
    insn_printf("eor r%d,r%d", ks, s111);
    insn_printf("mov r%d,r%d", temp_reg, s6_l);
    insn_printf("com r%d", temp_reg);
    insn_printf("and r%d,r%d", s66, temp_reg);
    insn_printf("eor r%d,r%d", ks, s66);
    release_reg(&s111);
    release_reg(&s66);
}
static void generate_keystream ( void ) { ks = s12 ; s12 = -1 ; insn_printf ( " " , ks , s4_l ) ; insn_printf ( " " , temp_reg , s235 ) ; insn_printf ( " " , temp_reg , s2_l ) ; insn_printf ( " " , ks , temp_reg ) ; insn_printf ( " " , s235 , s5_l ) ; insn_printf ( " " , ks , s235 ) ; insn_printf ( " " , temp_reg , s2_l ) ; insn_printf ( " " , temp_reg , s5_l ) ; insn_printf ( " " , ks , temp_reg ) ; release_reg ( & s235 ) ; insn_printf ( " " , s111 , s6_l ) ; insn_printf ( " " , ks , s111 ) ; insn_printf ( " " , temp_reg , s6_l ) ; insn_printf ( " " , temp_reg ) ; insn_printf ( " " , s66 , temp_reg ) ; insn_printf ( " " , ks , s66 ) ; release_reg ( & s111 ) ; release_reg ( & s66 ) ; }
Generate the next 8 keystream bits.
Generate the next 8 keystream bits .
// ks = s12 ^ state->s4_l ^ //      maj(s235, state->s2_l, state->s5_l) ^ //      ch(state->s6_l, s111, s66); // ks ^= maj(s235, state->s2_l, state->s5_l) // ks ^= (s235 & s2_l) // ks ^= (s235 & s5_l) // ks ^= (s2_l & s5_l) // ks ^= ch(state->s6_l, s111, s66)