Ignore:
Timestamp:
Nov 14, 2010, 5:32:51 PM (11 years ago)
Author:
Sven Rech
Message:

KeySearcher OpenCL implementation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/AES/OpenCL/AESOpenCL.cl

    r2061 r2086  
    620620
    621621        rk[0] = GETU32(userKey     );
    622         rk[0] += $$ADDKEYBYTE0$$ | ($$ADDKEYBYTE1$$ << 8) | ($$ADDKEYBYTE2$$ << 16) |($$ADDKEYBYTE3$$ << 24);
     622        rk[0] += $$ADDKEYBYTE3$$ | ($$ADDKEYBYTE2$$ << 8) | ($$ADDKEYBYTE1$$ << 16) |($$ADDKEYBYTE0$$ << 24);
    623623        rk[1] = GETU32(userKey +  4);
    624         rk[1] += $$ADDKEYBYTE4$$ | ($$ADDKEYBYTE5$$ << 8) | ($$ADDKEYBYTE6$$ << 16) |($$ADDKEYBYTE7$$ << 24);
     624        rk[1] += $$ADDKEYBYTE7$$ | ($$ADDKEYBYTE6$$ << 8) | ($$ADDKEYBYTE5$$ << 16) |($$ADDKEYBYTE4$$ << 24);
    625625        rk[2] = GETU32(userKey +  8);
    626         rk[2] += $$ADDKEYBYTE8$$ | ($$ADDKEYBYTE9$$ << 8) | ($$ADDKEYBYTE10$$ << 16) |($$ADDKEYBYTE11$$ << 24);
     626        rk[2] += $$ADDKEYBYTE11$$ | ($$ADDKEYBYTE10$$ << 8) | ($$ADDKEYBYTE9$$ << 16) |($$ADDKEYBYTE8$$ << 24);
    627627        rk[3] = GETU32(userKey + 12);
    628         rk[3] += $$ADDKEYBYTE12$$ | ($$ADDKEYBYTE13$$ << 8) | ($$ADDKEYBYTE14$$ << 16) |($$ADDKEYBYTE15$$ << 24);
     628        rk[3] += $$ADDKEYBYTE15$$ | ($$ADDKEYBYTE14$$ << 8) | ($$ADDKEYBYTE13$$ << 16) |($$ADDKEYBYTE12$$ << 24);
    629629        if (bits == 128) {
    630630                while (1) {
     
    646646        }
    647647        rk[4] = GETU32(userKey + 16);
    648         rk[4] += $$ADDKEYBYTE16$$ | ($$ADDKEYBYTE17$$ << 8) | ($$ADDKEYBYTE18$$ << 16) |($$ADDKEYBYTE19$$ << 24);
     648        rk[4] += $$ADDKEYBYTE19$$ | ($$ADDKEYBYTE18$$ << 8) | ($$ADDKEYBYTE17$$ << 16) |($$ADDKEYBYTE16$$ << 24);
    649649        rk[5] = GETU32(userKey + 20);
    650         rk[5] += $$ADDKEYBYTE20$$ | ($$ADDKEYBYTE21$$ << 8) | ($$ADDKEYBYTE22$$ << 16) |($$ADDKEYBYTE23$$ << 24);
     650        rk[5] += $$ADDKEYBYTE23$$ | ($$ADDKEYBYTE22$$ << 8) | ($$ADDKEYBYTE21$$ << 16) |($$ADDKEYBYTE20$$ << 24);
    651651        if (bits == 192) {
    652652                while (1) {
     
    670670        }
    671671        rk[6] = GETU32(userKey + 24);
    672         rk[6] += $$ADDKEYBYTE24$$ | ($$ADDKEYBYTE25$$ << 8) | ($$ADDKEYBYTE26$$ << 16) |($$ADDKEYBYTE27$$ << 24);
     672        rk[6] += $$ADDKEYBYTE27$$ | ($$ADDKEYBYTE26$$ << 8) | ($$ADDKEYBYTE25$$ << 16) |($$ADDKEYBYTE24$$ << 24);
    673673        rk[7] = GETU32(userKey + 28);
    674         rk[7] += $$ADDKEYBYTE28$$ | ($$ADDKEYBYTE29$$ << 8) | ($$ADDKEYBYTE30$$ << 16) |($$ADDKEYBYTE31$$ << 24);
     674        rk[7] += $$ADDKEYBYTE31$$ | ($$ADDKEYBYTE30$$ << 8) | ($$ADDKEYBYTE29$$ << 16) |($$ADDKEYBYTE28$$ << 24);
    675675        if (bits == 256) {
    676676                while (1) {
     
    883883kernel void bruteforceKernel(global unsigned char *userKey, global float *results)
    884884{
    885         size_t x = get_global_id(1) * get_global_size(0) + get_global_id(0);   
     885        size_t x = get_global_id(0);
    886886       
    887887        AES_KEY key;   
     
    895895        $$AESDECRYPT$$
    896896       
    897 resultcalculation:
    898897        //calculate result here:
    899898        float result = 0.0f;
Note: See TracChangeset for help on using the changeset viewer.