@stacks/storage
Advanced tools
Comparing version 6.14.1-next.38 to 6.14.1-next.63
@@ -1,3 +0,3 @@ | ||
import { BadPathError, bytesToHex, ConflictError, DoesNotExist, Logger, megabytesToBytes, NotEnoughProofError, PayloadTooLargeError, PreconditionFailedError, utf8ToBytes, ValidationError, } from '@stacks/common'; | ||
import { compressPrivateKey, ecSign, getPublicKeyFromPrivate, hashSha256Sync, publicKeyToBtcAddress, randomBytes, Signature, } from '@stacks/encryption'; | ||
import { BadPathError, bytesToHex, ConflictError, DoesNotExist, Logger, megabytesToBytes, NotEnoughProofError, PayloadTooLargeError, PreconditionFailedError, PRIVATE_KEY_BYTES_COMPRESSED, utf8ToBytes, ValidationError, } from '@stacks/common'; | ||
import { ecSign, getPublicKeyFromPrivate, hashSha256Sync, publicKeyToBtcAddress, randomBytes, Signature, } from '@stacks/encryption'; | ||
import { createFetchFn } from '@stacks/common'; | ||
@@ -57,3 +57,4 @@ import { fromByteArray } from 'base64-js'; | ||
const digest = hashSha256Sync(utf8ToBytes(challengeText)); | ||
const signatureBytes = ecSign(digest, compressPrivateKey(signerKeyHex)); | ||
const compressedPrivateKey = signerKeyHex.length === PRIVATE_KEY_BYTES_COMPRESSED * 2 ? signerKeyHex : `${signerKeyHex}01`; | ||
const signatureBytes = ecSign(digest, compressedPrivateKey); | ||
const signature = Signature.fromCompact(bytesToHex(signatureBytes)).toDERHex(); | ||
@@ -60,0 +61,0 @@ const publickey = getPublicKeyFromPrivate(signerKeyHex); |
@@ -63,3 +63,4 @@ "use strict"; | ||
const digest = (0, encryption_1.hashSha256Sync)((0, common_1.utf8ToBytes)(challengeText)); | ||
const signatureBytes = (0, encryption_1.ecSign)(digest, (0, encryption_1.compressPrivateKey)(signerKeyHex)); | ||
const compressedPrivateKey = signerKeyHex.length === common_1.PRIVATE_KEY_BYTES_COMPRESSED * 2 ? signerKeyHex : `${signerKeyHex}01`; | ||
const signatureBytes = (0, encryption_1.ecSign)(digest, compressedPrivateKey); | ||
const signature = encryption_1.Signature.fromCompact((0, common_1.bytesToHex)(signatureBytes)).toDERHex(); | ||
@@ -66,0 +67,0 @@ const publickey = (0, encryption_1.getPublicKeyFromPrivate)(signerKeyHex); |
{ | ||
"name": "@stacks/storage", | ||
"version": "6.14.1-next.38+3d92cc71", | ||
"version": "6.14.1-next.63+95d4e196", | ||
"description": "Stacks storage library", | ||
@@ -23,6 +23,6 @@ "license": "MIT", | ||
"dependencies": { | ||
"@stacks/auth": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/common": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/encryption": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/network": "^6.14.1-next.38+3d92cc71", | ||
"@stacks/auth": "^6.14.1-next.63+95d4e196", | ||
"@stacks/common": "^6.14.1-next.63+95d4e196", | ||
"@stacks/encryption": "^6.14.1-next.63+95d4e196", | ||
"@stacks/network": "^6.14.1-next.63+95d4e196", | ||
"base64-js": "^1.5.1", | ||
@@ -59,3 +59,3 @@ "jsontokens": "^4.0.1" | ||
}, | ||
"gitHead": "3d92cc71fbdc199225fd71111e890ac55ae28022" | ||
"gitHead": "95d4e196cce6322c4cf7f2435ebc25a85e320498" | ||
} |
@@ -12,2 +12,3 @@ import { | ||
PreconditionFailedError, | ||
PRIVATE_KEY_BYTES_COMPRESSED, | ||
utf8ToBytes, | ||
@@ -17,3 +18,2 @@ ValidationError, | ||
import { | ||
compressPrivateKey, | ||
ecSign, | ||
@@ -156,3 +156,5 @@ getPublicKeyFromPrivate, | ||
const digest = hashSha256Sync(utf8ToBytes(challengeText)); | ||
const signatureBytes = ecSign(digest, compressPrivateKey(signerKeyHex)); | ||
const compressedPrivateKey = | ||
signerKeyHex.length === PRIVATE_KEY_BYTES_COMPRESSED * 2 ? signerKeyHex : `${signerKeyHex}01`; | ||
const signatureBytes = ecSign(digest, compressedPrivateKey); | ||
// We only want the DER encoding so use toDERHex provided by @noble/secp256k1 | ||
@@ -159,0 +161,0 @@ const signature = Signature.fromCompact(bytesToHex(signatureBytes)).toDERHex(); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
Manifest confusion
Supply chain riskThis package has inconsistent metadata. This could be malicious or caused by an error when publishing the package.
Found 1 instance in 1 package
1301625
3771
191
+ Added@types/node@18.19.71(transitive)
- Removed@types/node@18.19.74(transitive)