diff options
author | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-25 03:08:23 +0000 |
---|---|---|
committer | akr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-06-25 03:08:23 +0000 |
commit | 2b93ed5e762d15334ad063be99cc9b9cb9d7df2f (patch) | |
tree | b1db4dd2728b45b830c14a52c5c802ad66d712f4 /ext | |
parent | 0a89315b83671e833b306bd047460dc8194037ae (diff) | |
download | ruby-2b93ed5e762d15334ad063be99cc9b9cb9d7df2f.tar.gz |
* bignum.c (MSB): Removed.
(BDIGIT_MSB): Defined using BIGRAD_HALF.
(bary_2comp): Apply BIGLO after possible over flow of BDIGIT.
(get2comp): Ditto.
(bary_unpack_internal): Use BDIGIT_MSB.
Apply BIGLO after possible over flow of BDIGIT.
(rb_integer_unpack): Use BDIGIT_MSB.
(calc_hbase): Use BDIGMAX.
(big2dbl): Use BDIGMAX.
Apply BIGLO after possible over flow of BDIGIT.
(rb_big_neg): Apply BIGLO after possible over flow of BDIGIT.
(biglsh_bang): Ditto.
(bigrsh_bang): Ditto.
(bary_divmod): Use BDIGIT_MSB.
(bigdivrem): Ditto.
(bigxor_int): Apply BIGLO after possible over flow of BDIGIT.
* marshal.c (shortlen): Use SIZEOF_BDIGITS instead of sizeof(BDIGIT).
* ext/openssl/ossl_bn.c (ossl_bn_initialize): Use SIZEOF_BDIGITS
instead of sizeof(BDIGIT).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/openssl/ossl_bn.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/openssl/ossl_bn.c b/ext/openssl/ossl_bn.c index a01272946e..05473635ae 100644 --- a/ext/openssl/ossl_bn.c +++ b/ext/openssl/ossl_bn.c @@ -147,14 +147,14 @@ ossl_bn_initialize(int argc, VALUE *argv, VALUE self) for (i = 0; len > i; i++) { BDIGIT v = ds[i]; - for (j = sizeof(BDIGIT) - 1; 0 <= j; j--) { - bin[(len-1-i)*sizeof(BDIGIT)+j] = v&0xff; + for (j = SIZEOF_BDIGITS - 1; 0 <= j; j--) { + bin[(len-1-i)*SIZEOF_BDIGITS+j] = v&0xff; v >>= 8; } } GetBN(self, bn); - if (!BN_bin2bn(bin, (int)sizeof(BDIGIT)*len, bn)) { + if (!BN_bin2bn(bin, (int)SIZEOF_BDIGITS*len, bn)) { ALLOCV_END(buf); ossl_raise(eBNError, NULL); } |