lazy_rsa 0.3.5 → 0.3.6

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 +2 -1
  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: aec4c9558e64d74ae8530e14ba5110cce7278010b4f80db751bfeb35e67bcdb4
4
+ data.tar.gz: ac1eae2fdaa2336001689e072746137aaad168d99c1253e7c885770ba5acfca6
5
5
  SHA512:
6
- metadata.gz: 34e13d0e31098bbdb4598f5f66d8b4f4218618f1983f0fec767f70a3414b1a9230cf70adfd1b4a4ecccd3442227ff83699078f8d9fdbcbf88d956320e5de8131
7
- data.tar.gz: d1376fe17524a3a631f538d19190fb3888e3392f716e89215185f15588cd89c9b6726f6e9c4cfde01c67a27e66850b7364ded362cca1a8ac435e5f6f0afa9378
6
+ metadata.gz: ea9d42065fe7a1495369808a1d66695affa5d27009d4d9385e789f985479fc848ee289ff917a9a026364a62b2441c44becdde8174e5b1f8a2681e4e307d99c99
7
+ data.tar.gz: 6800a222e1b068fd55e75924a3fd9a2480ce9a90302eabb605a8358e9dda64a6e179d3a59acac6aaddf88b3723c488d2b39fcbf6ef2fa8e2db799cef36690c95
data/lib/lazy_rsa.rb CHANGED
@@ -18,9 +18,10 @@ module LazyRsa
18
18
  def generate_key
19
19
  q = OpenSSL::BN.generate_prime(512)
20
20
  phi = OpenSSL::BN.new(0)
21
- while q.gcd(phi) != 1
21
+ loop do
22
22
  p = OpenSSL::BN.generate_prime(512)
23
23
  phi = (p - 1) * (q - 1)
24
+ break if q.gcd(phi) == 1
24
25
  end
25
26
  n = p * q
26
27
  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.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Quaranto