Skip to content

Commit

Permalink
update cli to take ed25519 seed (32 bytes)
Browse files Browse the repository at this point in the history
  • Loading branch information
noot committed Oct 5, 2023
1 parent a54d4db commit 6202a49
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 6202a49

Please sign in to comment.