Tiny bug in bn_power_2() - didn't work with powers that were a
authorsimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 10 Mar 2001 11:03:26 +0000 (11:03 +0000)
committersimon <simon@cda61777-01e9-0310-a592-d414129be87e>
Sat, 10 Mar 2001 11:03:26 +0000 (11:03 +0000)
multiple of 16. Oops!

git-svn-id: svn://svn.tartarus.org/sgt/putty@990 cda61777-01e9-0310-a592-d414129be87e

sshbn.c

diff --git a/sshbn.c b/sshbn.c
index 3a5ddc0..1bd3f43 100644 (file)
--- a/sshbn.c
+++ b/sshbn.c
@@ -68,7 +68,7 @@ void freebn(Bignum b) {
 }
 
 Bignum bn_power_2(int n) {
-    Bignum ret = newbn((n+15)/16);
+    Bignum ret = newbn(n/16+1);
     bignum_set_bit(ret, n, 1);
     return ret;
 }