WIP: No support for sha256 signatures #2

Draft
lee.miller wants to merge 2 commits from lee.miller/bitmessage-js:sha256 into master
Showing only changes of commit 7a3a366219 - Show all commits

10
test.js
View File

@ -101,6 +101,16 @@ describe("Crypto", function() {
});
});
// The samples are from PyBitmessage's tests
it("should verify sha256 signatures", function() {
var publicKey = bmcrypto.getPublic(Buffer.from(
"93d0b61371a54b53df143b954035d612f8efa8a3ed1cf842c2186bfd8f876665",
"hex")),
sig = Buffer.from("304402202302475351db6b822de15d922e29397541f10d8a19780ba2ca4a920b1035f07502205e5bba40d5f07a24c23a89ba5f01a3828371dfbb685dd5375fa1c29095fd232b", "hex"),
message = Buffer.from("0592a10584ffabf96539f3d780d776828c67da1ab5b169e9e8aed838aaecc9ed36d49ff1423c55f019e050c66c6324f53588be88894fef4dcffdb74b98e2b200", "hex");
return bmcrypto.verify(publicKey, message, sig);
});
it("should allow to encrypt and decrypt message", function() {
var privateKeyA = bmcrypto.getPrivate();
var publicKeyA = bmcrypto.getPublic(privateKeyA);