Skip to content
This repository has been archived by the owner on Nov 20, 2022. It is now read-only.

Commit

Permalink
Import 3.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sophiebremer committed Jul 7, 2022
1 parent c434bb4 commit 3fecefa
Show file tree
Hide file tree
Showing 128 changed files with 4,560 additions and 1,282 deletions.
12 changes: 6 additions & 6 deletions build/components/aes-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions build/components/aes.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
CryptoJS v3.0.2
CryptoJS v3.1
code.google.com/p/crypto-js
(c) 2009-2012 by Jeff Mott. All rights reserved.
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
(function () {
Expand Down
20 changes: 10 additions & 10 deletions build/components/cipher-core-min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

36 changes: 15 additions & 21 deletions build/components/cipher-core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
CryptoJS v3.0.2
CryptoJS v3.1
code.google.com/p/crypto-js
(c) 2009-2012 by Jeff Mott. All rights reserved.
(c) 2009-2013 by Jeff Mott. All rights reserved.
code.google.com/p/crypto-js/wiki/License
*/
/**
Expand Down Expand Up @@ -355,7 +355,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
var block = this._prevBlock;
}

// XOR block
// XOR blocks
for (var i = 0; i < blockSize; i++) {
words[offset + i] ^= block[i];
}
Expand Down Expand Up @@ -435,8 +435,8 @@ CryptoJS.lib.Cipher || (function (undefined) {
/**
* Configuration options.
*
* @property {Mode} mode The block mode to use. Default: CryptoJS.mode.CBC
* @property {Padding} padding The padding strategy to use. Default: CryptoJS.pad.Pkcs7
* @property {Mode} mode The block mode to use. Default: CBC
* @property {Padding} padding The padding strategy to use. Default: Pkcs7
*/
cfg: Cipher.cfg.extend({
mode: CBC,
Expand Down Expand Up @@ -583,12 +583,8 @@ CryptoJS.lib.Cipher || (function (undefined) {
} else {
var wordArray = ciphertext;
}
var openSSLStr = wordArray.toString(Base64);

// Limit lines to 64 characters
openSSLStr = openSSLStr.replace(/(.{64})/g, '$1\n');

return openSSLStr;
return wordArray.toString(Base64);
},

/**
Expand Down Expand Up @@ -632,8 +628,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
/**
* Configuration options.
*
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string.
* Default: CryptoJS.format.OpenSSL
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
*/
cfg: Base.extend({
format: OpenSSLFormatter
Expand Down Expand Up @@ -713,7 +708,7 @@ CryptoJS.lib.Cipher || (function (undefined) {

/**
* Converts serialized ciphertext to CipherParams,
* else assumes CipherParams already and returns ciphertext unchanged.
* else assumed CipherParams already and returns ciphertext unchanged.
*
* @param {CipherParams|string} ciphertext The ciphertext.
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
Expand All @@ -728,7 +723,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
*/
_parse: function (ciphertext, format) {
if (typeof ciphertext == 'string') {
return format.parse(ciphertext);
return format.parse(ciphertext, this);
} else {
return ciphertext;
}
Expand Down Expand Up @@ -758,10 +753,10 @@ CryptoJS.lib.Cipher || (function (undefined) {
*
* @example
*
* var derivedParams = CryptoJS.kdf.OpenSSL.compute('Password', 256/32, 128/32);
* var derivedParams = CryptoJS.kdf.OpenSSL.compute('Password', 256/32, 128/32, 'saltsalt');
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
* var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
*/
compute: function (password, keySize, ivSize, salt) {
execute: function (password, keySize, ivSize, salt) {
// Generate random salt
if (!salt) {
salt = WordArray.random(64/8);
Expand All @@ -787,8 +782,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
/**
* Configuration options.
*
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password.
* Default: CryptoJS.kdf.OpenSSL
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
*/
cfg: SerializableCipher.cfg.extend({
kdf: OpenSSLKdf
Expand Down Expand Up @@ -816,7 +810,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
cfg = this.cfg.extend(cfg);

// Derive key and other params
var derivedParams = cfg.kdf.compute(password, cipher.keySize, cipher.ivSize);
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);

// Add IV to config
cfg.iv = derivedParams.iv;
Expand Down Expand Up @@ -855,7 +849,7 @@ CryptoJS.lib.Cipher || (function (undefined) {
ciphertext = this._parse(ciphertext, cfg.format);

// Derive key and other params
var derivedParams = cfg.kdf.compute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);

// Add IV to config
cfg.iv = derivedParams.iv;
Expand Down
Loading

0 comments on commit 3fecefa

Please sign in to comment.