Revision f25b650a libavutil/aes.c

View differences:

libavutil/aes.c
158 158
    memcpy(tk, key, KC*4);
159 159

  
160 160
    for(t= 0; t < (rounds+1)*4;) {
161
        if(decrypt) memcpy(a->round_key[0     ][ t], tk, KC*4);
162
        else        memcpy(a->round_key[rounds][-t], tk, KC*4);
163

  
161
        memcpy(a->round_key[0][t], tk, KC*4);
164 162
        t+= KC;
165 163

  
166 164
        for(i = 0; i < 4; i++)
......
181 179
                a->round_key[i][0][j]= sbox[a->round_key[i][0][j]];
182 180
            mix(a->round_key[i], dec_multbl);
183 181
        }
182
    }else{
183
        for(i=0; i<(rounds+1)/2; i++){
184
            for(j=0; j<16; j++)
185
                FFSWAP(int, a->round_key[i][0][j], a->round_key[rounds-i][0][j]);
186
        }
184 187
    }
185 188

  
186 189
    return a;

Also available in: Unified diff