Module: OpenPGP::Engine::OpenSSL::Random
- Defined in:
- lib/openpgp/engine/openssl.rb
Overview
:nodoc:
Instance Method Summary collapse
- #bytes(count, &block) ⇒ Object
- #number(bits = 32, options = {}) ⇒ Object
- #prime(bits, options = {}) ⇒ Object
Instance Method Details
#bytes(count, &block) ⇒ Object
22 23 24 |
# File 'lib/openpgp/engine/openssl.rb', line 22 def bytes(count, &block) ::OpenSSL::Random.random_bytes(count) end |
#number(bits = 32, options = {}) ⇒ Object
14 15 16 |
# File 'lib/openpgp/engine/openssl.rb', line 14 def number(bits = 32, = {}) ::OpenSSL::BN.rand(bits) end |
#prime(bits, options = {}) ⇒ Object
18 19 20 |
# File 'lib/openpgp/engine/openssl.rb', line 18 def prime(bits, = {}) ::OpenSSL::BN.generate_prime(bits, [:safe]) end |