@theqrl/dilithium5 1.2.2 → 1.2.3
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 +6 -5
- package/dist/cjs/dilithium5.d.cts +7 -1
- package/dist/mjs/dilithium5.d.mts +7 -1
- package/package.json +1 -3
- package/src/index.d.ts +7 -1
package/README.md
CHANGED
|
@@ -26,10 +26,11 @@ const pk = new Uint8Array(CryptoPublicKeyBytes); // 2592 bytes
|
|
|
26
26
|
const sk = new Uint8Array(CryptoSecretKeyBytes); // 4896 bytes
|
|
27
27
|
cryptoSignKeypair(null, pk, sk); // null = random seed
|
|
28
28
|
|
|
29
|
-
// Sign a message
|
|
30
|
-
//
|
|
31
|
-
//
|
|
32
|
-
// use
|
|
29
|
+
// Sign a message. The randomized flag is required — there is no default;
|
|
30
|
+
// hedged (`true`) is the recommended mode. Pass `false` only when
|
|
31
|
+
// deterministic signatures are themselves a protocol requirement
|
|
32
|
+
// (e.g. KAT vector reproduction); for that case use
|
|
33
|
+
// `cryptoSignDeterministic`.
|
|
33
34
|
const message = new TextEncoder().encode('Hello, quantum world!');
|
|
34
35
|
const signedMessage = cryptoSign(message, sk, true); // true = hedged (recommended)
|
|
35
36
|
|
|
@@ -121,7 +122,7 @@ Check if buffer is all zeros (constant-time).
|
|
|
121
122
|
go-qrllib pre-hashes seeds with SHAKE256 before key generation. To generate matching keys:
|
|
122
123
|
|
|
123
124
|
```javascript
|
|
124
|
-
import { shake256 } from '@noble/hashes/sha3';
|
|
125
|
+
import { shake256 } from '@noble/hashes/sha3.js';
|
|
125
126
|
|
|
126
127
|
// go-qrllib: hashedSeed = SHAKE256(rawSeed)[:32]
|
|
127
128
|
const hashedSeed = shake256(rawSeed, { dkLen: 32 });
|
|
@@ -50,7 +50,7 @@ export const zetas: readonly number[];
|
|
|
50
50
|
* @throws Error if pk/sk buffers are wrong size or null
|
|
51
51
|
*/
|
|
52
52
|
export function cryptoSignKeypair(
|
|
53
|
-
seed: Uint8Array | null,
|
|
53
|
+
seed: Uint8Array | null | undefined,
|
|
54
54
|
pk: Uint8Array,
|
|
55
55
|
sk: Uint8Array
|
|
56
56
|
): Uint8Array;
|
|
@@ -187,6 +187,12 @@ export function isZero(buffer: Uint8Array): boolean;
|
|
|
187
187
|
/**
|
|
188
188
|
* Zero the coefficient arrays of a polynomial vector (best-effort, see
|
|
189
189
|
* SECURITY.md). Centralizes the secret-wiping pattern used by signing paths.
|
|
190
|
+
*
|
|
191
|
+
* @deprecated Internal API — its parameter types (`PolyVecK`/`PolyVecL`) are
|
|
192
|
+
* themselves internal and cannot be constructed through the documented
|
|
193
|
+
* surface, so this is a stable function over deprecated types. Not part of
|
|
194
|
+
* the stable documented API; will move behind a subpath or be removed at the
|
|
195
|
+
* next major version. See CONTRIBUTING.md "Public API surface policy".
|
|
190
196
|
*/
|
|
191
197
|
export function zeroizePolyVec(polyVec: PolyVecK | PolyVecL): void;
|
|
192
198
|
|
|
@@ -50,7 +50,7 @@ export const zetas: readonly number[];
|
|
|
50
50
|
* @throws Error if pk/sk buffers are wrong size or null
|
|
51
51
|
*/
|
|
52
52
|
export function cryptoSignKeypair(
|
|
53
|
-
seed: Uint8Array | null,
|
|
53
|
+
seed: Uint8Array | null | undefined,
|
|
54
54
|
pk: Uint8Array,
|
|
55
55
|
sk: Uint8Array
|
|
56
56
|
): Uint8Array;
|
|
@@ -187,6 +187,12 @@ export function isZero(buffer: Uint8Array): boolean;
|
|
|
187
187
|
/**
|
|
188
188
|
* Zero the coefficient arrays of a polynomial vector (best-effort, see
|
|
189
189
|
* SECURITY.md). Centralizes the secret-wiping pattern used by signing paths.
|
|
190
|
+
*
|
|
191
|
+
* @deprecated Internal API — its parameter types (`PolyVecK`/`PolyVecL`) are
|
|
192
|
+
* themselves internal and cannot be constructed through the documented
|
|
193
|
+
* surface, so this is a stable function over deprecated types. Not part of
|
|
194
|
+
* the stable documented API; will move behind a subpath or be removed at the
|
|
195
|
+
* next major version. See CONTRIBUTING.md "Public API surface policy".
|
|
190
196
|
*/
|
|
191
197
|
export function zeroizePolyVec(polyVec: PolyVecK | PolyVecL): void;
|
|
192
198
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theqrl/dilithium5",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.3",
|
|
4
4
|
"description": "Dilithium-5 cryptography",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"dilithium",
|
|
@@ -34,8 +34,6 @@
|
|
|
34
34
|
"test": "../../node_modules/mocha/bin/mocha.js --require ../../scripts/node-test-setup.cjs --timeout 10000",
|
|
35
35
|
"test:browser": "playwright test",
|
|
36
36
|
"build": "rollup -c && ./fixup",
|
|
37
|
-
"lint-check": "eslint 'src/**/*.js' 'test/**/*.js'",
|
|
38
|
-
"lint": "eslint --fix 'src/**/*.js' 'test/**/*.js'",
|
|
39
37
|
"coverage": "c8 npm run test",
|
|
40
38
|
"report-coverage": "c8 --reporter=text-lcov npm run test > coverage.lcov"
|
|
41
39
|
},
|
package/src/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export const zetas: readonly number[];
|
|
|
50
50
|
* @throws Error if pk/sk buffers are wrong size or null
|
|
51
51
|
*/
|
|
52
52
|
export function cryptoSignKeypair(
|
|
53
|
-
seed: Uint8Array | null,
|
|
53
|
+
seed: Uint8Array | null | undefined,
|
|
54
54
|
pk: Uint8Array,
|
|
55
55
|
sk: Uint8Array
|
|
56
56
|
): Uint8Array;
|
|
@@ -187,6 +187,12 @@ export function isZero(buffer: Uint8Array): boolean;
|
|
|
187
187
|
/**
|
|
188
188
|
* Zero the coefficient arrays of a polynomial vector (best-effort, see
|
|
189
189
|
* SECURITY.md). Centralizes the secret-wiping pattern used by signing paths.
|
|
190
|
+
*
|
|
191
|
+
* @deprecated Internal API — its parameter types (`PolyVecK`/`PolyVecL`) are
|
|
192
|
+
* themselves internal and cannot be constructed through the documented
|
|
193
|
+
* surface, so this is a stable function over deprecated types. Not part of
|
|
194
|
+
* the stable documented API; will move behind a subpath or be removed at the
|
|
195
|
+
* next major version. See CONTRIBUTING.md "Public API surface policy".
|
|
190
196
|
*/
|
|
191
197
|
export function zeroizePolyVec(polyVec: PolyVecK | PolyVecL): void;
|
|
192
198
|
|