30 #if ((WORD_SIZE == 16) || (WORD_SIZE == 32) || (WORD_SIZE == 64))
33 #if (RC5_FILTER_GOUP_LINEAR == 0)
34 #define RC5_GOUP_LEVEL 4//7//4//5//11//4//11//4//11//11//4//2//11//6//11//15//11//6//11//8//16//11//7
35 #endif // #if (RC5_FILTER_GOUP_LINEAR == 0)
36 #if (RC5_FILTER_GOUP_LINEAR == 1)
37 #define RC5_GOUP_LEVEL 8
38 #endif // #if (RC5_FILTER_GOUP_LINEAR == 0)
39 #else // #if (WORD_SIZE == 64)
40 #define RC5_GOUP_LEVEL 11//4//11//4//11//11//4//2//11//6//11//15//11//6//11//8//16//11//7
41 #endif // #if (WORD_SIZE <= 32)
42 #define RC5_FIB_LEN (RC5_GOUP_LEVEL + 1)//((2*NROUNDS) + 2)
43 #define RC5_FULL_FIB_LEN RC5_MAX_NHALF_ROUNDS//((2*RC5_MAX_NROUNDS) + 2)//((2*NROUNDS) + 2)
53 #define RC5_GOUP_EXPAND_ADD_DEPTH ((RC5_FIB_LEN - 2) - 1)//((RC5_FIB_LEN - 2) - 0)//((RC5_FIB_LEN - 2) - (RC5_FIB_LEN - 2) + 1)//((RC5_FIB_LEN - 2) - (RC5_FIB_LEN - 2))//((RC5_FIB_LEN - 2) - 0) // up to what level to exapnd the mod ADDs (small val = comput. expensive)
54 #if (RC5_FIB_LEN == ((2*NROUNDS) + 2))
55 #define RC5_FULL_FIB 1
57 #define RC5_FULL_FIB 0
58 #endif // #if (RC5_FIB_LEN == ((2*NROUNDS) + 2))
60 extern uint32_t FIB[RC5_FULL_FIB_LEN];
65 extern WORD_T g_D[RC5_FIB_LEN + 1];
66 extern WORD_T g_S[RC5_FIB_LEN + 1];
67 extern uint32_t g_count;
68 extern std::vector<rc5_goup_diffs_t> g_goup_diff_vec;
69 extern std::vector<std::vector<rc5_goup_diffs_t>> g_goup_diff_vec_2d;
72 #define NCOR 20 // Max number of corrections
73 #define LGW 5 // log2(WORD_SIZE)
74 #define NHALF_ROUNDS 14 // number of half-rounds: NHALF_ROUNDS = 2 * NROUNDS
75 #define BND (WORD_SIZE - LGW) // Hamming weight boundary
77 uint32_t rc5_filter_go_up(uint32_t depth);
78 uint32_t rc5_filter_go_up_debug(uint32_t depth);
79 void rc5_filter_go_up_debug_main();
80 bool rc5_filter_last_round(WORD_T L[2], WORD_T R[2]);
83 #endif // #if ((WORD_SIZE == 16) || (WORD_SIZE == 32) || (WORD_SIZE == 64))
84 #endif // #ifndef RC5_ALEX_H