Commit Graph
85 Commits
Author SHA1 Message Date
Tim Smart ec816aea4a Classify native Argon2 unavailability as Unsupported 2026-10-09 20:38:48 +00:00
Tim Smart 08f99f3570 Tighten Crypto comments and changeset wording 2026-10-09 20:38:48 +00:00
Tim Smart ba3d81a3ad Assert the error tag for small-order X25519 peers
Native deriveBits rejects a small-order X25519 public key with an
OperationError on Node, Bun and Deno, which currently surfaces as Unknown.
A peer's invalid key is rejected input data, so expect InvalidData.
2026-10-09 20:38:48 +00:00
Tim Smart 172b1413da Cover KDF parameter ownership after an operation starts
Mutating a PBKDF2 options object's iteration count after the operation
starts must not change the result. This currently fails on every runtime
because the Web Crypto backend reads the count after its first await.
2026-10-09 20:38:48 +00:00
Tim Smart fa05398960 Migrate Crypto tests and cover HMAC verification and backend contract 2026-10-09 20:38:48 +00:00
Tim Smart 213313da84 Narrow the Crypto backend contract and add Unsupported errors
- make takes a named Crypto.Backend: randomBytes, optional subtle, and
  optional byte-level primitives. Key operations come only from subtle,
  since a Key only works with the backend that created it. An omitted or
  undefined subtle behave the same.
- Add an Unsupported SystemErrorTag for operations and algorithms a
  backend cannot perform, separate from BadArgument caller mistakes.
- Add hmacVerify, which compares HMACs in constant time.
- Drop the bit length from HMAC key algorithms; generated keys use the
  hash block size and imported keys their material length.
- Deno computes digests with node:crypto instead of building a second
  service for MD5.
- TestCrypto builds its random members with make and delegates the rest
  through a type-checked object.
2026-10-09 20:38:47 +00:00
Tim Smart d176c06326 Migrate Crypto tests and cover public API guarantees 2026-10-09 20:38:47 +00:00
Tim Smart 8e809d73e2 Refactor Crypto backends and option shapes
Crypto.make now takes an optional Web Crypto `subtle` backend plus optional
per-operation overrides, replacing the exported makeSubtle. Operations with
no backend fail with BadArgument, so make({ randomBytes, digest }) keeps
working and custom services are no longer broken.

- pbkdf2 and hkdf take options objects; HKDF salt and info default to empty.
- Remove rsaOaepEncrypt; importKey("spki") plus encrypt covers it.
- Rename HmacAlgorithm to HashAlgorithm.
- Failed authenticated decryption and malformed key data fail with a
  SystemError tagged InvalidData; unsupported algorithms, usages, and
  missing native support fail with BadArgument.
- Node keeps createHash/createHmac overrides and drops its PBKDF2 and
  RSA-OAEP overrides in favour of webcrypto.
2026-10-09 20:38:47 +00:00
Tim Smart 97b8107341 Reduce Crypto tests to focused contract coverage
Replace per-runtime copies of the RSA-OAEP, HMAC, and PBKDF2 tests with one
shared describeCrypto suite of published known-answer vectors, following the
node-shared *.test-utils.ts convention. Drop tests that mock SubtleCrypto
internals, inspect batching or freezing, or exercise the internal HChaCha20
helper, and keep one core regression test per random-sampling fix plus one
for make's argument validation.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz f31cb6b53c Validate crypto arguments before calling platform backends 2026-10-09 20:38:47 +00:00
Sebastian Lorenz a8257a32de Batch random shuffle draws in Crypto 2026-10-09 20:38:47 +00:00
Sebastian Lorenz df9c3c0796 Buffer small random-byte requests in the Node crypto service
Each native random fill costs about as much for 4 KiB as for 7 bytes, so
serving per-draw requests from a reusable buffer makes randomShuffle about
15x faster on Node and 3x on Bun. Requests return fresh copies, consumed
bytes are zeroed, and the buffer is discarded before a V8 startup snapshot
is serialized so snapshot-started processes never share random bytes.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz a7af335c42 Add ECDH/X25519 key agreement and AES-CTR to Crypto
Add deriveSharedSecret for full-length ECDH and X25519 shared secrets,
rejecting mismatched keys and all-zero X25519 output (RFC 7748). Add
AES-CTR secret keys and cipher options, deriveBits key usage, and raw
import/export of ECDSA, ECDH, Ed25519, and X25519 public keys. Key usages
are now reported in a canonical order across backends.
2026-10-09 20:38:47 +00:00
Sebastian Lorenz 4f5902333a Address Crypto review findings
Default importJwk usages to the JWK key_ops, bound PBKDF2 iterations and
length to Web Crypto's 32-bit limits, sample narrow integer ranges without
BigInt, report a missing SubtleCrypto backend explicitly, reuse shared
digest paths in Deno, and avoid leaving XChaCha plaintext in the Buffer pool.
2026-10-09 20:38:46 +00:00
Michael Arnaldi d2e0cd0506 Add HKDF, Argon2id, XChaCha20-Poly1305, and JWK support 2026-10-09 20:38:46 +00:00
Michael Arnaldi a1a99a2b15 Expand Crypto with encryption, signing, and key management 2026-10-09 20:38:46 +00:00
Michael Arnaldi d60f8e23a0 Add portable HMAC, PBKDF2, and RSA-OAEP cryptography primitives 2026-10-09 20:38:45 +00:00
Sebastian Lorenz 9dbd07e006 Accept address and name server inputs in the Dns services (#8973) 2026-10-09 18:29:30 +00:00
effect-bot 93410da528 Add stderr terminal detection to Stdio (#8938) 2026-10-09 21:12:56 +13:00
Sebastian Lorenz d4f7dc3300 Add TLSA records to DNS services (#8953) 2026-10-09 09:02:21 +02:00
Sebastian LorenzandTim Smart a9b5148225 Add DNS resolution to effect/net (#8880)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-09 07:34:40 +02:00
Tim 8e5ab22a42 Fix Esc cancellation for CLI prompts (#8934) 2026-10-08 22:06:24 +00:00
Tim 0a6f270e21 Allow NodeTerminal fixtures time to start under CI load (#8930) 2026-10-09 09:27:28 +13:00
Tim b9e7821be3 Add DatagramSocket (UDP) module (#8409) 2026-10-08 21:16:57 +13:00
effect-botandTim Smart 182e26dae1 Add FileSystem noFollow open option and positional reads (#8900)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-10-08 06:46:46 +00:00
effect-bot 269a7c8643 Version Packages (#8744) 2026-10-07 19:23:49 +02:00
540ecd1a94 Require explicit @stability on every module and importable export (#8770)
Co-authored-by: Giulio Canti <giulio.canti@gmail.com>
Co-authored-by: Tim Smart <hello@timsmart.co>
Co-authored-by: Effect Bot <tech-ops@effectful.co>
Co-authored-by: Mattia Manzati <mattia.manzati@gmail.com>
2026-10-07 23:01:54 +13:00
Tim ec540703a5 Update repository dependencies (#8740) 2026-10-07 01:08:17 +13:00
effect-bot 460272d304 Version Packages (#8647) 2026-10-04 21:47:48 +00:00
Tim f1aedb0a67 Fix forceKillAfter cleanup after non-zero process leader exit (#8736) 2026-10-04 20:03:50 +00:00
Tim f79b23118b Fix NodeSocket re-entrant reader teardown (#8678) 2026-10-03 10:43:19 +13:00
effect-bot 67ba4e46a1 Version Packages (#8577) 2026-09-30 18:43:42 -07:00
8b0eac6ac4 Update readme files (#8634)
Co-authored-by: Maxwell Brown <maxwellbrown1990@gmail.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 18:19:46 +00:00
Maxwell BrownandClaude Opus 5.5 2c552f220e Consolidate changesets and fix stability tags (#8633)
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-30 13:59:10 -04:00
effect-bot ad61db80ef Version Packages (rc) (#8336) 2026-09-28 14:54:06 +13:00
Tim fd9095fb49 Update repository dependencies (#8562) 2026-09-28 09:25:45 +13:00
Tim 20276b3b48 Serialize NodeTerminal fixture tests (#8393) 2026-09-22 21:22:08 +00:00
Tim 1b4461ec3a Move unstable Effect modules to top-level paths (#8354) 2026-09-22 13:06:30 +12:00
effect-bot 14a3f14009 Version Packages (rc) (#8307) 2026-09-20 23:56:33 +00:00
Tim eea03fca8f Update repository dependencies (#8328) 2026-09-21 09:09:37 +12:00
effect-bot d62dd0d652 Version Packages (rc) (#8201) 2026-09-19 07:42:24 +12:00
Dan van der MerweandTim Smart 05a6405d3d fix(platform-node): clean process groups after successful leader exit (#8245)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-09-15 14:53:24 +12:00
Tim 8abae870f9 Update workspace dependencies to latest compatible releases (#8225) 2026-09-14 09:11:00 +12:00
effect-bot 4a05d4914f Version Packages (rc) (#8192) 2026-09-11 18:22:31 +02:00
effect-bot cdb3ac9171 Version Packages (rc) (#8159) 2026-09-11 15:50:54 +12:00
samandTim Smart 6d55555b83 fix(FileSystem): keep stat when optional inode exceeds MAX_SAFE_INTEGER (#8164)
Co-authored-by: Tim Smart <hello@timsmart.co>
2026-09-11 09:33:40 +12:00
effect-bot d3b837aee8 Version Packages (rc) (#8125) 2026-09-10 00:35:21 +00:00
Tim 7999b07895 Fix Content-Type preservation during HTTP compression (#8148) 2026-09-10 08:16:42 +12:00
Tim b43bfd644a Align CLI constructor names with Schema and Config (#8121) 2026-09-08 02:53:46 +00:00
Tim 7105c732f3 Revert "Version Packages (rc) (#7446)" (#8124) 2026-09-08 14:20:01 +12:00