Closed Zhiyi-Zhang closed 1 year ago
The large size can also be caused by some of our internal tools that didn't successfully compress/optimize the JS files so I want to get some insights from you.
I think one of the issues is the use of external libraries to support ciphersuites that are not covered by the Web Cryptography API. Currently, I'm refactoring the code to use only the Web Cryptography API and create a core module that is independent of external dependencies. Additionally, we are separating the cryptographic suites that rely on external libraries into extension modules outside the core.
If you do not use x25519/x448 or chacha20, you only need to use @hpke/core, which significantly reduces the size. Please refer to the following for more information.
There may be other issues with package generation as well. The npm package's support for esm/cjs dual compatibility could be affecting something. I'll also look into it on my end.
We have been using hpke-js in our library. We found the hpke-js library is big in size. Do you have some numbers for the size of the JS module?