Skip to content

Commit

Permalink
browser ECDSA compressed key generated
Browse files Browse the repository at this point in the history
  • Loading branch information
maraoz committed Feb 24, 2014
1 parent 0f393cb commit 915c048
Show file tree
Hide file tree
Showing 24 changed files with 5,705 additions and 41 deletions.
4 changes: 2 additions & 2 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ module.exports = function(grunt) {
standalone: 'bitcore',
}
},
vendor: {
/*vendor: {
src: ['browser/vendor_load.js'],
dest: 'browser/vendor.js',
options: {
}
}
}*/
},
watch: {
readme: {
Expand Down
31 changes: 30 additions & 1 deletion Key.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,32 @@

module.exports = require('bindings')('KeyModule');


if (process.versions) {
// c++ native version
module.exports = require('bindings')('KeyModule');
} else {
// pure js version
var ECKey = require('./browser/bitcoinjs-lib.js').ECKey;
var kSpec = function() {

};

kSpec.generateSync = function() {
var eck = new ECKey();
eck.setCompressed(true);
var pub = eck.getPub();
console.dir(eck);
console.log(pub);

return {
compressed: true,
public: new Buffer(33),
private: new Buffer(32)
};
};
module.exports = {
Key: kSpec
};
}


2 changes: 2 additions & 0 deletions bitcore.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ module.exports.PrivateKey = require('./PrivateKey');
module.exports.RpcClient = require('./RpcClient');
module.exports.Wallet = require('./Wallet');
module.exports.WalletKey = require('./WalletKey');
module.exports.Buffer = Buffer;

//module.exports.is = require('./browser/KeyEcdsaAdapter.js').is;

if (typeof process.versions === 'undefined') {
module.exports.bignum.config({EXPONENTIAL_AT: 9999999, DECIMAL_PLACES: 0, ROUNDING_MODE: 1});
Expand Down
2 changes: 2 additions & 0 deletions browser/bitcoin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Bitcoin = {};

0 comments on commit 915c048

Please sign in to comment.