From 18716fdd768848531d2602ac85e600a212c27aac Mon Sep 17 00:00:00 2001 From: hanish gogada Date: Mon, 11 Mar 2024 22:58:18 +0100 Subject: [PATCH] fix(eddsa): addressed review comments --- crypto/keygen/keygen.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/crypto/keygen/keygen.go b/crypto/keygen/keygen.go index e40606d9..0ce261c8 100644 --- a/crypto/keygen/keygen.go +++ b/crypto/keygen/keygen.go @@ -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 } + var ok bool key, ok = genericKey.(ed25519.PrivateKey) if !ok { return nil, fmt.Errorf("failed to parse key")