cryptoserve 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/pqc-engine.mjs +7 -4
- package/package.json +1 -1
package/lib/pqc-engine.mjs
CHANGED
|
@@ -473,12 +473,15 @@ function generateMigrationPlan(libraries, classifications, sndl) {
|
|
|
473
473
|
|
|
474
474
|
function calculateQuantumScore(libraries, classifications) {
|
|
475
475
|
if (libraries.length === 0) return 100.0;
|
|
476
|
+
if (classifications.length === 0) return 100.0;
|
|
476
477
|
|
|
477
|
-
|
|
478
|
-
|
|
478
|
+
// Score by individual algorithm classifications, not library count.
|
|
479
|
+
// A project with 5 symmetric + 1 asymmetric algorithm is mostly ready, not 0%.
|
|
480
|
+
const safe = classifications.filter(
|
|
481
|
+
c => c.category !== 'asymmetric' || c.category === 'pqc'
|
|
479
482
|
).length;
|
|
480
|
-
const vulnerable =
|
|
481
|
-
|
|
483
|
+
const vulnerable = classifications.filter(
|
|
484
|
+
c => c.category === 'asymmetric'
|
|
482
485
|
).length;
|
|
483
486
|
const total = safe + vulnerable;
|
|
484
487
|
|