* ext/openssl/ossl_bn.c (ossl_bn_to_i): Use bn2hex to speed up.
In general, binary to/from decimal needs extra cost. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
da39199964
commit
106595827a
@ -1,3 +1,8 @@
|
|||||||
|
Thu Apr 4 11:33:57 2013 NARUSE, Yui <naruse@ruby-lang.org>
|
||||||
|
|
||||||
|
* ext/openssl/ossl_bn.c (ossl_bn_to_i): Use bn2hex to speed up.
|
||||||
|
In general, binary to/from decimal needs extra cost.
|
||||||
|
|
||||||
Thu Apr 4 07:24:18 2013 Tanaka Akira <akr@fsij.org>
|
Thu Apr 4 07:24:18 2013 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/extconf.rb: Specify arguments to test functions.
|
* ext/socket/extconf.rb: Specify arguments to test functions.
|
||||||
|
@ -226,10 +226,10 @@ ossl_bn_to_i(VALUE self)
|
|||||||
|
|
||||||
GetBN(self, bn);
|
GetBN(self, bn);
|
||||||
|
|
||||||
if (!(txt = BN_bn2dec(bn))) {
|
if (!(txt = BN_bn2hex(bn))) {
|
||||||
ossl_raise(eBNError, NULL);
|
ossl_raise(eBNError, NULL);
|
||||||
}
|
}
|
||||||
num = rb_cstr_to_inum(txt, 10, Qtrue);
|
num = rb_cstr_to_inum(txt, 16, Qtrue);
|
||||||
OPENSSL_free(txt);
|
OPENSSL_free(txt);
|
||||||
|
|
||||||
return num;
|
return num;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user