X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=sshbn.c;h=7aa1069709f774964aa1de309fcb9f3412d528ef;hb=af1460d6e5044a3344aaacd15c91cfdcb58578e7;hp=3afea467f9d393fe55fa8f5581c4018665ebf5cd;hpb=4f340599029715d863b84bdfc0407f582114a23c;p=PuTTY.git diff --git a/sshbn.c b/sshbn.c index 3afea467..7aa10697 100644 --- a/sshbn.c +++ b/sshbn.c @@ -1142,8 +1142,7 @@ Bignum bignum_from_bytes(const unsigned char *data, int nbytes) (BignumInt)byte << (8*i % BIGNUM_INT_BITS); } - while (result[0] > 1 && result[result[0]] == 0) - result[0]--; + bn_restore_invariant(result); return result; } @@ -1165,8 +1164,7 @@ Bignum bignum_from_bytes_le(const unsigned char *data, int nbytes) (BignumInt)byte << (8*i % BIGNUM_INT_BITS); } - while (result[0] > 1 && result[result[0]] == 0) - result[0]--; + bn_restore_invariant(result); return result; }