noqtis 0.1.0 → 0.1.2

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/node.js CHANGED
@@ -34,9 +34,18 @@ export function readCapsule(dir) {
34
34
  return files;
35
35
  }
36
36
 
37
- /** capsule.check on a folder: { ok, code, checks }. */
37
+ /**
38
+ * capsule.check on a folder: { ok, code, checks }. `opts.lineage` may name
39
+ * folders as well as give capsules as files; dir may be null with
40
+ * `opts.proof`.
41
+ */
38
42
  export function checkDir(dir, opts = {}) {
39
- return capsule.check(readCapsule(dir), opts);
43
+ const o = { ...opts };
44
+ if (Array.isArray(o.lineage)) {
45
+ o.lineage = o.lineage.map((x) => (typeof x === 'string'
46
+ ? readCapsule(x) : x));
47
+ }
48
+ return capsule.check(dir === null ? null : readCapsule(dir), o);
40
49
  }
41
50
 
42
51
  /** capsule.seal on a folder: writes noqtis.json and noqtis.sig into it. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "noqtis",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Post-quantum signatures (ML-DSA, SLH-DSA), KEMs (ML-KEM, HQC), hashes and sealed file capsules: the noqtis C library as WebAssembly",
5
5
  "keywords": [
6
6
  "post-quantum",
@@ -80,7 +80,7 @@
80
80
  },
81
81
  "scripts": {
82
82
  "build": "sh build.sh",
83
- "test": "node --test test/api.test.js test/acvp.test.js test/cap.test.js test/cjs.test.cjs test/cli.test.js",
83
+ "test": "node --test test/api.test.js test/acvp.test.js test/cap.test.js test/cap2.test.js test/card.test.js test/cjs.test.cjs test/cli.test.js",
84
84
  "types": "tsc -p test/tsconfig.json",
85
85
  "prepack": "test -f dist/noqtis.wasm && test -f dist/noqtis.js"
86
86
  },