Repository navigation
Releases: WaterJuice/WjCryptLib
Releases Β· WaterJuice/WjCryptLib
Release list
Version 3.0.0
- Compatibility warning: the AES-CTR fix below changes the keystream produced when the cipher is called with sub-block chunks (smaller than 16 bytes) or when a call leaves the stream index mid-block. One-shot AES-CTR encryption was already correct and is unaffected. Ciphertext written by 2.x via the chunked path is non-standard and cannot be decrypted by 3.0.0 β decrypt with the previous release and re-encrypt with 3.0.0 to migrate stored data.
- Bugfix: AES-CTR produced an incorrect keystream when called with sub-block chunks (smaller than the 16-byte block size). Ciphertext did not match other AES-CTR implementations; intra-library encrypt/decrypt still round-tripped, which had masked the defect.
- Bugfix:
Rc4InitialiseandRc4XorWithKeywere undefined behaviour whenKeySize=0. Both now returnint(-1 on invalid key, 0 otherwise). Existing callers that ignored the previousvoidreturn continue to compile. - Bugfix:
Sha512Calculate(added in 2.3.0) was implemented but never declared inWjCryptLib_Sha512.h. The declaration has been added. - Bugfix: WjCryptLibTest AES-CBC had a stack buffer overflow that corrupted the IV. The CBC algorithm itself was unaffected.
- Bugfix:
HexToBytesin WjCryptLibTest now takes aMaxDataSizeand refuses to overflow the destination buffer. Digestparameter direction corrected from[in]to[out]onSha1Finalise,Sha1Calculate,Sha256Calculate,Md5Finalise,Md5Calculate, andSha512Calculate.WjCryptLib_Sha1.cTransformFunctionworkspace is now declared asCHAR64LONG16directly rather than auint8_t[64]cast (was UB on strict-alignment targets).- Defensive
curlenbounds check inSha256UpdateandSha512Updatechanged to>=for consistency with the correspondingFinalise. AES_KEY_SIZE_128replaced withAES_BLOCK_SIZEfor the 16-byte cipher blocks inAesCtrXor.- Removed unused
STORE64Hmacro fromWjCryptLib_AesCbc.c. WjCryptLib_Aes.hdocumentation now refers to the unifiedAesInitialiserather than the non-existentAesInitialise128/192/256.- Added a
Makefileconvenience wrapper around CMake withmake build,make test,make clean, andmake help(the default target). Works on macOS, Linux, and Windows native with GNU Make. - Registered the test harness with ctest, so
make testworks regardless of cmake generator (including multi-config generators such as Visual Studio). - Added direct test coverage for the
*Calculateone-shot functions, AES-CTR sub-block chunked consistency, RC4 zero-length key rejection, andHexToBytesbounds checking.
Version 2.3.0
Version 2.3.0 - March 2018
- Added AES-CBC module.
- Added functions Md5Calculate, Sha1Calculate, Sha256Calculate, and
Sha512Calculate to calculate a hash in one call. - Added function Rc4XorWithKey to encrypt/decrypt a buffer with RC4 in
one call. - Bugfix: AesInitialise now returns -1 if invalid key size is provided.
Previously it would return 0 despite what was documented.
Version 2.2.0
* Added AES-OFB module. * File names have been changed to have the prefix `WjCryptLib_` rather than `CryptLib_`. * Removed compiled binaries from source tree.