150件ヒット
[1-100件を表示]
(0.184秒)
ライブラリ
- openssl (150)
クラス
- Integer (11)
-
OpenSSL
:: BN (128) -
OpenSSL
:: PKey :: EC :: Point (11)
キーワード
- << (11)
- >> (11)
- coerce (11)
- lshift! (11)
-
mask
_ bits! (11) -
mod
_ inverse (11) - negative? (7)
-
num
_ bytes (11) -
pretty
_ print (11) - rshift! (11)
-
to
_ s (11)
検索結果
先頭5件
-
OpenSSL
:: BN # to _ bn -> self (21202.0) -
自分自身を返します。
自分自身を返します。 -
OpenSSL
:: PKey :: EC :: Point # to _ bn -> OpenSSL :: BN (21202.0) -
点を整数に変換します。
...点を整数に変換します。
@raise OpenSSL::PKey::EC::Point::Error 変換に失敗した場合に発生します... -
Integer
# to _ bn -> OpenSSL :: BN (18220.0) -
Integer を同じ数を表す OpenSSL::BN のオブジェクトに 変換します。
...SSL::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
OpenSSL::......BN::new(self)
end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i......SSL::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::new(self)......end
end
//}
@see OpenSSL::BN.new, OpenSSL::BN#to_i... -
OpenSSL
:: BN # lshift!(n) -> self (6107.0) -
自身を n ビット左シフトします。 OpenSSL::BN#<<と異なり、破壊的メソッドです。
...す。
OpenSSL::BN#<<と異なり、破壊的メソッドです。
//emlist[][ruby]{
require 'openssl'
bn = 1.to_bn
bn.lshift!(2) # => #<OpenSSL::BN 4>
bn # => #<OpenSSL::BN 4>
//}
@param n シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#<<... -
OpenSSL
:: BN # negative? -> bool (3119.0) -
自身が負である場合に true を返します。Ruby 2.5, OpenSSL 2.1.0 から利用できます。
...自身が負である場合に true を返します。Ruby 2.5, OpenSSL 2.1.0 から利用できます。
//emlist[][ruby]{
require 'openssl'
p 15.to_bn.negative? # => false
p 0.to_bn.negative? # => false
p (-5).to_bn.negative? # => true
//}... -
OpenSSL
:: BN # <<(other) -> OpenSSL :: BN (3107.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 # >>(other) -> OpenSSL :: BN (3107.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 # mask _ bits!(n) -> self (3107.0) -
自身を下位 n ビットでマスクし、破壊的に変更します。
...い場合は例外 OpenSSL::BNError
が発生します。
//emlist[][ruby]{
require 'openssl'
bn = 0b1111_1111.to_bn
bn.mask_bits!(8)
p "%b" % bn # => "11111111"
bn.mask_bits!(3)
p "%b" % bn # => "111"
//}
@param n マスクするビット数
@raise OpenSSL::BNError 計算時エ... -
OpenSSL
:: BN # mod _ inverse(m) -> OpenSSL :: BN (3107.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 計算... -
OpenSSL
:: BN # rshift!(n) -> self (3107.0) -
自身を n ビット右シフトします。 [[m:OpenSSL::BN#>>]と異なり、破壊的メソッドです。
...[[m:OpenSSL::BN#>>]と異なり、破壊的メソッドです。
//emlist[][ruby]{
require 'openssl'
bn = 8.to_bn
bn.rshift!(1) # => #<OpenSSL::BN 4>
bn # => #<OpenSSL::BN 4>
//}
@param n シフトするビット数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#>>...