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

Fix error message, Ed448 keys are 57 bytes #11880

Merged
merged 1 commit into from
Nov 3, 2024
Merged

Fix error message, Ed448 keys are 57 bytes #11880

merged 1 commit into from
Nov 3, 2024

Conversation

hannob
Copy link
Contributor

@hannob hannob commented Nov 3, 2024

When passing a key of incorrect size to Ed448PrivateKey.from_private_bytes, it will show an incorrect error message:

ValueError: An Ed448 private key is 56 bytes long

However, the correct key size for Ed448 is 57 bytes. 56 bytes causes an error, example:

#!/usr/bin/python3
import os
from cryptography.hazmat.primitives.asymmetric import ed448, x448
ecbin = os.urandom(56)
key = ed448.Ed448PrivateKey.from_private_bytes(ecbin)

@alex alex enabled auto-merge (squash) November 3, 2024 13:23
@alex alex merged commit 39738d7 into pyca:main Nov 3, 2024
60 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants