conseiljs-softsigner
Advanced tools
Comparing version 5.0.4 to 5.0.5-beta.1
@@ -20,3 +20,3 @@ /// <reference types="node" /> | ||
function checkTextSignature(signature: string, message: string, publicKey: string, prehash?: boolean): Promise<boolean>; | ||
function checkSignature(signature: string, bytes: Buffer, publicKey: string): Promise<boolean>; | ||
function checkSignature(signature: string, bytes: Buffer, publicKey: string, prehash?: boolean): Promise<boolean>; | ||
} |
@@ -122,3 +122,3 @@ "use strict"; | ||
KeyStoreUtils.checkTextSignature = checkTextSignature; | ||
function checkSignature(signature, bytes, publicKey) { | ||
function checkSignature(signature, bytes, publicKey, prehash = false) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
@@ -140,9 +140,16 @@ const sigPrefix = signature.slice(0, 5); | ||
} | ||
let messageBytes; | ||
if (prehash) { | ||
messageBytes = conseiljs_2.TezosMessageUtils.simpleHash(bytes, 32); | ||
} | ||
else { | ||
messageBytes = bytes; | ||
} | ||
const sig = conseiljs_2.TezosMessageUtils.writeSignatureWithHint(signature, sigPrefix); | ||
const pk = conseiljs_2.TezosMessageUtils.writeKeyWithHint(publicKey, keyPrefix); | ||
if (curve === conseiljs_1.SignerCurve.ED25519) { | ||
return yield CryptoUtils_1.CryptoUtils.checkSignature(sig, bytes, pk); | ||
return CryptoUtils_1.CryptoUtils.checkSignature(sig, messageBytes, pk); | ||
} | ||
if (curve === conseiljs_1.SignerCurve.SECP256K1) { | ||
return secp256k1.ecdsaVerify(sig, bytes, pk); | ||
return secp256k1.ecdsaVerify(sig, messageBytes, pk); | ||
} | ||
@@ -149,0 +156,0 @@ return false; |
@@ -10,3 +10,3 @@ /// <reference types="node" /> | ||
static createSigner(secretKey: Buffer, password?: string): Promise<Signer>; | ||
private getKey; | ||
getKey(password?: string): Promise<Buffer>; | ||
signOperation(bytes: Buffer, password?: string): Promise<Buffer>; | ||
@@ -13,0 +13,0 @@ signText(message: string, password?: string): Promise<string>; |
{ | ||
"name": "conseiljs-softsigner", | ||
"version": "5.0.4", | ||
"version": "5.0.5-beta.1", | ||
"description": "ConseilJS software signer plugin for ConseilJS-core. Supports the ED25519 curve via libsodium for tz1-address operations.", | ||
@@ -66,7 +66,7 @@ "browser": "dist/index.js", | ||
"dependencies": { | ||
"bip39": "3.0.3", | ||
"conseiljs": "5.0.7", | ||
"ed25519-hd-key": "1.1.2", | ||
"libsodium-wrappers-sumo": "0.7.8", | ||
"secp256k1": "4.0.2" | ||
"bip39": "3.0.4", | ||
"conseiljs": "5.2.3", | ||
"ed25519-hd-key": "1.3.0", | ||
"libsodium-wrappers-sumo": "0.7.10", | ||
"secp256k1": "4.0.3" | ||
}, | ||
@@ -73,0 +73,0 @@ "devDependencies": { |
@@ -51,3 +51,3 @@ # ConseilJS-softsigner | ||
<script src="https://cdn.jsdelivr.net/gh/cryptonomic/conseiljs-softsigner/dist-web/conseiljs-softsigner.min.js" | ||
integrity="sha384-5jDKotRViAmj5dYnobDcthO+GCIv7TtF+YMqQgJBD2fCYBUZtdZ2GaetkcaXIo7u" | ||
integrity="sha384-u9SDjbzVJQWfgX206Y01xb84lzX/xlRnQ8CLfoym44rwb3dbexqXk75sy5sLerHV" | ||
crossorigin="anonymous"></script> | ||
@@ -54,0 +54,0 @@ <script> |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
45834
398
1
+ Addedbig-integer@1.6.51(transitive)
+ Addedbignumber.js@9.0.2(transitive)
+ Addedbip39@3.0.4(transitive)
+ Addedconseiljs@5.2.3(transitive)
+ Addeded25519-hd-key@1.3.0(transitive)
+ Addedjsonpath-plus@6.0.1(transitive)
+ Addedlibsodium-wrappers-sumo@0.7.10(transitive)
+ Addedsecp256k1@4.0.3(transitive)
- Removedbig-integer@1.6.48(transitive)
- Removedbip39@3.0.23.0.3(transitive)
- Removedconseiljs@5.0.7(transitive)
- Removeded25519-hd-key@1.1.2(transitive)
- Removedjsonpath-plus@5.0.2(transitive)
- Removedlibsodium-wrappers-sumo@0.7.8(transitive)
- Removedsecp256k1@4.0.2(transitive)
Updatedbip39@3.0.4
Updatedconseiljs@5.2.3
Updateded25519-hd-key@1.3.0
Updatedsecp256k1@4.0.3