ecdsa_ext 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ecdsa/ext/jacobian_point.rb +17 -6
- data/lib/ecdsa/ext/projective_point.rb +9 -3
- data/lib/ecdsa/ext/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 125f4595851c77d460e1edfa38919c125aa3c06fc469135fc1ba5fe16191a760
|
4
|
+
data.tar.gz: 609d0345ac21dde9f6274db647b7fac1c4a3c9a45cc7fe7a9b9864605cf1b01d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e38986f4f0ecd76a1ab4ac495e1e1d745bbdb0ccb66d81a672e3d8331b8a47b5d4fc726ea716d2f50db6ae91cbe09ed89a01e5bc612fe7467b5485e2adad7326
|
7
|
+
data.tar.gz: 15d1f967986650ce026dc8e6bec695035d2002f69238f96db1324b4ffe736d1adbe653ee1d3c90f4bd67e80a69fdf47d65b6f39f2f4c9fcb3e103dce542c1fab
|
@@ -28,14 +28,25 @@ module ECDSA
|
|
28
28
|
return self if other.y.zero? || other.z.zero?
|
29
29
|
|
30
30
|
unless x == other.x
|
31
|
-
|
32
|
-
|
31
|
+
new_point =
|
32
|
+
if z == other.z
|
33
33
|
z == 1 ? add_with_z_one(self, other) : add_with_z_eq(self, other)
|
34
|
+
elsif z == 1
|
35
|
+
add_with_z2_one(other, self)
|
36
|
+
elsif other.z == 1
|
37
|
+
add_with_z2_one(self, other)
|
38
|
+
else
|
39
|
+
add_with_z_ne(self, other)
|
40
|
+
end
|
41
|
+
return(
|
42
|
+
(
|
43
|
+
if new_point.y.zero? || new_point.z.zero?
|
44
|
+
JacobianPoint.infinity_point(group)
|
45
|
+
else
|
46
|
+
new_point
|
47
|
+
end
|
34
48
|
)
|
35
|
-
|
36
|
-
return add_with_z2_one(other, self) if z == 1
|
37
|
-
return add_with_z2_one(self, other) if other.z == 1
|
38
|
-
return add_with_z_ne(self, other)
|
49
|
+
)
|
39
50
|
end
|
40
51
|
|
41
52
|
return double if self == other
|
@@ -25,12 +25,18 @@ module ECDSA
|
|
25
25
|
end
|
26
26
|
|
27
27
|
unless x == other.x
|
28
|
+
new_point =
|
29
|
+
if group.param_a == field.mod(-3)
|
30
|
+
addition_negative3(self, other)
|
31
|
+
else
|
32
|
+
addition_any(self, other)
|
33
|
+
end
|
28
34
|
return(
|
29
35
|
(
|
30
|
-
if
|
31
|
-
|
36
|
+
if new_point.y.zero? || new_point.z.zero?
|
37
|
+
JacobianPoint.infinity_point(group)
|
32
38
|
else
|
33
|
-
|
39
|
+
new_point
|
34
40
|
end
|
35
41
|
)
|
36
42
|
)
|
data/lib/ecdsa/ext/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ecdsa_ext
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- azuchi
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-03-
|
11
|
+
date: 2023-03-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ecdsa
|