X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Faes%2Fao_aes.c;h=0bc8188e3d2ae68c7eca2b78a214b473ce34b712;hb=2de8922b505f0358a36933721fbddf6a9ef7e9a4;hp=a04174c6ec12b1bf9eec44b796bc6e57112dcdab;hpb=5c9172ba5681ff93d63c9c263a453d0025170045;p=fw%2Faltos diff --git a/src/aes/ao_aes.c b/src/aes/ao_aes.c index a04174c6..0bc8188e 100644 --- a/src/aes/ao_aes.c +++ b/src/aes/ao_aes.c @@ -359,10 +359,10 @@ void xrijndaelDecrypt(word32 block[], roundkey *rkk) #endif uint8_t ao_aes_mutex; -static uint8_t key[16]; +static word32 key[16/4]; static roundkey rkk; -static uint8_t iv[16]; +static word32 iv[16/4]; void ao_aes_set_mode(enum ao_aes_mode mode) @@ -372,7 +372,7 @@ ao_aes_set_mode(enum ao_aes_mode mode) } void -ao_aes_set_key(__xdata uint8_t *in) +ao_aes_set_key(uint8_t *in) { memcpy(key, in, 16); xrijndaelKeySched((word32 *) key, 128, 128, &rkk); @@ -385,14 +385,15 @@ ao_aes_zero_iv(void) } void -ao_aes_run(__xdata uint8_t *in, - __xdata uint8_t *out) +ao_aes_run(uint8_t *in, + uint8_t *out) { uint8_t i; + uint8_t *_iv = (uint8_t *) iv; for (i = 0; i < 16; i++) - iv[i] ^= in[i]; - xrijndaelEncrypt((word32 *) iv, &rkk); + _iv[i] ^= in[i]; + xrijndaelEncrypt(iv, &rkk); if (out) memcpy(out, iv, 16); }