-
Notifications
You must be signed in to change notification settings - Fork 244
enable ES256K
for ECDSA signing scheme
#113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
a5ec491
fb12b08
649eab5
28cd302
35fb5b8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ class ECDSAECKey(Key): | |
SHA256: ecdsa.curves.NIST256p, | ||
SHA384: ecdsa.curves.NIST384p, | ||
SHA512: ecdsa.curves.NIST521p, | ||
SHA256: ecdsa.curves.SECP256k1, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Key in line 29 is same as key in line 26, that's a bug. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @pohutukawa Please fix. |
||
} | ||
|
||
def __init__(self, key, algorithm): | ||
|
@@ -35,7 +36,8 @@ def __init__(self, key, algorithm): | |
self.hash_alg = { | ||
ALGORITHMS.ES256: self.SHA256, | ||
ALGORITHMS.ES384: self.SHA384, | ||
ALGORITHMS.ES512: self.SHA512 | ||
ALGORITHMS.ES512: self.SHA512, | ||
ALGORITHMS.ES256K: self.SHA256 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Trailing comma here as well. |
||
}.get(algorithm) | ||
self._algorithm = algorithm | ||
|
||
|
@@ -120,6 +122,7 @@ def to_dict(self): | |
ecdsa.curves.NIST256p: 'P-256', | ||
ecdsa.curves.NIST384p: 'P-384', | ||
ecdsa.curves.NIST521p: 'P-521', | ||
ecdsa.curves.SECP256k1: 'P-256K', | ||
}[self.prepared_key.curve] | ||
|
||
# Calculate the key size in bytes. Section 6.2.1.2 and 6.2.1.3 of | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: I'm a huge fan of trailing commas in lists to minimize the size of diffs (and also makes git blames a lot more easier). Please add a trailing comma to the
ALGORITHMS.E256K
line.