400 Commits

Author SHA1 Message Date
larabr
6ac17dc71c 6.0.0-beta.3.patch.1 2024-09-11 10:57:20 +02:00
larabr
2b9a07e840 Run npm audit 2024-09-11 10:42:37 +02:00
larabr
0255fcba86 CI: update playwright to test latest browser versions 2024-09-11 10:39:51 +02:00
larabr
f2818429db 6.0.0-beta.3.patch.0 2024-09-09 11:47:41 +02:00
larabr
a3839f6db5 6.0.0-beta.3 2024-09-05 13:24:51 +02:00
larabr
e7b7f6c6b1 Run npm update 2024-09-05 13:20:56 +02:00
larabr
5fd7ef370f
Drop asmcrypto.js for AES fallbacks in favor of noble-ciphers (#1785)
Asm.js has now been deprecated for many years, and no performance gain is
recorded for AES compared to vanilla JS.
The relevant AES fallback code is primarily used if the WebCrypto (resp.
NodeCrypto) implementation is not available.
2024-08-21 12:59:23 +02:00
larabr
c0b35306cb 6.0.0-beta.2 2024-07-05 15:12:14 +02:00
larabr
8d11c5fd0f Drop support for Node 16 and 17 2024-06-26 12:01:10 +02:00
larabr
4026e24585 Merge branch 'main' into v6 2024-06-18 19:21:16 +02:00
larabr
a0337780b7 5.11.2 2024-06-18 17:53:56 +02:00
larabr
6ace4a00f5 Update web-stream-tools to fix passiveClone cancellation race condition in tests
Affecting tests over streamed detached verification
2024-06-18 10:16:33 +02:00
larabr
d138b5290b 6.0.0-beta.1 2024-05-17 14:13:46 +02:00
larabr
1d732c34ff Run npm update 2024-05-17 13:04:47 +02:00
larabr
6a306a1797 Lint: add support for dep imports that use exports declarations 2024-05-17 13:00:37 +02:00
larabr
cf0285add5 Drop BigInteger class, use standalone helpers 2024-05-16 13:59:11 +02:00
larabr
90495522f7 CI: update Browserstack legacy targets (drop Safari 13) 2024-05-16 13:59:11 +02:00
larabr
2985b0f470 Lint: add support for TS files, fix errors 2024-05-16 13:59:11 +02:00
larabr
ec52bdea83 Point to official noble-hashes and noble-curve libs 2024-05-16 13:59:11 +02:00
larabr
d1a24d1758 Drop support for platforms without native BigInt (e.g. Safari <14)
Remove BN.js fallback, and only keep native BigInteger interface
(for algorithmic constant-time functions).
Also, add support for TS modules, to move some over from the forked
noble repos.
2024-05-16 13:59:11 +02:00
larabr
2bf7c92469 6.0.0-beta.0 2024-04-12 14:28:06 +02:00
larabr
231fbbe8ca Run npm update 2024-04-09 19:07:58 +02:00
larabr
9a53ac15df Tests: bump Sinon to v17 2024-04-09 18:57:53 +02:00
larabr
147d043a32 6.0.0-alpha.1 2024-02-28 13:22:22 +01:00
larabr
15adf84a7d Run npm update 2024-02-28 12:44:05 +01:00
larabr
151f15e282
Node: drop asn1.js dependency (#1722)
asn1.js is a fairly large lib and was simply needed to handle DER encodings in
some NodeCrypto operations.
This change replaces the dependency by moving to:

- JWT encoding for RSA (support added in Node v15)
- a much lighter dependency (eckey-utils) for ECDSA, where JWT cannot be used
for now, as Node has yet to add decoding support for Brainpool curves.

The change also allows us to drop BN.js as a direct dependency, optimising the
BigInteger-related chunking in the lightweight build.
2024-02-27 14:56:07 +01:00
larabr
a6283e64cc Drop internal cipher/aes module
The module was barely used, and its presence confusing, since
WebCrypto or asmcrypto are often directly used and usable instead.
Also, use AES_CBC instead of AES_ECB for single-block encryption,
so that we can drop support for the latter in the asmcrypto lib.
2024-02-27 14:43:24 +01:00
larabr
026b348cf8 5.11.1 2024-02-19 17:23:54 +01:00
larabr
6370e0b2d3 CI: fix typescript test runner issues by switching to tsx from ts-node
ts-node is still needed for mocha to work with the different versions of Node
(passing --import in NODE_OPTIONS is not supported in older versions).
2024-02-01 10:38:01 +01:00
larabr
6bfb557ca6 Update Rollup to v4 2024-02-01 10:23:50 +01:00
larabr
99899d1d5c
Drop support for native Node Readable stream: require passing Node Web Streams (#1716)
Breaking change: all functions taking streams as inputs will now require passing Web Streams in Node.js . If given a native `stream.Readable` input, they will throw. The browser build is unaffected by this change.

Utils to convert from and to Web Streams in Node are available from v17,
see https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options .
Previously, we automatically converted between Node native streams and custom, Web-like Readable streams.
This led to occasional issues.
2024-01-26 17:52:29 +01:00
larabr
e92b44bc84 CI (temp): fix typescript test runner failure due to ts-node bug
This fix triggers some warnings about experimental features,
and it's meant to be temporary until ts-node shares a long-term solutio .

See https://github.com/TypeStrong/ts-node/issues/2094.
2023-12-08 15:10:27 +01:00
larabr
c754fac10f CI: replace nyc with c8 as coverage tool
Unclear if nyc is still actively maintained, and it does not seem
to work with ESM out of the box.
2023-12-08 14:53:19 +01:00
larabr
e93702bb8d Fix types path for lightweight build [skip ci] 2023-11-21 17:34:59 +01:00
larabr
7881b850ec 6.0.0-alpha.0 2023-10-25 12:55:43 +02:00
larabr
30635c72e8 Lint: error on unnecessary switch-case braces
Also fix some indent issues with armoring code detected after required ESLint update.

s
2023-10-25 12:53:15 +02:00
larabr
9a547b4553 Update rollup to v3 2023-10-25 12:53:14 +02:00
larabr
5456211266 Simplify userID parsing based on conventions, drop third-party parsing lib
Follow conventions as per https://datatracker.ietf.org/doc/draft-dkg-openpgp-userid-conventions
2023-10-25 12:53:14 +02:00
larabr
a56a4a16e8 Use internal tweetnacl SHA-512 implementation
Instead of relying on externally provided one (no async loading supported)
2023-10-25 12:53:14 +02:00
larabr
a9fae5ff12 Replace indutny-elliptic lib with noble-curves
Unlike elliptic, noble-curves targets algorithmic constant time, and
it relies on the native BigInts when available, resulting in a smaller bundle
and improved performance.

Also, expand testing of fallback elliptic implementation.
2023-10-25 12:53:14 +02:00
larabr
1ebf7034f5 crypto-refresh: add support for Ed448 2023-10-25 12:53:13 +02:00
larabr
538b5b6304 Set Node 16 as minimum supported version in package.json 2023-10-25 12:53:11 +02:00
larabr
e07a0c432a Replace hash.js with noble-hashes 2023-10-25 12:53:11 +02:00
larabr
b3ef95e60e Tests: update sinon 2023-10-25 12:53:11 +02:00
larabr
21a6d83ec8 Update asmcrypto.js, use for AES only (move to noble-hashes for sha1, sha256) 2023-10-25 12:53:10 +02:00
larabr
0b2767fe4c Replace pako with fflate as compression lib
fflate already supports ESM and is actively maintained
2023-10-25 12:53:10 +02:00
larabr
d49d92e5cb Update to Mocha v10 in tests, declare lib as module and add exports to package.json
Mocha v10 requires the lib to be esm compliant.
ESM mandates the use of file extensions in imports, so to minimize the
changes (for now), we rely on the flag `experimental-specifier-resolution=node`
and on `ts-node` (needed only for Node 20).

Breaking changes:
downstream bundlers might be affected by the package.json changes depending on
how they load the library.
NB: legacy package.json entrypoints are still available.
2023-10-25 12:53:10 +02:00
larabr
ebf22f2ee7 crypto-refresh: add support for Argon2 S2K (#1597)
In terms of API, this feature is backwards compatible, no breaking changes.
However, since a Wasm module is loaded for the Argon2 computation, browser apps
might need to make changes to their CSP policy in order to use the feature.

Newly introduced config fields:
- `config.s2kType` (defaulting to `enums.s2k.iterated`): s2k to use on
password-based encryption as well as private key encryption;
- `config.s2kArgon2Params` (defaulting to "uniformly safe settings" from Argon
RFC): parameters to use on encryption when `config.s2kType` is set to
`enums.s2k.argon2`;
2023-10-25 12:53:10 +02:00
Daniel Huigens
cec4e029f0 Update web-stream-tools 2023-10-25 12:53:10 +02:00
larabr
7003d19c71 5.11.0 2023-10-25 12:04:48 +02:00