diff options
Diffstat (limited to 'extra/yassl/taocrypt')
-rw-r--r-- | extra/yassl/taocrypt/include/misc.hpp | 9 | ||||
-rw-r--r-- | extra/yassl/taocrypt/include/modes.hpp | 5 |
2 files changed, 8 insertions, 6 deletions
diff --git a/extra/yassl/taocrypt/include/misc.hpp b/extra/yassl/taocrypt/include/misc.hpp index cb4d26e70c6..159b63c89d7 100644 --- a/extra/yassl/taocrypt/include/misc.hpp +++ b/extra/yassl/taocrypt/include/misc.hpp @@ -1,5 +1,6 @@ /* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -599,8 +600,8 @@ inline word16 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block, word16*) { return (order == BigEndianOrder) - ? block[1] | (block[0] << 8) - : block[0] | (block[1] << 8); + ? word16(block[1] | (word16(block[0]) << 8)) + : word16(block[0] | (word16(block[1]) << 8)); } inline word32 UnalignedGetWordNonTemplate(ByteOrder order, const byte* block, @@ -625,7 +626,7 @@ inline void UnalignedPutWord(ByteOrder order, byte *block, byte value, block[0] = xorBlock ? (value ^ xorBlock[0]) : value; } -#define GETBYTE(x, y) (unsigned int)byte((x)>>(8*(y))) +#define GETBYTE(x, y) byte((x)>>(8*(y))) inline void UnalignedPutWord(ByteOrder order, byte *block, word16 value, const byte *xorBlock = 0) @@ -827,7 +828,7 @@ word ShiftWordsLeftByBits(word* r, unsigned int n, unsigned int shiftBits) inline -word ShiftWordsRightByBits(word* r, unsigned int n, unsigned int shiftBits) +word ShiftWordsRightByBits(word* r, int n, unsigned int shiftBits) { word u, carry=0; if (shiftBits) diff --git a/extra/yassl/taocrypt/include/modes.hpp b/extra/yassl/taocrypt/include/modes.hpp index bfe8c6ec5d4..f65bc217947 100644 --- a/extra/yassl/taocrypt/include/modes.hpp +++ b/extra/yassl/taocrypt/include/modes.hpp @@ -1,5 +1,6 @@ /* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. + Copyright (c) 2017, MariaDB Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -57,7 +58,7 @@ class Mode_BASE : public virtual_base { public: enum { MaxBlockSz = 16 }; - explicit Mode_BASE(int sz, CipherDir dir, Mode mode) + explicit Mode_BASE(unsigned sz, CipherDir dir, Mode mode) : blockSz_(sz), reg_(reinterpret_cast<byte*>(r_)), tmp_(reinterpret_cast<byte*>(t_)), dir_(dir), mode_(mode) {} @@ -67,7 +68,7 @@ public: void SetIV(const byte* iv) { memcpy(reg_, iv, blockSz_); } protected: - int blockSz_; + unsigned blockSz_; byte* reg_; byte* tmp_; |