v1.0.0
Added
- Added CCM block cipher mode (Counter mode/CBC-MAC)
https://nvlpubs.nist.gov/nistpubs/Legacy/SP/nistspecialpublication800-38c.pdf - Added CBC-MAC
- Added tag length option to GMAC and GCM
- Exposed
CipherParams
class to public.
Changed
Small breaking change
- Pass initializing vector as Word32Array to constructor of BlockCipherMode instead of just a 32bit number array.
*This may enable developers to use non-32bit-aligned iv value to block cipher mode in future release.
*This change may not be breaking lib compatibility unless developers directly instantiate BlockCipherMode or
creating original BlockCipherMode extending old BlockCipherMode class.// BEFORE const gcm = new GCM({cipher: AES, iv: [0x11223344]}); // AFTER const gcm = new GCM({cipher: AES, iv: new Word32Array([0x11223344], 4)});
Breaking change
- Changed GMAC hash function name from
GCM.hash()
toGCM.mac()
. - Calculating authTag in GCM now requires developer to manually call authTag function.
Encryption/Decryption and MAC Generation are now calculated independently.////////////////////// // AES-GCM ////////////////////// // BEFORE const encrypted = AES.encrypt(msg, key, { iv, mode: GCM, padding: NoPadding, authData }); encrypted.authTag !== undefined; // This returns true. authTag is automatically calculated on encryption. // AFTER const encrypted = AES.encrypt(msg, key, { iv, mode: GCM, padding: NoPadding, authData }); encrypted.authTag === undefined; // This returns true. authTag must be manually calculated as below. const authTag = GCM.mac(AES, key, iv, authData, encrypted.cipherText);