projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos/lisp: Get lambdakey and nucleo-32 building again
[fw/altos]
/
src
/
aes
/
ao_aes.c
diff --git
a/src/aes/ao_aes.c
b/src/aes/ao_aes.c
index 71ffadb19e658cccb72826d49aeddc1b51d25601..fd90c5bf3ee03fa0c3435db43e5a4d3fea043b31 100644
(file)
--- a/
src/aes/ao_aes.c
+++ b/
src/aes/ao_aes.c
@@
-310,6
+310,10
@@
void xrijndaelEncrypt(word32 block[], roundkey *rkk)
xKeyAddition(block, block2, rp, BC);
}
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)
{
static
void xrijndaelDecrypt(word32 block[], roundkey *rkk)
{
@@
-352,16
+356,18
@@
void xrijndaelDecrypt(word32 block[], roundkey *rkk)
xKeyAddition(block, block, rp, BC);
}
xKeyAddition(block, block, rp, BC);
}
+#endif
uint8_t ao_aes_mutex;
uint8_t ao_aes_mutex;
-static
uint8_t key[16
];
+static
word32 key[16/4
];
static roundkey rkk;
static roundkey rkk;
-static
uint8_t iv[16
];
+static
word32 iv[16/4
];
void
ao_aes_set_mode(enum ao_aes_mode mode)
{
void
ao_aes_set_mode(enum ao_aes_mode mode)
{
+ (void) mode;
/* we only do CBC_MAC anyways... */
}
/* we only do CBC_MAC anyways... */
}
@@
-383,10
+389,11
@@
ao_aes_run(__xdata uint8_t *in,
__xdata uint8_t *out)
{
uint8_t i;
__xdata uint8_t *out)
{
uint8_t i;
+ uint8_t *_iv = (uint8_t *) iv;
for (i = 0; i < 16; i++)
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);
}
if (out)
memcpy(out, iv, 16);
}