ecdh, ecdsa tests
This commit is contained in:
@@ -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))]);
|
||||
}
|
||||
|
||||
@@ -346,9 +346,9 @@ sjcl.ecc.elGamal.secretKey.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
sjcl.ecc._dh("dsa");
|
||||
sjcl.ecc._dh("ecdsa");
|
||||
|
||||
sjcl.ecc.dsa.secretKey.prototype = {
|
||||
sjcl.ecc.ecdsa.secretKey.prototype = {
|
||||
sign: function(hash, paranoia) {
|
||||
var R = this._curve.r,
|
||||
l = R.bitLength(),
|
||||
@@ -359,7 +359,7 @@ sjcl.ecc.dsa.secretKey.prototype = {
|
||||
}
|
||||
};
|
||||
|
||||
sjcl.ecc.dsa.publicKey.prototype = {
|
||||
sjcl.ecc.ecdsa.publicKey.prototype = {
|
||||
verify: function(hash, rs) {
|
||||
var w = sjcl.bitArray,
|
||||
R = this._curve.r,
|
||||
|
||||
Reference in New Issue
Block a user