Skip to content
This repository has been archived by the owner on Nov 16, 2021. It is now read-only.

Commit

Permalink
fix curves unit test by using canonize version of sigencode
Browse files Browse the repository at this point in the history
  • Loading branch information
prusnak committed Aug 3, 2015
1 parent d659fd4 commit cbbc0bd
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions test_curves.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import pytest
import os


def bytes2num(s):
res = 0
for i, b in enumerate(reversed(bytearray(s))):
Expand Down Expand Up @@ -341,7 +340,7 @@ def test_sign(curve, r):
hashfunc=hashlib.sha256)
vk = sk.get_verifying_key()

sig_ref = sk.sign_digest_deterministic(digest, hashfunc=hashlib.sha256)
sig_ref = sk.sign_digest_deterministic(digest, hashfunc=hashlib.sha256, sigencode=ecdsa.util.sigencode_string_canonize)
assert binascii.hexlify(sig) == binascii.hexlify(sig_ref)

assert vk.verify_digest(sig, digest, sigdecode)

0 comments on commit cbbc0bd

Please sign in to comment.