[Ruby-Feature#3902][Open] Integer#to_bn in OpenSSL

Feature #3902: Integer#to_bn in OpenSSL
http://redmine.ruby-lang.org/issues/show/3902

e$B5/I<<Te(B: Ippei Obayashi
e$B%9%F!<%?%9e(B: Open, e$BM%@hEYe(B: Normal
e$B%+%F%4%je(B: ext

ext/openssl e$B$GDj5A$5$l$F$$$ke(B Integer#to_bn
e$B$,0J2<$N$h$&$K@5$7$/F0:n$7$^$;$s!#e(B
% ruby-1.9.2-p0 -v
ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
% ruby-1.9.2-p0 -ropenssl -e ‘43.to_bn’
/home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in
initialize': can't convert Fixnum into String (TypeError) from /home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in new’
from /home/ohai/opt/ruby-1.9.2-p0/lib/ruby/1.9.1/openssl/bn.rb:32:in
to_bn' from -e:1:in

e$B0J2<$N=$@5$GD>$k$H;W$$$^$9!#e(B
— a/ext/openssl/lib/openssl/bn.rb
+++ b/ext/openssl/lib/openssl/bn.rb
@@ -29,7 +29,7 @@ end # OpenSSL

class Integer
def to_bn

  • OpenSSL::BN::new(self)
  • OpenSSL::BN::new(self.to_s)
    end
    end # Integer

e$B%A%1%C%He(B #3902 e$B$,99?7$5$l$^$7$?!#e(B (by Yui NARUSE)

e$B%9%F!<%?%9e(B Opene$B$+$ie(BClosede$B$KJQ99e(B

r29407e$B$G=$@5$7$^$7$?e(B

http://redmine.ruby-lang.org/issues/show/3902