ecdh, ecdsa tests

This commit is contained in:
Mike Hamburg
2010-10-07 21:10:46 -07:00
parent 2bb04bb02f
commit 4f316afb56
6 changed files with 56 additions and 10 deletions

View File

@@ -318,8 +318,8 @@ sjcl.bn.prototype = {
toBits: function(len) {
this.fullReduce();
len = len || this.exponent || this.limbs.length * this.radix;
var i = Math.floor((len-1)/24), w=sjcl.bitArray, e = (len + 7 & -8) % this.radix || this.radix;
out = [w.partial(e, this.getLimb(i))];
var i = Math.floor((len-1)/24), w=sjcl.bitArray, e = (len + 7 & -8) % this.radix || this.radix,
out = [w.partial(e, this.getLimb(i))];
for (i--; i >= 0; i--) {
out = w.concat(out, [w.partial(this.radix, this.getLimb(i))]);
}