Skip to content

Commit

Permalink
Merge pull request #4 from astriaorg/noot/key-fix
Browse files Browse the repository at this point in the history
update cli to take ed25519 seed (32 bytes)
  • Loading branch information
noot authored Oct 5, 2023
2 parents a54d4db + 6202a49 commit 4c3150d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cmd/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ func getPrivateKeyFromFlag() (*ed25519.PrivateKey, error) {
return nil, err
}

privateKey := ed25519.PrivateKey(privateKeyBytes)
if len(privateKeyBytes) != ed25519.SeedSize {
return nil, fmt.Errorf("invalid private key length, expected 32: %d", len(privateKeyBytes))
}

privateKey := ed25519.NewKeyFromSeed(privateKeyBytes)
return &privateKey, nil
}

0 comments on commit 4c3150d

Please sign in to comment.