fix: correct HDKey seed error message to report 64 bytes instead of 32#219
Merged
yshyn-iohk merged 1 commit intomainfrom Mar 5, 2026
Merged
fix: correct HDKey seed error message to report 64 bytes instead of 32#219yshyn-iohk merged 1 commit intomainfrom
yshyn-iohk merged 1 commit intomainfrom
Conversation
The error message in HDKey and EdHDKey constructors was referencing ECConfig.PRIVATE_KEY_BYTE_SIZE (32 bytes) for the seed length validation message, but BIP32 HDKey derivation requires a 64-byte seed (512 bits, as produced by BIP39 PBKDF2-HMAC-SHA512). Add a dedicated ECConfig.SEED_BYTE_SIZE = 64 constant and use it in all seed-length error messages across all platform targets. Fixes #151 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Yurii Shynbuiev <yurii.shynbuiev@iohk.io>
|
amagyar-iohk
approved these changes
Mar 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The error message in HDKey and EdHDKey constructors was referencing ECConfig.PRIVATE_KEY_BYTE_SIZE (32 bytes) for the seed length validation message, but BIP32 HDKey derivation requires a 64-byte seed (512 bits, as produced by BIP39 PBKDF2-HMAC-SHA512).
Add a dedicated ECConfig.SEED_BYTE_SIZE = 64 constant and use it in all seed-length error messages across all platform targets.
Fixes #151
Description:
Summarize the changes you're submitting in a few sentences, including Jira ticket ATL-xxxx if applicable. Link to any discussion, related issues and bug reports to give the context to help the reviewer understand the PR.
Alternatives Considered (optional):
Link to existing ADR (Architecture Decision Record), if any. If relevant, describe other approaches explored and the selected approach. Documenting why the methods were not selected will create a knowledge base for future reference, helping prevent others from revisiting less optimal ideas.
Checklist: