bitwiseshiftleft / sjcl

Stanford Javascript Crypto Library
http://bitwiseshiftleft.github.com/sjcl/
Other
7.18k stars 987 forks source link

Scrypt not in sjcl.js and thus not available when getting from Node #348

Closed tasn closed 5 years ago

tasn commented 6 years ago

Hey,

As said in the title, the sjcl.js file is a bit outdated and doesn't include scrypt.js. Could you please regenerate that so it's available for people installing from node in the future?

Edit: it looks like just a regen doesn't include it, I guess something else is missing too, maybe it was not added to the build process?

Thanks, Tom.

elrido commented 6 years ago

I was investigating why sjcl.codec.bytes was missing and found the dependencies in the configure file. But it is missing in config.mk. If I understand the build process correctly, for scrypt support both core/scrypt.js and core/codecBytes.js would need to be added to the SOURCES.

luczsoma commented 5 years ago

Could you guys look into this?

Nilos commented 5 years ago

Scrypt is not currently part of the bundle on npm. The idea was to keep sjcl as small as possible in the default configuration and with pbkdf2 there is already one key derivation function included.

robyoder commented 5 years ago

Hey, @Nilos. With the advent of ES modules, Rollup, etc. tree shaking or dead code elimination is easier than ever before. Would you consider a PR that builds all of sjcl as ES modules (using the module entry in package.json) so that folks can install from npm and let their bundlers do the work to minimize bundle size for dead code?