(BN_set_word): simplify.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@22850 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2008-04-07 18:49:01 +00:00
parent 097a94944f
commit ebb04377b6

View File

@@ -297,13 +297,13 @@ BN_set_word(BIGNUM *bn, unsigned long num)
for (num2 = num, i = 0; num2 > 0; i++) for (num2 = num, i = 0; num2 > 0; i++)
num2 = num2 >> 8; num2 = num2 >> 8;
len = i - 1; len = i;
for (; i > 0; i--) { for (; i > 0; i--) {
p[i - 1] = (num & 0xff); p[i - 1] = (num & 0xff);
num = num >> 8; num = num >> 8;
} }
bn = BN_bin2bn(p, len + 1, bn); bn = BN_bin2bn(p, len, bn);
return bn != NULL; return bn != NULL;
} }