480件ヒット
[1-100件を表示]
(0.091秒)
ライブラリ
- openssl (480)
キーワード
- % (11)
- * (11)
- ** (11)
- + (11)
-
/ (11) - << (11)
- <=> (11)
- == (11)
- === (11)
- >> (11)
-
bit
_ set? (11) -
clear
_ bit! (11) - cmp (11)
- coerce (11)
- copy (11)
- eql? (11)
- gcd (11)
- lshift! (11)
-
mask
_ bits! (11) -
mod
_ add (11) -
mod
_ exp (11) -
mod
_ inverse (11) -
mod
_ mul (11) -
mod
_ sqr (11) -
mod
_ sub (11) - negative? (7)
-
num
_ bits (11) -
num
_ bytes (11) - odd? (11)
- one? (11)
-
pretty
_ print (11) - prime? (22)
-
prime
_ fasttest? (11) - rshift! (11)
-
set
_ bit! (11) - sqr (11)
-
to
_ bn (11) -
to
_ i (11) -
to
_ int (11) -
to
_ s (11) - ucmp (11)
- zero? (11)
検索結果
先頭5件
-
OpenSSL
:: BN # -(other) -> OpenSSL :: BN (18102.0) -
自身から other を引いた値を返します。
...自身から other を引いた値を返します。
@param other 引く整数
@raise OpenSSL::BNError 計算時エラー
@see OpenSSL::BN#mod_sub... -
OpenSSL
:: BN # <=>(other) -> -1 | 0 | 1 (126.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...は -1、
等しいときには 0、大きいときには 1 を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) #......=> 1
//}
@param other 比較する整数
@raise TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp... -
OpenSSL
:: BN # cmp(other) -> -1 | 0 | 1 (126.0) -
自身と other を比較し、自身が小さいときには -1、 等しいときには 0、大きいときには 1 を返します。
...は -1、
等しいときには 0、大きいときには 1 を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new(5) <=> 5 # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(9) # => -1
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(5) # => 0
OpenSSL::BN.new(5) <=> OpenSSL::BN.new(-5) #......=> 1
//}
@param other 比較する整数
@raise TypeError 比較できないときに発生します。
@see OpenSSL::BN#ucmp... -
OpenSSL
:: BN # ucmp(other) -> -1 | 0 | 1 (125.0) -
自身と other の絶対値を比較し、自身の絶対値が小さいときには -1、 等しいときには 0、 大きいときには 1 を返します。
... -1、
等しいときには 0、 大きいときには 1 を返します。
//emlist[][ruby]{
require 'openssl'
OpenSSL::BN.new(-5).ucmp(5) # => 0
OpenSSL::BN.new(5).ucmp(OpenSSL::BN.new(-9)) # => -1
OpenSSL::BN.new(-5).ucmp(OpenSSL::BN.new(5)) # => 0
OpenSSL::BN.new(-5).ucmp(OpenSSL::BN.ne......w(2)) # => 1
//}
@param other 比較する整数
@raise TypeError 比較できないときに発生します。
@see OpenSSL::BN#cmp... -
OpenSSL
:: BN # prime _ fasttest?(checks=nil , vtrivdiv=true) -> bool (120.0) -
自身が素数であるなら true を返します。
...真である場合には、 Miller-Rabin 法での
判定の前に小さな素数で割ることで素数か否かを
調べます。自身が小さな素数である場合にはこの手順
により素数ではないと誤った返り値を返します。
Miller-Rabin 法により確率的に判......ある
OpenSSL::BN.new("181").prime_fasttest?(nil, true) # => false
OpenSSL::BN.new("181").prime_fasttest?(nil, false) # => true
//}
@param checks Miller-Robin法の繰り返しの回数
@param vtrivdiv 真なら小さな素数で割ることでの素数判定を試みます
@raise OpenSSL::BNError......判定時にエラーが発生
@see OpenSSL::BN#prime?... -
OpenSSL
:: BN # mod _ sub(other , m) -> OpenSSL :: BN (118.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 # prime? -> bool (114.0) -
自身が素数であるなら true を返します。
...します。
Miller-Rabin 法により確率的に判定します。
checkで指定した回数だけ繰り返します。
引数を省略した場合は OpenSSL が適切な
回数を判断します。
@param check Miller-Robin 法の繰り返しの回数
@raise OpenSSL::BNError 判定時にエ... -
OpenSSL
:: BN # prime?(checks) -> bool (114.0) -
自身が素数であるなら true を返します。
...します。
Miller-Rabin 法により確率的に判定します。
checkで指定した回数だけ繰り返します。
引数を省略した場合は OpenSSL が適切な
回数を判断します。
@param check Miller-Robin 法の繰り返しの回数
@raise OpenSSL::BNError 判定時にエ... -
OpenSSL
:: BN # to _ s(base=10) -> String (108.0) -
自身を表す文字列を返します。
...2 big-endianの符号無し整数のバイナリ列
0 MPI形式の文字列(バイト列)
@param base 文字列への変換方法(基数)
@raise OpenSSL::BNError 変換に失敗した場合に発生します
//emlist[][ruby]{
require 'openssl'
p 10.to_bn.to_s # => "10"
p (-5).to_bn.to......_s # => "-5"
p 0.to_bn.to_s(16) # => "0"
p 9.to_bn.to_s(16) # => "09"
p 10.to_bn.to_s(16) # => "0A"
p 16.to_bn.to_s(16) # => "10"
p 26.to_bn.to_s(16) # => "1A"
p 256.to_bn.to_s(16) # => "0100"
p 0.to_bn.to_s(2) # => ""
p 6.to_bn.to_s(2) # => "\x06"
p 7.to_bn.to_s(2) # => "\a"
p 0.to_bn.t......o_s(0) # => "\x00\x00\x00\x00"
p 6.to_bn.to_s(0) # => "\x00\x00\x00\x01\x06"
p 7.to_bn.to_s(0) # => "\x00\x00\x00\x01\a"
//}
反対に、文字列から OpenSSL::BN クラスのインスタンスを作るには
OpenSSL::BN.new を用います。
@see OpenSSL::BN.new... -
OpenSSL
:: BN # %(other) -> OpenSSL :: BN (102.0) -
自身を other で割り算した余りを返します。
...自身を other で割り算した余りを返します。
@param other 除数
@raise OpenSSL::BNError 計算時エラー...