lazy_rsa 0.3.7 → 0.3.9

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 +3 -2
  3. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d82c509b57e993bf749370f60576fd0ca67065bd42872470e50e581aa5ed4054
4
- data.tar.gz: d66fd6952a570c28a5b35a203036e839e8afaee03d659d18df06785c6d55252c
3
+ metadata.gz: 26f2763bbac64ee14fad6ebd55d877d3836314cdbf2e14d56b3e1a6784cf0ff9
4
+ data.tar.gz: 1636f13b6801af9c8e93cbce99e1242d8fe8839519b0e0bb0e690a5b5cb802d1
5
5
  SHA512:
6
- metadata.gz: 5c61af315c46dae91905a437c16f2c70c265a018ff5fe93c2d78899f5924c020477ab2da3be347a96125821de8c03edc93f3f0ea150bda7fa471c954bdb048bd
7
- data.tar.gz: c079c3ce8a79ae3404b9cd00b0fed0bb65d29832d5b6bdf3fa59639989376c0b0470a6d407f05116ea1657f7a3ab670f23bbe0fde383540e34e62107d459be07
6
+ metadata.gz: 985e5ef5b10b8d16e24d25d6425e2b06a389b50a3b56adf330e336e86b842accf6c86fa12c4e111013c1ea1105a31a371998257c827b5623b12c7a0cf88f41b3
7
+ data.tar.gz: 2eff46898dcb49d2869d7c2e1c5b208061a58c3efd7b52679f86625ef3e8e6c33b219f5cdbf3bcd47572f9392c9148b2d84931c3c384a2111a5796cd9d1de7c4
data/lib/lazy_rsa.rb CHANGED
@@ -19,13 +19,14 @@ module LazyRsa
19
19
  p = 0
20
20
  q = OpenSSL::BN.generate_prime(512)
21
21
  phi = 0
22
+ e = 0
22
23
  loop do
23
24
  p = OpenSSL::BN.generate_prime(512)
24
25
  phi = (p - 1) * (q - 1)
25
- break if q.gcd(phi) == 1
26
+ e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
27
+ break if e.gcd(phi) == 1
26
28
  end
27
29
  n = p * q
28
- e = p.mod_exp(SECURE_EXPONENT, SECURE_MODULUS)
29
30
  d = e.mod_inverse(phi)
30
31
 
31
32
  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.7
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Nick Quaranto