Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@libp2p/crypto

Package Overview
Dependencies
Maintainers
6
Versions
574
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@libp2p/crypto - npm Package Compare versions

Comparing version 5.0.1 to 5.0.2

19

dist/src/keys/ecdh/index.browser.js

@@ -7,8 +7,8 @@ import { InvalidParametersError } from '@libp2p/interface';

import webcrypto from '../../webcrypto/index.js';
const bits = {
'P-256': 256,
'P-384': 384,
'P-521': 521
const curveLengths = {
'P-256': 32,
'P-384': 48,
'P-521': 66
};
const curveTypes = Object.keys(bits);
const curveTypes = Object.keys(curveLengths);
const names = curveTypes.join(' / ');

@@ -41,6 +41,4 @@ export async function generateEphemeralKeyPair(curve) {

name: 'ECDH',
// @ts-expect-error namedCurve is missing from the types
namedCurve: curve,
public: key
}, privateKey, bits[curve]);
}, privateKey, curveLengths[curve] * 8);
return new Uint8Array(buffer, 0, buffer.byteLength);

@@ -55,7 +53,2 @@ };

}
const curveLengths = {
'P-256': 32,
'P-384': 48,
'P-521': 66
};
// Marshal converts a jwk encoded ECDH public key into the

@@ -62,0 +55,0 @@ // form specified in section 4.3.6 of ANSI X9.62. (This is the format

{
"name": "@libp2p/crypto",
"version": "5.0.1",
"version": "5.0.2",
"description": "Crypto primitives for libp2p",

@@ -95,3 +95,3 @@ "license": "Apache-2.0 OR MIT",

"dependencies": {
"@libp2p/interface": "^2.0.1",
"@libp2p/interface": "^2.1.0",
"@noble/curves": "^1.4.0",

@@ -98,0 +98,0 @@ "@noble/hashes": "^1.4.0",

@@ -10,9 +10,9 @@ import { InvalidParametersError } from '@libp2p/interface'

const bits = {
'P-256': 256,
'P-384': 384,
'P-521': 521
const curveLengths = {
'P-256': 32,
'P-384': 48,
'P-521': 66
}
const curveTypes = Object.keys(bits)
const curveTypes = Object.keys(curveLengths)
const names = curveTypes.join(' / ')

@@ -67,8 +67,6 @@

name: 'ECDH',
// @ts-expect-error namedCurve is missing from the types
namedCurve: curve,
public: key
},
privateKey,
bits[curve]
curveLengths[curve] * 8
)

@@ -89,8 +87,2 @@

const curveLengths = {
'P-256': 32,
'P-384': 48,
'P-521': 66
}
// Marshal converts a jwk encoded ECDH public key into the

@@ -97,0 +89,0 @@ // form specified in section 4.3.6 of ANSI X9.62. (This is the format

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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