249件ヒット
[1-100件を表示]
(0.159秒)
ライブラリ
- openssl (249)
キーワード
- << (11)
- <=> (11)
- >> (11)
-
bit
_ set? (11) -
clear
_ bit! (11) - cmp (11)
- coerce (11)
- lshift! (11)
-
mask
_ bits! (11) -
mod
_ add (11) -
mod
_ exp (11) -
mod
_ inverse (11) -
mod
_ mul (11) -
mod
_ sub (11) - negative? (7)
-
num
_ bits (11) -
num
_ bytes (11) -
pretty
_ print (11) -
prime
_ fasttest? (11) - rshift! (11)
-
set
_ bit! (11) -
to
_ s (11) - ucmp (11)
検索結果
先頭5件
-
OpenSSL
:: BN # clear _ bit!(n) -> self (6108.0) -
自身の n ビット目を0にします。
...自身の n ビット目を0にします。
//emlist[][ruby]{
require 'openssl'
a = OpenSSL::BN.new("129")
a.clear_bit!(0)
a # => 128
//}
@param n 0にするビットの位置
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::set_bit!... -
OpenSSL
:: BN # lshift!(n) -> self (6108.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 # mod _ mul(other , m) -> OpenSSL :: BN (6108.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 # negative? -> bool (3124.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 (3108.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 (3108.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 # bit _ set?(n) -> bool (3108.0) -
自身の n ビット目が立っているなら true を返します。
...自身の n ビット目が立っているなら true を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new("129").bit_set?(0) # => true
OpenSSL::BN.new("129").bit_set?(1) # => false
//}
@param n 調べるビットの位置
@see OpenSSL::set_bit!... -
OpenSSL
:: BN # mask _ bits!(n) -> self (3108.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 _ add(other , m) -> OpenSSL :: BN (3108.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 _ exp(other , m) -> OpenSSL :: BN (3108.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 計算時エラー...