From bbcea5e6210d2429bdd9ac45e0c0ed31b0a6b620 Mon Sep 17 00:00:00 2001 From: "Ryan X. Charles" Date: Wed, 1 Jan 2014 15:47:36 -0500 Subject: [PATCH] fix validate math error --- PrivateKey.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PrivateKey.js b/PrivateKey.js index 3bcba59..decc9c7 100644 --- a/PrivateKey.js +++ b/PrivateKey.js @@ -16,7 +16,7 @@ function ClassSpec(b) { PrivateKey.prototype.validate = function() { this.doAsBinary(function() { PrivateKey.super(this, 'validate', arguments); - if (this.data.length < 32 || (this.data.length > 1+32 && !this.compressed()) || (this.data.length==1+32 && this.data[1+32+1-1]!=1) || this.data.length>1+32+1) + if (this.data.length < 32 || (this.data.length > 1+32 && !this.compressed()) || (this.data.length==1+32+1 && this.data[1+32+1-1]!=1) || this.data.length>1+32+1) throw new Error('invalid data length'); }); };