forked from wolfSSL/wolfssl
idea_mult() now works on 16,32, AND 64bit systems
This commit is contained in:
@@ -44,12 +44,11 @@
|
|||||||
*/
|
*/
|
||||||
static INLINE word16 idea_mult(word16 x, word16 y)
|
static INLINE word16 idea_mult(word16 x, word16 y)
|
||||||
{
|
{
|
||||||
word32 mul;
|
long mul, res;
|
||||||
long res;
|
|
||||||
|
|
||||||
mul = (word32)x * (word32)y;
|
mul = (long)x * (long)y;
|
||||||
if (mul) {
|
if (mul) {
|
||||||
res = (mul & IDEA_MASK) - (mul >> 16);
|
res = (mul & IDEA_MASK) - ((word32)mul >> 16);
|
||||||
if (res <= 0)
|
if (res <= 0)
|
||||||
res += IDEA_MODULO;
|
res += IDEA_MODULO;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user