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

Validate that master private key and seed are within bounds #118

Merged
merged 3 commits into from
Mar 7, 2023

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Feb 28, 2023

This validates that:

  • The master private key is greater than zero and less than the order of the curve.
  • The seed is within 16 and 64 bytes, as per the BIP-32 specification.

Related to MM-02-003 and MM-02-004.

@Mrtenz Mrtenz requested a review from a team as a code owner February 28, 2023 17:00
@@ -47,11 +48,21 @@ export async function deriveChildKey({
*/
export async function createBip39KeyFromSeed(
seed: Uint8Array,
curve: Curve = secp256k1,
Copy link
Member Author

Choose a reason for hiding this comment

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

I've made this non-optional, because we were forgetting to pass ed25519 to this function in certain tests. It's better to be explicit here.

@Mrtenz Mrtenz self-assigned this Mar 2, 2023
@Mrtenz Mrtenz force-pushed the mrtenz/validate-master-private-key branch from 2aab5f7 to 52ce799 Compare March 6, 2023 16:42
@Mrtenz Mrtenz force-pushed the mrtenz/validate-master-private-key branch from 52ce799 to 764c7e9 Compare March 7, 2023 09:41
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.

2 participants