'use strict';
-var ARCFourCipher = (function() {
+var ARCFourCipher = (function aRCFourCipher() {
function constructor(key) {
this.a = 0;
this.b = 0;
}
constructor.prototype = {
- encryptBlock: function(data) {
+ encryptBlock: function aRCFourCipherEncryptBlock(data) {
var i, n = data.length, tmp, tmp2;
var a = this.a, b = this.b, s = this.s;
var output = new Uint8Array(n);
return constructor;
})();
-var md5 = (function() {
+var md5 = (function md5Md5() {
var r = new Uint8Array([
7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22,
5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20,
return hash;
})();
-var NullCipher = (function() {
+var NullCipher = (function nullCipher() {
function constructor() {
}
constructor.prototype = {
- decryptBlock: function(data) {
+ decryptBlock: function nullCipherDecryptBlock(data) {
return data;
}
};
return constructor;
})();
-var AES128Cipher = (function() {
+var AES128Cipher = (function aES128Cipher() {
var rcon = new Uint8Array([
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,
}
constructor.prototype = {
- decryptBlock: function(data) {
+ decryptBlock: function aES128CipherDecryptBlock(data) {
var i, sourceLength = data.length;
var buffer = this.buffer, bufferLength = this.bufferPosition;
// waiting for IV values -- they are at the start of the stream
return constructor;
})();
-var CipherTransform = (function() {
+var CipherTransform = (function cipherTransform() {
function constructor(stringCipherConstructor, streamCipherConstructor) {
this.stringCipherConstructor = stringCipherConstructor;
this.streamCipherConstructor = streamCipherConstructor;
}
constructor.prototype = {
- createStream: function(stream) {
+ createStream: function cipherTransformCreateStream(stream) {
var cipher = new this.streamCipherConstructor();
- return new DecryptStream(stream, function(data) {
- return cipher.decryptBlock(data);
- });
+ return new DecryptStream(stream,
+ function cipherTransformDecryptStream(data) {
+ return cipher.decryptBlock(data);
+ }
+ );
},
- decryptString: function(s) {
+ decryptString: function cipherTransformDecryptString(s) {
var cipher = new this.stringCipherConstructor();
var data = stringToBytes(s);
data = cipher.decryptBlock(data);
return constructor;
})();
-var CipherTransformFactory = (function() {
+var CipherTransformFactory = (function cipherTransformFactory() {
function prepareKeyData(fileId, password, ownerPassword, userPassword,
flags, revision, keyLength, encryptMetadata) {
var defaultPasswordBytes = new Uint8Array([
if (cryptFilter != null)
cfm = cryptFilter.get('CFM');
if (!cfm || cfm.name == 'None') {
- return function() {
+ return function cipherTransformFactoryBuildCipherConstructorNone() {
return new NullCipher();
};
}
if ('V2' == cfm.name) {
- return function() {
+ return function cipherTransformFactoryBuildCipherConstructorV2() {
return new ARCFourCipher(
buildObjectKey(num, gen, key, false));
};
}
if ('AESV2' == cfm.name) {
- return function() {
+ return function cipherTransformFactoryBuildCipherConstructorAESV2() {
return new AES128Cipher(
buildObjectKey(num, gen, key, true));
};
}
constructor.prototype = {
- createCipherTransform: function(num, gen) {
+ createCipherTransform: function buildCipherCreateCipherTransform(num,
+ gen) {
if (this.algorithm == 4) {
return new CipherTransform(
buildCipherConstructor(this.cf, this.stmf,
}
// algorithms 1 and 2
var key = buildObjectKey(num, gen, this.encryptionKey, false);
- var cipherConstructor = function() {
+ var cipherConstructor = function buildCipherCipherConstructor() {
return new ARCFourCipher(key);
};
return new CipherTransform(cipherConstructor, cipherConstructor);