adjustment to chacha for big endian

This commit is contained in:
Jacob Barthelmeh 2015-04-03 12:19:40 -06:00
parent 523775fcd6
commit 10f853ae4d
2 changed files with 4 additions and 11 deletions

View File

@ -1201,12 +1201,6 @@ AC_ARG_ENABLE([chacha],
[ ENABLED_CHACHA=yes ]
)
# not ready for big endian yet
if test "x$ac_cv_c_bigendian" = "xyes"
then
ENABLED_CHACHA=no
fi
# lean psk does't need chacha
if test "$ENABLED_LEANPSK" = "yes"
then

View File

@ -48,7 +48,6 @@
#ifdef BIG_ENDIAN_ORDER
#define LITTLE32(x) ByteReverseWord32(x)
#error "CHACHA Not ready for Big Endian yet"
#else
#define LITTLE32(x) (x)
#endif
@ -164,10 +163,10 @@ int wc_Chacha_SetKey(ChaCha* ctx, const byte* key, word32 keySz)
ctx->X[ 9] = U8TO32_LITTLE(k + 4);
ctx->X[10] = U8TO32_LITTLE(k + 8);
ctx->X[11] = U8TO32_LITTLE(k + 12);
ctx->X[ 0] = U8TO32_LITTLE(constants + 0);
ctx->X[ 1] = U8TO32_LITTLE(constants + 1);
ctx->X[ 2] = U8TO32_LITTLE(constants + 2);
ctx->X[ 3] = U8TO32_LITTLE(constants + 3);
ctx->X[ 0] = constants[0];
ctx->X[ 1] = constants[1];
ctx->X[ 2] = constants[2];
ctx->X[ 3] = constants[3];
return 0;
}