Skip to content

Commit 0596fae

Browse files
author
evanvosberg
committed
Merge branch 'release/3.1.9'
2 parents be8d44d + 756e722 commit 0596fae

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crypto-js",
3-
"version": "3.1.8",
3+
"version": "3.1.9",
44
"description": "JavaScript library of crypto standards.",
55
"license": "MIT",
66
"homepage": "http://github.com/brix/crypto-js",

cipher-core.js

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
;(function (root, factory) {
1+
;(function (root, factory, undef) {
22
if (typeof exports === "object") {
33
// CommonJS
4-
module.exports = exports = factory(require("./core"));
4+
module.exports = exports = factory(require("./core"), require("./evpkdf"));
55
}
66
else if (typeof define === "function" && define.amd) {
77
// AMD
8-
define(["./core"], factory);
8+
define(["./core", "./evpkdf"], factory);
99
}
1010
else {
1111
// Global (browser)
@@ -466,11 +466,16 @@
466466
var modeCreator = mode.createEncryptor;
467467
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
468468
var modeCreator = mode.createDecryptor;
469-
470469
// Keep at least one block in the buffer for unpadding
471470
this._minBufferSize = 1;
472471
}
473-
this._mode = modeCreator.call(mode, this, iv && iv.words);
472+
473+
if (this._mode && this._mode.__creator == modeCreator) {
474+
this._mode.init(this, iv && iv.words);
475+
} else {
476+
this._mode = modeCreator.call(mode, this, iv && iv.words);
477+
this._mode.__creator = modeCreator;
478+
}
474479
},
475480

476481
_doProcessBlock: function (words, offset) {

crypto-js.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3717,11 +3717,16 @@
37173717
var modeCreator = mode.createEncryptor;
37183718
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
37193719
var modeCreator = mode.createDecryptor;
3720-
37213720
// Keep at least one block in the buffer for unpadding
37223721
this._minBufferSize = 1;
37233722
}
3724-
this._mode = modeCreator.call(mode, this, iv && iv.words);
3723+
3724+
if (this._mode && this._mode.__creator == modeCreator) {
3725+
this._mode.init(this, iv && iv.words);
3726+
} else {
3727+
this._mode = modeCreator.call(mode, this, iv && iv.words);
3728+
this._mode.__creator = modeCreator;
3729+
}
37253730
},
37263731

37273732
_doProcessBlock: function (words, offset) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "crypto-js",
3-
"version": "3.1.8",
3+
"version": "3.1.9",
44
"description": "JavaScript library of crypto standards.",
55
"license": "MIT",
66
"author": {

0 commit comments

Comments
 (0)