@bcts/crypto 1.0.0-alpha.9 → 1.0.0-beta.0

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/dist/index.d.mts CHANGED
@@ -1,62 +1,14 @@
1
1
  import { RandomNumberGenerator } from "@bcts/rand";
2
2
 
3
- //#region src/error.d.ts
4
- /**
5
- * AEAD-specific error for authentication failures
6
- */
7
- declare class AeadError extends Error {
8
- constructor(message?: string);
9
- }
10
- /**
11
- * Generic crypto error type
12
- */
13
- declare class CryptoError extends Error {
14
- readonly cause?: Error | undefined;
15
- constructor(message: string, cause?: Error);
16
- /**
17
- * Create a CryptoError for AEAD authentication failures.
18
- *
19
- * @param error - Optional underlying AeadError
20
- * @returns A CryptoError wrapping the AEAD error
21
- */
22
- static aead(error?: AeadError): CryptoError;
23
- /**
24
- * Create a CryptoError for invalid parameter values.
25
- *
26
- * @param message - Description of the invalid parameter
27
- * @returns A CryptoError describing the invalid parameter
28
- */
29
- static invalidParameter(message: string): CryptoError;
3
+ //#region src/hash.d.ts
4
+ declare namespace hash_d_exports {
5
+ export { CRC32_SIZE, SHA256_SIZE, SHA512_SIZE, crc32, crc32Data, crc32DataOpt, doubleSha256, hkdfHmacSha256, hkdfHmacSha512, hmacSha256, hmacSha512, pbkdf2HmacSha256, pbkdf2HmacSha512, sha256, sha512 };
30
6
  }
31
7
  /**
32
- * Result type for crypto operations (using standard Error)
33
- */
34
- type CryptoResult<T> = T;
35
- //#endregion
36
- //#region src/memzero.d.ts
37
- /**
38
- * Securely zero out a typed array.
39
- *
40
- * **IMPORTANT: This is a best-effort implementation.** Unlike the Rust reference
41
- * implementation which uses `std::ptr::write_volatile()` for guaranteed volatile
42
- * writes, JavaScript engines and JIT compilers can still potentially optimize
43
- * away these zeroing operations. The check at the end helps prevent optimization,
44
- * but it is not foolproof.
45
- *
46
- * For truly sensitive cryptographic operations, consider using the Web Crypto API's
47
- * `crypto.subtle` with non-extractable keys when possible, as it provides stronger
48
- * guarantees than what can be achieved with pure JavaScript.
8
+ * Copyright © 2023-2026 Blockchain Commons, LLC
9
+ * Copyright © 2025-2026 Parity Technologies
49
10
  *
50
- * This function attempts to prevent the compiler from optimizing away
51
- * the zeroing operation by using a verification check after the zeroing loop.
52
11
  */
53
- declare function memzero(data: Uint8Array | Uint32Array): void;
54
- /**
55
- * Securely zero out an array of Uint8Arrays.
56
- */
57
- declare function memzeroVecVecU8(arrays: Uint8Array[]): void;
58
- //#endregion
59
- //#region src/hash.d.ts
60
12
  declare const CRC32_SIZE = 4;
61
13
  declare const SHA256_SIZE = 32;
62
14
  declare const SHA512_SIZE = 64;
@@ -112,7 +64,97 @@ declare function hkdfHmacSha256(keyMaterial: Uint8Array, salt: Uint8Array, keyLe
112
64
  */
113
65
  declare function hkdfHmacSha512(keyMaterial: Uint8Array, salt: Uint8Array, keyLen: number): Uint8Array;
114
66
  //#endregion
67
+ //#region src/error.d.ts
68
+ /**
69
+ * Copyright © 2023-2026 Blockchain Commons, LLC
70
+ * Copyright © 2025-2026 Parity Technologies
71
+ *
72
+ */
73
+ /**
74
+ * AEAD-specific error for authentication failures
75
+ */
76
+ declare class AeadError extends Error {
77
+ constructor(message?: string);
78
+ }
79
+ /**
80
+ * Generic crypto error type
81
+ */
82
+ declare class CryptoError extends Error {
83
+ readonly cause?: Error | undefined;
84
+ constructor(message: string, cause?: Error);
85
+ /**
86
+ * Create a CryptoError for AEAD authentication failures.
87
+ *
88
+ * @param error - Optional underlying AeadError
89
+ * @returns A CryptoError wrapping the AEAD error
90
+ */
91
+ static aead(error?: AeadError): CryptoError;
92
+ /**
93
+ * Create a CryptoError for invalid parameter values.
94
+ *
95
+ * **TS-specific.** Rust's `bc_crypto::Error` enum has no
96
+ * `InvalidParameter` variant; size validation in Rust is enforced at
97
+ * compile time via fixed-size array references (e.g. `&[u8; 32]`) or
98
+ * via `panic!`/`expect(...)` for runtime checks. The TS port has no
99
+ * fixed-size array types, so it surfaces those same conditions through
100
+ * a thrown `CryptoError.invalidParameter(...)`. Catching this is
101
+ * equivalent to defensive guards around an `expect`-style panic on the
102
+ * Rust side.
103
+ *
104
+ * @param message - Description of the invalid parameter
105
+ * @returns A CryptoError describing the invalid parameter
106
+ */
107
+ static invalidParameter(message: string): CryptoError;
108
+ }
109
+ /**
110
+ * Result type for crypto operations (using standard Error)
111
+ */
112
+ type CryptoResult<T> = T;
113
+ //#endregion
114
+ //#region src/memzero.d.ts
115
+ /**
116
+ * Copyright © 2023-2026 Blockchain Commons, LLC
117
+ * Copyright © 2025-2026 Parity Technologies
118
+ *
119
+ */
120
+ /**
121
+ * Any of the integer-/float-valued typed arrays that JavaScript exposes.
122
+ * Maps to Rust's `&mut [T]` parameter on `bc_crypto::memzero<T>`.
123
+ */
124
+ type NumericTypedArray = Uint8Array | Uint8ClampedArray | Uint16Array | Uint32Array | Int8Array | Int16Array | Int32Array | Float32Array | Float64Array;
125
+ /**
126
+ * Securely zero out a typed array.
127
+ *
128
+ * Mirrors Rust `bc_crypto::memzero<T>(s: &mut [T])`. The Rust impl uses
129
+ * `std::ptr::write_volatile()` to guarantee the writes survive optimization;
130
+ * JavaScript has no equivalent primitive, so this is **best-effort** — JIT
131
+ * compilers may still elide the loop, though the post-hoc verification
132
+ * check forces the engine to keep the writes observable.
133
+ *
134
+ * For truly sensitive cryptographic operations, consider using the Web
135
+ * Crypto API's `crypto.subtle` with non-extractable keys when possible, as
136
+ * it provides stronger guarantees than what can be achieved with pure
137
+ * JavaScript.
138
+ *
139
+ * Accepts any of the standard numeric typed arrays — `Uint8Array`,
140
+ * `Uint8ClampedArray`, `Uint16Array`, `Uint32Array`, `Int8Array`,
141
+ * `Int16Array`, `Int32Array`, `Float32Array`, `Float64Array` — matching
142
+ * Rust's generic `&mut [T]`. (`BigInt64Array` / `BigUint64Array` are
143
+ * excluded because their elements are `bigint`, not `number`; if that
144
+ * support is needed, add a dedicated overload.)
145
+ */
146
+ declare function memzero(data: NumericTypedArray): void;
147
+ /**
148
+ * Securely zero out an array of Uint8Arrays.
149
+ */
150
+ declare function memzeroVecVecU8(arrays: Uint8Array[]): void;
151
+ //#endregion
115
152
  //#region src/symmetric-encryption.d.ts
153
+ /**
154
+ * Copyright © 2023-2026 Blockchain Commons, LLC
155
+ * Copyright © 2025-2026 Parity Technologies
156
+ *
157
+ */
116
158
  declare const SYMMETRIC_KEY_SIZE = 32;
117
159
  declare const SYMMETRIC_NONCE_SIZE = 12;
118
160
  declare const SYMMETRIC_AUTH_SIZE = 16;
@@ -172,8 +214,6 @@ declare function aeadChaCha20Poly1305Decrypt(ciphertext: Uint8Array, key: Uint8A
172
214
  declare function aeadChaCha20Poly1305DecryptWithAad(ciphertext: Uint8Array, key: Uint8Array, nonce: Uint8Array, aad: Uint8Array, authTag: Uint8Array): Uint8Array;
173
215
  //#endregion
174
216
  //#region src/public-key-encryption.d.ts
175
- declare const GENERIC_PRIVATE_KEY_SIZE = 32;
176
- declare const GENERIC_PUBLIC_KEY_SIZE = 32;
177
217
  declare const X25519_PRIVATE_KEY_SIZE = 32;
178
218
  declare const X25519_PUBLIC_KEY_SIZE = 32;
179
219
  /**
@@ -195,16 +235,27 @@ declare function x25519NewPrivateKeyUsing(rng: RandomNumberGenerator): Uint8Arra
195
235
  */
196
236
  declare function x25519PublicKeyFromPrivateKey(privateKey: Uint8Array): Uint8Array;
197
237
  /**
198
- * Compute a shared secret using X25519 key agreement (ECDH).
238
+ * Compute a shared symmetric key using X25519 key agreement (ECDH).
239
+ *
240
+ * This function performs X25519 Diffie-Hellman key agreement and then
241
+ * derives a symmetric key using HKDF-SHA256 with "agreement" as the salt.
242
+ * This matches the Rust bc-crypto implementation for cross-platform compatibility.
199
243
  *
200
- * **Security Note**: The resulting shared secret should be used with a KDF
201
- * (like HKDF) before using it as an encryption key. Never use the raw
202
- * shared secret directly for encryption.
244
+ * **Low-order public key handling.** The underlying `@noble/curves` X25519
245
+ * implementation rejects low-order public keys (where the u-coordinate is
246
+ * `0`) by throwing `'invalid private or public key received'`. Rust's
247
+ * `x25519-dalek` (v2.0-rc.2) instead silently produces the all-zero shared
248
+ * secret. This means an adversarial low-order public key fed in via TS
249
+ * surfaces as an exception, while in Rust it would yield an HKDF-derived
250
+ * key from a zero shared secret. For honest inputs both implementations
251
+ * produce byte-identical results; the TS port's stricter behaviour is a
252
+ * security improvement, not a parity bug.
203
253
  *
204
254
  * @param x25519Private - 32-byte X25519 private key
205
255
  * @param x25519Public - 32-byte X25519 public key from the other party
206
- * @returns 32-byte shared secret
256
+ * @returns 32-byte derived symmetric key
207
257
  * @throws {Error} If private key is not 32 bytes or public key is not 32 bytes
258
+ * @throws {Error} If the public key is low-order (`@noble/curves`-specific guard)
208
259
  */
209
260
  declare function x25519SharedKey(x25519Private: Uint8Array, x25519Public: Uint8Array): Uint8Array;
210
261
  //#endregion
@@ -249,6 +300,11 @@ declare function ecdsaDerivePrivateKey(keyMaterial: Uint8Array): Uint8Array;
249
300
  declare function schnorrPublicKeyFromPrivateKey(privateKey: Uint8Array): Uint8Array;
250
301
  //#endregion
251
302
  //#region src/ecdsa-signing.d.ts
303
+ /**
304
+ * Copyright © 2023-2026 Blockchain Commons, LLC
305
+ * Copyright © 2025-2026 Parity Technologies
306
+ *
307
+ */
252
308
  /**
253
309
  * Sign a message using ECDSA with secp256k1.
254
310
  *
@@ -353,9 +409,17 @@ declare function ed25519Sign(privateKey: Uint8Array, message: Uint8Array): Uint8
353
409
  declare function ed25519Verify(publicKey: Uint8Array, message: Uint8Array, signature: Uint8Array): boolean;
354
410
  //#endregion
355
411
  //#region src/scrypt.d.ts
412
+ /**
413
+ * Copyright © 2023-2026 Blockchain Commons, LLC
414
+ * Copyright © 2025-2026 Parity Technologies
415
+ *
416
+ */
356
417
  /**
357
418
  * Derive a key using Scrypt with recommended parameters.
358
- * Uses N=2^15 (32768), r=8, p=1 as recommended defaults.
419
+ *
420
+ * Mirrors Rust `bc_crypto::scrypt` which calls `scrypt::Params::recommended()`.
421
+ * The recommended parameters per the upstream `scrypt` crate are
422
+ * `log_n = 17` (N = 2^17 = 131072), `r = 8`, `p = 1`.
359
423
  *
360
424
  * @param password - Password or passphrase
361
425
  * @param salt - Salt value
@@ -378,26 +442,23 @@ declare function scryptOpt(password: Uint8Array, salt: Uint8Array, outputLen: nu
378
442
  //#endregion
379
443
  //#region src/argon.d.ts
380
444
  /**
381
- * Derive a key using Argon2id with default parameters.
445
+ * Copyright © 2023-2026 Blockchain Commons, LLC
446
+ * Copyright © 2025-2026 Parity Technologies
382
447
  *
383
- * @param password - Password or passphrase
384
- * @param salt - Salt value (must be at least 8 bytes)
385
- * @param outputLen - Desired output length
386
- * @returns Derived key
387
448
  */
388
- declare function argon2idHash(password: Uint8Array, salt: Uint8Array, outputLen: number): Uint8Array;
389
449
  /**
390
- * Derive a key using Argon2id with custom parameters.
450
+ * Derive a key using Argon2id with default parameters.
451
+ *
452
+ * Mirrors Rust `bc_crypto::argon2id` which calls `Argon2::default()`. The
453
+ * upstream `argon2` crate's defaults are `t = 2` iterations, `m = 19 * 1024
454
+ * = 19456` KiB of memory, `p = 1` lane (per `argon2-0.5.x/src/params.rs`).
391
455
  *
392
456
  * @param password - Password or passphrase
393
457
  * @param salt - Salt value (must be at least 8 bytes)
394
458
  * @param outputLen - Desired output length
395
- * @param iterations - Number of iterations (t)
396
- * @param memory - Memory in KiB (m)
397
- * @param parallelism - Degree of parallelism (p)
398
459
  * @returns Derived key
399
460
  */
400
- declare function argon2idHashOpt(password: Uint8Array, salt: Uint8Array, outputLen: number, iterations: number, memory: number, parallelism: number): Uint8Array;
461
+ declare function argon2id(password: Uint8Array, salt: Uint8Array, outputLen: number): Uint8Array;
401
462
  //#endregion
402
- export { AeadError, CRC32_SIZE, CryptoError, type CryptoResult, ECDSA_MESSAGE_HASH_SIZE, ECDSA_PRIVATE_KEY_SIZE, ECDSA_PUBLIC_KEY_SIZE, ECDSA_SIGNATURE_SIZE, ECDSA_UNCOMPRESSED_PUBLIC_KEY_SIZE, ED25519_PRIVATE_KEY_SIZE, ED25519_PUBLIC_KEY_SIZE, ED25519_SIGNATURE_SIZE, GENERIC_PRIVATE_KEY_SIZE, GENERIC_PUBLIC_KEY_SIZE, SCHNORR_PUBLIC_KEY_SIZE, SCHNORR_SIGNATURE_SIZE, SHA256_SIZE, SHA512_SIZE, SYMMETRIC_AUTH_SIZE, SYMMETRIC_KEY_SIZE, SYMMETRIC_NONCE_SIZE, X25519_PRIVATE_KEY_SIZE, X25519_PUBLIC_KEY_SIZE, aeadChaCha20Poly1305Decrypt, aeadChaCha20Poly1305DecryptWithAad, aeadChaCha20Poly1305Encrypt, aeadChaCha20Poly1305EncryptWithAad, argon2idHash, argon2idHashOpt, crc32, crc32Data, crc32DataOpt, deriveAgreementPrivateKey, deriveSigningPrivateKey, doubleSha256, ecdsaCompressPublicKey, ecdsaDecompressPublicKey, ecdsaDerivePrivateKey, ecdsaNewPrivateKeyUsing, ecdsaPublicKeyFromPrivateKey, ecdsaSign, ecdsaVerify, ed25519NewPrivateKeyUsing, ed25519PublicKeyFromPrivateKey, ed25519Sign, ed25519Verify, hkdfHmacSha256, hkdfHmacSha512, hmacSha256, hmacSha512, memzero, memzeroVecVecU8, pbkdf2HmacSha256, pbkdf2HmacSha512, schnorrPublicKeyFromPrivateKey, schnorrSign, schnorrSignUsing, schnorrSignWithAuxRand, schnorrVerify, scrypt, scryptOpt, sha256, sha512, x25519NewPrivateKeyUsing, x25519PublicKeyFromPrivateKey, x25519SharedKey };
463
+ export { AeadError, CRC32_SIZE, CryptoError, type CryptoResult, ECDSA_MESSAGE_HASH_SIZE, ECDSA_PRIVATE_KEY_SIZE, ECDSA_PUBLIC_KEY_SIZE, ECDSA_SIGNATURE_SIZE, ECDSA_UNCOMPRESSED_PUBLIC_KEY_SIZE, ED25519_PRIVATE_KEY_SIZE, ED25519_PUBLIC_KEY_SIZE, ED25519_SIGNATURE_SIZE, type NumericTypedArray, SCHNORR_PUBLIC_KEY_SIZE, SCHNORR_SIGNATURE_SIZE, SHA256_SIZE, SHA512_SIZE, SYMMETRIC_AUTH_SIZE, SYMMETRIC_KEY_SIZE, SYMMETRIC_NONCE_SIZE, X25519_PRIVATE_KEY_SIZE, X25519_PUBLIC_KEY_SIZE, aeadChaCha20Poly1305Decrypt, aeadChaCha20Poly1305DecryptWithAad, aeadChaCha20Poly1305Encrypt, aeadChaCha20Poly1305EncryptWithAad, argon2id, deriveAgreementPrivateKey, deriveSigningPrivateKey, doubleSha256, ecdsaCompressPublicKey, ecdsaDecompressPublicKey, ecdsaDerivePrivateKey, ecdsaNewPrivateKeyUsing, ecdsaPublicKeyFromPrivateKey, ecdsaSign, ecdsaVerify, ed25519NewPrivateKeyUsing, ed25519PublicKeyFromPrivateKey, ed25519Sign, ed25519Verify, hash_d_exports as hash, hkdfHmacSha256, hmacSha256, hmacSha512, memzero, memzeroVecVecU8, pbkdf2HmacSha256, schnorrPublicKeyFromPrivateKey, schnorrSign, schnorrSignUsing, schnorrSignWithAuxRand, schnorrVerify, scrypt, scryptOpt, sha256, sha512, x25519NewPrivateKeyUsing, x25519PublicKeyFromPrivateKey, x25519SharedKey };
403
464
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/error.ts","../src/memzero.ts","../src/hash.ts","../src/symmetric-encryption.ts","../src/public-key-encryption.ts","../src/ecdsa-keys.ts","../src/ecdsa-signing.ts","../src/schnorr-signing.ts","../src/ed25519-signing.ts","../src/scrypt.ts","../src/argon.ts"],"sourcesContent":[],"mappings":";;;;;;AAKa,cAAA,SAAA,SAAkB,KAAA,CAAK;EAUvB,WAAA,CAAA,OAAY,CAAA,EAAA,MAAA;;;;;AAyBmB,cAzB/B,WAAA,SAAoB,KAAA,CAyBW;EAzBX,SAAA,KAAA,CAAA,EACL,KADK,GAAA,SAAA;EAAK,WAAA,CAAA,OAAA,EAAA,MAAA,EAAA,KAAA,CAAA,EAGC,KAHD;EAiC1B;;;;AC9BZ;AAcA;sBDFsB,YAAY;;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;AAQ5C;;;;AC9BA;AAcA;;;;ACxBa,iBOoBG,SAAA,CPpBO,QAAA,EOqBX,UPrBW,EAAA,IAAA,EOsBf,UPtBe,EAAA,SAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,MAAA,CAAA,EO2BpB,UP3BoB;;;;;;AFHvB;AAUA;;;;AAekC,iBUlBlB,YAAA,CVkBkB,QAAA,EUjBtB,UViBsB,EAAA,IAAA,EUhB1B,UVgB0B,EAAA,SAAA,EAAA,MAAA,CAAA,EUd/B,UVc+B;;;;AAkBlC;;;;AC9BA;AAcA;;;iBSAgB,eAAA,WACJ,kBACJ,yFAKL"}
1
+ {"version":3,"file":"index.d.mts","names":[],"sources":["../src/hash.ts","../src/error.ts","../src/memzero.ts","../src/symmetric-encryption.ts","../src/public-key-encryption.ts","../src/ecdsa-keys.ts","../src/ecdsa-signing.ts","../src/schnorr-signing.ts","../src/ed25519-signing.ts","../src/scrypt.ts","../src/argon.ts"],"mappings":";;;;;;;;;;;cAca,UAAA;AAAA,cACA,WAAA;AAAA,cACA,WAAA;;;;iBAeG,KAAA,CAAM,IAAA,EAAM,UAAA;;;;iBAWZ,SAAA,CAAU,IAAA,EAAM,UAAA,GAAa,UAAA;;;;;;iBAS7B,YAAA,CAAa,IAAA,EAAM,UAAA,EAAY,YAAA,YAAwB,UAAA;;;;iBAWvD,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,UAAA;AA/C1C;;;;AAAA,iBAuDgB,YAAA,CAAa,OAAA,EAAS,UAAA,GAAa,UAAA;AAtDnD;;;AAAA,iBA6DgB,MAAA,CAAO,IAAA,EAAM,UAAA,GAAa,UAAA;;AA9C1C;;iBAqDgB,UAAA,CAAW,GAAA,EAAK,UAAA,EAAY,OAAA,EAAS,UAAA,GAAa,UAAA;;;AA1ClE;iBAiDgB,UAAA,CAAW,GAAA,EAAK,UAAA,EAAY,OAAA,EAAS,UAAA,GAAa,UAA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