From 52feaa671dd7cca36e1ddfa1a94b57eb467120d6 Mon Sep 17 00:00:00 2001 From: Kirill Fomichev Date: Mon, 21 Mar 2016 07:54:14 +0300 Subject: [PATCH] update loop in ger --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index c0c4fde..c3ff8e9 100644 --- a/index.js +++ b/index.js @@ -9,10 +9,10 @@ function blind (priv) { function getr (priv) { var len = priv.modulus.byteLength() - var r = new BN(randomBytes(len)) - while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) { + var r + do { r = new BN(randomBytes(len)) - } + } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2)) return r }