poly_pseudo 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -4
- data/lib/poly_pseudo/identity.rb +3 -3
- data/lib/poly_pseudo/pseudonym.rb +2 -1
- data/lib/poly_pseudo/util.rb +1 -1
- data/lib/poly_pseudo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: db1a8f78da752773735670a19e685efd975dc140
|
4
|
+
data.tar.gz: 8678187be0946d91649d98fda4686c770d316c62
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2539348249868295f7b9ec29551898c9d5c0c9e1cdd0ee9570aa55d14b33b4fecd2a5e87c16e018d17a6b1073e7aa383de298d304a825436e38f204c4020aa71
|
7
|
+
data.tar.gz: a4be807bfa242730a125500ba2cf5f51867a2626bc7884fd3410f23cbbc3ba60352c4d631fbcd438333e05efa808e75c25bf18106a322b71ee8a6cfff5d33948
|
data/README.md
CHANGED
@@ -25,6 +25,10 @@ Or install it yourself as:
|
|
25
25
|
```ruby
|
26
26
|
require 'poly_pseudo'
|
27
27
|
|
28
|
+
identity_key = PolyPseudo::Util.read_key(File.read('EI_Decryption.pem'))
|
29
|
+
decryption_key = PolyPseudo::Util.read_key(File.read('EP_Decryption.pem'))
|
30
|
+
closing_key = PolyPseudo::Util.read_key(File.read('EP_Closing.pem'))
|
31
|
+
|
28
32
|
encoded_asn1 = <<-BASE64
|
29
33
|
MIIBVAYMYIQQAYdrg+MFAQIBAgEBAgEBFhQwMDAwMDAwNDAwMzIxNDM0NTAwMRYU
|
30
34
|
MDAwMDAwMDMyNzMyMjYzMTAwMDACBAEzok4wgfkEUQQdTrTmvUoznOB+4bGfted+
|
@@ -38,10 +42,6 @@ BASE64
|
|
38
42
|
|
39
43
|
identity_or_pseudonym = PolyPseudo::PseudoId.from_asn1(encoded_asn1)
|
40
44
|
|
41
|
-
identity_key = PolyPseudo::Util.read_key(File.read('EI_Decryption.pem'))
|
42
|
-
decryption_key = PolyPseudo::Util.read_key(File.read('EP_Decryption.pem'))
|
43
|
-
closing_key = PolyPseudo::Util.read_key(File.read('EP_Closing.pem'))
|
44
|
-
|
45
45
|
case identity_or_pseudonym
|
46
46
|
when PolyPseudo::Identity
|
47
47
|
identity_or_pseudonym.decrypt(identity_key)
|
data/lib/poly_pseudo/identity.rb
CHANGED
@@ -12,13 +12,13 @@ module PolyPseudo
|
|
12
12
|
|
13
13
|
private_key = key.ec.private_key
|
14
14
|
|
15
|
-
identity_point = point_1
|
15
|
+
identity_point = point_1
|
16
|
+
.mul(private_key)
|
16
17
|
.invert!
|
17
18
|
.add(point_2)
|
18
19
|
.make_affine!
|
19
20
|
|
20
|
-
identity_point.x.to_s(
|
21
|
-
@identity = Util.oaep_decode(identity_point.x.to_s(2)).slice(3, 10)
|
21
|
+
@identity = Util.oaep_decode(identity_point.x.to_s(2)).slice(3, 10).force_encoding("UTF-8").strip
|
22
22
|
end
|
23
23
|
|
24
24
|
def identity
|
@@ -11,7 +11,8 @@ module PolyPseudo
|
|
11
11
|
product = decryption_private_key.mod_mul(closing_private_key, PolyPseudo.config.group.order)
|
12
12
|
point_2_multiplied = point_2.mul(closing_private_key)
|
13
13
|
|
14
|
-
pseudo_point = point_1
|
14
|
+
pseudo_point = point_1
|
15
|
+
.mul(product)
|
15
16
|
.invert!
|
16
17
|
.add(point_2_multiplied)
|
17
18
|
.make_affine!
|
data/lib/poly_pseudo/util.rb
CHANGED
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.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Benoist Claassen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|