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

ecdsa.keys.VerifyingKey.verify_digest should fail for CurveEdTw #349

Open
dfordivam opened this issue Nov 13, 2024 · 1 comment
Open

ecdsa.keys.VerifyingKey.verify_digest should fail for CurveEdTw #349

dfordivam opened this issue Nov 13, 2024 · 1 comment
Labels
bug unintended behaviour in ecdsa code help wanted

Comments

@dfordivam
Copy link

The verify_digest should explicitly fail if used with CurveEdTw, otherwise it leads to very hard to understand error:

AttributeError: 'PublicKey' object has no attribute 'order'

By the way, I was trying to verify the signature which was created for a message hashed with blake2b, and the correct usage is this (ie not to use verify_digest). But I had to study the code to understand the mistake.

    pk: VerifyingKey = VerifyingKey.from_string(
        public_key,
        curve=Ed25519,
    )
    hash_object = blake2b(digest_size=32)
    hash_object.update(message)
    return pk.verify(
        signature=signature,
        data=hash_object.digest()
    )
@tomato42 tomato42 added bug unintended behaviour in ecdsa code help wanted labels Nov 13, 2024
@tomato42
Copy link
Member

Both good points, but I don't think I'll have the time to fix them any time soon. Help welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug unintended behaviour in ecdsa code help wanted
Projects
None yet
Development

No branches or pull requests

2 participants