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

@hpke/common

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hpke/common - npm Package Compare versions

Comparing version 1.4.3 to 1.5.0

2

esm/mod.d.ts

@@ -24,3 +24,3 @@ export type { AeadEncryptionContext } from "./src/interfaces/aeadEncryptionContext.js";

export { EMPTY, INPUT_LENGTH_LIMIT, MINIMUM_PSK_LENGTH } from "./src/consts.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isNode, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isDeno, isDenoV1, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";
//# sourceMappingURL=mod.d.ts.map

@@ -14,2 +14,2 @@ export * from "./src/errors.js";

export { EMPTY, INPUT_LENGTH_LIMIT, MINIMUM_PSK_LENGTH } from "./src/consts.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isNode, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isDeno, isDenoV1, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";

@@ -22,24 +22,24 @@ import type { KdfInterface } from "../interfaces/kdfInterface.js";

/** KdfId.HkdfSha256 (0x0001) */
readonly id: KdfId;
id: KdfId;
/** 32 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
export declare class HkdfSha384Native extends HkdfNative {
/** KdfId.HkdfSha384 (0x0002) */
readonly id: KdfId;
id: KdfId;
/** 48 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
export declare class HkdfSha512Native extends HkdfNative {
/** KdfId.HkdfSha512 (0x0003) */
readonly id: KdfId;
id: KdfId;
/** 64 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
//# sourceMappingURL=hkdf.d.ts.map
import { KemId } from "../identifiers.js";
export declare const isNode: () => boolean;
export declare const isDenoV1: () => boolean;
/**
* Checks whether the runtime is Deno or not (Node.js).
* @returns boolean - true if the runtime is Deno, false Node.js.
*/
export declare function isDeno(): boolean;
/**
* Checks whetehr the type of input is CryptoKeyPair or not.

@@ -5,0 +10,0 @@ */

import * as dntShim from "../../_dnt.shims.js";
import { KemId } from "../identifiers.js";
export const isNode = () =>
export const isDenoV1 = () =>
// deno-lint-ignore no-explicit-any
dntShim.dntGlobalThis.process?.versions?.node != null;
dntShim.dntGlobalThis.process === undefined;
/**
* Checks whether the runtime is Deno or not (Node.js).
* @returns boolean - true if the runtime is Deno, false Node.js.
*/
export function isDeno() {
// deno-lint-ignore no-explicit-any
if (dntShim.dntGlobalThis.process === undefined) {
return true;
}
// deno-lint-ignore no-explicit-any
return dntShim.dntGlobalThis.process?.versions?.deno !== undefined;
}
/**
* Checks whetehr the type of input is CryptoKeyPair or not.

@@ -8,0 +20,0 @@ */

{
"name": "@hpke/common",
"version": "1.4.3",
"version": "1.5.0",
"description": "A Hybrid Public Key Encryption (HPKE) internal-use common module for @hpke family modules.",

@@ -5,0 +5,0 @@ "keywords": [

@@ -24,3 +24,3 @@ export type { AeadEncryptionContext } from "./src/interfaces/aeadEncryptionContext.js";

export { EMPTY, INPUT_LENGTH_LIMIT, MINIMUM_PSK_LENGTH } from "./src/consts.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isNode, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";
export { concat, hexToBytes, i2Osp, isCryptoKeyPair, isDeno, isDenoV1, kemToKeyGenAlgorithm, loadCrypto, loadSubtleCrypto, xor, } from "./src/utils/misc.js";
//# sourceMappingURL=mod.d.ts.map

@@ -26,3 +26,3 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.xor = exports.loadSubtleCrypto = exports.loadCrypto = exports.kemToKeyGenAlgorithm = exports.isNode = exports.isCryptoKeyPair = exports.i2Osp = exports.hexToBytes = exports.concat = exports.MINIMUM_PSK_LENGTH = exports.INPUT_LENGTH_LIMIT = exports.EMPTY = exports.SUITE_ID_HEADER_KEM = exports.LABEL_SK = exports.LABEL_DKP_PRK = exports.KEM_USAGES = exports.AEAD_USAGES = exports.HkdfSha512Native = exports.HkdfSha384Native = exports.HkdfSha256Native = exports.XCryptoKey = exports.Hybridkem = exports.Ec = exports.Dhkem = exports.Mode = exports.KemId = exports.KdfId = exports.AeadId = exports.NativeAlgorithm = void 0;
exports.xor = exports.loadSubtleCrypto = exports.loadCrypto = exports.kemToKeyGenAlgorithm = exports.isDenoV1 = exports.isDeno = exports.isCryptoKeyPair = exports.i2Osp = exports.hexToBytes = exports.concat = exports.MINIMUM_PSK_LENGTH = exports.INPUT_LENGTH_LIMIT = exports.EMPTY = exports.SUITE_ID_HEADER_KEM = exports.LABEL_SK = exports.LABEL_DKP_PRK = exports.KEM_USAGES = exports.AEAD_USAGES = exports.HkdfSha512Native = exports.HkdfSha384Native = exports.HkdfSha256Native = exports.XCryptoKey = exports.Hybridkem = exports.Ec = exports.Dhkem = exports.Mode = exports.KemId = exports.KdfId = exports.AeadId = exports.NativeAlgorithm = void 0;
__exportStar(require("./src/errors.js"), exports);

@@ -66,3 +66,4 @@ var algorithm_js_1 = require("./src/algorithm.js");

Object.defineProperty(exports, "isCryptoKeyPair", { enumerable: true, get: function () { return misc_js_1.isCryptoKeyPair; } });
Object.defineProperty(exports, "isNode", { enumerable: true, get: function () { return misc_js_1.isNode; } });
Object.defineProperty(exports, "isDeno", { enumerable: true, get: function () { return misc_js_1.isDeno; } });
Object.defineProperty(exports, "isDenoV1", { enumerable: true, get: function () { return misc_js_1.isDenoV1; } });
Object.defineProperty(exports, "kemToKeyGenAlgorithm", { enumerable: true, get: function () { return misc_js_1.kemToKeyGenAlgorithm; } });

@@ -69,0 +70,0 @@ Object.defineProperty(exports, "loadCrypto", { enumerable: true, get: function () { return misc_js_1.loadCrypto; } });

@@ -22,24 +22,24 @@ import type { KdfInterface } from "../interfaces/kdfInterface.js";

/** KdfId.HkdfSha256 (0x0001) */
readonly id: KdfId;
id: KdfId;
/** 32 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
export declare class HkdfSha384Native extends HkdfNative {
/** KdfId.HkdfSha384 (0x0002) */
readonly id: KdfId;
id: KdfId;
/** 48 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
export declare class HkdfSha512Native extends HkdfNative {
/** KdfId.HkdfSha512 (0x0003) */
readonly id: KdfId;
id: KdfId;
/** 64 */
readonly hashSize: number;
hashSize: number;
/** The parameters for Web Cryptography API */
protected readonly algHash: HmacKeyGenParams;
algHash: HmacKeyGenParams;
}
//# sourceMappingURL=hkdf.d.ts.map
import { KemId } from "../identifiers.js";
export declare const isNode: () => boolean;
export declare const isDenoV1: () => boolean;
/**
* Checks whether the runtime is Deno or not (Node.js).
* @returns boolean - true if the runtime is Deno, false Node.js.
*/
export declare function isDeno(): boolean;
/**
* Checks whetehr the type of input is CryptoKeyPair or not.

@@ -5,0 +10,0 @@ */

@@ -36,3 +36,4 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.isCryptoKeyPair = exports.isNode = void 0;
exports.isCryptoKeyPair = exports.isDenoV1 = void 0;
exports.isDeno = isDeno;
exports.i2Osp = i2Osp;

@@ -50,7 +51,19 @@ exports.concat = concat;

const identifiers_js_1 = require("../identifiers.js");
const isNode = () =>
const isDenoV1 = () =>
// deno-lint-ignore no-explicit-any
dntShim.dntGlobalThis.process?.versions?.node != null;
exports.isNode = isNode;
dntShim.dntGlobalThis.process === undefined;
exports.isDenoV1 = isDenoV1;
/**
* Checks whether the runtime is Deno or not (Node.js).
* @returns boolean - true if the runtime is Deno, false Node.js.
*/
function isDeno() {
// deno-lint-ignore no-explicit-any
if (dntShim.dntGlobalThis.process === undefined) {
return true;
}
// deno-lint-ignore no-explicit-any
return dntShim.dntGlobalThis.process?.versions?.deno !== undefined;
}
/**
* Checks whetehr the type of input is CryptoKeyPair or not.

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

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