gehe zum Quellcode dieser Datei
|
void | aes128_expandkey (void *expanded_key, const void *aes_key) |
|
void | aes128_encrypt_block (void *out_buffer, const void *inp_buffer, const unsigned char *expkey) |
|
void | aes128_decrypt_block (void *out_buffer, const void *inp_buffer, const unsigned char *expkey) |
|
void | aes128_cbc_encrypt (void *buffer, const unsigned char *expkey, const void *iv, int len) |
|
void | aes128_cbc_decrypt (void *buffer, const unsigned char *expkey, const void *iv, int len) |
|
void aes128_cbc_decrypt |
( |
void * |
buffer, |
|
|
const unsigned char * |
expkey, |
|
|
const void * |
iv, |
|
|
int |
len |
|
) |
| |
Definiert in Zeile 425 der Datei aes128.c.
436 for( i = 0; i < 4; i++ ) bufl[i] ^= xorl[i];
void aes128_cbc_encrypt |
( |
void * |
buffer, |
|
|
const unsigned char * |
expkey, |
|
|
const void * |
iv, |
|
|
int |
len |
|
) |
| |
Definiert in Zeile 409 der Datei aes128.c.
417 for( i = 0; i < 4; i++ ) bufl[i] ^= xorl[i];
void aes128_decrypt_block |
( |
void * |
out_buffer, |
|
|
const void * |
inp_buffer, |
|
|
const unsigned char * |
expkey |
|
) |
| |
Definiert in Zeile 387 der Datei aes128.c.
389 unsigned char *
out = (
unsigned char *)out_buffer;
390 unsigned char *
in = (
unsigned char *)inp_buffer;
391 unsigned char state[
Nb * 4];
394 memcpy (state, in,
sizeof(state));
399 for( round =
Nr; round--; )
406 memcpy (out, state,
sizeof(state));
void aes128_encrypt_block |
( |
void * |
out_buffer, |
|
|
const void * |
inp_buffer, |
|
|
const unsigned char * |
expkey |
|
) |
| |
Definiert in Zeile 365 der Datei aes128.c.
367 unsigned char *
out = (
unsigned char *)out_buffer;
368 unsigned char *
in = (
unsigned char *)inp_buffer;
369 unsigned char state[
Nb * 4];
375 for( round = 1; round <
Nr + 1; round++ ) {
384 memcpy (out, state,
sizeof(state));
void aes128_expandkey |
( |
void * |
expanded_key, |
|
|
const void * |
aes_key |
|
) |
| |
Definiert in Zeile 330 der Datei aes128.c.
332 unsigned char *expkey = (
unsigned char *)expanded_key;
333 unsigned char *
key = (
unsigned char *)aes_key;
334 unsigned char tmp0, tmp1,
tmp2, tmp3, tmp4;
339 for( idx =
Nk; idx <
Nb * (
Nr + 1); idx++ ) {
340 tmp0 = expkey[4*idx - 4];
341 tmp1 = expkey[4*idx - 3];
342 tmp2 = expkey[4*idx - 2];
343 tmp3 = expkey[4*idx - 1];
350 }
else if( Nk > 6 && idx % Nk == 4 ) {
357 expkey[4*idx+0] = expkey[4*idx - 4*Nk + 0] ^ tmp0;
358 expkey[4*idx+1] = expkey[4*idx - 4*Nk + 1] ^ tmp1;
359 expkey[4*idx+2] = expkey[4*idx - 4*Nk + 2] ^
tmp2;
360 expkey[4*idx+3] = expkey[4*idx - 4*Nk + 3] ^ tmp3;