Moved sources into src/ subdirectory.
This commit is contained in:
parent
5cd49a1c89
commit
8b32d43335
23 changed files with 6 additions and 3 deletions
|
@ -91,6 +91,8 @@ function hashTransactionForSignature(scriptCode, tx, inIndex, hashType)
|
|||
|
||||
buffer.concat(Crypto.util.wordsToBytes([parseInt(hashType)]));
|
||||
|
||||
console.log(buffer);
|
||||
|
||||
return Crypto.SHA256(Crypto.SHA256(buffer, {asBytes: true}), {asBytes: true});
|
||||
};
|
||||
|
||||
|
@ -148,8 +150,8 @@ $(function () {
|
|||
var key = new Bitcoin.ECKey(Crypto.util.hexToBytes("5c0b98e524ad188ddef35dc6abba13c34a351a05409e5d285403718b93336a4a"));
|
||||
key = new Bitcoin.ECKey(Crypto.util.hexToBytes("180cb41c7c600be951b5d3d0a7334acc7506173875834f7a6c4c786a28fcbb19"));
|
||||
//console.log(key.getBitcoinAddress().toString());
|
||||
var message = Crypto.util.hexToBytes("2aec28d323ee7b06a799d540d224b351161fe48967174ca5e43164e86137da11");
|
||||
message = [0];
|
||||
//var message = Crypto.util.hexToBytes("2aec28d323ee7b06a799d540d224b351161fe48967174ca5e43164e86137da11");
|
||||
//message = [0];
|
||||
//var out = key.sign(message);
|
||||
//console.log("pubkey: "+Crypto.util.bytesToHex(key.getPub()));
|
||||
//console.log("sig: "+Crypto.util.bytesToHex(out));
|
||||
|
@ -161,4 +163,4 @@ $(function () {
|
|||
//console.log(Bitcoin.ECDSA.verify(Crypto.util.hexToBytes("230aba77ccde46bb17fcb0295a92c0cc42a6ea9f439aaadeb0094625f49e6ed8"), Crypto.util.hexToBytes("3046022100a3ee5408f0003d8ef00ff2e0537f54ba09771626ff70dca1f01296b05c510e85022100d4dc70a5bb50685b65833a97e536909a6951dd247a2fdbde6688c33ba6d6407501"),Crypto.util.hexToBytes("04a19c1f07c7a0868d86dbb37510305843cc730eb3bea8a99d92131f44950cecd923788419bfef2f635fad621d753f30d4b4b63b29da44b4f3d92db974537ad5a4")));
|
||||
//console.log(Bitcoin.ECDSA.verify(Crypto.util.hexToBytes("c2c75bb77d7a5acddceb1d45ceef58e7451fd0d3abc9d4c16df7848eefafe00d"), Crypto.util.hexToBytes("3045022100ff9362dadcbf1f6ef954bc8eb27144bbb4f49abd32be1eb04c311151dcf4bcf802205112c2ca6a25aefb8be98bf460c5a9056c01253f31e118d80b81ec9604e3201a01"),Crypto.util.hexToBytes("04fe62ce7892ec209310c176ef7f06565865e286e8699e884603657efa9aa51086785099d544d4e04f1f7b4b065205c1783fade8daf4ba1e0d1962292e8eb722cd")));
|
||||
});
|
||||
*/
|
||||
//*/
|
|
@ -137,6 +137,7 @@
|
|||
txTmp.ins = [txTmp.ins[inIndex]];
|
||||
}
|
||||
|
||||
console.log(txTmp);
|
||||
var buffer = txTmp.serialize();
|
||||
|
||||
buffer = buffer.concat(Crypto.util.wordsToBytes([parseInt(hashType)]).reverse());
|
Loading…
Reference in a new issue