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 +5 -5
- data/lib/poly_pseudo/identity.rb +2 -1
- data/lib/poly_pseudo/util.rb +4 -3
- data/lib/poly_pseudo/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: f73daa683f2a0b467bbc8ae993c69ef723ef310ce7ebecbfc0d3eff8df314fdf
|
4
|
+
data.tar.gz: 957b1b0be8958587deee6cbc0a5047f8ffc71f272946ec305744540bef4f26b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 835eaecef1864eaee59bd5bdb7950775d29eeecad180c4e5381bc295b84c80d0440727d5ee187108ecb669415ebcda4107daf4f0b98b5ee89ad93e96ea83fbb5
|
7
|
+
data.tar.gz: a7ab8150b864b1f5e9484ef6bfc3f7dabd2116c8de7ffbe86c6ba327e5271a851f0b3d8f011642f22bec543acfd2d76562c2396af81e4fd93fb74332eab65ffe
|
data/lib/poly_pseudo/identity.rb
CHANGED
@@ -18,7 +18,8 @@ module PolyPseudo
|
|
18
18
|
.add(point_2)
|
19
19
|
.make_affine!
|
20
20
|
|
21
|
-
|
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
|
data/lib/poly_pseudo/util.rb
CHANGED
@@ -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
|
-
|
25
|
-
|
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
|
|
data/lib/poly_pseudo/version.rb
CHANGED
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.
|
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-
|
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.
|
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
|