8件ヒット
[1-8件を表示]
(0.060秒)
別のキーワード
クラス
-
OpenSSL
:: BN (8)
キーワード
-
mask
_ bits! (1) -
mod
_ add (1) -
mod
_ exp (1) -
mod
_ inverse (1) -
mod
_ mul (1) -
mod
_ sqr (1) -
mod
_ sub (1)
検索結果
先頭5件
-
OpenSSL
:: BN # %(other) -> OpenSSL :: BN (63610.0) -
自身を other で割り算した余りを返します。
...自身を other で割り算した余りを返します。
@param other 除数
@raise OpenSSL::BNError 計算時エラー... -
OpenSSL
:: BN # mod _ exp(other , m) -> OpenSSL :: BN (18358.0) -
(self ** other) % m を返します。
...(self ** other) % m を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("7").mod_exp(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 1
//}
@param other 指数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー... -
OpenSSL
:: BN # mod _ inverse(m) -> OpenSSL :: BN (9382.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 # mod _ add(other , m) -> OpenSSL :: BN (9358.0) -
(self + other) % m を返します。
...(self + other) % m を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("7").mod_add(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 4
//}
@param other 和を取る数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー... -
OpenSSL
:: BN # mod _ mul(other , m) -> OpenSSL :: BN (9358.0) -
(self * other) % m を返します。
...(self * other) % m を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("7").mod_mul(OpenSSL::BN.new("3"), OpenSSL::BN.new("6")) # => 3
//}
@param other 積を取る数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー... -
OpenSSL
:: BN # mod _ sqr(m) -> OpenSSL :: BN (9358.0) -
(self ** 2) % m を返します。
...(self ** 2) % m を返します。
@param m mod を取る数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#sqr... -
OpenSSL
:: BN # mod _ sub(other , m) -> OpenSSL :: BN (9358.0) -
(self - other) % m を返します。
...(self - other) % m を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("27").mod_sub(OpenSSL::BN.new("3"), OpenSSL::BN.new("5")) # => 4
//}
@param other 引く数
@param m 剰余を取る数
@raise OpenSSL::BNError 計算時エラー... -
OpenSSL
:: BN # mask _ bits!(n) -> self (9082.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 計算時...