Socket
Socket
Sign inDemoInstall

webcrypto-core

Package Overview
Dependencies
Maintainers
2
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

webcrypto-core - npm Package Compare versions

Comparing version 0.1.13 to 0.1.14

10

dist/webcrypto-core.es.js

@@ -921,9 +921,5 @@ import { __extends } from 'tslib';

Rsa.checkKeyGenParams = function (alg) {
switch (alg.modulusLength) {
case 1024:
case 2048:
case 4096:
break;
default:
throw new RsaKeyGenParamsError(RsaKeyGenParamsError.PARAM_WRONG_VALUE, "modulusLength", "1024, 2048 or 4096");
var modulusBits = alg.modulusLength;
if (!(modulusBits >= 256 && modulusBits <= 16384 && !(modulusBits % 8))) {
throw new RsaKeyGenParamsError(RsaKeyGenParamsError.PARAM_WRONG_VALUE, "modulusLength", " a multiple of 8 bits and >= 256 and <= 16384");
}

@@ -930,0 +926,0 @@ var pubExp = alg.publicExponent;

@@ -924,9 +924,5 @@ 'use strict';

Rsa.checkKeyGenParams = function (alg) {
switch (alg.modulusLength) {
case 1024:
case 2048:
case 4096:
break;
default:
throw new RsaKeyGenParamsError(RsaKeyGenParamsError.PARAM_WRONG_VALUE, "modulusLength", "1024, 2048 or 4096");
var modulusBits = alg.modulusLength;
if (!(modulusBits >= 256 && modulusBits <= 16384 && !(modulusBits % 8))) {
throw new RsaKeyGenParamsError(RsaKeyGenParamsError.PARAM_WRONG_VALUE, "modulusLength", " a multiple of 8 bits and >= 256 and <= 16384");
}

@@ -933,0 +929,0 @@ var pubExp = alg.publicExponent;

{
"name": "webcrypto-core",
"version": "0.1.13",
"version": "0.1.14",
"description": "Common layer to be used by crypto libraries based on WebCrypto API for input validation.",

@@ -5,0 +5,0 @@ "main": "dist/webcrypto-core.js",

@@ -64,10 +64,28 @@ var helper = require("./helper");

});
it("RSA generate RSASSA wrong modulusLength", function (done) {
generate({
name: "rsassa-pkcs1-v1_5",
modulusLength: 10,
publicExponent: new Uint8Array([1, 0, 1]),
hash: { name: "sha-256" }
}, ["verify", "verify"], done, true);
});
context("RSA generate RSASSA wrong modulusLength", function () {
it("not multiple 8", function (done) {
generate({
name: "rsassa-pkcs1-v1_5",
modulusLength: 257,
publicExponent: new Uint8Array([1, 0, 1]),
hash: { name: "sha-256" }
}, ["verify", "verify"], done, true);
});
it("less than 256", function (done) {
generate({
name: "rsassa-pkcs1-v1_5",
modulusLength: 128,
publicExponent: new Uint8Array([1, 0, 1]),
hash: { name: "sha-256" }
}, ["verify", "verify"], done, true);
});
it("more than 16384", function (done) {
generate({
name: "rsassa-pkcs1-v1_5",
modulusLength: 16392,
publicExponent: new Uint8Array([1, 0, 1]),
hash: { name: "sha-256" }
}, ["verify", "verify"], done, true);
});
})
it("RSA generate RSASSA empty publicExponent", function (done) {

@@ -74,0 +92,0 @@ generate({

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