* Vincent Rijmen
*/
+#ifndef AO_AES_TEST
#include <ao.h>
+#endif
#include <ao_aes.h>
#include "ao_aes_int.h"
#endif /* code included for reference */
+static
int xrijndaelKeySched(word32 key[], int keyBits, int blockBits,
roundkey *rkk)
{
/* Encryption of one block. */
+static
void xrijndaelEncrypt(word32 block[], roundkey *rkk)
{
word32 block2[MAXBC]; /* hold intermediate result */
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 */
xKeyAddition(block, block, rp, BC);
}
+#endif
uint8_t ao_aes_mutex;
+static uint8_t key[16];
static roundkey rkk;
static uint8_t iv[16];
void
ao_aes_set_mode(enum ao_aes_mode mode)
{
+ (void) mode;
/* we only do CBC_MAC anyways... */
}
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