Skip to content
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

fixed ecdsa_verify assertion failure #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

duckki
Copy link

@duckki duckki commented Apr 28, 2024

Summary:

  • Happens when the message is not an address.
  • It's supposed to check if the message is an address, not the public key.
  • Also, fixed bugs in get_version_byte and ecdsa_verify_addr.

Reproducer:

from cryptos import (sha256, Bitcoin, ecdsa_sign)

priv = sha256('some big long brainwallet password')
print("priv:", priv)

chain = Bitcoin()

# take 1
message = "Hello, world!"
signature = ecdsa_sign(message, priv, chain)
print("signature:", signature)

# take 2
signature = ecdsa_sign("", priv, chain)
print("signature:", signature)

# take 3
addr = chain.privtoaddr(priv)
signature = ecdsa_sign(addr, priv, chain)
print("signature:", signature)

- when the message is not an address.
- It's supposed to check if the message is an address, not the public key.
- Also, fixed bugs in `get_version_byte` and `ecdsa_verify_addr`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant