]> Cypherpunks.ru repositories - gogost.git/blobdiff - src/cypherpunks.ru/gogost/gost3410/private.go
Make private key length validation working
[gogost.git] / src / cypherpunks.ru / gogost / gost3410 / private.go
index 5f41ddc50b89b9ce805dfb0896509e2d6bd7ff2b..ced3b89527e86a6568fe85d1497f1446e5eb6869 100644 (file)
@@ -30,7 +30,7 @@ type PrivateKey struct {
 
 func NewPrivateKey(curve *Curve, mode Mode, raw []byte) (*PrivateKey, error) {
        if len(raw) != int(mode) {
-               errors.New("Invalid private key length")
+               return nil, errors.New("Invalid private key length")
        }
        key := make([]byte, int(mode))
        for i := 0; i < len(key); i++ {