Socket
Socket
Sign inDemoInstall

@ocap/mcrypto

Package Overview
Dependencies
Maintainers
3
Versions
439
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ocap/mcrypto - npm Package Compare versions

Comparing version 1.18.35 to 1.18.36

2

lib/signer/secp256k1.d.ts

@@ -12,3 +12,3 @@ import { BytesType, KeyPairType, EncodingType } from '@ocap/util';

constructor();
isValidSK(sk: BytesType): boolean;
isValidSK(sk: Uint8Array): boolean;
/**

@@ -15,0 +15,0 @@ * @public

@@ -28,2 +28,5 @@ "use strict";

isValidSK(sk) {
if (sk.byteLength !== 32) {
return false;
}
const bn = new util_1.BN(sk);

@@ -54,2 +57,5 @@ return bn.cmp(secp256k1.curve.n) < 0 && !bn.isZero();

getPublicKey(sk, encoding = 'hex') {
if (!this.isValidSK((0, util_1.toUint8Array)(sk))) {
throw new Error('Invalid secret key');
}
let pk = secp256k1.keyFromPrivate((0, util_1.toBuffer)(sk)).getPublic(this.pkCompressed, 'hex');

@@ -56,0 +62,0 @@ if (this.pkHasFormatPrefix === false) {

{
"name": "@ocap/mcrypto",
"version": "1.18.35",
"version": "1.18.36",
"description": "Crypto lib that provides signer,crypter,hasher interface",

@@ -59,3 +59,3 @@ "keywords": [

"dependencies": {
"@ocap/util": "1.18.35",
"@ocap/util": "1.18.36",
"bn.js": "5.2.1",

@@ -76,3 +76,3 @@ "crypto-js": "^4.1.1",

},
"gitHead": "21178573bd44a1fb3a3a71f21bb8e81433322a69"
"gitHead": "507eaab0fc94d92a88c49c2e3441c5f6b0e3788f"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc