Skip to content

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

Open
@dfordivam

Description

@dfordivam

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()
    )

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugunintended behaviour in ecdsa codehelp wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions