Skip to content

Commit

Permalink
Remember creator on mode object and add test case.
Browse files Browse the repository at this point in the history
  • Loading branch information
evanvosberg committed Dec 14, 2016
1 parent d887ede commit a5214c4
Show file tree
Hide file tree
Showing 3 changed files with 526 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/cipher-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -454,11 +454,12 @@ CryptoJS.lib.Cipher || (function (undefined) {
// Keep at least one block in the buffer for unpadding
this._minBufferSize = 1;
}
if (this._mode && this._modeCreator == modeCreator) {

if (this._mode && this._mode.__creator == modeCreator) {
this._mode.init(this, iv && iv.words);
} else {
this._mode = modeCreator.call(mode, this, iv && iv.words);
this._modeCreator = modeCreator;
this._mode.__creator = modeCreator;
}
},

Expand Down
Loading

0 comments on commit a5214c4

Please sign in to comment.