lazy_rsa 0.3.6 → 0.3.8

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 -3
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: aec4c9558e64d74ae8530e14ba5110cce7278010b4f80db751bfeb35e67bcdb4
4
- data.tar.gz: ac1eae2fdaa2336001689e072746137aaad168d99c1253e7c885770ba5acfca6
3
+ metadata.gz: cccc75263a2e8af28c8ca5611c1bb50482f96c1abf8a3df05829692527318597
4
+ data.tar.gz: 9d366feaff5efac3686308152de46eaadb9053ab6950ee77a1a412402e0471be
5
5
  SHA512:
6
- metadata.gz: ea9d42065fe7a1495369808a1d66695affa5d27009d4d9385e789f985479fc848ee289ff917a9a026364a62b2441c44becdde8174e5b1f8a2681e4e307d99c99
7
- data.tar.gz: 6800a222e1b068fd55e75924a3fd9a2480ce9a90302eabb605a8358e9dda64a6e179d3a59acac6aaddf88b3723c488d2b39fcbf6ef2fa8e2db799cef36690c95
6
+ metadata.gz: ba51891aae0d13c0795c3ff036e6fb9a1ecec913aed70b6d932252ce1b02f46b5f563d421884b9c7cccadd2e7e28fa51bf4481b7c0fa8c5214c944451846e620
7
+ data.tar.gz: 3c75a367345f92b65701b6393a5667610e215240e109148bcd52b2286a62ee15874a6a03c9274508a64b73f4ed679f5a70e2abd0eb5d45629241c6713194ff82
data/lib/lazy_rsa.rb CHANGED
@@ -16,15 +16,16 @@ 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
+ phi = 0
21
22
  loop do
22
23
  p = OpenSSL::BN.generate_prime(512)
23
24
  phi = (p - 1) * (q - 1)
24
- break if q.gcd(phi) == 1
25
+ e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
26
+ break if e.gcd(phi) == 1
25
27
  end
26
28
  n = p * q
27
- e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
28
29
  d = e.mod_inverse(phi)
29
30
 
30
31
  build_key(e:, d:, n:)
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.6
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Quaranto