| 1 | /* |
| 2 | * Based on John the Ripper and modified to integrate with aircrack |
| 3 | * |
| 4 | * John the Ripper copyright and license. |
| 5 | * |
| 6 | * John the Ripper password cracker, |
| 7 | * Copyright (c) 1996-2013 by Solar Designer. |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * As a special exception to the GNU General Public License terms, |
| 20 | * permission is hereby granted to link the code of this program, with or |
| 21 | * without modification, with any version of the OpenSSL library and/or any |
| 22 | * version of unRAR, and to distribute such linked combinations. You must |
| 23 | * obey the GNU GPL in all respects for all of the code used other than |
| 24 | * OpenSSL and unRAR. If you modify this program, you may extend this |
| 25 | * exception to your version of the program, but you are not obligated to |
| 26 | * do so. (In other words, you may release your derived work under pure |
| 27 | * GNU GPL version 2 or later as published by the FSF.) |
| 28 | * |
| 29 | * (This exception from the GNU GPL is not required for the core tree of |
| 30 | * John the Ripper, but arguably it is required for -jumbo.) |
| 31 | * |
| 32 | * Relaxed terms for certain components. |
| 33 | * |
| 34 | * In addition or alternatively to the license above, many components are |
| 35 | * available to you under more relaxed terms (most commonly under cut-down |
| 36 | * BSD license) as specified in the corresponding source files. |
| 37 | * |
| 38 | * For more information on John the Ripper licensing please visit: |
| 39 | * |
| 40 | * http://www.openwall.com/john/doc/LICENSE.shtml |
| 41 | * |
| 42 | * This software is Copyright (c) 2012 Lukas Odzioba <ukasz at openwall dot net> |
| 43 | * and it is hereby released to the general public under the following terms: |
| 44 | * Redistribution and use in source and binary forms, with or without |
| 45 | * modification, are permitted. |
| 46 | * |
| 47 | * Code is based on Aircrack-ng source |
| 48 | * |
| 49 | * SSE2 code enhancement, Jim Fougeron, Jan, 2013. |
| 50 | * Also removed oSSL code: HMAC(EVP_sha1(), ....), and coded what it does |
| 51 | * (which is simple), inline. |
| 52 | */ |
| 53 | |
| 54 | #ifdef HAVE_CONFIG_Hcxx . . $ `<built-in>:420:9`! |
| 55 | #include "config.h"cxx . . $ `<file>/config.h`/ |
| 56 | #endif |
| 57 | |
| 58 | #include <string.h> |
| 59 | #include <stdint.h> |
| 60 | |
| 61 | #include <aircrack-ng/crypto/crypto.h>cxx . . $ `<file>/include/aircrack-ng/crypto/crypto.h`/ |
| 62 | #include "aircrack-ng/ce-wpa/simd-intrinsics.h"cxx . . $ `<file>/include/aircrack-ng/ce-wpa/simd-intrinsics.h`/ |
| 63 | #include "aircrack-ng/aircrack-ng.h"cxx . . $ `<file>/include/aircrack-ng/aircrack-ng.h`/ |
| 64 | #include "aircrack-ng/ce-wpa/arch.h"cxx . . $ `<file>/include/aircrack-ng/ce-wpa/arch.h`/ |
| 65 | #include "aircrack-ng/ce-wpa/wpapsk.h"cxx . . $ `<file>/include/aircrack-ng/ce-wpa/wpapsk.h`/ |
| 66 | #include "aircrack-ng/ce-wpa/johnswap.h"cxx . . $ `<file>/include/aircrack-ng/ce-wpa/johnswap.h`/ |
| 67 | #include "aircrack-ng/ce-wpa/memory.h"cxx . . $ `<file>/include/aircrack-ng/ce-wpa/memory.h`/ |
| 68 | #include "aircrack-ng/cpu/simd_cpuid.h"cxx . . $ `<file>/include/aircrack-ng/cpu/simd_cpuid.h`/ |
| 69 | |
| 70 | // #define XDEBUG |
| 71 | |
| 72 | #if defined(__INTEL_COMPILER) |
| 73 | #define SIMD_PARA_SHA1 1 |
| 74 | #elif defined(__clang__cxx . . $ `<built-in>:3:9`!) |
| 75 | #define SIMD_PARA_SHA1cxx . . $ `lib/ce-wpa/wpapsk.c:75:9`! 1 |
| 76 | #elif defined(__llvm__) |
| 77 | #define SIMD_PARA_SHA1 1 |
| 78 | #elif defined(__GNUC__) && GCC_VERSION < 40504 // 4.5.4 |
| 79 | #define SIMD_PARA_SHA1 1 |
| 80 | #elif !defined(__AVX__) && defined(__GNUC__) && GCC_VERSION > 40700 // 4.7.0 |
| 81 | #define SIMD_PARA_SHA1 1 |
| 82 | #else |
| 83 | #define SIMD_PARA_SHA1 1 |
| 84 | #endif |
| 85 | |
| 86 | #ifdef SIMD_COREcxx . . $ `<built-in>:421:9`! |
| 87 | #ifdef SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`! |
| 88 | #define NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! (SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`! * SIMD_PARA_SHA1cxx . . $ `lib/ce-wpa/wpapsk.c:75:9`!) |
| 89 | #ifdef _OPENMP |
| 90 | #include <omp.h> |
| 91 | #endif |
| 92 | #else |
| 93 | #define NBKEYS 1 |
| 94 | #ifdef _OPENMP |
| 95 | #include <omp.h> |
| 96 | #endif |
| 97 | #endif |
| 98 | #else |
| 99 | #ifdef MMX_COEFcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:427:9`! |
| 100 | #define NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:100:9`! (MMX_COEF * SHA1_SSE_PARA) |
| 101 | #ifdef _OPENMP |
| 102 | #include <omp.h> |
| 103 | #endif |
| 104 | #else |
| 105 | #define NBKEYS 1 |
| 106 | #ifdef _OPENMP |
| 107 | #include <omp.h> |
| 108 | #endif |
| 109 | #endif |
| 110 | #endif |
| 111 | |
| 112 | static char itoa64cxx . . $ itoa64.[64] |
| 113 | = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; |
| 114 | char atoi64cxx . . $ atoi64.[0x100]; |
| 115 | |
| 116 | /* for endianity conversion */ |
| 117 | #ifdef SIMD_COREcxx . . $ `<built-in>:412:9`! |
| 118 | #define GETPOScxx . . $ `lib/ce-wpa/wpapsk.c:118:9`!(i, index) \ |
| 119 | ((index & (SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`! - 1)) * 4 \ |
| 120 | + ((i) & (0xffffffff - 3)) * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`! \ |
| 121 | + (3 - ((i) &3)) \ |
| 122 | + (unsigned int) index / SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`! * SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`! * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`! * 4) |
| 123 | #endif |
| 124 | |
| 125 | #define BUF_BASE_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:125:9`!(co, width, index) \ |
| 126 | (((index) / (co)) * (co) * (width) + ((index) & ((co) -1))) |
| 127 | #define BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(co, width, index, offset) \ |
| 128 | (BUF_BASE_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:125:9`!((co), (width), (index)) + (offset) * (co)) |
| 129 | #define SSE_HASH1_PTR_OFcxx . . $ `lib/ce-wpa/wpapsk.c:129:9`!(j) \ |
| 130 | &((uint32_t *) \ |
| 131 | t_sse_hash1)[((((j) / SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!) * SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!) * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!) \ |
| 132 | + ((j) & (SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`! - 1))] |
| 133 | |
| 134 | #ifdef SIMD_COREcxx . . $ `<built-in>:420:9`! |
| 135 | static MAYBE_INLINEcxx . . $ `include/aircrack-ng/ce-wpa/jcommon.h:81:9`! void wpapsk_ssecxx . . $ wpapsk_sse(fe6543d9b3d81361).(ac_crypto_engine_tcxx . . $ ac_crypto_engine_t# * engine, |
| 136 | int threadid, |
| 137 | int count, |
| 138 | const wpapsk_passwordcxx . . $ wpapsk_password# * in) |
| 139 | { |
| 140 | int t; // thread count |
| 141 | int salt_length = engine->essid_lengthcxx . . $ ac_crypto_engine#essid_length.; |
| 142 | int slen = salt_length + 4; |
| 143 | int loops = (count + NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! - 1) / NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; |
| 144 | |
| 145 | unsigned char * sse_hash1 = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 146 | unsigned char * sse_crypt1 = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 147 | unsigned char * sse_crypt2 = NULLcxx . . $ `/usr/lib/gcc/x86_64-linux-gnu/15/include/stddef.h:419:9`!; |
| 148 | unsigned char essid[ESSID_LENGTHcxx . . $ `include/aircrack-ng/ce-wpa/crypto_engine.h:63:9`! + 4]; |
| 149 | |
| 150 | sse_hash1 = engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->hash1cxx . . $ ac_crypto_engine_perthread#hash1.; |
| 151 | sse_crypt1 = engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->crypt1cxx . . $ ac_crypto_engine_perthread#crypt1.; |
| 152 | sse_crypt2 = engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->crypt2cxx . . $ ac_crypto_engine_perthread#crypt2.; |
| 153 | |
| 154 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(essid, 0, sizeof(essid)); |
| 155 | strncpycxx . . $ strncpy(255158a415b673b0).((char *) essid, |
| 156 | (const char *) engine->essidcxx . . $ ac_crypto_engine#essid., |
| 157 | (size_t) engine->essid_lengthcxx . . $ ac_crypto_engine#essid_length.); |
| 158 | |
| 159 | for (t = 0; t < loops; t++) |
| 160 | { |
| 161 | unsigned int i, k, j; |
| 162 | unioncxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0# { |
| 163 | unsigned char ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#c.[64]; |
| 164 | uint32_tcxx . . $ uint32_t# icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#i.[16]; |
| 165 | } buffer[NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!]; |
| 166 | char __dummy[CACHELINE_SIZEcxx . . $ `./config.h:8:9`!]; |
| 167 | unioncxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1# { |
| 168 | unsigned char ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c.[40]; // only 40 are used |
| 169 | uint32_tcxx . . $ uint32_t# icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[10]; // only 8 are used |
| 170 | } outbuf[NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!]; |
| 171 | char __dummy2[CACHELINE_SIZEcxx . . $ `./config.h:8:9`!]; |
| 172 | wpapsk_SHA1_CTXcxx . . $ blk_SHA_CTX# ctx_ipad[NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!]; |
| 173 | char __dummy3[CACHELINE_SIZEcxx . . $ `./config.h:8:9`!]; |
| 174 | wpapsk_SHA1_CTXcxx . . $ `include/aircrack-ng/crypto/sha1.h:50:9`! ctx_opad[NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!]; |
| 175 | char __dummy4[CACHELINE_SIZEcxx . . $ `./config.h:8:9`!]; |
| 176 | wpapsk_SHA1_CTXcxx . . $ blk_SHA_CTX# sha1_ctx; |
| 177 | unsigned int *i1, *i2, *o1; |
| 178 | unsigned char *t_sse_crypt1, *t_sse_crypt2, *t_sse_hash1; |
| 179 | |
| 180 | // All pointers get their offset for this thread here. No further |
| 181 | // offsetting below. |
| 182 | t_sse_crypt1 = &sse_crypt1[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! * DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!]; |
| 183 | t_sse_crypt2 = &sse_crypt2[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! * DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!]; |
| 184 | t_sse_hash1 = &sse_hash1[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! * SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`! * 4]; |
| 185 | i1 = (unsigned int *) t_sse_crypt1; |
| 186 | i2 = (unsigned int *) t_sse_crypt2; |
| 187 | o1 = (unsigned int *) t_sse_hash1; |
| 188 | (void) __dummy; |
| 189 | (void) __dummy2; |
| 190 | (void) __dummy3; |
| 191 | (void) __dummy4; |
| 192 | |
| 193 | for (j = 0; j < NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; ++j) |
| 194 | { |
| 195 | memcpycxx . . $ memcpy(cc817cb175f282d).( |
| 196 | buffer[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#c., in[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! + j].vcxx . . $ $anonymous_type_52ac32f0646012be_0#v., in[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! + j].lengthcxx . . $ $anonymous_type_52ac32f0646012be_0#length.); |
| 197 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(&buffer[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#c.[in[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! + j].lengthcxx . . $ $anonymous_type_52ac32f0646012be_0#length.], |
| 198 | 0, |
| 199 | 64 - in[t * NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`! + j].lengthcxx . . $ $anonymous_type_52ac32f0646012be_0#length.); |
| 200 | wpapsk_SHA1_Initcxx . . $ `include/aircrack-ng/crypto/sha1.h:51:9`!(&ctx_ipad[j]); |
| 201 | wpapsk_SHA1_Initcxx . . $ `include/aircrack-ng/crypto/sha1.h:51:9`!(&ctx_opad[j]); |
| 202 | |
| 203 | for (i = 0; i < 16; i++) buffer[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#i.[i] ^= 0x36363636; |
| 204 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&ctx_ipad[j], buffer[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#c., 64); |
| 205 | |
| 206 | for (i = 0; i < 16; i++) buffer[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#i.[i] ^= 0x6a6a6a6a; |
| 207 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&ctx_opad[j], buffer[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_0#c., 64); |
| 208 | |
| 209 | i1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, 5, j, 0)] = ctx_ipad[j].h0cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h0.; |
| 210 | i1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 1)] = ctx_ipad[j].h1cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h1.; |
| 211 | i1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, 5, j, 2)] = ctx_ipad[j].h2cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h2.; |
| 212 | i1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 3)] = ctx_ipad[j].h3cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h3.; |
| 213 | i1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 4)] = ctx_ipad[j].h4cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h4.; |
| 214 | |
| 215 | i2[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, 5, j, 0)] = ctx_opad[j].h0cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h0.; |
| 216 | i2[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 1)] = ctx_opad[j].h1cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h1.; |
| 217 | i2[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 2)] = ctx_opad[j].h2cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h2.; |
| 218 | i2[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 3)] = ctx_opad[j].h3cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h3.; |
| 219 | i2[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, 5, j, 4)] = ctx_opad[j].h4cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h4.; |
| 220 | |
| 221 | essid[slen - 1] = 1; |
| 222 | // This code does the HMAC(EVP_....) call. We already |
| 223 | // have essid appended with BE((int)1) so we simply |
| 224 | // call a single SHA1_Update |
| 225 | wpapsk_SHA1_Clonecxx . . $ `include/aircrack-ng/crypto/sha1.h:54:9`!(&sha1_ctx, &ctx_ipad[j]); |
| 226 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&sha1_ctx, essid, slen); |
| 227 | wpapsk_SHA1_Finalcxx . . $ `include/aircrack-ng/crypto/sha1.h:53:9`!(outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c., &sha1_ctx); |
| 228 | |
| 229 | wpapsk_SHA1_Clonecxx . . $ `include/aircrack-ng/crypto/sha1.h:54:9`!(&sha1_ctx, &ctx_opad[j]); |
| 230 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&sha1_ctx, outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c., DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!); |
| 231 | wpapsk_SHA1_Finalcxx . . $ `include/aircrack-ng/crypto/sha1.h:53:9`!(outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c., &sha1_ctx); |
| 232 | |
| 233 | // now convert this from flat into COEF buffers. Also, |
| 234 | // perform the 'first' ^= into the crypt buffer. We |
| 235 | // are doing that in BE format so we will need to |
| 236 | // 'undo' that in the end. |
| 237 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 0)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[0] |
| 238 | = sha1_ctx.h0cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h0.; |
| 239 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 1)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[1] |
| 240 | = sha1_ctx.h1cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h1.; |
| 241 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 2)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[2] |
| 242 | = sha1_ctx.h2cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h2.; |
| 243 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 3)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[3] |
| 244 | = sha1_ctx.h3cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h3.; |
| 245 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 4)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[4] |
| 246 | = sha1_ctx.h4cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h4.; |
| 247 | } |
| 248 | |
| 249 | for (i = 1; i < 4096; i++) |
| 250 | { |
| 251 | SIMDSHA1bodycxx . . $ SIMDSHA1body(7b9b6b671f70ddd3).((unsigned int *) t_sse_hash1, |
| 252 | (unsigned int *) t_sse_hash1, |
| 253 | (unsigned int *) t_sse_crypt1, |
| 254 | SSEi_MIXED_INcxx . . $ SSEi_MIXED_IN. | SSEi_RELOADcxx . . $ SSEi_RELOAD. | SSEi_OUTPUT_AS_INP_FMTcxx . . $ SSEi_OUTPUT_AS_INP_FMT.); |
| 255 | SIMDSHA1bodycxx . . $ SIMDSHA1body(7b9b6b671f70ddd3).((unsigned int *) t_sse_hash1, |
| 256 | (unsigned int *) t_sse_hash1, |
| 257 | (unsigned int *) t_sse_crypt2, |
| 258 | SSEi_MIXED_INcxx . . $ SSEi_MIXED_IN. | SSEi_RELOADcxx . . $ SSEi_RELOAD. | SSEi_OUTPUT_AS_INP_FMTcxx . . $ SSEi_OUTPUT_AS_INP_FMT.); |
| 259 | |
| 260 | for (j = 0; j < NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; j++) |
| 261 | { |
| 262 | uint32_tcxx . . $ uint32_t# * p = SSE_HASH1_PTR_OFcxx . . $ uint32_t#(j); |
| 263 | for (k = 0; k < 5; k++) outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[k] ^= p[(k * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!)]; |
| 264 | } |
| 265 | } |
| 266 | |
| 267 | essid[slen - 1] = 2; |
| 268 | for (j = 0; j < NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; ++j) |
| 269 | { |
| 270 | // This code does the HMAC(EVP_....) call. We already |
| 271 | // have essid appended with BE((int)1) so we simply |
| 272 | // call a single SHA1_Update |
| 273 | wpapsk_SHA1_Clonecxx . . $ blk_SHA_CTX#(&sha1_ctx, &ctx_ipad[j]); |
| 274 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&sha1_ctx, essid, slen); |
| 275 | wpapsk_SHA1_Finalcxx . . $ `include/aircrack-ng/crypto/sha1.h:53:9`!(&outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c.[DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!], &sha1_ctx); |
| 276 | |
| 277 | wpapsk_SHA1_Clonecxx . . $ `include/aircrack-ng/crypto/sha1.h:54:9`!(&sha1_ctx, &ctx_opad[j]); |
| 278 | wpapsk_SHA1_Updatecxx . . $ `include/aircrack-ng/crypto/sha1.h:52:9`!(&sha1_ctx, |
| 279 | &outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c.[DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!], |
| 280 | DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!); |
| 281 | wpapsk_SHA1_Finalcxx . . $ `include/aircrack-ng/crypto/sha1.h:53:9`!(&outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c.[DIGEST_SHA1_MAC_LENcxx . . $ `include/aircrack-ng/crypto/sha1.h:72:9`!], &sha1_ctx); |
| 282 | |
| 283 | // now convert this from flat into COEF buffers. Also, |
| 284 | // perform the 'first' ^= into the crypt buffer. We |
| 285 | // are doing that in BE format so we will need to |
| 286 | // 'undo' that in the end. (only 3 dwords of the 2nd |
| 287 | // block outbuf are worked with). |
| 288 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 0)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[5] |
| 289 | = sha1_ctx.h0cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h0.; |
| 290 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 1)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[6] |
| 291 | = sha1_ctx.h1cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h1.; |
| 292 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 2)] = outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[7] |
| 293 | = sha1_ctx.h2cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h2.; |
| 294 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 3)] = sha1_ctx.h3cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h3.; |
| 295 | o1[BUF_OFFSET_OFcxx . . $ `lib/ce-wpa/wpapsk.c:127:9`!(SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!, SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`!, j, 4)] = sha1_ctx.h4cxx . . $ $anonymous_type_cf3135df9ea69b52_0#h4.; |
| 296 | } |
| 297 | for (i = 1; i < 4096; i++) |
| 298 | { |
| 299 | SIMDSHA1bodycxx . . $ SIMDSHA1body(7b9b6b671f70ddd3).((unsigned int *) t_sse_hash1, |
| 300 | (unsigned int *) t_sse_hash1, |
| 301 | (unsigned int *) t_sse_crypt1, |
| 302 | SSEi_MIXED_INcxx . . $ SSEi_MIXED_IN. | SSEi_RELOADcxx . . $ SSEi_RELOAD. | SSEi_OUTPUT_AS_INP_FMTcxx . . $ SSEi_OUTPUT_AS_INP_FMT.); |
| 303 | SIMDSHA1bodycxx . . $ SIMDSHA1body(7b9b6b671f70ddd3).((unsigned int *) t_sse_hash1, |
| 304 | (unsigned int *) t_sse_hash1, |
| 305 | (unsigned int *) t_sse_crypt2, |
| 306 | SSEi_MIXED_INcxx . . $ SSEi_MIXED_IN. | SSEi_RELOADcxx . . $ SSEi_RELOAD. | SSEi_OUTPUT_AS_INP_FMTcxx . . $ SSEi_OUTPUT_AS_INP_FMT.); |
| 307 | for (j = 0; j < NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; j++) |
| 308 | { |
| 309 | uint32_tcxx . . $ uint32_t# * p = SSE_HASH1_PTR_OFcxx . . $ `lib/ce-wpa/wpapsk.c:129:9`!(j); |
| 310 | for (k = 5; k < 8; k++) |
| 311 | outbuf[j].icxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#i.[k] ^= p[((k - 5) * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`!)]; |
| 312 | } |
| 313 | } |
| 314 | |
| 315 | for (j = 0; j < NBKEYScxx . . $ `lib/ce-wpa/wpapsk.c:88:9`!; ++j) |
| 316 | { |
| 317 | memcpycxx . . $ memcpy(cc817cb175f282d).(&engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->pmkcxx . . $ ac_crypto_engine_perthread#pmk.[j], //-V512 |
| 318 | outbuf[j].ccxx . . $ wpapsk_sse(fe6543d9b3d81361).$anonymous_type_1#c., |
| 319 | 32); |
| 320 | alter_endianity_to_BEcxx . . $ __bswap_32(2141b656ce2cc063).((&engine->thread_data[threadid]->pmk[j]), 8); |
| 321 | } |
| 322 | } |
| 323 | |
| 324 | return; |
| 325 | } |
| 326 | #endif |
| 327 | |
| 328 | void init_atoicxx . . $ init_atoi(49f6e7a06ebc5aa8).(void) |
| 329 | { |
| 330 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(atoi64cxx . . $ atoi64., 0x7F, sizeof(atoi64cxx . . $ atoi64.)); |
| 331 | for (char const * pos = itoa64cxx . . $ itoa64.; pos != &itoa64cxx . . $ itoa64.[63]; pos++) |
| 332 | atoi64cxx . . $ atoi64.[ARCH_INDEXcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:119:9`!(*pos)] = pos - itoa64cxx . . $ itoa64.; |
| 333 | } |
| 334 | |
| 335 | #ifdef SIMD_COREcxx . . $ `<built-in>:412:9`! |
| 336 | //#define XDEBUG 1 |
| 337 | //#define ODEBUG 1 |
| 338 | int init_wpapskcxx . . $ init_wpapsk(cb83f2ff776551c4).(ac_crypto_engine_tcxx . . $ ac_crypto_engine_t# * engine, |
| 339 | const wpapsk_passwordcxx . . $ wpapsk_password# key[MAX_KEYS_PER_CRYPT_SUPPORTEDcxx . . $ `include/aircrack-ng/ce-wpa/crypto_engine.h:87:9`!], |
| 340 | int nparallel, |
| 341 | int threadid) |
| 342 | { |
| 343 | int i = 0; |
| 344 | int count = 0; |
| 345 | |
| 346 | // clear entire output table |
| 347 | memsetcxx . . $ memset(d1de1e4fb215f1c6).(engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->pmkcxx . . $ ac_crypto_engine_perthread#pmk., |
| 348 | 0, |
| 349 | (sizeof(wpapsk_hashcxx . . $ wpapsk_hash#) * (nparallel))); |
| 350 | |
| 351 | { |
| 352 | unsigned char * sse_hash1 = engine->thread_datacxx . . $ ac_crypto_engine#thread_data.[threadid]->hash1cxx . . $ ac_crypto_engine_perthread#hash1.; |
| 353 | |
| 354 | int index; |
| 355 | for (index = 0; index < nparallel; ++index) |
| 356 | { |
| 357 | // set the length of all hash1 SSE buffer to |
| 358 | // 64+20 * 8 bits. The 64 is for the ipad/opad, |
| 359 | // the 20 is for the length of the SHA1 buffer that |
| 360 | // also gets into each crypt. Works for SSE2i and SSE2 |
| 361 | ((unsigned int *) |
| 362 | sse_hash1)[15 * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`! + (index & (SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:68:9`! - 1)) |
| 363 | + (unsigned int) index / SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`! * SHA_BUF_SIZcxx . . $ `include/aircrack-ng/ce-wpa/arch.h:421:9`! |
| 364 | * SIMD_COEF_32cxx . . $ `include/aircrack-ng/ce-wpa/memory.h:71:9`!] |
| 365 | = (84 << 3); // all encrypts are 64+20 bytes. |
| 366 | sse_hash1[GETPOScxx . . $ `lib/ce-wpa/wpapsk.c:118:9`!(20, index)] = 0x80; |
| 367 | } |
| 368 | } |
| 369 | |
| 370 | for (i = 0; i < nparallel; ++i) |
| 371 | { |
| 372 | char * tkey = (char *) key[i].vcxx . . $ $anonymous_type_52ac32f0646012be_0#v.; |
| 373 | |
| 374 | if (*tkey != 0) |
| 375 | { |
| 376 | // set_key(tkey, i, inbuffer); |
| 377 | #ifdef XDEBUG |
| 378 | printf( |
| 379 | "key%d (inbuffer) = (%p) %s VALID\n", i + 1, tkey, key[i].v); |
| 380 | #endif |
| 381 | count = i + 1; |
| 382 | } |
| 383 | } |
| 384 | |
| 385 | wpapsk_ssecxx . . $ wpapsk_sse(fe6543d9b3d81361).(engine, threadid, count, key); |
| 386 | |
| 387 | return 0; |
| 388 | } |
| 389 | #endif |