paulmillr / noble-ciphers

Audited & minimal JS implementation of Salsa20, ChaCha and AES
https://paulmillr.com/noble
MIT License
214 stars 8 forks source link

test: probe node/crypto API in crosstest for browserify compat #44

Closed ChALkeR closed 2 weeks ago

ChALkeR commented 2 weeks ago

This allows running tests in bundle mode under different engines

In bundle, reqire('crypto') is https://www.npmjs.com/package/crypto-browserify For compatibility:

  1. Don't use iv = null, pass an empty Uint8Array instance instead to crypto.createCipheriv / crypto.createDecipheriv
  2. Check that crypto implementation supports chacha20, chacha20-poly1305, aes*-wrap before using them

To test:

Refs: https://github.com/paulmillr/noble-curves/pull/166