X-Git-Url: https://git.saurik.com/apple/security.git/blobdiff_plain/5c19dc3ae3bd8e40a9c028b0deddd50ff337692c..dd5fb164cf5b32c462296bc65e289e100f74b59a:/OSX/libsecurity_cryptkit/lib/giantIntegers.c diff --git a/OSX/libsecurity_cryptkit/lib/giantIntegers.c b/OSX/libsecurity_cryptkit/lib/giantIntegers.c index e7872b58..d5a19537 100644 --- a/OSX/libsecurity_cryptkit/lib/giantIntegers.c +++ b/OSX/libsecurity_cryptkit/lib/giantIntegers.c @@ -493,7 +493,7 @@ giant copyGiant(giant x) unsigned bitlen(giant n) { unsigned b = GIANT_BITS_PER_DIGIT; - giantDigit c = 1 << (GIANT_BITS_PER_DIGIT - 1); + giantDigit c = ((giantDigit)1) << (GIANT_BITS_PER_DIGIT - 1); giantDigit w; if (isZero(n)) { @@ -512,9 +512,9 @@ unsigned bitlen(giant n) { int bitval(giant n, int pos) { int i = abs(pos) >> GIANT_LOG2_BITS_PER_DIGIT; - giantDigit c = 1 << (pos & (GIANT_BITS_PER_DIGIT - 1)); + giantDigit c = ((giantDigit)1) << (pos & (GIANT_BITS_PER_DIGIT - 1)); - return((n->n[i]) & c); + return ((0!=((n->n[i]) & c))?1:0); } int gsign(giant g) @@ -1047,7 +1047,6 @@ void gshiftleft(int bits, giant g) { if(!size) return; if((size+digits) > (int)g->capacity) { CKRaise("gshiftleft overflow"); - return; } k = size - 1 + digits; // (MSD of result + 1) carry = 0;