200件ヒット
[1-100件を表示]
(0.034秒)
種類
- インスタンスメソッド (164)
- 特異メソッド (36)
ライブラリ
- openssl (200)
クラス
- Integer (12)
-
OpenSSL
:: BN (176) -
OpenSSL
:: PKey :: EC :: Point (12)
キーワード
- << (12)
- >> (12)
- coerce (12)
- lshift! (12)
-
mask
_ bits! (12) -
mod
_ inverse (12) - negative? (8)
- new (36)
-
num
_ bytes (12) -
pretty
_ print (12) - rshift! (12)
-
to
_ s (12)
検索結果
先頭5件
-
OpenSSL
:: PKey :: EC :: Point # to _ bn -> OpenSSL :: BN (29208.0) -
点を整数に変換します。
...点を整数に変換します。
@raise OpenSSL::PKey::EC::Point::Error 変換に失敗した場合に発生します... -
OpenSSL
:: BN # to _ bn -> self (29101.0) -
自分自身を返します。
自分自身を返します。 -
Integer
# to _ bn -> OpenSSL :: BN (26272.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
...す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'pp'
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
def to_bn
O......penSSL::BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i......す OpenSSL::BN のオブジェクトに
変換します。
//emlist[][ruby]{
require 'openssl'
pp 5.to_bn #=> #<OpenSSL::BN 5>
pp (-5).to_bn #=> #<OpenSSL::BN -5>
//}
なお、実装は、以下のようになっています。
//emlist[][ruby]{
class Integer
def to_bn
OpenSSL::BN::n......ew(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i... -
OpenSSL
:: BN . new(str , base=10) -> OpenSSL :: BN (11195.0) -
文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
...文字列を多倍長整数オブジェクト(OpenSSL::BN)を生成します。
base で、変換方法(基数)を指定します。
デフォルトは 10 で、他に 16, 2, 0 を指定できます。
10 引数の文字列を 10進数とみなして、変換します。
16 引数の文字......{
require 'openssl'
OpenSSL::BN.new("-241") # => -241
OpenSSL::BN.new("ff00",16) # => 65280
OpenSSL::BN.new("\x81",2) # => 129
OpenSSL::BN.new("\xff\x81",2) # => 65409
OpenSSL::BN.new("\x00\x00\x00\x02\x00\x81", 0) # => 129
OpenSSL::BN.new("\x00\x00\x00\x02\x80\x81", 0) # => -129
OpenSSL::BN.new(12......を表す文字列
@param base 文字列から整数に変換するときの基数
@raise OpenSSL::BNError 変換に失敗した場合に発生します
反対に、OpenSSL::BN クラスのオブジェクトを文字列にするには、
OpenSSL::BN#to_s を用います。
@see OpenSSL::BN#to_s... -
OpenSSL
:: BN . new(bn) -> OpenSSL :: BN (11140.0) -
OpenSSL::BN を複製して返します。
...
OpenSSL::BN を複製して返します。
@param bn 複製する OpenSSL::BN オブジェクト... -
OpenSSL
:: BN . new(integer) -> OpenSSL :: BN (11140.0) -
整数オブジェクト(Integer)から多倍長整数オブジェクト (OpenSSL::BN)を生成します。
...整数オブジェクト(Integer)から多倍長整数オブジェクト
(OpenSSL::BN)を生成します。
@param integer 整数オブジェクト
@see Integer#to_bn... -
OpenSSL
:: BN # >>(other) -> OpenSSL :: BN (11137.0) -
自身を other ビット右シフトした値を返します。
...自身を other ビット右シフトした値を返します。
//emlist[][ruby]{
require 'openssl'
bn = 2.to_bn
bn >> 1 # => #<OpenSSL::BN 1>
bn # => #<OpenSSL::BN 2>
//}
@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#rshift!... -
OpenSSL
:: BN # <<(other) -> OpenSSL :: BN (11131.0) -
自身を other ビット左シフトした値を返します。
...自身を other ビット左シフトした値を返します。
//emlist[][ruby]{
bn = 1.to_bn
pp bn << 1 # => #<OpenSSL::BN 2>
pp bn # => #<OpenSSL::BN 1>
//}
@param other シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#lshift!... -
OpenSSL
:: BN # mod _ inverse(m) -> OpenSSL :: BN (11125.0) -
自身の mod m における逆元を返します。
...(self * r) % m == 1 となる r を返します。
存在しない場合は例外 OpenSSL::BNError が発生します。
//emlist[][ruby]{
require 'openssl'
p 3.to_bn.mod_inverse(5) # => 2
p (3 * 2) % 5 # => 1
//}
@param m mod を取る数
@raise OpenSSL::BNError 計算時エラー...