From 181114cd70c638e8d45e9212e94c614193c5100a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9A=D0=B0=D0=BC=D0=B8=D0=BB=D1=8C=20=D0=9C=D1=83=D1=85?= =?UTF-8?q?=D0=B0=D0=BC=D0=B5=D1=82=D0=B7=D1=8F=D0=BD=D0=BE=D0=B2?= Date: Sun, 8 Jul 2018 10:09:58 +0300 Subject: [PATCH] fixed privateKey length; --- src/BIP/HDKey.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BIP/HDKey.php b/src/BIP/HDKey.php index cd5e782..5b1d984 100644 --- a/src/BIP/HDKey.php +++ b/src/BIP/HDKey.php @@ -180,7 +180,7 @@ public function generateKeysFromPrivate(string $privateKey): void throw new \Exception('Invalid private key'); } - $this->data['privateKey'] = $privateKey; + $this->data['privateKey'] = str_repeat('0', 64 - strlen($privateKey)) . $privateKey; $this->data['publicKey'] = $this->getPublicKeyFromPrivate($privateKey); $this->data['fingerprint'] = $this->computeFingerprint($this->data['publicKey']); }