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

@hpke/dhkem-x448

Package Overview
Dependencies
Maintainers
0
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hpke/dhkem-x448 - npm Package Compare versions

Comparing version 1.3.0 to 1.3.1

2

esm/dhkem-x448/src/dhkemX448.d.ts

@@ -1,2 +0,2 @@

import { Dhkem, KemId } from "../../core/mod.js";
import { Dhkem, KemId } from "@hpke/core";
/**

@@ -3,0 +3,0 @@ * The DHKEM(X448, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.

@@ -1,2 +0,2 @@

import { Dhkem, KemId } from "../../core/mod.js";
import { Dhkem, KemId } from "@hpke/core";
import { HkdfSha512 } from "./hkdfSha512.js";

@@ -3,0 +3,0 @@ import { X448 } from "./x448.js";

@@ -1,2 +0,2 @@

import { HkdfSha512 as HkdfSha512Native } from "../../core/mod.js";
import { HkdfSha512 as HkdfSha512Native } from "@hpke/core";
export declare class HkdfSha512 extends HkdfSha512Native {

@@ -3,0 +3,0 @@ extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;

@@ -1,6 +0,4 @@

// @ts-ignore: for "npm:"
import { hmac } from "@noble/hashes/hmac";
// @ts-ignore: for "npm:"
import { sha512 } from "@noble/hashes/sha512";
import { HkdfSha512 as HkdfSha512Native } from "../../core/mod.js";
import { HkdfSha512 as HkdfSha512Native } from "@hpke/core";
export class HkdfSha512 extends HkdfSha512Native {

@@ -7,0 +5,0 @@ async extract(salt, ikm) {

@@ -1,2 +0,2 @@

import type { DhkemPrimitives, KdfInterface } from "../../core/mod.js";
import type { DhkemPrimitives, KdfInterface } from "@hpke/core";
export declare class X448 implements DhkemPrimitives {

@@ -3,0 +3,0 @@ private _hkdf;

@@ -1,4 +0,3 @@

// @ts-ignore: for "npm:"
import { x448 } from "@noble/curves/ed448";
import { DeriveKeyPairError, DeserializeError, NotSupportedError, SerializeError, XCryptoKey, } from "../../core/mod.js";
import { DeriveKeyPairError, DeserializeError, NotSupportedError, SerializeError, XCryptoKey, } from "@hpke/core";
const ALG_NAME = "X448";

@@ -5,0 +4,0 @@ const EMPTY = new Uint8Array();

{
"name": "@hpke/dhkem-x448",
"version": "1.3.0",
"version": "1.3.1",
"description": "A Hybrid Public Key Encryption (HPKE) module extension for X448",

@@ -43,4 +43,5 @@ "keywords": [

"dependencies": {
"@noble/curves": "1.4.2",
"@noble/hashes": "1.4.0"
"@hpke/core": "^1.3.0",
"@noble/curves": "^1.4.2",
"@noble/hashes": "^1.4.0"
},

@@ -47,0 +48,0 @@ "devDependencies": {

@@ -13,5 +13,3 @@ <h1 align="center">@hpke/dhkem-x448</h1>

Documentation:
[deno.land](https://doc.deno.land/https://deno.land/x/hpke/x/dhkem-x448/mod.ts)
|
Documentation: [jsr.io](https://jsr.io/@hpke/dhkem-x448/doc) |
[pages (only for the latest ver.)](https://dajiaji.github.io/hpke-js/dhkem-x448/docs/)

@@ -86,4 +84,4 @@

<script type="module">
import * as hpke from "https://esm.sh/@hpke/core@1.3.0";
import * as x448 from "https://esm.sh/@hpke/dhkem-x448@1.3.0";
import * as hpke from "https://esm.sh/@hpke/core@<SEMVER>";
import * as x448 from "https://esm.sh/@hpke/dhkem-x448@<SEMVER>";
// ...

@@ -105,4 +103,4 @@ </script>

<script type="module">
import * as hpke from "https://unpkg.com/@hpke/core@1.3.0/esm/mod.js";
import * as x448 from "https://unpkg.com/@hpke/dhkem-x448@1.3.0/esm/mod.js";
import * as hpke from "https://unpkg.com/@hpke/core@<SEMVER>/esm/mod.js";
import * as x448 from "https://unpkg.com/@hpke/dhkem-x448@<SEMVER>/esm/mod.js";
// ...

@@ -218,4 +216,4 @@ </script>

<script type="module">
import { Aes256Gcm, CipherSuite, HkdfSha512 } from "https://esm.sh/@hpke/core@1.3.0";
import { DhkemX448HkdfSha512 } from "https://esm.sh/@hpke/dhkem-x448@1.3.0";
import { Aes256Gcm, CipherSuite, HkdfSha512 } from "https://esm.sh/@hpke/core@<SEMVER>";
import { DhkemX448HkdfSha512 } from "https://esm.sh/@hpke/dhkem-x448@<SEMVER>";

@@ -222,0 +220,0 @@ globalThis.doHpke = async () => {

@@ -1,2 +0,2 @@

import { Dhkem, KemId } from "../../core/mod.js";
import { Dhkem, KemId } from "@hpke/core";
/**

@@ -3,0 +3,0 @@ * The DHKEM(X448, HKDF-SHA512) for HPKE KEM implementing {@link KemInterface}.

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "../../core/mod.js", "./hkdfSha512.js", "./x448.js"], factory);
define(["require", "exports", "@hpke/core", "./hkdfSha512.js", "./x448.js"], factory);
}

@@ -14,3 +14,3 @@ })(function (require, exports) {

exports.DhkemX448HkdfSha512 = void 0;
const mod_js_1 = require("../../core/mod.js");
const core_1 = require("@hpke/core");
const hkdfSha512_js_1 = require("./hkdfSha512.js");

@@ -57,6 +57,6 @@ const x448_js_1 = require("./x448.js");

*/
class DhkemX448HkdfSha512 extends mod_js_1.Dhkem {
class DhkemX448HkdfSha512 extends core_1.Dhkem {
constructor() {
const kdf = new hkdfSha512_js_1.HkdfSha512();
super(mod_js_1.KemId.DhkemX448HkdfSha512, new x448_js_1.X448(kdf), kdf);
super(core_1.KemId.DhkemX448HkdfSha512, new x448_js_1.X448(kdf), kdf);
/** KemId.DhkemX448HkdfSha512 (0x0021) */

@@ -67,3 +67,3 @@ Object.defineProperty(this, "id", {

writable: true,
value: mod_js_1.KemId.DhkemX448HkdfSha512
value: core_1.KemId.DhkemX448HkdfSha512
});

@@ -70,0 +70,0 @@ /** 64 */

@@ -1,2 +0,2 @@

import { HkdfSha512 as HkdfSha512Native } from "../../core/mod.js";
import { HkdfSha512 as HkdfSha512Native } from "@hpke/core";
export declare class HkdfSha512 extends HkdfSha512Native {

@@ -3,0 +3,0 @@ extract(salt: ArrayBuffer, ikm: ArrayBuffer): Promise<ArrayBuffer>;

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "@noble/hashes/hmac", "@noble/hashes/sha512", "../../core/mod.js"], factory);
define(["require", "exports", "@noble/hashes/hmac", "@noble/hashes/sha512", "@hpke/core"], factory);
}

@@ -14,8 +14,6 @@ })(function (require, exports) {

exports.HkdfSha512 = void 0;
// @ts-ignore: for "npm:"
const hmac_1 = require("@noble/hashes/hmac");
// @ts-ignore: for "npm:"
const sha512_1 = require("@noble/hashes/sha512");
const mod_js_1 = require("../../core/mod.js");
class HkdfSha512 extends mod_js_1.HkdfSha512 {
const core_1 = require("@hpke/core");
class HkdfSha512 extends core_1.HkdfSha512 {
async extract(salt, ikm) {

@@ -22,0 +20,0 @@ await this._setup();

@@ -1,2 +0,2 @@

import type { DhkemPrimitives, KdfInterface } from "../../core/mod.js";
import type { DhkemPrimitives, KdfInterface } from "@hpke/core";
export declare class X448 implements DhkemPrimitives {

@@ -3,0 +3,0 @@ private _hkdf;

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "@noble/curves/ed448", "../../core/mod.js"], factory);
define(["require", "exports", "@noble/curves/ed448", "@hpke/core"], factory);
}

@@ -14,5 +14,4 @@ })(function (require, exports) {

exports.X448 = void 0;
// @ts-ignore: for "npm:"
const ed448_1 = require("@noble/curves/ed448");
const mod_js_1 = require("../../core/mod.js");
const core_1 = require("@hpke/core");
const ALG_NAME = "X448";

@@ -66,3 +65,3 @@ const EMPTY = new Uint8Array();

catch (e) {
throw new mod_js_1.SerializeError(e);
throw new core_1.SerializeError(e);
}

@@ -75,3 +74,3 @@ }

catch (e) {
throw new mod_js_1.DeserializeError(e);
throw new core_1.DeserializeError(e);
}

@@ -84,3 +83,3 @@ }

catch (e) {
throw new mod_js_1.SerializeError(e);
throw new core_1.SerializeError(e);
}

@@ -93,3 +92,3 @@ }

catch (e) {
throw new mod_js_1.DeserializeError(e);
throw new core_1.DeserializeError(e);
}

@@ -109,3 +108,3 @@ }

catch (e) {
throw new mod_js_1.DeserializeError(e);
throw new core_1.DeserializeError(e);
}

@@ -116,3 +115,3 @@ }

const rawSk = ed448_1.x448.utils.randomPrivateKey();
const sk = new mod_js_1.XCryptoKey(ALG_NAME, rawSk, "private", KEM_USAGES);
const sk = new core_1.XCryptoKey(ALG_NAME, rawSk, "private", KEM_USAGES);
const pk = await this.derivePublicKey(sk);

@@ -122,3 +121,3 @@ return { publicKey: pk, privateKey: sk };

catch (e) {
throw new mod_js_1.NotSupportedError(e);
throw new core_1.NotSupportedError(e);
}

@@ -130,3 +129,3 @@ }

const rawSk = await this._hkdf.labeledExpand(dkpPrk, LABEL_SK, EMPTY, this._nSk);
const sk = new mod_js_1.XCryptoKey(ALG_NAME, new Uint8Array(rawSk), "private", KEM_USAGES);
const sk = new core_1.XCryptoKey(ALG_NAME, new Uint8Array(rawSk), "private", KEM_USAGES);
return {

@@ -138,3 +137,3 @@ privateKey: sk,

catch (e) {
throw new mod_js_1.DeriveKeyPairError(e);
throw new core_1.DeriveKeyPairError(e);
}

@@ -147,3 +146,3 @@ }

catch (e) {
throw new mod_js_1.DeserializeError(e);
throw new core_1.DeserializeError(e);
}

@@ -156,3 +155,3 @@ }

catch (e) {
throw new mod_js_1.SerializeError(e);
throw new core_1.SerializeError(e);
}

@@ -178,3 +177,3 @@ }

}
resolve(new mod_js_1.XCryptoKey(ALG_NAME, new Uint8Array(key), isPublic ? "public" : "private", isPublic ? [] : KEM_USAGES));
resolve(new core_1.XCryptoKey(ALG_NAME, new Uint8Array(key), isPublic ? "public" : "private", isPublic ? [] : KEM_USAGES));
});

@@ -197,3 +196,3 @@ }

}
resolve(new mod_js_1.XCryptoKey(ALG_NAME, base64UrlToBytes(key.x), "public"));
resolve(new core_1.XCryptoKey(ALG_NAME, base64UrlToBytes(key.x), "public"));
}

@@ -204,3 +203,3 @@ else {

}
resolve(new mod_js_1.XCryptoKey(ALG_NAME, base64UrlToBytes(key.d), "private", KEM_USAGES));
resolve(new core_1.XCryptoKey(ALG_NAME, base64UrlToBytes(key.d), "private", KEM_USAGES));
}

@@ -213,3 +212,3 @@ });

const pk = ed448_1.x448.getPublicKey(k.key);
resolve(new mod_js_1.XCryptoKey(ALG_NAME, pk, "public"));
resolve(new core_1.XCryptoKey(ALG_NAME, pk, "public"));
}

@@ -216,0 +215,0 @@ catch (e) {

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 not supported yet

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 not supported yet

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