Commit 4b960e2 1 parent aa4e9e0 commit 4b960e2 Copy full SHA for 4b960e2
File tree 2 files changed +28
-1
lines changed
2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [ Keep a Changelog] ( https://keepachangelog.com/en/1.0.0/ )
6
+ and this project adheres to the following versioning pattern:
7
+
8
+ Given a version number MAJOR.MINOR.PATCH, increment:
9
+
10
+ - MAJOR version when ** breaking changes** are introduced;
11
+ - MINOR version when ** backwards compatible changes** are introduced;
12
+ - PATCH version when backwards compatible bug ** fixes** are implemented.
13
+
14
+
15
+ ## [ Unreleased]
16
+ ### Fixed
17
+ - signature r and s range check
18
+
19
+ ## [ 1.0.0] - 2020-04-14
20
+ ### Added
21
+ - first official version
Original file line number Diff line number Diff line change @@ -85,7 +85,7 @@ defmodule EllipticCurve.Ecdsa do
85
85
86
86
inv = Math . inv ( signature . s , curveData . "N" )
87
87
88
- signature . r ==
88
+ result = signature . r ==
89
89
Math . add (
90
90
Math . multiply (
91
91
curveData . "G" ,
@@ -104,5 +104,11 @@ defmodule EllipticCurve.Ecdsa do
104
104
curveData . "A" ,
105
105
curveData . "P"
106
106
) . x
107
+
108
+ cond do
109
+ signature . r < 1 || signature . r >= curveData . "N" -> false
110
+ signature . s < 1 || signature . s >= curveData . "N" -> false
111
+ true -> result
112
+ end
107
113
end
108
114
end
You can’t perform that action at this time.
0 commit comments