v4.0.0: fix incorrect BLAKE2bp wrapper implementation
Note on breaking change
In BLAKE2bp initalization, instead of passing digestLength as specified by the consumer, constant BLAKE2B_OUTBYTES = 64 was always passed, and then first digestLength bytes were taken from the resulting 64-bit digest.
@jbowes added support for specifying digest length in this commit:
4d73876#diff-672b939c4bdf28c42fc7ba5da56105dbR108
but forgot to update init for BLAKE2bp, and rigged the unit test to expect the incorrect output value.
This fix warrants a major version bump (v4.0.0), as it breaks backwards compatibility with blake2bp digests shorter than 64 bytes that were created with previous versions of node-blake2. I.e. all BLAKE2bp digests shorter than 64 bytes created with older versions of this package are computed incorrectly.
Other variants (BLAKE2s, BLAKE2sp, BLAKE2b) are not affected.
Changes
- Fix incorrect BLAKE2bp wrapper implementation
- Update BLAKE2 source to BLAKE2/BLAKE2@997fa5b
- Test build on Windows and update build instructions