![]() |
A52HackTool 1.3.0
Turnkey & easy to use tool for cracking the GSM A5/2 cipher
|
00001 /*============================================================================* 00002 * * 00003 * const_A52.h * 00004 * * 00005 *============================================================================* 00006 * * 00007 * Part of A52HackTool * 00008 * * 00009 * Copyright © 2011 - Nicolas Paglieri & Olivier Benjamin * 00010 * All rights reserved. * 00011 * * 00012 * Contact Information: nicolas.paglieri [at] ensimag.fr * 00013 * olivier.benjamin [at] ensimag.fr * 00014 * * 00015 *============================================================================* 00016 * * 00017 * This file may be used under the terms of the GNU General Public License * 00018 * version 3 as published by the Free Software Foundation. * 00019 * See <http://www.gnu.org/licenses/> or GPL.txt included in the packaging of * 00020 * this file. * 00021 * * 00022 * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE * 00023 * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. * 00024 * * 00025 *============================================================================*/ 00026 00037 #ifndef _CONST_A52_H_ 00038 #define _CONST_A52_H_ 00039 00041 00042 #define R1_BITS 19 00043 #define R2_BITS 22 00044 #define R3_BITS 23 00045 #define R4_BITS 17 00046 #define REGS_BITS (R1_BITS+R2_BITS+R3_BITS+R4_BITS) 00047 00048 00049 00051 00052 #define R4_CLOCKTAP_R1 10 00053 #define R4_CLOCKTAP_R2 3 00054 #define R4_CLOCKTAP_R3 7 00055 00056 00057 00059 00060 #define R1_OUTTAP_1 12 00061 #define R1_OUTTAP_2 14 //!< Output Tap to be xored with 1 00062 #define R1_OUTTAP_3 15 00063 #define R2_OUTTAP_1 9 00064 #define R2_OUTTAP_2 13 00065 #define R2_OUTTAP_3 16 //!< Output Tap to be xored with 1 00066 #define R3_OUTTAP_1 13 //!< Output Tap to be xored with 1 00067 #define R3_OUTTAP_2 16 00068 #define R3_OUTTAP_3 18 00069 00070 00071 00073 00074 #define R1_SHIFTTAP_1 13 00075 #define R1_SHIFTTAP_2 16 00076 #define R1_SHIFTTAP_3 17 00077 #define R1_SHIFTTAP_4 18 00078 #define R2_SHIFTTAP_1 20 00079 #define R2_SHIFTTAP_2 21 00080 #define R3_SHIFTTAP_1 7 00081 #define R3_SHIFTTAP_2 20 00082 #define R3_SHIFTTAP_3 21 00083 #define R3_SHIFTTAP_4 22 00084 #define R4_SHIFTTAP_1 11 00085 #define R4_SHIFTTAP_2 16 00086 00087 00088 00090 00091 #define R1_INITIAL_CONST_POS 15 00092 #define R2_INITIAL_CONST_POS 16 00093 #define R3_INITIAL_CONST_POS 18 00094 #define R4_INITIAL_CONST_POS 10 00095 00096 00097 00099 #define SECRETKEY_BITS 64 00100 00101 #define FRAMEID_BITS 22 00102 00103 00105 00106 #define R1_SIMPLE_VARS (R1_BITS - 1) 00107 #define R2_SIMPLE_VARS (R2_BITS - 1) 00108 #define R3_SIMPLE_VARS (R3_BITS - 1) 00109 #define REGS_SIMPLE_VARS (R1_SIMPLE_VARS + R2_SIMPLE_VARS + R3_SIMPLE_VARS) 00110 00111 00112 00114 00115 #define R1_PROD_VARS ((R1_SIMPLE_VARS * (R1_SIMPLE_VARS-1)) / 2) 00116 #define R2_PROD_VARS ((R2_SIMPLE_VARS * (R2_SIMPLE_VARS-1)) / 2) 00117 #define R3_PROD_VARS ((R3_SIMPLE_VARS * (R3_SIMPLE_VARS-1)) / 2) 00118 #define REGS_PROD_VARS (R1_PROD_VARS + R2_PROD_VARS + R3_PROD_VARS) 00119 00120 00121 00123 #define REGS_TOTAL_VARS (REGS_SIMPLE_VARS + REGS_PROD_VARS + 1) // +1 for constant "1" 00124 00125 00126 00127 00128 00129 00131 #define TOTAL_MATRICES (1<<(R4_BITS-1)) 00132 00133 #define PROCESSING_THREADS (1<<5) 00134 00135 #define THREAD_CHUNKSIZE (TOTAL_MATRICES/PROCESSING_THREADS) 00136 00137 00139 #define RESOLUTION_MATRIX_INT_WIDTH ((REGS_TOTAL_VARS+31)/32) 00140 00141 00142 00143 #endif