diff options
author | Olivier Bertrand <bertrandop@gmail.com> | 2014-08-07 19:12:45 +0200 |
---|---|---|
committer | Olivier Bertrand <bertrandop@gmail.com> | 2014-08-07 19:12:45 +0200 |
commit | f835588cc2e32da97269cc58e97ee77b5927498a (patch) | |
tree | 8e5c53593e7e3a9db0892afefb118fd0d581e23a /extra/yassl/taocrypt/src/rabbit.cpp | |
parent | 0219ac1e98cc53250a8e165c4b37e83529932256 (diff) | |
parent | b81b6d3f836feb682b963c9489f00ca1ee6a6a95 (diff) | |
download | mariadb-git-f835588cc2e32da97269cc58e97ee77b5927498a.tar.gz |
- Commiting merge files
Diffstat (limited to 'extra/yassl/taocrypt/src/rabbit.cpp')
-rw-r--r-- | extra/yassl/taocrypt/src/rabbit.cpp | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/extra/yassl/taocrypt/src/rabbit.cpp b/extra/yassl/taocrypt/src/rabbit.cpp index 071a25191f8..89e6a207a1b 100644 --- a/extra/yassl/taocrypt/src/rabbit.cpp +++ b/extra/yassl/taocrypt/src/rabbit.cpp @@ -198,7 +198,6 @@ void Rabbit::Process(byte* output, const byte* input, word32 msglen) { /* Temporary variables */ word32 i; - byte buffer[16]; /* Encrypt/decrypt all full blocks */ while (msglen >= 16) { @@ -227,17 +226,23 @@ void Rabbit::Process(byte* output, const byte* input, word32 msglen) /* Encrypt/decrypt remaining data */ if (msglen) { + + word32 tmp[4]; + byte* buffer = (byte*)tmp; + + memset(tmp, 0, sizeof(tmp)); /* help static analysis */ + /* Iterate the system */ NextState(Work); /* Generate 16 bytes of pseudo-random data */ - *(word32*)(buffer+ 0) = LITTLE32(workCtx_.x[0] ^ + tmp[0] = LITTLE32(workCtx_.x[0] ^ (workCtx_.x[5]>>16) ^ U32V(workCtx_.x[3]<<16)); - *(word32*)(buffer+ 4) = LITTLE32(workCtx_.x[2] ^ + tmp[1] = LITTLE32(workCtx_.x[2] ^ (workCtx_.x[7]>>16) ^ U32V(workCtx_.x[5]<<16)); - *(word32*)(buffer+ 8) = LITTLE32(workCtx_.x[4] ^ + tmp[2] = LITTLE32(workCtx_.x[4] ^ (workCtx_.x[1]>>16) ^ U32V(workCtx_.x[7]<<16)); - *(word32*)(buffer+12) = LITTLE32(workCtx_.x[6] ^ + tmp[3] = LITTLE32(workCtx_.x[6] ^ (workCtx_.x[3]>>16) ^ U32V(workCtx_.x[1]<<16)); /* Encrypt/decrypt the data */ |