ecdsa_ext 0.4.0 → 0.4.2

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
2
  SHA256:
3
- metadata.gz: 84f032825c120367ced4c69a3faf2f25c519b0591a6fe2e6a9ebe21e1456a66b
4
- data.tar.gz: af328ff04a086fabaf93652cab94400c95a1dfba85daff6667defca0c112b2a1
3
+ metadata.gz: ffeb5bdada0b817b13c781070e239322058aa645a85440a6ef77bf87e5dea2d2
4
+ data.tar.gz: 277175edaac373991a84de08987c3ec5d426410664f5e5d57a56f409a39ea8f5
5
5
  SHA512:
6
- metadata.gz: c1c83beba1a26a89ba958f0b1f3f75ea48ad4777f252c1430294997cf44385c205559876354fe62d728f714fc162606af4975535c813a18595623d8ed6944d09
7
- data.tar.gz: e32b28574ec1c21cc336039e9a66a780784a7a5d3ea2a1fa20796799c2077f24b6db0dcb8853d0b7067bba4b6b41d7196214df10b7175037ab118828a74934ba
6
+ metadata.gz: 2b9944ff8eaa893aec952088eb9d5fad70d550f9396eec59c76a5e070aa3e0752bef098e5d13982a0963b0eab2641faa10de665feede18305ac32bdc1ff73c69
7
+ data.tar.gz: bff44997fbd4154ad6099dadd15661927dba01bdf8fd53182b70c1eca8c77ca6f4d08883b413d014b06f1530b8e43e0fe0a433ac3e9751a4b6cb49efcc73c331
data/.rubocop.yml CHANGED
@@ -4,7 +4,7 @@ require:
4
4
  inherit_gem:
5
5
  prettier: rubocop.yml
6
6
  AllCops:
7
- TargetRubyVersion: 3.0
7
+ TargetRubyVersion: 2.7
8
8
  RSpec/ExampleLength:
9
9
  Enabled: false
10
10
  Metrics:
data/ecdsa_ext.gemspec CHANGED
@@ -12,7 +12,7 @@ Gem::Specification.new do |spec|
12
12
  spec.description = spec.summary
13
13
  spec.homepage = "https://github.com/azuchi/ruby_ecdsa_ext"
14
14
  spec.license = "MIT"
15
- spec.required_ruby_version = ">= 3.0.0"
15
+ spec.required_ruby_version = ">= 2.7.0"
16
16
 
17
17
  spec.metadata["homepage_uri"] = spec.homepage
18
18
  spec.metadata["source_code_uri"] = spec.homepage
@@ -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
- if z == other.z
32
- return(
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
- end
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 group.param_a == field.mod(-3)
31
- addition_negative3(self, other)
36
+ if new_point.y.zero? || new_point.z.zero?
37
+ JacobianPoint.infinity_point(group)
32
38
  else
33
- addition_any(self, other)
39
+ new_point
34
40
  end
35
41
  )
36
42
  )
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ECDSA
4
4
  module Ext
5
- VERSION = "0.4.0"
5
+ VERSION = "0.4.2"
6
6
  end
7
7
  end
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.0
4
+ version: 0.4.2
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-27 00:00:00.000000000 Z
11
+ date: 2023-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ecdsa
@@ -71,7 +71,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
71
71
  requirements:
72
72
  - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: 3.0.0
74
+ version: 2.7.0
75
75
  required_rubygems_version: !ruby/object:Gem::Requirement
76
76
  requirements:
77
77
  - - ">="