poly_pseudo 0.1.3 → 0.1.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 793a8c85f4f1ba8dc27efbc62dd9da1128f125e9
4
- data.tar.gz: bf8bd1a56268675c8c5a75a521ed4c26f0e8c37d
2
+ SHA256:
3
+ metadata.gz: f73daa683f2a0b467bbc8ae993c69ef723ef310ce7ebecbfc0d3eff8df314fdf
4
+ data.tar.gz: 957b1b0be8958587deee6cbc0a5047f8ffc71f272946ec305744540bef4f26b8
5
5
  SHA512:
6
- metadata.gz: 230f00a0e4a3b5ea28cc624bbe5f881504645770bc6a3d7f29270cb1d4e66675d38a856ea666c203d53a98a159864dd8638cfc04b06ed4cfb1c2cdd17a1dc3dc
7
- data.tar.gz: 7f924a92e4aba19a90f99865df99caaa91d64d7b48a2ce933fc26e306faae0372dfc293f615bfc7bf5086433a64817bd79e4260a1bb19d9b1e6483113f6b7a04
6
+ metadata.gz: 835eaecef1864eaee59bd5bdb7950775d29eeecad180c4e5381bc295b84c80d0440727d5ee187108ecb669415ebcda4107daf4f0b98b5ee89ad93e96ea83fbb5
7
+ data.tar.gz: a7ab8150b864b1f5e9484ef6bfc3f7dabd2116c8de7ffbe86c6ba327e5271a851f0b3d8f011642f22bec543acfd2d76562c2396af81e4fd93fb74332eab65ffe
@@ -18,7 +18,8 @@ module PolyPseudo
18
18
  .add(point_2)
19
19
  .make_affine!
20
20
 
21
- @identity = Util.oaep_decode(identity_point.x.to_s(2)).slice(3, 10).force_encoding("UTF-8").strip
21
+ decoded = Util.oaep_decode(identity_point.x.to_s(2).rjust(40, "\x00"))
22
+ @identity = decoded.slice(3, decoded[2].ord).force_encoding("UTF-8")
22
23
  end
23
24
 
24
25
  def identity
@@ -21,12 +21,13 @@ module PolyPseudo
21
21
  def oaep_decode(em, p = '', hlen = 10)
22
22
  raise 'message is too short!' if em.length < hlen * 2 + 1
23
23
 
24
- maskedSeed = em[0...hlen]
25
- maskedDB = em[hlen..-1]
24
+ raise 'Y should be zero!' unless em[0] == "\x00"
25
+ maskedSeed = em[1..hlen]
26
+ maskedDB = em[(hlen+1)..-1]
26
27
 
27
28
  seedMask = mgf1 maskedDB, hlen
28
29
  seed = xor maskedSeed, seedMask
29
- dbMask = mgf1 seed, em.size - hlen
30
+ dbMask = mgf1 seed, em.size - hlen - 1
30
31
  db = xor maskedDB, dbMask
31
32
  pHash = Digest::SHA384.digest(p)[0...hlen]
32
33
 
@@ -1,3 +1,3 @@
1
1
  module PolyPseudo
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poly_pseudo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benoist Claassen
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-09 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -123,7 +123,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
123
123
  version: '0'
124
124
  requirements: []
125
125
  rubyforge_project:
126
- rubygems_version: 2.5.1
126
+ rubygems_version: 2.7.7
127
127
  signing_key:
128
128
  specification_version: 4
129
129
  summary: Gem to decrypt polymorphic pseudonyms and identities