-
Notifications
You must be signed in to change notification settings - Fork 24
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
improvement #8
improvement #8
Conversation
Moustikitos
commented
Jul 14, 2019
- formatters module compatibility for python 2.7
- added rfc 6979 signature to ecschnorr module
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.
Need usage ref for rf6979 in ecschnorr
int and encoding fixes are IMHO false.
@@ -149,6 +149,22 @@ def sign(self, msg, pv_key): | |||
return sig | |||
return None | |||
|
|||
def sign_rfc6979(self, msg, pv_key, hasher, canonical=False): |
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.
Can you provide real usage of ec-schnorr+rfc6979 ?
src/ecpy/formatters.py
Outdated
from builtins import int,pow | ||
if sys.version_info[0] <= 2: | ||
basint = lambda b:int.from_bytes(b, 'big') |
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.
from_bytes
is New in version 3.2. so this wont work
src/ecpy/formatters.py
Outdated
r = int.from_bytes(sig[0], 'big') | ||
s = int.from_bytes(sig[1], 'big') | ||
return r,s | ||
|
||
if fmt=="BTUPLE": | ||
return (sig[0],sig[1]) |
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.
ITUPLE is a tuple of ints, so r,s as int is just sig[0]/sig[1]
BTUPLE is a tuple of bytes, so decoding must be done.
I dont understand why you invert that?
src/ecpy/formatters.py
Outdated
if sys.version_info[0] <= 2: | ||
basint = lambda b:int.from_bytes(b, 'big') | ||
else: | ||
basint = lambda b:int(b) |
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.
you cannot convert bytes to int like this.
Please give rational of what you are trying to do.
Hi, rfc 6979 is just a protocol to do deterministic signature providing k parameter in a deterministic way. Because Schnorr uses elliptic curves with k parameter, I think According to the My mistake about BTW, I like your pacakge because it is simple and efficient. I replaced |