Skip to content

Commit

Permalink
fix(eddsa): addressed review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
hanish520 committed Mar 11, 2024
1 parent f8f5c48 commit 18716fd
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions crypto/keygen/keygen.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,13 +233,11 @@ func ParsePrivateKey(buf []byte) (key hotstuff.PrivateKey, err error) {
case ecdsacrypto.PrivateKeyFileType:
key, err = x509.ParseECPrivateKey(b.Bytes)
case eddsa.PrivateKeyFileType:
//key = ed25519.NewKeyFromSeed(b.Bytes[:32])
var genericKey any
var ok bool
genericKey, err = x509.ParsePKCS8PrivateKey(b.Bytes)
genericKey, err := x509.ParsePKCS8PrivateKey(b.Bytes)
if err != nil {
return nil, err
}

Check warning on line 239 in crypto/keygen/keygen.go

View check run for this annotation

Codecov / codecov/patch

crypto/keygen/keygen.go#L238-L239

Added lines #L238 - L239 were not covered by tests
var ok bool
key, ok = genericKey.(ed25519.PrivateKey)
if !ok {
return nil, fmt.Errorf("failed to parse key")
Expand Down

0 comments on commit 18716fd

Please sign in to comment.