Class Methods


Parameters

  • bits - integer

  • safe - boolean

  • add - BN

  • rem - BN

OpenSSL::BN.new => aBN
OpenSSL::BN.new(bn) => aBN
OpenSSL::BN.new(integer) => aBN
OpenSSL::BN.new(string) => aBN
OpenSSL::BN.new(string, 0 | 2 | 10 | 16) => aBN

Construct a new OpenSSL BigNum object.

Instance Methods


bn % bn2 => aBN

bn * bn2 => aBN

bn ** bn2 => aBN

bn + bn2 => aBN

bn - bn2 => aBN

bn1 / bn2 => [result, remainder]

Division of OpenSSL::BN instances

No documentation available
An alias for cmp

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

An alias for ==
No documentation available

Returns boolean of whether bit is set. Bitwise operations for openssl BIGNUMs.

bn.bit_set?(bit) => true | false

bn.clear_bit!(bit) -> self

bn.cmp(bn2) => integer

No documentation available
No documentation available

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

bn.gcd(bn2) => aBN

Returns a hash code for this object.

See also Object#hash.

bn.lshift!(bits) -> self

bn.mod_add(bn1, bn2) -> aBN

bn.mod_exp(bn1, bn2) -> aBN

bn.mod_inverse(bn2) => aBN

bn.mod_mul(bn1, bn2) -> aBN

bn.mod_sqr(bn2) => aBN

bn.mod_sub(bn1, bn2) -> aBN

bn.num_bits => integer

bn.num_bytes => integer

bn.odd? => true | false

bn.one? => true | false

No documentation available

Parameters

  • checks - integer

Parameters

  • checks - integer

  • trial_div - boolean

bn.rshift!(bits) -> self

bn.set_bit!(bit) -> self

bn.sqr => aBN

No documentation available
No documentation available
An alias for to_i

Parameters

  • base - integer

    • Valid values:

      • 0 - MPI

      • 2 - binary

      • 10 - the default

      • 16 - hex

bn.ucmp(bn2) => integer

bn.zero? => true | false