Browse Source

use strict to crypto

patch-2
Manuel Araoz 10 years ago
parent
commit
2bf1ed8f34
  1. 6
      lib/address.js
  2. 16
      lib/bip32.js
  3. 2
      lib/crypto/bn.js
  4. 2
      lib/crypto/ecdsa.js
  5. 2
      lib/crypto/hash.js
  6. 2
      lib/crypto/kdf.js
  7. 2
      lib/crypto/point.js
  8. 4
      lib/crypto/random.js
  9. 12
      lib/privkey.js
  10. 4
      lib/protocol/base58check.js
  11. 2
      lib/pubkey.js

6
lib/address.js

@ -1,6 +1,8 @@
'use strict';
var base58check = require('./base58check');
var constants = require('./constants');
var Hash = require('./hash');
var Hash = require('./crypto/hash');
function Address(buf) {
if (!(this instanceof Address))
@ -14,7 +16,7 @@ function Address(buf) {
var obj = buf;
this.set(obj);
}
};
}
Address.prototype.set = function(obj) {
this.hashbuf = obj.hashbuf || this.hashbuf || null;

16
lib/bip32.js

@ -1,12 +1,14 @@
var Base58Check = require('./base58check');
var Hash = require('./hash');
'use strict';
var Base58Check = require('./protocol/base58check');
var constants = require('./protocol/constants');
var Hash = require('./crypto/hash');
var Point = require('./crypto/point');
var Random = require('./crypto/random');
var BN = require('./crypto/bn');
var Keypair = require('./keypair');
var Pubkey = require('./pubkey');
var Privkey = require('./privkey');
var Point = require('./point');
var Random = require('./random');
var BN = require('./bn');
var constants = require('./constants');
var BIP32 = function BIP32(obj) {
if (!(this instanceof BIP32))
@ -17,7 +19,7 @@ var BIP32 = function BIP32(obj) {
} else if (obj ) {
this.set(obj);
}
}
};
BIP32.prototype.set = function(obj) {
this.version = typeof obj.version !== 'undefined' ? obj.version : this.version;

2
lib/crypto/bn.js

@ -1,3 +1,5 @@
'use strict';
var _BN = require('bn.js');
var BN = function BN_extended(n) {

2
lib/crypto/ecdsa.js

@ -1,3 +1,5 @@
'use strict';
var BN = require('./bn');
var Point = require('./point');
var Signature = require('./signature');

2
lib/crypto/hash.js

@ -1,3 +1,5 @@
'use strict';
var hashjs = require('hash.js');
var sha512 = require('sha512');

2
lib/crypto/kdf.js

@ -1,3 +1,5 @@
'use strict';
var Bn = require('./bn');
var Privkey = require('./privkey');
var Point = require('./point');

2
lib/crypto/point.js

@ -1,3 +1,5 @@
'use strict';
var BN = require('./bn');
var elliptic = require('elliptic');

4
lib/crypto/random.js

@ -1,5 +1,7 @@
'use strict';
function Random() {
};
}
/* secure random bytes that sometimes throws an error due to lack of entropy */
Random.getRandomBuffer = function(size) {

12
lib/privkey.js

@ -1,8 +1,10 @@
var BN = require('./bn');
var Point = require('./point');
var constants = require('./constants');
var base58check = require('./base58check');
var Random = require('./random');
'use strict';
var BN = require('./crypto/bn');
var Point = require('./crypto/point');
var constants = require('./protocol/constants');
var base58check = require('./protocol/base58check');
var Random = require('./crypto/random');
var Privkey = function Privkey(bn) {
if (!(this instanceof Privkey))

4
lib/protocol/base58check.js

@ -1,5 +1,7 @@
'use strict';
var base58 = require('./base58');
var sha256sha256 = require('./hash').sha256sha256;
var sha256sha256 = require('../crypto/hash').sha256sha256;
var Base58Check = function Base58Check(obj) {
if (!(this instanceof Base58Check))

2
lib/pubkey.js

@ -1,5 +1,5 @@
var Point = require('./crypto/point');
var bn = require('./bn');
var bn = require('./crypto/bn');
var privkey = require('./privkey');
var Pubkey = function Pubkey(point) {

Loading…
Cancel
Save