123456789_123456789_123456789_123456789_123456789_

Class: OpenSSL::BN

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Instance Chain:
self, Comparable
Inherits: Object
Defined in: ext/openssl/ossl_bn.c,
ext/openssl/lib/openssl/bn.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

.newBN .new(bn) ⇒ BN .new(integer) ⇒ BN .new(string) ⇒ BN .new(string, 0 | 2 | 10 | 16) ⇒ BN

Class Method Details

.generate_prime

.pseudo_rand

.pseudo_rand_range

.rand

.rand_range

Instance Attribute Details

#odd?Boolean (readonly)

#one?Boolean (readonly)

#zero?Boolean (readonly)

Instance Method Details

#%

#*

#**

#+

#-

#/

#<<

#<=> Also known as: #cmp

#==(obj) ⇒ Boolean Also known as: #===

Returns true only if obj has the same value as bn. Contrast this with #eql?, which requires obj to be BN.

#==(obj) ⇒ Boolean #===(obj) ⇒ Boolean

Alias for #==.

#>>

#bit_set?Boolean

#clear_bit!

#cmp

Alias for #<=>.

#coerce(other)

#copy(other)

#eql?(obj) ⇒ Boolean

Returns true only if obj is a BN with the same value as big. Contrast this with #==, which performs type conversions.

#gcd

#hashInteger

Returns a hash code for this object.

See also Object#hash.

#lshift!

#mask_bits!

#mod_add

#mod_exp

#mod_inverse

#mod_mul

#mod_sqr

#mod_sub

#num_bits

#num_bytes

#pretty_print(q)

[ GitHub ]

  
# File 'ext/openssl/lib/openssl/bn.rb', line 25

def pretty_print(q)
  q.object_group(self) {
    q.text ' '
    q.text to_i.to_s
  }
end

#prime?Boolean #prime?(checks) ⇒ Boolean

Parameters

  • checks - integer

#prime_fasttest?Boolean #prime_fasttest?(checks) ⇒ Boolean #prime_fasttest?(checks, trial_div) ⇒ Boolean

Parameters

  • checks - integer

  • trial_div - boolean

#rshift!

#set_bit!

#sqr

#to_bn

#to_iInteger Also known as: #to_int

#to_iInteger #to_intInteger

Alias for #to_i.

#to_sString #to_s(base) ⇒ String

Parameters

  • base - integer

    • Valid values:

      • 0 - MPI

      • 2 - binary

      • 10 - the default

      • 16 - hex

#ucmp