X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=blobdiff_plain;f=src%2Faes%2Fao_aes.c;h=52463f5d3b2f202be30b49b19d35f7601b3518c5;hp=4977aaf81158408aff72e02ad5641a22de919f83;hb=44249a9262a16ed103aedf30a300003fc2a17579;hpb=b635cb26ba54c8f5c6a958e0ab0bc4d34d33b635 diff --git a/src/aes/ao_aes.c b/src/aes/ao_aes.c index 4977aaf8..52463f5d 100644 --- a/src/aes/ao_aes.c +++ b/src/aes/ao_aes.c @@ -11,7 +11,9 @@ * Vincent Rijmen */ +#ifndef AO_AES_TEST #include +#endif #include #include "ao_aes_int.h" @@ -193,6 +195,7 @@ static inline void xAddInvMix(word32 res[MAXBC], word32 a[MAXBC], #endif /* code included for reference */ +static int xrijndaelKeySched(word32 key[], int keyBits, int blockBits, roundkey *rkk) { @@ -280,6 +283,7 @@ int xrijndaelKeySched(word32 key[], int keyBits, int blockBits, /* Encryption of one block. */ +static void xrijndaelEncrypt(word32 block[], roundkey *rkk) { word32 block2[MAXBC]; /* hold intermediate result */ @@ -306,6 +310,11 @@ void xrijndaelEncrypt(word32 block[], roundkey *rkk) xKeyAddition(block, block2, rp, BC); } +#if NOTUSED +/* We don't actually need this in AltOS, so don't bother including it */ + +/* Decryption of one block. */ +static void xrijndaelDecrypt(word32 block[], roundkey *rkk) { word32 block2[MAXBC]; /* hold intermediate result */ @@ -347,8 +356,10 @@ void xrijndaelDecrypt(word32 block[], roundkey *rkk) xKeyAddition(block, block, rp, BC); } +#endif uint8_t ao_aes_mutex; +static uint8_t key[16]; static roundkey rkk; static uint8_t iv[16]; @@ -362,7 +373,8 @@ ao_aes_set_mode(enum ao_aes_mode mode) void ao_aes_set_key(__xdata uint8_t *in) { - xrijndaelKeySched((word32 *) in, 128, 128, &rkk); + memcpy(key, in, 16); + xrijndaelKeySched((word32 *) key, 128, 128, &rkk); } void