From 225ade6c7ae53433e0c8c29f677c6295b97cf305 Mon Sep 17 00:00:00 2001 From: Manuel Araoz Date: Mon, 22 Dec 2014 17:33:00 -0300 Subject: [PATCH] return comment to deterministicK --- lib/crypto/ecdsa.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/crypto/ecdsa.js b/lib/crypto/ecdsa.js index 6e5c09146..9ab220d0e 100644 --- a/lib/crypto/ecdsa.js +++ b/lib/crypto/ecdsa.js @@ -75,6 +75,9 @@ ECDSA.prototype.randomK = function() { // https://tools.ietf.org/html/rfc6979#section-3.2 ECDSA.prototype.deterministicK = function(badrs) { /* jshint maxstatements: 25 */ + // if r or s were invalid when this function was used in signing, + // we do not want to actually compute r, s here for efficiency, so, + // we can increment badrs. explained at end of RFC 6979 section 3.2 if (_.isUndefined(badrs)) { badrs = 0; }