You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -236,6 +253,8 @@ Decapsulate to recover the shared secret.
236
253
-`secretKey`: Your secret key
237
254
-`ciphertext`: The ciphertext from encapsulation
238
255
- Returns: 32-byte shared secret
256
+
- Throws: `INVALID_KEY_LENGTH` if secret key has wrong length
257
+
- Throws: `INVALID_CIPHERTEXT_LENGTH` if ciphertext has wrong length
239
258
240
259
##### `params: MlKemParams`
241
260
@@ -260,13 +279,20 @@ Parameter set information:
260
279
261
280
#### 1. Install Rust
262
281
282
+
**macOS / Linux:**
283
+
263
284
```bash
264
-
# macOS / Linux
265
285
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
266
286
267
287
# Follow the prompts, then restart your terminal or run:
268
288
source$HOME/.cargo/env
289
+
```
290
+
291
+
**Windows:**
292
+
293
+
Download and run [rustup-init.exe](https://rustup.rs/). During installation, you will be prompted to install the Visual Studio C++ Build Tools — follow the instructions to install them. After installation, restart your terminal.
269
294
295
+
```bash
270
296
# Verify installation
271
297
rustc --version
272
298
cargo --version
@@ -293,7 +319,7 @@ wasm-pack --version
293
319
294
320
#### 4. Install Node.js (18+)
295
321
296
-
Download from [nodejs.org](https://nodejs.org/) or use a version manager like `nvm`.
322
+
Download from [nodejs.org](https://nodejs.org/) or use a version manager like `nvm` (macOS/Linux) or [nvm-windows](https://github.com/coreybutler/nvm-windows) (Windows).
297
323
298
324
### Build Steps
299
325
@@ -322,6 +348,7 @@ npm test
322
348
|`npm test`| Run test suite |
323
349
|`npm run test:coverage`| Run tests with coverage |
324
350
|`npm run bench`| Run benchmarks |
351
+
|`npm run lint`| Run ESLint |
325
352
|`npm run clean`| Clean build artifacts |
326
353
327
354
---
@@ -331,7 +358,7 @@ npm test
331
358
### Running Tests
332
359
333
360
```bash
334
-
# Run all JavaScript/TypeScript tests (unit + compliance)
361
+
# Run all JavaScript/TypeScript tests (unit + compliance + property-based)
335
362
npm test
336
363
337
364
# Run Rust tests
@@ -343,7 +370,14 @@ npm run test:coverage
343
370
344
371
### Test Suite
345
372
346
-
The test suite covers both Rust (`cargo test`) and JavaScript/TypeScript (`npm test`) layers, including FIPS 203 KAT (Known Answer Test) vector compliance tests that verify our ML-KEM output against pre-generated vectors from an independent implementation.
373
+
The test suite covers both Rust (`cargo test`) and JavaScript/TypeScript (`npm test`) layers:
374
+
375
+
-**Unit tests**: Comprehensive parameter validation, input validation, and functional tests for all ML-KEM variants
376
+
-**Compliance tests**: FIPS 203 KAT (Known Answer Test) vector verification against an independent implementation
377
+
-**Property-based tests**: Randomized testing with [fast-check](https://github.com/dubzzz/fast-check) to verify cryptographic properties (roundtrip correctness, determinism, seed validation) hold for arbitrary inputs
0 commit comments