Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #295 from Sc00bz/master

Major problem with ECC private key generation
  • Loading branch information...
commit 5c69cb7d8543184d2f33944cb4129605d050ecad 2 parents 8272880 + cac1dbf
@kaepora kaepora authored
View
2  src/core/js/etc/cryptocatRandom.js
@@ -60,7 +60,7 @@ else {
var x, o = '';
while (o.length < 16) {
x = state.getBytes(1);
- if (x[0] <= 250) {
+ if (x[0] < 250) {
o += x[0] % 10;
}
}
View
4 src/core/js/lib/multiparty.js
@@ -88,8 +88,8 @@ function checkSize(publicKey) {
// Generate private key (32 byte random number)
// Represented in decimal
multiParty.genPrivateKey = function() {
- rand = Cryptocat.randomString(32, 0, 0, 1);
- myPrivateKey = BigInt.str2bigInt(rand, 10);
+ var rand = Cryptocat.randomString(64, 0, 0, 0, 1);
+ myPrivateKey = BigInt.str2bigInt(rand, 16);
return myPrivateKey;
}
Please sign in to comment.
Something went wrong with that request. Please try again.