sealed-lattice 0.0.8 → 0.0.10
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/README.md +5 -86
- package/dist/index.d.ts +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -0
- package/package.json +42 -108
- package/dist/core/bytes.d.ts +0 -2
- package/dist/core/bytes.js +0 -8
- package/dist/core/crypto.d.ts +0 -10
- package/dist/core/crypto.js +0 -18
- package/dist/core/errors.d.ts +0 -7
- package/dist/core/errors.js +0 -11
- package/dist/core/index.d.ts +0 -3
- package/dist/core/index.js +0 -3
package/README.md
CHANGED
|
@@ -1,88 +1,7 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Sealed-lattice public package
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[](https://www.npmjs.com/package/sealed-lattice)
|
|
3
|
+
This package is the only published npm surface in the workspace.
|
|
5
4
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
[](https://tenemo.github.io/sealed-lattice/coverage-summary.json)
|
|
10
|
-
[](https://github.com/Tenemo/sealed-lattice/actions/workflows/pages.yml)
|
|
11
|
-
|
|
12
|
-
---
|
|
13
|
-
|
|
14
|
-
[](https://nodejs.org/)
|
|
15
|
-
[](LICENSE)
|
|
16
|
-
|
|
17
|
-
---
|
|
18
|
-
|
|
19
|
-
`sealed-lattice` is a browser-native TypeScript package for post-quantum voting research prototypes.
|
|
20
|
-
|
|
21
|
-
The current implementation ships:
|
|
22
|
-
|
|
23
|
-
- a real `sha256Hex` helper on the safe root package
|
|
24
|
-
- a typed `UnsupportedRuntimeError` for missing Web Crypto support
|
|
25
|
-
- a hardened repo, docs, testing, and publish workflow around that narrow surface
|
|
26
|
-
- a deliberately narrow public surface while the lattice-native architecture is still being proven
|
|
27
|
-
|
|
28
|
-
This repository is a hardened research prototype. It is not audited production voting software.
|
|
29
|
-
|
|
30
|
-
## Release status
|
|
31
|
-
|
|
32
|
-
This repository currently tracks the initial public `sealed-lattice` surface.
|
|
33
|
-
|
|
34
|
-
The public surface is intentionally narrow while the repo, CI, docs, tests, coverage, and packaging experience are stabilized. Lattice cryptography, threshold flows, transport payloads, proofs, protocol types, and any future subpath structure are still being designed and are not frozen yet.
|
|
35
|
-
|
|
36
|
-
## Installation
|
|
37
|
-
|
|
38
|
-
```bash
|
|
39
|
-
pnpm add sealed-lattice
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## Runtime requirements
|
|
43
|
-
|
|
44
|
-
- Use ESM imports such as `import { sha256Hex } from 'sealed-lattice'`. The published package does not expose CommonJS `require()` entry points.
|
|
45
|
-
- Browsers need `globalThis.crypto.subtle` and `TextEncoder`.
|
|
46
|
-
- CI validates Chromium, Firefox, and WebKit on desktop, plus Chromium and WebKit in mobile emulation.
|
|
47
|
-
- Node requires version `24.14.1` or newer with `globalThis.crypto`.
|
|
48
|
-
|
|
49
|
-
## Safe quickstart
|
|
50
|
-
|
|
51
|
-
```typescript
|
|
52
|
-
import { sha256Hex } from "sealed-lattice";
|
|
53
|
-
|
|
54
|
-
const digest = await sha256Hex("sealed-lattice");
|
|
55
|
-
|
|
56
|
-
console.log(digest);
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
The root package currently exposes only `sha256Hex` and `UnsupportedRuntimeError`.
|
|
60
|
-
|
|
61
|
-
## Public package boundary
|
|
62
|
-
|
|
63
|
-
- `sealed-lattice`
|
|
64
|
-
|
|
65
|
-
No additional public subpaths are promised yet. Future capability areas such as runtime helpers, serialization, transport, threshold coordination, proofs, and protocol types remain internal design space until the post-quantum flow and misuse-resistant contracts are stable.
|
|
66
|
-
|
|
67
|
-
## Documentation
|
|
68
|
-
|
|
69
|
-
- Hosted documentation site: [tenemo.github.io/sealed-lattice](https://tenemo.github.io/sealed-lattice/)
|
|
70
|
-
- Get started: [tenemo.github.io/sealed-lattice/guides/getting-started](https://tenemo.github.io/sealed-lattice/guides/getting-started/)
|
|
71
|
-
- Browser and worker usage: [tenemo.github.io/sealed-lattice/guides/browser-and-worker-usage](https://tenemo.github.io/sealed-lattice/guides/browser-and-worker-usage/)
|
|
72
|
-
- Runtime and compatibility: [tenemo.github.io/sealed-lattice/guides/runtime-and-compatibility](https://tenemo.github.io/sealed-lattice/guides/runtime-and-compatibility/)
|
|
73
|
-
- Security and non-goals: [tenemo.github.io/sealed-lattice/guides/security-and-non-goals](https://tenemo.github.io/sealed-lattice/guides/security-and-non-goals/)
|
|
74
|
-
- API reference: [tenemo.github.io/sealed-lattice/api](https://tenemo.github.io/sealed-lattice/api/)
|
|
75
|
-
|
|
76
|
-
## Development
|
|
77
|
-
|
|
78
|
-
```bash
|
|
79
|
-
pnpm install
|
|
80
|
-
pnpm run lint
|
|
81
|
-
pnpm run tsc
|
|
82
|
-
pnpm run test
|
|
83
|
-
pnpm run build
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
## License
|
|
87
|
-
|
|
88
|
-
This project is licensed under MPL-2.0. See [LICENSE](LICENSE).
|
|
5
|
+
The current public runtime facade is intentionally empty. The package exists so
|
|
6
|
+
packaging, documentation, smoke checks, and release workflow can stabilize
|
|
7
|
+
before broader protocol-facing APIs are introduced.
|
package/dist/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
package/dist/index.js
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,110 +1,44 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"prebuild": "pnpm run lint && tsc && knip && tsx ./tools/ci/verify-vectors.ts && pnpm run test",
|
|
45
|
-
"build:dist": "pnpm exec del-cli dist && tsc --project tsconfig.build.json && tsx ./tools/build/rewrite-dist-relative-imports.ts",
|
|
46
|
-
"build:ci": "pnpm run check:node && pnpm run build:dist",
|
|
47
|
-
"build": "pnpm run build:dist",
|
|
48
|
-
"vectors:core": "tsx ./tools/generate-core-vectors.ts",
|
|
49
|
-
"docs:api": "pnpm exec del-cli docs/src/content/docs/api/reference && tsx ./node_modules/typedoc/bin/typedoc --options typedoc.config.mjs && tsx ./typedoc/postprocess-site-docs.ts",
|
|
50
|
-
"docs:dev": "pnpm run docs:api && astro dev --root docs",
|
|
51
|
-
"docs:build:site": "pnpm exec del-cli docs/dist && astro build --root docs --silent",
|
|
52
|
-
"docs:preview": "astro preview --root docs",
|
|
53
|
-
"verify:docs": "pnpm run docs:api && tsx ./typedoc/verify-docs.ts",
|
|
54
|
-
"bench:micro": "tsx ./tools/benchmarks/microbench.ts",
|
|
55
|
-
"prepare": "husky"
|
|
56
|
-
},
|
|
57
|
-
"devDependencies": {
|
|
58
|
-
"@astrojs/mdx": "^5.0.3",
|
|
59
|
-
"@astrojs/starlight": "^0.38.3",
|
|
60
|
-
"@eslint/eslintrc": "^3.3.5",
|
|
61
|
-
"@eslint/js": "^10.0.1",
|
|
62
|
-
"@fontsource/ibm-plex-sans": "^5.2.8",
|
|
63
|
-
"@fontsource/jetbrains-mono": "^5.2.8",
|
|
64
|
-
"@types/node": "^25.5.2",
|
|
65
|
-
"@typescript-eslint/eslint-plugin": "^8.58.1",
|
|
66
|
-
"@typescript-eslint/parser": "^8.58.1",
|
|
67
|
-
"@vitest/browser-playwright": "^4.1.4",
|
|
68
|
-
"@vitest/coverage-v8": "^4.1.4",
|
|
69
|
-
"astro": "^6.1.5",
|
|
70
|
-
"del-cli": "^7.0.0",
|
|
71
|
-
"eslint": "^10.2.0",
|
|
72
|
-
"eslint-config-prettier": "^10.1.8",
|
|
73
|
-
"eslint-plugin-import-x": "^4.16.2",
|
|
74
|
-
"eslint-plugin-only-error": "^1.0.2",
|
|
75
|
-
"eslint-plugin-prettier": "^5.5.5",
|
|
76
|
-
"globals": "^17.4.0",
|
|
77
|
-
"husky": "^9.1.7",
|
|
78
|
-
"knip": "^5.67.0",
|
|
79
|
-
"playwright": "^1.59.1",
|
|
80
|
-
"prettier": "^3.8.1",
|
|
81
|
-
"tsx": "^4.21.0",
|
|
82
|
-
"typedoc": "^0.28.18",
|
|
83
|
-
"typedoc-plugin-markdown": "^4.11.0",
|
|
84
|
-
"typescript": "^6.0.2",
|
|
85
|
-
"vite": "^8.0.8",
|
|
86
|
-
"vitest": "^4.1.4"
|
|
87
|
-
},
|
|
88
|
-
"engines": {
|
|
89
|
-
"node": ">=24.14.1"
|
|
90
|
-
},
|
|
91
|
-
"pnpm": {
|
|
92
|
-
"onlyBuiltDependencies": [
|
|
93
|
-
"esbuild",
|
|
94
|
-
"unrs-resolver"
|
|
95
|
-
]
|
|
96
|
-
},
|
|
97
|
-
"type": "module",
|
|
98
|
-
"keywords": [
|
|
99
|
-
"cryptography",
|
|
100
|
-
"security",
|
|
101
|
-
"post-quantum",
|
|
102
|
-
"lattice",
|
|
103
|
-
"threshold-encryption",
|
|
104
|
-
"research-prototype",
|
|
105
|
-
"webcrypto",
|
|
106
|
-
"typescript-cryptography",
|
|
107
|
-
"data-protection",
|
|
108
|
-
"privacy"
|
|
109
|
-
]
|
|
2
|
+
"name": "sealed-lattice",
|
|
3
|
+
"version": "0.0.10",
|
|
4
|
+
"description": "Published npm facade for the sealed-lattice library.",
|
|
5
|
+
"author": "Piotr Piech <piotr@piech.dev>",
|
|
6
|
+
"license": "MPL-2.0",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/index.js",
|
|
9
|
+
"types": "dist/index.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md",
|
|
13
|
+
"LICENSE"
|
|
14
|
+
],
|
|
15
|
+
"exports": {
|
|
16
|
+
".": {
|
|
17
|
+
"types": "./dist/index.d.ts",
|
|
18
|
+
"import": "./dist/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/Tenemo/sealed-lattice.git"
|
|
24
|
+
},
|
|
25
|
+
"bugs": {
|
|
26
|
+
"url": "https://github.com/Tenemo/sealed-lattice/issues"
|
|
27
|
+
},
|
|
28
|
+
"homepage": "https://tenemo.github.io/sealed-lattice/",
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=24.14.1"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"check": "tsc --project tsconfig.json --pretty false --noEmit",
|
|
34
|
+
"build": "pnpm exec del-cli dist tsconfig.tsbuildinfo && tsc --project tsconfig.json"
|
|
35
|
+
},
|
|
36
|
+
"keywords": [
|
|
37
|
+
"cryptography",
|
|
38
|
+
"security",
|
|
39
|
+
"post-quantum",
|
|
40
|
+
"lattice",
|
|
41
|
+
"threshold-encryption",
|
|
42
|
+
"voting"
|
|
43
|
+
]
|
|
110
44
|
}
|
package/dist/core/bytes.d.ts
DELETED
package/dist/core/bytes.js
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const textEncoder = new TextEncoder();
|
|
2
|
-
export const normalizeInputToBytes = (input) => {
|
|
3
|
-
if (typeof input === 'string') {
|
|
4
|
-
return Uint8Array.from(textEncoder.encode(input));
|
|
5
|
-
}
|
|
6
|
-
return Uint8Array.from(input);
|
|
7
|
-
};
|
|
8
|
-
export const bytesToHex = (bytes) => Array.from(bytes, (value) => value.toString(16).padStart(2, '0')).join('');
|
package/dist/core/crypto.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
type SupportedCrypto = Crypto & {
|
|
2
|
-
subtle: SubtleCrypto;
|
|
3
|
-
};
|
|
4
|
-
export declare const getWebCrypto: () => SupportedCrypto;
|
|
5
|
-
/**
|
|
6
|
-
* Returns the lowercase hexadecimal SHA-256 digest of the provided text or
|
|
7
|
-
* byte input.
|
|
8
|
-
*/
|
|
9
|
-
export declare const sha256Hex: (input: string | Uint8Array) => Promise<string>;
|
|
10
|
-
export {};
|
package/dist/core/crypto.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { bytesToHex, normalizeInputToBytes } from './bytes.js';
|
|
2
|
-
import { UnsupportedRuntimeError } from './errors.js';
|
|
3
|
-
const hasDigest = (value) => typeof value?.subtle?.digest === 'function';
|
|
4
|
-
export const getWebCrypto = () => {
|
|
5
|
-
const cryptoApi = globalThis.crypto;
|
|
6
|
-
if (!hasDigest(cryptoApi)) {
|
|
7
|
-
throw new UnsupportedRuntimeError();
|
|
8
|
-
}
|
|
9
|
-
return cryptoApi;
|
|
10
|
-
};
|
|
11
|
-
/**
|
|
12
|
-
* Returns the lowercase hexadecimal SHA-256 digest of the provided text or
|
|
13
|
-
* byte input.
|
|
14
|
-
*/
|
|
15
|
-
export const sha256Hex = async (input) => {
|
|
16
|
-
const digest = await getWebCrypto().subtle.digest('SHA-256', normalizeInputToBytes(input));
|
|
17
|
-
return bytesToHex(new Uint8Array(digest));
|
|
18
|
-
};
|
package/dist/core/errors.d.ts
DELETED
package/dist/core/errors.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Error thrown when the current runtime does not provide the Web Crypto API
|
|
3
|
-
* features required by the public package surface.
|
|
4
|
-
*/
|
|
5
|
-
export class UnsupportedRuntimeError extends Error {
|
|
6
|
-
constructor(message = 'sealed-lattice requires globalThis.crypto.subtle.digest.') {
|
|
7
|
-
super(message);
|
|
8
|
-
this.name = new.target.name;
|
|
9
|
-
Object.setPrototypeOf(this, new.target.prototype);
|
|
10
|
-
}
|
|
11
|
-
}
|
package/dist/core/index.d.ts
DELETED
package/dist/core/index.js
DELETED