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

allow generate() seed arg to be a string #99

Merged
merged 2 commits into from
Jun 8, 2022
Merged

Conversation

staltz
Copy link
Member

@staltz staltz commented Jun 8, 2022

Context: For testing, it's worth using deterministic keys, but the API for passing a seed is a bit annoying because you have to craft a buffer yourself and it has to be 32 bytes long.

Solution: this PR allows the seed argument of generate(curve, seed, feedFormat) to be a string, which is then used to produce a 32-byte seed buffer regardless of the size of the seed string.

@staltz staltz requested a review from arj03 June 8, 2022 10:48
Copy link
Member

@arj03 arj03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Any reason not to do utf8 instead of ascii? I don't think it will matter much so marked it as aprpoved :)

@staltz
Copy link
Member Author

staltz commented Jun 8, 2022

Ah yeah, let's change it to utf8. It's cooler

@staltz staltz merged commit fc5ce18 into main Jun 8, 2022
@staltz staltz deleted the generate-string-seed branch June 8, 2022 11:58
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.

None yet

2 participants