forked from wolfSSL/wolfssl
fix idea conversion warnings
This commit is contained in:
@ -8532,8 +8532,9 @@ int wolfSSL_set_compression(WOLFSSL* ssl)
|
||||
if (enc == 0 || enc == 1)
|
||||
ctx->enc = enc ? 1 : 0;
|
||||
if (key) {
|
||||
ret = wc_IdeaSetKey(&ctx->cipher.idea, key, ctx->keyLen, iv,
|
||||
ctx->enc ? IDEA_ENCRYPTION : IDEA_DECRYPTION);
|
||||
ret = wc_IdeaSetKey(&ctx->cipher.idea, key, (word16)ctx->keyLen,
|
||||
iv, ctx->enc ? IDEA_ENCRYPTION :
|
||||
IDEA_DECRYPTION);
|
||||
if (ret != 0)
|
||||
return ret;
|
||||
}
|
||||
|
@ -211,17 +211,17 @@ void wc_IdeaCipher(Idea *idea, byte* out, const byte* in)
|
||||
x[3] = idea_mult(x[3], idea->skey[skey_idx++]);
|
||||
|
||||
t2 = x[0] ^ x[2];
|
||||
t2 = idea_mult(t2, idea->skey[skey_idx++]);
|
||||
t2 = idea_mult((word16)t2, idea->skey[skey_idx++]);
|
||||
t1 = (t2 + (x[1] ^ x[3])) & IDEA_MASK;
|
||||
t1 = idea_mult(t1, idea->skey[skey_idx++]);
|
||||
t1 = idea_mult((word16)t1, idea->skey[skey_idx++]);
|
||||
t2 = (t1 + t2) & IDEA_MASK;
|
||||
|
||||
x[0] ^= t1;
|
||||
x[3] ^= t2;
|
||||
|
||||
t2 ^= x[1];
|
||||
x[1] = x[2] ^ t1;
|
||||
x[2] = t2;
|
||||
x[1] = x[2] ^ (word16)t1;
|
||||
x[2] = (word16)t2;
|
||||
}
|
||||
|
||||
x[0] = idea_mult(x[0], idea->skey[skey_idx++]);
|
||||
|
Reference in New Issue
Block a user