+void bmw_large_f0(uint64_t *q, const uint64_t *h, const void *m){
+ uint16_t hack_reg;
+ uint8_t i,j,c;
+ uint64_t(*s[])(uint64_t)={ bmw_large_s0, bmw_large_s1, bmw_large_s2,
+ bmw_large_s3, bmw_large_s4 };
+ for(i=0; i<16; ++i){
+ ((uint64_t*)h)[i] ^= ((uint64_t*)m)[i];
+ }
+ dump_x(h, 16, 'T');
+ memset(q, 0, 8*16);
+ c=4;
+ do{
+ i=15;
+ j=pgm_read_byte(offset_table+c);
+ hack_reg=pgm_read_word(&(hack_table[c]));
+ do{
+ if(hack_reg&1){
+ q[i]-= h[j&15];
+ }else{
+ q[i]+= h[j&15];
+ }
+ --j;
+ hack_reg>>= 1;
+ }while(i--!=0);
+ }while(c--!=0);
+ dump_x(q, 16, 'W');
+ for(i=0; i<16; ++i){
+ q[i] = s[i%5](q[i]);
+ }
+#if TWEAK
+ for(i=0; i<16; ++i){
+ ((uint64_t*)h)[i] ^= ((uint64_t*)m)[i];
+ }
+ for(i=0; i<16; ++i){
+ q[i] += h[(i+1)&0xf];
+ }
+#endif /* TWEAK */
+}
+#endif /* F0_HACK==2 */
+
+#if F0_HACK==1
+static
+const uint8_t f0_lut[] PROGMEM ={