1 /* FFdecsa -- fast decsa algorithm
3 * Copyright (C) 2007 Dark Avenger
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 inline static void FFTABLEIN(unsigned char *tab
, int g
, unsigned char *data
)
27 *(((int *)tab
)+2*g
)=*((int *)data
);
28 *(((int *)tab
)+2*g
+1)=*(((int *)data
)+1);
30 *(((long long *)tab
)+g
)=*((long long *)data
);
34 inline static void FFTABLEOUT(unsigned char *data
, unsigned char *tab
, int g
)
37 *((int *)data
)=*(((int *)tab
)+2*g
);
38 *(((int *)data
)+1)=*(((int *)tab
)+2*g
+1);
40 *((long long *)data
)=*(((long long *)tab
)+g
);
44 inline static void FFTABLEOUTXORNBY(int n
, unsigned char *data
, unsigned char *tab
, int g
)
47 for(j
=0;j
<n
;j
++) *(data
+j
)^=*(tab
+8*g
+j
);
51 inline static void XOREQ_BEST_BY(unsigned char *d
, unsigned char *s
)