Skip to content

Commit a5214c4

Browse files
author
evanvosberg
committed
Remember creator on mode object and add test case.
1 parent d887ede commit a5214c4

File tree

3 files changed

+526
-2
lines changed

3 files changed

+526
-2
lines changed

src/cipher-core.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,11 +454,12 @@ CryptoJS.lib.Cipher || (function (undefined) {
454454
// Keep at least one block in the buffer for unpadding
455455
this._minBufferSize = 1;
456456
}
457-
if (this._mode && this._modeCreator == modeCreator) {
457+
458+
if (this._mode && this._mode.__creator == modeCreator) {
458459
this._mode.init(this, iv && iv.words);
459460
} else {
460461
this._mode = modeCreator.call(mode, this, iv && iv.words);
461-
this._modeCreator = modeCreator;
462+
this._mode.__creator = modeCreator;
462463
}
463464
},
464465

0 commit comments

Comments
 (0)