pdfjs-dist 2.3.200 → 2.4.456

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of pdfjs-dist might be problematic. Click here for more details.

Files changed (185) hide show
  1. package/README.md +4 -0
  2. package/bower.json +1 -1
  3. package/build/pdf.js +6499 -17971
  4. package/build/pdf.js.map +1 -1
  5. package/build/pdf.min.js +22 -1
  6. package/build/pdf.worker.entry.js +5 -3
  7. package/build/pdf.worker.js +19303 -29896
  8. package/build/pdf.worker.js.map +1 -1
  9. package/build/pdf.worker.min.js +22 -1
  10. package/es5/build/pdf.js +25473 -0
  11. package/es5/build/pdf.js.map +1 -0
  12. package/{lib/shared/global_scope.js → es5/build/pdf.worker.entry.js} +5 -10
  13. package/es5/build/pdf.worker.js +57878 -0
  14. package/es5/build/pdf.worker.js.map +1 -0
  15. package/es5/web/images/annotation-check.svg +11 -0
  16. package/es5/web/images/annotation-comment.svg +16 -0
  17. package/es5/web/images/annotation-help.svg +26 -0
  18. package/es5/web/images/annotation-insert.svg +10 -0
  19. package/es5/web/images/annotation-key.svg +11 -0
  20. package/es5/web/images/annotation-newparagraph.svg +11 -0
  21. package/es5/web/images/annotation-noicon.svg +7 -0
  22. package/es5/web/images/annotation-note.svg +42 -0
  23. package/es5/web/images/annotation-paragraph.svg +16 -0
  24. package/es5/web/images/loading-icon.gif +0 -0
  25. package/es5/web/images/shadow.png +0 -0
  26. package/es5/web/images/texture.png +0 -0
  27. package/es5/web/pdf_viewer.css +407 -0
  28. package/es5/web/pdf_viewer.js +7757 -0
  29. package/es5/web/pdf_viewer.js.map +1 -0
  30. package/image_decoders/pdf.image_decoders.js +1333 -4839
  31. package/image_decoders/pdf.image_decoders.js.map +1 -1
  32. package/image_decoders/pdf.image_decoders.min.js +22 -1
  33. package/lib/README.md +7 -0
  34. package/lib/core/annotation.js +683 -1066
  35. package/lib/core/arithmetic_decoder.js +81 -97
  36. package/lib/core/bidi.js +54 -46
  37. package/lib/core/ccitt.js +88 -81
  38. package/lib/core/ccitt_stream.js +15 -14
  39. package/lib/core/cff_parser.js +196 -193
  40. package/lib/core/charsets.js +4 -4
  41. package/lib/core/chunked_stream.js +441 -569
  42. package/lib/core/cmap.js +220 -279
  43. package/lib/core/colorspace.js +699 -863
  44. package/lib/core/core_utils.js +59 -80
  45. package/lib/core/crypto.js +379 -437
  46. package/lib/core/document.js +564 -673
  47. package/lib/core/encodings.js +15 -15
  48. package/lib/core/evaluator.js +983 -889
  49. package/lib/core/font_renderer.js +128 -171
  50. package/lib/core/fonts.js +451 -400
  51. package/lib/core/function.js +289 -285
  52. package/lib/core/glyphlist.js +4527 -4527
  53. package/lib/core/image.js +138 -117
  54. package/lib/core/image_utils.js +46 -63
  55. package/lib/core/jbig2.js +324 -332
  56. package/lib/core/jbig2_stream.js +18 -17
  57. package/lib/core/jpeg_stream.js +133 -24
  58. package/lib/core/jpg.js +238 -210
  59. package/lib/core/jpx.js +158 -157
  60. package/lib/core/jpx_stream.js +28 -28
  61. package/lib/core/metrics.js +2928 -2928
  62. package/lib/core/murmurhash3.js +87 -102
  63. package/lib/core/obj.js +1111 -1302
  64. package/lib/core/operator_list.js +55 -42
  65. package/lib/core/parser.js +956 -987
  66. package/lib/core/pattern.js +69 -69
  67. package/lib/core/pdf_manager.js +149 -316
  68. package/lib/core/primitives.js +45 -77
  69. package/lib/core/ps_parser.js +175 -214
  70. package/lib/core/standard_fonts.js +237 -236
  71. package/lib/core/stream.js +83 -77
  72. package/lib/core/type1_parser.js +78 -68
  73. package/lib/core/unicode.js +1654 -1654
  74. package/lib/core/worker.js +148 -196
  75. package/lib/core/worker_stream.js +101 -210
  76. package/lib/display/annotation_layer.js +733 -1155
  77. package/lib/display/api.js +1539 -1928
  78. package/lib/display/api_compatibility.js +10 -8
  79. package/lib/display/canvas.js +159 -158
  80. package/lib/display/content_disposition.js +36 -55
  81. package/lib/display/display_utils.js +298 -551
  82. package/lib/display/fetch_stream.js +181 -305
  83. package/lib/display/font_loader.js +273 -416
  84. package/lib/display/metadata.js +86 -98
  85. package/lib/display/network.js +376 -511
  86. package/lib/display/network_utils.js +20 -19
  87. package/lib/display/node_stream.js +276 -460
  88. package/lib/display/pattern_helper.js +76 -44
  89. package/lib/display/svg.js +1137 -1405
  90. package/lib/display/text_layer.js +75 -82
  91. package/lib/display/transport_stream.js +236 -374
  92. package/lib/display/webgl.js +70 -83
  93. package/lib/display/worker_options.js +3 -3
  94. package/lib/display/xml_parser.js +303 -392
  95. package/lib/examples/node/domstubs.js +37 -37
  96. package/lib/pdf.js +22 -21
  97. package/lib/pdf.worker.js +5 -5
  98. package/lib/shared/compatibility.js +2 -251
  99. package/lib/shared/is_node.js +7 -6
  100. package/lib/shared/message_handler.js +222 -194
  101. package/lib/shared/util.js +269 -405
  102. package/lib/test/unit/annotation_spec.js +1089 -1014
  103. package/lib/test/unit/api_spec.js +617 -544
  104. package/lib/test/unit/bidi_spec.js +7 -7
  105. package/lib/test/unit/cff_parser_spec.js +63 -62
  106. package/lib/test/unit/clitests_helper.js +7 -9
  107. package/lib/test/unit/cmap_spec.js +84 -86
  108. package/lib/test/unit/colorspace_spec.js +154 -154
  109. package/lib/test/unit/core_utils_spec.js +125 -105
  110. package/lib/test/unit/crypto_spec.js +181 -181
  111. package/lib/test/unit/custom_spec.js +22 -24
  112. package/lib/test/unit/display_svg_spec.js +35 -36
  113. package/lib/test/unit/display_utils_spec.js +139 -149
  114. package/lib/test/unit/document_spec.js +16 -16
  115. package/lib/test/unit/encodings_spec.js +12 -34
  116. package/lib/test/unit/evaluator_spec.js +81 -95
  117. package/lib/test/unit/fetch_stream_spec.js +30 -30
  118. package/lib/test/unit/function_spec.js +206 -204
  119. package/lib/test/unit/jasmine-boot.js +48 -32
  120. package/lib/test/unit/message_handler_spec.js +172 -162
  121. package/lib/test/unit/metadata_spec.js +69 -69
  122. package/lib/test/unit/murmurhash3_spec.js +12 -12
  123. package/lib/test/unit/network_spec.js +12 -12
  124. package/lib/test/unit/network_utils_spec.js +152 -152
  125. package/lib/test/unit/node_stream_spec.js +74 -90
  126. package/lib/test/unit/parser_spec.js +107 -113
  127. package/lib/test/unit/pdf_find_controller_spec.js +55 -86
  128. package/lib/test/unit/pdf_find_utils_spec.js +32 -32
  129. package/lib/test/unit/pdf_history_spec.js +32 -32
  130. package/lib/test/unit/primitives_spec.js +117 -115
  131. package/lib/test/unit/stream_spec.js +16 -14
  132. package/lib/test/unit/test_utils.js +119 -285
  133. package/lib/test/unit/testreporter.js +19 -19
  134. package/lib/test/unit/type1_parser_spec.js +41 -41
  135. package/lib/test/unit/ui_utils_spec.js +318 -426
  136. package/lib/test/unit/unicode_spec.js +42 -42
  137. package/lib/test/unit/util_spec.js +122 -143
  138. package/lib/web/annotation_layer_builder.js +66 -103
  139. package/lib/web/app.js +1166 -1196
  140. package/lib/web/app_options.js +61 -77
  141. package/lib/web/base_viewer.js +804 -850
  142. package/lib/web/chromecom.js +164 -249
  143. package/lib/web/debugger.js +149 -205
  144. package/lib/web/download_manager.js +38 -57
  145. package/lib/web/firefox_print_service.js +35 -30
  146. package/lib/web/firefoxcom.js +175 -374
  147. package/lib/web/genericcom.js +26 -108
  148. package/lib/web/genericl10n.js +24 -153
  149. package/lib/web/grab_to_pan.js +30 -30
  150. package/lib/web/interfaces.js +80 -258
  151. package/lib/web/overlay_manager.js +70 -246
  152. package/lib/web/password_prompt.js +38 -64
  153. package/lib/web/pdf_attachment_viewer.js +105 -130
  154. package/lib/web/pdf_cursor_tools.js +75 -102
  155. package/lib/web/pdf_document_properties.js +227 -376
  156. package/lib/web/pdf_find_bar.js +137 -171
  157. package/lib/web/pdf_find_controller.js +492 -549
  158. package/lib/web/pdf_find_utils.js +13 -13
  159. package/lib/web/pdf_history.js +395 -406
  160. package/lib/web/pdf_link_service.js +302 -349
  161. package/lib/web/pdf_outline_viewer.js +148 -209
  162. package/lib/web/pdf_page_view.js +449 -507
  163. package/lib/web/pdf_presentation_mode.js +304 -357
  164. package/lib/web/pdf_print_service.js +90 -104
  165. package/lib/web/pdf_rendering_queue.js +87 -108
  166. package/lib/web/pdf_sidebar.js +264 -304
  167. package/lib/web/pdf_sidebar_resizer.js +92 -119
  168. package/lib/web/pdf_single_page_viewer.js +77 -126
  169. package/lib/web/pdf_thumbnail_view.js +276 -297
  170. package/lib/web/pdf_thumbnail_viewer.js +186 -206
  171. package/lib/web/pdf_viewer.component.js +20 -21
  172. package/lib/web/pdf_viewer.js +55 -115
  173. package/lib/web/preferences.js +66 -273
  174. package/lib/web/secondary_toolbar.js +164 -196
  175. package/lib/web/text_layer_builder.js +284 -317
  176. package/lib/web/toolbar.js +216 -211
  177. package/lib/web/ui_utils.js +303 -404
  178. package/lib/web/view_history.js +49 -222
  179. package/lib/web/viewer_compatibility.js +7 -5
  180. package/package.json +2 -9
  181. package/web/pdf_viewer.css +25 -18
  182. package/web/pdf_viewer.js +3481 -4764
  183. package/web/pdf_viewer.js.map +1 -1
  184. package/webpack.js +14 -5
  185. package/lib/shared/streams_polyfill.js +0 -43
@@ -2,7 +2,7 @@
2
2
  * @licstart The following is the entire license notice for the
3
3
  * Javascript code in this page
4
4
  *
5
- * Copyright 2019 Mozilla Foundation
5
+ * Copyright 2020 Mozilla Foundation
6
6
  *
7
7
  * Licensed under the Apache License, Version 2.0 (the "License");
8
8
  * you may not use this file except in compliance with the License.
@@ -26,29 +26,11 @@ Object.defineProperty(exports, "__esModule", {
26
26
  });
27
27
  exports.calculateSHA512 = exports.calculateSHA384 = exports.calculateSHA256 = exports.calculateMD5 = exports.PDF20 = exports.PDF17 = exports.CipherTransformFactory = exports.ARCFourCipher = exports.AES256Cipher = exports.AES128Cipher = void 0;
28
28
 
29
- var _util = require("../shared/util");
29
+ var _util = require("../shared/util.js");
30
30
 
31
- var _primitives = require("./primitives");
31
+ var _primitives = require("./primitives.js");
32
32
 
33
- var _stream = require("./stream");
34
-
35
- function _typeof(obj) { if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
36
-
37
- function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
38
-
39
- function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
40
-
41
- function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
42
-
43
- function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
44
-
45
- function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
46
-
47
- function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
48
-
49
- function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
50
-
51
- function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
33
+ var _stream = require("./stream.js");
52
34
 
53
35
  var ARCFourCipher = function ARCFourCipherClosure() {
54
36
  function ARCFourCipher(key) {
@@ -66,7 +48,7 @@ var ARCFourCipher = function ARCFourCipherClosure() {
66
48
 
67
49
  for (i = 0; i < 256; ++i) {
68
50
  tmp = s[i];
69
- j = j + tmp + key[i % keyLength] & 0xFF;
51
+ j = j + tmp + key[i % keyLength] & 0xff;
70
52
  s[i] = s[j];
71
53
  s[j] = tmp;
72
54
  }
@@ -86,13 +68,13 @@ var ARCFourCipher = function ARCFourCipherClosure() {
86
68
  var output = new Uint8Array(n);
87
69
 
88
70
  for (i = 0; i < n; ++i) {
89
- a = a + 1 & 0xFF;
71
+ a = a + 1 & 0xff;
90
72
  tmp = s[a];
91
- b = b + tmp & 0xFF;
73
+ b = b + tmp & 0xff;
92
74
  tmp2 = s[b];
93
75
  s[a] = tmp2;
94
76
  s[b] = tmp;
95
- output[i] = data[i] ^ s[tmp + tmp2 & 0xFF];
77
+ output[i] = data[i] ^ s[tmp + tmp2 & 0xff];
96
78
  }
97
79
 
98
80
  this.a = a;
@@ -130,11 +112,11 @@ var calculateMD5 = function calculateMD5Closure() {
130
112
  padded[i++] = 0;
131
113
  }
132
114
 
133
- padded[i++] = length << 3 & 0xFF;
134
- padded[i++] = length >> 5 & 0xFF;
135
- padded[i++] = length >> 13 & 0xFF;
136
- padded[i++] = length >> 21 & 0xFF;
137
- padded[i++] = length >>> 29 & 0xFF;
115
+ padded[i++] = length << 3 & 0xff;
116
+ padded[i++] = length >> 5 & 0xff;
117
+ padded[i++] = length >> 13 & 0xff;
118
+ padded[i++] = length >> 21 & 0xff;
119
+ padded[i++] = length >>> 29 & 0xff;
138
120
  padded[i++] = 0;
139
121
  padded[i++] = 0;
140
122
  padded[i++] = 0;
@@ -250,7 +232,7 @@ var Word64 = function Word64Closure() {
250
232
  var lowAdd = (this.low >>> 0) + (word.low >>> 0);
251
233
  var highAdd = (this.high >>> 0) + (word.high >>> 0);
252
234
 
253
- if (lowAdd > 0xFFFFFFFF) {
235
+ if (lowAdd > 0xffffffff) {
254
236
  highAdd += 1;
255
237
  }
256
238
 
@@ -258,14 +240,14 @@ var Word64 = function Word64Closure() {
258
240
  this.high = highAdd | 0;
259
241
  },
260
242
  copyTo: function Word64_copyTo(bytes, offset) {
261
- bytes[offset] = this.high >>> 24 & 0xFF;
262
- bytes[offset + 1] = this.high >> 16 & 0xFF;
263
- bytes[offset + 2] = this.high >> 8 & 0xFF;
264
- bytes[offset + 3] = this.high & 0xFF;
265
- bytes[offset + 4] = this.low >>> 24 & 0xFF;
266
- bytes[offset + 5] = this.low >> 16 & 0xFF;
267
- bytes[offset + 6] = this.low >> 8 & 0xFF;
268
- bytes[offset + 7] = this.low & 0xFF;
243
+ bytes[offset] = this.high >>> 24 & 0xff;
244
+ bytes[offset + 1] = this.high >> 16 & 0xff;
245
+ bytes[offset + 2] = this.high >> 8 & 0xff;
246
+ bytes[offset + 3] = this.high & 0xff;
247
+ bytes[offset + 4] = this.low >>> 24 & 0xff;
248
+ bytes[offset + 5] = this.low >> 16 & 0xff;
249
+ bytes[offset + 6] = this.low >> 8 & 0xff;
250
+ bytes[offset + 7] = this.low & 0xff;
269
251
  },
270
252
  assign: function Word64_assign(word) {
271
253
  this.high = word.high;
@@ -333,11 +315,11 @@ var calculateSHA256 = function calculateSHA256Closure() {
333
315
  padded[i++] = 0;
334
316
  padded[i++] = 0;
335
317
  padded[i++] = 0;
336
- padded[i++] = length >>> 29 & 0xFF;
337
- padded[i++] = length >> 21 & 0xFF;
338
- padded[i++] = length >> 13 & 0xFF;
339
- padded[i++] = length >> 5 & 0xFF;
340
- padded[i++] = length << 3 & 0xFF;
318
+ padded[i++] = length >>> 29 & 0xff;
319
+ padded[i++] = length >> 21 & 0xff;
320
+ padded[i++] = length >> 13 & 0xff;
321
+ padded[i++] = length >> 5 & 0xff;
322
+ padded[i++] = length << 3 & 0xff;
341
323
  var w = new Uint32Array(64);
342
324
 
343
325
  for (i = 0; i < paddedLength;) {
@@ -509,11 +491,11 @@ var calculateSHA512 = function calculateSHA512Closure() {
509
491
  padded[i++] = 0;
510
492
  padded[i++] = 0;
511
493
  padded[i++] = 0;
512
- padded[i++] = length >>> 29 & 0xFF;
513
- padded[i++] = length >> 21 & 0xFF;
514
- padded[i++] = length >> 13 & 0xFF;
515
- padded[i++] = length >> 5 & 0xFF;
516
- padded[i++] = length << 3 & 0xFF;
494
+ padded[i++] = length >>> 29 & 0xff;
495
+ padded[i++] = length >> 21 & 0xff;
496
+ padded[i++] = length >> 13 & 0xff;
497
+ padded[i++] = length >> 5 & 0xff;
498
+ padded[i++] = length << 3 & 0xff;
517
499
  var w = new Array(80);
518
500
 
519
501
  for (i = 0; i < 80; i++) {
@@ -645,14 +627,10 @@ var NullCipher = function NullCipherClosure() {
645
627
  return NullCipher;
646
628
  }();
647
629
 
648
- var AESBaseCipher =
649
- /*#__PURE__*/
650
- function () {
651
- function AESBaseCipher() {
652
- _classCallCheck(this, AESBaseCipher);
653
-
630
+ class AESBaseCipher {
631
+ constructor() {
654
632
  if (this.constructor === AESBaseCipher) {
655
- (0, _util.unreachable)('Cannot initialize AESBaseCipher.');
633
+ (0, _util.unreachable)("Cannot initialize AESBaseCipher.");
656
634
  }
657
635
 
658
636
  this._s = new Uint8Array([0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16]);
@@ -660,7 +638,7 @@ function () {
660
638
  this._mix = new Uint32Array([0x00000000, 0x0e090d0b, 0x1c121a16, 0x121b171d, 0x3824342c, 0x362d3927, 0x24362e3a, 0x2a3f2331, 0x70486858, 0x7e416553, 0x6c5a724e, 0x62537f45, 0x486c5c74, 0x4665517f, 0x547e4662, 0x5a774b69, 0xe090d0b0, 0xee99ddbb, 0xfc82caa6, 0xf28bc7ad, 0xd8b4e49c, 0xd6bde997, 0xc4a6fe8a, 0xcaaff381, 0x90d8b8e8, 0x9ed1b5e3, 0x8ccaa2fe, 0x82c3aff5, 0xa8fc8cc4, 0xa6f581cf, 0xb4ee96d2, 0xbae79bd9, 0xdb3bbb7b, 0xd532b670, 0xc729a16d, 0xc920ac66, 0xe31f8f57, 0xed16825c, 0xff0d9541, 0xf104984a, 0xab73d323, 0xa57ade28, 0xb761c935, 0xb968c43e, 0x9357e70f, 0x9d5eea04, 0x8f45fd19, 0x814cf012, 0x3bab6bcb, 0x35a266c0, 0x27b971dd, 0x29b07cd6, 0x038f5fe7, 0x0d8652ec, 0x1f9d45f1, 0x119448fa, 0x4be30393, 0x45ea0e98, 0x57f11985, 0x59f8148e, 0x73c737bf, 0x7dce3ab4, 0x6fd52da9, 0x61dc20a2, 0xad766df6, 0xa37f60fd, 0xb16477e0, 0xbf6d7aeb, 0x955259da, 0x9b5b54d1, 0x894043cc, 0x87494ec7, 0xdd3e05ae, 0xd33708a5, 0xc12c1fb8, 0xcf2512b3, 0xe51a3182, 0xeb133c89, 0xf9082b94, 0xf701269f, 0x4de6bd46, 0x43efb04d, 0x51f4a750, 0x5ffdaa5b, 0x75c2896a, 0x7bcb8461, 0x69d0937c, 0x67d99e77, 0x3daed51e, 0x33a7d815, 0x21bccf08, 0x2fb5c203, 0x058ae132, 0x0b83ec39, 0x1998fb24, 0x1791f62f, 0x764dd68d, 0x7844db86, 0x6a5fcc9b, 0x6456c190, 0x4e69e2a1, 0x4060efaa, 0x527bf8b7, 0x5c72f5bc, 0x0605bed5, 0x080cb3de, 0x1a17a4c3, 0x141ea9c8, 0x3e218af9, 0x302887f2, 0x223390ef, 0x2c3a9de4, 0x96dd063d, 0x98d40b36, 0x8acf1c2b, 0x84c61120, 0xaef93211, 0xa0f03f1a, 0xb2eb2807, 0xbce2250c, 0xe6956e65, 0xe89c636e, 0xfa877473, 0xf48e7978, 0xdeb15a49, 0xd0b85742, 0xc2a3405f, 0xccaa4d54, 0x41ecdaf7, 0x4fe5d7fc, 0x5dfec0e1, 0x53f7cdea, 0x79c8eedb, 0x77c1e3d0, 0x65daf4cd, 0x6bd3f9c6, 0x31a4b2af, 0x3fadbfa4, 0x2db6a8b9, 0x23bfa5b2, 0x09808683, 0x07898b88, 0x15929c95, 0x1b9b919e, 0xa17c0a47, 0xaf75074c, 0xbd6e1051, 0xb3671d5a, 0x99583e6b, 0x97513360, 0x854a247d, 0x8b432976, 0xd134621f, 0xdf3d6f14, 0xcd267809, 0xc32f7502, 0xe9105633, 0xe7195b38, 0xf5024c25, 0xfb0b412e, 0x9ad7618c, 0x94de6c87, 0x86c57b9a, 0x88cc7691, 0xa2f355a0, 0xacfa58ab, 0xbee14fb6, 0xb0e842bd, 0xea9f09d4, 0xe49604df, 0xf68d13c2, 0xf8841ec9, 0xd2bb3df8, 0xdcb230f3, 0xcea927ee, 0xc0a02ae5, 0x7a47b13c, 0x744ebc37, 0x6655ab2a, 0x685ca621, 0x42638510, 0x4c6a881b, 0x5e719f06, 0x5078920d, 0x0a0fd964, 0x0406d46f, 0x161dc372, 0x1814ce79, 0x322bed48, 0x3c22e043, 0x2e39f75e, 0x2030fa55, 0xec9ab701, 0xe293ba0a, 0xf088ad17, 0xfe81a01c, 0xd4be832d, 0xdab78e26, 0xc8ac993b, 0xc6a59430, 0x9cd2df59, 0x92dbd252, 0x80c0c54f, 0x8ec9c844, 0xa4f6eb75, 0xaaffe67e, 0xb8e4f163, 0xb6edfc68, 0x0c0a67b1, 0x02036aba, 0x10187da7, 0x1e1170ac, 0x342e539d, 0x3a275e96, 0x283c498b, 0x26354480, 0x7c420fe9, 0x724b02e2, 0x605015ff, 0x6e5918f4, 0x44663bc5, 0x4a6f36ce, 0x587421d3, 0x567d2cd8, 0x37a10c7a, 0x39a80171, 0x2bb3166c, 0x25ba1b67, 0x0f853856, 0x018c355d, 0x13972240, 0x1d9e2f4b, 0x47e96422, 0x49e06929, 0x5bfb7e34, 0x55f2733f, 0x7fcd500e, 0x71c45d05, 0x63df4a18, 0x6dd64713, 0xd731dcca, 0xd938d1c1, 0xcb23c6dc, 0xc52acbd7, 0xef15e8e6, 0xe11ce5ed, 0xf307f2f0, 0xfd0efffb, 0xa779b492, 0xa970b999, 0xbb6bae84, 0xb562a38f, 0x9f5d80be, 0x91548db5, 0x834f9aa8, 0x8d4697a3]);
661
639
  this._mixCol = new Uint8Array(256);
662
640
 
663
- for (var i = 0; i < 256; i++) {
641
+ for (let i = 0; i < 256; i++) {
664
642
  if (i < 128) {
665
643
  this._mixCol[i] = i << 1;
666
644
  } else {
@@ -672,63 +650,20 @@ function () {
672
650
  this.bufferPosition = 0;
673
651
  }
674
652
 
675
- _createClass(AESBaseCipher, [{
676
- key: "_expandKey",
677
- value: function _expandKey(cipherKey) {
678
- (0, _util.unreachable)('Cannot call `_expandKey` on the base class');
679
- }
680
- }, {
681
- key: "_decrypt",
682
- value: function _decrypt(input, key) {
683
- var t, u, v;
684
- var state = new Uint8Array(16);
685
- state.set(input);
686
-
687
- for (var j = 0, k = this._keySize; j < 16; ++j, ++k) {
688
- state[j] ^= key[k];
689
- }
690
-
691
- for (var i = this._cyclesOfRepetition - 1; i >= 1; --i) {
692
- t = state[13];
693
- state[13] = state[9];
694
- state[9] = state[5];
695
- state[5] = state[1];
696
- state[1] = t;
697
- t = state[14];
698
- u = state[10];
699
- state[14] = state[6];
700
- state[10] = state[2];
701
- state[6] = t;
702
- state[2] = u;
703
- t = state[15];
704
- u = state[11];
705
- v = state[7];
706
- state[15] = state[3];
707
- state[11] = t;
708
- state[7] = u;
709
- state[3] = v;
710
-
711
- for (var _j = 0; _j < 16; ++_j) {
712
- state[_j] = this._inv_s[state[_j]];
713
- }
653
+ _expandKey(cipherKey) {
654
+ (0, _util.unreachable)("Cannot call `_expandKey` on the base class");
655
+ }
714
656
 
715
- for (var _j2 = 0, _k = i * 16; _j2 < 16; ++_j2, ++_k) {
716
- state[_j2] ^= key[_k];
717
- }
657
+ _decrypt(input, key) {
658
+ let t, u, v;
659
+ const state = new Uint8Array(16);
660
+ state.set(input);
718
661
 
719
- for (var _j3 = 0; _j3 < 16; _j3 += 4) {
720
- var s0 = this._mix[state[_j3]];
721
- var s1 = this._mix[state[_j3 + 1]];
722
- var s2 = this._mix[state[_j3 + 2]];
723
- var s3 = this._mix[state[_j3 + 3]];
724
- t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8;
725
- state[_j3] = t >>> 24 & 0xFF;
726
- state[_j3 + 1] = t >> 16 & 0xFF;
727
- state[_j3 + 2] = t >> 8 & 0xFF;
728
- state[_j3 + 3] = t & 0xFF;
729
- }
730
- }
662
+ for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
663
+ state[j] ^= key[k];
664
+ }
731
665
 
666
+ for (let i = this._cyclesOfRepetition - 1; i >= 1; --i) {
732
667
  t = state[13];
733
668
  state[13] = state[9];
734
669
  state[9] = state[5];
@@ -748,68 +683,67 @@ function () {
748
683
  state[7] = u;
749
684
  state[3] = v;
750
685
 
751
- for (var _j4 = 0; _j4 < 16; ++_j4) {
752
- state[_j4] = this._inv_s[state[_j4]];
753
- state[_j4] ^= key[_j4];
686
+ for (let j = 0; j < 16; ++j) {
687
+ state[j] = this._inv_s[state[j]];
754
688
  }
755
689
 
756
- return state;
757
- }
758
- }, {
759
- key: "_encrypt",
760
- value: function _encrypt(input, key) {
761
- var s = this._s;
762
- var t, u, v;
763
- var state = new Uint8Array(16);
764
- state.set(input);
690
+ for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
691
+ state[j] ^= key[k];
692
+ }
765
693
 
766
- for (var j = 0; j < 16; ++j) {
767
- state[j] ^= key[j];
694
+ for (let j = 0; j < 16; j += 4) {
695
+ const s0 = this._mix[state[j]];
696
+ const s1 = this._mix[state[j + 1]];
697
+ const s2 = this._mix[state[j + 2]];
698
+ const s3 = this._mix[state[j + 3]];
699
+ t = s0 ^ s1 >>> 8 ^ s1 << 24 ^ s2 >>> 16 ^ s2 << 16 ^ s3 >>> 24 ^ s3 << 8;
700
+ state[j] = t >>> 24 & 0xff;
701
+ state[j + 1] = t >> 16 & 0xff;
702
+ state[j + 2] = t >> 8 & 0xff;
703
+ state[j + 3] = t & 0xff;
768
704
  }
705
+ }
769
706
 
770
- for (var i = 1; i < this._cyclesOfRepetition; i++) {
771
- for (var _j5 = 0; _j5 < 16; ++_j5) {
772
- state[_j5] = s[state[_j5]];
773
- }
707
+ t = state[13];
708
+ state[13] = state[9];
709
+ state[9] = state[5];
710
+ state[5] = state[1];
711
+ state[1] = t;
712
+ t = state[14];
713
+ u = state[10];
714
+ state[14] = state[6];
715
+ state[10] = state[2];
716
+ state[6] = t;
717
+ state[2] = u;
718
+ t = state[15];
719
+ u = state[11];
720
+ v = state[7];
721
+ state[15] = state[3];
722
+ state[11] = t;
723
+ state[7] = u;
724
+ state[3] = v;
725
+
726
+ for (let j = 0; j < 16; ++j) {
727
+ state[j] = this._inv_s[state[j]];
728
+ state[j] ^= key[j];
729
+ }
730
+
731
+ return state;
732
+ }
774
733
 
775
- v = state[1];
776
- state[1] = state[5];
777
- state[5] = state[9];
778
- state[9] = state[13];
779
- state[13] = v;
780
- v = state[2];
781
- u = state[6];
782
- state[2] = state[10];
783
- state[6] = state[14];
784
- state[10] = v;
785
- state[14] = u;
786
- v = state[3];
787
- u = state[7];
788
- t = state[11];
789
- state[3] = state[15];
790
- state[7] = v;
791
- state[11] = u;
792
- state[15] = t;
793
-
794
- for (var _j6 = 0; _j6 < 16; _j6 += 4) {
795
- var s0 = state[_j6 + 0];
796
- var s1 = state[_j6 + 1];
797
- var s2 = state[_j6 + 2];
798
- var s3 = state[_j6 + 3];
799
- t = s0 ^ s1 ^ s2 ^ s3;
800
- state[_j6 + 0] ^= t ^ this._mixCol[s0 ^ s1];
801
- state[_j6 + 1] ^= t ^ this._mixCol[s1 ^ s2];
802
- state[_j6 + 2] ^= t ^ this._mixCol[s2 ^ s3];
803
- state[_j6 + 3] ^= t ^ this._mixCol[s3 ^ s0];
804
- }
734
+ _encrypt(input, key) {
735
+ const s = this._s;
736
+ let t, u, v;
737
+ const state = new Uint8Array(16);
738
+ state.set(input);
805
739
 
806
- for (var _j7 = 0, k = i * 16; _j7 < 16; ++_j7, ++k) {
807
- state[_j7] ^= key[k];
808
- }
809
- }
740
+ for (let j = 0; j < 16; ++j) {
741
+ state[j] ^= key[j];
742
+ }
810
743
 
811
- for (var _j8 = 0; _j8 < 16; ++_j8) {
812
- state[_j8] = s[state[_j8]];
744
+ for (let i = 1; i < this._cyclesOfRepetition; i++) {
745
+ for (let j = 0; j < 16; ++j) {
746
+ state[j] = s[state[j]];
813
747
  }
814
748
 
815
749
  v = state[1];
@@ -831,285 +765,293 @@ function () {
831
765
  state[11] = u;
832
766
  state[15] = t;
833
767
 
834
- for (var _j9 = 0, _k2 = this._keySize; _j9 < 16; ++_j9, ++_k2) {
835
- state[_j9] ^= key[_k2];
768
+ for (let j = 0; j < 16; j += 4) {
769
+ const s0 = state[j + 0];
770
+ const s1 = state[j + 1];
771
+ const s2 = state[j + 2];
772
+ const s3 = state[j + 3];
773
+ t = s0 ^ s1 ^ s2 ^ s3;
774
+ state[j + 0] ^= t ^ this._mixCol[s0 ^ s1];
775
+ state[j + 1] ^= t ^ this._mixCol[s1 ^ s2];
776
+ state[j + 2] ^= t ^ this._mixCol[s2 ^ s3];
777
+ state[j + 3] ^= t ^ this._mixCol[s3 ^ s0];
836
778
  }
837
779
 
838
- return state;
780
+ for (let j = 0, k = i * 16; j < 16; ++j, ++k) {
781
+ state[j] ^= key[k];
782
+ }
839
783
  }
840
- }, {
841
- key: "_decryptBlock2",
842
- value: function _decryptBlock2(data, finalize) {
843
- var sourceLength = data.length;
844
- var buffer = this.buffer,
845
- bufferLength = this.bufferPosition;
846
- var result = [],
847
- iv = this.iv;
848
784
 
849
- for (var i = 0; i < sourceLength; ++i) {
850
- buffer[bufferLength] = data[i];
851
- ++bufferLength;
785
+ for (let j = 0; j < 16; ++j) {
786
+ state[j] = s[state[j]];
787
+ }
852
788
 
853
- if (bufferLength < 16) {
854
- continue;
855
- }
789
+ v = state[1];
790
+ state[1] = state[5];
791
+ state[5] = state[9];
792
+ state[9] = state[13];
793
+ state[13] = v;
794
+ v = state[2];
795
+ u = state[6];
796
+ state[2] = state[10];
797
+ state[6] = state[14];
798
+ state[10] = v;
799
+ state[14] = u;
800
+ v = state[3];
801
+ u = state[7];
802
+ t = state[11];
803
+ state[3] = state[15];
804
+ state[7] = v;
805
+ state[11] = u;
806
+ state[15] = t;
856
807
 
857
- var plain = this._decrypt(buffer, this._key);
808
+ for (let j = 0, k = this._keySize; j < 16; ++j, ++k) {
809
+ state[j] ^= key[k];
810
+ }
858
811
 
859
- for (var j = 0; j < 16; ++j) {
860
- plain[j] ^= iv[j];
861
- }
812
+ return state;
813
+ }
814
+
815
+ _decryptBlock2(data, finalize) {
816
+ const sourceLength = data.length;
817
+ let buffer = this.buffer,
818
+ bufferLength = this.bufferPosition;
819
+ const result = [];
820
+ let iv = this.iv;
821
+
822
+ for (let i = 0; i < sourceLength; ++i) {
823
+ buffer[bufferLength] = data[i];
824
+ ++bufferLength;
862
825
 
863
- iv = buffer;
864
- result.push(plain);
865
- buffer = new Uint8Array(16);
866
- bufferLength = 0;
826
+ if (bufferLength < 16) {
827
+ continue;
867
828
  }
868
829
 
869
- this.buffer = buffer;
870
- this.bufferLength = bufferLength;
871
- this.iv = iv;
830
+ const plain = this._decrypt(buffer, this._key);
872
831
 
873
- if (result.length === 0) {
874
- return new Uint8Array(0);
832
+ for (let j = 0; j < 16; ++j) {
833
+ plain[j] ^= iv[j];
875
834
  }
876
835
 
877
- var outputLength = 16 * result.length;
836
+ iv = buffer;
837
+ result.push(plain);
838
+ buffer = new Uint8Array(16);
839
+ bufferLength = 0;
840
+ }
878
841
 
879
- if (finalize) {
880
- var lastBlock = result[result.length - 1];
881
- var psLen = lastBlock[15];
842
+ this.buffer = buffer;
843
+ this.bufferLength = bufferLength;
844
+ this.iv = iv;
882
845
 
883
- if (psLen <= 16) {
884
- for (var _i = 15, ii = 16 - psLen; _i >= ii; --_i) {
885
- if (lastBlock[_i] !== psLen) {
886
- psLen = 0;
887
- break;
888
- }
889
- }
846
+ if (result.length === 0) {
847
+ return new Uint8Array(0);
848
+ }
890
849
 
891
- outputLength -= psLen;
892
- result[result.length - 1] = lastBlock.subarray(0, 16 - psLen);
893
- }
894
- }
850
+ let outputLength = 16 * result.length;
895
851
 
896
- var output = new Uint8Array(outputLength);
852
+ if (finalize) {
853
+ const lastBlock = result[result.length - 1];
854
+ let psLen = lastBlock[15];
897
855
 
898
- for (var _i2 = 0, _j10 = 0, _ii = result.length; _i2 < _ii; ++_i2, _j10 += 16) {
899
- output.set(result[_i2], _j10);
856
+ if (psLen <= 16) {
857
+ for (let i = 15, ii = 16 - psLen; i >= ii; --i) {
858
+ if (lastBlock[i] !== psLen) {
859
+ psLen = 0;
860
+ break;
861
+ }
862
+ }
863
+
864
+ outputLength -= psLen;
865
+ result[result.length - 1] = lastBlock.subarray(0, 16 - psLen);
900
866
  }
867
+ }
901
868
 
902
- return output;
869
+ const output = new Uint8Array(outputLength);
870
+
871
+ for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
872
+ output.set(result[i], j);
903
873
  }
904
- }, {
905
- key: "decryptBlock",
906
- value: function decryptBlock(data, finalize) {
907
- var iv = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
908
- var sourceLength = data.length;
909
- var buffer = this.buffer,
910
- bufferLength = this.bufferPosition;
911
874
 
912
- if (iv) {
913
- this.iv = iv;
914
- } else {
915
- for (var i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) {
916
- buffer[bufferLength] = data[i];
917
- }
875
+ return output;
876
+ }
918
877
 
919
- if (bufferLength < 16) {
920
- this.bufferLength = bufferLength;
921
- return new Uint8Array(0);
922
- }
878
+ decryptBlock(data, finalize, iv = null) {
879
+ const sourceLength = data.length;
880
+ const buffer = this.buffer;
881
+ let bufferLength = this.bufferPosition;
923
882
 
924
- this.iv = buffer;
925
- data = data.subarray(16);
883
+ if (iv) {
884
+ this.iv = iv;
885
+ } else {
886
+ for (let i = 0; bufferLength < 16 && i < sourceLength; ++i, ++bufferLength) {
887
+ buffer[bufferLength] = data[i];
926
888
  }
927
889
 
928
- this.buffer = new Uint8Array(16);
929
- this.bufferLength = 0;
930
- this.decryptBlock = this._decryptBlock2;
931
- return this.decryptBlock(data, finalize);
932
- }
933
- }, {
934
- key: "encrypt",
935
- value: function encrypt(data, iv) {
936
- var sourceLength = data.length;
937
- var buffer = this.buffer,
938
- bufferLength = this.bufferPosition;
939
- var result = [];
940
-
941
- if (!iv) {
942
- iv = new Uint8Array(16);
890
+ if (bufferLength < 16) {
891
+ this.bufferLength = bufferLength;
892
+ return new Uint8Array(0);
943
893
  }
944
894
 
945
- for (var i = 0; i < sourceLength; ++i) {
946
- buffer[bufferLength] = data[i];
947
- ++bufferLength;
895
+ this.iv = buffer;
896
+ data = data.subarray(16);
897
+ }
948
898
 
949
- if (bufferLength < 16) {
950
- continue;
951
- }
899
+ this.buffer = new Uint8Array(16);
900
+ this.bufferLength = 0;
901
+ this.decryptBlock = this._decryptBlock2;
902
+ return this.decryptBlock(data, finalize);
903
+ }
952
904
 
953
- for (var j = 0; j < 16; ++j) {
954
- buffer[j] ^= iv[j];
955
- }
905
+ encrypt(data, iv) {
906
+ const sourceLength = data.length;
907
+ let buffer = this.buffer,
908
+ bufferLength = this.bufferPosition;
909
+ const result = [];
956
910
 
957
- var cipher = this._encrypt(buffer, this._key);
911
+ if (!iv) {
912
+ iv = new Uint8Array(16);
913
+ }
958
914
 
959
- iv = cipher;
960
- result.push(cipher);
961
- buffer = new Uint8Array(16);
962
- bufferLength = 0;
963
- }
915
+ for (let i = 0; i < sourceLength; ++i) {
916
+ buffer[bufferLength] = data[i];
917
+ ++bufferLength;
964
918
 
965
- this.buffer = buffer;
966
- this.bufferLength = bufferLength;
967
- this.iv = iv;
919
+ if (bufferLength < 16) {
920
+ continue;
921
+ }
968
922
 
969
- if (result.length === 0) {
970
- return new Uint8Array(0);
923
+ for (let j = 0; j < 16; ++j) {
924
+ buffer[j] ^= iv[j];
971
925
  }
972
926
 
973
- var outputLength = 16 * result.length;
974
- var output = new Uint8Array(outputLength);
927
+ const cipher = this._encrypt(buffer, this._key);
975
928
 
976
- for (var _i3 = 0, _j11 = 0, ii = result.length; _i3 < ii; ++_i3, _j11 += 16) {
977
- output.set(result[_i3], _j11);
978
- }
929
+ iv = cipher;
930
+ result.push(cipher);
931
+ buffer = new Uint8Array(16);
932
+ bufferLength = 0;
933
+ }
979
934
 
980
- return output;
935
+ this.buffer = buffer;
936
+ this.bufferLength = bufferLength;
937
+ this.iv = iv;
938
+
939
+ if (result.length === 0) {
940
+ return new Uint8Array(0);
981
941
  }
982
- }]);
983
942
 
984
- return AESBaseCipher;
985
- }();
943
+ const outputLength = 16 * result.length;
944
+ const output = new Uint8Array(outputLength);
986
945
 
987
- var AES128Cipher =
988
- /*#__PURE__*/
989
- function (_AESBaseCipher) {
990
- _inherits(AES128Cipher, _AESBaseCipher);
946
+ for (let i = 0, j = 0, ii = result.length; i < ii; ++i, j += 16) {
947
+ output.set(result[i], j);
948
+ }
991
949
 
992
- function AES128Cipher(key) {
993
- var _this;
950
+ return output;
951
+ }
994
952
 
995
- _classCallCheck(this, AES128Cipher);
953
+ }
996
954
 
997
- _this = _possibleConstructorReturn(this, _getPrototypeOf(AES128Cipher).call(this));
998
- _this._cyclesOfRepetition = 10;
999
- _this._keySize = 160;
1000
- _this._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, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]);
1001
- _this._key = _this._expandKey(key);
1002
- return _this;
955
+ class AES128Cipher extends AESBaseCipher {
956
+ constructor(key) {
957
+ super();
958
+ this._cyclesOfRepetition = 10;
959
+ this._keySize = 160;
960
+ this._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, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd4, 0xb3, 0x7d, 0xfa, 0xef, 0xc5, 0x91, 0x39, 0x72, 0xe4, 0xd3, 0xbd, 0x61, 0xc2, 0x9f, 0x25, 0x4a, 0x94, 0x33, 0x66, 0xcc, 0x83, 0x1d, 0x3a, 0x74, 0xe8, 0xcb, 0x8d]);
961
+ this._key = this._expandKey(key);
1003
962
  }
1004
963
 
1005
- _createClass(AES128Cipher, [{
1006
- key: "_expandKey",
1007
- value: function _expandKey(cipherKey) {
1008
- var b = 176;
1009
- var s = this._s;
1010
- var rcon = this._rcon;
1011
- var result = new Uint8Array(b);
1012
- result.set(cipherKey);
1013
-
1014
- for (var j = 16, i = 1; j < b; ++i) {
1015
- var t1 = result[j - 3];
1016
- var t2 = result[j - 2];
1017
- var t3 = result[j - 1];
1018
- var t4 = result[j - 4];
1019
- t1 = s[t1];
1020
- t2 = s[t2];
1021
- t3 = s[t3];
1022
- t4 = s[t4];
1023
- t1 = t1 ^ rcon[i];
1024
-
1025
- for (var n = 0; n < 4; ++n) {
1026
- result[j] = t1 ^= result[j - 16];
1027
- j++;
1028
- result[j] = t2 ^= result[j - 16];
1029
- j++;
1030
- result[j] = t3 ^= result[j - 16];
1031
- j++;
1032
- result[j] = t4 ^= result[j - 16];
1033
- j++;
1034
- }
964
+ _expandKey(cipherKey) {
965
+ const b = 176;
966
+ const s = this._s;
967
+ const rcon = this._rcon;
968
+ const result = new Uint8Array(b);
969
+ result.set(cipherKey);
970
+
971
+ for (let j = 16, i = 1; j < b; ++i) {
972
+ let t1 = result[j - 3];
973
+ let t2 = result[j - 2];
974
+ let t3 = result[j - 1];
975
+ let t4 = result[j - 4];
976
+ t1 = s[t1];
977
+ t2 = s[t2];
978
+ t3 = s[t3];
979
+ t4 = s[t4];
980
+ t1 = t1 ^ rcon[i];
981
+
982
+ for (let n = 0; n < 4; ++n) {
983
+ result[j] = t1 ^= result[j - 16];
984
+ j++;
985
+ result[j] = t2 ^= result[j - 16];
986
+ j++;
987
+ result[j] = t3 ^= result[j - 16];
988
+ j++;
989
+ result[j] = t4 ^= result[j - 16];
990
+ j++;
1035
991
  }
1036
-
1037
- return result;
1038
992
  }
1039
- }]);
1040
-
1041
- return AES128Cipher;
1042
- }(AESBaseCipher);
1043
993
 
1044
- exports.AES128Cipher = AES128Cipher;
1045
-
1046
- var AES256Cipher =
1047
- /*#__PURE__*/
1048
- function (_AESBaseCipher2) {
1049
- _inherits(AES256Cipher, _AESBaseCipher2);
994
+ return result;
995
+ }
1050
996
 
1051
- function AES256Cipher(key) {
1052
- var _this2;
997
+ }
1053
998
 
1054
- _classCallCheck(this, AES256Cipher);
999
+ exports.AES128Cipher = AES128Cipher;
1055
1000
 
1056
- _this2 = _possibleConstructorReturn(this, _getPrototypeOf(AES256Cipher).call(this));
1057
- _this2._cyclesOfRepetition = 14;
1058
- _this2._keySize = 224;
1059
- _this2._key = _this2._expandKey(key);
1060
- return _this2;
1001
+ class AES256Cipher extends AESBaseCipher {
1002
+ constructor(key) {
1003
+ super();
1004
+ this._cyclesOfRepetition = 14;
1005
+ this._keySize = 224;
1006
+ this._key = this._expandKey(key);
1061
1007
  }
1062
1008
 
1063
- _createClass(AES256Cipher, [{
1064
- key: "_expandKey",
1065
- value: function _expandKey(cipherKey) {
1066
- var b = 240;
1067
- var s = this._s;
1068
- var result = new Uint8Array(b);
1069
- result.set(cipherKey);
1070
- var r = 1;
1071
- var t1, t2, t3, t4;
1072
-
1073
- for (var j = 32, i = 1; j < b; ++i) {
1074
- if (j % 32 === 16) {
1075
- t1 = s[t1];
1076
- t2 = s[t2];
1077
- t3 = s[t3];
1078
- t4 = s[t4];
1079
- } else if (j % 32 === 0) {
1080
- t1 = result[j - 3];
1081
- t2 = result[j - 2];
1082
- t3 = result[j - 1];
1083
- t4 = result[j - 4];
1084
- t1 = s[t1];
1085
- t2 = s[t2];
1086
- t3 = s[t3];
1087
- t4 = s[t4];
1088
- t1 = t1 ^ r;
1089
-
1090
- if ((r <<= 1) >= 256) {
1091
- r = (r ^ 0x1b) & 0xFF;
1092
- }
1093
- }
1009
+ _expandKey(cipherKey) {
1010
+ const b = 240;
1011
+ const s = this._s;
1012
+ const result = new Uint8Array(b);
1013
+ result.set(cipherKey);
1014
+ let r = 1;
1015
+ let t1, t2, t3, t4;
1094
1016
 
1095
- for (var n = 0; n < 4; ++n) {
1096
- result[j] = t1 ^= result[j - 32];
1097
- j++;
1098
- result[j] = t2 ^= result[j - 32];
1099
- j++;
1100
- result[j] = t3 ^= result[j - 32];
1101
- j++;
1102
- result[j] = t4 ^= result[j - 32];
1103
- j++;
1017
+ for (let j = 32, i = 1; j < b; ++i) {
1018
+ if (j % 32 === 16) {
1019
+ t1 = s[t1];
1020
+ t2 = s[t2];
1021
+ t3 = s[t3];
1022
+ t4 = s[t4];
1023
+ } else if (j % 32 === 0) {
1024
+ t1 = result[j - 3];
1025
+ t2 = result[j - 2];
1026
+ t3 = result[j - 1];
1027
+ t4 = result[j - 4];
1028
+ t1 = s[t1];
1029
+ t2 = s[t2];
1030
+ t3 = s[t3];
1031
+ t4 = s[t4];
1032
+ t1 = t1 ^ r;
1033
+
1034
+ if ((r <<= 1) >= 256) {
1035
+ r = (r ^ 0x1b) & 0xff;
1104
1036
  }
1105
1037
  }
1106
1038
 
1107
- return result;
1039
+ for (let n = 0; n < 4; ++n) {
1040
+ result[j] = t1 ^= result[j - 32];
1041
+ j++;
1042
+ result[j] = t2 ^= result[j - 32];
1043
+ j++;
1044
+ result[j] = t3 ^= result[j - 32];
1045
+ j++;
1046
+ result[j] = t4 ^= result[j - 32];
1047
+ j++;
1048
+ }
1108
1049
  }
1109
- }]);
1110
1050
 
1111
- return AES256Cipher;
1112
- }(AESBaseCipher);
1051
+ return result;
1052
+ }
1053
+
1054
+ }
1113
1055
 
1114
1056
  exports.AES256Cipher = AES256Cipher;
1115
1057
 
@@ -1351,20 +1293,20 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1351
1293
  hashData[i++] = ownerPassword[j];
1352
1294
  }
1353
1295
 
1354
- hashData[i++] = flags & 0xFF;
1355
- hashData[i++] = flags >> 8 & 0xFF;
1356
- hashData[i++] = flags >> 16 & 0xFF;
1357
- hashData[i++] = flags >>> 24 & 0xFF;
1296
+ hashData[i++] = flags & 0xff;
1297
+ hashData[i++] = flags >> 8 & 0xff;
1298
+ hashData[i++] = flags >> 16 & 0xff;
1299
+ hashData[i++] = flags >>> 24 & 0xff;
1358
1300
 
1359
1301
  for (j = 0, n = fileId.length; j < n; ++j) {
1360
1302
  hashData[i++] = fileId[j];
1361
1303
  }
1362
1304
 
1363
1305
  if (revision >= 4 && !encryptMetadata) {
1364
- hashData[i++] = 0xFF;
1365
- hashData[i++] = 0xFF;
1366
- hashData[i++] = 0xFF;
1367
- hashData[i++] = 0xFF;
1306
+ hashData[i++] = 0xff;
1307
+ hashData[i++] = 0xff;
1308
+ hashData[i++] = 0xff;
1309
+ hashData[i++] = 0xff;
1368
1310
  }
1369
1311
 
1370
1312
  var hash = calculateMD5(hashData, 0, i);
@@ -1471,36 +1413,36 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1471
1413
  return userPassword;
1472
1414
  }
1473
1415
 
1474
- var identityName = _primitives.Name.get('Identity');
1416
+ var identityName = _primitives.Name.get("Identity");
1475
1417
 
1476
1418
  function CipherTransformFactory(dict, fileId, password) {
1477
- var filter = dict.get('Filter');
1419
+ var filter = dict.get("Filter");
1478
1420
 
1479
- if (!(0, _primitives.isName)(filter, 'Standard')) {
1480
- throw new _util.FormatError('unknown encryption method');
1421
+ if (!(0, _primitives.isName)(filter, "Standard")) {
1422
+ throw new _util.FormatError("unknown encryption method");
1481
1423
  }
1482
1424
 
1483
1425
  this.dict = dict;
1484
- var algorithm = dict.get('V');
1426
+ var algorithm = dict.get("V");
1485
1427
 
1486
1428
  if (!Number.isInteger(algorithm) || algorithm !== 1 && algorithm !== 2 && algorithm !== 4 && algorithm !== 5) {
1487
- throw new _util.FormatError('unsupported encryption algorithm');
1429
+ throw new _util.FormatError("unsupported encryption algorithm");
1488
1430
  }
1489
1431
 
1490
1432
  this.algorithm = algorithm;
1491
- var keyLength = dict.get('Length');
1433
+ var keyLength = dict.get("Length");
1492
1434
 
1493
1435
  if (!keyLength) {
1494
1436
  if (algorithm <= 3) {
1495
1437
  keyLength = 40;
1496
1438
  } else {
1497
- var cfDict = dict.get('CF');
1498
- var streamCryptoName = dict.get('StmF');
1439
+ var cfDict = dict.get("CF");
1440
+ var streamCryptoName = dict.get("StmF");
1499
1441
 
1500
1442
  if ((0, _primitives.isDict)(cfDict) && (0, _primitives.isName)(streamCryptoName)) {
1501
1443
  cfDict.suppressEncryption = true;
1502
1444
  var handlerDict = cfDict.get(streamCryptoName.name);
1503
- keyLength = handlerDict && handlerDict.get('Length') || 128;
1445
+ keyLength = handlerDict && handlerDict.get("Length") || 128;
1504
1446
 
1505
1447
  if (keyLength < 40) {
1506
1448
  keyLength <<= 3;
@@ -1510,14 +1452,14 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1510
1452
  }
1511
1453
 
1512
1454
  if (!Number.isInteger(keyLength) || keyLength < 40 || keyLength % 8 !== 0) {
1513
- throw new _util.FormatError('invalid key length');
1455
+ throw new _util.FormatError("invalid key length");
1514
1456
  }
1515
1457
 
1516
- var ownerPassword = (0, _util.stringToBytes)(dict.get('O')).subarray(0, 32);
1517
- var userPassword = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 32);
1518
- var flags = dict.get('P');
1519
- var revision = dict.get('R');
1520
- var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get('EncryptMetadata') !== false;
1458
+ var ownerPassword = (0, _util.stringToBytes)(dict.get("O")).subarray(0, 32);
1459
+ var userPassword = (0, _util.stringToBytes)(dict.get("U")).subarray(0, 32);
1460
+ var flags = dict.get("P");
1461
+ var revision = dict.get("R");
1462
+ var encryptMetadata = (algorithm === 4 || algorithm === 5) && dict.get("EncryptMetadata") !== false;
1521
1463
  this.encryptMetadata = encryptMetadata;
1522
1464
  var fileIdBytes = (0, _util.stringToBytes)(fileId);
1523
1465
  var passwordBytes;
@@ -1527,7 +1469,7 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1527
1469
  try {
1528
1470
  password = (0, _util.utf8StringToString)(password);
1529
1471
  } catch (ex) {
1530
- (0, _util.warn)('CipherTransformFactory: ' + 'Unable to convert UTF8 encoded password.');
1472
+ (0, _util.warn)("CipherTransformFactory: " + "Unable to convert UTF8 encoded password.");
1531
1473
  }
1532
1474
  }
1533
1475
 
@@ -1539,41 +1481,41 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1539
1481
  if (algorithm !== 5) {
1540
1482
  encryptionKey = prepareKeyData(fileIdBytes, passwordBytes, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
1541
1483
  } else {
1542
- var ownerValidationSalt = (0, _util.stringToBytes)(dict.get('O')).subarray(32, 40);
1543
- var ownerKeySalt = (0, _util.stringToBytes)(dict.get('O')).subarray(40, 48);
1544
- var uBytes = (0, _util.stringToBytes)(dict.get('U')).subarray(0, 48);
1545
- var userValidationSalt = (0, _util.stringToBytes)(dict.get('U')).subarray(32, 40);
1546
- var userKeySalt = (0, _util.stringToBytes)(dict.get('U')).subarray(40, 48);
1547
- var ownerEncryption = (0, _util.stringToBytes)(dict.get('OE'));
1548
- var userEncryption = (0, _util.stringToBytes)(dict.get('UE'));
1549
- var perms = (0, _util.stringToBytes)(dict.get('Perms'));
1484
+ var ownerValidationSalt = (0, _util.stringToBytes)(dict.get("O")).subarray(32, 40);
1485
+ var ownerKeySalt = (0, _util.stringToBytes)(dict.get("O")).subarray(40, 48);
1486
+ var uBytes = (0, _util.stringToBytes)(dict.get("U")).subarray(0, 48);
1487
+ var userValidationSalt = (0, _util.stringToBytes)(dict.get("U")).subarray(32, 40);
1488
+ var userKeySalt = (0, _util.stringToBytes)(dict.get("U")).subarray(40, 48);
1489
+ var ownerEncryption = (0, _util.stringToBytes)(dict.get("OE"));
1490
+ var userEncryption = (0, _util.stringToBytes)(dict.get("UE"));
1491
+ var perms = (0, _util.stringToBytes)(dict.get("Perms"));
1550
1492
  encryptionKey = createEncryptionKey20(revision, passwordBytes, ownerPassword, ownerValidationSalt, ownerKeySalt, uBytes, userPassword, userValidationSalt, userKeySalt, ownerEncryption, userEncryption, perms);
1551
1493
  }
1552
1494
 
1553
1495
  if (!encryptionKey && !password) {
1554
- throw new _util.PasswordException('No password given', _util.PasswordResponses.NEED_PASSWORD);
1496
+ throw new _util.PasswordException("No password given", _util.PasswordResponses.NEED_PASSWORD);
1555
1497
  } else if (!encryptionKey && password) {
1556
1498
  var decodedPassword = decodeUserPassword(passwordBytes, ownerPassword, revision, keyLength);
1557
1499
  encryptionKey = prepareKeyData(fileIdBytes, decodedPassword, ownerPassword, userPassword, flags, revision, keyLength, encryptMetadata);
1558
1500
  }
1559
1501
 
1560
1502
  if (!encryptionKey) {
1561
- throw new _util.PasswordException('Incorrect Password', _util.PasswordResponses.INCORRECT_PASSWORD);
1503
+ throw new _util.PasswordException("Incorrect Password", _util.PasswordResponses.INCORRECT_PASSWORD);
1562
1504
  }
1563
1505
 
1564
1506
  this.encryptionKey = encryptionKey;
1565
1507
 
1566
1508
  if (algorithm >= 4) {
1567
- var cf = dict.get('CF');
1509
+ var cf = dict.get("CF");
1568
1510
 
1569
1511
  if ((0, _primitives.isDict)(cf)) {
1570
1512
  cf.suppressEncryption = true;
1571
1513
  }
1572
1514
 
1573
1515
  this.cf = cf;
1574
- this.stmf = dict.get('StmF') || identityName;
1575
- this.strf = dict.get('StrF') || identityName;
1576
- this.eff = dict.get('EFF') || this.stmf;
1516
+ this.stmf = dict.get("StmF") || identityName;
1517
+ this.strf = dict.get("StrF") || identityName;
1518
+ this.eff = dict.get("EFF") || this.stmf;
1577
1519
  }
1578
1520
  }
1579
1521
 
@@ -1586,16 +1528,16 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1586
1528
  key[i] = encryptionKey[i];
1587
1529
  }
1588
1530
 
1589
- key[i++] = num & 0xFF;
1590
- key[i++] = num >> 8 & 0xFF;
1591
- key[i++] = num >> 16 & 0xFF;
1592
- key[i++] = gen & 0xFF;
1593
- key[i++] = gen >> 8 & 0xFF;
1531
+ key[i++] = num & 0xff;
1532
+ key[i++] = num >> 8 & 0xff;
1533
+ key[i++] = num >> 16 & 0xff;
1534
+ key[i++] = gen & 0xff;
1535
+ key[i++] = gen >> 8 & 0xff;
1594
1536
 
1595
1537
  if (isAes) {
1596
1538
  key[i++] = 0x73;
1597
1539
  key[i++] = 0x41;
1598
- key[i++] = 0x6C;
1540
+ key[i++] = 0x6c;
1599
1541
  key[i++] = 0x54;
1600
1542
  }
1601
1543
 
@@ -1605,41 +1547,41 @@ var CipherTransformFactory = function CipherTransformFactoryClosure() {
1605
1547
 
1606
1548
  function buildCipherConstructor(cf, name, num, gen, key) {
1607
1549
  if (!(0, _primitives.isName)(name)) {
1608
- throw new _util.FormatError('Invalid crypt filter name.');
1550
+ throw new _util.FormatError("Invalid crypt filter name.");
1609
1551
  }
1610
1552
 
1611
1553
  var cryptFilter = cf.get(name.name);
1612
1554
  var cfm;
1613
1555
 
1614
1556
  if (cryptFilter !== null && cryptFilter !== undefined) {
1615
- cfm = cryptFilter.get('CFM');
1557
+ cfm = cryptFilter.get("CFM");
1616
1558
  }
1617
1559
 
1618
- if (!cfm || cfm.name === 'None') {
1560
+ if (!cfm || cfm.name === "None") {
1619
1561
  return function cipherTransformFactoryBuildCipherConstructorNone() {
1620
1562
  return new NullCipher();
1621
1563
  };
1622
1564
  }
1623
1565
 
1624
- if (cfm.name === 'V2') {
1566
+ if (cfm.name === "V2") {
1625
1567
  return function cipherTransformFactoryBuildCipherConstructorV2() {
1626
1568
  return new ARCFourCipher(buildObjectKey(num, gen, key, false));
1627
1569
  };
1628
1570
  }
1629
1571
 
1630
- if (cfm.name === 'AESV2') {
1572
+ if (cfm.name === "AESV2") {
1631
1573
  return function cipherTransformFactoryBuildCipherConstructorAESV2() {
1632
1574
  return new AES128Cipher(buildObjectKey(num, gen, key, true));
1633
1575
  };
1634
1576
  }
1635
1577
 
1636
- if (cfm.name === 'AESV3') {
1578
+ if (cfm.name === "AESV3") {
1637
1579
  return function cipherTransformFactoryBuildCipherConstructorAESV3() {
1638
1580
  return new AES256Cipher(key);
1639
1581
  };
1640
1582
  }
1641
1583
 
1642
- throw new _util.FormatError('Unknown crypto method');
1584
+ throw new _util.FormatError("Unknown crypto method");
1643
1585
  }
1644
1586
 
1645
1587
  CipherTransformFactory.prototype = {