C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
D ^= f1(A, kr(i*4+3, ctx), ctx->km[i][3]);
A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
}
D ^= f1(A, kr(i*4+3, ctx), ctx->km[i][3]);
A ^= f3(B, kr(i*4+2, ctx), ctx->km[i][2]);
B ^= f2(C, kr(i*4+1, ctx), ctx->km[i][1]);
C ^= f1(D, kr(i*4+0, ctx), ctx->km[i][0]);
}
G ^= f1(H, (tr[0]&0x0f)+(tr[5]&0x01)?0x10:0x00, tm[0]);
F ^= f2(G, (tr[0]>>4) +(tr[5]&0x02)?0x10:0x00, tm[1]);
E ^= f3(F, (tr[1]&0x0f)+(tr[5]&0x04)?0x10:0x00, tm[2]);
G ^= f1(H, (tr[0]&0x0f)+(tr[5]&0x01)?0x10:0x00, tm[0]);
F ^= f2(G, (tr[0]>>4) +(tr[5]&0x02)?0x10:0x00, tm[1]);
E ^= f3(F, (tr[1]&0x0f)+(tr[5]&0x04)?0x10:0x00, tm[2]);
G ^= f1(H, tr[0], tm[0]);
F ^= f2(G, tr[1], tm[1]);
E ^= f3(F, tr[2], tm[2]);
G ^= f1(H, tr[0], tm[0]);
F ^= f2(G, tr[1], tm[1]);
E ^= f3(F, tr[2], tm[2]);