compiler: introduce ALIGNED macro
[bertos.git] / bertos / sec / cipher / blowfish_test.c
index 0a041e62a2c4916dba4c07097c4b4f3e98e10e14..2e0ba1e53d17cf15c63d4f24793b4214d27bd260 100644 (file)
@@ -37,6 +37,7 @@
 
 #include "blowfish.h"
 #include <cpu/byteorder.h>
+#include <string.h>
 
 /*
  *  Author     :  Randy L. Milbert
@@ -166,9 +167,11 @@ int blowfish_testTearDown(void)
 
 int blowfish_testRun(void)
 {
+       // NOTE: we use a static variable here to avoid stack overflows due to the huge
+       // context structure of blowfish.
        static BlowfishContext ctx;
        blowfish_init(&ctx);
-       BlockCipher *c = &ctx.c; //blowfish_stackinit();
+       BlockCipher *c = &ctx.c;
 
        for (int i=0; i<NUM_VARIABLE_KEY_TESTS; ++i)
        {