Revision 597e3232 libavutil/aes.c

View differences:

libavutil/aes.c
99 99
    crypt(a, 2, sbox, enc_multbl);
100 100
}
101 101

  
102
static void init_multbl3(uint8_t tbl[4][256][4]){
103
    int i, j, k;
104
    for(k=1; k<4; k++)
105
        for(j=0; j<256; j++)
106
            for(i=0; i<4; i++)
107
                tbl[k][j][i]= tbl[k-1][j][(i-1)&3];
108
}
109

  
110 102
static void init_multbl2(uint8_t tbl[1024], int c[4], uint8_t *log8, uint8_t *alog8, uint8_t *sbox){
111
    int i;
103
    int i, j;
112 104
    for(i=0; i<1024; i++){
113 105
        int x= sbox[i/4];
114 106
        if(x) tbl[i]= alog8[ log8[x] + log8[c[i&3]] ];
115 107
    }
116 108
#ifndef CONFIG_SMALL
117
    init_multbl3(tbl);
109
    for(j=256; j<1024; j++)
110
        for(i=0; i<4; i++)
111
            tbl[4*j+i]= tbl[4*j + ((i-1)&3) - 1024];
118 112
#endif
119 113
}
120 114

  

Also available in: Unified diff