diff options
author | Ian Coleman <coleman.ian@gmail.com> | 2014-09-29 16:11:09 +1000 |
---|---|---|
committer | Ian Coleman <coleman.ian@gmail.com> | 2014-09-29 16:11:09 +1000 |
commit | e66c8a9b5aade1c6b19c58e5366f777fde3f373f (patch) | |
tree | c525a3e6cfeb004df3c2d16ff6a526951b13d9c7 /src | |
parent | 3af2954aeee7e849fcfa3c61b016793a59ab585e (diff) | |
download | BIP39-e66c8a9b5aade1c6b19c58e5366f777fde3f373f.tar.gz BIP39-e66c8a9b5aade1c6b19c58e5366f777fde3f373f.tar.zst BIP39-e66c8a9b5aade1c6b19c58e5366f777fde3f373f.zip |
jsbip39 updated and asmcrypto replaced with sjcl
Diffstat (limited to 'src')
-rw-r--r-- | src/index.html | 2 | ||||
-rw-r--r-- | src/js/asmcrypto.js | 7491 | ||||
-rw-r--r-- | src/js/jsbip39.js | 79 | ||||
-rw-r--r-- | src/js/sjcl-bip39.js | 1059 |
4 files changed, 1116 insertions, 7515 deletions
diff --git a/src/index.html b/src/index.html index 468a1c0..d09a71a 100644 --- a/src/index.html +++ b/src/index.html | |||
@@ -345,7 +345,7 @@ | |||
345 | <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> | 345 | <script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> |
346 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> | 346 | <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script> |
347 | <script src="/js/bitcoinjs-1-0-0.js"></script> | 347 | <script src="/js/bitcoinjs-1-0-0.js"></script> |
348 | <script src="/js/asmcrypto.js"></script> | 348 | <script src="/js/sjcl-bip39.js"></script> |
349 | <script src="/js/wordlists.js"></script> | 349 | <script src="/js/wordlists.js"></script> |
350 | <script src="/js/wordlist_english.js"></script> | 350 | <script src="/js/wordlist_english.js"></script> |
351 | <script src="/js/jsbip39.js"></script> | 351 | <script src="/js/jsbip39.js"></script> |
diff --git a/src/js/asmcrypto.js b/src/js/asmcrypto.js deleted file mode 100644 index c056f56..0000000 --- a/src/js/asmcrypto.js +++ /dev/null | |||
@@ -1,7491 +0,0 @@ | |||
1 | // https://rawgit.com/tresorit/asmcrypto.js/598a1098504f1b2d0e615bc51dd8404afd2d338b/asmcrypto.js | ||
2 | // Provides PBKDF2 functionality | ||
3 | // It's faster than CryptoJS | ||
4 | // Couldn't get SJCL working as desired | ||
5 | |||
6 | |||
7 | (function(exports, global) { | ||
8 | global["asmCrypto"] = exports; | ||
9 | "use strict"; | ||
10 | function string_to_bytes(str) { | ||
11 | var i, len = str.length, arr = new Uint8Array(len); | ||
12 | for (i = 0; i < len; i += 1) { | ||
13 | arr[i] = str.charCodeAt(i); | ||
14 | } | ||
15 | return arr; | ||
16 | } | ||
17 | function hex_to_bytes(str) { | ||
18 | var arr = [], len = str.length, i; | ||
19 | if (len & 1) { | ||
20 | str = "0" + str; | ||
21 | len++; | ||
22 | } | ||
23 | for (i = 0; i < len; i += 2) { | ||
24 | arr.push(parseInt(str.substr(i, 2), 16)); | ||
25 | } | ||
26 | return new Uint8Array(arr); | ||
27 | } | ||
28 | function base64_to_bytes(str) { | ||
29 | return string_to_bytes(atob(str)); | ||
30 | } | ||
31 | function bytes_to_string(arr) { | ||
32 | var str = ""; | ||
33 | for (var i = 0; i < arr.length; i++) str += String.fromCharCode(arr[i]); | ||
34 | return str; | ||
35 | } | ||
36 | function bytes_to_hex(arr) { | ||
37 | var sz = (arr.byteLength || arr.length) / arr.length, str = ""; | ||
38 | for (var i = 0; i < arr.length; i++) { | ||
39 | var h = arr[i].toString(16); | ||
40 | if (h.length < 2 * sz) str += "00000000000000".substr(0, 2 * sz - h.length); | ||
41 | str += h; | ||
42 | } | ||
43 | return str; | ||
44 | } | ||
45 | function bytes_to_base64(arr) { | ||
46 | return btoa(bytes_to_string(arr)); | ||
47 | } | ||
48 | function pow2_ceil(a) { | ||
49 | a -= 1; | ||
50 | a |= a >>> 1; | ||
51 | a |= a >>> 2; | ||
52 | a |= a >>> 4; | ||
53 | a |= a >>> 8; | ||
54 | a |= a >>> 16; | ||
55 | a += 1; | ||
56 | return a; | ||
57 | } | ||
58 | function is_number(a) { | ||
59 | return typeof a === "number"; | ||
60 | } | ||
61 | function is_string(a) { | ||
62 | return typeof a === "string"; | ||
63 | } | ||
64 | function is_buffer(a) { | ||
65 | return a instanceof ArrayBuffer; | ||
66 | } | ||
67 | function is_bytes(a) { | ||
68 | return a instanceof Uint8Array; | ||
69 | } | ||
70 | function is_typed_array(a) { | ||
71 | return a instanceof Int8Array || a instanceof Uint8Array || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array; | ||
72 | } | ||
73 | function IllegalStateError() { | ||
74 | Error.apply(this, arguments); | ||
75 | } | ||
76 | IllegalStateError.prototype = new Error(); | ||
77 | function IllegalArgumentError() { | ||
78 | Error.apply(this, arguments); | ||
79 | } | ||
80 | IllegalArgumentError.prototype = new Error(); | ||
81 | function SecurityError() { | ||
82 | Error.apply(this, arguments); | ||
83 | } | ||
84 | IllegalArgumentError.prototype = new Error(); | ||
85 | var _aes_tables = [ 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22, 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125, 198, 248, 238, 246, 255, 214, 222, 145, 96, 2, 206, 86, 231, 181, 77, 236, 143, 31, 137, 250, 239, 178, 142, 251, 65, 179, 95, 69, 35, 83, 228, 155, 117, 225, 61, 76, 108, 126, 245, 131, 104, 81, 209, 249, 226, 171, 98, 42, 8, 149, 70, 157, 48, 55, 10, 47, 14, 36, 27, 223, 205, 78, 127, 234, 18, 29, 88, 52, 54, 220, 180, 91, 164, 118, 183, 125, 82, 221, 94, 19, 166, 185, 0, 193, 64, 227, 121, 182, 212, 141, 103, 114, 148, 152, 176, 133, 187, 197, 79, 237, 134, 154, 102, 17, 138, 233, 4, 254, 160, 120, 37, 75, 162, 93, 128, 5, 63, 33, 112, 241, 99, 119, 175, 66, 32, 229, 253, 191, 129, 24, 38, 195, 190, 53, 136, 46, 147, 85, 252, 122, 200, 186, 50, 230, 192, 25, 158, 163, 68, 84, 59, 11, 140, 199, 107, 40, 167, 188, 22, 173, 219, 100, 116, 20, 146, 12, 72, 184, 159, 189, 67, 196, 57, 49, 211, 242, 213, 139, 110, 218, 1, 177, 156, 73, 216, 172, 243, 207, 202, 244, 71, 16, 111, 240, 74, 92, 56, 87, 115, 151, 203, 161, 232, 62, 150, 97, 13, 15, 224, 124, 113, 204, 144, 6, 247, 28, 194, 106, 174, 105, 23, 153, 58, 39, 217, 235, 43, 34, 210, 169, 7, 51, 45, 60, 21, 201, 135, 170, 80, 165, 3, 89, 9, 26, 101, 215, 132, 208, 130, 41, 90, 30, 123, 168, 109, 44, 165, 132, 153, 141, 13, 189, 177, 84, 80, 3, 169, 125, 25, 98, 230, 154, 69, 157, 64, 135, 21, 235, 201, 11, 236, 103, 253, 234, 191, 247, 150, 91, 194, 28, 174, 106, 90, 65, 2, 79, 92, 244, 52, 8, 147, 115, 83, 63, 12, 82, 101, 94, 40, 161, 15, 181, 9, 54, 155, 61, 38, 105, 205, 159, 27, 158, 116, 46, 45, 178, 238, 251, 246, 77, 97, 206, 123, 62, 113, 151, 245, 104, 0, 44, 96, 31, 200, 237, 190, 70, 217, 75, 222, 212, 232, 74, 107, 42, 229, 22, 197, 215, 85, 148, 207, 16, 6, 129, 240, 68, 186, 227, 243, 254, 192, 138, 173, 188, 72, 4, 223, 193, 117, 99, 48, 26, 14, 109, 76, 20, 53, 47, 225, 162, 204, 57, 87, 242, 130, 71, 172, 231, 43, 149, 160, 152, 209, 127, 102, 126, 171, 131, 202, 41, 211, 60, 121, 226, 29, 118, 59, 86, 78, 30, 219, 10, 108, 228, 93, 110, 239, 166, 168, 164, 55, 139, 50, 67, 89, 183, 140, 100, 210, 224, 180, 250, 7, 37, 175, 142, 233, 24, 213, 136, 111, 114, 36, 241, 199, 81, 35, 124, 156, 33, 221, 220, 134, 133, 144, 66, 196, 170, 216, 5, 1, 18, 163, 95, 249, 208, 145, 88, 39, 185, 56, 19, 179, 51, 187, 112, 137, 167, 182, 34, 146, 32, 73, 255, 120, 122, 143, 248, 128, 23, 218, 49, 198, 184, 195, 176, 119, 17, 203, 252, 214, 58, 0, 9, 18, 27, 36, 45, 54, 63, 72, 65, 90, 83, 108, 101, 126, 119, 144, 153, 130, 139, 180, 189, 166, 175, 216, 209, 202, 195, 252, 245, 238, 231, 59, 50, 41, 32, 31, 22, 13, 4, 115, 122, 97, 104, 87, 94, 69, 76, 171, 162, 185, 176, 143, 134, 157, 148, 227, 234, 241, 248, 199, 206, 213, 220, 118, 127, 100, 109, 82, 91, 64, 73, 62, 55, 44, 37, 26, 19, 8, 1, 230, 239, 244, 253, 194, 203, 208, 217, 174, 167, 188, 181, 138, 131, 152, 145, 77, 68, 95, 86, 105, 96, 123, 114, 5, 12, 23, 30, 33, 40, 51, 58, 221, 212, 207, 198, 249, 240, 235, 226, 149, 156, 135, 142, 177, 184, 163, 170, 236, 229, 254, 247, 200, 193, 218, 211, 164, 173, 182, 191, 128, 137, 146, 155, 124, 117, 110, 103, 88, 81, 74, 67, 52, 61, 38, 47, 16, 25, 2, 11, 215, 222, 197, 204, 243, 250, 225, 232, 159, 150, 141, 132, 187, 178, 169, 160, 71, 78, 85, 92, 99, 106, 113, 120, 15, 6, 29, 20, 43, 34, 57, 48, 154, 147, 136, 129, 190, 183, 172, 165, 210, 219, 192, 201, 246, 255, 228, 237, 10, 3, 24, 17, 46, 39, 60, 53, 66, 75, 80, 89, 102, 111, 116, 125, 161, 168, 179, 186, 133, 140, 151, 158, 233, 224, 251, 242, 205, 196, 223, 214, 49, 56, 35, 42, 21, 28, 7, 14, 121, 112, 107, 98, 93, 84, 79, 70, 0, 11, 22, 29, 44, 39, 58, 49, 88, 83, 78, 69, 116, 127, 98, 105, 176, 187, 166, 173, 156, 151, 138, 129, 232, 227, 254, 245, 196, 207, 210, 217, 123, 112, 109, 102, 87, 92, 65, 74, 35, 40, 53, 62, 15, 4, 25, 18, 203, 192, 221, 214, 231, 236, 241, 250, 147, 152, 133, 142, 191, 180, 169, 162, 246, 253, 224, 235, 218, 209, 204, 199, 174, 165, 184, 179, 130, 137, 148, 159, 70, 77, 80, 91, 106, 97, 124, 119, 30, 21, 8, 3, 50, 57, 36, 47, 141, 134, 155, 144, 161, 170, 183, 188, 213, 222, 195, 200, 249, 242, 239, 228, 61, 54, 43, 32, 17, 26, 7, 12, 101, 110, 115, 120, 73, 66, 95, 84, 247, 252, 225, 234, 219, 208, 205, 198, 175, 164, 185, 178, 131, 136, 149, 158, 71, 76, 81, 90, 107, 96, 125, 118, 31, 20, 9, 2, 51, 56, 37, 46, 140, 135, 154, 145, 160, 171, 182, 189, 212, 223, 194, 201, 248, 243, 238, 229, 60, 55, 42, 33, 16, 27, 6, 13, 100, 111, 114, 121, 72, 67, 94, 85, 1, 10, 23, 28, 45, 38, 59, 48, 89, 82, 79, 68, 117, 126, 99, 104, 177, 186, 167, 172, 157, 150, 139, 128, 233, 226, 255, 244, 197, 206, 211, 216, 122, 113, 108, 103, 86, 93, 64, 75, 34, 41, 52, 63, 14, 5, 24, 19, 202, 193, 220, 215, 230, 237, 240, 251, 146, 153, 132, 143, 190, 181, 168, 163, 0, 13, 26, 23, 52, 57, 46, 35, 104, 101, 114, 127, 92, 81, 70, 75, 208, 221, 202, 199, 228, 233, 254, 243, 184, 181, 162, 175, 140, 129, 150, 155, 187, 182, 161, 172, 143, 130, 149, 152, 211, 222, 201, 196, 231, 234, 253, 240, 107, 102, 113, 124, 95, 82, 69, 72, 3, 14, 25, 20, 55, 58, 45, 32, 109, 96, 119, 122, 89, 84, 67, 78, 5, 8, 31, 18, 49, 60, 43, 38, 189, 176, 167, 170, 137, 132, 147, 158, 213, 216, 207, 194, 225, 236, 251, 246, 214, 219, 204, 193, 226, 239, 248, 245, 190, 179, 164, 169, 138, 135, 144, 157, 6, 11, 28, 17, 50, 63, 40, 37, 110, 99, 116, 121, 90, 87, 64, 77, 218, 215, 192, 205, 238, 227, 244, 249, 178, 191, 168, 165, 134, 139, 156, 145, 10, 7, 16, 29, 62, 51, 36, 41, 98, 111, 120, 117, 86, 91, 76, 65, 97, 108, 123, 118, 85, 88, 79, 66, 9, 4, 19, 30, 61, 48, 39, 42, 177, 188, 171, 166, 133, 136, 159, 146, 217, 212, 195, 206, 237, 224, 247, 250, 183, 186, 173, 160, 131, 142, 153, 148, 223, 210, 197, 200, 235, 230, 241, 252, 103, 106, 125, 112, 83, 94, 73, 68, 15, 2, 21, 24, 59, 54, 33, 44, 12, 1, 22, 27, 56, 53, 34, 47, 100, 105, 126, 115, 80, 93, 74, 71, 220, 209, 198, 203, 232, 229, 242, 255, 180, 185, 174, 163, 128, 141, 154, 151, 0, 14, 28, 18, 56, 54, 36, 42, 112, 126, 108, 98, 72, 70, 84, 90, 224, 238, 252, 242, 216, 214, 196, 202, 144, 158, 140, 130, 168, 166, 180, 186, 219, 213, 199, 201, 227, 237, 255, 241, 171, 165, 183, 185, 147, 157, 143, 129, 59, 53, 39, 41, 3, 13, 31, 17, 75, 69, 87, 89, 115, 125, 111, 97, 173, 163, 177, 191, 149, 155, 137, 135, 221, 211, 193, 207, 229, 235, 249, 247, 77, 67, 81, 95, 117, 123, 105, 103, 61, 51, 33, 47, 5, 11, 25, 23, 118, 120, 106, 100, 78, 64, 82, 92, 6, 8, 26, 20, 62, 48, 34, 44, 150, 152, 138, 132, 174, 160, 178, 188, 230, 232, 250, 244, 222, 208, 194, 204, 65, 79, 93, 83, 121, 119, 101, 107, 49, 63, 45, 35, 9, 7, 21, 27, 161, 175, 189, 179, 153, 151, 133, 139, 209, 223, 205, 195, 233, 231, 245, 251, 154, 148, 134, 136, 162, 172, 190, 176, 234, 228, 246, 248, 210, 220, 206, 192, 122, 116, 102, 104, 66, 76, 94, 80, 10, 4, 22, 24, 50, 60, 46, 32, 236, 226, 240, 254, 212, 218, 200, 198, 156, 146, 128, 142, 164, 170, 184, 182, 12, 2, 16, 30, 52, 58, 40, 38, 124, 114, 96, 110, 68, 74, 88, 86, 55, 57, 43, 37, 15, 1, 19, 29, 71, 73, 91, 85, 127, 113, 99, 109, 215, 217, 203, 197, 239, 225, 243, 253, 167, 169, 187, 181, 159, 145, 131, 141 ]; | ||
86 | var _aes_heap_start = 2048; | ||
87 | function _aes_asm(stdlib, foreign, buffer) { | ||
88 | "use asm"; | ||
89 | var S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, S5 = 0, S6 = 0, S7 = 0, S8 = 0, S9 = 0, SA = 0, SB = 0, SC = 0, SD = 0, SE = 0, SF = 0; | ||
90 | var keySize = 0; | ||
91 | var R00 = 0, R01 = 0, R02 = 0, R03 = 0, R04 = 0, R05 = 0, R06 = 0, R07 = 0, R08 = 0, R09 = 0, R0A = 0, R0B = 0, R0C = 0, R0D = 0, R0E = 0, R0F = 0, R10 = 0, R11 = 0, R12 = 0, R13 = 0, R14 = 0, R15 = 0, R16 = 0, R17 = 0, R18 = 0, R19 = 0, R1A = 0, R1B = 0, R1C = 0, R1D = 0, R1E = 0, R1F = 0, R20 = 0, R21 = 0, R22 = 0, R23 = 0, R24 = 0, R25 = 0, R26 = 0, R27 = 0, R28 = 0, R29 = 0, R2A = 0, R2B = 0, R2C = 0, R2D = 0, R2E = 0, R2F = 0, R30 = 0, R31 = 0, R32 = 0, R33 = 0, R34 = 0, R35 = 0, R36 = 0, R37 = 0, R38 = 0, R39 = 0, R3A = 0, R3B = 0, R3C = 0, R3D = 0, R3E = 0, R3F = 0, R40 = 0, R41 = 0, R42 = 0, R43 = 0, R44 = 0, R45 = 0, R46 = 0, R47 = 0, R48 = 0, R49 = 0, R4A = 0, R4B = 0, R4C = 0, R4D = 0, R4E = 0, R4F = 0, R50 = 0, R51 = 0, R52 = 0, R53 = 0, R54 = 0, R55 = 0, R56 = 0, R57 = 0, R58 = 0, R59 = 0, R5A = 0, R5B = 0, R5C = 0, R5D = 0, R5E = 0, R5F = 0, R60 = 0, R61 = 0, R62 = 0, R63 = 0, R64 = 0, R65 = 0, R66 = 0, R67 = 0, R68 = 0, R69 = 0, R6A = 0, R6B = 0, R6C = 0, R6D = 0, R6E = 0, R6F = 0, R70 = 0, R71 = 0, R72 = 0, R73 = 0, R74 = 0, R75 = 0, R76 = 0, R77 = 0, R78 = 0, R79 = 0, R7A = 0, R7B = 0, R7C = 0, R7D = 0, R7E = 0, R7F = 0, R80 = 0, R81 = 0, R82 = 0, R83 = 0, R84 = 0, R85 = 0, R86 = 0, R87 = 0, R88 = 0, R89 = 0, R8A = 0, R8B = 0, R8C = 0, R8D = 0, R8E = 0, R8F = 0, R90 = 0, R91 = 0, R92 = 0, R93 = 0, R94 = 0, R95 = 0, R96 = 0, R97 = 0, R98 = 0, R99 = 0, R9A = 0, R9B = 0, R9C = 0, R9D = 0, R9E = 0, R9F = 0, RA0 = 0, RA1 = 0, RA2 = 0, RA3 = 0, RA4 = 0, RA5 = 0, RA6 = 0, RA7 = 0, RA8 = 0, RA9 = 0, RAA = 0, RAB = 0, RAC = 0, RAD = 0, RAE = 0, RAF = 0, RB0 = 0, RB1 = 0, RB2 = 0, RB3 = 0, RB4 = 0, RB5 = 0, RB6 = 0, RB7 = 0, RB8 = 0, RB9 = 0, RBA = 0, RBB = 0, RBC = 0, RBD = 0, RBE = 0, RBF = 0, RC0 = 0, RC1 = 0, RC2 = 0, RC3 = 0, RC4 = 0, RC5 = 0, RC6 = 0, RC7 = 0, RC8 = 0, RC9 = 0, RCA = 0, RCB = 0, RCC = 0, RCD = 0, RCE = 0, RCF = 0, RD0 = 0, RD1 = 0, RD2 = 0, RD3 = 0, RD4 = 0, RD5 = 0, RD6 = 0, RD7 = 0, RD8 = 0, RD9 = 0, RDA = 0, RDB = 0, RDC = 0, RDD = 0, RDE = 0, RDF = 0, RE0 = 0, RE1 = 0, RE2 = 0, RE3 = 0, RE4 = 0, RE5 = 0, RE6 = 0, RE7 = 0, RE8 = 0, RE9 = 0, REA = 0, REB = 0, REC = 0, RED = 0, REE = 0, REF = 0; | ||
92 | var HEAP = new stdlib.Uint8Array(buffer); | ||
93 | function _expand_key_128() { | ||
94 | var sbox = 0; | ||
95 | R10 = R00 ^ HEAP[sbox | R0D] ^ 1; | ||
96 | R11 = R01 ^ HEAP[sbox | R0E]; | ||
97 | R12 = R02 ^ HEAP[sbox | R0F]; | ||
98 | R13 = R03 ^ HEAP[sbox | R0C]; | ||
99 | R14 = R04 ^ R10; | ||
100 | R15 = R05 ^ R11; | ||
101 | R16 = R06 ^ R12; | ||
102 | R17 = R07 ^ R13; | ||
103 | R18 = R08 ^ R14; | ||
104 | R19 = R09 ^ R15; | ||
105 | R1A = R0A ^ R16; | ||
106 | R1B = R0B ^ R17; | ||
107 | R1C = R0C ^ R18; | ||
108 | R1D = R0D ^ R19; | ||
109 | R1E = R0E ^ R1A; | ||
110 | R1F = R0F ^ R1B; | ||
111 | R20 = R10 ^ HEAP[sbox | R1D] ^ 2; | ||
112 | R21 = R11 ^ HEAP[sbox | R1E]; | ||
113 | R22 = R12 ^ HEAP[sbox | R1F]; | ||
114 | R23 = R13 ^ HEAP[sbox | R1C]; | ||
115 | R24 = R14 ^ R20; | ||
116 | R25 = R15 ^ R21; | ||
117 | R26 = R16 ^ R22; | ||
118 | R27 = R17 ^ R23; | ||
119 | R28 = R18 ^ R24; | ||
120 | R29 = R19 ^ R25; | ||
121 | R2A = R1A ^ R26; | ||
122 | R2B = R1B ^ R27; | ||
123 | R2C = R1C ^ R28; | ||
124 | R2D = R1D ^ R29; | ||
125 | R2E = R1E ^ R2A; | ||
126 | R2F = R1F ^ R2B; | ||
127 | R30 = R20 ^ HEAP[sbox | R2D] ^ 4; | ||
128 | R31 = R21 ^ HEAP[sbox | R2E]; | ||
129 | R32 = R22 ^ HEAP[sbox | R2F]; | ||
130 | R33 = R23 ^ HEAP[sbox | R2C]; | ||
131 | R34 = R24 ^ R30; | ||
132 | R35 = R25 ^ R31; | ||
133 | R36 = R26 ^ R32; | ||
134 | R37 = R27 ^ R33; | ||
135 | R38 = R28 ^ R34; | ||
136 | R39 = R29 ^ R35; | ||
137 | R3A = R2A ^ R36; | ||
138 | R3B = R2B ^ R37; | ||
139 | R3C = R2C ^ R38; | ||
140 | R3D = R2D ^ R39; | ||
141 | R3E = R2E ^ R3A; | ||
142 | R3F = R2F ^ R3B; | ||
143 | R40 = R30 ^ HEAP[sbox | R3D] ^ 8; | ||
144 | R41 = R31 ^ HEAP[sbox | R3E]; | ||
145 | R42 = R32 ^ HEAP[sbox | R3F]; | ||
146 | R43 = R33 ^ HEAP[sbox | R3C]; | ||
147 | R44 = R34 ^ R40; | ||
148 | R45 = R35 ^ R41; | ||
149 | R46 = R36 ^ R42; | ||
150 | R47 = R37 ^ R43; | ||
151 | R48 = R38 ^ R44; | ||
152 | R49 = R39 ^ R45; | ||
153 | R4A = R3A ^ R46; | ||
154 | R4B = R3B ^ R47; | ||
155 | R4C = R3C ^ R48; | ||
156 | R4D = R3D ^ R49; | ||
157 | R4E = R3E ^ R4A; | ||
158 | R4F = R3F ^ R4B; | ||
159 | R50 = R40 ^ HEAP[sbox | R4D] ^ 16; | ||
160 | R51 = R41 ^ HEAP[sbox | R4E]; | ||
161 | R52 = R42 ^ HEAP[sbox | R4F]; | ||
162 | R53 = R43 ^ HEAP[sbox | R4C]; | ||
163 | R54 = R44 ^ R50; | ||
164 | R55 = R45 ^ R51; | ||
165 | R56 = R46 ^ R52; | ||
166 | R57 = R47 ^ R53; | ||
167 | R58 = R48 ^ R54; | ||
168 | R59 = R49 ^ R55; | ||
169 | R5A = R4A ^ R56; | ||
170 | R5B = R4B ^ R57; | ||
171 | R5C = R4C ^ R58; | ||
172 | R5D = R4D ^ R59; | ||
173 | R5E = R4E ^ R5A; | ||
174 | R5F = R4F ^ R5B; | ||
175 | R60 = R50 ^ HEAP[sbox | R5D] ^ 32; | ||
176 | R61 = R51 ^ HEAP[sbox | R5E]; | ||
177 | R62 = R52 ^ HEAP[sbox | R5F]; | ||
178 | R63 = R53 ^ HEAP[sbox | R5C]; | ||
179 | R64 = R54 ^ R60; | ||
180 | R65 = R55 ^ R61; | ||
181 | R66 = R56 ^ R62; | ||
182 | R67 = R57 ^ R63; | ||
183 | R68 = R58 ^ R64; | ||
184 | R69 = R59 ^ R65; | ||
185 | R6A = R5A ^ R66; | ||
186 | R6B = R5B ^ R67; | ||
187 | R6C = R5C ^ R68; | ||
188 | R6D = R5D ^ R69; | ||
189 | R6E = R5E ^ R6A; | ||
190 | R6F = R5F ^ R6B; | ||
191 | R70 = R60 ^ HEAP[sbox | R6D] ^ 64; | ||
192 | R71 = R61 ^ HEAP[sbox | R6E]; | ||
193 | R72 = R62 ^ HEAP[sbox | R6F]; | ||
194 | R73 = R63 ^ HEAP[sbox | R6C]; | ||
195 | R74 = R64 ^ R70; | ||
196 | R75 = R65 ^ R71; | ||
197 | R76 = R66 ^ R72; | ||
198 | R77 = R67 ^ R73; | ||
199 | R78 = R68 ^ R74; | ||
200 | R79 = R69 ^ R75; | ||
201 | R7A = R6A ^ R76; | ||
202 | R7B = R6B ^ R77; | ||
203 | R7C = R6C ^ R78; | ||
204 | R7D = R6D ^ R79; | ||
205 | R7E = R6E ^ R7A; | ||
206 | R7F = R6F ^ R7B; | ||
207 | R80 = R70 ^ HEAP[sbox | R7D] ^ 128; | ||
208 | R81 = R71 ^ HEAP[sbox | R7E]; | ||
209 | R82 = R72 ^ HEAP[sbox | R7F]; | ||
210 | R83 = R73 ^ HEAP[sbox | R7C]; | ||
211 | R84 = R74 ^ R80; | ||
212 | R85 = R75 ^ R81; | ||
213 | R86 = R76 ^ R82; | ||
214 | R87 = R77 ^ R83; | ||
215 | R88 = R78 ^ R84; | ||
216 | R89 = R79 ^ R85; | ||
217 | R8A = R7A ^ R86; | ||
218 | R8B = R7B ^ R87; | ||
219 | R8C = R7C ^ R88; | ||
220 | R8D = R7D ^ R89; | ||
221 | R8E = R7E ^ R8A; | ||
222 | R8F = R7F ^ R8B; | ||
223 | R90 = R80 ^ HEAP[sbox | R8D] ^ 27; | ||
224 | R91 = R81 ^ HEAP[sbox | R8E]; | ||
225 | R92 = R82 ^ HEAP[sbox | R8F]; | ||
226 | R93 = R83 ^ HEAP[sbox | R8C]; | ||
227 | R94 = R84 ^ R90; | ||
228 | R95 = R85 ^ R91; | ||
229 | R96 = R86 ^ R92; | ||
230 | R97 = R87 ^ R93; | ||
231 | R98 = R88 ^ R94; | ||
232 | R99 = R89 ^ R95; | ||
233 | R9A = R8A ^ R96; | ||
234 | R9B = R8B ^ R97; | ||
235 | R9C = R8C ^ R98; | ||
236 | R9D = R8D ^ R99; | ||
237 | R9E = R8E ^ R9A; | ||
238 | R9F = R8F ^ R9B; | ||
239 | RA0 = R90 ^ HEAP[sbox | R9D] ^ 54; | ||
240 | RA1 = R91 ^ HEAP[sbox | R9E]; | ||
241 | RA2 = R92 ^ HEAP[sbox | R9F]; | ||
242 | RA3 = R93 ^ HEAP[sbox | R9C]; | ||
243 | RA4 = R94 ^ RA0; | ||
244 | RA5 = R95 ^ RA1; | ||
245 | RA6 = R96 ^ RA2; | ||
246 | RA7 = R97 ^ RA3; | ||
247 | RA8 = R98 ^ RA4; | ||
248 | RA9 = R99 ^ RA5; | ||
249 | RAA = R9A ^ RA6; | ||
250 | RAB = R9B ^ RA7; | ||
251 | RAC = R9C ^ RA8; | ||
252 | RAD = R9D ^ RA9; | ||
253 | RAE = R9E ^ RAA; | ||
254 | RAF = R9F ^ RAB; | ||
255 | } | ||
256 | function _expand_key_256() { | ||
257 | var sbox = 0; | ||
258 | R20 = R00 ^ HEAP[sbox | R1D] ^ 1; | ||
259 | R21 = R01 ^ HEAP[sbox | R1E]; | ||
260 | R22 = R02 ^ HEAP[sbox | R1F]; | ||
261 | R23 = R03 ^ HEAP[sbox | R1C]; | ||
262 | R24 = R04 ^ R20; | ||
263 | R25 = R05 ^ R21; | ||
264 | R26 = R06 ^ R22; | ||
265 | R27 = R07 ^ R23; | ||
266 | R28 = R08 ^ R24; | ||
267 | R29 = R09 ^ R25; | ||
268 | R2A = R0A ^ R26; | ||
269 | R2B = R0B ^ R27; | ||
270 | R2C = R0C ^ R28; | ||
271 | R2D = R0D ^ R29; | ||
272 | R2E = R0E ^ R2A; | ||
273 | R2F = R0F ^ R2B; | ||
274 | R30 = R10 ^ HEAP[sbox | R2C]; | ||
275 | R31 = R11 ^ HEAP[sbox | R2D]; | ||
276 | R32 = R12 ^ HEAP[sbox | R2E]; | ||
277 | R33 = R13 ^ HEAP[sbox | R2F]; | ||
278 | R34 = R14 ^ R30; | ||
279 | R35 = R15 ^ R31; | ||
280 | R36 = R16 ^ R32; | ||
281 | R37 = R17 ^ R33; | ||
282 | R38 = R18 ^ R34; | ||
283 | R39 = R19 ^ R35; | ||
284 | R3A = R1A ^ R36; | ||
285 | R3B = R1B ^ R37; | ||
286 | R3C = R1C ^ R38; | ||
287 | R3D = R1D ^ R39; | ||
288 | R3E = R1E ^ R3A; | ||
289 | R3F = R1F ^ R3B; | ||
290 | R40 = R20 ^ HEAP[sbox | R3D] ^ 2; | ||
291 | R41 = R21 ^ HEAP[sbox | R3E]; | ||
292 | R42 = R22 ^ HEAP[sbox | R3F]; | ||
293 | R43 = R23 ^ HEAP[sbox | R3C]; | ||
294 | R44 = R24 ^ R40; | ||
295 | R45 = R25 ^ R41; | ||
296 | R46 = R26 ^ R42; | ||
297 | R47 = R27 ^ R43; | ||
298 | R48 = R28 ^ R44; | ||
299 | R49 = R29 ^ R45; | ||
300 | R4A = R2A ^ R46; | ||
301 | R4B = R2B ^ R47; | ||
302 | R4C = R2C ^ R48; | ||
303 | R4D = R2D ^ R49; | ||
304 | R4E = R2E ^ R4A; | ||
305 | R4F = R2F ^ R4B; | ||
306 | R50 = R30 ^ HEAP[sbox | R4C]; | ||
307 | R51 = R31 ^ HEAP[sbox | R4D]; | ||
308 | R52 = R32 ^ HEAP[sbox | R4E]; | ||
309 | R53 = R33 ^ HEAP[sbox | R4F]; | ||
310 | R54 = R34 ^ R50; | ||
311 | R55 = R35 ^ R51; | ||
312 | R56 = R36 ^ R52; | ||
313 | R57 = R37 ^ R53; | ||
314 | R58 = R38 ^ R54; | ||
315 | R59 = R39 ^ R55; | ||
316 | R5A = R3A ^ R56; | ||
317 | R5B = R3B ^ R57; | ||
318 | R5C = R3C ^ R58; | ||
319 | R5D = R3D ^ R59; | ||
320 | R5E = R3E ^ R5A; | ||
321 | R5F = R3F ^ R5B; | ||
322 | R60 = R40 ^ HEAP[sbox | R5D] ^ 4; | ||
323 | R61 = R41 ^ HEAP[sbox | R5E]; | ||
324 | R62 = R42 ^ HEAP[sbox | R5F]; | ||
325 | R63 = R43 ^ HEAP[sbox | R5C]; | ||
326 | R64 = R44 ^ R60; | ||
327 | R65 = R45 ^ R61; | ||
328 | R66 = R46 ^ R62; | ||
329 | R67 = R47 ^ R63; | ||
330 | R68 = R48 ^ R64; | ||
331 | R69 = R49 ^ R65; | ||
332 | R6A = R4A ^ R66; | ||
333 | R6B = R4B ^ R67; | ||
334 | R6C = R4C ^ R68; | ||
335 | R6D = R4D ^ R69; | ||
336 | R6E = R4E ^ R6A; | ||
337 | R6F = R4F ^ R6B; | ||
338 | R70 = R50 ^ HEAP[sbox | R6C]; | ||
339 | R71 = R51 ^ HEAP[sbox | R6D]; | ||
340 | R72 = R52 ^ HEAP[sbox | R6E]; | ||
341 | R73 = R53 ^ HEAP[sbox | R6F]; | ||
342 | R74 = R54 ^ R70; | ||
343 | R75 = R55 ^ R71; | ||
344 | R76 = R56 ^ R72; | ||
345 | R77 = R57 ^ R73; | ||
346 | R78 = R58 ^ R74; | ||
347 | R79 = R59 ^ R75; | ||
348 | R7A = R5A ^ R76; | ||
349 | R7B = R5B ^ R77; | ||
350 | R7C = R5C ^ R78; | ||
351 | R7D = R5D ^ R79; | ||
352 | R7E = R5E ^ R7A; | ||
353 | R7F = R5F ^ R7B; | ||
354 | R80 = R60 ^ HEAP[sbox | R7D] ^ 8; | ||
355 | R81 = R61 ^ HEAP[sbox | R7E]; | ||
356 | R82 = R62 ^ HEAP[sbox | R7F]; | ||
357 | R83 = R63 ^ HEAP[sbox | R7C]; | ||
358 | R84 = R64 ^ R80; | ||
359 | R85 = R65 ^ R81; | ||
360 | R86 = R66 ^ R82; | ||
361 | R87 = R67 ^ R83; | ||
362 | R88 = R68 ^ R84; | ||
363 | R89 = R69 ^ R85; | ||
364 | R8A = R6A ^ R86; | ||
365 | R8B = R6B ^ R87; | ||
366 | R8C = R6C ^ R88; | ||
367 | R8D = R6D ^ R89; | ||
368 | R8E = R6E ^ R8A; | ||
369 | R8F = R6F ^ R8B; | ||
370 | R90 = R70 ^ HEAP[sbox | R8C]; | ||
371 | R91 = R71 ^ HEAP[sbox | R8D]; | ||
372 | R92 = R72 ^ HEAP[sbox | R8E]; | ||
373 | R93 = R73 ^ HEAP[sbox | R8F]; | ||
374 | R94 = R74 ^ R90; | ||
375 | R95 = R75 ^ R91; | ||
376 | R96 = R76 ^ R92; | ||
377 | R97 = R77 ^ R93; | ||
378 | R98 = R78 ^ R94; | ||
379 | R99 = R79 ^ R95; | ||
380 | R9A = R7A ^ R96; | ||
381 | R9B = R7B ^ R97; | ||
382 | R9C = R7C ^ R98; | ||
383 | R9D = R7D ^ R99; | ||
384 | R9E = R7E ^ R9A; | ||
385 | R9F = R7F ^ R9B; | ||
386 | RA0 = R80 ^ HEAP[sbox | R9D] ^ 16; | ||
387 | RA1 = R81 ^ HEAP[sbox | R9E]; | ||
388 | RA2 = R82 ^ HEAP[sbox | R9F]; | ||
389 | RA3 = R83 ^ HEAP[sbox | R9C]; | ||
390 | RA4 = R84 ^ RA0; | ||
391 | RA5 = R85 ^ RA1; | ||
392 | RA6 = R86 ^ RA2; | ||
393 | RA7 = R87 ^ RA3; | ||
394 | RA8 = R88 ^ RA4; | ||
395 | RA9 = R89 ^ RA5; | ||
396 | RAA = R8A ^ RA6; | ||
397 | RAB = R8B ^ RA7; | ||
398 | RAC = R8C ^ RA8; | ||
399 | RAD = R8D ^ RA9; | ||
400 | RAE = R8E ^ RAA; | ||
401 | RAF = R8F ^ RAB; | ||
402 | RB0 = R90 ^ HEAP[sbox | RAC]; | ||
403 | RB1 = R91 ^ HEAP[sbox | RAD]; | ||
404 | RB2 = R92 ^ HEAP[sbox | RAE]; | ||
405 | RB3 = R93 ^ HEAP[sbox | RAF]; | ||
406 | RB4 = R94 ^ RB0; | ||
407 | RB5 = R95 ^ RB1; | ||
408 | RB6 = R96 ^ RB2; | ||
409 | RB7 = R97 ^ RB3; | ||
410 | RB8 = R98 ^ RB4; | ||
411 | RB9 = R99 ^ RB5; | ||
412 | RBA = R9A ^ RB6; | ||
413 | RBB = R9B ^ RB7; | ||
414 | RBC = R9C ^ RB8; | ||
415 | RBD = R9D ^ RB9; | ||
416 | RBE = R9E ^ RBA; | ||
417 | RBF = R9F ^ RBB; | ||
418 | RC0 = RA0 ^ HEAP[sbox | RBD] ^ 32; | ||
419 | RC1 = RA1 ^ HEAP[sbox | RBE]; | ||
420 | RC2 = RA2 ^ HEAP[sbox | RBF]; | ||
421 | RC3 = RA3 ^ HEAP[sbox | RBC]; | ||
422 | RC4 = RA4 ^ RC0; | ||
423 | RC5 = RA5 ^ RC1; | ||
424 | RC6 = RA6 ^ RC2; | ||
425 | RC7 = RA7 ^ RC3; | ||
426 | RC8 = RA8 ^ RC4; | ||
427 | RC9 = RA9 ^ RC5; | ||
428 | RCA = RAA ^ RC6; | ||
429 | RCB = RAB ^ RC7; | ||
430 | RCC = RAC ^ RC8; | ||
431 | RCD = RAD ^ RC9; | ||
432 | RCE = RAE ^ RCA; | ||
433 | RCF = RAF ^ RCB; | ||
434 | RD0 = RB0 ^ HEAP[sbox | RCC]; | ||
435 | RD1 = RB1 ^ HEAP[sbox | RCD]; | ||
436 | RD2 = RB2 ^ HEAP[sbox | RCE]; | ||
437 | RD3 = RB3 ^ HEAP[sbox | RCF]; | ||
438 | RD4 = RB4 ^ RD0; | ||
439 | RD5 = RB5 ^ RD1; | ||
440 | RD6 = RB6 ^ RD2; | ||
441 | RD7 = RB7 ^ RD3; | ||
442 | RD8 = RB8 ^ RD4; | ||
443 | RD9 = RB9 ^ RD5; | ||
444 | RDA = RBA ^ RD6; | ||
445 | RDB = RBB ^ RD7; | ||
446 | RDC = RBC ^ RD8; | ||
447 | RDD = RBD ^ RD9; | ||
448 | RDE = RBE ^ RDA; | ||
449 | RDF = RBF ^ RDB; | ||
450 | RE0 = RC0 ^ HEAP[sbox | RDD] ^ 64; | ||
451 | RE1 = RC1 ^ HEAP[sbox | RDE]; | ||
452 | RE2 = RC2 ^ HEAP[sbox | RDF]; | ||
453 | RE3 = RC3 ^ HEAP[sbox | RDC]; | ||
454 | RE4 = RC4 ^ RE0; | ||
455 | RE5 = RC5 ^ RE1; | ||
456 | RE6 = RC6 ^ RE2; | ||
457 | RE7 = RC7 ^ RE3; | ||
458 | RE8 = RC8 ^ RE4; | ||
459 | RE9 = RC9 ^ RE5; | ||
460 | REA = RCA ^ RE6; | ||
461 | REB = RCB ^ RE7; | ||
462 | REC = RCC ^ RE8; | ||
463 | RED = RCD ^ RE9; | ||
464 | REE = RCE ^ REA; | ||
465 | REF = RCF ^ REB; | ||
466 | } | ||
467 | function _encrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) { | ||
468 | s0 = s0 | 0; | ||
469 | s1 = s1 | 0; | ||
470 | s2 = s2 | 0; | ||
471 | s3 = s3 | 0; | ||
472 | s4 = s4 | 0; | ||
473 | s5 = s5 | 0; | ||
474 | s6 = s6 | 0; | ||
475 | s7 = s7 | 0; | ||
476 | s8 = s8 | 0; | ||
477 | s9 = s9 | 0; | ||
478 | sA = sA | 0; | ||
479 | sB = sB | 0; | ||
480 | sC = sC | 0; | ||
481 | sD = sD | 0; | ||
482 | sE = sE | 0; | ||
483 | sF = sF | 0; | ||
484 | var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, tA = 0, tB = 0, tC = 0, tD = 0, tE = 0, tF = 0, sbox = 0, x2_sbox = 512, x3_sbox = 768; | ||
485 | s0 = s0 ^ R00; | ||
486 | s1 = s1 ^ R01; | ||
487 | s2 = s2 ^ R02; | ||
488 | s3 = s3 ^ R03; | ||
489 | s4 = s4 ^ R04; | ||
490 | s5 = s5 ^ R05; | ||
491 | s6 = s6 ^ R06; | ||
492 | s7 = s7 ^ R07; | ||
493 | s8 = s8 ^ R08; | ||
494 | s9 = s9 ^ R09; | ||
495 | sA = sA ^ R0A; | ||
496 | sB = sB ^ R0B; | ||
497 | sC = sC ^ R0C; | ||
498 | sD = sD ^ R0D; | ||
499 | sE = sE ^ R0E; | ||
500 | sF = sF ^ R0F; | ||
501 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R10; | ||
502 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R11; | ||
503 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R12; | ||
504 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R13; | ||
505 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R14; | ||
506 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R15; | ||
507 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R16; | ||
508 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R17; | ||
509 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R18; | ||
510 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R19; | ||
511 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R1A; | ||
512 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R1B; | ||
513 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R1C; | ||
514 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R1D; | ||
515 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R1E; | ||
516 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R1F; | ||
517 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R20; | ||
518 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R21; | ||
519 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R22; | ||
520 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R23; | ||
521 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R24; | ||
522 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R25; | ||
523 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R26; | ||
524 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R27; | ||
525 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R28; | ||
526 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R29; | ||
527 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R2A; | ||
528 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R2B; | ||
529 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R2C; | ||
530 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R2D; | ||
531 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R2E; | ||
532 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R2F; | ||
533 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R30; | ||
534 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R31; | ||
535 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R32; | ||
536 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R33; | ||
537 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R34; | ||
538 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R35; | ||
539 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R36; | ||
540 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R37; | ||
541 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R38; | ||
542 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R39; | ||
543 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R3A; | ||
544 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R3B; | ||
545 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R3C; | ||
546 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R3D; | ||
547 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R3E; | ||
548 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R3F; | ||
549 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R40; | ||
550 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R41; | ||
551 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R42; | ||
552 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R43; | ||
553 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R44; | ||
554 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R45; | ||
555 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R46; | ||
556 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R47; | ||
557 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R48; | ||
558 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R49; | ||
559 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R4A; | ||
560 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R4B; | ||
561 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R4C; | ||
562 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R4D; | ||
563 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R4E; | ||
564 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R4F; | ||
565 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R50; | ||
566 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R51; | ||
567 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R52; | ||
568 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R53; | ||
569 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R54; | ||
570 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R55; | ||
571 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R56; | ||
572 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R57; | ||
573 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R58; | ||
574 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R59; | ||
575 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R5A; | ||
576 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R5B; | ||
577 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R5C; | ||
578 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R5D; | ||
579 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R5E; | ||
580 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R5F; | ||
581 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R60; | ||
582 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R61; | ||
583 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R62; | ||
584 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R63; | ||
585 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R64; | ||
586 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R65; | ||
587 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R66; | ||
588 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R67; | ||
589 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R68; | ||
590 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R69; | ||
591 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R6A; | ||
592 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R6B; | ||
593 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R6C; | ||
594 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R6D; | ||
595 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R6E; | ||
596 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R6F; | ||
597 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R70; | ||
598 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R71; | ||
599 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R72; | ||
600 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R73; | ||
601 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R74; | ||
602 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R75; | ||
603 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R76; | ||
604 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R77; | ||
605 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R78; | ||
606 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R79; | ||
607 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R7A; | ||
608 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R7B; | ||
609 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R7C; | ||
610 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R7D; | ||
611 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R7E; | ||
612 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R7F; | ||
613 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R80; | ||
614 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R81; | ||
615 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R82; | ||
616 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R83; | ||
617 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R84; | ||
618 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R85; | ||
619 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R86; | ||
620 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R87; | ||
621 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R88; | ||
622 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R89; | ||
623 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R8A; | ||
624 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R8B; | ||
625 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R8C; | ||
626 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R8D; | ||
627 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R8E; | ||
628 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R8F; | ||
629 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R90; | ||
630 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R91; | ||
631 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R92; | ||
632 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R93; | ||
633 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R94; | ||
634 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R95; | ||
635 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R96; | ||
636 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R97; | ||
637 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R98; | ||
638 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R99; | ||
639 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R9A; | ||
640 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R9B; | ||
641 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R9C; | ||
642 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R9D; | ||
643 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R9E; | ||
644 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R9F; | ||
645 | if ((keySize | 0) == 16) { | ||
646 | S0 = HEAP[sbox | t0] ^ RA0; | ||
647 | S1 = HEAP[sbox | t5] ^ RA1; | ||
648 | S2 = HEAP[sbox | tA] ^ RA2; | ||
649 | S3 = HEAP[sbox | tF] ^ RA3; | ||
650 | S4 = HEAP[sbox | t4] ^ RA4; | ||
651 | S5 = HEAP[sbox | t9] ^ RA5; | ||
652 | S6 = HEAP[sbox | tE] ^ RA6; | ||
653 | S7 = HEAP[sbox | t3] ^ RA7; | ||
654 | S8 = HEAP[sbox | t8] ^ RA8; | ||
655 | S9 = HEAP[sbox | tD] ^ RA9; | ||
656 | SA = HEAP[sbox | t2] ^ RAA; | ||
657 | SB = HEAP[sbox | t7] ^ RAB; | ||
658 | SC = HEAP[sbox | tC] ^ RAC; | ||
659 | SD = HEAP[sbox | t1] ^ RAD; | ||
660 | SE = HEAP[sbox | t6] ^ RAE; | ||
661 | SF = HEAP[sbox | tB] ^ RAF; | ||
662 | return; | ||
663 | } | ||
664 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RA0; | ||
665 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RA1; | ||
666 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RA2; | ||
667 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RA3; | ||
668 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RA4; | ||
669 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RA5; | ||
670 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RA6; | ||
671 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RA7; | ||
672 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RA8; | ||
673 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RA9; | ||
674 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RAA; | ||
675 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RAB; | ||
676 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RAC; | ||
677 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RAD; | ||
678 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RAE; | ||
679 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RAF; | ||
680 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RB0; | ||
681 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RB1; | ||
682 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RB2; | ||
683 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RB3; | ||
684 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RB4; | ||
685 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RB5; | ||
686 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RB6; | ||
687 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RB7; | ||
688 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RB8; | ||
689 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RB9; | ||
690 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RBA; | ||
691 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RBB; | ||
692 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RBC; | ||
693 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RBD; | ||
694 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RBE; | ||
695 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RBF; | ||
696 | s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RC0; | ||
697 | s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RC1; | ||
698 | s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RC2; | ||
699 | s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RC3; | ||
700 | s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RC4; | ||
701 | s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RC5; | ||
702 | s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RC6; | ||
703 | s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RC7; | ||
704 | s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RC8; | ||
705 | s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RC9; | ||
706 | sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RCA; | ||
707 | sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RCB; | ||
708 | sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RCC; | ||
709 | sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RCD; | ||
710 | sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RCE; | ||
711 | sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RCF; | ||
712 | t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RD0; | ||
713 | t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RD1; | ||
714 | t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RD2; | ||
715 | t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RD3; | ||
716 | t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RD4; | ||
717 | t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RD5; | ||
718 | t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RD6; | ||
719 | t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RD7; | ||
720 | t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RD8; | ||
721 | t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RD9; | ||
722 | tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RDA; | ||
723 | tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RDB; | ||
724 | tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RDC; | ||
725 | tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RDD; | ||
726 | tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RDE; | ||
727 | tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RDF; | ||
728 | S0 = HEAP[sbox | t0] ^ RE0; | ||
729 | S1 = HEAP[sbox | t5] ^ RE1; | ||
730 | S2 = HEAP[sbox | tA] ^ RE2; | ||
731 | S3 = HEAP[sbox | tF] ^ RE3; | ||
732 | S4 = HEAP[sbox | t4] ^ RE4; | ||
733 | S5 = HEAP[sbox | t9] ^ RE5; | ||
734 | S6 = HEAP[sbox | tE] ^ RE6; | ||
735 | S7 = HEAP[sbox | t3] ^ RE7; | ||
736 | S8 = HEAP[sbox | t8] ^ RE8; | ||
737 | S9 = HEAP[sbox | tD] ^ RE9; | ||
738 | SA = HEAP[sbox | t2] ^ REA; | ||
739 | SB = HEAP[sbox | t7] ^ REB; | ||
740 | SC = HEAP[sbox | tC] ^ REC; | ||
741 | SD = HEAP[sbox | t1] ^ RED; | ||
742 | SE = HEAP[sbox | t6] ^ REE; | ||
743 | SF = HEAP[sbox | tB] ^ REF; | ||
744 | } | ||
745 | function _decrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) { | ||
746 | s0 = s0 | 0; | ||
747 | s1 = s1 | 0; | ||
748 | s2 = s2 | 0; | ||
749 | s3 = s3 | 0; | ||
750 | s4 = s4 | 0; | ||
751 | s5 = s5 | 0; | ||
752 | s6 = s6 | 0; | ||
753 | s7 = s7 | 0; | ||
754 | s8 = s8 | 0; | ||
755 | s9 = s9 | 0; | ||
756 | sA = sA | 0; | ||
757 | sB = sB | 0; | ||
758 | sC = sC | 0; | ||
759 | sD = sD | 0; | ||
760 | sE = sE | 0; | ||
761 | sF = sF | 0; | ||
762 | var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, tA = 0, tB = 0, tC = 0, tD = 0, tE = 0, tF = 0, inv_sbox = 256, x9 = 1024, xB = 1280, xD = 1536, xE = 1792; | ||
763 | if ((keySize | 0) == 32) { | ||
764 | t0 = HEAP[inv_sbox | s0 ^ RE0] ^ RD0; | ||
765 | t1 = HEAP[inv_sbox | sD ^ RED] ^ RD1; | ||
766 | t2 = HEAP[inv_sbox | sA ^ REA] ^ RD2; | ||
767 | t3 = HEAP[inv_sbox | s7 ^ RE7] ^ RD3; | ||
768 | t4 = HEAP[inv_sbox | s4 ^ RE4] ^ RD4; | ||
769 | t5 = HEAP[inv_sbox | s1 ^ RE1] ^ RD5; | ||
770 | t6 = HEAP[inv_sbox | sE ^ REE] ^ RD6; | ||
771 | t7 = HEAP[inv_sbox | sB ^ REB] ^ RD7; | ||
772 | t8 = HEAP[inv_sbox | s8 ^ RE8] ^ RD8; | ||
773 | t9 = HEAP[inv_sbox | s5 ^ RE5] ^ RD9; | ||
774 | tA = HEAP[inv_sbox | s2 ^ RE2] ^ RDA; | ||
775 | tB = HEAP[inv_sbox | sF ^ REF] ^ RDB; | ||
776 | tC = HEAP[inv_sbox | sC ^ REC] ^ RDC; | ||
777 | tD = HEAP[inv_sbox | s9 ^ RE9] ^ RDD; | ||
778 | tE = HEAP[inv_sbox | s6 ^ RE6] ^ RDE; | ||
779 | tF = HEAP[inv_sbox | s3 ^ RE3] ^ RDF; | ||
780 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
781 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
782 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
783 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
784 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
785 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
786 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
787 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
788 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
789 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
790 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
791 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
792 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
793 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
794 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
795 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
796 | t0 = HEAP[inv_sbox | s0] ^ RC0; | ||
797 | t1 = HEAP[inv_sbox | s1] ^ RC1; | ||
798 | t2 = HEAP[inv_sbox | s2] ^ RC2; | ||
799 | t3 = HEAP[inv_sbox | s3] ^ RC3; | ||
800 | t4 = HEAP[inv_sbox | s4] ^ RC4; | ||
801 | t5 = HEAP[inv_sbox | s5] ^ RC5; | ||
802 | t6 = HEAP[inv_sbox | s6] ^ RC6; | ||
803 | t7 = HEAP[inv_sbox | s7] ^ RC7; | ||
804 | t8 = HEAP[inv_sbox | s8] ^ RC8; | ||
805 | t9 = HEAP[inv_sbox | s9] ^ RC9; | ||
806 | tA = HEAP[inv_sbox | sA] ^ RCA; | ||
807 | tB = HEAP[inv_sbox | sB] ^ RCB; | ||
808 | tC = HEAP[inv_sbox | sC] ^ RCC; | ||
809 | tD = HEAP[inv_sbox | sD] ^ RCD; | ||
810 | tE = HEAP[inv_sbox | sE] ^ RCE; | ||
811 | tF = HEAP[inv_sbox | sF] ^ RCF; | ||
812 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
813 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
814 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
815 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
816 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
817 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
818 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
819 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
820 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
821 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
822 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
823 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
824 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
825 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
826 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
827 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
828 | t0 = HEAP[inv_sbox | s0] ^ RB0; | ||
829 | t1 = HEAP[inv_sbox | s1] ^ RB1; | ||
830 | t2 = HEAP[inv_sbox | s2] ^ RB2; | ||
831 | t3 = HEAP[inv_sbox | s3] ^ RB3; | ||
832 | t4 = HEAP[inv_sbox | s4] ^ RB4; | ||
833 | t5 = HEAP[inv_sbox | s5] ^ RB5; | ||
834 | t6 = HEAP[inv_sbox | s6] ^ RB6; | ||
835 | t7 = HEAP[inv_sbox | s7] ^ RB7; | ||
836 | t8 = HEAP[inv_sbox | s8] ^ RB8; | ||
837 | t9 = HEAP[inv_sbox | s9] ^ RB9; | ||
838 | tA = HEAP[inv_sbox | sA] ^ RBA; | ||
839 | tB = HEAP[inv_sbox | sB] ^ RBB; | ||
840 | tC = HEAP[inv_sbox | sC] ^ RBC; | ||
841 | tD = HEAP[inv_sbox | sD] ^ RBD; | ||
842 | tE = HEAP[inv_sbox | sE] ^ RBE; | ||
843 | tF = HEAP[inv_sbox | sF] ^ RBF; | ||
844 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
845 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
846 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
847 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
848 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
849 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
850 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
851 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
852 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
853 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
854 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
855 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
856 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
857 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
858 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
859 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
860 | t0 = HEAP[inv_sbox | s0] ^ RA0; | ||
861 | t1 = HEAP[inv_sbox | s1] ^ RA1; | ||
862 | t2 = HEAP[inv_sbox | s2] ^ RA2; | ||
863 | t3 = HEAP[inv_sbox | s3] ^ RA3; | ||
864 | t4 = HEAP[inv_sbox | s4] ^ RA4; | ||
865 | t5 = HEAP[inv_sbox | s5] ^ RA5; | ||
866 | t6 = HEAP[inv_sbox | s6] ^ RA6; | ||
867 | t7 = HEAP[inv_sbox | s7] ^ RA7; | ||
868 | t8 = HEAP[inv_sbox | s8] ^ RA8; | ||
869 | t9 = HEAP[inv_sbox | s9] ^ RA9; | ||
870 | tA = HEAP[inv_sbox | sA] ^ RAA; | ||
871 | tB = HEAP[inv_sbox | sB] ^ RAB; | ||
872 | tC = HEAP[inv_sbox | sC] ^ RAC; | ||
873 | tD = HEAP[inv_sbox | sD] ^ RAD; | ||
874 | tE = HEAP[inv_sbox | sE] ^ RAE; | ||
875 | tF = HEAP[inv_sbox | sF] ^ RAF; | ||
876 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
877 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
878 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
879 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
880 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
881 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
882 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
883 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
884 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
885 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
886 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
887 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
888 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
889 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
890 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
891 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
892 | t0 = HEAP[inv_sbox | s0] ^ R90; | ||
893 | t1 = HEAP[inv_sbox | s1] ^ R91; | ||
894 | t2 = HEAP[inv_sbox | s2] ^ R92; | ||
895 | t3 = HEAP[inv_sbox | s3] ^ R93; | ||
896 | t4 = HEAP[inv_sbox | s4] ^ R94; | ||
897 | t5 = HEAP[inv_sbox | s5] ^ R95; | ||
898 | t6 = HEAP[inv_sbox | s6] ^ R96; | ||
899 | t7 = HEAP[inv_sbox | s7] ^ R97; | ||
900 | t8 = HEAP[inv_sbox | s8] ^ R98; | ||
901 | t9 = HEAP[inv_sbox | s9] ^ R99; | ||
902 | tA = HEAP[inv_sbox | sA] ^ R9A; | ||
903 | tB = HEAP[inv_sbox | sB] ^ R9B; | ||
904 | tC = HEAP[inv_sbox | sC] ^ R9C; | ||
905 | tD = HEAP[inv_sbox | sD] ^ R9D; | ||
906 | tE = HEAP[inv_sbox | sE] ^ R9E; | ||
907 | tF = HEAP[inv_sbox | sF] ^ R9F; | ||
908 | } else { | ||
909 | t0 = HEAP[inv_sbox | s0 ^ RA0] ^ R90; | ||
910 | t1 = HEAP[inv_sbox | sD ^ RAD] ^ R91; | ||
911 | t2 = HEAP[inv_sbox | sA ^ RAA] ^ R92; | ||
912 | t3 = HEAP[inv_sbox | s7 ^ RA7] ^ R93; | ||
913 | t4 = HEAP[inv_sbox | s4 ^ RA4] ^ R94; | ||
914 | t5 = HEAP[inv_sbox | s1 ^ RA1] ^ R95; | ||
915 | t6 = HEAP[inv_sbox | sE ^ RAE] ^ R96; | ||
916 | t7 = HEAP[inv_sbox | sB ^ RAB] ^ R97; | ||
917 | t8 = HEAP[inv_sbox | s8 ^ RA8] ^ R98; | ||
918 | t9 = HEAP[inv_sbox | s5 ^ RA5] ^ R99; | ||
919 | tA = HEAP[inv_sbox | s2 ^ RA2] ^ R9A; | ||
920 | tB = HEAP[inv_sbox | sF ^ RAF] ^ R9B; | ||
921 | tC = HEAP[inv_sbox | sC ^ RAC] ^ R9C; | ||
922 | tD = HEAP[inv_sbox | s9 ^ RA9] ^ R9D; | ||
923 | tE = HEAP[inv_sbox | s6 ^ RA6] ^ R9E; | ||
924 | tF = HEAP[inv_sbox | s3 ^ RA3] ^ R9F; | ||
925 | } | ||
926 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
927 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
928 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
929 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
930 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
931 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
932 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
933 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
934 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
935 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
936 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
937 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
938 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
939 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
940 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
941 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
942 | t0 = HEAP[inv_sbox | s0] ^ R80; | ||
943 | t1 = HEAP[inv_sbox | s1] ^ R81; | ||
944 | t2 = HEAP[inv_sbox | s2] ^ R82; | ||
945 | t3 = HEAP[inv_sbox | s3] ^ R83; | ||
946 | t4 = HEAP[inv_sbox | s4] ^ R84; | ||
947 | t5 = HEAP[inv_sbox | s5] ^ R85; | ||
948 | t6 = HEAP[inv_sbox | s6] ^ R86; | ||
949 | t7 = HEAP[inv_sbox | s7] ^ R87; | ||
950 | t8 = HEAP[inv_sbox | s8] ^ R88; | ||
951 | t9 = HEAP[inv_sbox | s9] ^ R89; | ||
952 | tA = HEAP[inv_sbox | sA] ^ R8A; | ||
953 | tB = HEAP[inv_sbox | sB] ^ R8B; | ||
954 | tC = HEAP[inv_sbox | sC] ^ R8C; | ||
955 | tD = HEAP[inv_sbox | sD] ^ R8D; | ||
956 | tE = HEAP[inv_sbox | sE] ^ R8E; | ||
957 | tF = HEAP[inv_sbox | sF] ^ R8F; | ||
958 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
959 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
960 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
961 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
962 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
963 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
964 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
965 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
966 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
967 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
968 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
969 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
970 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
971 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
972 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
973 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
974 | t0 = HEAP[inv_sbox | s0] ^ R70; | ||
975 | t1 = HEAP[inv_sbox | s1] ^ R71; | ||
976 | t2 = HEAP[inv_sbox | s2] ^ R72; | ||
977 | t3 = HEAP[inv_sbox | s3] ^ R73; | ||
978 | t4 = HEAP[inv_sbox | s4] ^ R74; | ||
979 | t5 = HEAP[inv_sbox | s5] ^ R75; | ||
980 | t6 = HEAP[inv_sbox | s6] ^ R76; | ||
981 | t7 = HEAP[inv_sbox | s7] ^ R77; | ||
982 | t8 = HEAP[inv_sbox | s8] ^ R78; | ||
983 | t9 = HEAP[inv_sbox | s9] ^ R79; | ||
984 | tA = HEAP[inv_sbox | sA] ^ R7A; | ||
985 | tB = HEAP[inv_sbox | sB] ^ R7B; | ||
986 | tC = HEAP[inv_sbox | sC] ^ R7C; | ||
987 | tD = HEAP[inv_sbox | sD] ^ R7D; | ||
988 | tE = HEAP[inv_sbox | sE] ^ R7E; | ||
989 | tF = HEAP[inv_sbox | sF] ^ R7F; | ||
990 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
991 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
992 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
993 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
994 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
995 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
996 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
997 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
998 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
999 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1000 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1001 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1002 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1003 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1004 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1005 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1006 | t0 = HEAP[inv_sbox | s0] ^ R60; | ||
1007 | t1 = HEAP[inv_sbox | s1] ^ R61; | ||
1008 | t2 = HEAP[inv_sbox | s2] ^ R62; | ||
1009 | t3 = HEAP[inv_sbox | s3] ^ R63; | ||
1010 | t4 = HEAP[inv_sbox | s4] ^ R64; | ||
1011 | t5 = HEAP[inv_sbox | s5] ^ R65; | ||
1012 | t6 = HEAP[inv_sbox | s6] ^ R66; | ||
1013 | t7 = HEAP[inv_sbox | s7] ^ R67; | ||
1014 | t8 = HEAP[inv_sbox | s8] ^ R68; | ||
1015 | t9 = HEAP[inv_sbox | s9] ^ R69; | ||
1016 | tA = HEAP[inv_sbox | sA] ^ R6A; | ||
1017 | tB = HEAP[inv_sbox | sB] ^ R6B; | ||
1018 | tC = HEAP[inv_sbox | sC] ^ R6C; | ||
1019 | tD = HEAP[inv_sbox | sD] ^ R6D; | ||
1020 | tE = HEAP[inv_sbox | sE] ^ R6E; | ||
1021 | tF = HEAP[inv_sbox | sF] ^ R6F; | ||
1022 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1023 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1024 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1025 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1026 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1027 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1028 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1029 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1030 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1031 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1032 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1033 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1034 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1035 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1036 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1037 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1038 | t0 = HEAP[inv_sbox | s0] ^ R50; | ||
1039 | t1 = HEAP[inv_sbox | s1] ^ R51; | ||
1040 | t2 = HEAP[inv_sbox | s2] ^ R52; | ||
1041 | t3 = HEAP[inv_sbox | s3] ^ R53; | ||
1042 | t4 = HEAP[inv_sbox | s4] ^ R54; | ||
1043 | t5 = HEAP[inv_sbox | s5] ^ R55; | ||
1044 | t6 = HEAP[inv_sbox | s6] ^ R56; | ||
1045 | t7 = HEAP[inv_sbox | s7] ^ R57; | ||
1046 | t8 = HEAP[inv_sbox | s8] ^ R58; | ||
1047 | t9 = HEAP[inv_sbox | s9] ^ R59; | ||
1048 | tA = HEAP[inv_sbox | sA] ^ R5A; | ||
1049 | tB = HEAP[inv_sbox | sB] ^ R5B; | ||
1050 | tC = HEAP[inv_sbox | sC] ^ R5C; | ||
1051 | tD = HEAP[inv_sbox | sD] ^ R5D; | ||
1052 | tE = HEAP[inv_sbox | sE] ^ R5E; | ||
1053 | tF = HEAP[inv_sbox | sF] ^ R5F; | ||
1054 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1055 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1056 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1057 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1058 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1059 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1060 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1061 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1062 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1063 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1064 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1065 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1066 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1067 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1068 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1069 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1070 | t0 = HEAP[inv_sbox | s0] ^ R40; | ||
1071 | t1 = HEAP[inv_sbox | s1] ^ R41; | ||
1072 | t2 = HEAP[inv_sbox | s2] ^ R42; | ||
1073 | t3 = HEAP[inv_sbox | s3] ^ R43; | ||
1074 | t4 = HEAP[inv_sbox | s4] ^ R44; | ||
1075 | t5 = HEAP[inv_sbox | s5] ^ R45; | ||
1076 | t6 = HEAP[inv_sbox | s6] ^ R46; | ||
1077 | t7 = HEAP[inv_sbox | s7] ^ R47; | ||
1078 | t8 = HEAP[inv_sbox | s8] ^ R48; | ||
1079 | t9 = HEAP[inv_sbox | s9] ^ R49; | ||
1080 | tA = HEAP[inv_sbox | sA] ^ R4A; | ||
1081 | tB = HEAP[inv_sbox | sB] ^ R4B; | ||
1082 | tC = HEAP[inv_sbox | sC] ^ R4C; | ||
1083 | tD = HEAP[inv_sbox | sD] ^ R4D; | ||
1084 | tE = HEAP[inv_sbox | sE] ^ R4E; | ||
1085 | tF = HEAP[inv_sbox | sF] ^ R4F; | ||
1086 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1087 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1088 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1089 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1090 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1091 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1092 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1093 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1094 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1095 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1096 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1097 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1098 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1099 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1100 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1101 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1102 | t0 = HEAP[inv_sbox | s0] ^ R30; | ||
1103 | t1 = HEAP[inv_sbox | s1] ^ R31; | ||
1104 | t2 = HEAP[inv_sbox | s2] ^ R32; | ||
1105 | t3 = HEAP[inv_sbox | s3] ^ R33; | ||
1106 | t4 = HEAP[inv_sbox | s4] ^ R34; | ||
1107 | t5 = HEAP[inv_sbox | s5] ^ R35; | ||
1108 | t6 = HEAP[inv_sbox | s6] ^ R36; | ||
1109 | t7 = HEAP[inv_sbox | s7] ^ R37; | ||
1110 | t8 = HEAP[inv_sbox | s8] ^ R38; | ||
1111 | t9 = HEAP[inv_sbox | s9] ^ R39; | ||
1112 | tA = HEAP[inv_sbox | sA] ^ R3A; | ||
1113 | tB = HEAP[inv_sbox | sB] ^ R3B; | ||
1114 | tC = HEAP[inv_sbox | sC] ^ R3C; | ||
1115 | tD = HEAP[inv_sbox | sD] ^ R3D; | ||
1116 | tE = HEAP[inv_sbox | sE] ^ R3E; | ||
1117 | tF = HEAP[inv_sbox | sF] ^ R3F; | ||
1118 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1119 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1120 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1121 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1122 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1123 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1124 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1125 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1126 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1127 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1128 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1129 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1130 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1131 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1132 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1133 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1134 | t0 = HEAP[inv_sbox | s0] ^ R20; | ||
1135 | t1 = HEAP[inv_sbox | s1] ^ R21; | ||
1136 | t2 = HEAP[inv_sbox | s2] ^ R22; | ||
1137 | t3 = HEAP[inv_sbox | s3] ^ R23; | ||
1138 | t4 = HEAP[inv_sbox | s4] ^ R24; | ||
1139 | t5 = HEAP[inv_sbox | s5] ^ R25; | ||
1140 | t6 = HEAP[inv_sbox | s6] ^ R26; | ||
1141 | t7 = HEAP[inv_sbox | s7] ^ R27; | ||
1142 | t8 = HEAP[inv_sbox | s8] ^ R28; | ||
1143 | t9 = HEAP[inv_sbox | s9] ^ R29; | ||
1144 | tA = HEAP[inv_sbox | sA] ^ R2A; | ||
1145 | tB = HEAP[inv_sbox | sB] ^ R2B; | ||
1146 | tC = HEAP[inv_sbox | sC] ^ R2C; | ||
1147 | tD = HEAP[inv_sbox | sD] ^ R2D; | ||
1148 | tE = HEAP[inv_sbox | sE] ^ R2E; | ||
1149 | tF = HEAP[inv_sbox | sF] ^ R2F; | ||
1150 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1151 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1152 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1153 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1154 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1155 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1156 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1157 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1158 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1159 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1160 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1161 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1162 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1163 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1164 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1165 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1166 | t0 = HEAP[inv_sbox | s0] ^ R10; | ||
1167 | t1 = HEAP[inv_sbox | s1] ^ R11; | ||
1168 | t2 = HEAP[inv_sbox | s2] ^ R12; | ||
1169 | t3 = HEAP[inv_sbox | s3] ^ R13; | ||
1170 | t4 = HEAP[inv_sbox | s4] ^ R14; | ||
1171 | t5 = HEAP[inv_sbox | s5] ^ R15; | ||
1172 | t6 = HEAP[inv_sbox | s6] ^ R16; | ||
1173 | t7 = HEAP[inv_sbox | s7] ^ R17; | ||
1174 | t8 = HEAP[inv_sbox | s8] ^ R18; | ||
1175 | t9 = HEAP[inv_sbox | s9] ^ R19; | ||
1176 | tA = HEAP[inv_sbox | sA] ^ R1A; | ||
1177 | tB = HEAP[inv_sbox | sB] ^ R1B; | ||
1178 | tC = HEAP[inv_sbox | sC] ^ R1C; | ||
1179 | tD = HEAP[inv_sbox | sD] ^ R1D; | ||
1180 | tE = HEAP[inv_sbox | sE] ^ R1E; | ||
1181 | tF = HEAP[inv_sbox | sF] ^ R1F; | ||
1182 | s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3]; | ||
1183 | s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF]; | ||
1184 | s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB]; | ||
1185 | s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7]; | ||
1186 | s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7]; | ||
1187 | s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3]; | ||
1188 | s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF]; | ||
1189 | s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB]; | ||
1190 | s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB]; | ||
1191 | s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7]; | ||
1192 | sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3]; | ||
1193 | sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF]; | ||
1194 | sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF]; | ||
1195 | sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB]; | ||
1196 | sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7]; | ||
1197 | sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3]; | ||
1198 | S0 = HEAP[inv_sbox | s0] ^ R00; | ||
1199 | S1 = HEAP[inv_sbox | s1] ^ R01; | ||
1200 | S2 = HEAP[inv_sbox | s2] ^ R02; | ||
1201 | S3 = HEAP[inv_sbox | s3] ^ R03; | ||
1202 | S4 = HEAP[inv_sbox | s4] ^ R04; | ||
1203 | S5 = HEAP[inv_sbox | s5] ^ R05; | ||
1204 | S6 = HEAP[inv_sbox | s6] ^ R06; | ||
1205 | S7 = HEAP[inv_sbox | s7] ^ R07; | ||
1206 | S8 = HEAP[inv_sbox | s8] ^ R08; | ||
1207 | S9 = HEAP[inv_sbox | s9] ^ R09; | ||
1208 | SA = HEAP[inv_sbox | sA] ^ R0A; | ||
1209 | SB = HEAP[inv_sbox | sB] ^ R0B; | ||
1210 | SC = HEAP[inv_sbox | sC] ^ R0C; | ||
1211 | SD = HEAP[inv_sbox | sD] ^ R0D; | ||
1212 | SE = HEAP[inv_sbox | sE] ^ R0E; | ||
1213 | SF = HEAP[inv_sbox | sF] ^ R0F; | ||
1214 | } | ||
1215 | function init_state(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) { | ||
1216 | s0 = s0 | 0; | ||
1217 | s1 = s1 | 0; | ||
1218 | s2 = s2 | 0; | ||
1219 | s3 = s3 | 0; | ||
1220 | s4 = s4 | 0; | ||
1221 | s5 = s5 | 0; | ||
1222 | s6 = s6 | 0; | ||
1223 | s7 = s7 | 0; | ||
1224 | s8 = s8 | 0; | ||
1225 | s9 = s9 | 0; | ||
1226 | sA = sA | 0; | ||
1227 | sB = sB | 0; | ||
1228 | sC = sC | 0; | ||
1229 | sD = sD | 0; | ||
1230 | sE = sE | 0; | ||
1231 | sF = sF | 0; | ||
1232 | S0 = s0; | ||
1233 | S1 = s1; | ||
1234 | S2 = s2; | ||
1235 | S3 = s3; | ||
1236 | S4 = s4; | ||
1237 | S5 = s5; | ||
1238 | S6 = s6; | ||
1239 | S7 = s7; | ||
1240 | S8 = s8; | ||
1241 | S9 = s9; | ||
1242 | SA = sA; | ||
1243 | SB = sB; | ||
1244 | SC = sC; | ||
1245 | SD = sD; | ||
1246 | SE = sE; | ||
1247 | SF = sF; | ||
1248 | } | ||
1249 | function save_state(offset) { | ||
1250 | offset = offset | 0; | ||
1251 | HEAP[offset] = S0; | ||
1252 | HEAP[offset | 1] = S1; | ||
1253 | HEAP[offset | 2] = S2; | ||
1254 | HEAP[offset | 3] = S3; | ||
1255 | HEAP[offset | 4] = S4; | ||
1256 | HEAP[offset | 5] = S5; | ||
1257 | HEAP[offset | 6] = S6; | ||
1258 | HEAP[offset | 7] = S7; | ||
1259 | HEAP[offset | 8] = S8; | ||
1260 | HEAP[offset | 9] = S9; | ||
1261 | HEAP[offset | 10] = SA; | ||
1262 | HEAP[offset | 11] = SB; | ||
1263 | HEAP[offset | 12] = SC; | ||
1264 | HEAP[offset | 13] = SD; | ||
1265 | HEAP[offset | 14] = SE; | ||
1266 | HEAP[offset | 15] = SF; | ||
1267 | } | ||
1268 | function init_key_128(k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, kA, kB, kC, kD, kE, kF) { | ||
1269 | k0 = k0 | 0; | ||
1270 | k1 = k1 | 0; | ||
1271 | k2 = k2 | 0; | ||
1272 | k3 = k3 | 0; | ||
1273 | k4 = k4 | 0; | ||
1274 | k5 = k5 | 0; | ||
1275 | k6 = k6 | 0; | ||
1276 | k7 = k7 | 0; | ||
1277 | k8 = k8 | 0; | ||
1278 | k9 = k9 | 0; | ||
1279 | kA = kA | 0; | ||
1280 | kB = kB | 0; | ||
1281 | kC = kC | 0; | ||
1282 | kD = kD | 0; | ||
1283 | kE = kE | 0; | ||
1284 | kF = kF | 0; | ||
1285 | R00 = k0; | ||
1286 | R01 = k1; | ||
1287 | R02 = k2; | ||
1288 | R03 = k3; | ||
1289 | R04 = k4; | ||
1290 | R05 = k5; | ||
1291 | R06 = k6; | ||
1292 | R07 = k7; | ||
1293 | R08 = k8; | ||
1294 | R09 = k9; | ||
1295 | R0A = kA; | ||
1296 | R0B = kB; | ||
1297 | R0C = kC; | ||
1298 | R0D = kD; | ||
1299 | R0E = kE; | ||
1300 | R0F = kF; | ||
1301 | keySize = 16; | ||
1302 | _expand_key_128(); | ||
1303 | } | ||
1304 | function init_key_256(k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F) { | ||
1305 | k00 = k00 | 0; | ||
1306 | k01 = k01 | 0; | ||
1307 | k02 = k02 | 0; | ||
1308 | k03 = k03 | 0; | ||
1309 | k04 = k04 | 0; | ||
1310 | k05 = k05 | 0; | ||
1311 | k06 = k06 | 0; | ||
1312 | k07 = k07 | 0; | ||
1313 | k08 = k08 | 0; | ||
1314 | k09 = k09 | 0; | ||
1315 | k0A = k0A | 0; | ||
1316 | k0B = k0B | 0; | ||
1317 | k0C = k0C | 0; | ||
1318 | k0D = k0D | 0; | ||
1319 | k0E = k0E | 0; | ||
1320 | k0F = k0F | 0; | ||
1321 | k10 = k10 | 0; | ||
1322 | k11 = k11 | 0; | ||
1323 | k12 = k12 | 0; | ||
1324 | k13 = k13 | 0; | ||
1325 | k14 = k14 | 0; | ||
1326 | k15 = k15 | 0; | ||
1327 | k16 = k16 | 0; | ||
1328 | k17 = k17 | 0; | ||
1329 | k18 = k18 | 0; | ||
1330 | k19 = k19 | 0; | ||
1331 | k1A = k1A | 0; | ||
1332 | k1B = k1B | 0; | ||
1333 | k1C = k1C | 0; | ||
1334 | k1D = k1D | 0; | ||
1335 | k1E = k1E | 0; | ||
1336 | k1F = k1F | 0; | ||
1337 | R00 = k00; | ||
1338 | R01 = k01; | ||
1339 | R02 = k02; | ||
1340 | R03 = k03; | ||
1341 | R04 = k04; | ||
1342 | R05 = k05; | ||
1343 | R06 = k06; | ||
1344 | R07 = k07; | ||
1345 | R08 = k08; | ||
1346 | R09 = k09; | ||
1347 | R0A = k0A; | ||
1348 | R0B = k0B; | ||
1349 | R0C = k0C; | ||
1350 | R0D = k0D; | ||
1351 | R0E = k0E; | ||
1352 | R0F = k0F; | ||
1353 | R10 = k10; | ||
1354 | R11 = k11; | ||
1355 | R12 = k12; | ||
1356 | R13 = k13; | ||
1357 | R14 = k14; | ||
1358 | R15 = k15; | ||
1359 | R16 = k16; | ||
1360 | R17 = k17; | ||
1361 | R18 = k18; | ||
1362 | R19 = k19; | ||
1363 | R1A = k1A; | ||
1364 | R1B = k1B; | ||
1365 | R1C = k1C; | ||
1366 | R1D = k1D; | ||
1367 | R1E = k1E; | ||
1368 | R1F = k1F; | ||
1369 | keySize = 32; | ||
1370 | _expand_key_256(); | ||
1371 | } | ||
1372 | function cbc_encrypt(offset, length) { | ||
1373 | offset = offset | 0; | ||
1374 | length = length | 0; | ||
1375 | var encrypted = 0; | ||
1376 | if (offset & 15) return -1; | ||
1377 | while ((length | 0) >= 16) { | ||
1378 | _encrypt(S0 ^ HEAP[offset], S1 ^ HEAP[offset | 1], S2 ^ HEAP[offset | 2], S3 ^ HEAP[offset | 3], S4 ^ HEAP[offset | 4], S5 ^ HEAP[offset | 5], S6 ^ HEAP[offset | 6], S7 ^ HEAP[offset | 7], S8 ^ HEAP[offset | 8], S9 ^ HEAP[offset | 9], SA ^ HEAP[offset | 10], SB ^ HEAP[offset | 11], SC ^ HEAP[offset | 12], SD ^ HEAP[offset | 13], SE ^ HEAP[offset | 14], SF ^ HEAP[offset | 15]); | ||
1379 | HEAP[offset] = S0; | ||
1380 | HEAP[offset | 1] = S1; | ||
1381 | HEAP[offset | 2] = S2; | ||
1382 | HEAP[offset | 3] = S3; | ||
1383 | HEAP[offset | 4] = S4; | ||
1384 | HEAP[offset | 5] = S5; | ||
1385 | HEAP[offset | 6] = S6; | ||
1386 | HEAP[offset | 7] = S7; | ||
1387 | HEAP[offset | 8] = S8; | ||
1388 | HEAP[offset | 9] = S9; | ||
1389 | HEAP[offset | 10] = SA; | ||
1390 | HEAP[offset | 11] = SB; | ||
1391 | HEAP[offset | 12] = SC; | ||
1392 | HEAP[offset | 13] = SD; | ||
1393 | HEAP[offset | 14] = SE; | ||
1394 | HEAP[offset | 15] = SF; | ||
1395 | offset = offset + 16 | 0; | ||
1396 | length = length - 16 | 0; | ||
1397 | encrypted = encrypted + 16 | 0; | ||
1398 | } | ||
1399 | return encrypted | 0; | ||
1400 | } | ||
1401 | function cbc_decrypt(offset, length) { | ||
1402 | offset = offset | 0; | ||
1403 | length = length | 0; | ||
1404 | var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, decrypted = 0; | ||
1405 | if (offset & 15) return -1; | ||
1406 | iv0 = S0; | ||
1407 | iv1 = S1; | ||
1408 | iv2 = S2; | ||
1409 | iv3 = S3; | ||
1410 | iv4 = S4; | ||
1411 | iv5 = S5; | ||
1412 | iv6 = S6; | ||
1413 | iv7 = S7; | ||
1414 | iv8 = S8; | ||
1415 | iv9 = S9; | ||
1416 | ivA = SA; | ||
1417 | ivB = SB; | ||
1418 | ivC = SC; | ||
1419 | ivD = SD; | ||
1420 | ivE = SE; | ||
1421 | ivF = SF; | ||
1422 | while ((length | 0) >= 16) { | ||
1423 | _decrypt(HEAP[offset] | 0, HEAP[offset | 1] | 0, HEAP[offset | 2] | 0, HEAP[offset | 3] | 0, HEAP[offset | 4] | 0, HEAP[offset | 5] | 0, HEAP[offset | 6] | 0, HEAP[offset | 7] | 0, HEAP[offset | 8] | 0, HEAP[offset | 9] | 0, HEAP[offset | 10] | 0, HEAP[offset | 11] | 0, HEAP[offset | 12] | 0, HEAP[offset | 13] | 0, HEAP[offset | 14] | 0, HEAP[offset | 15] | 0); | ||
1424 | S0 = S0 ^ iv0; | ||
1425 | iv0 = HEAP[offset] | 0; | ||
1426 | S1 = S1 ^ iv1; | ||
1427 | iv1 = HEAP[offset | 1] | 0; | ||
1428 | S2 = S2 ^ iv2; | ||
1429 | iv2 = HEAP[offset | 2] | 0; | ||
1430 | S3 = S3 ^ iv3; | ||
1431 | iv3 = HEAP[offset | 3] | 0; | ||
1432 | S4 = S4 ^ iv4; | ||
1433 | iv4 = HEAP[offset | 4] | 0; | ||
1434 | S5 = S5 ^ iv5; | ||
1435 | iv5 = HEAP[offset | 5] | 0; | ||
1436 | S6 = S6 ^ iv6; | ||
1437 | iv6 = HEAP[offset | 6] | 0; | ||
1438 | S7 = S7 ^ iv7; | ||
1439 | iv7 = HEAP[offset | 7] | 0; | ||
1440 | S8 = S8 ^ iv8; | ||
1441 | iv8 = HEAP[offset | 8] | 0; | ||
1442 | S9 = S9 ^ iv9; | ||
1443 | iv9 = HEAP[offset | 9] | 0; | ||
1444 | SA = SA ^ ivA; | ||
1445 | ivA = HEAP[offset | 10] | 0; | ||
1446 | SB = SB ^ ivB; | ||
1447 | ivB = HEAP[offset | 11] | 0; | ||
1448 | SC = SC ^ ivC; | ||
1449 | ivC = HEAP[offset | 12] | 0; | ||
1450 | SD = SD ^ ivD; | ||
1451 | ivD = HEAP[offset | 13] | 0; | ||
1452 | SE = SE ^ ivE; | ||
1453 | ivE = HEAP[offset | 14] | 0; | ||
1454 | SF = SF ^ ivF; | ||
1455 | ivF = HEAP[offset | 15] | 0; | ||
1456 | HEAP[offset] = S0; | ||
1457 | HEAP[offset | 1] = S1; | ||
1458 | HEAP[offset | 2] = S2; | ||
1459 | HEAP[offset | 3] = S3; | ||
1460 | HEAP[offset | 4] = S4; | ||
1461 | HEAP[offset | 5] = S5; | ||
1462 | HEAP[offset | 6] = S6; | ||
1463 | HEAP[offset | 7] = S7; | ||
1464 | HEAP[offset | 8] = S8; | ||
1465 | HEAP[offset | 9] = S9; | ||
1466 | HEAP[offset | 10] = SA; | ||
1467 | HEAP[offset | 11] = SB; | ||
1468 | HEAP[offset | 12] = SC; | ||
1469 | HEAP[offset | 13] = SD; | ||
1470 | HEAP[offset | 14] = SE; | ||
1471 | HEAP[offset | 15] = SF; | ||
1472 | offset = offset + 16 | 0; | ||
1473 | length = length - 16 | 0; | ||
1474 | decrypted = decrypted + 16 | 0; | ||
1475 | } | ||
1476 | S0 = iv0; | ||
1477 | S1 = iv1; | ||
1478 | S2 = iv2; | ||
1479 | S3 = iv3; | ||
1480 | S4 = iv4; | ||
1481 | S5 = iv5; | ||
1482 | S6 = iv6; | ||
1483 | S7 = iv7; | ||
1484 | S8 = iv8; | ||
1485 | S9 = iv9; | ||
1486 | SA = ivA; | ||
1487 | SB = ivB; | ||
1488 | SC = ivC; | ||
1489 | SD = ivD; | ||
1490 | SE = ivE; | ||
1491 | SF = ivF; | ||
1492 | return decrypted | 0; | ||
1493 | } | ||
1494 | function cbc_mac(offset, length, output) { | ||
1495 | offset = offset | 0; | ||
1496 | length = length | 0; | ||
1497 | output = output | 0; | ||
1498 | if (offset & 15) return -1; | ||
1499 | if (~output) if (output & 31) return -1; | ||
1500 | while ((length | 0) >= 16) { | ||
1501 | _encrypt(S0 ^ HEAP[offset], S1 ^ HEAP[offset | 1], S2 ^ HEAP[offset | 2], S3 ^ HEAP[offset | 3], S4 ^ HEAP[offset | 4], S5 ^ HEAP[offset | 5], S6 ^ HEAP[offset | 6], S7 ^ HEAP[offset | 7], S8 ^ HEAP[offset | 8], S9 ^ HEAP[offset | 9], SA ^ HEAP[offset | 10], SB ^ HEAP[offset | 11], SC ^ HEAP[offset | 12], SD ^ HEAP[offset | 13], SE ^ HEAP[offset | 14], SF ^ HEAP[offset | 15]); | ||
1502 | offset = offset + 16 | 0; | ||
1503 | length = length - 16 | 0; | ||
1504 | } | ||
1505 | if ((length | 0) > 0) { | ||
1506 | S0 = S0 ^ HEAP[offset]; | ||
1507 | if ((length | 0) > 1) S1 = S1 ^ HEAP[offset | 1]; | ||
1508 | if ((length | 0) > 2) S2 = S2 ^ HEAP[offset | 2]; | ||
1509 | if ((length | 0) > 3) S3 = S3 ^ HEAP[offset | 3]; | ||
1510 | if ((length | 0) > 4) S4 = S4 ^ HEAP[offset | 4]; | ||
1511 | if ((length | 0) > 5) S5 = S5 ^ HEAP[offset | 5]; | ||
1512 | if ((length | 0) > 6) S6 = S6 ^ HEAP[offset | 6]; | ||
1513 | if ((length | 0) > 7) S7 = S7 ^ HEAP[offset | 7]; | ||
1514 | if ((length | 0) > 8) S8 = S8 ^ HEAP[offset | 8]; | ||
1515 | if ((length | 0) > 9) S9 = S9 ^ HEAP[offset | 9]; | ||
1516 | if ((length | 0) > 10) SA = SA ^ HEAP[offset | 10]; | ||
1517 | if ((length | 0) > 11) SB = SB ^ HEAP[offset | 11]; | ||
1518 | if ((length | 0) > 12) SC = SC ^ HEAP[offset | 12]; | ||
1519 | if ((length | 0) > 13) SD = SD ^ HEAP[offset | 13]; | ||
1520 | if ((length | 0) > 14) SE = SE ^ HEAP[offset | 14]; | ||
1521 | _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); | ||
1522 | offset = offset + length | 0; | ||
1523 | length = 0; | ||
1524 | } | ||
1525 | if (~output) { | ||
1526 | HEAP[output | 0] = S0; | ||
1527 | HEAP[output | 1] = S1; | ||
1528 | HEAP[output | 2] = S2; | ||
1529 | HEAP[output | 3] = S3; | ||
1530 | HEAP[output | 4] = S4; | ||
1531 | HEAP[output | 5] = S5; | ||
1532 | HEAP[output | 6] = S6; | ||
1533 | HEAP[output | 7] = S7; | ||
1534 | HEAP[output | 8] = S8; | ||
1535 | HEAP[output | 9] = S9; | ||
1536 | HEAP[output | 10] = SA; | ||
1537 | HEAP[output | 11] = SB; | ||
1538 | HEAP[output | 12] = SC; | ||
1539 | HEAP[output | 13] = SD; | ||
1540 | HEAP[output | 14] = SE; | ||
1541 | HEAP[output | 15] = SF; | ||
1542 | } | ||
1543 | return 0; | ||
1544 | } | ||
1545 | function ccm_encrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) { | ||
1546 | offset = offset | 0; | ||
1547 | length = length | 0; | ||
1548 | nonce0 = nonce0 | 0; | ||
1549 | nonce1 = nonce1 | 0; | ||
1550 | nonce2 = nonce2 | 0; | ||
1551 | nonce3 = nonce3 | 0; | ||
1552 | nonce4 = nonce4 | 0; | ||
1553 | nonce5 = nonce5 | 0; | ||
1554 | nonce6 = nonce6 | 0; | ||
1555 | nonce7 = nonce7 | 0; | ||
1556 | nonce8 = nonce8 | 0; | ||
1557 | nonce9 = nonce9 | 0; | ||
1558 | nonceA = nonceA | 0; | ||
1559 | nonceB = nonceB | 0; | ||
1560 | nonceC = nonceC | 0; | ||
1561 | nonceD = nonceD | 0; | ||
1562 | counter0 = counter0 | 0; | ||
1563 | counter1 = counter1 | 0; | ||
1564 | var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sA = 0, sB = 0, sC = 0, sD = 0, sE = 0, sF = 0, encrypted = 0; | ||
1565 | if (offset & 15) return -1; | ||
1566 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1567 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1568 | while ((length | 0) >= 16) { | ||
1569 | s0 = HEAP[offset] | 0; | ||
1570 | s1 = HEAP[offset | 1] | 0; | ||
1571 | s2 = HEAP[offset | 2] | 0; | ||
1572 | s3 = HEAP[offset | 3] | 0; | ||
1573 | s4 = HEAP[offset | 4] | 0; | ||
1574 | s5 = HEAP[offset | 5] | 0; | ||
1575 | s6 = HEAP[offset | 6] | 0; | ||
1576 | s7 = HEAP[offset | 7] | 0; | ||
1577 | s8 = HEAP[offset | 8] | 0; | ||
1578 | s9 = HEAP[offset | 9] | 0; | ||
1579 | sA = HEAP[offset | 10] | 0; | ||
1580 | sB = HEAP[offset | 11] | 0; | ||
1581 | sC = HEAP[offset | 12] | 0; | ||
1582 | sD = HEAP[offset | 13] | 0; | ||
1583 | sE = HEAP[offset | 14] | 0; | ||
1584 | sF = HEAP[offset | 15] | 0; | ||
1585 | _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255); | ||
1586 | HEAP[offset] = s0 ^ S0; | ||
1587 | HEAP[offset | 1] = s1 ^ S1; | ||
1588 | HEAP[offset | 2] = s2 ^ S2; | ||
1589 | HEAP[offset | 3] = s3 ^ S3; | ||
1590 | HEAP[offset | 4] = s4 ^ S4; | ||
1591 | HEAP[offset | 5] = s5 ^ S5; | ||
1592 | HEAP[offset | 6] = s6 ^ S6; | ||
1593 | HEAP[offset | 7] = s7 ^ S7; | ||
1594 | HEAP[offset | 8] = s8 ^ S8; | ||
1595 | HEAP[offset | 9] = s9 ^ S9; | ||
1596 | HEAP[offset | 10] = sA ^ SA; | ||
1597 | HEAP[offset | 11] = sB ^ SB; | ||
1598 | HEAP[offset | 12] = sC ^ SC; | ||
1599 | HEAP[offset | 13] = sD ^ SD; | ||
1600 | HEAP[offset | 14] = sE ^ SE; | ||
1601 | HEAP[offset | 15] = sF ^ SF; | ||
1602 | _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF); | ||
1603 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1604 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1605 | encrypted = encrypted + 16 | 0; | ||
1606 | offset = offset + 16 | 0; | ||
1607 | length = length - 16 | 0; | ||
1608 | counter1 = counter1 + 1 | 0; | ||
1609 | if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0; | ||
1610 | } | ||
1611 | if ((length | 0) > 0) { | ||
1612 | s0 = HEAP[offset] | 0; | ||
1613 | s1 = (length | 0) > 1 ? HEAP[offset | 1] | 0 : 0; | ||
1614 | s2 = (length | 0) > 2 ? HEAP[offset | 2] | 0 : 0; | ||
1615 | s3 = (length | 0) > 3 ? HEAP[offset | 3] | 0 : 0; | ||
1616 | s4 = (length | 0) > 4 ? HEAP[offset | 4] | 0 : 0; | ||
1617 | s5 = (length | 0) > 5 ? HEAP[offset | 5] | 0 : 0; | ||
1618 | s6 = (length | 0) > 6 ? HEAP[offset | 6] | 0 : 0; | ||
1619 | s7 = (length | 0) > 7 ? HEAP[offset | 7] | 0 : 0; | ||
1620 | s8 = (length | 0) > 8 ? HEAP[offset | 8] | 0 : 0; | ||
1621 | s9 = (length | 0) > 9 ? HEAP[offset | 9] | 0 : 0; | ||
1622 | sA = (length | 0) > 10 ? HEAP[offset | 10] | 0 : 0; | ||
1623 | sB = (length | 0) > 11 ? HEAP[offset | 11] | 0 : 0; | ||
1624 | sC = (length | 0) > 12 ? HEAP[offset | 12] | 0 : 0; | ||
1625 | sD = (length | 0) > 13 ? HEAP[offset | 13] | 0 : 0; | ||
1626 | sE = (length | 0) > 14 ? HEAP[offset | 14] | 0 : 0; | ||
1627 | _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255); | ||
1628 | HEAP[offset] = s0 ^ S0; | ||
1629 | if ((length | 0) > 1) HEAP[offset | 1] = s1 ^ S1; | ||
1630 | if ((length | 0) > 2) HEAP[offset | 2] = s2 ^ S2; | ||
1631 | if ((length | 0) > 3) HEAP[offset | 3] = s3 ^ S3; | ||
1632 | if ((length | 0) > 4) HEAP[offset | 4] = s4 ^ S4; | ||
1633 | if ((length | 0) > 5) HEAP[offset | 5] = s5 ^ S5; | ||
1634 | if ((length | 0) > 6) HEAP[offset | 6] = s6 ^ S6; | ||
1635 | if ((length | 0) > 7) HEAP[offset | 7] = s7 ^ S7; | ||
1636 | if ((length | 0) > 8) HEAP[offset | 8] = s8 ^ S8; | ||
1637 | if ((length | 0) > 9) HEAP[offset | 9] = s9 ^ S9; | ||
1638 | if ((length | 0) > 10) HEAP[offset | 10] = sA ^ SA; | ||
1639 | if ((length | 0) > 11) HEAP[offset | 11] = sB ^ SB; | ||
1640 | if ((length | 0) > 12) HEAP[offset | 12] = sC ^ SC; | ||
1641 | if ((length | 0) > 13) HEAP[offset | 13] = sD ^ SD; | ||
1642 | if ((length | 0) > 14) HEAP[offset | 14] = sE ^ SE; | ||
1643 | _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, ivF); | ||
1644 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1645 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1646 | encrypted = encrypted + length | 0; | ||
1647 | offset = offset + length | 0; | ||
1648 | length = 0; | ||
1649 | counter1 = counter1 + 1 | 0; | ||
1650 | if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0; | ||
1651 | } | ||
1652 | return encrypted | 0; | ||
1653 | } | ||
1654 | function ccm_decrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) { | ||
1655 | offset = offset | 0; | ||
1656 | length = length | 0; | ||
1657 | nonce0 = nonce0 | 0; | ||
1658 | nonce1 = nonce1 | 0; | ||
1659 | nonce2 = nonce2 | 0; | ||
1660 | nonce3 = nonce3 | 0; | ||
1661 | nonce4 = nonce4 | 0; | ||
1662 | nonce5 = nonce5 | 0; | ||
1663 | nonce6 = nonce6 | 0; | ||
1664 | nonce7 = nonce7 | 0; | ||
1665 | nonce8 = nonce8 | 0; | ||
1666 | nonce9 = nonce9 | 0; | ||
1667 | nonceA = nonceA | 0; | ||
1668 | nonceB = nonceB | 0; | ||
1669 | nonceC = nonceC | 0; | ||
1670 | nonceD = nonceD | 0; | ||
1671 | counter0 = counter0 | 0; | ||
1672 | counter1 = counter1 | 0; | ||
1673 | var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sA = 0, sB = 0, sC = 0, sD = 0, sE = 0, sF = 0, decrypted = 0; | ||
1674 | if (offset & 15) return -1; | ||
1675 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1676 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1677 | while ((length | 0) >= 16) { | ||
1678 | _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255); | ||
1679 | HEAP[offset] = s0 = HEAP[offset] ^ S0; | ||
1680 | HEAP[offset | 1] = s1 = HEAP[offset | 1] ^ S1; | ||
1681 | HEAP[offset | 2] = s2 = HEAP[offset | 2] ^ S2; | ||
1682 | HEAP[offset | 3] = s3 = HEAP[offset | 3] ^ S3; | ||
1683 | HEAP[offset | 4] = s4 = HEAP[offset | 4] ^ S4; | ||
1684 | HEAP[offset | 5] = s5 = HEAP[offset | 5] ^ S5; | ||
1685 | HEAP[offset | 6] = s6 = HEAP[offset | 6] ^ S6; | ||
1686 | HEAP[offset | 7] = s7 = HEAP[offset | 7] ^ S7; | ||
1687 | HEAP[offset | 8] = s8 = HEAP[offset | 8] ^ S8; | ||
1688 | HEAP[offset | 9] = s9 = HEAP[offset | 9] ^ S9; | ||
1689 | HEAP[offset | 10] = sA = HEAP[offset | 10] ^ SA; | ||
1690 | HEAP[offset | 11] = sB = HEAP[offset | 11] ^ SB; | ||
1691 | HEAP[offset | 12] = sC = HEAP[offset | 12] ^ SC; | ||
1692 | HEAP[offset | 13] = sD = HEAP[offset | 13] ^ SD; | ||
1693 | HEAP[offset | 14] = sE = HEAP[offset | 14] ^ SE; | ||
1694 | HEAP[offset | 15] = sF = HEAP[offset | 15] ^ SF; | ||
1695 | _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF); | ||
1696 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1697 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1698 | decrypted = decrypted + 16 | 0; | ||
1699 | offset = offset + 16 | 0; | ||
1700 | length = length - 16 | 0; | ||
1701 | counter1 = counter1 + 1 | 0; | ||
1702 | if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0; | ||
1703 | } | ||
1704 | if ((length | 0) > 0) { | ||
1705 | _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255); | ||
1706 | s0 = HEAP[offset] ^ S0; | ||
1707 | s1 = (length | 0) > 1 ? HEAP[offset | 1] ^ S1 : 0; | ||
1708 | s2 = (length | 0) > 2 ? HEAP[offset | 2] ^ S2 : 0; | ||
1709 | s3 = (length | 0) > 3 ? HEAP[offset | 3] ^ S3 : 0; | ||
1710 | s4 = (length | 0) > 4 ? HEAP[offset | 4] ^ S4 : 0; | ||
1711 | s5 = (length | 0) > 5 ? HEAP[offset | 5] ^ S5 : 0; | ||
1712 | s6 = (length | 0) > 6 ? HEAP[offset | 6] ^ S6 : 0; | ||
1713 | s7 = (length | 0) > 7 ? HEAP[offset | 7] ^ S7 : 0; | ||
1714 | s8 = (length | 0) > 8 ? HEAP[offset | 8] ^ S8 : 0; | ||
1715 | s9 = (length | 0) > 9 ? HEAP[offset | 9] ^ S9 : 0; | ||
1716 | sA = (length | 0) > 10 ? HEAP[offset | 10] ^ SA : 0; | ||
1717 | sB = (length | 0) > 11 ? HEAP[offset | 11] ^ SB : 0; | ||
1718 | sC = (length | 0) > 12 ? HEAP[offset | 12] ^ SC : 0; | ||
1719 | sD = (length | 0) > 13 ? HEAP[offset | 13] ^ SD : 0; | ||
1720 | sE = (length | 0) > 14 ? HEAP[offset | 14] ^ SE : 0; | ||
1721 | sF = (length | 0) > 15 ? HEAP[offset | 15] ^ SF : 0; | ||
1722 | HEAP[offset] = s0; | ||
1723 | if ((length | 0) > 1) HEAP[offset | 1] = s1; | ||
1724 | if ((length | 0) > 2) HEAP[offset | 2] = s2; | ||
1725 | if ((length | 0) > 3) HEAP[offset | 3] = s3; | ||
1726 | if ((length | 0) > 4) HEAP[offset | 4] = s4; | ||
1727 | if ((length | 0) > 5) HEAP[offset | 5] = s5; | ||
1728 | if ((length | 0) > 6) HEAP[offset | 6] = s6; | ||
1729 | if ((length | 0) > 7) HEAP[offset | 7] = s7; | ||
1730 | if ((length | 0) > 8) HEAP[offset | 8] = s8; | ||
1731 | if ((length | 0) > 9) HEAP[offset | 9] = s9; | ||
1732 | if ((length | 0) > 10) HEAP[offset | 10] = sA; | ||
1733 | if ((length | 0) > 11) HEAP[offset | 11] = sB; | ||
1734 | if ((length | 0) > 12) HEAP[offset | 12] = sC; | ||
1735 | if ((length | 0) > 13) HEAP[offset | 13] = sD; | ||
1736 | if ((length | 0) > 14) HEAP[offset | 14] = sE; | ||
1737 | _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF); | ||
1738 | iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7, | ||
1739 | iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF; | ||
1740 | decrypted = decrypted + length | 0; | ||
1741 | offset = offset + length | 0; | ||
1742 | length = 0; | ||
1743 | counter1 = counter1 + 1 | 0; | ||
1744 | if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0; | ||
1745 | } | ||
1746 | return decrypted | 0; | ||
1747 | } | ||
1748 | function cfb_encrypt(offset, length) { | ||
1749 | offset = offset | 0; | ||
1750 | length = length | 0; | ||
1751 | var encrypted = 0; | ||
1752 | if (offset & 15) return -1; | ||
1753 | while ((length | 0) >= 16) { | ||
1754 | _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); | ||
1755 | S0 = S0 ^ HEAP[offset]; | ||
1756 | S1 = S1 ^ HEAP[offset | 1]; | ||
1757 | S2 = S2 ^ HEAP[offset | 2]; | ||
1758 | S3 = S3 ^ HEAP[offset | 3]; | ||
1759 | S4 = S4 ^ HEAP[offset | 4]; | ||
1760 | S5 = S5 ^ HEAP[offset | 5]; | ||
1761 | S6 = S6 ^ HEAP[offset | 6]; | ||
1762 | S7 = S7 ^ HEAP[offset | 7]; | ||
1763 | S8 = S8 ^ HEAP[offset | 8]; | ||
1764 | S9 = S9 ^ HEAP[offset | 9]; | ||
1765 | SA = SA ^ HEAP[offset | 10]; | ||
1766 | SB = SB ^ HEAP[offset | 11]; | ||
1767 | SC = SC ^ HEAP[offset | 12]; | ||
1768 | SD = SD ^ HEAP[offset | 13]; | ||
1769 | SE = SE ^ HEAP[offset | 14]; | ||
1770 | SF = SF ^ HEAP[offset | 15]; | ||
1771 | HEAP[offset] = S0; | ||
1772 | HEAP[offset | 1] = S1; | ||
1773 | HEAP[offset | 2] = S2; | ||
1774 | HEAP[offset | 3] = S3; | ||
1775 | HEAP[offset | 4] = S4; | ||
1776 | HEAP[offset | 5] = S5; | ||
1777 | HEAP[offset | 6] = S6; | ||
1778 | HEAP[offset | 7] = S7; | ||
1779 | HEAP[offset | 8] = S8; | ||
1780 | HEAP[offset | 9] = S9; | ||
1781 | HEAP[offset | 10] = SA; | ||
1782 | HEAP[offset | 11] = SB; | ||
1783 | HEAP[offset | 12] = SC; | ||
1784 | HEAP[offset | 13] = SD; | ||
1785 | HEAP[offset | 14] = SE; | ||
1786 | HEAP[offset | 15] = SF; | ||
1787 | offset = offset + 16 | 0; | ||
1788 | length = length - 16 | 0; | ||
1789 | encrypted = encrypted + 16 | 0; | ||
1790 | } | ||
1791 | if ((length | 0) > 0) { | ||
1792 | _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); | ||
1793 | HEAP[offset] = HEAP[offset] ^ S0; | ||
1794 | if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1; | ||
1795 | if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2; | ||
1796 | if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3; | ||
1797 | if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4; | ||
1798 | if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5; | ||
1799 | if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6; | ||
1800 | if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7; | ||
1801 | if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8; | ||
1802 | if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9; | ||
1803 | if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA; | ||
1804 | if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB; | ||
1805 | if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC; | ||
1806 | if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD; | ||
1807 | if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE; | ||
1808 | encrypted = encrypted + length | 0; | ||
1809 | offset = offset + length | 0; | ||
1810 | length = 0; | ||
1811 | } | ||
1812 | return encrypted | 0; | ||
1813 | } | ||
1814 | function cfb_decrypt(offset, length) { | ||
1815 | offset = offset | 0; | ||
1816 | length = length | 0; | ||
1817 | var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, decrypted = 0; | ||
1818 | if (offset & 15) return -1; | ||
1819 | while ((length | 0) >= 16) { | ||
1820 | _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); | ||
1821 | iv0 = HEAP[offset] | 0; | ||
1822 | iv1 = HEAP[offset | 1] | 0; | ||
1823 | iv2 = HEAP[offset | 2] | 0; | ||
1824 | iv3 = HEAP[offset | 3] | 0; | ||
1825 | iv4 = HEAP[offset | 4] | 0; | ||
1826 | iv5 = HEAP[offset | 5] | 0; | ||
1827 | iv6 = HEAP[offset | 6] | 0; | ||
1828 | iv7 = HEAP[offset | 7] | 0; | ||
1829 | iv8 = HEAP[offset | 8] | 0; | ||
1830 | iv9 = HEAP[offset | 9] | 0; | ||
1831 | ivA = HEAP[offset | 10] | 0; | ||
1832 | ivB = HEAP[offset | 11] | 0; | ||
1833 | ivC = HEAP[offset | 12] | 0; | ||
1834 | ivD = HEAP[offset | 13] | 0; | ||
1835 | ivE = HEAP[offset | 14] | 0; | ||
1836 | ivF = HEAP[offset | 15] | 0; | ||
1837 | HEAP[offset] = S0 ^ iv0; | ||
1838 | HEAP[offset | 1] = S1 ^ iv1; | ||
1839 | HEAP[offset | 2] = S2 ^ iv2; | ||
1840 | HEAP[offset | 3] = S3 ^ iv3; | ||
1841 | HEAP[offset | 4] = S4 ^ iv4; | ||
1842 | HEAP[offset | 5] = S5 ^ iv5; | ||
1843 | HEAP[offset | 6] = S6 ^ iv6; | ||
1844 | HEAP[offset | 7] = S7 ^ iv7; | ||
1845 | HEAP[offset | 8] = S8 ^ iv8; | ||
1846 | HEAP[offset | 9] = S9 ^ iv9; | ||
1847 | HEAP[offset | 10] = SA ^ ivA; | ||
1848 | HEAP[offset | 11] = SB ^ ivB; | ||
1849 | HEAP[offset | 12] = SC ^ ivC; | ||
1850 | HEAP[offset | 13] = SD ^ ivD; | ||
1851 | HEAP[offset | 14] = SE ^ ivE; | ||
1852 | HEAP[offset | 15] = SF ^ ivF; | ||
1853 | S0 = iv0; | ||
1854 | S1 = iv1; | ||
1855 | S2 = iv2; | ||
1856 | S3 = iv3; | ||
1857 | S4 = iv4; | ||
1858 | S5 = iv5; | ||
1859 | S6 = iv6; | ||
1860 | S7 = iv7; | ||
1861 | S8 = iv8; | ||
1862 | S9 = iv9; | ||
1863 | SA = ivA; | ||
1864 | SB = ivB; | ||
1865 | SC = ivC; | ||
1866 | SD = ivD; | ||
1867 | SE = ivE; | ||
1868 | SF = ivF; | ||
1869 | offset = offset + 16 | 0; | ||
1870 | length = length - 16 | 0; | ||
1871 | decrypted = decrypted + 16 | 0; | ||
1872 | } | ||
1873 | if ((length | 0) > 0) { | ||
1874 | _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF); | ||
1875 | HEAP[offset] = HEAP[offset] ^ S0; | ||
1876 | if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1; | ||
1877 | if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2; | ||
1878 | if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3; | ||
1879 | if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4; | ||
1880 | if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5; | ||
1881 | if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6; | ||
1882 | if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7; | ||
1883 | if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8; | ||
1884 | if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9; | ||
1885 | if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA; | ||
1886 | if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB; | ||
1887 | if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC; | ||
1888 | if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD; | ||
1889 | if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE; | ||
1890 | decrypted = decrypted + length | 0; | ||
1891 | offset = offset + length | 0; | ||
1892 | length = 0; | ||
1893 | } | ||
1894 | return decrypted | 0; | ||
1895 | } | ||
1896 | return { | ||
1897 | init_state: init_state, | ||
1898 | save_state: save_state, | ||
1899 | init_key_128: init_key_128, | ||
1900 | init_key_256: init_key_256, | ||
1901 | cbc_encrypt: cbc_encrypt, | ||
1902 | cbc_decrypt: cbc_decrypt, | ||
1903 | cbc_mac: cbc_mac, | ||
1904 | ccm_encrypt: ccm_encrypt, | ||
1905 | ccm_decrypt: ccm_decrypt, | ||
1906 | cfb_encrypt: cfb_encrypt, | ||
1907 | cfb_decrypt: cfb_decrypt | ||
1908 | }; | ||
1909 | } | ||
1910 | function aes_asm(stdlib, foreign, buffer) { | ||
1911 | var heap = new Uint8Array(buffer); | ||
1912 | heap.set(_aes_tables); | ||
1913 | return _aes_asm(stdlib, foreign, buffer); | ||
1914 | } | ||
1915 | var _aes_block_size = 16; | ||
1916 | function _aes_constructor(options) { | ||
1917 | options = options || {}; | ||
1918 | options.heapSize = options.heapSize || 4096; | ||
1919 | if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096"); | ||
1920 | this.BLOCK_SIZE = _aes_block_size; | ||
1921 | this.heap = options.heap || new Uint8Array(options.heapSize); | ||
1922 | this.asm = options.asm || aes_asm(global, null, this.heap.buffer); | ||
1923 | this.pos = _aes_heap_start; | ||
1924 | this.len = 0; | ||
1925 | this.key = null; | ||
1926 | this.result = null; | ||
1927 | this.reset(options); | ||
1928 | } | ||
1929 | function _aes_reset(options) { | ||
1930 | options = options || {}; | ||
1931 | this.result = null; | ||
1932 | this.pos = _aes_heap_start; | ||
1933 | this.len = 0; | ||
1934 | var asm = this.asm; | ||
1935 | var key = options.key; | ||
1936 | if (key !== undefined) { | ||
1937 | if (is_buffer(key) || is_bytes(key)) { | ||
1938 | key = new Uint8Array(key); | ||
1939 | } else if (is_string(key)) { | ||
1940 | var str = key; | ||
1941 | key = new Uint8Array(str.length); | ||
1942 | for (var i = 0; i < str.length; ++i) key[i] = str.charCodeAt(i); | ||
1943 | } else { | ||
1944 | throw new TypeError("unexpected key type"); | ||
1945 | } | ||
1946 | if (key.length === 16) { | ||
1947 | this.key = key; | ||
1948 | asm.init_key_128.call(asm, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8], key[9], key[10], key[11], key[12], key[13], key[14], key[15]); | ||
1949 | } else if (key.length === 24) { | ||
1950 | throw new IllegalArgumentError("illegal key size"); | ||
1951 | } else if (key.length === 32) { | ||
1952 | this.key = key; | ||
1953 | asm.init_key_256.call(asm, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8], key[9], key[10], key[11], key[12], key[13], key[14], key[15], key[16], key[17], key[18], key[19], key[20], key[21], key[22], key[23], key[24], key[25], key[26], key[27], key[28], key[29], key[30], key[31]); | ||
1954 | } else { | ||
1955 | throw new IllegalArgumentError("illegal key size"); | ||
1956 | } | ||
1957 | } | ||
1958 | return this; | ||
1959 | } | ||
1960 | function _aes_init_iv(iv) { | ||
1961 | var asm = this.asm; | ||
1962 | if (iv !== undefined) { | ||
1963 | if (is_buffer(iv) || is_bytes(iv)) { | ||
1964 | iv = new Uint8Array(iv); | ||
1965 | } else if (is_string(iv)) { | ||
1966 | var str = iv; | ||
1967 | iv = new Uint8Array(str.length); | ||
1968 | for (var i = 0; i < str.length; ++i) iv[i] = str.charCodeAt(i); | ||
1969 | } else { | ||
1970 | throw new TypeError("unexpected iv type"); | ||
1971 | } | ||
1972 | if (iv.length !== _aes_block_size) throw new IllegalArgumentError("illegal iv size"); | ||
1973 | this.iv = iv; | ||
1974 | asm.init_state.call(asm, iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7], iv[8], iv[9], iv[10], iv[11], iv[12], iv[13], iv[14], iv[15]); | ||
1975 | } else { | ||
1976 | this.iv = null; | ||
1977 | asm.init_state.call(asm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); | ||
1978 | } | ||
1979 | } | ||
1980 | function _aes_heap_write(heap, hpos, data, dpos, dlen) { | ||
1981 | var hlen = heap.byteLength - hpos, wlen = hlen < dlen ? hlen : dlen; | ||
1982 | if (is_buffer(data) || is_bytes(data)) { | ||
1983 | heap.set(new Uint8Array(data.buffer || data, dpos, wlen), hpos); | ||
1984 | } else if (is_string(data)) { | ||
1985 | for (var i = 0; i < wlen; ++i) heap[hpos + i] = data.charCodeAt(dpos + i); | ||
1986 | } else { | ||
1987 | throw new TypeError("unexpected data type"); | ||
1988 | } | ||
1989 | return wlen; | ||
1990 | } | ||
1991 | function cbc_aes_constructor(options) { | ||
1992 | this.padding = true; | ||
1993 | this.mode = "cbc"; | ||
1994 | this.iv = null; | ||
1995 | _aes_constructor.call(this, options); | ||
1996 | } | ||
1997 | function cbc_aes_encrypt_constructor(options) { | ||
1998 | cbc_aes_constructor.call(this, options); | ||
1999 | } | ||
2000 | function cbc_aes_decrypt_constructor(options) { | ||
2001 | cbc_aes_constructor.call(this, options); | ||
2002 | } | ||
2003 | function cbc_aes_reset(options) { | ||
2004 | options = options || {}; | ||
2005 | _aes_reset.call(this, options); | ||
2006 | var padding = options.padding; | ||
2007 | if (padding !== undefined) { | ||
2008 | this.padding = !!padding; | ||
2009 | } else { | ||
2010 | this.padding = true; | ||
2011 | } | ||
2012 | _aes_init_iv.call(this, options.iv); | ||
2013 | return this; | ||
2014 | } | ||
2015 | function cbc_aes_encrypt_process(data) { | ||
2016 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2017 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2018 | var result = new Uint8Array(rlen); | ||
2019 | while (dlen > 0) { | ||
2020 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2021 | len += wlen; | ||
2022 | dpos += wlen; | ||
2023 | dlen -= wlen; | ||
2024 | wlen = asm.cbc_encrypt(pos, len); | ||
2025 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2026 | rpos += wlen; | ||
2027 | if (wlen < len) { | ||
2028 | pos += wlen; | ||
2029 | len -= wlen; | ||
2030 | } else { | ||
2031 | pos = _aes_heap_start; | ||
2032 | len = 0; | ||
2033 | } | ||
2034 | } | ||
2035 | this.result = result; | ||
2036 | this.pos = pos; | ||
2037 | this.len = len; | ||
2038 | return this; | ||
2039 | } | ||
2040 | function cbc_aes_encrypt_finish() { | ||
2041 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2042 | var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len, rlen = _aes_block_size * Math.ceil(len / _aes_block_size); | ||
2043 | if (len % _aes_block_size === 0) { | ||
2044 | if (padding) rlen += _aes_block_size; | ||
2045 | } else if (!padding) { | ||
2046 | throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size); | ||
2047 | } | ||
2048 | var result = new Uint8Array(rlen); | ||
2049 | if (len < rlen) { | ||
2050 | var plen = _aes_block_size - len % _aes_block_size; | ||
2051 | for (var p = 0; p < plen; ++p) heap[pos + len + p] = plen; | ||
2052 | len += plen; | ||
2053 | } | ||
2054 | asm.cbc_encrypt(pos, len); | ||
2055 | result.set(heap.subarray(pos, pos + len)); | ||
2056 | this.result = result; | ||
2057 | this.pos = _aes_heap_start; | ||
2058 | this.len = 0; | ||
2059 | return this; | ||
2060 | } | ||
2061 | function cbc_aes_encrypt(data) { | ||
2062 | var result1 = cbc_aes_encrypt_process.call(this, data).result, result2 = cbc_aes_encrypt_finish.call(this).result, result; | ||
2063 | result = new Uint8Array(result1.length + result2.length); | ||
2064 | result.set(result1); | ||
2065 | result.set(result2, result1.length); | ||
2066 | this.result = result; | ||
2067 | return this; | ||
2068 | } | ||
2069 | function cbc_aes_decrypt_process(data) { | ||
2070 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2071 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2072 | var result = new Uint8Array(rlen); | ||
2073 | while (dlen > 0) { | ||
2074 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2075 | len += wlen; | ||
2076 | dpos += wlen; | ||
2077 | dlen -= wlen; | ||
2078 | wlen = asm.cbc_decrypt(pos, len - (padding && dlen === 0 && len % _aes_block_size === 0 ? _aes_block_size : 0)); | ||
2079 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2080 | rpos += wlen; | ||
2081 | if (wlen < len) { | ||
2082 | pos += wlen; | ||
2083 | len -= wlen; | ||
2084 | } else { | ||
2085 | pos = _aes_heap_start; | ||
2086 | len = 0; | ||
2087 | } | ||
2088 | } | ||
2089 | this.result = result.subarray(0, rpos); | ||
2090 | this.pos = pos; | ||
2091 | this.len = len; | ||
2092 | return this; | ||
2093 | } | ||
2094 | function cbc_aes_decrypt_finish() { | ||
2095 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2096 | var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len; | ||
2097 | if (len === 0) { | ||
2098 | if (!padding) { | ||
2099 | this.result = new Uint8Array(0); | ||
2100 | this.pos = _aes_heap_start; | ||
2101 | this.len = 0; | ||
2102 | return this; | ||
2103 | } else { | ||
2104 | throw new IllegalStateError("padding not found"); | ||
2105 | } | ||
2106 | } | ||
2107 | if (len % _aes_block_size !== 0) throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size); | ||
2108 | var result = new Uint8Array(len); | ||
2109 | asm.cbc_decrypt(pos, len); | ||
2110 | result.set(heap.subarray(pos, pos + len)); | ||
2111 | if (padding) { | ||
2112 | var pad = result[len - 1]; | ||
2113 | result = result.subarray(0, len - pad); | ||
2114 | } | ||
2115 | this.result = result; | ||
2116 | this.pos = _aes_heap_start; | ||
2117 | this.len = 0; | ||
2118 | return this; | ||
2119 | } | ||
2120 | function cbc_aes_decrypt(data) { | ||
2121 | var result1 = cbc_aes_decrypt_process.call(this, data).result, result2 = cbc_aes_decrypt_finish.call(this).result, result; | ||
2122 | result = new Uint8Array(result1.length + result2.length); | ||
2123 | result.set(result1); | ||
2124 | result.set(result2, result1.length); | ||
2125 | this.result = result; | ||
2126 | return this; | ||
2127 | } | ||
2128 | var cbc_aes_encrypt_prototype = cbc_aes_encrypt_constructor.prototype; | ||
2129 | cbc_aes_encrypt_prototype.reset = cbc_aes_reset; | ||
2130 | cbc_aes_encrypt_prototype.process = cbc_aes_encrypt_process; | ||
2131 | cbc_aes_encrypt_prototype.finish = cbc_aes_encrypt_finish; | ||
2132 | var cbc_aes_decrypt_prototype = cbc_aes_decrypt_constructor.prototype; | ||
2133 | cbc_aes_decrypt_prototype.reset = cbc_aes_reset; | ||
2134 | cbc_aes_decrypt_prototype.process = cbc_aes_decrypt_process; | ||
2135 | cbc_aes_decrypt_prototype.finish = cbc_aes_decrypt_finish; | ||
2136 | var cbc_aes_prototype = cbc_aes_constructor.prototype; | ||
2137 | cbc_aes_prototype.reset = cbc_aes_reset; | ||
2138 | cbc_aes_prototype.encrypt = cbc_aes_encrypt; | ||
2139 | cbc_aes_prototype.decrypt = cbc_aes_decrypt; | ||
2140 | function _cbc_mac_process(data) { | ||
2141 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, wlen = 0; | ||
2142 | while (dlen > 0) { | ||
2143 | wlen = _aes_heap_write(this.heap, _aes_heap_start, data, dpos, dlen); | ||
2144 | this.asm.cbc_mac(_aes_heap_start, wlen, -1); | ||
2145 | dpos += wlen; | ||
2146 | dlen -= wlen; | ||
2147 | } | ||
2148 | } | ||
2149 | var _ccm_adata_maxLength = 65279, _ccm_data_maxLength = 68719476720; | ||
2150 | function ccm_aes_constructor(options) { | ||
2151 | this.padding = false; | ||
2152 | this.mode = "ccm"; | ||
2153 | this.tagSize = _aes_block_size; | ||
2154 | this.lengthSize = 4; | ||
2155 | this.nonce = null; | ||
2156 | this.adata = null; | ||
2157 | this.iv = null; | ||
2158 | this.dataLength = -1; | ||
2159 | this.dataLeft = -1; | ||
2160 | this.counter = 1; | ||
2161 | _aes_constructor.call(this, options); | ||
2162 | } | ||
2163 | function ccm_aes_encrypt_constructor(options) { | ||
2164 | ccm_aes_constructor.call(this, options); | ||
2165 | } | ||
2166 | function ccm_aes_decrypt_constructor(options) { | ||
2167 | ccm_aes_constructor.call(this, options); | ||
2168 | } | ||
2169 | function _ccm_calculate_iv() { | ||
2170 | var nonce = this.nonce, adata = this.adata, tagSize = this.tagSize, lengthSize = this.lengthSize, dataLength = this.dataLength; | ||
2171 | var data = new Uint8Array(_aes_block_size + (adata ? 2 + adata.byteLength : 0)); | ||
2172 | data[0] = (adata ? 64 : 0) | tagSize - 2 << 2 | lengthSize - 1; | ||
2173 | data.set(nonce, 1); | ||
2174 | if (lengthSize > 4) data[11] = (dataLength - (dataLength >>> 0)) / 4294967296 & 15; | ||
2175 | if (lengthSize > 3) data[12] = dataLength >>> 24; | ||
2176 | if (lengthSize > 2) data[13] = dataLength >>> 16 & 255; | ||
2177 | data[14] = dataLength >>> 8 & 255; | ||
2178 | data[15] = dataLength & 255; | ||
2179 | if (adata) { | ||
2180 | data[16] = adata.byteLength >>> 8 & 255; | ||
2181 | data[17] = adata.byteLength & 255; | ||
2182 | data.set(adata, 18); | ||
2183 | } | ||
2184 | _cbc_mac_process.call(this, data); | ||
2185 | this.asm.save_state(_aes_heap_start); | ||
2186 | this.iv = new Uint8Array(this.heap.subarray(_aes_heap_start, _aes_heap_start + _aes_block_size)); | ||
2187 | } | ||
2188 | function ccm_aes_reset(options) { | ||
2189 | options = options || {}; | ||
2190 | _aes_reset.call(this, options); | ||
2191 | _aes_init_iv.call(this, options.iv); | ||
2192 | var tagSize = options.tagSize; | ||
2193 | if (tagSize !== undefined) { | ||
2194 | if (!is_number(tagSize)) throw new TypeError("tagSize must be a number"); | ||
2195 | if (tagSize < 4 || tagSize > 16 || tagSize & 1) throw new IllegalArgumentError("illegal tagSize value"); | ||
2196 | this.tagSize = tagSize; | ||
2197 | } else { | ||
2198 | this.tagSize = _aes_block_size; | ||
2199 | } | ||
2200 | var lengthSize = options.lengthSize, nonce = options.nonce; | ||
2201 | if (nonce !== undefined) { | ||
2202 | if (is_buffer(nonce) || is_bytes(nonce)) { | ||
2203 | nonce = new Uint8Array(nonce); | ||
2204 | } else if (is_string(nonce)) { | ||
2205 | var str = nonce; | ||
2206 | nonce = new Uint8Array(str.length); | ||
2207 | for (var i = 0; i < str.length; ++i) nonce[i] = str.charCodeAt(i); | ||
2208 | } else { | ||
2209 | throw new TypeError("unexpected nonce type"); | ||
2210 | } | ||
2211 | if (nonce.length < 10 || nonce.length > 13) throw new IllegalArgumentError("illegal nonce length"); | ||
2212 | lengthSize = lengthSize || 15 - nonce.length; | ||
2213 | this.nonce = nonce; | ||
2214 | } else { | ||
2215 | this.nonce = null; | ||
2216 | } | ||
2217 | if (lengthSize !== undefined) { | ||
2218 | if (!is_number(lengthSize)) throw new TypeError("lengthSize must be a number"); | ||
2219 | if (lengthSize < 2 || lengthSize > 5 || nonce.length + lengthSize !== 15) throw new IllegalArgumentError("illegal lengthSize value"); | ||
2220 | this.lengthSize = lengthSize; | ||
2221 | } else { | ||
2222 | this.lengthSize = lengthSize = 4; | ||
2223 | } | ||
2224 | var iv = this.iv; | ||
2225 | var counter = options.counter; | ||
2226 | if (counter !== undefined) { | ||
2227 | if (iv === null) throw new IllegalStateError("iv is also required"); | ||
2228 | if (!is_number(counter)) throw new TypeError("counter must be a number"); | ||
2229 | this.counter = counter; | ||
2230 | } else { | ||
2231 | this.counter = 1; | ||
2232 | } | ||
2233 | var dataLength = options.dataLength; | ||
2234 | if (dataLength !== undefined) { | ||
2235 | if (!is_number(dataLength)) throw new TypeError("dataLength must be a number"); | ||
2236 | if (dataLength < 0 || dataLength > _ccm_data_maxLength || dataLength > Math.pow(2, 8 * lengthSize) - 1) throw new IllegalArgumentError("illegal dataLength value"); | ||
2237 | this.dataLength = dataLength; | ||
2238 | var dataLeft = options.dataLeft || dataLength; | ||
2239 | if (!is_number(dataLeft)) throw new TypeError("dataLeft must be a number"); | ||
2240 | if (dataLeft < 0 || dataLeft > dataLength) throw new IllegalArgumentError("illegal dataLeft value"); | ||
2241 | this.dataLeft = dataLeft; | ||
2242 | } else { | ||
2243 | this.dataLength = dataLength = -1; | ||
2244 | this.dataLeft = dataLength; | ||
2245 | } | ||
2246 | var adata = options.adata; | ||
2247 | if (adata !== undefined) { | ||
2248 | if (iv !== null) throw new IllegalStateError("you must specify either adata or iv, not both"); | ||
2249 | if (is_buffer(adata) || is_bytes(adata)) { | ||
2250 | adata = new Uint8Array(adata); | ||
2251 | } else if (is_string(adata)) { | ||
2252 | var str = adata; | ||
2253 | adata = new Uint8Array(str.length); | ||
2254 | for (var i = 0; i < str.length; ++i) adata[i] = str.charCodeAt(i); | ||
2255 | } else { | ||
2256 | throw new TypeError("unexpected adata type"); | ||
2257 | } | ||
2258 | if (adata.byteLength === 0 || adata.byteLength > _ccm_adata_maxLength) throw new IllegalArgumentError("illegal adata length"); | ||
2259 | this.adata = adata; | ||
2260 | this.counter = 1; | ||
2261 | } else { | ||
2262 | this.adata = adata = null; | ||
2263 | } | ||
2264 | if (dataLength !== -1) _ccm_calculate_iv.call(this); | ||
2265 | return this; | ||
2266 | } | ||
2267 | function ccm_aes_encrypt_process(data) { | ||
2268 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2269 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2270 | if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow"); | ||
2271 | var result = new Uint8Array(rlen); | ||
2272 | var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; | ||
2273 | for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i]; | ||
2274 | while (dlen > 0) { | ||
2275 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2276 | len += wlen; | ||
2277 | dpos += wlen; | ||
2278 | dlen -= wlen; | ||
2279 | asm_args[0] = pos; | ||
2280 | asm_args[1] = len & ~15; | ||
2281 | asm_args[16] = counter / 4294967296 >>> 0; | ||
2282 | asm_args[17] = counter >>> 0; | ||
2283 | wlen = asm.ccm_encrypt.apply(asm, asm_args); | ||
2284 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2285 | counter += wlen >>> 4; | ||
2286 | rpos += wlen; | ||
2287 | if (wlen < len) { | ||
2288 | pos += wlen; | ||
2289 | len -= wlen; | ||
2290 | } else { | ||
2291 | pos = _aes_heap_start; | ||
2292 | len = 0; | ||
2293 | } | ||
2294 | } | ||
2295 | this.result = result; | ||
2296 | this.counter = counter; | ||
2297 | this.pos = pos; | ||
2298 | this.len = len; | ||
2299 | return this; | ||
2300 | } | ||
2301 | function ccm_aes_encrypt_finish() { | ||
2302 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2303 | var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, wlen = 0; | ||
2304 | var result = new Uint8Array(len + tagSize); | ||
2305 | var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; | ||
2306 | for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i]; | ||
2307 | asm_args[0] = pos; | ||
2308 | asm_args[1] = len; | ||
2309 | asm_args[16] = counter / 4294967296 >>> 0; | ||
2310 | asm_args[17] = counter >>> 0; | ||
2311 | wlen = asm.ccm_encrypt.apply(asm, asm_args); | ||
2312 | result.set(heap.subarray(pos, pos + wlen)); | ||
2313 | counter = 1; | ||
2314 | pos = _aes_heap_start; | ||
2315 | len = 0; | ||
2316 | asm.save_state(_aes_heap_start); | ||
2317 | asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0; | ||
2318 | asm_args[17] = 0; | ||
2319 | asm.ccm_encrypt.apply(asm, asm_args); | ||
2320 | result.set(heap.subarray(_aes_heap_start, _aes_heap_start + tagSize), wlen); | ||
2321 | this.result = result; | ||
2322 | this.counter = counter; | ||
2323 | this.pos = pos; | ||
2324 | this.len = len; | ||
2325 | return this; | ||
2326 | } | ||
2327 | function ccm_aes_encrypt(data) { | ||
2328 | this.dataLength = this.dataLeft = data.byteLength || data.length || 0; | ||
2329 | var result1 = ccm_aes_encrypt_process.call(this, data).result, result2 = ccm_aes_encrypt_finish.call(this).result, result; | ||
2330 | result = new Uint8Array(result1.length + result2.length); | ||
2331 | result.set(result1); | ||
2332 | result.set(result2, result1.length); | ||
2333 | this.result = result; | ||
2334 | return this; | ||
2335 | } | ||
2336 | function ccm_aes_decrypt_process(data) { | ||
2337 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2338 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2339 | if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow"); | ||
2340 | var result = new Uint8Array(rlen); | ||
2341 | var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; | ||
2342 | for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i]; | ||
2343 | while (dlen > 0) { | ||
2344 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2345 | len += wlen; | ||
2346 | dpos += wlen; | ||
2347 | dlen -= wlen; | ||
2348 | asm_args[0] = pos; | ||
2349 | asm_args[1] = len + dlen - tagSize >= _aes_block_size ? dlen >= tagSize ? len & ~15 : len + dlen - tagSize & ~15 : 0; | ||
2350 | asm_args[16] = counter / 4294967296 >>> 0; | ||
2351 | asm_args[17] = counter >>> 0; | ||
2352 | wlen = asm.ccm_decrypt.apply(asm, asm_args); | ||
2353 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2354 | counter += wlen >>> 4; | ||
2355 | rpos += wlen; | ||
2356 | if (wlen < len) { | ||
2357 | pos += wlen; | ||
2358 | len -= wlen; | ||
2359 | } else { | ||
2360 | pos = _aes_heap_start; | ||
2361 | len = 0; | ||
2362 | } | ||
2363 | } | ||
2364 | this.result = result.subarray(0, rpos); | ||
2365 | this.counter = counter; | ||
2366 | this.pos = pos; | ||
2367 | this.len = len; | ||
2368 | return this; | ||
2369 | } | ||
2370 | function ccm_aes_decrypt_finish() { | ||
2371 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2372 | var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, rlen = len - tagSize, wlen = 0; | ||
2373 | if (len < tagSize) throw new IllegalStateError("authentication tag not found"); | ||
2374 | var result = new Uint8Array(rlen), atag = new Uint8Array(heap.subarray(pos + rlen, pos + len)); | ||
2375 | var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; | ||
2376 | for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i]; | ||
2377 | asm_args[0] = pos; | ||
2378 | asm_args[1] = rlen; | ||
2379 | asm_args[16] = counter / 4294967296 >>> 0; | ||
2380 | asm_args[17] = counter >>> 0; | ||
2381 | wlen = asm.ccm_decrypt.apply(asm, asm_args); | ||
2382 | result.set(heap.subarray(pos, pos + wlen)); | ||
2383 | counter = 1; | ||
2384 | pos = _aes_heap_start; | ||
2385 | len = 0; | ||
2386 | asm.save_state(_aes_heap_start); | ||
2387 | asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0; | ||
2388 | asm_args[17] = 0; | ||
2389 | asm.ccm_encrypt.apply(asm, asm_args); | ||
2390 | var acheck = 0; | ||
2391 | for (var i = 0; i < tagSize; ++i) acheck |= atag[i] ^ heap[_aes_heap_start + i]; | ||
2392 | if (acheck) throw new SecurityError("data integrity check failed"); | ||
2393 | this.result = result; | ||
2394 | this.counter = counter; | ||
2395 | this.pos = pos; | ||
2396 | this.len = len; | ||
2397 | return this; | ||
2398 | } | ||
2399 | function ccm_aes_decrypt(data) { | ||
2400 | this.dataLength = this.dataLeft = data.byteLength || data.length || 0; | ||
2401 | var result1 = ccm_aes_decrypt_process.call(this, data).result, result2 = ccm_aes_decrypt_finish.call(this).result, result; | ||
2402 | result = new Uint8Array(result1.length + result2.length); | ||
2403 | result.set(result1); | ||
2404 | result.set(result2, result1.length); | ||
2405 | this.result = result; | ||
2406 | return this; | ||
2407 | } | ||
2408 | var ccm_aes_prototype = ccm_aes_constructor.prototype; | ||
2409 | ccm_aes_prototype.reset = ccm_aes_reset; | ||
2410 | ccm_aes_prototype.encrypt = ccm_aes_encrypt; | ||
2411 | ccm_aes_prototype.decrypt = ccm_aes_decrypt; | ||
2412 | var ccm_aes_encrypt_prototype = ccm_aes_encrypt_constructor.prototype; | ||
2413 | ccm_aes_encrypt_prototype.reset = ccm_aes_reset; | ||
2414 | ccm_aes_encrypt_prototype.process = ccm_aes_encrypt_process; | ||
2415 | ccm_aes_encrypt_prototype.finish = ccm_aes_encrypt_finish; | ||
2416 | var ccm_aes_decrypt_prototype = ccm_aes_decrypt_constructor.prototype; | ||
2417 | ccm_aes_decrypt_prototype.reset = ccm_aes_reset; | ||
2418 | ccm_aes_decrypt_prototype.process = ccm_aes_decrypt_process; | ||
2419 | ccm_aes_decrypt_prototype.finish = ccm_aes_decrypt_finish; | ||
2420 | function cfb_aes_constructor(options) { | ||
2421 | this.padding = false; | ||
2422 | this.mode = "cfb"; | ||
2423 | this.iv = null; | ||
2424 | _aes_constructor.call(this, options); | ||
2425 | } | ||
2426 | function cfb_aes_encrypt_constructor(options) { | ||
2427 | cfb_aes_constructor.call(this, options); | ||
2428 | } | ||
2429 | function cfb_aes_decrypt_constructor(options) { | ||
2430 | cfb_aes_constructor.call(this, options); | ||
2431 | } | ||
2432 | function cfb_aes_reset(options) { | ||
2433 | options = options || {}; | ||
2434 | _aes_reset.call(this, options); | ||
2435 | _aes_init_iv.call(this, options.iv); | ||
2436 | return this; | ||
2437 | } | ||
2438 | function cfb_aes_encrypt_process(data) { | ||
2439 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2440 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2441 | var result = new Uint8Array(rlen); | ||
2442 | while (dlen > 0) { | ||
2443 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2444 | len += wlen; | ||
2445 | dpos += wlen; | ||
2446 | dlen -= wlen; | ||
2447 | wlen = asm.cfb_encrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size)); | ||
2448 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2449 | rpos += wlen; | ||
2450 | if (wlen < len) { | ||
2451 | pos += wlen; | ||
2452 | len -= wlen; | ||
2453 | } else { | ||
2454 | pos = _aes_heap_start; | ||
2455 | len = 0; | ||
2456 | } | ||
2457 | } | ||
2458 | this.result = result; | ||
2459 | this.pos = pos; | ||
2460 | this.len = len; | ||
2461 | return this; | ||
2462 | } | ||
2463 | function cfb_aes_encrypt_finish() { | ||
2464 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2465 | var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len; | ||
2466 | var result = new Uint8Array(len); | ||
2467 | asm.cfb_encrypt(pos, len); | ||
2468 | result.set(heap.subarray(pos, pos + len)); | ||
2469 | this.result = result; | ||
2470 | this.pos = _aes_heap_start; | ||
2471 | this.len = 0; | ||
2472 | return this; | ||
2473 | } | ||
2474 | function cfb_aes_encrypt(data) { | ||
2475 | var result1 = cfb_aes_encrypt_process.call(this, data).result, result2 = cfb_aes_encrypt_finish.call(this).result, result; | ||
2476 | result = new Uint8Array(result1.length + result2.length); | ||
2477 | result.set(result1); | ||
2478 | result.set(result2, result1.length); | ||
2479 | this.result = result; | ||
2480 | return this; | ||
2481 | } | ||
2482 | function cfb_aes_decrypt_process(data) { | ||
2483 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2484 | var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0; | ||
2485 | var result = new Uint8Array(rlen); | ||
2486 | while (dlen > 0) { | ||
2487 | wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen); | ||
2488 | len += wlen; | ||
2489 | dpos += wlen; | ||
2490 | dlen -= wlen; | ||
2491 | wlen = asm.cfb_decrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size)); | ||
2492 | result.set(heap.subarray(pos, pos + wlen), rpos); | ||
2493 | rpos += wlen; | ||
2494 | if (wlen < len) { | ||
2495 | pos += wlen; | ||
2496 | len -= wlen; | ||
2497 | } else { | ||
2498 | pos = _aes_heap_start; | ||
2499 | len = 0; | ||
2500 | } | ||
2501 | } | ||
2502 | this.result = result.subarray(0, rpos); | ||
2503 | this.pos = pos; | ||
2504 | this.len = len; | ||
2505 | return this; | ||
2506 | } | ||
2507 | function cfb_aes_decrypt_finish() { | ||
2508 | if (!this.key) throw new IllegalStateError("no key is associated with the instance"); | ||
2509 | var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len; | ||
2510 | if (len === 0) { | ||
2511 | this.result = new Uint8Array(0); | ||
2512 | this.pos = _aes_heap_start; | ||
2513 | this.len = 0; | ||
2514 | return this; | ||
2515 | } | ||
2516 | var result = new Uint8Array(len); | ||
2517 | asm.cfb_decrypt(pos, len); | ||
2518 | result.set(heap.subarray(pos, pos + len)); | ||
2519 | this.result = result; | ||
2520 | this.pos = _aes_heap_start; | ||
2521 | this.len = 0; | ||
2522 | return this; | ||
2523 | } | ||
2524 | function cfb_aes_decrypt(data) { | ||
2525 | var result1 = cfb_aes_decrypt_process.call(this, data).result, result2 = cfb_aes_decrypt_finish.call(this).result, result; | ||
2526 | result = new Uint8Array(result1.length + result2.length); | ||
2527 | result.set(result1); | ||
2528 | result.set(result2, result1.length); | ||
2529 | this.result = result; | ||
2530 | return this; | ||
2531 | } | ||
2532 | var cfb_aes_encrypt_prototype = cfb_aes_encrypt_constructor.prototype; | ||
2533 | cfb_aes_encrypt_prototype.reset = cfb_aes_reset; | ||
2534 | cfb_aes_encrypt_prototype.process = cfb_aes_encrypt_process; | ||
2535 | cfb_aes_encrypt_prototype.finish = cfb_aes_encrypt_finish; | ||
2536 | var cfb_aes_decrypt_prototype = cfb_aes_decrypt_constructor.prototype; | ||
2537 | cfb_aes_decrypt_prototype.reset = cfb_aes_reset; | ||
2538 | cfb_aes_decrypt_prototype.process = cfb_aes_decrypt_process; | ||
2539 | cfb_aes_decrypt_prototype.finish = cfb_aes_decrypt_finish; | ||
2540 | var cfb_aes_prototype = cfb_aes_constructor.prototype; | ||
2541 | cfb_aes_prototype.reset = cfb_aes_reset; | ||
2542 | cfb_aes_prototype.encrypt = cfb_aes_encrypt; | ||
2543 | cfb_aes_prototype.decrypt = cfb_aes_decrypt; | ||
2544 | function sha256_asm(stdlib, foreign, buffer) { | ||
2545 | "use asm"; | ||
2546 | var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0, TOTAL = 0; | ||
2547 | var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0, I5 = 0, I6 = 0, I7 = 0, O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0, O5 = 0, O6 = 0, O7 = 0; | ||
2548 | var HEAP = new stdlib.Uint8Array(buffer); | ||
2549 | function _core(w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15) { | ||
2550 | w0 = w0 | 0; | ||
2551 | w1 = w1 | 0; | ||
2552 | w2 = w2 | 0; | ||
2553 | w3 = w3 | 0; | ||
2554 | w4 = w4 | 0; | ||
2555 | w5 = w5 | 0; | ||
2556 | w6 = w6 | 0; | ||
2557 | w7 = w7 | 0; | ||
2558 | w8 = w8 | 0; | ||
2559 | w9 = w9 | 0; | ||
2560 | w10 = w10 | 0; | ||
2561 | w11 = w11 | 0; | ||
2562 | w12 = w12 | 0; | ||
2563 | w13 = w13 | 0; | ||
2564 | w14 = w14 | 0; | ||
2565 | w15 = w15 | 0; | ||
2566 | var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, t = 0; | ||
2567 | a = H0; | ||
2568 | b = H1; | ||
2569 | c = H2; | ||
2570 | d = H3; | ||
2571 | e = H4; | ||
2572 | f = H5; | ||
2573 | g = H6; | ||
2574 | h = H7; | ||
2575 | t = w0 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1116352408 | 0; | ||
2576 | h = g; | ||
2577 | g = f; | ||
2578 | f = e; | ||
2579 | e = d + t | 0; | ||
2580 | d = c; | ||
2581 | c = b; | ||
2582 | b = a; | ||
2583 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2584 | t = w1 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1899447441 | 0; | ||
2585 | h = g; | ||
2586 | g = f; | ||
2587 | f = e; | ||
2588 | e = d + t | 0; | ||
2589 | d = c; | ||
2590 | c = b; | ||
2591 | b = a; | ||
2592 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2593 | t = w2 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3049323471 | 0; | ||
2594 | h = g; | ||
2595 | g = f; | ||
2596 | f = e; | ||
2597 | e = d + t | 0; | ||
2598 | d = c; | ||
2599 | c = b; | ||
2600 | b = a; | ||
2601 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2602 | t = w3 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3921009573 | 0; | ||
2603 | h = g; | ||
2604 | g = f; | ||
2605 | f = e; | ||
2606 | e = d + t | 0; | ||
2607 | d = c; | ||
2608 | c = b; | ||
2609 | b = a; | ||
2610 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2611 | t = w4 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 961987163 | 0; | ||
2612 | h = g; | ||
2613 | g = f; | ||
2614 | f = e; | ||
2615 | e = d + t | 0; | ||
2616 | d = c; | ||
2617 | c = b; | ||
2618 | b = a; | ||
2619 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2620 | t = w5 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1508970993 | 0; | ||
2621 | h = g; | ||
2622 | g = f; | ||
2623 | f = e; | ||
2624 | e = d + t | 0; | ||
2625 | d = c; | ||
2626 | c = b; | ||
2627 | b = a; | ||
2628 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2629 | t = w6 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2453635748 | 0; | ||
2630 | h = g; | ||
2631 | g = f; | ||
2632 | f = e; | ||
2633 | e = d + t | 0; | ||
2634 | d = c; | ||
2635 | c = b; | ||
2636 | b = a; | ||
2637 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2638 | t = w7 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2870763221 | 0; | ||
2639 | h = g; | ||
2640 | g = f; | ||
2641 | f = e; | ||
2642 | e = d + t | 0; | ||
2643 | d = c; | ||
2644 | c = b; | ||
2645 | b = a; | ||
2646 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2647 | t = w8 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3624381080 | 0; | ||
2648 | h = g; | ||
2649 | g = f; | ||
2650 | f = e; | ||
2651 | e = d + t | 0; | ||
2652 | d = c; | ||
2653 | c = b; | ||
2654 | b = a; | ||
2655 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2656 | t = w9 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 310598401 | 0; | ||
2657 | h = g; | ||
2658 | g = f; | ||
2659 | f = e; | ||
2660 | e = d + t | 0; | ||
2661 | d = c; | ||
2662 | c = b; | ||
2663 | b = a; | ||
2664 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2665 | t = w10 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 607225278 | 0; | ||
2666 | h = g; | ||
2667 | g = f; | ||
2668 | f = e; | ||
2669 | e = d + t | 0; | ||
2670 | d = c; | ||
2671 | c = b; | ||
2672 | b = a; | ||
2673 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2674 | t = w11 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1426881987 | 0; | ||
2675 | h = g; | ||
2676 | g = f; | ||
2677 | f = e; | ||
2678 | e = d + t | 0; | ||
2679 | d = c; | ||
2680 | c = b; | ||
2681 | b = a; | ||
2682 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2683 | t = w12 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1925078388 | 0; | ||
2684 | h = g; | ||
2685 | g = f; | ||
2686 | f = e; | ||
2687 | e = d + t | 0; | ||
2688 | d = c; | ||
2689 | c = b; | ||
2690 | b = a; | ||
2691 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2692 | t = w13 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2162078206 | 0; | ||
2693 | h = g; | ||
2694 | g = f; | ||
2695 | f = e; | ||
2696 | e = d + t | 0; | ||
2697 | d = c; | ||
2698 | c = b; | ||
2699 | b = a; | ||
2700 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2701 | t = w14 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2614888103 | 0; | ||
2702 | h = g; | ||
2703 | g = f; | ||
2704 | f = e; | ||
2705 | e = d + t | 0; | ||
2706 | d = c; | ||
2707 | c = b; | ||
2708 | b = a; | ||
2709 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2710 | t = w15 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3248222580 | 0; | ||
2711 | h = g; | ||
2712 | g = f; | ||
2713 | f = e; | ||
2714 | e = d + t | 0; | ||
2715 | d = c; | ||
2716 | c = b; | ||
2717 | b = a; | ||
2718 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2719 | w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0; | ||
2720 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3835390401 | 0; | ||
2721 | h = g; | ||
2722 | g = f; | ||
2723 | f = e; | ||
2724 | e = d + t | 0; | ||
2725 | d = c; | ||
2726 | c = b; | ||
2727 | b = a; | ||
2728 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2729 | w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0; | ||
2730 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4022224774 | 0; | ||
2731 | h = g; | ||
2732 | g = f; | ||
2733 | f = e; | ||
2734 | e = d + t | 0; | ||
2735 | d = c; | ||
2736 | c = b; | ||
2737 | b = a; | ||
2738 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2739 | w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0; | ||
2740 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 264347078 | 0; | ||
2741 | h = g; | ||
2742 | g = f; | ||
2743 | f = e; | ||
2744 | e = d + t | 0; | ||
2745 | d = c; | ||
2746 | c = b; | ||
2747 | b = a; | ||
2748 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2749 | w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0; | ||
2750 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 604807628 | 0; | ||
2751 | h = g; | ||
2752 | g = f; | ||
2753 | f = e; | ||
2754 | e = d + t | 0; | ||
2755 | d = c; | ||
2756 | c = b; | ||
2757 | b = a; | ||
2758 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2759 | w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0; | ||
2760 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 770255983 | 0; | ||
2761 | h = g; | ||
2762 | g = f; | ||
2763 | f = e; | ||
2764 | e = d + t | 0; | ||
2765 | d = c; | ||
2766 | c = b; | ||
2767 | b = a; | ||
2768 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2769 | w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0; | ||
2770 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1249150122 | 0; | ||
2771 | h = g; | ||
2772 | g = f; | ||
2773 | f = e; | ||
2774 | e = d + t | 0; | ||
2775 | d = c; | ||
2776 | c = b; | ||
2777 | b = a; | ||
2778 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2779 | w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0; | ||
2780 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1555081692 | 0; | ||
2781 | h = g; | ||
2782 | g = f; | ||
2783 | f = e; | ||
2784 | e = d + t | 0; | ||
2785 | d = c; | ||
2786 | c = b; | ||
2787 | b = a; | ||
2788 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2789 | w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0; | ||
2790 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1996064986 | 0; | ||
2791 | h = g; | ||
2792 | g = f; | ||
2793 | f = e; | ||
2794 | e = d + t | 0; | ||
2795 | d = c; | ||
2796 | c = b; | ||
2797 | b = a; | ||
2798 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2799 | w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0; | ||
2800 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2554220882 | 0; | ||
2801 | h = g; | ||
2802 | g = f; | ||
2803 | f = e; | ||
2804 | e = d + t | 0; | ||
2805 | d = c; | ||
2806 | c = b; | ||
2807 | b = a; | ||
2808 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2809 | w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0; | ||
2810 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2821834349 | 0; | ||
2811 | h = g; | ||
2812 | g = f; | ||
2813 | f = e; | ||
2814 | e = d + t | 0; | ||
2815 | d = c; | ||
2816 | c = b; | ||
2817 | b = a; | ||
2818 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2819 | w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0; | ||
2820 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2952996808 | 0; | ||
2821 | h = g; | ||
2822 | g = f; | ||
2823 | f = e; | ||
2824 | e = d + t | 0; | ||
2825 | d = c; | ||
2826 | c = b; | ||
2827 | b = a; | ||
2828 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2829 | w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0; | ||
2830 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3210313671 | 0; | ||
2831 | h = g; | ||
2832 | g = f; | ||
2833 | f = e; | ||
2834 | e = d + t | 0; | ||
2835 | d = c; | ||
2836 | c = b; | ||
2837 | b = a; | ||
2838 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2839 | w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0; | ||
2840 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3336571891 | 0; | ||
2841 | h = g; | ||
2842 | g = f; | ||
2843 | f = e; | ||
2844 | e = d + t | 0; | ||
2845 | d = c; | ||
2846 | c = b; | ||
2847 | b = a; | ||
2848 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2849 | w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0; | ||
2850 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3584528711 | 0; | ||
2851 | h = g; | ||
2852 | g = f; | ||
2853 | f = e; | ||
2854 | e = d + t | 0; | ||
2855 | d = c; | ||
2856 | c = b; | ||
2857 | b = a; | ||
2858 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2859 | w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0; | ||
2860 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 113926993 | 0; | ||
2861 | h = g; | ||
2862 | g = f; | ||
2863 | f = e; | ||
2864 | e = d + t | 0; | ||
2865 | d = c; | ||
2866 | c = b; | ||
2867 | b = a; | ||
2868 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2869 | w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0; | ||
2870 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 338241895 | 0; | ||
2871 | h = g; | ||
2872 | g = f; | ||
2873 | f = e; | ||
2874 | e = d + t | 0; | ||
2875 | d = c; | ||
2876 | c = b; | ||
2877 | b = a; | ||
2878 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2879 | w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0; | ||
2880 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 666307205 | 0; | ||
2881 | h = g; | ||
2882 | g = f; | ||
2883 | f = e; | ||
2884 | e = d + t | 0; | ||
2885 | d = c; | ||
2886 | c = b; | ||
2887 | b = a; | ||
2888 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2889 | w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0; | ||
2890 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 773529912 | 0; | ||
2891 | h = g; | ||
2892 | g = f; | ||
2893 | f = e; | ||
2894 | e = d + t | 0; | ||
2895 | d = c; | ||
2896 | c = b; | ||
2897 | b = a; | ||
2898 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2899 | w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0; | ||
2900 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1294757372 | 0; | ||
2901 | h = g; | ||
2902 | g = f; | ||
2903 | f = e; | ||
2904 | e = d + t | 0; | ||
2905 | d = c; | ||
2906 | c = b; | ||
2907 | b = a; | ||
2908 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2909 | w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0; | ||
2910 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1396182291 | 0; | ||
2911 | h = g; | ||
2912 | g = f; | ||
2913 | f = e; | ||
2914 | e = d + t | 0; | ||
2915 | d = c; | ||
2916 | c = b; | ||
2917 | b = a; | ||
2918 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2919 | w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0; | ||
2920 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1695183700 | 0; | ||
2921 | h = g; | ||
2922 | g = f; | ||
2923 | f = e; | ||
2924 | e = d + t | 0; | ||
2925 | d = c; | ||
2926 | c = b; | ||
2927 | b = a; | ||
2928 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2929 | w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0; | ||
2930 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1986661051 | 0; | ||
2931 | h = g; | ||
2932 | g = f; | ||
2933 | f = e; | ||
2934 | e = d + t | 0; | ||
2935 | d = c; | ||
2936 | c = b; | ||
2937 | b = a; | ||
2938 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2939 | w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0; | ||
2940 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2177026350 | 0; | ||
2941 | h = g; | ||
2942 | g = f; | ||
2943 | f = e; | ||
2944 | e = d + t | 0; | ||
2945 | d = c; | ||
2946 | c = b; | ||
2947 | b = a; | ||
2948 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2949 | w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0; | ||
2950 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2456956037 | 0; | ||
2951 | h = g; | ||
2952 | g = f; | ||
2953 | f = e; | ||
2954 | e = d + t | 0; | ||
2955 | d = c; | ||
2956 | c = b; | ||
2957 | b = a; | ||
2958 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2959 | w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0; | ||
2960 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2730485921 | 0; | ||
2961 | h = g; | ||
2962 | g = f; | ||
2963 | f = e; | ||
2964 | e = d + t | 0; | ||
2965 | d = c; | ||
2966 | c = b; | ||
2967 | b = a; | ||
2968 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2969 | w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0; | ||
2970 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2820302411 | 0; | ||
2971 | h = g; | ||
2972 | g = f; | ||
2973 | f = e; | ||
2974 | e = d + t | 0; | ||
2975 | d = c; | ||
2976 | c = b; | ||
2977 | b = a; | ||
2978 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2979 | w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0; | ||
2980 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3259730800 | 0; | ||
2981 | h = g; | ||
2982 | g = f; | ||
2983 | f = e; | ||
2984 | e = d + t | 0; | ||
2985 | d = c; | ||
2986 | c = b; | ||
2987 | b = a; | ||
2988 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2989 | w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0; | ||
2990 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3345764771 | 0; | ||
2991 | h = g; | ||
2992 | g = f; | ||
2993 | f = e; | ||
2994 | e = d + t | 0; | ||
2995 | d = c; | ||
2996 | c = b; | ||
2997 | b = a; | ||
2998 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
2999 | w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0; | ||
3000 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3516065817 | 0; | ||
3001 | h = g; | ||
3002 | g = f; | ||
3003 | f = e; | ||
3004 | e = d + t | 0; | ||
3005 | d = c; | ||
3006 | c = b; | ||
3007 | b = a; | ||
3008 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3009 | w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0; | ||
3010 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3600352804 | 0; | ||
3011 | h = g; | ||
3012 | g = f; | ||
3013 | f = e; | ||
3014 | e = d + t | 0; | ||
3015 | d = c; | ||
3016 | c = b; | ||
3017 | b = a; | ||
3018 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3019 | w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0; | ||
3020 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4094571909 | 0; | ||
3021 | h = g; | ||
3022 | g = f; | ||
3023 | f = e; | ||
3024 | e = d + t | 0; | ||
3025 | d = c; | ||
3026 | c = b; | ||
3027 | b = a; | ||
3028 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3029 | w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0; | ||
3030 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 275423344 | 0; | ||
3031 | h = g; | ||
3032 | g = f; | ||
3033 | f = e; | ||
3034 | e = d + t | 0; | ||
3035 | d = c; | ||
3036 | c = b; | ||
3037 | b = a; | ||
3038 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3039 | w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0; | ||
3040 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 430227734 | 0; | ||
3041 | h = g; | ||
3042 | g = f; | ||
3043 | f = e; | ||
3044 | e = d + t | 0; | ||
3045 | d = c; | ||
3046 | c = b; | ||
3047 | b = a; | ||
3048 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3049 | w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0; | ||
3050 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 506948616 | 0; | ||
3051 | h = g; | ||
3052 | g = f; | ||
3053 | f = e; | ||
3054 | e = d + t | 0; | ||
3055 | d = c; | ||
3056 | c = b; | ||
3057 | b = a; | ||
3058 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3059 | w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0; | ||
3060 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 659060556 | 0; | ||
3061 | h = g; | ||
3062 | g = f; | ||
3063 | f = e; | ||
3064 | e = d + t | 0; | ||
3065 | d = c; | ||
3066 | c = b; | ||
3067 | b = a; | ||
3068 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3069 | w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0; | ||
3070 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 883997877 | 0; | ||
3071 | h = g; | ||
3072 | g = f; | ||
3073 | f = e; | ||
3074 | e = d + t | 0; | ||
3075 | d = c; | ||
3076 | c = b; | ||
3077 | b = a; | ||
3078 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3079 | w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0; | ||
3080 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 958139571 | 0; | ||
3081 | h = g; | ||
3082 | g = f; | ||
3083 | f = e; | ||
3084 | e = d + t | 0; | ||
3085 | d = c; | ||
3086 | c = b; | ||
3087 | b = a; | ||
3088 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3089 | w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0; | ||
3090 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1322822218 | 0; | ||
3091 | h = g; | ||
3092 | g = f; | ||
3093 | f = e; | ||
3094 | e = d + t | 0; | ||
3095 | d = c; | ||
3096 | c = b; | ||
3097 | b = a; | ||
3098 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3099 | w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0; | ||
3100 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1537002063 | 0; | ||
3101 | h = g; | ||
3102 | g = f; | ||
3103 | f = e; | ||
3104 | e = d + t | 0; | ||
3105 | d = c; | ||
3106 | c = b; | ||
3107 | b = a; | ||
3108 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3109 | w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0; | ||
3110 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1747873779 | 0; | ||
3111 | h = g; | ||
3112 | g = f; | ||
3113 | f = e; | ||
3114 | e = d + t | 0; | ||
3115 | d = c; | ||
3116 | c = b; | ||
3117 | b = a; | ||
3118 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3119 | w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0; | ||
3120 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1955562222 | 0; | ||
3121 | h = g; | ||
3122 | g = f; | ||
3123 | f = e; | ||
3124 | e = d + t | 0; | ||
3125 | d = c; | ||
3126 | c = b; | ||
3127 | b = a; | ||
3128 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3129 | w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0; | ||
3130 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2024104815 | 0; | ||
3131 | h = g; | ||
3132 | g = f; | ||
3133 | f = e; | ||
3134 | e = d + t | 0; | ||
3135 | d = c; | ||
3136 | c = b; | ||
3137 | b = a; | ||
3138 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3139 | w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0; | ||
3140 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2227730452 | 0; | ||
3141 | h = g; | ||
3142 | g = f; | ||
3143 | f = e; | ||
3144 | e = d + t | 0; | ||
3145 | d = c; | ||
3146 | c = b; | ||
3147 | b = a; | ||
3148 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3149 | w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0; | ||
3150 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2361852424 | 0; | ||
3151 | h = g; | ||
3152 | g = f; | ||
3153 | f = e; | ||
3154 | e = d + t | 0; | ||
3155 | d = c; | ||
3156 | c = b; | ||
3157 | b = a; | ||
3158 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3159 | w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0; | ||
3160 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2428436474 | 0; | ||
3161 | h = g; | ||
3162 | g = f; | ||
3163 | f = e; | ||
3164 | e = d + t | 0; | ||
3165 | d = c; | ||
3166 | c = b; | ||
3167 | b = a; | ||
3168 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3169 | w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0; | ||
3170 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2756734187 | 0; | ||
3171 | h = g; | ||
3172 | g = f; | ||
3173 | f = e; | ||
3174 | e = d + t | 0; | ||
3175 | d = c; | ||
3176 | c = b; | ||
3177 | b = a; | ||
3178 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3179 | w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0; | ||
3180 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3204031479 | 0; | ||
3181 | h = g; | ||
3182 | g = f; | ||
3183 | f = e; | ||
3184 | e = d + t | 0; | ||
3185 | d = c; | ||
3186 | c = b; | ||
3187 | b = a; | ||
3188 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3189 | w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0; | ||
3190 | t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3329325298 | 0; | ||
3191 | h = g; | ||
3192 | g = f; | ||
3193 | f = e; | ||
3194 | e = d + t | 0; | ||
3195 | d = c; | ||
3196 | c = b; | ||
3197 | b = a; | ||
3198 | a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0; | ||
3199 | H0 = H0 + a | 0; | ||
3200 | H1 = H1 + b | 0; | ||
3201 | H2 = H2 + c | 0; | ||
3202 | H3 = H3 + d | 0; | ||
3203 | H4 = H4 + e | 0; | ||
3204 | H5 = H5 + f | 0; | ||
3205 | H6 = H6 + g | 0; | ||
3206 | H7 = H7 + h | 0; | ||
3207 | } | ||
3208 | function _core_heap(offset) { | ||
3209 | offset = offset | 0; | ||
3210 | _core(HEAP[offset | 0] << 24 | HEAP[offset | 1] << 16 | HEAP[offset | 2] << 8 | HEAP[offset | 3], HEAP[offset | 4] << 24 | HEAP[offset | 5] << 16 | HEAP[offset | 6] << 8 | HEAP[offset | 7], HEAP[offset | 8] << 24 | HEAP[offset | 9] << 16 | HEAP[offset | 10] << 8 | HEAP[offset | 11], HEAP[offset | 12] << 24 | HEAP[offset | 13] << 16 | HEAP[offset | 14] << 8 | HEAP[offset | 15], HEAP[offset | 16] << 24 | HEAP[offset | 17] << 16 | HEAP[offset | 18] << 8 | HEAP[offset | 19], HEAP[offset | 20] << 24 | HEAP[offset | 21] << 16 | HEAP[offset | 22] << 8 | HEAP[offset | 23], HEAP[offset | 24] << 24 | HEAP[offset | 25] << 16 | HEAP[offset | 26] << 8 | HEAP[offset | 27], HEAP[offset | 28] << 24 | HEAP[offset | 29] << 16 | HEAP[offset | 30] << 8 | HEAP[offset | 31], HEAP[offset | 32] << 24 | HEAP[offset | 33] << 16 | HEAP[offset | 34] << 8 | HEAP[offset | 35], HEAP[offset | 36] << 24 | HEAP[offset | 37] << 16 | HEAP[offset | 38] << 8 | HEAP[offset | 39], HEAP[offset | 40] << 24 | HEAP[offset | 41] << 16 | HEAP[offset | 42] << 8 | HEAP[offset | 43], HEAP[offset | 44] << 24 | HEAP[offset | 45] << 16 | HEAP[offset | 46] << 8 | HEAP[offset | 47], HEAP[offset | 48] << 24 | HEAP[offset | 49] << 16 | HEAP[offset | 50] << 8 | HEAP[offset | 51], HEAP[offset | 52] << 24 | HEAP[offset | 53] << 16 | HEAP[offset | 54] << 8 | HEAP[offset | 55], HEAP[offset | 56] << 24 | HEAP[offset | 57] << 16 | HEAP[offset | 58] << 8 | HEAP[offset | 59], HEAP[offset | 60] << 24 | HEAP[offset | 61] << 16 | HEAP[offset | 62] << 8 | HEAP[offset | 63]); | ||
3211 | } | ||
3212 | function _state_to_heap(output) { | ||
3213 | output = output | 0; | ||
3214 | HEAP[output | 0] = H0 >>> 24; | ||
3215 | HEAP[output | 1] = H0 >>> 16 & 255; | ||
3216 | HEAP[output | 2] = H0 >>> 8 & 255; | ||
3217 | HEAP[output | 3] = H0 & 255; | ||
3218 | HEAP[output | 4] = H1 >>> 24; | ||
3219 | HEAP[output | 5] = H1 >>> 16 & 255; | ||
3220 | HEAP[output | 6] = H1 >>> 8 & 255; | ||
3221 | HEAP[output | 7] = H1 & 255; | ||
3222 | HEAP[output | 8] = H2 >>> 24; | ||
3223 | HEAP[output | 9] = H2 >>> 16 & 255; | ||
3224 | HEAP[output | 10] = H2 >>> 8 & 255; | ||
3225 | HEAP[output | 11] = H2 & 255; | ||
3226 | HEAP[output | 12] = H3 >>> 24; | ||
3227 | HEAP[output | 13] = H3 >>> 16 & 255; | ||
3228 | HEAP[output | 14] = H3 >>> 8 & 255; | ||
3229 | HEAP[output | 15] = H3 & 255; | ||
3230 | HEAP[output | 16] = H4 >>> 24; | ||
3231 | HEAP[output | 17] = H4 >>> 16 & 255; | ||
3232 | HEAP[output | 18] = H4 >>> 8 & 255; | ||
3233 | HEAP[output | 19] = H4 & 255; | ||
3234 | HEAP[output | 20] = H5 >>> 24; | ||
3235 | HEAP[output | 21] = H5 >>> 16 & 255; | ||
3236 | HEAP[output | 22] = H5 >>> 8 & 255; | ||
3237 | HEAP[output | 23] = H5 & 255; | ||
3238 | HEAP[output | 24] = H6 >>> 24; | ||
3239 | HEAP[output | 25] = H6 >>> 16 & 255; | ||
3240 | HEAP[output | 26] = H6 >>> 8 & 255; | ||
3241 | HEAP[output | 27] = H6 & 255; | ||
3242 | HEAP[output | 28] = H7 >>> 24; | ||
3243 | HEAP[output | 29] = H7 >>> 16 & 255; | ||
3244 | HEAP[output | 30] = H7 >>> 8 & 255; | ||
3245 | HEAP[output | 31] = H7 & 255; | ||
3246 | } | ||
3247 | function reset() { | ||
3248 | H0 = 1779033703; | ||
3249 | H1 = 3144134277; | ||
3250 | H2 = 1013904242; | ||
3251 | H3 = 2773480762; | ||
3252 | H4 = 1359893119; | ||
3253 | H5 = 2600822924; | ||
3254 | H6 = 528734635; | ||
3255 | H7 = 1541459225; | ||
3256 | TOTAL = 0; | ||
3257 | } | ||
3258 | function init(h0, h1, h2, h3, h4, h5, h6, h7, total) { | ||
3259 | h0 = h0 | 0; | ||
3260 | h1 = h1 | 0; | ||
3261 | h2 = h2 | 0; | ||
3262 | h3 = h3 | 0; | ||
3263 | h4 = h4 | 0; | ||
3264 | h5 = h5 | 0; | ||
3265 | h6 = h6 | 0; | ||
3266 | h7 = h7 | 0; | ||
3267 | total = total | 0; | ||
3268 | H0 = h0; | ||
3269 | H1 = h1; | ||
3270 | H2 = h2; | ||
3271 | H3 = h3; | ||
3272 | H4 = h4; | ||
3273 | H5 = h5; | ||
3274 | H6 = h6; | ||
3275 | H7 = h7; | ||
3276 | TOTAL = total; | ||
3277 | } | ||
3278 | function process(offset, length) { | ||
3279 | offset = offset | 0; | ||
3280 | length = length | 0; | ||
3281 | var hashed = 0; | ||
3282 | if (offset & 63) return -1; | ||
3283 | while ((length | 0) >= 64) { | ||
3284 | _core_heap(offset); | ||
3285 | offset = offset + 64 | 0; | ||
3286 | length = length - 64 | 0; | ||
3287 | hashed = hashed + 64 | 0; | ||
3288 | } | ||
3289 | TOTAL = TOTAL + hashed | 0; | ||
3290 | return hashed | 0; | ||
3291 | } | ||
3292 | function finish(offset, length, output) { | ||
3293 | offset = offset | 0; | ||
3294 | length = length | 0; | ||
3295 | output = output | 0; | ||
3296 | var hashed = 0, i = 0; | ||
3297 | if (offset & 63) return -1; | ||
3298 | if (~output) if (output & 31) return -1; | ||
3299 | if ((length | 0) >= 64) { | ||
3300 | hashed = process(offset, length) | 0; | ||
3301 | if ((hashed | 0) == -1) return -1; | ||
3302 | offset = offset + hashed | 0; | ||
3303 | length = length - hashed | 0; | ||
3304 | } | ||
3305 | hashed = hashed + length | 0; | ||
3306 | TOTAL = TOTAL + length | 0; | ||
3307 | HEAP[offset | length] = 128; | ||
3308 | if ((length | 0) >= 56) { | ||
3309 | for (i = length + 1 | 0; (i | 0) < 64; i = i + 1 | 0) HEAP[offset | i] = 0; | ||
3310 | _core_heap(offset); | ||
3311 | length = 0; | ||
3312 | HEAP[offset | 0] = 0; | ||
3313 | } | ||
3314 | for (i = length + 1 | 0; (i | 0) < 59; i = i + 1 | 0) HEAP[offset | i] = 0; | ||
3315 | HEAP[offset | 59] = TOTAL >>> 29; | ||
3316 | HEAP[offset | 60] = TOTAL >>> 21 & 255; | ||
3317 | HEAP[offset | 61] = TOTAL >>> 13 & 255; | ||
3318 | HEAP[offset | 62] = TOTAL >>> 5 & 255; | ||
3319 | HEAP[offset | 63] = TOTAL << 3 & 255; | ||
3320 | _core_heap(offset); | ||
3321 | if (~output) _state_to_heap(output); | ||
3322 | return hashed | 0; | ||
3323 | } | ||
3324 | function hmac_reset() { | ||
3325 | H0 = I0; | ||
3326 | H1 = I1; | ||
3327 | H2 = I2; | ||
3328 | H3 = I3; | ||
3329 | H4 = I4; | ||
3330 | H5 = I5; | ||
3331 | H6 = I6; | ||
3332 | H7 = I7; | ||
3333 | TOTAL = 64; | ||
3334 | } | ||
3335 | function _hmac_opad() { | ||
3336 | H0 = O0; | ||
3337 | H1 = O1; | ||
3338 | H2 = O2; | ||
3339 | H3 = O3; | ||
3340 | H4 = O4; | ||
3341 | H5 = O5; | ||
3342 | H6 = O6; | ||
3343 | H7 = O7; | ||
3344 | TOTAL = 64; | ||
3345 | } | ||
3346 | function hmac_init(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) { | ||
3347 | p0 = p0 | 0; | ||
3348 | p1 = p1 | 0; | ||
3349 | p2 = p2 | 0; | ||
3350 | p3 = p3 | 0; | ||
3351 | p4 = p4 | 0; | ||
3352 | p5 = p5 | 0; | ||
3353 | p6 = p6 | 0; | ||
3354 | p7 = p7 | 0; | ||
3355 | p8 = p8 | 0; | ||
3356 | p9 = p9 | 0; | ||
3357 | p10 = p10 | 0; | ||
3358 | p11 = p11 | 0; | ||
3359 | p12 = p12 | 0; | ||
3360 | p13 = p13 | 0; | ||
3361 | p14 = p14 | 0; | ||
3362 | p15 = p15 | 0; | ||
3363 | reset(); | ||
3364 | _core(p0 ^ 1549556828, p1 ^ 1549556828, p2 ^ 1549556828, p3 ^ 1549556828, p4 ^ 1549556828, p5 ^ 1549556828, p6 ^ 1549556828, p7 ^ 1549556828, p8 ^ 1549556828, p9 ^ 1549556828, p10 ^ 1549556828, p11 ^ 1549556828, p12 ^ 1549556828, p13 ^ 1549556828, p14 ^ 1549556828, p15 ^ 1549556828); | ||
3365 | O0 = H0; | ||
3366 | O1 = H1; | ||
3367 | O2 = H2; | ||
3368 | O3 = H3; | ||
3369 | O4 = H4; | ||
3370 | O5 = H5; | ||
3371 | O6 = H6; | ||
3372 | O7 = H7; | ||
3373 | reset(); | ||
3374 | _core(p0 ^ 909522486, p1 ^ 909522486, p2 ^ 909522486, p3 ^ 909522486, p4 ^ 909522486, p5 ^ 909522486, p6 ^ 909522486, p7 ^ 909522486, p8 ^ 909522486, p9 ^ 909522486, p10 ^ 909522486, p11 ^ 909522486, p12 ^ 909522486, p13 ^ 909522486, p14 ^ 909522486, p15 ^ 909522486); | ||
3375 | I0 = H0; | ||
3376 | I1 = H1; | ||
3377 | I2 = H2; | ||
3378 | I3 = H3; | ||
3379 | I4 = H4; | ||
3380 | I5 = H5; | ||
3381 | I6 = H6; | ||
3382 | I7 = H7; | ||
3383 | TOTAL = 64; | ||
3384 | } | ||
3385 | function hmac_finish(offset, length, output) { | ||
3386 | offset = offset | 0; | ||
3387 | length = length | 0; | ||
3388 | output = output | 0; | ||
3389 | var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, hashed = 0; | ||
3390 | if (offset & 63) return -1; | ||
3391 | if (~output) if (output & 31) return -1; | ||
3392 | hashed = finish(offset, length, -1) | 0; | ||
3393 | t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7; | ||
3394 | _hmac_opad(); | ||
3395 | _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768); | ||
3396 | if (~output) _state_to_heap(output); | ||
3397 | return hashed | 0; | ||
3398 | } | ||
3399 | function pbkdf2_generate_block(offset, length, block, count, output) { | ||
3400 | offset = offset | 0; | ||
3401 | length = length | 0; | ||
3402 | block = block | 0; | ||
3403 | count = count | 0; | ||
3404 | output = output | 0; | ||
3405 | var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0, h7 = 0, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0; | ||
3406 | if (offset & 63) return -1; | ||
3407 | if (~output) if (output & 31) return -1; | ||
3408 | HEAP[offset + length | 0] = block >>> 24; | ||
3409 | HEAP[offset + length + 1 | 0] = block >>> 16 & 255; | ||
3410 | HEAP[offset + length + 2 | 0] = block >>> 8 & 255; | ||
3411 | HEAP[offset + length + 3 | 0] = block & 255; | ||
3412 | hmac_finish(offset, length + 4 | 0, -1) | 0; | ||
3413 | h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5, | ||
3414 | h6 = t6 = H6, h7 = t7 = H7; | ||
3415 | count = count - 1 | 0; | ||
3416 | while ((count | 0) > 0) { | ||
3417 | hmac_reset(); | ||
3418 | _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768); | ||
3419 | t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7; | ||
3420 | _hmac_opad(); | ||
3421 | _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768); | ||
3422 | t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7; | ||
3423 | h0 = h0 ^ H0; | ||
3424 | h1 = h1 ^ H1; | ||
3425 | h2 = h2 ^ H2; | ||
3426 | h3 = h3 ^ H3; | ||
3427 | h4 = h4 ^ H4; | ||
3428 | h5 = h5 ^ H5; | ||
3429 | h6 = h6 ^ H6; | ||
3430 | h7 = h7 ^ H7; | ||
3431 | count = count - 1 | 0; | ||
3432 | } | ||
3433 | H0 = h0; | ||
3434 | H1 = h1; | ||
3435 | H2 = h2; | ||
3436 | H3 = h3; | ||
3437 | H4 = h4; | ||
3438 | H5 = h5; | ||
3439 | H6 = h6; | ||
3440 | H7 = h7; | ||
3441 | if (~output) _state_to_heap(output); | ||
3442 | return 0; | ||
3443 | } | ||
3444 | return { | ||
3445 | reset: reset, | ||
3446 | init: init, | ||
3447 | process: process, | ||
3448 | finish: finish, | ||
3449 | hmac_reset: hmac_reset, | ||
3450 | hmac_init: hmac_init, | ||
3451 | hmac_finish: hmac_finish, | ||
3452 | pbkdf2_generate_block: pbkdf2_generate_block | ||
3453 | }; | ||
3454 | } | ||
3455 | var _sha256_block_size = 64, _sha256_hash_size = 32; | ||
3456 | function sha256_constructor(options) { | ||
3457 | options = options || {}; | ||
3458 | options.heapSize = options.heapSize || 4096; | ||
3459 | if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096"); | ||
3460 | this.heap = options.heap || new Uint8Array(options.heapSize); | ||
3461 | this.asm = options.asm || sha256_asm(global, null, this.heap.buffer); | ||
3462 | this.BLOCK_SIZE = _sha256_block_size; | ||
3463 | this.HASH_SIZE = _sha256_hash_size; | ||
3464 | this.reset(); | ||
3465 | } | ||
3466 | function sha256_reset() { | ||
3467 | this.result = null; | ||
3468 | this.pos = 0; | ||
3469 | this.len = 0; | ||
3470 | this.asm.reset(); | ||
3471 | return this; | ||
3472 | } | ||
3473 | function sha256_process(data) { | ||
3474 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
3475 | var dpos = 0, dlen = 0, clen = 0; | ||
3476 | if (is_buffer(data) || is_bytes(data)) { | ||
3477 | dpos = data.byteOffset || 0; | ||
3478 | dlen = data.byteLength; | ||
3479 | } else if (is_string(data)) { | ||
3480 | dlen = data.length; | ||
3481 | } else { | ||
3482 | throw new TypeError("data isn't of expected type"); | ||
3483 | } | ||
3484 | while (dlen > 0) { | ||
3485 | clen = this.heap.byteLength - this.pos - this.len; | ||
3486 | clen = clen < dlen ? clen : dlen; | ||
3487 | if (is_buffer(data) || is_bytes(data)) { | ||
3488 | this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len); | ||
3489 | } else { | ||
3490 | for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i); | ||
3491 | } | ||
3492 | this.len += clen; | ||
3493 | dpos += clen; | ||
3494 | dlen -= clen; | ||
3495 | clen = this.asm.process(this.pos, this.len); | ||
3496 | if (clen < this.len) { | ||
3497 | this.pos += clen; | ||
3498 | this.len -= clen; | ||
3499 | } else { | ||
3500 | this.pos = 0; | ||
3501 | this.len = 0; | ||
3502 | } | ||
3503 | } | ||
3504 | return this; | ||
3505 | } | ||
3506 | function sha256_finish() { | ||
3507 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
3508 | this.asm.finish(this.pos, this.len, 0); | ||
3509 | this.result = new Uint8Array(_sha256_hash_size); | ||
3510 | this.result.set(this.heap.subarray(0, _sha256_hash_size)); | ||
3511 | this.pos = 0; | ||
3512 | this.len = 0; | ||
3513 | return this; | ||
3514 | } | ||
3515 | sha256_constructor.BLOCK_SIZE = _sha256_block_size; | ||
3516 | sha256_constructor.HASH_SIZE = _sha256_hash_size; | ||
3517 | var sha256_prototype = sha256_constructor.prototype; | ||
3518 | sha256_prototype.reset = sha256_reset; | ||
3519 | sha256_prototype.process = sha256_process; | ||
3520 | sha256_prototype.finish = sha256_finish; | ||
3521 | function sha512_asm(stdlib, foreign, buffer) { | ||
3522 | "use asm"; | ||
3523 | var H0h = 0, H0l = 0, H1h = 0, H1l = 0, H2h = 0, H2l = 0, H3h = 0, H3l = 0, H4h = 0, H4l = 0, H5h = 0, H5l = 0, H6h = 0, H6l = 0, H7h = 0, H7l = 0, TOTAL = 0; | ||
3524 | var I0h = 0, I0l = 0, I1h = 0, I1l = 0, I2h = 0, I2l = 0, I3h = 0, I3l = 0, I4h = 0, I4l = 0, I5h = 0, I5l = 0, I6h = 0, I6l = 0, I7h = 0, I7l = 0, O0h = 0, O0l = 0, O1h = 0, O1l = 0, O2h = 0, O2l = 0, O3h = 0, O3l = 0, O4h = 0, O4l = 0, O5h = 0, O5l = 0, O6h = 0, O6l = 0, O7h = 0, O7l = 0; | ||
3525 | var HEAP = new stdlib.Uint8Array(buffer); | ||
3526 | function _core(w0h, w0l, w1h, w1l, w2h, w2l, w3h, w3l, w4h, w4l, w5h, w5l, w6h, w6l, w7h, w7l, w8h, w8l, w9h, w9l, w10h, w10l, w11h, w11l, w12h, w12l, w13h, w13l, w14h, w14l, w15h, w15l) { | ||
3527 | w0h = w0h | 0; | ||
3528 | w0l = w0l | 0; | ||
3529 | w1h = w1h | 0; | ||
3530 | w1l = w1l | 0; | ||
3531 | w2h = w2h | 0; | ||
3532 | w2l = w2l | 0; | ||
3533 | w3h = w3h | 0; | ||
3534 | w3l = w3l | 0; | ||
3535 | w4h = w4h | 0; | ||
3536 | w4l = w4l | 0; | ||
3537 | w5h = w5h | 0; | ||
3538 | w5l = w5l | 0; | ||
3539 | w6h = w6h | 0; | ||
3540 | w6l = w6l | 0; | ||
3541 | w7h = w7h | 0; | ||
3542 | w7l = w7l | 0; | ||
3543 | w8h = w8h | 0; | ||
3544 | w8l = w8l | 0; | ||
3545 | w9h = w9h | 0; | ||
3546 | w9l = w9l | 0; | ||
3547 | w10h = w10h | 0; | ||
3548 | w10l = w10l | 0; | ||
3549 | w11h = w11h | 0; | ||
3550 | w11l = w11l | 0; | ||
3551 | w12h = w12h | 0; | ||
3552 | w12l = w12l | 0; | ||
3553 | w13h = w13h | 0; | ||
3554 | w13l = w13l | 0; | ||
3555 | w14h = w14h | 0; | ||
3556 | w14l = w14l | 0; | ||
3557 | w15h = w15h | 0; | ||
3558 | w15l = w15l | 0; | ||
3559 | var ah = 0, al = 0, bh = 0, bl = 0, ch = 0, cl = 0, dh = 0, dl = 0, eh = 0, el = 0, fh = 0, fl = 0, gh = 0, gl = 0, hh = 0, hl = 0, th = 0, tl = 0, xl = 0; | ||
3560 | ah = H0h; | ||
3561 | al = H0l; | ||
3562 | bh = H1h; | ||
3563 | bl = H1l; | ||
3564 | ch = H2h; | ||
3565 | cl = H2l; | ||
3566 | dh = H3h; | ||
3567 | dl = H3l; | ||
3568 | eh = H4h; | ||
3569 | el = H4l; | ||
3570 | fh = H5h; | ||
3571 | fl = H5l; | ||
3572 | gh = H6h; | ||
3573 | gl = H6l; | ||
3574 | hh = H7h; | ||
3575 | hl = H7l; | ||
3576 | tl = 3609767458 + w0l | 0; | ||
3577 | th = 1116352408 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
3578 | tl = tl + hl | 0; | ||
3579 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3580 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3581 | tl = tl + xl | 0; | ||
3582 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3583 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3584 | tl = tl + xl | 0; | ||
3585 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3586 | hl = gl; | ||
3587 | hh = gh; | ||
3588 | gl = fl; | ||
3589 | gh = fh; | ||
3590 | fl = el; | ||
3591 | fh = eh; | ||
3592 | el = dl + tl | 0; | ||
3593 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3594 | dl = cl; | ||
3595 | dh = ch; | ||
3596 | cl = bl; | ||
3597 | ch = bh; | ||
3598 | bl = al; | ||
3599 | bh = ah; | ||
3600 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3601 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3602 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3603 | al = al + xl | 0; | ||
3604 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3605 | tl = 602891725 + w1l | 0; | ||
3606 | th = 1899447441 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
3607 | tl = tl + hl | 0; | ||
3608 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3609 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3610 | tl = tl + xl | 0; | ||
3611 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3612 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3613 | tl = tl + xl | 0; | ||
3614 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3615 | hl = gl; | ||
3616 | hh = gh; | ||
3617 | gl = fl; | ||
3618 | gh = fh; | ||
3619 | fl = el; | ||
3620 | fh = eh; | ||
3621 | el = dl + tl | 0; | ||
3622 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3623 | dl = cl; | ||
3624 | dh = ch; | ||
3625 | cl = bl; | ||
3626 | ch = bh; | ||
3627 | bl = al; | ||
3628 | bh = ah; | ||
3629 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3630 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3631 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3632 | al = al + xl | 0; | ||
3633 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3634 | tl = 3964484399 + w2l | 0; | ||
3635 | th = 3049323471 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
3636 | tl = tl + hl | 0; | ||
3637 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3638 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3639 | tl = tl + xl | 0; | ||
3640 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3641 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3642 | tl = tl + xl | 0; | ||
3643 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3644 | hl = gl; | ||
3645 | hh = gh; | ||
3646 | gl = fl; | ||
3647 | gh = fh; | ||
3648 | fl = el; | ||
3649 | fh = eh; | ||
3650 | el = dl + tl | 0; | ||
3651 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3652 | dl = cl; | ||
3653 | dh = ch; | ||
3654 | cl = bl; | ||
3655 | ch = bh; | ||
3656 | bl = al; | ||
3657 | bh = ah; | ||
3658 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3659 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3660 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3661 | al = al + xl | 0; | ||
3662 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3663 | tl = 2173295548 + w3l | 0; | ||
3664 | th = 3921009573 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
3665 | tl = tl + hl | 0; | ||
3666 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3667 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3668 | tl = tl + xl | 0; | ||
3669 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3670 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3671 | tl = tl + xl | 0; | ||
3672 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3673 | hl = gl; | ||
3674 | hh = gh; | ||
3675 | gl = fl; | ||
3676 | gh = fh; | ||
3677 | fl = el; | ||
3678 | fh = eh; | ||
3679 | el = dl + tl | 0; | ||
3680 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3681 | dl = cl; | ||
3682 | dh = ch; | ||
3683 | cl = bl; | ||
3684 | ch = bh; | ||
3685 | bl = al; | ||
3686 | bh = ah; | ||
3687 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3688 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3689 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3690 | al = al + xl | 0; | ||
3691 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3692 | tl = 4081628472 + w4l | 0; | ||
3693 | th = 961987163 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
3694 | tl = tl + hl | 0; | ||
3695 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3696 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3697 | tl = tl + xl | 0; | ||
3698 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3699 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3700 | tl = tl + xl | 0; | ||
3701 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3702 | hl = gl; | ||
3703 | hh = gh; | ||
3704 | gl = fl; | ||
3705 | gh = fh; | ||
3706 | fl = el; | ||
3707 | fh = eh; | ||
3708 | el = dl + tl | 0; | ||
3709 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3710 | dl = cl; | ||
3711 | dh = ch; | ||
3712 | cl = bl; | ||
3713 | ch = bh; | ||
3714 | bl = al; | ||
3715 | bh = ah; | ||
3716 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3717 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3718 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3719 | al = al + xl | 0; | ||
3720 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3721 | tl = 3053834265 + w5l | 0; | ||
3722 | th = 1508970993 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
3723 | tl = tl + hl | 0; | ||
3724 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3725 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3726 | tl = tl + xl | 0; | ||
3727 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3728 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3729 | tl = tl + xl | 0; | ||
3730 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3731 | hl = gl; | ||
3732 | hh = gh; | ||
3733 | gl = fl; | ||
3734 | gh = fh; | ||
3735 | fl = el; | ||
3736 | fh = eh; | ||
3737 | el = dl + tl | 0; | ||
3738 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3739 | dl = cl; | ||
3740 | dh = ch; | ||
3741 | cl = bl; | ||
3742 | ch = bh; | ||
3743 | bl = al; | ||
3744 | bh = ah; | ||
3745 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3746 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3747 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3748 | al = al + xl | 0; | ||
3749 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3750 | tl = 2937671579 + w6l | 0; | ||
3751 | th = 2453635748 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
3752 | tl = tl + hl | 0; | ||
3753 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3754 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3755 | tl = tl + xl | 0; | ||
3756 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3757 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3758 | tl = tl + xl | 0; | ||
3759 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3760 | hl = gl; | ||
3761 | hh = gh; | ||
3762 | gl = fl; | ||
3763 | gh = fh; | ||
3764 | fl = el; | ||
3765 | fh = eh; | ||
3766 | el = dl + tl | 0; | ||
3767 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3768 | dl = cl; | ||
3769 | dh = ch; | ||
3770 | cl = bl; | ||
3771 | ch = bh; | ||
3772 | bl = al; | ||
3773 | bh = ah; | ||
3774 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3775 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3776 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3777 | al = al + xl | 0; | ||
3778 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3779 | tl = 3664609560 + w7l | 0; | ||
3780 | th = 2870763221 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
3781 | tl = tl + hl | 0; | ||
3782 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3783 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3784 | tl = tl + xl | 0; | ||
3785 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3786 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3787 | tl = tl + xl | 0; | ||
3788 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3789 | hl = gl; | ||
3790 | hh = gh; | ||
3791 | gl = fl; | ||
3792 | gh = fh; | ||
3793 | fl = el; | ||
3794 | fh = eh; | ||
3795 | el = dl + tl | 0; | ||
3796 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3797 | dl = cl; | ||
3798 | dh = ch; | ||
3799 | cl = bl; | ||
3800 | ch = bh; | ||
3801 | bl = al; | ||
3802 | bh = ah; | ||
3803 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3804 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3805 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3806 | al = al + xl | 0; | ||
3807 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3808 | tl = 2734883394 + w8l | 0; | ||
3809 | th = 3624381080 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
3810 | tl = tl + hl | 0; | ||
3811 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3812 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3813 | tl = tl + xl | 0; | ||
3814 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3815 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3816 | tl = tl + xl | 0; | ||
3817 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3818 | hl = gl; | ||
3819 | hh = gh; | ||
3820 | gl = fl; | ||
3821 | gh = fh; | ||
3822 | fl = el; | ||
3823 | fh = eh; | ||
3824 | el = dl + tl | 0; | ||
3825 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3826 | dl = cl; | ||
3827 | dh = ch; | ||
3828 | cl = bl; | ||
3829 | ch = bh; | ||
3830 | bl = al; | ||
3831 | bh = ah; | ||
3832 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3833 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3834 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3835 | al = al + xl | 0; | ||
3836 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3837 | tl = 1164996542 + w9l | 0; | ||
3838 | th = 310598401 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
3839 | tl = tl + hl | 0; | ||
3840 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3841 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3842 | tl = tl + xl | 0; | ||
3843 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3844 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3845 | tl = tl + xl | 0; | ||
3846 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3847 | hl = gl; | ||
3848 | hh = gh; | ||
3849 | gl = fl; | ||
3850 | gh = fh; | ||
3851 | fl = el; | ||
3852 | fh = eh; | ||
3853 | el = dl + tl | 0; | ||
3854 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3855 | dl = cl; | ||
3856 | dh = ch; | ||
3857 | cl = bl; | ||
3858 | ch = bh; | ||
3859 | bl = al; | ||
3860 | bh = ah; | ||
3861 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3862 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3863 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3864 | al = al + xl | 0; | ||
3865 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3866 | tl = 1323610764 + w10l | 0; | ||
3867 | th = 607225278 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
3868 | tl = tl + hl | 0; | ||
3869 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3870 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3871 | tl = tl + xl | 0; | ||
3872 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3873 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3874 | tl = tl + xl | 0; | ||
3875 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3876 | hl = gl; | ||
3877 | hh = gh; | ||
3878 | gl = fl; | ||
3879 | gh = fh; | ||
3880 | fl = el; | ||
3881 | fh = eh; | ||
3882 | el = dl + tl | 0; | ||
3883 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3884 | dl = cl; | ||
3885 | dh = ch; | ||
3886 | cl = bl; | ||
3887 | ch = bh; | ||
3888 | bl = al; | ||
3889 | bh = ah; | ||
3890 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3891 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3892 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3893 | al = al + xl | 0; | ||
3894 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3895 | tl = 3590304994 + w11l | 0; | ||
3896 | th = 1426881987 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
3897 | tl = tl + hl | 0; | ||
3898 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3899 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3900 | tl = tl + xl | 0; | ||
3901 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3902 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3903 | tl = tl + xl | 0; | ||
3904 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3905 | hl = gl; | ||
3906 | hh = gh; | ||
3907 | gl = fl; | ||
3908 | gh = fh; | ||
3909 | fl = el; | ||
3910 | fh = eh; | ||
3911 | el = dl + tl | 0; | ||
3912 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3913 | dl = cl; | ||
3914 | dh = ch; | ||
3915 | cl = bl; | ||
3916 | ch = bh; | ||
3917 | bl = al; | ||
3918 | bh = ah; | ||
3919 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3920 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3921 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3922 | al = al + xl | 0; | ||
3923 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3924 | tl = 4068182383 + w12l | 0; | ||
3925 | th = 1925078388 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
3926 | tl = tl + hl | 0; | ||
3927 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3928 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3929 | tl = tl + xl | 0; | ||
3930 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3931 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3932 | tl = tl + xl | 0; | ||
3933 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3934 | hl = gl; | ||
3935 | hh = gh; | ||
3936 | gl = fl; | ||
3937 | gh = fh; | ||
3938 | fl = el; | ||
3939 | fh = eh; | ||
3940 | el = dl + tl | 0; | ||
3941 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3942 | dl = cl; | ||
3943 | dh = ch; | ||
3944 | cl = bl; | ||
3945 | ch = bh; | ||
3946 | bl = al; | ||
3947 | bh = ah; | ||
3948 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3949 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3950 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3951 | al = al + xl | 0; | ||
3952 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3953 | tl = 991336113 + w13l | 0; | ||
3954 | th = 2162078206 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
3955 | tl = tl + hl | 0; | ||
3956 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3957 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3958 | tl = tl + xl | 0; | ||
3959 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3960 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3961 | tl = tl + xl | 0; | ||
3962 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3963 | hl = gl; | ||
3964 | hh = gh; | ||
3965 | gl = fl; | ||
3966 | gh = fh; | ||
3967 | fl = el; | ||
3968 | fh = eh; | ||
3969 | el = dl + tl | 0; | ||
3970 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
3971 | dl = cl; | ||
3972 | dh = ch; | ||
3973 | cl = bl; | ||
3974 | ch = bh; | ||
3975 | bl = al; | ||
3976 | bh = ah; | ||
3977 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
3978 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
3979 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
3980 | al = al + xl | 0; | ||
3981 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3982 | tl = 633803317 + w14l | 0; | ||
3983 | th = 2614888103 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
3984 | tl = tl + hl | 0; | ||
3985 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
3986 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
3987 | tl = tl + xl | 0; | ||
3988 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3989 | xl = gl ^ el & (fl ^ gl) | 0; | ||
3990 | tl = tl + xl | 0; | ||
3991 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
3992 | hl = gl; | ||
3993 | hh = gh; | ||
3994 | gl = fl; | ||
3995 | gh = fh; | ||
3996 | fl = el; | ||
3997 | fh = eh; | ||
3998 | el = dl + tl | 0; | ||
3999 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4000 | dl = cl; | ||
4001 | dh = ch; | ||
4002 | cl = bl; | ||
4003 | ch = bh; | ||
4004 | bl = al; | ||
4005 | bh = ah; | ||
4006 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4007 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4008 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4009 | al = al + xl | 0; | ||
4010 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4011 | tl = 3479774868 + w15l | 0; | ||
4012 | th = 3248222580 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
4013 | tl = tl + hl | 0; | ||
4014 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4015 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4016 | tl = tl + xl | 0; | ||
4017 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4018 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4019 | tl = tl + xl | 0; | ||
4020 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4021 | hl = gl; | ||
4022 | hh = gh; | ||
4023 | gl = fl; | ||
4024 | gh = fh; | ||
4025 | fl = el; | ||
4026 | fh = eh; | ||
4027 | el = dl + tl | 0; | ||
4028 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4029 | dl = cl; | ||
4030 | dh = ch; | ||
4031 | cl = bl; | ||
4032 | ch = bh; | ||
4033 | bl = al; | ||
4034 | bh = ah; | ||
4035 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4036 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4037 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4038 | al = al + xl | 0; | ||
4039 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4040 | w0l = w0l + w9l | 0; | ||
4041 | w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
4042 | xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0; | ||
4043 | w0l = w0l + xl | 0; | ||
4044 | w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4045 | xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0; | ||
4046 | w0l = w0l + xl | 0; | ||
4047 | w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4048 | tl = 2666613458 + w0l | 0; | ||
4049 | th = 3835390401 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
4050 | tl = tl + hl | 0; | ||
4051 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4052 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4053 | tl = tl + xl | 0; | ||
4054 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4055 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4056 | tl = tl + xl | 0; | ||
4057 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4058 | hl = gl; | ||
4059 | hh = gh; | ||
4060 | gl = fl; | ||
4061 | gh = fh; | ||
4062 | fl = el; | ||
4063 | fh = eh; | ||
4064 | el = dl + tl | 0; | ||
4065 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4066 | dl = cl; | ||
4067 | dh = ch; | ||
4068 | cl = bl; | ||
4069 | ch = bh; | ||
4070 | bl = al; | ||
4071 | bh = ah; | ||
4072 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4073 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4074 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4075 | al = al + xl | 0; | ||
4076 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4077 | w1l = w1l + w10l | 0; | ||
4078 | w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
4079 | xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0; | ||
4080 | w1l = w1l + xl | 0; | ||
4081 | w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4082 | xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0; | ||
4083 | w1l = w1l + xl | 0; | ||
4084 | w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4085 | tl = 944711139 + w1l | 0; | ||
4086 | th = 4022224774 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
4087 | tl = tl + hl | 0; | ||
4088 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4089 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4090 | tl = tl + xl | 0; | ||
4091 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4092 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4093 | tl = tl + xl | 0; | ||
4094 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4095 | hl = gl; | ||
4096 | hh = gh; | ||
4097 | gl = fl; | ||
4098 | gh = fh; | ||
4099 | fl = el; | ||
4100 | fh = eh; | ||
4101 | el = dl + tl | 0; | ||
4102 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4103 | dl = cl; | ||
4104 | dh = ch; | ||
4105 | cl = bl; | ||
4106 | ch = bh; | ||
4107 | bl = al; | ||
4108 | bh = ah; | ||
4109 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4110 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4111 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4112 | al = al + xl | 0; | ||
4113 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4114 | w2l = w2l + w11l | 0; | ||
4115 | w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
4116 | xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0; | ||
4117 | w2l = w2l + xl | 0; | ||
4118 | w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4119 | xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0; | ||
4120 | w2l = w2l + xl | 0; | ||
4121 | w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4122 | tl = 2341262773 + w2l | 0; | ||
4123 | th = 264347078 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
4124 | tl = tl + hl | 0; | ||
4125 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4126 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4127 | tl = tl + xl | 0; | ||
4128 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4129 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4130 | tl = tl + xl | 0; | ||
4131 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4132 | hl = gl; | ||
4133 | hh = gh; | ||
4134 | gl = fl; | ||
4135 | gh = fh; | ||
4136 | fl = el; | ||
4137 | fh = eh; | ||
4138 | el = dl + tl | 0; | ||
4139 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4140 | dl = cl; | ||
4141 | dh = ch; | ||
4142 | cl = bl; | ||
4143 | ch = bh; | ||
4144 | bl = al; | ||
4145 | bh = ah; | ||
4146 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4147 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4148 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4149 | al = al + xl | 0; | ||
4150 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4151 | w3l = w3l + w12l | 0; | ||
4152 | w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
4153 | xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0; | ||
4154 | w3l = w3l + xl | 0; | ||
4155 | w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4156 | xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0; | ||
4157 | w3l = w3l + xl | 0; | ||
4158 | w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4159 | tl = 2007800933 + w3l | 0; | ||
4160 | th = 604807628 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
4161 | tl = tl + hl | 0; | ||
4162 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4163 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4164 | tl = tl + xl | 0; | ||
4165 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4166 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4167 | tl = tl + xl | 0; | ||
4168 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4169 | hl = gl; | ||
4170 | hh = gh; | ||
4171 | gl = fl; | ||
4172 | gh = fh; | ||
4173 | fl = el; | ||
4174 | fh = eh; | ||
4175 | el = dl + tl | 0; | ||
4176 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4177 | dl = cl; | ||
4178 | dh = ch; | ||
4179 | cl = bl; | ||
4180 | ch = bh; | ||
4181 | bl = al; | ||
4182 | bh = ah; | ||
4183 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4184 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4185 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4186 | al = al + xl | 0; | ||
4187 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4188 | w4l = w4l + w13l | 0; | ||
4189 | w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
4190 | xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0; | ||
4191 | w4l = w4l + xl | 0; | ||
4192 | w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4193 | xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0; | ||
4194 | w4l = w4l + xl | 0; | ||
4195 | w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4196 | tl = 1495990901 + w4l | 0; | ||
4197 | th = 770255983 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
4198 | tl = tl + hl | 0; | ||
4199 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4200 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4201 | tl = tl + xl | 0; | ||
4202 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4203 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4204 | tl = tl + xl | 0; | ||
4205 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4206 | hl = gl; | ||
4207 | hh = gh; | ||
4208 | gl = fl; | ||
4209 | gh = fh; | ||
4210 | fl = el; | ||
4211 | fh = eh; | ||
4212 | el = dl + tl | 0; | ||
4213 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4214 | dl = cl; | ||
4215 | dh = ch; | ||
4216 | cl = bl; | ||
4217 | ch = bh; | ||
4218 | bl = al; | ||
4219 | bh = ah; | ||
4220 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4221 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4222 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4223 | al = al + xl | 0; | ||
4224 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4225 | w5l = w5l + w14l | 0; | ||
4226 | w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
4227 | xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0; | ||
4228 | w5l = w5l + xl | 0; | ||
4229 | w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4230 | xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0; | ||
4231 | w5l = w5l + xl | 0; | ||
4232 | w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4233 | tl = 1856431235 + w5l | 0; | ||
4234 | th = 1249150122 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
4235 | tl = tl + hl | 0; | ||
4236 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4237 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4238 | tl = tl + xl | 0; | ||
4239 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4240 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4241 | tl = tl + xl | 0; | ||
4242 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4243 | hl = gl; | ||
4244 | hh = gh; | ||
4245 | gl = fl; | ||
4246 | gh = fh; | ||
4247 | fl = el; | ||
4248 | fh = eh; | ||
4249 | el = dl + tl | 0; | ||
4250 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4251 | dl = cl; | ||
4252 | dh = ch; | ||
4253 | cl = bl; | ||
4254 | ch = bh; | ||
4255 | bl = al; | ||
4256 | bh = ah; | ||
4257 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4258 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4259 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4260 | al = al + xl | 0; | ||
4261 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4262 | w6l = w6l + w15l | 0; | ||
4263 | w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
4264 | xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0; | ||
4265 | w6l = w6l + xl | 0; | ||
4266 | w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4267 | xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0; | ||
4268 | w6l = w6l + xl | 0; | ||
4269 | w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4270 | tl = 3175218132 + w6l | 0; | ||
4271 | th = 1555081692 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
4272 | tl = tl + hl | 0; | ||
4273 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4274 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4275 | tl = tl + xl | 0; | ||
4276 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4277 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4278 | tl = tl + xl | 0; | ||
4279 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4280 | hl = gl; | ||
4281 | hh = gh; | ||
4282 | gl = fl; | ||
4283 | gh = fh; | ||
4284 | fl = el; | ||
4285 | fh = eh; | ||
4286 | el = dl + tl | 0; | ||
4287 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4288 | dl = cl; | ||
4289 | dh = ch; | ||
4290 | cl = bl; | ||
4291 | ch = bh; | ||
4292 | bl = al; | ||
4293 | bh = ah; | ||
4294 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4295 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4296 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4297 | al = al + xl | 0; | ||
4298 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4299 | w7l = w7l + w0l | 0; | ||
4300 | w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
4301 | xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0; | ||
4302 | w7l = w7l + xl | 0; | ||
4303 | w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4304 | xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0; | ||
4305 | w7l = w7l + xl | 0; | ||
4306 | w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4307 | tl = 2198950837 + w7l | 0; | ||
4308 | th = 1996064986 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
4309 | tl = tl + hl | 0; | ||
4310 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4311 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4312 | tl = tl + xl | 0; | ||
4313 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4314 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4315 | tl = tl + xl | 0; | ||
4316 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4317 | hl = gl; | ||
4318 | hh = gh; | ||
4319 | gl = fl; | ||
4320 | gh = fh; | ||
4321 | fl = el; | ||
4322 | fh = eh; | ||
4323 | el = dl + tl | 0; | ||
4324 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4325 | dl = cl; | ||
4326 | dh = ch; | ||
4327 | cl = bl; | ||
4328 | ch = bh; | ||
4329 | bl = al; | ||
4330 | bh = ah; | ||
4331 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4332 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4333 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4334 | al = al + xl | 0; | ||
4335 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4336 | w8l = w8l + w1l | 0; | ||
4337 | w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
4338 | xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0; | ||
4339 | w8l = w8l + xl | 0; | ||
4340 | w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4341 | xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0; | ||
4342 | w8l = w8l + xl | 0; | ||
4343 | w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4344 | tl = 3999719339 + w8l | 0; | ||
4345 | th = 2554220882 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
4346 | tl = tl + hl | 0; | ||
4347 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4348 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4349 | tl = tl + xl | 0; | ||
4350 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4351 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4352 | tl = tl + xl | 0; | ||
4353 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4354 | hl = gl; | ||
4355 | hh = gh; | ||
4356 | gl = fl; | ||
4357 | gh = fh; | ||
4358 | fl = el; | ||
4359 | fh = eh; | ||
4360 | el = dl + tl | 0; | ||
4361 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4362 | dl = cl; | ||
4363 | dh = ch; | ||
4364 | cl = bl; | ||
4365 | ch = bh; | ||
4366 | bl = al; | ||
4367 | bh = ah; | ||
4368 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4369 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4370 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4371 | al = al + xl | 0; | ||
4372 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4373 | w9l = w9l + w2l | 0; | ||
4374 | w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
4375 | xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0; | ||
4376 | w9l = w9l + xl | 0; | ||
4377 | w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4378 | xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0; | ||
4379 | w9l = w9l + xl | 0; | ||
4380 | w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4381 | tl = 766784016 + w9l | 0; | ||
4382 | th = 2821834349 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
4383 | tl = tl + hl | 0; | ||
4384 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4385 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4386 | tl = tl + xl | 0; | ||
4387 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4388 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4389 | tl = tl + xl | 0; | ||
4390 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4391 | hl = gl; | ||
4392 | hh = gh; | ||
4393 | gl = fl; | ||
4394 | gh = fh; | ||
4395 | fl = el; | ||
4396 | fh = eh; | ||
4397 | el = dl + tl | 0; | ||
4398 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4399 | dl = cl; | ||
4400 | dh = ch; | ||
4401 | cl = bl; | ||
4402 | ch = bh; | ||
4403 | bl = al; | ||
4404 | bh = ah; | ||
4405 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4406 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4407 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4408 | al = al + xl | 0; | ||
4409 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4410 | w10l = w10l + w3l | 0; | ||
4411 | w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
4412 | xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0; | ||
4413 | w10l = w10l + xl | 0; | ||
4414 | w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4415 | xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0; | ||
4416 | w10l = w10l + xl | 0; | ||
4417 | w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4418 | tl = 2566594879 + w10l | 0; | ||
4419 | th = 2952996808 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
4420 | tl = tl + hl | 0; | ||
4421 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4422 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4423 | tl = tl + xl | 0; | ||
4424 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4425 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4426 | tl = tl + xl | 0; | ||
4427 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4428 | hl = gl; | ||
4429 | hh = gh; | ||
4430 | gl = fl; | ||
4431 | gh = fh; | ||
4432 | fl = el; | ||
4433 | fh = eh; | ||
4434 | el = dl + tl | 0; | ||
4435 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4436 | dl = cl; | ||
4437 | dh = ch; | ||
4438 | cl = bl; | ||
4439 | ch = bh; | ||
4440 | bl = al; | ||
4441 | bh = ah; | ||
4442 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4443 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4444 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4445 | al = al + xl | 0; | ||
4446 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4447 | w11l = w11l + w4l | 0; | ||
4448 | w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
4449 | xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0; | ||
4450 | w11l = w11l + xl | 0; | ||
4451 | w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4452 | xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0; | ||
4453 | w11l = w11l + xl | 0; | ||
4454 | w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4455 | tl = 3203337956 + w11l | 0; | ||
4456 | th = 3210313671 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
4457 | tl = tl + hl | 0; | ||
4458 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4459 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4460 | tl = tl + xl | 0; | ||
4461 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4462 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4463 | tl = tl + xl | 0; | ||
4464 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4465 | hl = gl; | ||
4466 | hh = gh; | ||
4467 | gl = fl; | ||
4468 | gh = fh; | ||
4469 | fl = el; | ||
4470 | fh = eh; | ||
4471 | el = dl + tl | 0; | ||
4472 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4473 | dl = cl; | ||
4474 | dh = ch; | ||
4475 | cl = bl; | ||
4476 | ch = bh; | ||
4477 | bl = al; | ||
4478 | bh = ah; | ||
4479 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4480 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4481 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4482 | al = al + xl | 0; | ||
4483 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4484 | w12l = w12l + w5l | 0; | ||
4485 | w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
4486 | xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0; | ||
4487 | w12l = w12l + xl | 0; | ||
4488 | w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4489 | xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0; | ||
4490 | w12l = w12l + xl | 0; | ||
4491 | w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4492 | tl = 1034457026 + w12l | 0; | ||
4493 | th = 3336571891 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
4494 | tl = tl + hl | 0; | ||
4495 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4496 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4497 | tl = tl + xl | 0; | ||
4498 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4499 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4500 | tl = tl + xl | 0; | ||
4501 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4502 | hl = gl; | ||
4503 | hh = gh; | ||
4504 | gl = fl; | ||
4505 | gh = fh; | ||
4506 | fl = el; | ||
4507 | fh = eh; | ||
4508 | el = dl + tl | 0; | ||
4509 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4510 | dl = cl; | ||
4511 | dh = ch; | ||
4512 | cl = bl; | ||
4513 | ch = bh; | ||
4514 | bl = al; | ||
4515 | bh = ah; | ||
4516 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4517 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4518 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4519 | al = al + xl | 0; | ||
4520 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4521 | w13l = w13l + w6l | 0; | ||
4522 | w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
4523 | xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0; | ||
4524 | w13l = w13l + xl | 0; | ||
4525 | w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4526 | xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0; | ||
4527 | w13l = w13l + xl | 0; | ||
4528 | w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4529 | tl = 2466948901 + w13l | 0; | ||
4530 | th = 3584528711 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
4531 | tl = tl + hl | 0; | ||
4532 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4533 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4534 | tl = tl + xl | 0; | ||
4535 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4536 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4537 | tl = tl + xl | 0; | ||
4538 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4539 | hl = gl; | ||
4540 | hh = gh; | ||
4541 | gl = fl; | ||
4542 | gh = fh; | ||
4543 | fl = el; | ||
4544 | fh = eh; | ||
4545 | el = dl + tl | 0; | ||
4546 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4547 | dl = cl; | ||
4548 | dh = ch; | ||
4549 | cl = bl; | ||
4550 | ch = bh; | ||
4551 | bl = al; | ||
4552 | bh = ah; | ||
4553 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4554 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4555 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4556 | al = al + xl | 0; | ||
4557 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4558 | w14l = w14l + w7l | 0; | ||
4559 | w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
4560 | xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0; | ||
4561 | w14l = w14l + xl | 0; | ||
4562 | w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4563 | xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0; | ||
4564 | w14l = w14l + xl | 0; | ||
4565 | w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4566 | tl = 3758326383 + w14l | 0; | ||
4567 | th = 113926993 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
4568 | tl = tl + hl | 0; | ||
4569 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4570 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4571 | tl = tl + xl | 0; | ||
4572 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4573 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4574 | tl = tl + xl | 0; | ||
4575 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4576 | hl = gl; | ||
4577 | hh = gh; | ||
4578 | gl = fl; | ||
4579 | gh = fh; | ||
4580 | fl = el; | ||
4581 | fh = eh; | ||
4582 | el = dl + tl | 0; | ||
4583 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4584 | dl = cl; | ||
4585 | dh = ch; | ||
4586 | cl = bl; | ||
4587 | ch = bh; | ||
4588 | bl = al; | ||
4589 | bh = ah; | ||
4590 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4591 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4592 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4593 | al = al + xl | 0; | ||
4594 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4595 | w15l = w15l + w8l | 0; | ||
4596 | w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
4597 | xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0; | ||
4598 | w15l = w15l + xl | 0; | ||
4599 | w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4600 | xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0; | ||
4601 | w15l = w15l + xl | 0; | ||
4602 | w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4603 | tl = 168717936 + w15l | 0; | ||
4604 | th = 338241895 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
4605 | tl = tl + hl | 0; | ||
4606 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4607 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4608 | tl = tl + xl | 0; | ||
4609 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4610 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4611 | tl = tl + xl | 0; | ||
4612 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4613 | hl = gl; | ||
4614 | hh = gh; | ||
4615 | gl = fl; | ||
4616 | gh = fh; | ||
4617 | fl = el; | ||
4618 | fh = eh; | ||
4619 | el = dl + tl | 0; | ||
4620 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4621 | dl = cl; | ||
4622 | dh = ch; | ||
4623 | cl = bl; | ||
4624 | ch = bh; | ||
4625 | bl = al; | ||
4626 | bh = ah; | ||
4627 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4628 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4629 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4630 | al = al + xl | 0; | ||
4631 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4632 | w0l = w0l + w9l | 0; | ||
4633 | w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
4634 | xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0; | ||
4635 | w0l = w0l + xl | 0; | ||
4636 | w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4637 | xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0; | ||
4638 | w0l = w0l + xl | 0; | ||
4639 | w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4640 | tl = 1188179964 + w0l | 0; | ||
4641 | th = 666307205 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
4642 | tl = tl + hl | 0; | ||
4643 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4644 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4645 | tl = tl + xl | 0; | ||
4646 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4647 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4648 | tl = tl + xl | 0; | ||
4649 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4650 | hl = gl; | ||
4651 | hh = gh; | ||
4652 | gl = fl; | ||
4653 | gh = fh; | ||
4654 | fl = el; | ||
4655 | fh = eh; | ||
4656 | el = dl + tl | 0; | ||
4657 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4658 | dl = cl; | ||
4659 | dh = ch; | ||
4660 | cl = bl; | ||
4661 | ch = bh; | ||
4662 | bl = al; | ||
4663 | bh = ah; | ||
4664 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4665 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4666 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4667 | al = al + xl | 0; | ||
4668 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4669 | w1l = w1l + w10l | 0; | ||
4670 | w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
4671 | xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0; | ||
4672 | w1l = w1l + xl | 0; | ||
4673 | w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4674 | xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0; | ||
4675 | w1l = w1l + xl | 0; | ||
4676 | w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4677 | tl = 1546045734 + w1l | 0; | ||
4678 | th = 773529912 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
4679 | tl = tl + hl | 0; | ||
4680 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4681 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4682 | tl = tl + xl | 0; | ||
4683 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4684 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4685 | tl = tl + xl | 0; | ||
4686 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4687 | hl = gl; | ||
4688 | hh = gh; | ||
4689 | gl = fl; | ||
4690 | gh = fh; | ||
4691 | fl = el; | ||
4692 | fh = eh; | ||
4693 | el = dl + tl | 0; | ||
4694 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4695 | dl = cl; | ||
4696 | dh = ch; | ||
4697 | cl = bl; | ||
4698 | ch = bh; | ||
4699 | bl = al; | ||
4700 | bh = ah; | ||
4701 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4702 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4703 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4704 | al = al + xl | 0; | ||
4705 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4706 | w2l = w2l + w11l | 0; | ||
4707 | w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
4708 | xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0; | ||
4709 | w2l = w2l + xl | 0; | ||
4710 | w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4711 | xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0; | ||
4712 | w2l = w2l + xl | 0; | ||
4713 | w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4714 | tl = 1522805485 + w2l | 0; | ||
4715 | th = 1294757372 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
4716 | tl = tl + hl | 0; | ||
4717 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4718 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4719 | tl = tl + xl | 0; | ||
4720 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4721 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4722 | tl = tl + xl | 0; | ||
4723 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4724 | hl = gl; | ||
4725 | hh = gh; | ||
4726 | gl = fl; | ||
4727 | gh = fh; | ||
4728 | fl = el; | ||
4729 | fh = eh; | ||
4730 | el = dl + tl | 0; | ||
4731 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4732 | dl = cl; | ||
4733 | dh = ch; | ||
4734 | cl = bl; | ||
4735 | ch = bh; | ||
4736 | bl = al; | ||
4737 | bh = ah; | ||
4738 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4739 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4740 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4741 | al = al + xl | 0; | ||
4742 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4743 | w3l = w3l + w12l | 0; | ||
4744 | w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
4745 | xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0; | ||
4746 | w3l = w3l + xl | 0; | ||
4747 | w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4748 | xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0; | ||
4749 | w3l = w3l + xl | 0; | ||
4750 | w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4751 | tl = 2643833823 + w3l | 0; | ||
4752 | th = 1396182291 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
4753 | tl = tl + hl | 0; | ||
4754 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4755 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4756 | tl = tl + xl | 0; | ||
4757 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4758 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4759 | tl = tl + xl | 0; | ||
4760 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4761 | hl = gl; | ||
4762 | hh = gh; | ||
4763 | gl = fl; | ||
4764 | gh = fh; | ||
4765 | fl = el; | ||
4766 | fh = eh; | ||
4767 | el = dl + tl | 0; | ||
4768 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4769 | dl = cl; | ||
4770 | dh = ch; | ||
4771 | cl = bl; | ||
4772 | ch = bh; | ||
4773 | bl = al; | ||
4774 | bh = ah; | ||
4775 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4776 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4777 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4778 | al = al + xl | 0; | ||
4779 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4780 | w4l = w4l + w13l | 0; | ||
4781 | w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
4782 | xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0; | ||
4783 | w4l = w4l + xl | 0; | ||
4784 | w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4785 | xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0; | ||
4786 | w4l = w4l + xl | 0; | ||
4787 | w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4788 | tl = 2343527390 + w4l | 0; | ||
4789 | th = 1695183700 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
4790 | tl = tl + hl | 0; | ||
4791 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4792 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4793 | tl = tl + xl | 0; | ||
4794 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4795 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4796 | tl = tl + xl | 0; | ||
4797 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4798 | hl = gl; | ||
4799 | hh = gh; | ||
4800 | gl = fl; | ||
4801 | gh = fh; | ||
4802 | fl = el; | ||
4803 | fh = eh; | ||
4804 | el = dl + tl | 0; | ||
4805 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4806 | dl = cl; | ||
4807 | dh = ch; | ||
4808 | cl = bl; | ||
4809 | ch = bh; | ||
4810 | bl = al; | ||
4811 | bh = ah; | ||
4812 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4813 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4814 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4815 | al = al + xl | 0; | ||
4816 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4817 | w5l = w5l + w14l | 0; | ||
4818 | w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
4819 | xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0; | ||
4820 | w5l = w5l + xl | 0; | ||
4821 | w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4822 | xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0; | ||
4823 | w5l = w5l + xl | 0; | ||
4824 | w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4825 | tl = 1014477480 + w5l | 0; | ||
4826 | th = 1986661051 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
4827 | tl = tl + hl | 0; | ||
4828 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4829 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4830 | tl = tl + xl | 0; | ||
4831 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4832 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4833 | tl = tl + xl | 0; | ||
4834 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4835 | hl = gl; | ||
4836 | hh = gh; | ||
4837 | gl = fl; | ||
4838 | gh = fh; | ||
4839 | fl = el; | ||
4840 | fh = eh; | ||
4841 | el = dl + tl | 0; | ||
4842 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4843 | dl = cl; | ||
4844 | dh = ch; | ||
4845 | cl = bl; | ||
4846 | ch = bh; | ||
4847 | bl = al; | ||
4848 | bh = ah; | ||
4849 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4850 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4851 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4852 | al = al + xl | 0; | ||
4853 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4854 | w6l = w6l + w15l | 0; | ||
4855 | w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
4856 | xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0; | ||
4857 | w6l = w6l + xl | 0; | ||
4858 | w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4859 | xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0; | ||
4860 | w6l = w6l + xl | 0; | ||
4861 | w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4862 | tl = 1206759142 + w6l | 0; | ||
4863 | th = 2177026350 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
4864 | tl = tl + hl | 0; | ||
4865 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4866 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4867 | tl = tl + xl | 0; | ||
4868 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4869 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4870 | tl = tl + xl | 0; | ||
4871 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4872 | hl = gl; | ||
4873 | hh = gh; | ||
4874 | gl = fl; | ||
4875 | gh = fh; | ||
4876 | fl = el; | ||
4877 | fh = eh; | ||
4878 | el = dl + tl | 0; | ||
4879 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4880 | dl = cl; | ||
4881 | dh = ch; | ||
4882 | cl = bl; | ||
4883 | ch = bh; | ||
4884 | bl = al; | ||
4885 | bh = ah; | ||
4886 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4887 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4888 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4889 | al = al + xl | 0; | ||
4890 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4891 | w7l = w7l + w0l | 0; | ||
4892 | w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
4893 | xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0; | ||
4894 | w7l = w7l + xl | 0; | ||
4895 | w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4896 | xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0; | ||
4897 | w7l = w7l + xl | 0; | ||
4898 | w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4899 | tl = 344077627 + w7l | 0; | ||
4900 | th = 2456956037 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
4901 | tl = tl + hl | 0; | ||
4902 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4903 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4904 | tl = tl + xl | 0; | ||
4905 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4906 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4907 | tl = tl + xl | 0; | ||
4908 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4909 | hl = gl; | ||
4910 | hh = gh; | ||
4911 | gl = fl; | ||
4912 | gh = fh; | ||
4913 | fl = el; | ||
4914 | fh = eh; | ||
4915 | el = dl + tl | 0; | ||
4916 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4917 | dl = cl; | ||
4918 | dh = ch; | ||
4919 | cl = bl; | ||
4920 | ch = bh; | ||
4921 | bl = al; | ||
4922 | bh = ah; | ||
4923 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4924 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4925 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4926 | al = al + xl | 0; | ||
4927 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4928 | w8l = w8l + w1l | 0; | ||
4929 | w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
4930 | xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0; | ||
4931 | w8l = w8l + xl | 0; | ||
4932 | w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4933 | xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0; | ||
4934 | w8l = w8l + xl | 0; | ||
4935 | w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4936 | tl = 1290863460 + w8l | 0; | ||
4937 | th = 2730485921 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
4938 | tl = tl + hl | 0; | ||
4939 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4940 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4941 | tl = tl + xl | 0; | ||
4942 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4943 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4944 | tl = tl + xl | 0; | ||
4945 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4946 | hl = gl; | ||
4947 | hh = gh; | ||
4948 | gl = fl; | ||
4949 | gh = fh; | ||
4950 | fl = el; | ||
4951 | fh = eh; | ||
4952 | el = dl + tl | 0; | ||
4953 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4954 | dl = cl; | ||
4955 | dh = ch; | ||
4956 | cl = bl; | ||
4957 | ch = bh; | ||
4958 | bl = al; | ||
4959 | bh = ah; | ||
4960 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4961 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4962 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
4963 | al = al + xl | 0; | ||
4964 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4965 | w9l = w9l + w2l | 0; | ||
4966 | w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
4967 | xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0; | ||
4968 | w9l = w9l + xl | 0; | ||
4969 | w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4970 | xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0; | ||
4971 | w9l = w9l + xl | 0; | ||
4972 | w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4973 | tl = 3158454273 + w9l | 0; | ||
4974 | th = 2820302411 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
4975 | tl = tl + hl | 0; | ||
4976 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
4977 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
4978 | tl = tl + xl | 0; | ||
4979 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4980 | xl = gl ^ el & (fl ^ gl) | 0; | ||
4981 | tl = tl + xl | 0; | ||
4982 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
4983 | hl = gl; | ||
4984 | hh = gh; | ||
4985 | gl = fl; | ||
4986 | gh = fh; | ||
4987 | fl = el; | ||
4988 | fh = eh; | ||
4989 | el = dl + tl | 0; | ||
4990 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
4991 | dl = cl; | ||
4992 | dh = ch; | ||
4993 | cl = bl; | ||
4994 | ch = bh; | ||
4995 | bl = al; | ||
4996 | bh = ah; | ||
4997 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
4998 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
4999 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5000 | al = al + xl | 0; | ||
5001 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5002 | w10l = w10l + w3l | 0; | ||
5003 | w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
5004 | xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0; | ||
5005 | w10l = w10l + xl | 0; | ||
5006 | w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5007 | xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0; | ||
5008 | w10l = w10l + xl | 0; | ||
5009 | w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5010 | tl = 3505952657 + w10l | 0; | ||
5011 | th = 3259730800 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
5012 | tl = tl + hl | 0; | ||
5013 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5014 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5015 | tl = tl + xl | 0; | ||
5016 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5017 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5018 | tl = tl + xl | 0; | ||
5019 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5020 | hl = gl; | ||
5021 | hh = gh; | ||
5022 | gl = fl; | ||
5023 | gh = fh; | ||
5024 | fl = el; | ||
5025 | fh = eh; | ||
5026 | el = dl + tl | 0; | ||
5027 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5028 | dl = cl; | ||
5029 | dh = ch; | ||
5030 | cl = bl; | ||
5031 | ch = bh; | ||
5032 | bl = al; | ||
5033 | bh = ah; | ||
5034 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5035 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5036 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5037 | al = al + xl | 0; | ||
5038 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5039 | w11l = w11l + w4l | 0; | ||
5040 | w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
5041 | xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0; | ||
5042 | w11l = w11l + xl | 0; | ||
5043 | w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5044 | xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0; | ||
5045 | w11l = w11l + xl | 0; | ||
5046 | w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5047 | tl = 106217008 + w11l | 0; | ||
5048 | th = 3345764771 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
5049 | tl = tl + hl | 0; | ||
5050 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5051 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5052 | tl = tl + xl | 0; | ||
5053 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5054 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5055 | tl = tl + xl | 0; | ||
5056 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5057 | hl = gl; | ||
5058 | hh = gh; | ||
5059 | gl = fl; | ||
5060 | gh = fh; | ||
5061 | fl = el; | ||
5062 | fh = eh; | ||
5063 | el = dl + tl | 0; | ||
5064 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5065 | dl = cl; | ||
5066 | dh = ch; | ||
5067 | cl = bl; | ||
5068 | ch = bh; | ||
5069 | bl = al; | ||
5070 | bh = ah; | ||
5071 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5072 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5073 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5074 | al = al + xl | 0; | ||
5075 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5076 | w12l = w12l + w5l | 0; | ||
5077 | w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
5078 | xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0; | ||
5079 | w12l = w12l + xl | 0; | ||
5080 | w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5081 | xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0; | ||
5082 | w12l = w12l + xl | 0; | ||
5083 | w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5084 | tl = 3606008344 + w12l | 0; | ||
5085 | th = 3516065817 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
5086 | tl = tl + hl | 0; | ||
5087 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5088 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5089 | tl = tl + xl | 0; | ||
5090 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5091 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5092 | tl = tl + xl | 0; | ||
5093 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5094 | hl = gl; | ||
5095 | hh = gh; | ||
5096 | gl = fl; | ||
5097 | gh = fh; | ||
5098 | fl = el; | ||
5099 | fh = eh; | ||
5100 | el = dl + tl | 0; | ||
5101 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5102 | dl = cl; | ||
5103 | dh = ch; | ||
5104 | cl = bl; | ||
5105 | ch = bh; | ||
5106 | bl = al; | ||
5107 | bh = ah; | ||
5108 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5109 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5110 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5111 | al = al + xl | 0; | ||
5112 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5113 | w13l = w13l + w6l | 0; | ||
5114 | w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
5115 | xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0; | ||
5116 | w13l = w13l + xl | 0; | ||
5117 | w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5118 | xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0; | ||
5119 | w13l = w13l + xl | 0; | ||
5120 | w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5121 | tl = 1432725776 + w13l | 0; | ||
5122 | th = 3600352804 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
5123 | tl = tl + hl | 0; | ||
5124 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5125 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5126 | tl = tl + xl | 0; | ||
5127 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5128 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5129 | tl = tl + xl | 0; | ||
5130 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5131 | hl = gl; | ||
5132 | hh = gh; | ||
5133 | gl = fl; | ||
5134 | gh = fh; | ||
5135 | fl = el; | ||
5136 | fh = eh; | ||
5137 | el = dl + tl | 0; | ||
5138 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5139 | dl = cl; | ||
5140 | dh = ch; | ||
5141 | cl = bl; | ||
5142 | ch = bh; | ||
5143 | bl = al; | ||
5144 | bh = ah; | ||
5145 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5146 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5147 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5148 | al = al + xl | 0; | ||
5149 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5150 | w14l = w14l + w7l | 0; | ||
5151 | w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
5152 | xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0; | ||
5153 | w14l = w14l + xl | 0; | ||
5154 | w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5155 | xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0; | ||
5156 | w14l = w14l + xl | 0; | ||
5157 | w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5158 | tl = 1467031594 + w14l | 0; | ||
5159 | th = 4094571909 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
5160 | tl = tl + hl | 0; | ||
5161 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5162 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5163 | tl = tl + xl | 0; | ||
5164 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5165 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5166 | tl = tl + xl | 0; | ||
5167 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5168 | hl = gl; | ||
5169 | hh = gh; | ||
5170 | gl = fl; | ||
5171 | gh = fh; | ||
5172 | fl = el; | ||
5173 | fh = eh; | ||
5174 | el = dl + tl | 0; | ||
5175 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5176 | dl = cl; | ||
5177 | dh = ch; | ||
5178 | cl = bl; | ||
5179 | ch = bh; | ||
5180 | bl = al; | ||
5181 | bh = ah; | ||
5182 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5183 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5184 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5185 | al = al + xl | 0; | ||
5186 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5187 | w15l = w15l + w8l | 0; | ||
5188 | w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
5189 | xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0; | ||
5190 | w15l = w15l + xl | 0; | ||
5191 | w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5192 | xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0; | ||
5193 | w15l = w15l + xl | 0; | ||
5194 | w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5195 | tl = 851169720 + w15l | 0; | ||
5196 | th = 275423344 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
5197 | tl = tl + hl | 0; | ||
5198 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5199 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5200 | tl = tl + xl | 0; | ||
5201 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5202 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5203 | tl = tl + xl | 0; | ||
5204 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5205 | hl = gl; | ||
5206 | hh = gh; | ||
5207 | gl = fl; | ||
5208 | gh = fh; | ||
5209 | fl = el; | ||
5210 | fh = eh; | ||
5211 | el = dl + tl | 0; | ||
5212 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5213 | dl = cl; | ||
5214 | dh = ch; | ||
5215 | cl = bl; | ||
5216 | ch = bh; | ||
5217 | bl = al; | ||
5218 | bh = ah; | ||
5219 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5220 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5221 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5222 | al = al + xl | 0; | ||
5223 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5224 | w0l = w0l + w9l | 0; | ||
5225 | w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
5226 | xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0; | ||
5227 | w0l = w0l + xl | 0; | ||
5228 | w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5229 | xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0; | ||
5230 | w0l = w0l + xl | 0; | ||
5231 | w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5232 | tl = 3100823752 + w0l | 0; | ||
5233 | th = 430227734 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
5234 | tl = tl + hl | 0; | ||
5235 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5236 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5237 | tl = tl + xl | 0; | ||
5238 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5239 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5240 | tl = tl + xl | 0; | ||
5241 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5242 | hl = gl; | ||
5243 | hh = gh; | ||
5244 | gl = fl; | ||
5245 | gh = fh; | ||
5246 | fl = el; | ||
5247 | fh = eh; | ||
5248 | el = dl + tl | 0; | ||
5249 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5250 | dl = cl; | ||
5251 | dh = ch; | ||
5252 | cl = bl; | ||
5253 | ch = bh; | ||
5254 | bl = al; | ||
5255 | bh = ah; | ||
5256 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5257 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5258 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5259 | al = al + xl | 0; | ||
5260 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5261 | w1l = w1l + w10l | 0; | ||
5262 | w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
5263 | xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0; | ||
5264 | w1l = w1l + xl | 0; | ||
5265 | w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5266 | xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0; | ||
5267 | w1l = w1l + xl | 0; | ||
5268 | w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5269 | tl = 1363258195 + w1l | 0; | ||
5270 | th = 506948616 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
5271 | tl = tl + hl | 0; | ||
5272 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5273 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5274 | tl = tl + xl | 0; | ||
5275 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5276 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5277 | tl = tl + xl | 0; | ||
5278 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5279 | hl = gl; | ||
5280 | hh = gh; | ||
5281 | gl = fl; | ||
5282 | gh = fh; | ||
5283 | fl = el; | ||
5284 | fh = eh; | ||
5285 | el = dl + tl | 0; | ||
5286 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5287 | dl = cl; | ||
5288 | dh = ch; | ||
5289 | cl = bl; | ||
5290 | ch = bh; | ||
5291 | bl = al; | ||
5292 | bh = ah; | ||
5293 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5294 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5295 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5296 | al = al + xl | 0; | ||
5297 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5298 | w2l = w2l + w11l | 0; | ||
5299 | w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
5300 | xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0; | ||
5301 | w2l = w2l + xl | 0; | ||
5302 | w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5303 | xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0; | ||
5304 | w2l = w2l + xl | 0; | ||
5305 | w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5306 | tl = 3750685593 + w2l | 0; | ||
5307 | th = 659060556 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
5308 | tl = tl + hl | 0; | ||
5309 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5310 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5311 | tl = tl + xl | 0; | ||
5312 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5313 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5314 | tl = tl + xl | 0; | ||
5315 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5316 | hl = gl; | ||
5317 | hh = gh; | ||
5318 | gl = fl; | ||
5319 | gh = fh; | ||
5320 | fl = el; | ||
5321 | fh = eh; | ||
5322 | el = dl + tl | 0; | ||
5323 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5324 | dl = cl; | ||
5325 | dh = ch; | ||
5326 | cl = bl; | ||
5327 | ch = bh; | ||
5328 | bl = al; | ||
5329 | bh = ah; | ||
5330 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5331 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5332 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5333 | al = al + xl | 0; | ||
5334 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5335 | w3l = w3l + w12l | 0; | ||
5336 | w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
5337 | xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0; | ||
5338 | w3l = w3l + xl | 0; | ||
5339 | w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5340 | xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0; | ||
5341 | w3l = w3l + xl | 0; | ||
5342 | w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5343 | tl = 3785050280 + w3l | 0; | ||
5344 | th = 883997877 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
5345 | tl = tl + hl | 0; | ||
5346 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5347 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5348 | tl = tl + xl | 0; | ||
5349 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5350 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5351 | tl = tl + xl | 0; | ||
5352 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5353 | hl = gl; | ||
5354 | hh = gh; | ||
5355 | gl = fl; | ||
5356 | gh = fh; | ||
5357 | fl = el; | ||
5358 | fh = eh; | ||
5359 | el = dl + tl | 0; | ||
5360 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5361 | dl = cl; | ||
5362 | dh = ch; | ||
5363 | cl = bl; | ||
5364 | ch = bh; | ||
5365 | bl = al; | ||
5366 | bh = ah; | ||
5367 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5368 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5369 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5370 | al = al + xl | 0; | ||
5371 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5372 | w4l = w4l + w13l | 0; | ||
5373 | w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
5374 | xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0; | ||
5375 | w4l = w4l + xl | 0; | ||
5376 | w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5377 | xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0; | ||
5378 | w4l = w4l + xl | 0; | ||
5379 | w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5380 | tl = 3318307427 + w4l | 0; | ||
5381 | th = 958139571 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
5382 | tl = tl + hl | 0; | ||
5383 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5384 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5385 | tl = tl + xl | 0; | ||
5386 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5387 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5388 | tl = tl + xl | 0; | ||
5389 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5390 | hl = gl; | ||
5391 | hh = gh; | ||
5392 | gl = fl; | ||
5393 | gh = fh; | ||
5394 | fl = el; | ||
5395 | fh = eh; | ||
5396 | el = dl + tl | 0; | ||
5397 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5398 | dl = cl; | ||
5399 | dh = ch; | ||
5400 | cl = bl; | ||
5401 | ch = bh; | ||
5402 | bl = al; | ||
5403 | bh = ah; | ||
5404 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5405 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5406 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5407 | al = al + xl | 0; | ||
5408 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5409 | w5l = w5l + w14l | 0; | ||
5410 | w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
5411 | xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0; | ||
5412 | w5l = w5l + xl | 0; | ||
5413 | w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5414 | xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0; | ||
5415 | w5l = w5l + xl | 0; | ||
5416 | w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5417 | tl = 3812723403 + w5l | 0; | ||
5418 | th = 1322822218 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
5419 | tl = tl + hl | 0; | ||
5420 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5421 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5422 | tl = tl + xl | 0; | ||
5423 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5424 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5425 | tl = tl + xl | 0; | ||
5426 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5427 | hl = gl; | ||
5428 | hh = gh; | ||
5429 | gl = fl; | ||
5430 | gh = fh; | ||
5431 | fl = el; | ||
5432 | fh = eh; | ||
5433 | el = dl + tl | 0; | ||
5434 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5435 | dl = cl; | ||
5436 | dh = ch; | ||
5437 | cl = bl; | ||
5438 | ch = bh; | ||
5439 | bl = al; | ||
5440 | bh = ah; | ||
5441 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5442 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5443 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5444 | al = al + xl | 0; | ||
5445 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5446 | w6l = w6l + w15l | 0; | ||
5447 | w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
5448 | xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0; | ||
5449 | w6l = w6l + xl | 0; | ||
5450 | w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5451 | xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0; | ||
5452 | w6l = w6l + xl | 0; | ||
5453 | w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5454 | tl = 2003034995 + w6l | 0; | ||
5455 | th = 1537002063 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
5456 | tl = tl + hl | 0; | ||
5457 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5458 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5459 | tl = tl + xl | 0; | ||
5460 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5461 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5462 | tl = tl + xl | 0; | ||
5463 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5464 | hl = gl; | ||
5465 | hh = gh; | ||
5466 | gl = fl; | ||
5467 | gh = fh; | ||
5468 | fl = el; | ||
5469 | fh = eh; | ||
5470 | el = dl + tl | 0; | ||
5471 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5472 | dl = cl; | ||
5473 | dh = ch; | ||
5474 | cl = bl; | ||
5475 | ch = bh; | ||
5476 | bl = al; | ||
5477 | bh = ah; | ||
5478 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5479 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5480 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5481 | al = al + xl | 0; | ||
5482 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5483 | w7l = w7l + w0l | 0; | ||
5484 | w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
5485 | xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0; | ||
5486 | w7l = w7l + xl | 0; | ||
5487 | w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5488 | xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0; | ||
5489 | w7l = w7l + xl | 0; | ||
5490 | w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5491 | tl = 3602036899 + w7l | 0; | ||
5492 | th = 1747873779 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
5493 | tl = tl + hl | 0; | ||
5494 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5495 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5496 | tl = tl + xl | 0; | ||
5497 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5498 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5499 | tl = tl + xl | 0; | ||
5500 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5501 | hl = gl; | ||
5502 | hh = gh; | ||
5503 | gl = fl; | ||
5504 | gh = fh; | ||
5505 | fl = el; | ||
5506 | fh = eh; | ||
5507 | el = dl + tl | 0; | ||
5508 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5509 | dl = cl; | ||
5510 | dh = ch; | ||
5511 | cl = bl; | ||
5512 | ch = bh; | ||
5513 | bl = al; | ||
5514 | bh = ah; | ||
5515 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5516 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5517 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5518 | al = al + xl | 0; | ||
5519 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5520 | w8l = w8l + w1l | 0; | ||
5521 | w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
5522 | xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0; | ||
5523 | w8l = w8l + xl | 0; | ||
5524 | w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5525 | xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0; | ||
5526 | w8l = w8l + xl | 0; | ||
5527 | w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5528 | tl = 1575990012 + w8l | 0; | ||
5529 | th = 1955562222 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
5530 | tl = tl + hl | 0; | ||
5531 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5532 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5533 | tl = tl + xl | 0; | ||
5534 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5535 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5536 | tl = tl + xl | 0; | ||
5537 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5538 | hl = gl; | ||
5539 | hh = gh; | ||
5540 | gl = fl; | ||
5541 | gh = fh; | ||
5542 | fl = el; | ||
5543 | fh = eh; | ||
5544 | el = dl + tl | 0; | ||
5545 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5546 | dl = cl; | ||
5547 | dh = ch; | ||
5548 | cl = bl; | ||
5549 | ch = bh; | ||
5550 | bl = al; | ||
5551 | bh = ah; | ||
5552 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5553 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5554 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5555 | al = al + xl | 0; | ||
5556 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5557 | w9l = w9l + w2l | 0; | ||
5558 | w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
5559 | xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0; | ||
5560 | w9l = w9l + xl | 0; | ||
5561 | w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5562 | xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0; | ||
5563 | w9l = w9l + xl | 0; | ||
5564 | w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5565 | tl = 1125592928 + w9l | 0; | ||
5566 | th = 2024104815 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
5567 | tl = tl + hl | 0; | ||
5568 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5569 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5570 | tl = tl + xl | 0; | ||
5571 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5572 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5573 | tl = tl + xl | 0; | ||
5574 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5575 | hl = gl; | ||
5576 | hh = gh; | ||
5577 | gl = fl; | ||
5578 | gh = fh; | ||
5579 | fl = el; | ||
5580 | fh = eh; | ||
5581 | el = dl + tl | 0; | ||
5582 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5583 | dl = cl; | ||
5584 | dh = ch; | ||
5585 | cl = bl; | ||
5586 | ch = bh; | ||
5587 | bl = al; | ||
5588 | bh = ah; | ||
5589 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5590 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5591 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5592 | al = al + xl | 0; | ||
5593 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5594 | w10l = w10l + w3l | 0; | ||
5595 | w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
5596 | xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0; | ||
5597 | w10l = w10l + xl | 0; | ||
5598 | w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5599 | xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0; | ||
5600 | w10l = w10l + xl | 0; | ||
5601 | w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5602 | tl = 2716904306 + w10l | 0; | ||
5603 | th = 2227730452 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
5604 | tl = tl + hl | 0; | ||
5605 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5606 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5607 | tl = tl + xl | 0; | ||
5608 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5609 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5610 | tl = tl + xl | 0; | ||
5611 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5612 | hl = gl; | ||
5613 | hh = gh; | ||
5614 | gl = fl; | ||
5615 | gh = fh; | ||
5616 | fl = el; | ||
5617 | fh = eh; | ||
5618 | el = dl + tl | 0; | ||
5619 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5620 | dl = cl; | ||
5621 | dh = ch; | ||
5622 | cl = bl; | ||
5623 | ch = bh; | ||
5624 | bl = al; | ||
5625 | bh = ah; | ||
5626 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5627 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5628 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5629 | al = al + xl | 0; | ||
5630 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5631 | w11l = w11l + w4l | 0; | ||
5632 | w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
5633 | xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0; | ||
5634 | w11l = w11l + xl | 0; | ||
5635 | w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5636 | xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0; | ||
5637 | w11l = w11l + xl | 0; | ||
5638 | w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5639 | tl = 442776044 + w11l | 0; | ||
5640 | th = 2361852424 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
5641 | tl = tl + hl | 0; | ||
5642 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5643 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5644 | tl = tl + xl | 0; | ||
5645 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5646 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5647 | tl = tl + xl | 0; | ||
5648 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5649 | hl = gl; | ||
5650 | hh = gh; | ||
5651 | gl = fl; | ||
5652 | gh = fh; | ||
5653 | fl = el; | ||
5654 | fh = eh; | ||
5655 | el = dl + tl | 0; | ||
5656 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5657 | dl = cl; | ||
5658 | dh = ch; | ||
5659 | cl = bl; | ||
5660 | ch = bh; | ||
5661 | bl = al; | ||
5662 | bh = ah; | ||
5663 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5664 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5665 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5666 | al = al + xl | 0; | ||
5667 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5668 | w12l = w12l + w5l | 0; | ||
5669 | w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
5670 | xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0; | ||
5671 | w12l = w12l + xl | 0; | ||
5672 | w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5673 | xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0; | ||
5674 | w12l = w12l + xl | 0; | ||
5675 | w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5676 | tl = 593698344 + w12l | 0; | ||
5677 | th = 2428436474 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
5678 | tl = tl + hl | 0; | ||
5679 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5680 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5681 | tl = tl + xl | 0; | ||
5682 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5683 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5684 | tl = tl + xl | 0; | ||
5685 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5686 | hl = gl; | ||
5687 | hh = gh; | ||
5688 | gl = fl; | ||
5689 | gh = fh; | ||
5690 | fl = el; | ||
5691 | fh = eh; | ||
5692 | el = dl + tl | 0; | ||
5693 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5694 | dl = cl; | ||
5695 | dh = ch; | ||
5696 | cl = bl; | ||
5697 | ch = bh; | ||
5698 | bl = al; | ||
5699 | bh = ah; | ||
5700 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5701 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5702 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5703 | al = al + xl | 0; | ||
5704 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5705 | w13l = w13l + w6l | 0; | ||
5706 | w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
5707 | xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0; | ||
5708 | w13l = w13l + xl | 0; | ||
5709 | w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5710 | xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0; | ||
5711 | w13l = w13l + xl | 0; | ||
5712 | w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5713 | tl = 3733110249 + w13l | 0; | ||
5714 | th = 2756734187 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
5715 | tl = tl + hl | 0; | ||
5716 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5717 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5718 | tl = tl + xl | 0; | ||
5719 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5720 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5721 | tl = tl + xl | 0; | ||
5722 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5723 | hl = gl; | ||
5724 | hh = gh; | ||
5725 | gl = fl; | ||
5726 | gh = fh; | ||
5727 | fl = el; | ||
5728 | fh = eh; | ||
5729 | el = dl + tl | 0; | ||
5730 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5731 | dl = cl; | ||
5732 | dh = ch; | ||
5733 | cl = bl; | ||
5734 | ch = bh; | ||
5735 | bl = al; | ||
5736 | bh = ah; | ||
5737 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5738 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5739 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5740 | al = al + xl | 0; | ||
5741 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5742 | w14l = w14l + w7l | 0; | ||
5743 | w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
5744 | xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0; | ||
5745 | w14l = w14l + xl | 0; | ||
5746 | w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5747 | xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0; | ||
5748 | w14l = w14l + xl | 0; | ||
5749 | w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5750 | tl = 2999351573 + w14l | 0; | ||
5751 | th = 3204031479 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
5752 | tl = tl + hl | 0; | ||
5753 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5754 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5755 | tl = tl + xl | 0; | ||
5756 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5757 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5758 | tl = tl + xl | 0; | ||
5759 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5760 | hl = gl; | ||
5761 | hh = gh; | ||
5762 | gl = fl; | ||
5763 | gh = fh; | ||
5764 | fl = el; | ||
5765 | fh = eh; | ||
5766 | el = dl + tl | 0; | ||
5767 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5768 | dl = cl; | ||
5769 | dh = ch; | ||
5770 | cl = bl; | ||
5771 | ch = bh; | ||
5772 | bl = al; | ||
5773 | bh = ah; | ||
5774 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5775 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5776 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5777 | al = al + xl | 0; | ||
5778 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5779 | w15l = w15l + w8l | 0; | ||
5780 | w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
5781 | xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0; | ||
5782 | w15l = w15l + xl | 0; | ||
5783 | w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5784 | xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0; | ||
5785 | w15l = w15l + xl | 0; | ||
5786 | w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5787 | tl = 3815920427 + w15l | 0; | ||
5788 | th = 3329325298 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
5789 | tl = tl + hl | 0; | ||
5790 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5791 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5792 | tl = tl + xl | 0; | ||
5793 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5794 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5795 | tl = tl + xl | 0; | ||
5796 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5797 | hl = gl; | ||
5798 | hh = gh; | ||
5799 | gl = fl; | ||
5800 | gh = fh; | ||
5801 | fl = el; | ||
5802 | fh = eh; | ||
5803 | el = dl + tl | 0; | ||
5804 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5805 | dl = cl; | ||
5806 | dh = ch; | ||
5807 | cl = bl; | ||
5808 | ch = bh; | ||
5809 | bl = al; | ||
5810 | bh = ah; | ||
5811 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5812 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5813 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5814 | al = al + xl | 0; | ||
5815 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5816 | w0l = w0l + w9l | 0; | ||
5817 | w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
5818 | xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0; | ||
5819 | w0l = w0l + xl | 0; | ||
5820 | w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5821 | xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0; | ||
5822 | w0l = w0l + xl | 0; | ||
5823 | w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5824 | tl = 3928383900 + w0l | 0; | ||
5825 | th = 3391569614 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
5826 | tl = tl + hl | 0; | ||
5827 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5828 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5829 | tl = tl + xl | 0; | ||
5830 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5831 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5832 | tl = tl + xl | 0; | ||
5833 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5834 | hl = gl; | ||
5835 | hh = gh; | ||
5836 | gl = fl; | ||
5837 | gh = fh; | ||
5838 | fl = el; | ||
5839 | fh = eh; | ||
5840 | el = dl + tl | 0; | ||
5841 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5842 | dl = cl; | ||
5843 | dh = ch; | ||
5844 | cl = bl; | ||
5845 | ch = bh; | ||
5846 | bl = al; | ||
5847 | bh = ah; | ||
5848 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5849 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5850 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5851 | al = al + xl | 0; | ||
5852 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5853 | w1l = w1l + w10l | 0; | ||
5854 | w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
5855 | xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0; | ||
5856 | w1l = w1l + xl | 0; | ||
5857 | w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5858 | xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0; | ||
5859 | w1l = w1l + xl | 0; | ||
5860 | w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5861 | tl = 566280711 + w1l | 0; | ||
5862 | th = 3515267271 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
5863 | tl = tl + hl | 0; | ||
5864 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5865 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5866 | tl = tl + xl | 0; | ||
5867 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5868 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5869 | tl = tl + xl | 0; | ||
5870 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5871 | hl = gl; | ||
5872 | hh = gh; | ||
5873 | gl = fl; | ||
5874 | gh = fh; | ||
5875 | fl = el; | ||
5876 | fh = eh; | ||
5877 | el = dl + tl | 0; | ||
5878 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5879 | dl = cl; | ||
5880 | dh = ch; | ||
5881 | cl = bl; | ||
5882 | ch = bh; | ||
5883 | bl = al; | ||
5884 | bh = ah; | ||
5885 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5886 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5887 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5888 | al = al + xl | 0; | ||
5889 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5890 | w2l = w2l + w11l | 0; | ||
5891 | w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
5892 | xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0; | ||
5893 | w2l = w2l + xl | 0; | ||
5894 | w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5895 | xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0; | ||
5896 | w2l = w2l + xl | 0; | ||
5897 | w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5898 | tl = 3454069534 + w2l | 0; | ||
5899 | th = 3940187606 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
5900 | tl = tl + hl | 0; | ||
5901 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5902 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5903 | tl = tl + xl | 0; | ||
5904 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5905 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5906 | tl = tl + xl | 0; | ||
5907 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5908 | hl = gl; | ||
5909 | hh = gh; | ||
5910 | gl = fl; | ||
5911 | gh = fh; | ||
5912 | fl = el; | ||
5913 | fh = eh; | ||
5914 | el = dl + tl | 0; | ||
5915 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5916 | dl = cl; | ||
5917 | dh = ch; | ||
5918 | cl = bl; | ||
5919 | ch = bh; | ||
5920 | bl = al; | ||
5921 | bh = ah; | ||
5922 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5923 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5924 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5925 | al = al + xl | 0; | ||
5926 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5927 | w3l = w3l + w12l | 0; | ||
5928 | w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
5929 | xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0; | ||
5930 | w3l = w3l + xl | 0; | ||
5931 | w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5932 | xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0; | ||
5933 | w3l = w3l + xl | 0; | ||
5934 | w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5935 | tl = 4000239992 + w3l | 0; | ||
5936 | th = 4118630271 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
5937 | tl = tl + hl | 0; | ||
5938 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5939 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5940 | tl = tl + xl | 0; | ||
5941 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5942 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5943 | tl = tl + xl | 0; | ||
5944 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5945 | hl = gl; | ||
5946 | hh = gh; | ||
5947 | gl = fl; | ||
5948 | gh = fh; | ||
5949 | fl = el; | ||
5950 | fh = eh; | ||
5951 | el = dl + tl | 0; | ||
5952 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5953 | dl = cl; | ||
5954 | dh = ch; | ||
5955 | cl = bl; | ||
5956 | ch = bh; | ||
5957 | bl = al; | ||
5958 | bh = ah; | ||
5959 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5960 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5961 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5962 | al = al + xl | 0; | ||
5963 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5964 | w4l = w4l + w13l | 0; | ||
5965 | w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
5966 | xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0; | ||
5967 | w4l = w4l + xl | 0; | ||
5968 | w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5969 | xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0; | ||
5970 | w4l = w4l + xl | 0; | ||
5971 | w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5972 | tl = 1914138554 + w4l | 0; | ||
5973 | th = 116418474 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
5974 | tl = tl + hl | 0; | ||
5975 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
5976 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
5977 | tl = tl + xl | 0; | ||
5978 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5979 | xl = gl ^ el & (fl ^ gl) | 0; | ||
5980 | tl = tl + xl | 0; | ||
5981 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
5982 | hl = gl; | ||
5983 | hh = gh; | ||
5984 | gl = fl; | ||
5985 | gh = fh; | ||
5986 | fl = el; | ||
5987 | fh = eh; | ||
5988 | el = dl + tl | 0; | ||
5989 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
5990 | dl = cl; | ||
5991 | dh = ch; | ||
5992 | cl = bl; | ||
5993 | ch = bh; | ||
5994 | bl = al; | ||
5995 | bh = ah; | ||
5996 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
5997 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
5998 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
5999 | al = al + xl | 0; | ||
6000 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6001 | w5l = w5l + w14l | 0; | ||
6002 | w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
6003 | xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0; | ||
6004 | w5l = w5l + xl | 0; | ||
6005 | w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6006 | xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0; | ||
6007 | w5l = w5l + xl | 0; | ||
6008 | w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6009 | tl = 2731055270 + w5l | 0; | ||
6010 | th = 174292421 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
6011 | tl = tl + hl | 0; | ||
6012 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6013 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6014 | tl = tl + xl | 0; | ||
6015 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6016 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6017 | tl = tl + xl | 0; | ||
6018 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6019 | hl = gl; | ||
6020 | hh = gh; | ||
6021 | gl = fl; | ||
6022 | gh = fh; | ||
6023 | fl = el; | ||
6024 | fh = eh; | ||
6025 | el = dl + tl | 0; | ||
6026 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6027 | dl = cl; | ||
6028 | dh = ch; | ||
6029 | cl = bl; | ||
6030 | ch = bh; | ||
6031 | bl = al; | ||
6032 | bh = ah; | ||
6033 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6034 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6035 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6036 | al = al + xl | 0; | ||
6037 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6038 | w6l = w6l + w15l | 0; | ||
6039 | w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
6040 | xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0; | ||
6041 | w6l = w6l + xl | 0; | ||
6042 | w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6043 | xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0; | ||
6044 | w6l = w6l + xl | 0; | ||
6045 | w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6046 | tl = 3203993006 + w6l | 0; | ||
6047 | th = 289380356 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
6048 | tl = tl + hl | 0; | ||
6049 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6050 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6051 | tl = tl + xl | 0; | ||
6052 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6053 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6054 | tl = tl + xl | 0; | ||
6055 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6056 | hl = gl; | ||
6057 | hh = gh; | ||
6058 | gl = fl; | ||
6059 | gh = fh; | ||
6060 | fl = el; | ||
6061 | fh = eh; | ||
6062 | el = dl + tl | 0; | ||
6063 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6064 | dl = cl; | ||
6065 | dh = ch; | ||
6066 | cl = bl; | ||
6067 | ch = bh; | ||
6068 | bl = al; | ||
6069 | bh = ah; | ||
6070 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6071 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6072 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6073 | al = al + xl | 0; | ||
6074 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6075 | w7l = w7l + w0l | 0; | ||
6076 | w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0; | ||
6077 | xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0; | ||
6078 | w7l = w7l + xl | 0; | ||
6079 | w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6080 | xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0; | ||
6081 | w7l = w7l + xl | 0; | ||
6082 | w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6083 | tl = 320620315 + w7l | 0; | ||
6084 | th = 460393269 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
6085 | tl = tl + hl | 0; | ||
6086 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6087 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6088 | tl = tl + xl | 0; | ||
6089 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6090 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6091 | tl = tl + xl | 0; | ||
6092 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6093 | hl = gl; | ||
6094 | hh = gh; | ||
6095 | gl = fl; | ||
6096 | gh = fh; | ||
6097 | fl = el; | ||
6098 | fh = eh; | ||
6099 | el = dl + tl | 0; | ||
6100 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6101 | dl = cl; | ||
6102 | dh = ch; | ||
6103 | cl = bl; | ||
6104 | ch = bh; | ||
6105 | bl = al; | ||
6106 | bh = ah; | ||
6107 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6108 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6109 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6110 | al = al + xl | 0; | ||
6111 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6112 | w8l = w8l + w1l | 0; | ||
6113 | w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0; | ||
6114 | xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0; | ||
6115 | w8l = w8l + xl | 0; | ||
6116 | w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6117 | xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0; | ||
6118 | w8l = w8l + xl | 0; | ||
6119 | w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6120 | tl = 587496836 + w8l | 0; | ||
6121 | th = 685471733 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
6122 | tl = tl + hl | 0; | ||
6123 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6124 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6125 | tl = tl + xl | 0; | ||
6126 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6127 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6128 | tl = tl + xl | 0; | ||
6129 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6130 | hl = gl; | ||
6131 | hh = gh; | ||
6132 | gl = fl; | ||
6133 | gh = fh; | ||
6134 | fl = el; | ||
6135 | fh = eh; | ||
6136 | el = dl + tl | 0; | ||
6137 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6138 | dl = cl; | ||
6139 | dh = ch; | ||
6140 | cl = bl; | ||
6141 | ch = bh; | ||
6142 | bl = al; | ||
6143 | bh = ah; | ||
6144 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6145 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6146 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6147 | al = al + xl | 0; | ||
6148 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6149 | w9l = w9l + w2l | 0; | ||
6150 | w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0; | ||
6151 | xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0; | ||
6152 | w9l = w9l + xl | 0; | ||
6153 | w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6154 | xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0; | ||
6155 | w9l = w9l + xl | 0; | ||
6156 | w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6157 | tl = 1086792851 + w9l | 0; | ||
6158 | th = 852142971 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0; | ||
6159 | tl = tl + hl | 0; | ||
6160 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6161 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6162 | tl = tl + xl | 0; | ||
6163 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6164 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6165 | tl = tl + xl | 0; | ||
6166 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6167 | hl = gl; | ||
6168 | hh = gh; | ||
6169 | gl = fl; | ||
6170 | gh = fh; | ||
6171 | fl = el; | ||
6172 | fh = eh; | ||
6173 | el = dl + tl | 0; | ||
6174 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6175 | dl = cl; | ||
6176 | dh = ch; | ||
6177 | cl = bl; | ||
6178 | ch = bh; | ||
6179 | bl = al; | ||
6180 | bh = ah; | ||
6181 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6182 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6183 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6184 | al = al + xl | 0; | ||
6185 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6186 | w10l = w10l + w3l | 0; | ||
6187 | w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0; | ||
6188 | xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0; | ||
6189 | w10l = w10l + xl | 0; | ||
6190 | w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6191 | xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0; | ||
6192 | w10l = w10l + xl | 0; | ||
6193 | w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6194 | tl = 365543100 + w10l | 0; | ||
6195 | th = 1017036298 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0; | ||
6196 | tl = tl + hl | 0; | ||
6197 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6198 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6199 | tl = tl + xl | 0; | ||
6200 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6201 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6202 | tl = tl + xl | 0; | ||
6203 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6204 | hl = gl; | ||
6205 | hh = gh; | ||
6206 | gl = fl; | ||
6207 | gh = fh; | ||
6208 | fl = el; | ||
6209 | fh = eh; | ||
6210 | el = dl + tl | 0; | ||
6211 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6212 | dl = cl; | ||
6213 | dh = ch; | ||
6214 | cl = bl; | ||
6215 | ch = bh; | ||
6216 | bl = al; | ||
6217 | bh = ah; | ||
6218 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6219 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6220 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6221 | al = al + xl | 0; | ||
6222 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6223 | w11l = w11l + w4l | 0; | ||
6224 | w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0; | ||
6225 | xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0; | ||
6226 | w11l = w11l + xl | 0; | ||
6227 | w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6228 | xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0; | ||
6229 | w11l = w11l + xl | 0; | ||
6230 | w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6231 | tl = 2618297676 + w11l | 0; | ||
6232 | th = 1126000580 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0; | ||
6233 | tl = tl + hl | 0; | ||
6234 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6235 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6236 | tl = tl + xl | 0; | ||
6237 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6238 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6239 | tl = tl + xl | 0; | ||
6240 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6241 | hl = gl; | ||
6242 | hh = gh; | ||
6243 | gl = fl; | ||
6244 | gh = fh; | ||
6245 | fl = el; | ||
6246 | fh = eh; | ||
6247 | el = dl + tl | 0; | ||
6248 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6249 | dl = cl; | ||
6250 | dh = ch; | ||
6251 | cl = bl; | ||
6252 | ch = bh; | ||
6253 | bl = al; | ||
6254 | bh = ah; | ||
6255 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6256 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6257 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6258 | al = al + xl | 0; | ||
6259 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6260 | w12l = w12l + w5l | 0; | ||
6261 | w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0; | ||
6262 | xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0; | ||
6263 | w12l = w12l + xl | 0; | ||
6264 | w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6265 | xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0; | ||
6266 | w12l = w12l + xl | 0; | ||
6267 | w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6268 | tl = 3409855158 + w12l | 0; | ||
6269 | th = 1288033470 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0; | ||
6270 | tl = tl + hl | 0; | ||
6271 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6272 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6273 | tl = tl + xl | 0; | ||
6274 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6275 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6276 | tl = tl + xl | 0; | ||
6277 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6278 | hl = gl; | ||
6279 | hh = gh; | ||
6280 | gl = fl; | ||
6281 | gh = fh; | ||
6282 | fl = el; | ||
6283 | fh = eh; | ||
6284 | el = dl + tl | 0; | ||
6285 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6286 | dl = cl; | ||
6287 | dh = ch; | ||
6288 | cl = bl; | ||
6289 | ch = bh; | ||
6290 | bl = al; | ||
6291 | bh = ah; | ||
6292 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6293 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6294 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6295 | al = al + xl | 0; | ||
6296 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6297 | w13l = w13l + w6l | 0; | ||
6298 | w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0; | ||
6299 | xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0; | ||
6300 | w13l = w13l + xl | 0; | ||
6301 | w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6302 | xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0; | ||
6303 | w13l = w13l + xl | 0; | ||
6304 | w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6305 | tl = 4234509866 + w13l | 0; | ||
6306 | th = 1501505948 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0; | ||
6307 | tl = tl + hl | 0; | ||
6308 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6309 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6310 | tl = tl + xl | 0; | ||
6311 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6312 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6313 | tl = tl + xl | 0; | ||
6314 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6315 | hl = gl; | ||
6316 | hh = gh; | ||
6317 | gl = fl; | ||
6318 | gh = fh; | ||
6319 | fl = el; | ||
6320 | fh = eh; | ||
6321 | el = dl + tl | 0; | ||
6322 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6323 | dl = cl; | ||
6324 | dh = ch; | ||
6325 | cl = bl; | ||
6326 | ch = bh; | ||
6327 | bl = al; | ||
6328 | bh = ah; | ||
6329 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6330 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6331 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6332 | al = al + xl | 0; | ||
6333 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6334 | w14l = w14l + w7l | 0; | ||
6335 | w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0; | ||
6336 | xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0; | ||
6337 | w14l = w14l + xl | 0; | ||
6338 | w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6339 | xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0; | ||
6340 | w14l = w14l + xl | 0; | ||
6341 | w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6342 | tl = 987167468 + w14l | 0; | ||
6343 | th = 1607167915 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0; | ||
6344 | tl = tl + hl | 0; | ||
6345 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6346 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6347 | tl = tl + xl | 0; | ||
6348 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6349 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6350 | tl = tl + xl | 0; | ||
6351 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6352 | hl = gl; | ||
6353 | hh = gh; | ||
6354 | gl = fl; | ||
6355 | gh = fh; | ||
6356 | fl = el; | ||
6357 | fh = eh; | ||
6358 | el = dl + tl | 0; | ||
6359 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6360 | dl = cl; | ||
6361 | dh = ch; | ||
6362 | cl = bl; | ||
6363 | ch = bh; | ||
6364 | bl = al; | ||
6365 | bh = ah; | ||
6366 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6367 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6368 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6369 | al = al + xl | 0; | ||
6370 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6371 | w15l = w15l + w8l | 0; | ||
6372 | w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0; | ||
6373 | xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0; | ||
6374 | w15l = w15l + xl | 0; | ||
6375 | w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6376 | xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0; | ||
6377 | w15l = w15l + xl | 0; | ||
6378 | w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6379 | tl = 1246189591 + w15l | 0; | ||
6380 | th = 1816402316 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0; | ||
6381 | tl = tl + hl | 0; | ||
6382 | th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6383 | xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0; | ||
6384 | tl = tl + xl | 0; | ||
6385 | th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6386 | xl = gl ^ el & (fl ^ gl) | 0; | ||
6387 | tl = tl + xl | 0; | ||
6388 | th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6389 | hl = gl; | ||
6390 | hh = gh; | ||
6391 | gl = fl; | ||
6392 | gh = fh; | ||
6393 | fl = el; | ||
6394 | fh = eh; | ||
6395 | el = dl + tl | 0; | ||
6396 | eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6397 | dl = cl; | ||
6398 | dh = ch; | ||
6399 | cl = bl; | ||
6400 | ch = bh; | ||
6401 | bl = al; | ||
6402 | bh = ah; | ||
6403 | al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0; | ||
6404 | ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0; | ||
6405 | xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0; | ||
6406 | al = al + xl | 0; | ||
6407 | ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0; | ||
6408 | H0l = H0l + al | 0; | ||
6409 | H0h = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0) | 0; | ||
6410 | H1l = H1l + bl | 0; | ||
6411 | H1h = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0) | 0; | ||
6412 | H2l = H2l + cl | 0; | ||
6413 | H2h = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0) | 0; | ||
6414 | H3l = H3l + dl | 0; | ||
6415 | H3h = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0) | 0; | ||
6416 | H4l = H4l + el | 0; | ||
6417 | H4h = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0) | 0; | ||
6418 | H5l = H5l + fl | 0; | ||
6419 | H5h = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0) | 0; | ||
6420 | H6l = H6l + gl | 0; | ||
6421 | H6h = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0) | 0; | ||
6422 | H7l = H7l + hl | 0; | ||
6423 | H7h = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0) | 0; | ||
6424 | } | ||
6425 | function _core_heap(offset) { | ||
6426 | offset = offset | 0; | ||
6427 | _core(HEAP[offset | 0] << 24 | HEAP[offset | 1] << 16 | HEAP[offset | 2] << 8 | HEAP[offset | 3], HEAP[offset | 4] << 24 | HEAP[offset | 5] << 16 | HEAP[offset | 6] << 8 | HEAP[offset | 7], HEAP[offset | 8] << 24 | HEAP[offset | 9] << 16 | HEAP[offset | 10] << 8 | HEAP[offset | 11], HEAP[offset | 12] << 24 | HEAP[offset | 13] << 16 | HEAP[offset | 14] << 8 | HEAP[offset | 15], HEAP[offset | 16] << 24 | HEAP[offset | 17] << 16 | HEAP[offset | 18] << 8 | HEAP[offset | 19], HEAP[offset | 20] << 24 | HEAP[offset | 21] << 16 | HEAP[offset | 22] << 8 | HEAP[offset | 23], HEAP[offset | 24] << 24 | HEAP[offset | 25] << 16 | HEAP[offset | 26] << 8 | HEAP[offset | 27], HEAP[offset | 28] << 24 | HEAP[offset | 29] << 16 | HEAP[offset | 30] << 8 | HEAP[offset | 31], HEAP[offset | 32] << 24 | HEAP[offset | 33] << 16 | HEAP[offset | 34] << 8 | HEAP[offset | 35], HEAP[offset | 36] << 24 | HEAP[offset | 37] << 16 | HEAP[offset | 38] << 8 | HEAP[offset | 39], HEAP[offset | 40] << 24 | HEAP[offset | 41] << 16 | HEAP[offset | 42] << 8 | HEAP[offset | 43], HEAP[offset | 44] << 24 | HEAP[offset | 45] << 16 | HEAP[offset | 46] << 8 | HEAP[offset | 47], HEAP[offset | 48] << 24 | HEAP[offset | 49] << 16 | HEAP[offset | 50] << 8 | HEAP[offset | 51], HEAP[offset | 52] << 24 | HEAP[offset | 53] << 16 | HEAP[offset | 54] << 8 | HEAP[offset | 55], HEAP[offset | 56] << 24 | HEAP[offset | 57] << 16 | HEAP[offset | 58] << 8 | HEAP[offset | 59], HEAP[offset | 60] << 24 | HEAP[offset | 61] << 16 | HEAP[offset | 62] << 8 | HEAP[offset | 63], HEAP[offset | 64] << 24 | HEAP[offset | 65] << 16 | HEAP[offset | 66] << 8 | HEAP[offset | 67], HEAP[offset | 68] << 24 | HEAP[offset | 69] << 16 | HEAP[offset | 70] << 8 | HEAP[offset | 71], HEAP[offset | 72] << 24 | HEAP[offset | 73] << 16 | HEAP[offset | 74] << 8 | HEAP[offset | 75], HEAP[offset | 76] << 24 | HEAP[offset | 77] << 16 | HEAP[offset | 78] << 8 | HEAP[offset | 79], HEAP[offset | 80] << 24 | HEAP[offset | 81] << 16 | HEAP[offset | 82] << 8 | HEAP[offset | 83], HEAP[offset | 84] << 24 | HEAP[offset | 85] << 16 | HEAP[offset | 86] << 8 | HEAP[offset | 87], HEAP[offset | 88] << 24 | HEAP[offset | 89] << 16 | HEAP[offset | 90] << 8 | HEAP[offset | 91], HEAP[offset | 92] << 24 | HEAP[offset | 93] << 16 | HEAP[offset | 94] << 8 | HEAP[offset | 95], HEAP[offset | 96] << 24 | HEAP[offset | 97] << 16 | HEAP[offset | 98] << 8 | HEAP[offset | 99], HEAP[offset | 100] << 24 | HEAP[offset | 101] << 16 | HEAP[offset | 102] << 8 | HEAP[offset | 103], HEAP[offset | 104] << 24 | HEAP[offset | 105] << 16 | HEAP[offset | 106] << 8 | HEAP[offset | 107], HEAP[offset | 108] << 24 | HEAP[offset | 109] << 16 | HEAP[offset | 110] << 8 | HEAP[offset | 111], HEAP[offset | 112] << 24 | HEAP[offset | 113] << 16 | HEAP[offset | 114] << 8 | HEAP[offset | 115], HEAP[offset | 116] << 24 | HEAP[offset | 117] << 16 | HEAP[offset | 118] << 8 | HEAP[offset | 119], HEAP[offset | 120] << 24 | HEAP[offset | 121] << 16 | HEAP[offset | 122] << 8 | HEAP[offset | 123], HEAP[offset | 124] << 24 | HEAP[offset | 125] << 16 | HEAP[offset | 126] << 8 | HEAP[offset | 127]); | ||
6428 | } | ||
6429 | function _state_to_heap(output) { | ||
6430 | output = output | 0; | ||
6431 | HEAP[output | 0] = H0h >>> 24; | ||
6432 | HEAP[output | 1] = H0h >>> 16 & 255; | ||
6433 | HEAP[output | 2] = H0h >>> 8 & 255; | ||
6434 | HEAP[output | 3] = H0h & 255; | ||
6435 | HEAP[output | 4] = H0l >>> 24; | ||
6436 | HEAP[output | 5] = H0l >>> 16 & 255; | ||
6437 | HEAP[output | 6] = H0l >>> 8 & 255; | ||
6438 | HEAP[output | 7] = H0l & 255; | ||
6439 | HEAP[output | 8] = H1h >>> 24; | ||
6440 | HEAP[output | 9] = H1h >>> 16 & 255; | ||
6441 | HEAP[output | 10] = H1h >>> 8 & 255; | ||
6442 | HEAP[output | 11] = H1h & 255; | ||
6443 | HEAP[output | 12] = H1l >>> 24; | ||
6444 | HEAP[output | 13] = H1l >>> 16 & 255; | ||
6445 | HEAP[output | 14] = H1l >>> 8 & 255; | ||
6446 | HEAP[output | 15] = H1l & 255; | ||
6447 | HEAP[output | 16] = H2h >>> 24; | ||
6448 | HEAP[output | 17] = H2h >>> 16 & 255; | ||
6449 | HEAP[output | 18] = H2h >>> 8 & 255; | ||
6450 | HEAP[output | 19] = H2h & 255; | ||
6451 | HEAP[output | 20] = H2l >>> 24; | ||
6452 | HEAP[output | 21] = H2l >>> 16 & 255; | ||
6453 | HEAP[output | 22] = H2l >>> 8 & 255; | ||
6454 | HEAP[output | 23] = H2l & 255; | ||
6455 | HEAP[output | 24] = H3h >>> 24; | ||
6456 | HEAP[output | 25] = H3h >>> 16 & 255; | ||
6457 | HEAP[output | 26] = H3h >>> 8 & 255; | ||
6458 | HEAP[output | 27] = H3h & 255; | ||
6459 | HEAP[output | 28] = H3l >>> 24; | ||
6460 | HEAP[output | 29] = H3l >>> 16 & 255; | ||
6461 | HEAP[output | 30] = H3l >>> 8 & 255; | ||
6462 | HEAP[output | 31] = H3l & 255; | ||
6463 | HEAP[output | 32] = H4h >>> 24; | ||
6464 | HEAP[output | 33] = H4h >>> 16 & 255; | ||
6465 | HEAP[output | 34] = H4h >>> 8 & 255; | ||
6466 | HEAP[output | 35] = H4h & 255; | ||
6467 | HEAP[output | 36] = H4l >>> 24; | ||
6468 | HEAP[output | 37] = H4l >>> 16 & 255; | ||
6469 | HEAP[output | 38] = H4l >>> 8 & 255; | ||
6470 | HEAP[output | 39] = H4l & 255; | ||
6471 | HEAP[output | 40] = H5h >>> 24; | ||
6472 | HEAP[output | 41] = H5h >>> 16 & 255; | ||
6473 | HEAP[output | 42] = H5h >>> 8 & 255; | ||
6474 | HEAP[output | 43] = H5h & 255; | ||
6475 | HEAP[output | 44] = H5l >>> 24; | ||
6476 | HEAP[output | 45] = H5l >>> 16 & 255; | ||
6477 | HEAP[output | 46] = H5l >>> 8 & 255; | ||
6478 | HEAP[output | 47] = H5l & 255; | ||
6479 | HEAP[output | 48] = H6h >>> 24; | ||
6480 | HEAP[output | 49] = H6h >>> 16 & 255; | ||
6481 | HEAP[output | 50] = H6h >>> 8 & 255; | ||
6482 | HEAP[output | 51] = H6h & 255; | ||
6483 | HEAP[output | 52] = H6l >>> 24; | ||
6484 | HEAP[output | 53] = H6l >>> 16 & 255; | ||
6485 | HEAP[output | 54] = H6l >>> 8 & 255; | ||
6486 | HEAP[output | 55] = H6l & 255; | ||
6487 | HEAP[output | 56] = H7h >>> 24; | ||
6488 | HEAP[output | 57] = H7h >>> 16 & 255; | ||
6489 | HEAP[output | 58] = H7h >>> 8 & 255; | ||
6490 | HEAP[output | 59] = H7h & 255; | ||
6491 | HEAP[output | 60] = H7l >>> 24; | ||
6492 | HEAP[output | 61] = H7l >>> 16 & 255; | ||
6493 | HEAP[output | 62] = H7l >>> 8 & 255; | ||
6494 | HEAP[output | 63] = H7l & 255; | ||
6495 | } | ||
6496 | function reset() { | ||
6497 | H0h = 1779033703; | ||
6498 | H0l = 4089235720; | ||
6499 | H1h = 3144134277; | ||
6500 | H1l = 2227873595; | ||
6501 | H2h = 1013904242; | ||
6502 | H2l = 4271175723; | ||
6503 | H3h = 2773480762; | ||
6504 | H3l = 1595750129; | ||
6505 | H4h = 1359893119; | ||
6506 | H4l = 2917565137; | ||
6507 | H5h = 2600822924; | ||
6508 | H5l = 725511199; | ||
6509 | H6h = 528734635; | ||
6510 | H6l = 4215389547; | ||
6511 | H7h = 1541459225; | ||
6512 | H7l = 327033209; | ||
6513 | TOTAL = 0; | ||
6514 | } | ||
6515 | function init(h0h, h0l, h1h, h1l, h2h, h2l, h3h, h3l, h4h, h4l, h5h, h5l, h6h, h6l, h7h, h7l, total) { | ||
6516 | h0h = h0h | 0; | ||
6517 | h0l = h0l | 0; | ||
6518 | h1h = h1h | 0; | ||
6519 | h1l = h1l | 0; | ||
6520 | h2h = h2h | 0; | ||
6521 | h2l = h2l | 0; | ||
6522 | h3h = h3h | 0; | ||
6523 | h3l = h3l | 0; | ||
6524 | h4h = h4h | 0; | ||
6525 | h4l = h4l | 0; | ||
6526 | h5h = h5h | 0; | ||
6527 | h5l = h5l | 0; | ||
6528 | h6h = h6h | 0; | ||
6529 | h6l = h6l | 0; | ||
6530 | h7h = h7h | 0; | ||
6531 | h7l = h7l | 0; | ||
6532 | total = total | 0; | ||
6533 | H0h = h0h; | ||
6534 | H0l = h0l; | ||
6535 | H1h = h1h; | ||
6536 | H1l = h1l; | ||
6537 | H2h = h2h; | ||
6538 | H2l = h2l; | ||
6539 | H3h = h3h; | ||
6540 | H3l = h3l; | ||
6541 | H4h = h4h; | ||
6542 | H4l = h4l; | ||
6543 | H5h = h5h; | ||
6544 | H5l = h5l; | ||
6545 | H6h = h6h; | ||
6546 | H6l = h6l; | ||
6547 | H7h = h7h; | ||
6548 | H7l = h7l; | ||
6549 | TOTAL = total; | ||
6550 | } | ||
6551 | function process(offset, length) { | ||
6552 | offset = offset | 0; | ||
6553 | length = length | 0; | ||
6554 | var hashed = 0; | ||
6555 | if (offset & 127) return -1; | ||
6556 | while ((length | 0) >= 128) { | ||
6557 | _core_heap(offset); | ||
6558 | offset = offset + 128 | 0; | ||
6559 | length = length - 128 | 0; | ||
6560 | hashed = hashed + 128 | 0; | ||
6561 | } | ||
6562 | TOTAL = TOTAL + hashed | 0; | ||
6563 | return hashed | 0; | ||
6564 | } | ||
6565 | function finish(offset, length, output) { | ||
6566 | offset = offset | 0; | ||
6567 | length = length | 0; | ||
6568 | output = output | 0; | ||
6569 | var hashed = 0, i = 0; | ||
6570 | if (offset & 127) return -1; | ||
6571 | if (~output) if (output & 63) return -1; | ||
6572 | if ((length | 0) >= 128) { | ||
6573 | hashed = process(offset, length) | 0; | ||
6574 | if ((hashed | 0) == -1) return -1; | ||
6575 | offset = offset + hashed | 0; | ||
6576 | length = length - hashed | 0; | ||
6577 | } | ||
6578 | hashed = hashed + length | 0; | ||
6579 | TOTAL = TOTAL + length | 0; | ||
6580 | HEAP[offset | length] = 128; | ||
6581 | if ((length | 0) >= 112) { | ||
6582 | for (i = length + 1 | 0; (i | 0) < 128; i = i + 1 | 0) HEAP[offset | i] = 0; | ||
6583 | _core_heap(offset); | ||
6584 | length = 0; | ||
6585 | HEAP[offset | 0] = 0; | ||
6586 | } | ||
6587 | for (i = length + 1 | 0; (i | 0) < 123; i = i + 1 | 0) HEAP[offset | i] = 0; | ||
6588 | HEAP[offset | 123] = TOTAL >>> 29; | ||
6589 | HEAP[offset | 124] = TOTAL >>> 21 & 255; | ||
6590 | HEAP[offset | 125] = TOTAL >>> 13 & 255; | ||
6591 | HEAP[offset | 126] = TOTAL >>> 5 & 255; | ||
6592 | HEAP[offset | 127] = TOTAL << 3 & 255; | ||
6593 | _core_heap(offset); | ||
6594 | if (~output) _state_to_heap(output); | ||
6595 | return hashed | 0; | ||
6596 | } | ||
6597 | function hmac_reset() { | ||
6598 | H0h = I0h; | ||
6599 | H0l = I0l; | ||
6600 | H1h = I1h; | ||
6601 | H1l = I1l; | ||
6602 | H2h = I2h; | ||
6603 | H2l = I2l; | ||
6604 | H3h = I3h; | ||
6605 | H3l = I3l; | ||
6606 | H4h = I4h; | ||
6607 | H4l = I4l; | ||
6608 | H5h = I5h; | ||
6609 | H5l = I5l; | ||
6610 | H6h = I6h; | ||
6611 | H6l = I6l; | ||
6612 | H7h = I7h; | ||
6613 | H7l = I7l; | ||
6614 | TOTAL = 128; | ||
6615 | } | ||
6616 | function _hmac_opad() { | ||
6617 | H0h = O0h; | ||
6618 | H0l = O0l; | ||
6619 | H1h = O1h; | ||
6620 | H1l = O1l; | ||
6621 | H2h = O2h; | ||
6622 | H2l = O2l; | ||
6623 | H3h = O3h; | ||
6624 | H3l = O3l; | ||
6625 | H4h = O4h; | ||
6626 | H4l = O4l; | ||
6627 | H5h = O5h; | ||
6628 | H5l = O5l; | ||
6629 | H6h = O6h; | ||
6630 | H6l = O6l; | ||
6631 | H7h = O7h; | ||
6632 | H7l = O7l; | ||
6633 | TOTAL = 128; | ||
6634 | } | ||
6635 | function hmac_init(p0h, p0l, p1h, p1l, p2h, p2l, p3h, p3l, p4h, p4l, p5h, p5l, p6h, p6l, p7h, p7l, p8h, p8l, p9h, p9l, p10h, p10l, p11h, p11l, p12h, p12l, p13h, p13l, p14h, p14l, p15h, p15l) { | ||
6636 | p0h = p0h | 0; | ||
6637 | p0l = p0l | 0; | ||
6638 | p1h = p1h | 0; | ||
6639 | p1l = p1l | 0; | ||
6640 | p2h = p2h | 0; | ||
6641 | p2l = p2l | 0; | ||
6642 | p3h = p3h | 0; | ||
6643 | p3l = p3l | 0; | ||
6644 | p4h = p4h | 0; | ||
6645 | p4l = p4l | 0; | ||
6646 | p5h = p5h | 0; | ||
6647 | p5l = p5l | 0; | ||
6648 | p6h = p6h | 0; | ||
6649 | p6l = p6l | 0; | ||
6650 | p7h = p7h | 0; | ||
6651 | p7l = p7l | 0; | ||
6652 | p8h = p8h | 0; | ||
6653 | p8l = p8l | 0; | ||
6654 | p9h = p9h | 0; | ||
6655 | p9l = p9l | 0; | ||
6656 | p10h = p10h | 0; | ||
6657 | p10l = p10l | 0; | ||
6658 | p11h = p11h | 0; | ||
6659 | p11l = p11l | 0; | ||
6660 | p12h = p12h | 0; | ||
6661 | p12l = p12l | 0; | ||
6662 | p13h = p13h | 0; | ||
6663 | p13l = p13l | 0; | ||
6664 | p14h = p14h | 0; | ||
6665 | p14l = p14l | 0; | ||
6666 | p15h = p15h | 0; | ||
6667 | p15l = p15l | 0; | ||
6668 | reset(); | ||
6669 | _core(p0h ^ 1549556828, p0l ^ 1549556828, p1h ^ 1549556828, p1l ^ 1549556828, p2h ^ 1549556828, p2l ^ 1549556828, p3h ^ 1549556828, p3l ^ 1549556828, p4h ^ 1549556828, p4l ^ 1549556828, p5h ^ 1549556828, p5l ^ 1549556828, p6h ^ 1549556828, p6l ^ 1549556828, p7h ^ 1549556828, p7l ^ 1549556828, p8h ^ 1549556828, p8l ^ 1549556828, p9h ^ 1549556828, p9l ^ 1549556828, p10h ^ 1549556828, p10l ^ 1549556828, p11h ^ 1549556828, p11l ^ 1549556828, p12h ^ 1549556828, p12l ^ 1549556828, p13h ^ 1549556828, p13l ^ 1549556828, p14h ^ 1549556828, p14l ^ 1549556828, p15h ^ 1549556828, p15l ^ 1549556828); | ||
6670 | O0h = H0h; | ||
6671 | O0l = H0l; | ||
6672 | O1h = H1h; | ||
6673 | O1l = H1l; | ||
6674 | O2h = H2h; | ||
6675 | O2l = H2l; | ||
6676 | O3h = H3h; | ||
6677 | O3l = H3l; | ||
6678 | O4h = H4h; | ||
6679 | O4l = H4l; | ||
6680 | O5h = H5h; | ||
6681 | O5l = H5l; | ||
6682 | O6h = H6h; | ||
6683 | O6l = H6l; | ||
6684 | O7h = H7h; | ||
6685 | O7l = H7l; | ||
6686 | reset(); | ||
6687 | _core(p0h ^ 909522486, p0l ^ 909522486, p1h ^ 909522486, p1l ^ 909522486, p2h ^ 909522486, p2l ^ 909522486, p3h ^ 909522486, p3l ^ 909522486, p4h ^ 909522486, p4l ^ 909522486, p5h ^ 909522486, p5l ^ 909522486, p6h ^ 909522486, p6l ^ 909522486, p7h ^ 909522486, p7l ^ 909522486, p8h ^ 909522486, p8l ^ 909522486, p9h ^ 909522486, p9l ^ 909522486, p10h ^ 909522486, p10l ^ 909522486, p11h ^ 909522486, p11l ^ 909522486, p12h ^ 909522486, p12l ^ 909522486, p13h ^ 909522486, p13l ^ 909522486, p14h ^ 909522486, p14l ^ 909522486, p15h ^ 909522486, p15l ^ 909522486); | ||
6688 | I0h = H0h; | ||
6689 | I0l = H0l; | ||
6690 | I1h = H1h; | ||
6691 | I1l = H1l; | ||
6692 | I2h = H2h; | ||
6693 | I2l = H2l; | ||
6694 | I3h = H3h; | ||
6695 | I3l = H3l; | ||
6696 | I4h = H4h; | ||
6697 | I4l = H4l; | ||
6698 | I5h = H5h; | ||
6699 | I5l = H5l; | ||
6700 | I6h = H6h; | ||
6701 | I6l = H6l; | ||
6702 | I7h = H7h; | ||
6703 | I7l = H7l; | ||
6704 | TOTAL = 128; | ||
6705 | } | ||
6706 | function hmac_finish(offset, length, output) { | ||
6707 | offset = offset | 0; | ||
6708 | length = length | 0; | ||
6709 | output = output | 0; | ||
6710 | var t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0, t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0, hashed = 0; | ||
6711 | if (offset & 127) return -1; | ||
6712 | if (~output) if (output & 63) return -1; | ||
6713 | hashed = finish(offset, length, -1) | 0; | ||
6714 | t0h = H0h; | ||
6715 | t0l = H0l; | ||
6716 | t1h = H1h; | ||
6717 | t1l = H1l; | ||
6718 | t2h = H2h; | ||
6719 | t2l = H2l; | ||
6720 | t3h = H3h; | ||
6721 | t3l = H3l; | ||
6722 | t4h = H4h; | ||
6723 | t4l = H4l; | ||
6724 | t5h = H5h; | ||
6725 | t5l = H5l; | ||
6726 | t6h = H6h; | ||
6727 | t6l = H6l; | ||
6728 | t7h = H7h; | ||
6729 | t7l = H7l; | ||
6730 | _hmac_opad(); | ||
6731 | _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536); | ||
6732 | if (~output) _state_to_heap(output); | ||
6733 | return hashed | 0; | ||
6734 | } | ||
6735 | function pbkdf2_generate_block(offset, length, block, count, output) { | ||
6736 | offset = offset | 0; | ||
6737 | length = length | 0; | ||
6738 | block = block | 0; | ||
6739 | count = count | 0; | ||
6740 | output = output | 0; | ||
6741 | var h0h = 0, h0l = 0, h1h = 0, h1l = 0, h2h = 0, h2l = 0, h3h = 0, h3l = 0, h4h = 0, h4l = 0, h5h = 0, h5l = 0, h6h = 0, h6l = 0, h7h = 0, h7l = 0, t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0, t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0; | ||
6742 | if (offset & 127) return -1; | ||
6743 | if (~output) if (output & 63) return -1; | ||
6744 | HEAP[offset + length | 0] = block >>> 24; | ||
6745 | HEAP[offset + length + 1 | 0] = block >>> 16 & 255; | ||
6746 | HEAP[offset + length + 2 | 0] = block >>> 8 & 255; | ||
6747 | HEAP[offset + length + 3 | 0] = block & 255; | ||
6748 | hmac_finish(offset, length + 4 | 0, -1) | 0; | ||
6749 | h0h = t0h = H0h; | ||
6750 | h0l = t0l = H0l; | ||
6751 | h1h = t1h = H1h; | ||
6752 | h1l = t1l = H1l; | ||
6753 | h2h = t2h = H2h; | ||
6754 | h2l = t2l = H2l; | ||
6755 | h3h = t3h = H3h; | ||
6756 | h3l = t3l = H3l; | ||
6757 | h4h = t4h = H4h; | ||
6758 | h4l = t4l = H4l; | ||
6759 | h5h = t5h = H5h; | ||
6760 | h5l = t5l = H5l; | ||
6761 | h6h = t6h = H6h; | ||
6762 | h6l = t6l = H6l; | ||
6763 | h7h = t7h = H7h; | ||
6764 | h7l = t7l = H7l; | ||
6765 | count = count - 1 | 0; | ||
6766 | while ((count | 0) > 0) { | ||
6767 | hmac_reset(); | ||
6768 | _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536); | ||
6769 | t0h = H0h; | ||
6770 | t0l = H0l; | ||
6771 | t1h = H1h; | ||
6772 | t1l = H1l; | ||
6773 | t2h = H2h; | ||
6774 | t2l = H2l; | ||
6775 | t3h = H3h; | ||
6776 | t3l = H3l; | ||
6777 | t4h = H4h; | ||
6778 | t4l = H4l; | ||
6779 | t5h = H5h; | ||
6780 | t5l = H5l; | ||
6781 | t6h = H6h; | ||
6782 | t6l = H6l; | ||
6783 | t7h = H7h; | ||
6784 | t7l = H7l; | ||
6785 | _hmac_opad(); | ||
6786 | _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536); | ||
6787 | t0h = H0h; | ||
6788 | t0l = H0l; | ||
6789 | t1h = H1h; | ||
6790 | t1l = H1l; | ||
6791 | t2h = H2h; | ||
6792 | t2l = H2l; | ||
6793 | t3h = H3h; | ||
6794 | t3l = H3l; | ||
6795 | t4h = H4h; | ||
6796 | t4l = H4l; | ||
6797 | t5h = H5h; | ||
6798 | t5l = H5l; | ||
6799 | t6h = H6h; | ||
6800 | t6l = H6l; | ||
6801 | t7h = H7h; | ||
6802 | t7l = H7l; | ||
6803 | h0h = h0h ^ H0h; | ||
6804 | h0l = h0l ^ H0l; | ||
6805 | h1h = h1h ^ H1h; | ||
6806 | h1l = h1l ^ H1l; | ||
6807 | h2h = h2h ^ H2h; | ||
6808 | h2l = h2l ^ H2l; | ||
6809 | h3h = h3h ^ H3h; | ||
6810 | h3l = h3l ^ H3l; | ||
6811 | h4h = h4h ^ H4h; | ||
6812 | h4l = h4l ^ H4l; | ||
6813 | h5h = h5h ^ H5h; | ||
6814 | h5l = h5l ^ H5l; | ||
6815 | h6h = h6h ^ H6h; | ||
6816 | h6l = h6l ^ H6l; | ||
6817 | h7h = h7h ^ H7h; | ||
6818 | h7l = h7l ^ H7l; | ||
6819 | count = count - 1 | 0; | ||
6820 | } | ||
6821 | H0h = h0h; | ||
6822 | H0l = h0l; | ||
6823 | H1h = h1h; | ||
6824 | H1l = h1l; | ||
6825 | H2h = h2h; | ||
6826 | H2l = h2l; | ||
6827 | H3h = h3h; | ||
6828 | H3l = h3l; | ||
6829 | H4h = h4h; | ||
6830 | H4l = h4l; | ||
6831 | H5h = h5h; | ||
6832 | H5l = h5l; | ||
6833 | H6h = h6h; | ||
6834 | H6l = h6l; | ||
6835 | H7h = h7h; | ||
6836 | H7l = h7l; | ||
6837 | if (~output) _state_to_heap(output); | ||
6838 | return 0; | ||
6839 | } | ||
6840 | return { | ||
6841 | reset: reset, | ||
6842 | init: init, | ||
6843 | process: process, | ||
6844 | finish: finish, | ||
6845 | hmac_reset: hmac_reset, | ||
6846 | hmac_init: hmac_init, | ||
6847 | hmac_finish: hmac_finish, | ||
6848 | pbkdf2_generate_block: pbkdf2_generate_block | ||
6849 | }; | ||
6850 | } | ||
6851 | var _sha512_block_size = 128, _sha512_hash_size = 64; | ||
6852 | function sha512_constructor(options) { | ||
6853 | options = options || {}; | ||
6854 | options.heapSize = options.heapSize || 4096; | ||
6855 | if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096"); | ||
6856 | this.heap = options.heap || new Uint8Array(options.heapSize); | ||
6857 | this.asm = options.asm || sha512_asm(global, null, this.heap.buffer); | ||
6858 | this.BLOCK_SIZE = _sha512_block_size; | ||
6859 | this.HASH_SIZE = _sha512_hash_size; | ||
6860 | this.reset(); | ||
6861 | } | ||
6862 | function sha512_reset() { | ||
6863 | this.result = null; | ||
6864 | this.pos = 0; | ||
6865 | this.len = 0; | ||
6866 | this.asm.reset(); | ||
6867 | return this; | ||
6868 | } | ||
6869 | function sha512_process(data) { | ||
6870 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
6871 | var dpos = 0, dlen = 0, clen = 0; | ||
6872 | if (is_buffer(data) || is_bytes(data)) { | ||
6873 | dpos = data.byteOffset || 0; | ||
6874 | dlen = data.byteLength; | ||
6875 | } else if (is_string(data)) { | ||
6876 | dlen = data.length; | ||
6877 | } else { | ||
6878 | throw new TypeError("data isn't of expected type"); | ||
6879 | } | ||
6880 | while (dlen > 0) { | ||
6881 | clen = this.heap.byteLength - this.pos - this.len; | ||
6882 | clen = clen < dlen ? clen : dlen; | ||
6883 | if (is_buffer(data) || is_bytes(data)) { | ||
6884 | this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len); | ||
6885 | } else { | ||
6886 | for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i); | ||
6887 | } | ||
6888 | this.len += clen; | ||
6889 | dpos += clen; | ||
6890 | dlen -= clen; | ||
6891 | clen = this.asm.process(this.pos, this.len); | ||
6892 | if (clen < this.len) { | ||
6893 | this.pos += clen; | ||
6894 | this.len -= clen; | ||
6895 | } else { | ||
6896 | this.pos = 0; | ||
6897 | this.len = 0; | ||
6898 | } | ||
6899 | } | ||
6900 | return this; | ||
6901 | } | ||
6902 | function sha512_finish() { | ||
6903 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
6904 | this.asm.finish(this.pos, this.len, 0); | ||
6905 | this.result = new Uint8Array(_sha512_hash_size); | ||
6906 | this.result.set(this.heap.subarray(0, _sha512_hash_size)); | ||
6907 | this.pos = 0; | ||
6908 | this.len = 0; | ||
6909 | return this; | ||
6910 | } | ||
6911 | sha512_constructor.BLOCK_SIZE = _sha512_block_size; | ||
6912 | sha512_constructor.HASH_SIZE = _sha512_hash_size; | ||
6913 | var sha512_prototype = sha512_constructor.prototype; | ||
6914 | sha512_prototype.reset = sha512_reset; | ||
6915 | sha512_prototype.process = sha512_process; | ||
6916 | sha512_prototype.finish = sha512_finish; | ||
6917 | function hmac_constructor(options) { | ||
6918 | options = options || {}; | ||
6919 | if (!options.hash) throw new SyntaxError("option 'hash' is required"); | ||
6920 | if (!options.hash.HASH_SIZE) throw new SyntaxError("option 'hash' supplied doesn't seem to be a valid hash function"); | ||
6921 | this.hash = options.hash; | ||
6922 | this.BLOCK_SIZE = this.hash.BLOCK_SIZE; | ||
6923 | this.HMAC_SIZE = this.hash.HASH_SIZE; | ||
6924 | this.key = null; | ||
6925 | this.verify = null; | ||
6926 | this.result = null; | ||
6927 | if (options.password !== undefined || options.verify !== undefined) this.reset(options); | ||
6928 | return this; | ||
6929 | } | ||
6930 | function hmac_sha256_constructor(options) { | ||
6931 | options = options || {}; | ||
6932 | if (!(options.hash instanceof sha256_constructor)) options.hash = new sha256_constructor(options); | ||
6933 | hmac_constructor.call(this, options); | ||
6934 | return this; | ||
6935 | } | ||
6936 | function hmac_sha512_constructor(options) { | ||
6937 | options = options || {}; | ||
6938 | if (!(options.hash instanceof sha512_constructor)) options.hash = new sha512_constructor(options); | ||
6939 | hmac_constructor.call(this, options); | ||
6940 | return this; | ||
6941 | } | ||
6942 | function _hmac_key(hash, password) { | ||
6943 | var key; | ||
6944 | if (is_buffer(password) || is_bytes(password)) { | ||
6945 | key = new Uint8Array(hash.BLOCK_SIZE); | ||
6946 | if (password.byteLength > hash.BLOCK_SIZE) { | ||
6947 | key.set(new Uint8Array(hash.reset().process(password).finish().result)); | ||
6948 | } else if (is_buffer(password)) { | ||
6949 | key.set(new Uint8Array(password)); | ||
6950 | } else { | ||
6951 | key.set(password); | ||
6952 | } | ||
6953 | } else if (is_string(password)) { | ||
6954 | key = new Uint8Array(hash.BLOCK_SIZE); | ||
6955 | if (password.length > hash.BLOCK_SIZE) { | ||
6956 | key.set(new Uint8Array(hash.reset().process(password).finish().result)); | ||
6957 | } else { | ||
6958 | for (var i = 0; i < password.length; ++i) key[i] = password.charCodeAt(i); | ||
6959 | } | ||
6960 | } else { | ||
6961 | throw new TypeError("password isn't of expected type"); | ||
6962 | } | ||
6963 | return key; | ||
6964 | } | ||
6965 | function _hmac_init_verify(verify) { | ||
6966 | if (is_buffer(verify) || is_bytes(verify)) { | ||
6967 | verify = new Uint8Array(verify); | ||
6968 | } else if (is_string(verify)) { | ||
6969 | verify = string_to_bytes(verify); | ||
6970 | } else { | ||
6971 | throw new TypeError("verify tag isn't of expected type"); | ||
6972 | } | ||
6973 | if (verify.length !== this.HMAC_SIZE) throw new IllegalArgumentError("illegal verification tag size"); | ||
6974 | this.verify = verify; | ||
6975 | } | ||
6976 | function hmac_reset(options) { | ||
6977 | options = options || {}; | ||
6978 | var password = options.password; | ||
6979 | if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance"); | ||
6980 | this.result = null; | ||
6981 | this.hash.reset(); | ||
6982 | if (password || is_string(password)) this.key = _hmac_key(this.hash, password); | ||
6983 | var ipad = new Uint8Array(this.key); | ||
6984 | for (var i = 0; i < ipad.length; ++i) ipad[i] ^= 54; | ||
6985 | this.hash.process(ipad); | ||
6986 | var verify = options.verify; | ||
6987 | if (verify !== undefined) { | ||
6988 | _hmac_init_verify.call(this, verify); | ||
6989 | } else { | ||
6990 | this.verify = null; | ||
6991 | } | ||
6992 | return this; | ||
6993 | } | ||
6994 | function hmac_sha256_reset(options) { | ||
6995 | options = options || {}; | ||
6996 | var password = options.password; | ||
6997 | if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance"); | ||
6998 | this.result = null; | ||
6999 | this.hash.reset(); | ||
7000 | if (password || is_string(password)) { | ||
7001 | this.key = _hmac_key(this.hash, password); | ||
7002 | this.hash.reset().asm.hmac_init(this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3], this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7], this.key[8] << 24 | this.key[9] << 16 | this.key[10] << 8 | this.key[11], this.key[12] << 24 | this.key[13] << 16 | this.key[14] << 8 | this.key[15], this.key[16] << 24 | this.key[17] << 16 | this.key[18] << 8 | this.key[19], this.key[20] << 24 | this.key[21] << 16 | this.key[22] << 8 | this.key[23], this.key[24] << 24 | this.key[25] << 16 | this.key[26] << 8 | this.key[27], this.key[28] << 24 | this.key[29] << 16 | this.key[30] << 8 | this.key[31], this.key[32] << 24 | this.key[33] << 16 | this.key[34] << 8 | this.key[35], this.key[36] << 24 | this.key[37] << 16 | this.key[38] << 8 | this.key[39], this.key[40] << 24 | this.key[41] << 16 | this.key[42] << 8 | this.key[43], this.key[44] << 24 | this.key[45] << 16 | this.key[46] << 8 | this.key[47], this.key[48] << 24 | this.key[49] << 16 | this.key[50] << 8 | this.key[51], this.key[52] << 24 | this.key[53] << 16 | this.key[54] << 8 | this.key[55], this.key[56] << 24 | this.key[57] << 16 | this.key[58] << 8 | this.key[59], this.key[60] << 24 | this.key[61] << 16 | this.key[62] << 8 | this.key[63]); | ||
7003 | } else { | ||
7004 | this.hash.asm.hmac_reset(); | ||
7005 | } | ||
7006 | var verify = options.verify; | ||
7007 | if (verify !== undefined) { | ||
7008 | _hmac_init_verify.call(this, verify); | ||
7009 | } else { | ||
7010 | this.verify = null; | ||
7011 | } | ||
7012 | return this; | ||
7013 | } | ||
7014 | function hmac_sha512_reset(options) { | ||
7015 | options = options || {}; | ||
7016 | var password = options.password; | ||
7017 | if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance"); | ||
7018 | this.result = null; | ||
7019 | this.hash.reset(); | ||
7020 | if (password || is_string(password)) { | ||
7021 | this.key = _hmac_key(this.hash, password); | ||
7022 | this.hash.reset().asm.hmac_init(this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3], this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7], this.key[8] << 24 | this.key[9] << 16 | this.key[10] << 8 | this.key[11], this.key[12] << 24 | this.key[13] << 16 | this.key[14] << 8 | this.key[15], this.key[16] << 24 | this.key[17] << 16 | this.key[18] << 8 | this.key[19], this.key[20] << 24 | this.key[21] << 16 | this.key[22] << 8 | this.key[23], this.key[24] << 24 | this.key[25] << 16 | this.key[26] << 8 | this.key[27], this.key[28] << 24 | this.key[29] << 16 | this.key[30] << 8 | this.key[31], this.key[32] << 24 | this.key[33] << 16 | this.key[34] << 8 | this.key[35], this.key[36] << 24 | this.key[37] << 16 | this.key[38] << 8 | this.key[39], this.key[40] << 24 | this.key[41] << 16 | this.key[42] << 8 | this.key[43], this.key[44] << 24 | this.key[45] << 16 | this.key[46] << 8 | this.key[47], this.key[48] << 24 | this.key[49] << 16 | this.key[50] << 8 | this.key[51], this.key[52] << 24 | this.key[53] << 16 | this.key[54] << 8 | this.key[55], this.key[56] << 24 | this.key[57] << 16 | this.key[58] << 8 | this.key[59], this.key[60] << 24 | this.key[61] << 16 | this.key[62] << 8 | this.key[63], this.key[64] << 24 | this.key[65] << 16 | this.key[66] << 8 | this.key[67], this.key[68] << 24 | this.key[69] << 16 | this.key[70] << 8 | this.key[71], this.key[72] << 24 | this.key[73] << 16 | this.key[74] << 8 | this.key[75], this.key[76] << 24 | this.key[77] << 16 | this.key[78] << 8 | this.key[79], this.key[80] << 24 | this.key[81] << 16 | this.key[82] << 8 | this.key[83], this.key[84] << 24 | this.key[85] << 16 | this.key[86] << 8 | this.key[87], this.key[88] << 24 | this.key[89] << 16 | this.key[90] << 8 | this.key[91], this.key[92] << 24 | this.key[93] << 16 | this.key[94] << 8 | this.key[95], this.key[96] << 24 | this.key[97] << 16 | this.key[98] << 8 | this.key[99], this.key[100] << 24 | this.key[101] << 16 | this.key[102] << 8 | this.key[103], this.key[104] << 24 | this.key[105] << 16 | this.key[106] << 8 | this.key[107], this.key[108] << 24 | this.key[109] << 16 | this.key[110] << 8 | this.key[111], this.key[112] << 24 | this.key[113] << 16 | this.key[114] << 8 | this.key[115], this.key[116] << 24 | this.key[117] << 16 | this.key[118] << 8 | this.key[119], this.key[120] << 24 | this.key[121] << 16 | this.key[122] << 8 | this.key[123], this.key[124] << 24 | this.key[125] << 16 | this.key[126] << 8 | this.key[127]); | ||
7023 | } else { | ||
7024 | this.hash.asm.hmac_reset(); | ||
7025 | } | ||
7026 | var verify = options.verify; | ||
7027 | if (verify !== undefined) { | ||
7028 | _hmac_init_verify.call(this, verify); | ||
7029 | } else { | ||
7030 | this.verify = null; | ||
7031 | } | ||
7032 | return this; | ||
7033 | } | ||
7034 | function hmac_process(data) { | ||
7035 | if (this.key === null) throw new IllegalStateError("no key is associated with the instance"); | ||
7036 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7037 | this.hash.process(data); | ||
7038 | return this; | ||
7039 | } | ||
7040 | function hmac_finish() { | ||
7041 | if (this.key === null) throw new IllegalStateError("no key is associated with the instance"); | ||
7042 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7043 | var inner_result = this.hash.finish().result; | ||
7044 | var opad = new Uint8Array(this.key); | ||
7045 | for (var i = 0; i < opad.length; ++i) opad[i] ^= 92; | ||
7046 | var verify = this.verify; | ||
7047 | var result = this.hash.reset().process(opad).process(inner_result).finish().result; | ||
7048 | if (verify) { | ||
7049 | if (verify.length === result.length) { | ||
7050 | var diff = 0; | ||
7051 | for (var i = 0; i < verify.length; i++) { | ||
7052 | diff |= verify[i] ^ result[i]; | ||
7053 | } | ||
7054 | this.result = !diff; | ||
7055 | } else { | ||
7056 | this.result = false; | ||
7057 | } | ||
7058 | } else { | ||
7059 | this.result = result; | ||
7060 | } | ||
7061 | return this; | ||
7062 | } | ||
7063 | function hmac_sha256_finish() { | ||
7064 | if (this.key === null) throw new IllegalStateError("no key is associated with the instance"); | ||
7065 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7066 | var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap; | ||
7067 | asm.hmac_finish(hash.pos, hash.len, 0); | ||
7068 | var verify = this.verify; | ||
7069 | var result = new Uint8Array(_sha256_hash_size); | ||
7070 | result.set(heap.subarray(0, _sha256_hash_size)); | ||
7071 | if (verify) { | ||
7072 | if (verify.length === result.length) { | ||
7073 | var diff = 0; | ||
7074 | for (var i = 0; i < verify.length; i++) { | ||
7075 | diff |= verify[i] ^ result[i]; | ||
7076 | } | ||
7077 | this.result = !diff; | ||
7078 | } else { | ||
7079 | this.result = false; | ||
7080 | } | ||
7081 | } else { | ||
7082 | this.result = result; | ||
7083 | } | ||
7084 | return this; | ||
7085 | } | ||
7086 | function hmac_sha512_finish() { | ||
7087 | if (this.key === null) throw new IllegalStateError("no key is associated with the instance"); | ||
7088 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7089 | var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap; | ||
7090 | asm.hmac_finish(hash.pos, hash.len, 0); | ||
7091 | var verify = this.verify; | ||
7092 | var result = new Uint8Array(_sha512_hash_size); | ||
7093 | result.set(heap.subarray(0, _sha512_hash_size)); | ||
7094 | if (verify) { | ||
7095 | if (verify.length === result.length) { | ||
7096 | var diff = 0; | ||
7097 | for (var i = 0; i < verify.length; i++) { | ||
7098 | diff |= verify[i] ^ result[i]; | ||
7099 | } | ||
7100 | this.result = !diff; | ||
7101 | } else { | ||
7102 | this.result = false; | ||
7103 | } | ||
7104 | } else { | ||
7105 | this.result = result; | ||
7106 | } | ||
7107 | return this; | ||
7108 | } | ||
7109 | var hmac_prototype = hmac_constructor.prototype; | ||
7110 | hmac_prototype.reset = hmac_reset; | ||
7111 | hmac_prototype.process = hmac_process; | ||
7112 | hmac_prototype.finish = hmac_finish; | ||
7113 | hmac_sha256_constructor.BLOCK_SIZE = sha256_constructor.BLOCK_SIZE; | ||
7114 | hmac_sha256_constructor.HMAC_SIZE = sha256_constructor.HASH_SIZE; | ||
7115 | var hmac_sha256_prototype = hmac_sha256_constructor.prototype; | ||
7116 | hmac_sha256_prototype.reset = hmac_sha256_reset; | ||
7117 | hmac_sha256_prototype.process = hmac_process; | ||
7118 | hmac_sha256_prototype.finish = hmac_sha256_finish; | ||
7119 | hmac_sha512_constructor.BLOCK_SIZE = sha512_constructor.BLOCK_SIZE; | ||
7120 | hmac_sha512_constructor.HMAC_SIZE = sha512_constructor.HASH_SIZE; | ||
7121 | var hmac_sha512_prototype = hmac_sha512_constructor.prototype; | ||
7122 | hmac_sha512_prototype.reset = hmac_sha512_reset; | ||
7123 | hmac_sha512_prototype.process = hmac_process; | ||
7124 | hmac_sha512_prototype.finish = hmac_sha512_finish; | ||
7125 | function pbkdf2_constructor(options) { | ||
7126 | options = options || {}; | ||
7127 | if (!options.hmac) throw new SyntaxError("option 'hmac' is required"); | ||
7128 | if (!options.hmac.HMAC_SIZE) throw new SyntaxError("option 'hmac' supplied doesn't seem to be a valid HMAC function"); | ||
7129 | this.hmac = options.hmac; | ||
7130 | this.count = options.count || 4096; | ||
7131 | this.length = options.length || this.hmac.HMAC_SIZE; | ||
7132 | this.result = null; | ||
7133 | var password = options.password; | ||
7134 | if (password || is_string(password)) this.reset(options); | ||
7135 | return this; | ||
7136 | } | ||
7137 | function pbkdf2_hmac_sha256_constructor(options) { | ||
7138 | options = options || {}; | ||
7139 | if (!(options.hmac instanceof hmac_sha256_constructor)) options.hmac = new hmac_sha256_constructor(options); | ||
7140 | pbkdf2_constructor.call(this, options); | ||
7141 | return this; | ||
7142 | } | ||
7143 | function pbkdf2_hmac_sha512_constructor(options) { | ||
7144 | options = options || {}; | ||
7145 | if (!(options.hmac instanceof hmac_sha512_constructor)) options.hmac = new hmac_sha512_constructor(options); | ||
7146 | pbkdf2_constructor.call(this, options); | ||
7147 | return this; | ||
7148 | } | ||
7149 | function pbkdf2_reset(options) { | ||
7150 | this.result = null; | ||
7151 | this.hmac.reset(options); | ||
7152 | return this; | ||
7153 | } | ||
7154 | function pbkdf2_generate(salt, count, length) { | ||
7155 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7156 | if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value"); | ||
7157 | count = count || this.count; | ||
7158 | length = length || this.length; | ||
7159 | this.result = new Uint8Array(length); | ||
7160 | var blocks = Math.ceil(length / this.hmac.HMAC_SIZE); | ||
7161 | for (var i = 1; i <= blocks; ++i) { | ||
7162 | var j = (i - 1) * this.hmac.HMAC_SIZE; | ||
7163 | var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE; | ||
7164 | var tmp = new Uint8Array(this.hmac.reset().process(salt).process(new Uint8Array([ i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, i & 255 ])).finish().result); | ||
7165 | this.result.set(tmp.subarray(0, l), j); | ||
7166 | for (var k = 1; k < count; ++k) { | ||
7167 | tmp = new Uint8Array(this.hmac.reset().process(tmp).finish().result); | ||
7168 | for (var r = 0; r < l; ++r) this.result[j + r] ^= tmp[r]; | ||
7169 | } | ||
7170 | } | ||
7171 | return this; | ||
7172 | } | ||
7173 | function pbkdf2_hmac_sha256_generate(salt, count, length) { | ||
7174 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7175 | if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value"); | ||
7176 | count = count || this.count; | ||
7177 | length = length || this.length; | ||
7178 | this.result = new Uint8Array(length); | ||
7179 | var blocks = Math.ceil(length / this.hmac.HMAC_SIZE); | ||
7180 | for (var i = 1; i <= blocks; ++i) { | ||
7181 | var j = (i - 1) * this.hmac.HMAC_SIZE; | ||
7182 | var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE; | ||
7183 | this.hmac.reset().process(salt); | ||
7184 | this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0); | ||
7185 | this.result.set(this.hmac.hash.heap.subarray(0, l), j); | ||
7186 | } | ||
7187 | return this; | ||
7188 | } | ||
7189 | function pbkdf2_hmac_sha512_generate(salt, count, length) { | ||
7190 | if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data"); | ||
7191 | if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value"); | ||
7192 | count = count || this.count; | ||
7193 | length = length || this.length; | ||
7194 | this.result = new Uint8Array(length); | ||
7195 | var blocks = Math.ceil(length / this.hmac.HMAC_SIZE); | ||
7196 | for (var i = 1; i <= blocks; ++i) { | ||
7197 | var j = (i - 1) * this.hmac.HMAC_SIZE; | ||
7198 | var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE; | ||
7199 | this.hmac.reset().process(salt); | ||
7200 | this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0); | ||
7201 | this.result.set(this.hmac.hash.heap.subarray(0, l), j); | ||
7202 | } | ||
7203 | return this; | ||
7204 | } | ||
7205 | var pbkdf2_prototype = pbkdf2_constructor.prototype; | ||
7206 | pbkdf2_prototype.reset = pbkdf2_reset; | ||
7207 | pbkdf2_prototype.generate = pbkdf2_generate; | ||
7208 | var pbkdf2_hmac_sha256_prototype = pbkdf2_hmac_sha256_constructor.prototype; | ||
7209 | pbkdf2_hmac_sha256_prototype.reset = pbkdf2_reset; | ||
7210 | pbkdf2_hmac_sha256_prototype.generate = pbkdf2_hmac_sha256_generate; | ||
7211 | var pbkdf2_hmac_sha512_prototype = pbkdf2_hmac_sha512_constructor.prototype; | ||
7212 | pbkdf2_hmac_sha512_prototype.reset = pbkdf2_reset; | ||
7213 | pbkdf2_hmac_sha512_prototype.generate = pbkdf2_hmac_sha512_generate; | ||
7214 | global.IllegalStateError = IllegalStateError; | ||
7215 | global.IllegalArgumentError = IllegalArgumentError; | ||
7216 | global.SecurityError = SecurityError; | ||
7217 | exports.string_to_bytes = string_to_bytes; | ||
7218 | exports.hex_to_bytes = hex_to_bytes; | ||
7219 | exports.base64_to_bytes = base64_to_bytes; | ||
7220 | exports.bytes_to_string = bytes_to_string; | ||
7221 | exports.bytes_to_hex = bytes_to_hex; | ||
7222 | exports.bytes_to_base64 = bytes_to_base64; | ||
7223 | var SHA256_instance = new sha256_constructor({ | ||
7224 | heapSize: 1048576 | ||
7225 | }); | ||
7226 | function sha256_bytes(data) { | ||
7227 | if (data === undefined) throw new SyntaxError("data required"); | ||
7228 | return SHA256_instance.reset().process(data).finish().result; | ||
7229 | } | ||
7230 | function sha256_hex(data) { | ||
7231 | var result = sha256_bytes(data.toUTF8Array()); | ||
7232 | return bytes_to_hex(result); | ||
7233 | } | ||
7234 | function sha256_base64(data) { | ||
7235 | var result = sha256_bytes(data); | ||
7236 | return bytes_to_base64(result); | ||
7237 | } | ||
7238 | exports.SHA256 = { | ||
7239 | bytes: sha256_bytes, | ||
7240 | hex: sha256_hex, | ||
7241 | base64: sha256_base64 | ||
7242 | }; | ||
7243 | var SHA512_instance = new sha512_constructor({ | ||
7244 | heapSize: 1048576 | ||
7245 | }); | ||
7246 | function sha512_bytes(data) { | ||
7247 | if (data === undefined) throw new SyntaxError("data required"); | ||
7248 | return SHA512_instance.reset().process(data).finish().result; | ||
7249 | } | ||
7250 | function sha512_hex(data) { | ||
7251 | var result = sha512_bytes(data); | ||
7252 | return bytes_to_hex(result); | ||
7253 | } | ||
7254 | function sha512_base64(data) { | ||
7255 | var result = sha512_bytes(data); | ||
7256 | return bytes_to_base64(result); | ||
7257 | } | ||
7258 | exports.SHA512 = { | ||
7259 | bytes: sha512_bytes, | ||
7260 | hex: sha512_hex, | ||
7261 | base64: sha512_base64 | ||
7262 | }; | ||
7263 | var hmac_sha256_instance = new hmac_sha256_constructor({ | ||
7264 | hash: SHA256_instance | ||
7265 | }); | ||
7266 | function hmac_sha256_bytes(data, password) { | ||
7267 | if (data === undefined) throw new SyntaxError("data required"); | ||
7268 | if (password === undefined) throw new SyntaxError("password required"); | ||
7269 | return hmac_sha256_instance.reset({ | ||
7270 | password: password | ||
7271 | }).process(data).finish().result; | ||
7272 | } | ||
7273 | function hmac_sha256_hex(data, password) { | ||
7274 | var result = hmac_sha256_bytes(data, password); | ||
7275 | return bytes_to_hex(result); | ||
7276 | } | ||
7277 | function hmac_sha256_base64(data, password) { | ||
7278 | var result = hmac_sha256_bytes(data, password); | ||
7279 | return bytes_to_base64(result); | ||
7280 | } | ||
7281 | exports.HMAC = exports.HMAC_SHA256 = { | ||
7282 | bytes: hmac_sha256_bytes, | ||
7283 | hex: hmac_sha256_hex, | ||
7284 | base64: hmac_sha256_base64 | ||
7285 | }; | ||
7286 | var hmac_sha512_instance = new hmac_sha512_constructor({ | ||
7287 | hash: SHA512_instance | ||
7288 | }); | ||
7289 | function hmac_sha512_bytes(data, password) { | ||
7290 | if (data === undefined) throw new SyntaxError("data required"); | ||
7291 | if (password === undefined) throw new SyntaxError("password required"); | ||
7292 | return hmac_sha512_instance.reset({ | ||
7293 | password: password | ||
7294 | }).process(data).finish().result; | ||
7295 | } | ||
7296 | function hmac_sha512_hex(data, password) { | ||
7297 | var result = hmac_sha512_bytes(data, password); | ||
7298 | return bytes_to_hex(result); | ||
7299 | } | ||
7300 | function hmac_sha512_base64(data, password) { | ||
7301 | var result = hmac_sha512_bytes(data, password); | ||
7302 | return bytes_to_base64(result); | ||
7303 | } | ||
7304 | exports.HMAC_SHA512 = { | ||
7305 | bytes: hmac_sha512_bytes, | ||
7306 | hex: hmac_sha512_hex, | ||
7307 | base64: hmac_sha512_base64 | ||
7308 | }; | ||
7309 | var pbkdf2_hmac_sha256_instance = new pbkdf2_hmac_sha256_constructor({ | ||
7310 | hmac: hmac_sha256_instance | ||
7311 | }); | ||
7312 | function pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen) { | ||
7313 | if (password === undefined) throw new SyntaxError("password required"); | ||
7314 | if (salt === undefined) throw new SyntaxError("salt required"); | ||
7315 | return pbkdf2_hmac_sha256_instance.reset({ | ||
7316 | password: password.toUTF8Array() | ||
7317 | }).generate(salt.toUTF8Array(), iterations, dklen).result; | ||
7318 | } | ||
7319 | function pbkdf2_hmac_sha256_hex(password, salt, iterations, dklen) { | ||
7320 | var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen); | ||
7321 | return bytes_to_hex(result); | ||
7322 | } | ||
7323 | function pbkdf2_hmac_sha256_base64(password, salt, iterations, dklen) { | ||
7324 | var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen); | ||
7325 | return bytes_to_base64(result); | ||
7326 | } | ||
7327 | exports.PBKDF2 = exports.PBKDF2_HMAC_SHA256 = { | ||
7328 | bytes: pbkdf2_hmac_sha256_bytes, | ||
7329 | hex: pbkdf2_hmac_sha256_hex, | ||
7330 | base64: pbkdf2_hmac_sha256_base64 | ||
7331 | }; | ||
7332 | var pbkdf2_hmac_sha512_instance = new pbkdf2_hmac_sha512_constructor({ | ||
7333 | hmac: hmac_sha512_instance | ||
7334 | }); | ||
7335 | function pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen) { | ||
7336 | if (password === undefined) throw new SyntaxError("password required"); | ||
7337 | if (salt === undefined) throw new SyntaxError("salt required"); | ||
7338 | return pbkdf2_hmac_sha512_instance.reset({ | ||
7339 | password: password.toUTF8Array() | ||
7340 | }).generate(salt.toUTF8Array(), iterations, dklen).result; | ||
7341 | } | ||
7342 | function pbkdf2_hmac_sha512_hex(password, salt, iterations, dklen) { | ||
7343 | var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen); | ||
7344 | return bytes_to_hex(result); | ||
7345 | } | ||
7346 | function pbkdf2_hmac_sha512_base64(password, salt, iterations, dklen) { | ||
7347 | var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen); | ||
7348 | return bytes_to_base64(result); | ||
7349 | } | ||
7350 | exports.PBKDF2_HMAC_SHA512 = { | ||
7351 | bytes: pbkdf2_hmac_sha512_bytes, | ||
7352 | hex: pbkdf2_hmac_sha512_hex, | ||
7353 | base64: pbkdf2_hmac_sha512_base64 | ||
7354 | }; | ||
7355 | var cbc_aes_instance = new cbc_aes_constructor({ | ||
7356 | heapSize: 1048576 | ||
7357 | }); | ||
7358 | function cbc_aes_encrypt_bytes(data, key, padding, iv) { | ||
7359 | if (data === undefined) throw new SyntaxError("data required"); | ||
7360 | if (key === undefined) throw new SyntaxError("key required"); | ||
7361 | return cbc_aes_instance.reset({ | ||
7362 | key: key, | ||
7363 | padding: padding, | ||
7364 | iv: iv | ||
7365 | }).encrypt(data).result; | ||
7366 | } | ||
7367 | function cbc_aes_decrypt_bytes(data, key, padding, iv) { | ||
7368 | if (data === undefined) throw new SyntaxError("data required"); | ||
7369 | if (key === undefined) throw new SyntaxError("key required"); | ||
7370 | return cbc_aes_instance.reset({ | ||
7371 | key: key, | ||
7372 | padding: padding, | ||
7373 | iv: iv | ||
7374 | }).decrypt(data).result; | ||
7375 | } | ||
7376 | exports.AES = exports.AES_CBC = { | ||
7377 | encrypt: cbc_aes_encrypt_bytes, | ||
7378 | decrypt: cbc_aes_decrypt_bytes | ||
7379 | }; | ||
7380 | var ccm_aes_instance = new ccm_aes_constructor({ | ||
7381 | heap: cbc_aes_instance.heap, | ||
7382 | asm: cbc_aes_instance.asm | ||
7383 | }); | ||
7384 | function ccm_aes_encrypt_bytes(data, key, nonce, adata, tagSize) { | ||
7385 | if (data === undefined) throw new SyntaxError("data required"); | ||
7386 | if (key === undefined) throw new SyntaxError("key required"); | ||
7387 | if (nonce === undefined) throw new SyntaxError("nonce required"); | ||
7388 | var dataLength = data.byteLength || data.length || 0; | ||
7389 | return ccm_aes_instance.reset({ | ||
7390 | key: key, | ||
7391 | nonce: nonce, | ||
7392 | adata: adata, | ||
7393 | tagSize: tagSize, | ||
7394 | dataLength: dataLength | ||
7395 | }).encrypt(data).result; | ||
7396 | } | ||
7397 | function ccm_aes_decrypt_bytes(data, key, nonce, adata, tagSize) { | ||
7398 | if (data === undefined) throw new SyntaxError("data required"); | ||
7399 | if (key === undefined) throw new SyntaxError("key required"); | ||
7400 | if (nonce === undefined) throw new SyntaxError("nonce required"); | ||
7401 | var dataLength = data.byteLength || data.length || 0; | ||
7402 | tagSize = tagSize || _aes_block_size; | ||
7403 | return ccm_aes_instance.reset({ | ||
7404 | key: key, | ||
7405 | nonce: nonce, | ||
7406 | adata: adata, | ||
7407 | tagSize: tagSize, | ||
7408 | dataLength: dataLength - tagSize | ||
7409 | }).decrypt(data).result; | ||
7410 | } | ||
7411 | exports.AES_CCM = { | ||
7412 | encrypt: ccm_aes_encrypt_bytes, | ||
7413 | decrypt: ccm_aes_decrypt_bytes | ||
7414 | }; | ||
7415 | var cfb_aes_instance = new cfb_aes_constructor({ | ||
7416 | heap: cbc_aes_instance.heap, | ||
7417 | asm: cbc_aes_instance.asm | ||
7418 | }); | ||
7419 | function cfb_aes_encrypt_bytes(data, key, padding, iv) { | ||
7420 | if (data === undefined) throw new SyntaxError("data required"); | ||
7421 | if (key === undefined) throw new SyntaxError("key required"); | ||
7422 | return cfb_aes_instance.reset({ | ||
7423 | key: key, | ||
7424 | padding: padding, | ||
7425 | iv: iv | ||
7426 | }).encrypt(data).result; | ||
7427 | } | ||
7428 | function cfb_aes_decrypt_bytes(data, key, padding, iv) { | ||
7429 | if (data === undefined) throw new SyntaxError("data required"); | ||
7430 | if (key === undefined) throw new SyntaxError("key required"); | ||
7431 | return cfb_aes_instance.reset({ | ||
7432 | key: key, | ||
7433 | padding: padding, | ||
7434 | iv: iv | ||
7435 | }).decrypt(data).result; | ||
7436 | } | ||
7437 | exports.AES_CFB = { | ||
7438 | encrypt: cfb_aes_encrypt_bytes, | ||
7439 | decrypt: cfb_aes_decrypt_bytes | ||
7440 | }; | ||
7441 | var cfb_aes_decrypt_instance = new cfb_aes_decrypt_constructor({ | ||
7442 | heap: cbc_aes_instance.heap, | ||
7443 | asm: cbc_aes_instance.asm | ||
7444 | }); | ||
7445 | function cfb_aes_decrypt_init(key, padding, iv) { | ||
7446 | if (key === undefined) throw new SyntaxError("key required"); | ||
7447 | return cfb_aes_decrypt_instance.reset({ | ||
7448 | key: key, | ||
7449 | padding: padding, | ||
7450 | iv: iv | ||
7451 | }); | ||
7452 | } | ||
7453 | exports.AES_CFB = exports.AES_CFB || {}; | ||
7454 | exports.AES_CFB.decryptor = { | ||
7455 | init: cfb_aes_decrypt_init | ||
7456 | }; | ||
7457 | })({}, function() { | ||
7458 | return this; | ||
7459 | }()); | ||
7460 | |||
7461 | String.prototype.toUTF8Array = function() { | ||
7462 | var str = this; | ||
7463 | var utf8 = []; | ||
7464 | for (var i=0; i < str.length; i++) { | ||
7465 | var charcode = str.charCodeAt(i); | ||
7466 | if (charcode < 0x80) utf8.push(charcode); | ||
7467 | else if (charcode < 0x800) { | ||
7468 | utf8.push(0xc0 | (charcode >> 6), | ||
7469 | 0x80 | (charcode & 0x3f)); | ||
7470 | } | ||
7471 | else if (charcode < 0xd800 || charcode >= 0xe000) { | ||
7472 | utf8.push(0xe0 | (charcode >> 12), | ||
7473 | 0x80 | ((charcode>>6) & 0x3f), | ||
7474 | 0x80 | (charcode & 0x3f)); | ||
7475 | } | ||
7476 | // surrogate pair | ||
7477 | else { | ||
7478 | i++; | ||
7479 | // UTF-16 encodes 0x10000-0x10FFFF by | ||
7480 | // subtracting 0x10000 and splitting the | ||
7481 | // 20 bits of 0x0-0xFFFFF into two halves | ||
7482 | charcode = 0x10000 + (((charcode & 0x3ff)<<10) | ||
7483 | | (str.charCodeAt(i) & 0x3ff)) | ||
7484 | utf8.push(0xf0 | (charcode >>18), | ||
7485 | 0x80 | ((charcode>>12) & 0x3f), | ||
7486 | 0x80 | ((charcode>>6) & 0x3f), | ||
7487 | 0x80 | (charcode & 0x3f)); | ||
7488 | } | ||
7489 | } | ||
7490 | return new Uint8Array(utf8); | ||
7491 | } | ||
diff --git a/src/js/jsbip39.js b/src/js/jsbip39.js index 0b88fef..257d8d7 100644 --- a/src/js/jsbip39.js +++ b/src/js/jsbip39.js | |||
@@ -22,8 +22,8 @@ | |||
22 | /* | 22 | /* |
23 | * Javascript port from python by Ian Coleman | 23 | * Javascript port from python by Ian Coleman |
24 | * | 24 | * |
25 | * Includes code from asmCrypto | 25 | * Requires code from sjcl |
26 | * https://github.com/tresorit/asmcrypto.js | 26 | * https://github.com/bitwiseshiftleft/sjcl |
27 | */ | 27 | */ |
28 | 28 | ||
29 | var Mnemonic = function(language) { | 29 | var Mnemonic = function(language) { |
@@ -34,6 +34,13 @@ var Mnemonic = function(language) { | |||
34 | var self = this; | 34 | var self = this; |
35 | var wordlist = []; | 35 | var wordlist = []; |
36 | 36 | ||
37 | var hmacSHA512 = function(key) { | ||
38 | var hasher = new sjcl.misc.hmac(key, sjcl.hash.sha512); | ||
39 | this.encrypt = function() { | ||
40 | return hasher.encrypt.apply(hasher, arguments); | ||
41 | }; | ||
42 | }; | ||
43 | |||
37 | function init() { | 44 | function init() { |
38 | wordlist = WORDLISTS[language]; | 45 | wordlist = WORDLISTS[language]; |
39 | if (wordlist.length != RADIX) { | 46 | if (wordlist.length != RADIX) { |
@@ -57,14 +64,15 @@ var Mnemonic = function(language) { | |||
57 | return self.toMnemonic(data); | 64 | return self.toMnemonic(data); |
58 | } | 65 | } |
59 | 66 | ||
60 | self.toMnemonic = function(data) { | 67 | self.toMnemonic = function(byteArray) { |
61 | if (data.length % 4 > 0) { | 68 | if (byteArray.length % 4 > 0) { |
62 | throw 'Data length in bits should be divisible by 32, but it is not (' + data.length + ' bytes = ' + data.length*8 + ' bits).' | 69 | throw 'Data length in bits should be divisible by 32, but it is not (' + byteArray.length + ' bytes = ' + byteArray.length*8 + ' bits).' |
63 | } | 70 | } |
64 | 71 | ||
65 | //h = hashlib.sha256(data).hexdigest() | 72 | //h = hashlib.sha256(data).hexdigest() |
66 | var uintArray = new Uint8Array(data); | 73 | var data = byteArrayToWordArray(byteArray); |
67 | var h = asmCrypto.SHA256.bytes(uintArray); | 74 | var hash = sjcl.hash.sha256.hash(data); |
75 | var h = sjcl.codec.hex.fromBits(hash); | ||
68 | 76 | ||
69 | // b is a binary string, eg '00111010101100...' | 77 | // b is a binary string, eg '00111010101100...' |
70 | //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \ | 78 | //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \ |
@@ -73,9 +81,9 @@ var Mnemonic = function(language) { | |||
73 | // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) | 81 | // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) |
74 | // c = bin(int(h, 16))[2:].zfill(256) | 82 | // c = bin(int(h, 16))[2:].zfill(256) |
75 | // d = c[:len(data) * 8 / 32] | 83 | // d = c[:len(data) * 8 / 32] |
76 | var a = byteArrayToBinaryString(data); | 84 | var a = byteArrayToBinaryString(byteArray); |
77 | var c = byteArrayToBinaryString(h); | 85 | var c = zfill(hexStringToBinaryString(h), 256); |
78 | var d = c.substring(0, data.length * 8 / 32); | 86 | var d = c.substring(0, byteArray.length * 8 / 32); |
79 | // b = line1 + line2 | 87 | // b = line1 + line2 |
80 | var b = a + d; | 88 | var b = a + d; |
81 | 89 | ||
@@ -111,10 +119,11 @@ var Mnemonic = function(language) { | |||
111 | var d = b.substring(0, l / 33 * 32); | 119 | var d = b.substring(0, l / 33 * 32); |
112 | var h = b.substring(l - l / 33, l); | 120 | var h = b.substring(l - l / 33, l); |
113 | //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8)) | 121 | //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8)) |
122 | var nd = binaryStringToWordArray(d); | ||
114 | //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33] | 123 | //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33] |
115 | var nd = binaryStringToByteArray(d); | 124 | var ndHash = sjcl.hash.sha256.hash(nd); |
116 | var ndHash = asmCrypto.SHA256.bytes(nd); | 125 | var ndHex = sjcl.codec.hex.fromBits(ndHash); |
117 | var ndBstr = zfill(byteArrayToBinaryString(ndHash), 256); | 126 | var ndBstr = zfill(hexStringToBinaryString(ndHex), 256); |
118 | var nh = ndBstr.substring(0,l/33); | 127 | var nh = ndBstr.substring(0,l/33); |
119 | return h == nh; | 128 | return h == nh; |
120 | } | 129 | } |
@@ -124,8 +133,11 @@ var Mnemonic = function(language) { | |||
124 | mnemonic = self.normalizeString(mnemonic) | 133 | mnemonic = self.normalizeString(mnemonic) |
125 | passphrase = self.normalizeString(passphrase) | 134 | passphrase = self.normalizeString(passphrase) |
126 | passphrase = "mnemonic" + passphrase; | 135 | passphrase = "mnemonic" + passphrase; |
127 | //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64) | 136 | var mnemonicBits = sjcl.codec.utf8String.toBits(mnemonic); |
128 | return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8); | 137 | var passphraseBits = sjcl.codec.utf8String.toBits(passphrase); |
138 | var result = sjcl.misc.pbkdf2(mnemonicBits, passphraseBits, PBKDF2_ROUNDS, 512, hmacSHA512); | ||
139 | var hashHex = sjcl.codec.hex.fromBits(result); | ||
140 | return hashHex; | ||
129 | } | 141 | } |
130 | 142 | ||
131 | self.normalizeString = function(str) { | 143 | self.normalizeString = function(str) { |
@@ -139,6 +151,19 @@ var Mnemonic = function(language) { | |||
139 | } | 151 | } |
140 | } | 152 | } |
141 | 153 | ||
154 | function byteArrayToWordArray(data) { | ||
155 | var a = []; | ||
156 | for (var i=0; i<data.length/4; i++) { | ||
157 | v = 0; | ||
158 | v += data[i*4 + 0] << 8 * 3; | ||
159 | v += data[i*4 + 1] << 8 * 2; | ||
160 | v += data[i*4 + 2] << 8 * 1; | ||
161 | v += data[i*4 + 3] << 8 * 0; | ||
162 | a.push(v); | ||
163 | } | ||
164 | return a; | ||
165 | } | ||
166 | |||
142 | function byteArrayToBinaryString(data) { | 167 | function byteArrayToBinaryString(data) { |
143 | var bin = ""; | 168 | var bin = ""; |
144 | for (var i=0; i<data.length; i++) { | 169 | for (var i=0; i<data.length; i++) { |
@@ -147,16 +172,24 @@ var Mnemonic = function(language) { | |||
147 | return bin; | 172 | return bin; |
148 | } | 173 | } |
149 | 174 | ||
150 | function binaryStringToByteArray(str) { | 175 | function hexStringToBinaryString(hexString) { |
151 | var arrayLen = str.length / 8; | 176 | binaryString = ""; |
152 | var array = new Uint8Array(arrayLen); | 177 | for (var i=0; i<hexString.length; i++) { |
153 | for (var i=0; i<arrayLen; i++) { | 178 | binaryString += zfill(parseInt(hexString[i], 16).toString(2),4); |
154 | var valueStr = str.substring(0,8); | 179 | } |
180 | return binaryString; | ||
181 | } | ||
182 | |||
183 | function binaryStringToWordArray(binary) { | ||
184 | var aLen = binary.length / 32; | ||
185 | var a = []; | ||
186 | for (var i=0; i<aLen; i++) { | ||
187 | var valueStr = binary.substring(0,32); | ||
155 | var value = parseInt(valueStr, 2); | 188 | var value = parseInt(valueStr, 2); |
156 | array[i] = value; | 189 | a.push(value); |
157 | str = str.slice(8); | 190 | binary = binary.slice(32); |
158 | } | 191 | } |
159 | return array; | 192 | return a; |
160 | } | 193 | } |
161 | 194 | ||
162 | // Pad a numeric string on the left with zero digits until the given width | 195 | // Pad a numeric string on the left with zero digits until the given width |
diff --git a/src/js/sjcl-bip39.js b/src/js/sjcl-bip39.js new file mode 100644 index 0000000..537e3b8 --- /dev/null +++ b/src/js/sjcl-bip39.js | |||
@@ -0,0 +1,1059 @@ | |||
1 | // Select components from sjcl to suit the crypto operations bip39 requires. | ||
2 | |||
3 | //// base.js | ||
4 | |||
5 | /** @fileOverview Javascript cryptography implementation. | ||
6 | * | ||
7 | * Crush to remove comments, shorten variable names and | ||
8 | * generally reduce transmission size. | ||
9 | * | ||
10 | * @author Emily Stark | ||
11 | * @author Mike Hamburg | ||
12 | * @author Dan Boneh | ||
13 | */ | ||
14 | |||
15 | "use strict"; | ||
16 | /*jslint indent: 2, bitwise: false, nomen: false, plusplus: false, white: false, regexp: false */ | ||
17 | /*global document, window, escape, unescape, module, require, Uint32Array */ | ||
18 | |||
19 | /** @namespace The Stanford Javascript Crypto Library, top-level namespace. */ | ||
20 | var sjcl = { | ||
21 | /** @namespace Symmetric ciphers. */ | ||
22 | cipher: {}, | ||
23 | |||
24 | /** @namespace Hash functions. Right now only SHA256 is implemented. */ | ||
25 | hash: {}, | ||
26 | |||
27 | /** @namespace Key exchange functions. Right now only SRP is implemented. */ | ||
28 | keyexchange: {}, | ||
29 | |||
30 | /** @namespace Block cipher modes of operation. */ | ||
31 | mode: {}, | ||
32 | |||
33 | /** @namespace Miscellaneous. HMAC and PBKDF2. */ | ||
34 | misc: {}, | ||
35 | |||
36 | /** | ||
37 | * @namespace Bit array encoders and decoders. | ||
38 | * | ||
39 | * @description | ||
40 | * The members of this namespace are functions which translate between | ||
41 | * SJCL's bitArrays and other objects (usually strings). Because it | ||
42 | * isn't always clear which direction is encoding and which is decoding, | ||
43 | * the method names are "fromBits" and "toBits". | ||
44 | */ | ||
45 | codec: {}, | ||
46 | |||
47 | /** @namespace Exceptions. */ | ||
48 | exception: { | ||
49 | /** @constructor Ciphertext is corrupt. */ | ||
50 | corrupt: function(message) { | ||
51 | this.toString = function() { return "CORRUPT: "+this.message; }; | ||
52 | this.message = message; | ||
53 | }, | ||
54 | |||
55 | /** @constructor Invalid parameter. */ | ||
56 | invalid: function(message) { | ||
57 | this.toString = function() { return "INVALID: "+this.message; }; | ||
58 | this.message = message; | ||
59 | }, | ||
60 | |||
61 | /** @constructor Bug or missing feature in SJCL. @constructor */ | ||
62 | bug: function(message) { | ||
63 | this.toString = function() { return "BUG: "+this.message; }; | ||
64 | this.message = message; | ||
65 | }, | ||
66 | |||
67 | /** @constructor Something isn't ready. */ | ||
68 | notReady: function(message) { | ||
69 | this.toString = function() { return "NOT READY: "+this.message; }; | ||
70 | this.message = message; | ||
71 | } | ||
72 | } | ||
73 | }; | ||
74 | |||
75 | if(typeof module !== 'undefined' && module.exports){ | ||
76 | module.exports = sjcl; | ||
77 | } | ||
78 | if (typeof define === "function") { | ||
79 | define([], function () { | ||
80 | return sjcl; | ||
81 | }); | ||
82 | } | ||
83 | |||
84 | |||
85 | //// bitArray.js | ||
86 | |||
87 | /** @fileOverview Arrays of bits, encoded as arrays of Numbers. | ||
88 | * | ||
89 | * @author Emily Stark | ||
90 | * @author Mike Hamburg | ||
91 | * @author Dan Boneh | ||
92 | */ | ||
93 | |||
94 | /** @namespace Arrays of bits, encoded as arrays of Numbers. | ||
95 | * | ||
96 | * @description | ||
97 | * <p> | ||
98 | * These objects are the currency accepted by SJCL's crypto functions. | ||
99 | * </p> | ||
100 | * | ||
101 | * <p> | ||
102 | * Most of our crypto primitives operate on arrays of 4-byte words internally, | ||
103 | * but many of them can take arguments that are not a multiple of 4 bytes. | ||
104 | * This library encodes arrays of bits (whose size need not be a multiple of 8 | ||
105 | * bits) as arrays of 32-bit words. The bits are packed, big-endian, into an | ||
106 | * array of words, 32 bits at a time. Since the words are double-precision | ||
107 | * floating point numbers, they fit some extra data. We use this (in a private, | ||
108 | * possibly-changing manner) to encode the number of bits actually present | ||
109 | * in the last word of the array. | ||
110 | * </p> | ||
111 | * | ||
112 | * <p> | ||
113 | * Because bitwise ops clear this out-of-band data, these arrays can be passed | ||
114 | * to ciphers like AES which want arrays of words. | ||
115 | * </p> | ||
116 | */ | ||
117 | sjcl.bitArray = { | ||
118 | /** | ||
119 | * Array slices in units of bits. | ||
120 | * @param {bitArray} a The array to slice. | ||
121 | * @param {Number} bstart The offset to the start of the slice, in bits. | ||
122 | * @param {Number} bend The offset to the end of the slice, in bits. If this is undefined, | ||
123 | * slice until the end of the array. | ||
124 | * @return {bitArray} The requested slice. | ||
125 | */ | ||
126 | bitSlice: function (a, bstart, bend) { | ||
127 | a = sjcl.bitArray._shiftRight(a.slice(bstart/32), 32 - (bstart & 31)).slice(1); | ||
128 | return (bend === undefined) ? a : sjcl.bitArray.clamp(a, bend-bstart); | ||
129 | }, | ||
130 | |||
131 | /** | ||
132 | * Extract a number packed into a bit array. | ||
133 | * @param {bitArray} a The array to slice. | ||
134 | * @param {Number} bstart The offset to the start of the slice, in bits. | ||
135 | * @param {Number} length The length of the number to extract. | ||
136 | * @return {Number} The requested slice. | ||
137 | */ | ||
138 | extract: function(a, bstart, blength) { | ||
139 | // FIXME: this Math.floor is not necessary at all, but for some reason | ||
140 | // seems to suppress a bug in the Chromium JIT. | ||
141 | var x, sh = Math.floor((-bstart-blength) & 31); | ||
142 | if ((bstart + blength - 1 ^ bstart) & -32) { | ||
143 | // it crosses a boundary | ||
144 | x = (a[bstart/32|0] << (32 - sh)) ^ (a[bstart/32+1|0] >>> sh); | ||
145 | } else { | ||
146 | // within a single word | ||
147 | x = a[bstart/32|0] >>> sh; | ||
148 | } | ||
149 | return x & ((1<<blength) - 1); | ||
150 | }, | ||
151 | |||
152 | /** | ||
153 | * Concatenate two bit arrays. | ||
154 | * @param {bitArray} a1 The first array. | ||
155 | * @param {bitArray} a2 The second array. | ||
156 | * @return {bitArray} The concatenation of a1 and a2. | ||
157 | */ | ||
158 | concat: function (a1, a2) { | ||
159 | if (a1.length === 0 || a2.length === 0) { | ||
160 | return a1.concat(a2); | ||
161 | } | ||
162 | |||
163 | var last = a1[a1.length-1], shift = sjcl.bitArray.getPartial(last); | ||
164 | if (shift === 32) { | ||
165 | return a1.concat(a2); | ||
166 | } else { | ||
167 | return sjcl.bitArray._shiftRight(a2, shift, last|0, a1.slice(0,a1.length-1)); | ||
168 | } | ||
169 | }, | ||
170 | |||
171 | /** | ||
172 | * Find the length of an array of bits. | ||
173 | * @param {bitArray} a The array. | ||
174 | * @return {Number} The length of a, in bits. | ||
175 | */ | ||
176 | bitLength: function (a) { | ||
177 | var l = a.length, x; | ||
178 | if (l === 0) { return 0; } | ||
179 | x = a[l - 1]; | ||
180 | return (l-1) * 32 + sjcl.bitArray.getPartial(x); | ||
181 | }, | ||
182 | |||
183 | /** | ||
184 | * Truncate an array. | ||
185 | * @param {bitArray} a The array. | ||
186 | * @param {Number} len The length to truncate to, in bits. | ||
187 | * @return {bitArray} A new array, truncated to len bits. | ||
188 | */ | ||
189 | clamp: function (a, len) { | ||
190 | if (a.length * 32 < len) { return a; } | ||
191 | a = a.slice(0, Math.ceil(len / 32)); | ||
192 | var l = a.length; | ||
193 | len = len & 31; | ||
194 | if (l > 0 && len) { | ||
195 | a[l-1] = sjcl.bitArray.partial(len, a[l-1] & 0x80000000 >> (len-1), 1); | ||
196 | } | ||
197 | return a; | ||
198 | }, | ||
199 | |||
200 | /** | ||
201 | * Make a partial word for a bit array. | ||
202 | * @param {Number} len The number of bits in the word. | ||
203 | * @param {Number} x The bits. | ||
204 | * @param {Number} [0] _end Pass 1 if x has already been shifted to the high side. | ||
205 | * @return {Number} The partial word. | ||
206 | */ | ||
207 | partial: function (len, x, _end) { | ||
208 | if (len === 32) { return x; } | ||
209 | return (_end ? x|0 : x << (32-len)) + len * 0x10000000000; | ||
210 | }, | ||
211 | |||
212 | /** | ||
213 | * Get the number of bits used by a partial word. | ||
214 | * @param {Number} x The partial word. | ||
215 | * @return {Number} The number of bits used by the partial word. | ||
216 | */ | ||
217 | getPartial: function (x) { | ||
218 | return Math.round(x/0x10000000000) || 32; | ||
219 | }, | ||
220 | |||
221 | /** | ||
222 | * Compare two arrays for equality in a predictable amount of time. | ||
223 | * @param {bitArray} a The first array. | ||
224 | * @param {bitArray} b The second array. | ||
225 | * @return {boolean} true if a == b; false otherwise. | ||
226 | */ | ||
227 | equal: function (a, b) { | ||
228 | if (sjcl.bitArray.bitLength(a) !== sjcl.bitArray.bitLength(b)) { | ||
229 | return false; | ||
230 | } | ||
231 | var x = 0, i; | ||
232 | for (i=0; i<a.length; i++) { | ||
233 | x |= a[i]^b[i]; | ||
234 | } | ||
235 | return (x === 0); | ||
236 | }, | ||
237 | |||
238 | /** Shift an array right. | ||
239 | * @param {bitArray} a The array to shift. | ||
240 | * @param {Number} shift The number of bits to shift. | ||
241 | * @param {Number} [carry=0] A byte to carry in | ||
242 | * @param {bitArray} [out=[]] An array to prepend to the output. | ||
243 | * @private | ||
244 | */ | ||
245 | _shiftRight: function (a, shift, carry, out) { | ||
246 | var i, last2=0, shift2; | ||
247 | if (out === undefined) { out = []; } | ||
248 | |||
249 | for (; shift >= 32; shift -= 32) { | ||
250 | out.push(carry); | ||
251 | carry = 0; | ||
252 | } | ||
253 | if (shift === 0) { | ||
254 | return out.concat(a); | ||
255 | } | ||
256 | |||
257 | for (i=0; i<a.length; i++) { | ||
258 | out.push(carry | a[i]>>>shift); | ||
259 | carry = a[i] << (32-shift); | ||
260 | } | ||
261 | last2 = a.length ? a[a.length-1] : 0; | ||
262 | shift2 = sjcl.bitArray.getPartial(last2); | ||
263 | out.push(sjcl.bitArray.partial(shift+shift2 & 31, (shift + shift2 > 32) ? carry : out.pop(),1)); | ||
264 | return out; | ||
265 | }, | ||
266 | |||
267 | /** xor a block of 4 words together. | ||
268 | * @private | ||
269 | */ | ||
270 | _xor4: function(x,y) { | ||
271 | return [x[0]^y[0],x[1]^y[1],x[2]^y[2],x[3]^y[3]]; | ||
272 | }, | ||
273 | |||
274 | /** byteswap a word array inplace. | ||
275 | * (does not handle partial words) | ||
276 | * @param {sjcl.bitArray} a word array | ||
277 | * @return {sjcl.bitArray} byteswapped array | ||
278 | */ | ||
279 | byteswapM: function(a) { | ||
280 | var i, v, m = 0xff00; | ||
281 | for (i = 0; i < a.length; ++i) { | ||
282 | v = a[i]; | ||
283 | a[i] = (v >>> 24) | ((v >>> 8) & m) | ((v & m) << 8) | (v << 24); | ||
284 | } | ||
285 | return a; | ||
286 | } | ||
287 | }; | ||
288 | |||
289 | |||
290 | //// codecString.js | ||
291 | |||
292 | /** @fileOverview Bit array codec implementations. | ||
293 | * | ||
294 | * @author Emily Stark | ||
295 | * @author Mike Hamburg | ||
296 | * @author Dan Boneh | ||
297 | */ | ||
298 | |||
299 | /** @namespace UTF-8 strings */ | ||
300 | sjcl.codec.utf8String = { | ||
301 | /** Convert from a bitArray to a UTF-8 string. */ | ||
302 | fromBits: function (arr) { | ||
303 | var out = "", bl = sjcl.bitArray.bitLength(arr), i, tmp; | ||
304 | for (i=0; i<bl/8; i++) { | ||
305 | if ((i&3) === 0) { | ||
306 | tmp = arr[i/4]; | ||
307 | } | ||
308 | out += String.fromCharCode(tmp >>> 24); | ||
309 | tmp <<= 8; | ||
310 | } | ||
311 | return decodeURIComponent(escape(out)); | ||
312 | }, | ||
313 | |||
314 | /** Convert from a UTF-8 string to a bitArray. */ | ||
315 | toBits: function (str) { | ||
316 | str = unescape(encodeURIComponent(str)); | ||
317 | var out = [], i, tmp=0; | ||
318 | for (i=0; i<str.length; i++) { | ||
319 | tmp = tmp << 8 | str.charCodeAt(i); | ||
320 | if ((i&3) === 3) { | ||
321 | out.push(tmp); | ||
322 | tmp = 0; | ||
323 | } | ||
324 | } | ||
325 | if (i&3) { | ||
326 | out.push(sjcl.bitArray.partial(8*(i&3), tmp)); | ||
327 | } | ||
328 | return out; | ||
329 | } | ||
330 | }; | ||
331 | |||
332 | |||
333 | //// codecHex.js | ||
334 | |||
335 | /** @fileOverview Bit array codec implementations. | ||
336 | * | ||
337 | * @author Emily Stark | ||
338 | * @author Mike Hamburg | ||
339 | * @author Dan Boneh | ||
340 | */ | ||
341 | |||
342 | /** @namespace Hexadecimal */ | ||
343 | sjcl.codec.hex = { | ||
344 | /** Convert from a bitArray to a hex string. */ | ||
345 | fromBits: function (arr) { | ||
346 | var out = "", i; | ||
347 | for (i=0; i<arr.length; i++) { | ||
348 | out += ((arr[i]|0)+0xF00000000000).toString(16).substr(4); | ||
349 | } | ||
350 | return out.substr(0, sjcl.bitArray.bitLength(arr)/4);//.replace(/(.{8})/g, "$1 "); | ||
351 | }, | ||
352 | /** Convert from a hex string to a bitArray. */ | ||
353 | toBits: function (str) { | ||
354 | var i, out=[], len; | ||
355 | str = str.replace(/\s|0x/g, ""); | ||
356 | len = str.length; | ||
357 | str = str + "00000000"; | ||
358 | for (i=0; i<str.length; i+=8) { | ||
359 | out.push(parseInt(str.substr(i,8),16)^0); | ||
360 | } | ||
361 | return sjcl.bitArray.clamp(out, len*4); | ||
362 | } | ||
363 | }; | ||
364 | |||
365 | |||
366 | //// sha512.js | ||
367 | |||
368 | /** @fileOverview Javascript SHA-512 implementation. | ||
369 | * | ||
370 | * This implementation was written for CryptoJS by Jeff Mott and adapted for | ||
371 | * SJCL by Stefan Thomas. | ||
372 | * | ||
373 | * CryptoJS (c) 2009–2012 by Jeff Mott. All rights reserved. | ||
374 | * Released with New BSD License | ||
375 | * | ||
376 | * @author Emily Stark | ||
377 | * @author Mike Hamburg | ||
378 | * @author Dan Boneh | ||
379 | * @author Jeff Mott | ||
380 | * @author Stefan Thomas | ||
381 | */ | ||
382 | |||
383 | /** | ||
384 | * Context for a SHA-512 operation in progress. | ||
385 | * @constructor | ||
386 | * @class Secure Hash Algorithm, 512 bits. | ||
387 | */ | ||
388 | sjcl.hash.sha512 = function (hash) { | ||
389 | if (!this._key[0]) { this._precompute(); } | ||
390 | if (hash) { | ||
391 | this._h = hash._h.slice(0); | ||
392 | this._buffer = hash._buffer.slice(0); | ||
393 | this._length = hash._length; | ||
394 | } else { | ||
395 | this.reset(); | ||
396 | } | ||
397 | }; | ||
398 | |||
399 | /** | ||
400 | * Hash a string or an array of words. | ||
401 | * @static | ||
402 | * @param {bitArray|String} data the data to hash. | ||
403 | * @return {bitArray} The hash value, an array of 16 big-endian words. | ||
404 | */ | ||
405 | sjcl.hash.sha512.hash = function (data) { | ||
406 | return (new sjcl.hash.sha512()).update(data).finalize(); | ||
407 | }; | ||
408 | |||
409 | sjcl.hash.sha512.prototype = { | ||
410 | /** | ||
411 | * The hash's block size, in bits. | ||
412 | * @constant | ||
413 | */ | ||
414 | blockSize: 1024, | ||
415 | |||
416 | /** | ||
417 | * Reset the hash state. | ||
418 | * @return this | ||
419 | */ | ||
420 | reset:function () { | ||
421 | this._h = this._init.slice(0); | ||
422 | this._buffer = []; | ||
423 | this._length = 0; | ||
424 | return this; | ||
425 | }, | ||
426 | |||
427 | /** | ||
428 | * Input several words to the hash. | ||
429 | * @param {bitArray|String} data the data to hash. | ||
430 | * @return this | ||
431 | */ | ||
432 | update: function (data) { | ||
433 | if (typeof data === "string") { | ||
434 | data = sjcl.codec.utf8String.toBits(data); | ||
435 | } | ||
436 | var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), | ||
437 | ol = this._length, | ||
438 | nl = this._length = ol + sjcl.bitArray.bitLength(data); | ||
439 | for (i = 1024+ol & -1024; i <= nl; i+= 1024) { | ||
440 | this._block(b.splice(0,32)); | ||
441 | } | ||
442 | return this; | ||
443 | }, | ||
444 | |||
445 | /** | ||
446 | * Complete hashing and output the hash value. | ||
447 | * @return {bitArray} The hash value, an array of 16 big-endian words. | ||
448 | */ | ||
449 | finalize:function () { | ||
450 | var i, b = this._buffer, h = this._h; | ||
451 | |||
452 | // Round out and push the buffer | ||
453 | b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]); | ||
454 | |||
455 | // Round out the buffer to a multiple of 32 words, less the 4 length words. | ||
456 | for (i = b.length + 4; i & 31; i++) { | ||
457 | b.push(0); | ||
458 | } | ||
459 | |||
460 | // append the length | ||
461 | b.push(0); | ||
462 | b.push(0); | ||
463 | b.push(Math.floor(this._length / 0x100000000)); | ||
464 | b.push(this._length | 0); | ||
465 | |||
466 | while (b.length) { | ||
467 | this._block(b.splice(0,32)); | ||
468 | } | ||
469 | |||
470 | this.reset(); | ||
471 | return h; | ||
472 | }, | ||
473 | |||
474 | /** | ||
475 | * The SHA-512 initialization vector, to be precomputed. | ||
476 | * @private | ||
477 | */ | ||
478 | _init:[], | ||
479 | |||
480 | /** | ||
481 | * Least significant 24 bits of SHA512 initialization values. | ||
482 | * | ||
483 | * Javascript only has 53 bits of precision, so we compute the 40 most | ||
484 | * significant bits and add the remaining 24 bits as constants. | ||
485 | * | ||
486 | * @private | ||
487 | */ | ||
488 | _initr: [ 0xbcc908, 0xcaa73b, 0x94f82b, 0x1d36f1, 0xe682d1, 0x3e6c1f, 0x41bd6b, 0x7e2179 ], | ||
489 | |||
490 | /* | ||
491 | _init: | ||
492 | [0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, | ||
493 | 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179], | ||
494 | */ | ||
495 | |||
496 | /** | ||
497 | * The SHA-512 hash key, to be precomputed. | ||
498 | * @private | ||
499 | */ | ||
500 | _key:[], | ||
501 | |||
502 | /** | ||
503 | * Least significant 24 bits of SHA512 key values. | ||
504 | * @private | ||
505 | */ | ||
506 | _keyr: | ||
507 | [0x28ae22, 0xef65cd, 0x4d3b2f, 0x89dbbc, 0x48b538, 0x05d019, 0x194f9b, 0x6d8118, | ||
508 | 0x030242, 0x706fbe, 0xe4b28c, 0xffb4e2, 0x7b896f, 0x1696b1, 0xc71235, 0x692694, | ||
509 | 0xf14ad2, 0x4f25e3, 0x8cd5b5, 0xac9c65, 0x2b0275, 0xa6e483, 0x41fbd4, 0x1153b5, | ||
510 | 0x66dfab, 0xb43210, 0xfb213f, 0xef0ee4, 0xa88fc2, 0x0aa725, 0x03826f, 0x0e6e70, | ||
511 | 0xd22ffc, 0x26c926, 0xc42aed, 0x95b3df, 0xaf63de, 0x77b2a8, 0xedaee6, 0x82353b, | ||
512 | 0xf10364, 0x423001, 0xf89791, 0x54be30, 0xef5218, 0x65a910, 0x71202a, 0xbbd1b8, | ||
513 | 0xd2d0c8, 0x41ab53, 0x8eeb99, 0x9b48a8, 0xc95a63, 0x418acb, 0x63e373, 0xb2b8a3, | ||
514 | 0xefb2fc, 0x172f60, 0xf0ab72, 0x6439ec, 0x631e28, 0x82bde9, 0xc67915, 0x72532b, | ||
515 | 0x26619c, 0xc0c207, 0xe0eb1e, 0x6ed178, 0x176fba, 0xc898a6, 0xf90dae, 0x1c471b, | ||
516 | 0x047d84, 0xc72493, 0xc9bebc, 0x100d4c, 0x3e42b6, 0x657e2a, 0xd6faec, 0x475817], | ||
517 | |||
518 | /* | ||
519 | _key: | ||
520 | [0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, | ||
521 | 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, | ||
522 | 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, | ||
523 | 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, | ||
524 | 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, | ||
525 | 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, | ||
526 | 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, | ||
527 | 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, | ||
528 | 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, | ||
529 | 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, | ||
530 | 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, | ||
531 | 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, | ||
532 | 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, | ||
533 | 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, | ||
534 | 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, | ||
535 | 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, | ||
536 | 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, | ||
537 | 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, | ||
538 | 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, | ||
539 | 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817], | ||
540 | */ | ||
541 | |||
542 | /** | ||
543 | * Function to precompute _init and _key. | ||
544 | * @private | ||
545 | */ | ||
546 | _precompute: function () { | ||
547 | // XXX: This code is for precomputing the SHA256 constants, change for | ||
548 | // SHA512 and re-enable. | ||
549 | var i = 0, prime = 2, factor; | ||
550 | |||
551 | function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; } | ||
552 | function frac2(x) { return (x-Math.floor(x)) * 0x10000000000 & 0xff; } | ||
553 | |||
554 | outer: for (; i<80; prime++) { | ||
555 | for (factor=2; factor*factor <= prime; factor++) { | ||
556 | if (prime % factor === 0) { | ||
557 | // not a prime | ||
558 | continue outer; | ||
559 | } | ||
560 | } | ||
561 | |||
562 | if (i<8) { | ||
563 | this._init[i*2] = frac(Math.pow(prime, 1/2)); | ||
564 | this._init[i*2+1] = (frac2(Math.pow(prime, 1/2)) << 24) | this._initr[i]; | ||
565 | } | ||
566 | this._key[i*2] = frac(Math.pow(prime, 1/3)); | ||
567 | this._key[i*2+1] = (frac2(Math.pow(prime, 1/3)) << 24) | this._keyr[i]; | ||
568 | i++; | ||
569 | } | ||
570 | }, | ||
571 | |||
572 | /** | ||
573 | * Perform one cycle of SHA-512. | ||
574 | * @param {bitArray} words one block of words. | ||
575 | * @private | ||
576 | */ | ||
577 | _block:function (words) { | ||
578 | var i, wrh, wrl, | ||
579 | w = words.slice(0), | ||
580 | h = this._h, | ||
581 | k = this._key, | ||
582 | h0h = h[ 0], h0l = h[ 1], h1h = h[ 2], h1l = h[ 3], | ||
583 | h2h = h[ 4], h2l = h[ 5], h3h = h[ 6], h3l = h[ 7], | ||
584 | h4h = h[ 8], h4l = h[ 9], h5h = h[10], h5l = h[11], | ||
585 | h6h = h[12], h6l = h[13], h7h = h[14], h7l = h[15]; | ||
586 | |||
587 | // Working variables | ||
588 | var ah = h0h, al = h0l, bh = h1h, bl = h1l, | ||
589 | ch = h2h, cl = h2l, dh = h3h, dl = h3l, | ||
590 | eh = h4h, el = h4l, fh = h5h, fl = h5l, | ||
591 | gh = h6h, gl = h6l, hh = h7h, hl = h7l; | ||
592 | |||
593 | for (i=0; i<80; i++) { | ||
594 | // load up the input word for this round | ||
595 | if (i<16) { | ||
596 | wrh = w[i * 2]; | ||
597 | wrl = w[i * 2 + 1]; | ||
598 | } else { | ||
599 | // Gamma0 | ||
600 | var gamma0xh = w[(i-15) * 2]; | ||
601 | var gamma0xl = w[(i-15) * 2 + 1]; | ||
602 | var gamma0h = | ||
603 | ((gamma0xl << 31) | (gamma0xh >>> 1)) ^ | ||
604 | ((gamma0xl << 24) | (gamma0xh >>> 8)) ^ | ||
605 | (gamma0xh >>> 7); | ||
606 | var gamma0l = | ||
607 | ((gamma0xh << 31) | (gamma0xl >>> 1)) ^ | ||
608 | ((gamma0xh << 24) | (gamma0xl >>> 8)) ^ | ||
609 | ((gamma0xh << 25) | (gamma0xl >>> 7)); | ||
610 | |||
611 | // Gamma1 | ||
612 | var gamma1xh = w[(i-2) * 2]; | ||
613 | var gamma1xl = w[(i-2) * 2 + 1]; | ||
614 | var gamma1h = | ||
615 | ((gamma1xl << 13) | (gamma1xh >>> 19)) ^ | ||
616 | ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ | ||
617 | (gamma1xh >>> 6); | ||
618 | var gamma1l = | ||
619 | ((gamma1xh << 13) | (gamma1xl >>> 19)) ^ | ||
620 | ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ | ||
621 | ((gamma1xh << 26) | (gamma1xl >>> 6)); | ||
622 | |||
623 | // Shortcuts | ||
624 | var wr7h = w[(i-7) * 2]; | ||
625 | var wr7l = w[(i-7) * 2 + 1]; | ||
626 | |||
627 | var wr16h = w[(i-16) * 2]; | ||
628 | var wr16l = w[(i-16) * 2 + 1]; | ||
629 | |||
630 | // W(round) = gamma0 + W(round - 7) + gamma1 + W(round - 16) | ||
631 | wrl = gamma0l + wr7l; | ||
632 | wrh = gamma0h + wr7h + ((wrl >>> 0) < (gamma0l >>> 0) ? 1 : 0); | ||
633 | wrl += gamma1l; | ||
634 | wrh += gamma1h + ((wrl >>> 0) < (gamma1l >>> 0) ? 1 : 0); | ||
635 | wrl += wr16l; | ||
636 | wrh += wr16h + ((wrl >>> 0) < (wr16l >>> 0) ? 1 : 0); | ||
637 | } | ||
638 | |||
639 | w[i*2] = wrh |= 0; | ||
640 | w[i*2 + 1] = wrl |= 0; | ||
641 | |||
642 | // Ch | ||
643 | var chh = (eh & fh) ^ (~eh & gh); | ||
644 | var chl = (el & fl) ^ (~el & gl); | ||
645 | |||
646 | // Maj | ||
647 | var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch); | ||
648 | var majl = (al & bl) ^ (al & cl) ^ (bl & cl); | ||
649 | |||
650 | // Sigma0 | ||
651 | var sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7)); | ||
652 | var sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7)); | ||
653 | |||
654 | // Sigma1 | ||
655 | var sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9)); | ||
656 | var sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9)); | ||
657 | |||
658 | // K(round) | ||
659 | var krh = k[i*2]; | ||
660 | var krl = k[i*2+1]; | ||
661 | |||
662 | // t1 = h + sigma1 + ch + K(round) + W(round) | ||
663 | var t1l = hl + sigma1l; | ||
664 | var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0); | ||
665 | t1l += chl; | ||
666 | t1h += chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0); | ||
667 | t1l += krl; | ||
668 | t1h += krh + ((t1l >>> 0) < (krl >>> 0) ? 1 : 0); | ||
669 | t1l = t1l + wrl|0; // FF32..FF34 perf issue https://bugzilla.mozilla.org/show_bug.cgi?id=1054972 | ||
670 | t1h += wrh + ((t1l >>> 0) < (wrl >>> 0) ? 1 : 0); | ||
671 | |||
672 | // t2 = sigma0 + maj | ||
673 | var t2l = sigma0l + majl; | ||
674 | var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0); | ||
675 | |||
676 | // Update working variables | ||
677 | hh = gh; | ||
678 | hl = gl; | ||
679 | gh = fh; | ||
680 | gl = fl; | ||
681 | fh = eh; | ||
682 | fl = el; | ||
683 | el = (dl + t1l) | 0; | ||
684 | eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; | ||
685 | dh = ch; | ||
686 | dl = cl; | ||
687 | ch = bh; | ||
688 | cl = bl; | ||
689 | bh = ah; | ||
690 | bl = al; | ||
691 | al = (t1l + t2l) | 0; | ||
692 | ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0; | ||
693 | } | ||
694 | |||
695 | // Intermediate hash | ||
696 | h0l = h[1] = (h0l + al) | 0; | ||
697 | h[0] = (h0h + ah + ((h0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0; | ||
698 | h1l = h[3] = (h1l + bl) | 0; | ||
699 | h[2] = (h1h + bh + ((h1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0; | ||
700 | h2l = h[5] = (h2l + cl) | 0; | ||
701 | h[4] = (h2h + ch + ((h2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0; | ||
702 | h3l = h[7] = (h3l + dl) | 0; | ||
703 | h[6] = (h3h + dh + ((h3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0; | ||
704 | h4l = h[9] = (h4l + el) | 0; | ||
705 | h[8] = (h4h + eh + ((h4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0; | ||
706 | h5l = h[11] = (h5l + fl) | 0; | ||
707 | h[10] = (h5h + fh + ((h5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0; | ||
708 | h6l = h[13] = (h6l + gl) | 0; | ||
709 | h[12] = (h6h + gh + ((h6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0; | ||
710 | h7l = h[15] = (h7l + hl) | 0; | ||
711 | h[14] = (h7h + hh + ((h7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0; | ||
712 | } | ||
713 | }; | ||
714 | |||
715 | |||
716 | //// hmac.js | ||
717 | |||
718 | /** @fileOverview HMAC implementation. | ||
719 | * | ||
720 | * @author Emily Stark | ||
721 | * @author Mike Hamburg | ||
722 | * @author Dan Boneh | ||
723 | */ | ||
724 | |||
725 | /** HMAC with the specified hash function. | ||
726 | * @constructor | ||
727 | * @param {bitArray} key the key for HMAC. | ||
728 | * @param {Object} [hash=sjcl.hash.sha256] The hash function to use. | ||
729 | */ | ||
730 | sjcl.misc.hmac = function (key, Hash) { | ||
731 | this._hash = Hash = Hash || sjcl.hash.sha256; | ||
732 | var exKey = [[],[]], i, | ||
733 | bs = Hash.prototype.blockSize / 32; | ||
734 | this._baseHash = [new Hash(), new Hash()]; | ||
735 | |||
736 | if (key.length > bs) { | ||
737 | key = Hash.hash(key); | ||
738 | } | ||
739 | |||
740 | for (i=0; i<bs; i++) { | ||
741 | exKey[0][i] = key[i]^0x36363636; | ||
742 | exKey[1][i] = key[i]^0x5C5C5C5C; | ||
743 | } | ||
744 | |||
745 | this._baseHash[0].update(exKey[0]); | ||
746 | this._baseHash[1].update(exKey[1]); | ||
747 | this._resultHash = new Hash(this._baseHash[0]); | ||
748 | }; | ||
749 | |||
750 | /** HMAC with the specified hash function. Also called encrypt since it's a prf. | ||
751 | * @param {bitArray|String} data The data to mac. | ||
752 | */ | ||
753 | sjcl.misc.hmac.prototype.encrypt = sjcl.misc.hmac.prototype.mac = function (data) { | ||
754 | if (!this._updated) { | ||
755 | this.update(data); | ||
756 | return this.digest(data); | ||
757 | } else { | ||
758 | throw new sjcl.exception.invalid("encrypt on already updated hmac called!"); | ||
759 | } | ||
760 | }; | ||
761 | |||
762 | sjcl.misc.hmac.prototype.reset = function () { | ||
763 | this._resultHash = new this._hash(this._baseHash[0]); | ||
764 | this._updated = false; | ||
765 | }; | ||
766 | |||
767 | sjcl.misc.hmac.prototype.update = function (data) { | ||
768 | this._updated = true; | ||
769 | this._resultHash.update(data); | ||
770 | }; | ||
771 | |||
772 | sjcl.misc.hmac.prototype.digest = function () { | ||
773 | var w = this._resultHash.finalize(), result = new (this._hash)(this._baseHash[1]).update(w).finalize(); | ||
774 | |||
775 | this.reset(); | ||
776 | |||
777 | return result; | ||
778 | }; | ||
779 | |||
780 | |||
781 | //// pbkdf2.js | ||
782 | |||
783 | |||
784 | /** @fileOverview Password-based key-derivation function, version 2.0. | ||
785 | * | ||
786 | * @author Emily Stark | ||
787 | * @author Mike Hamburg | ||
788 | * @author Dan Boneh | ||
789 | */ | ||
790 | |||
791 | /** Password-Based Key-Derivation Function, version 2.0. | ||
792 | * | ||
793 | * Generate keys from passwords using PBKDF2-HMAC-SHA256. | ||
794 | * | ||
795 | * This is the method specified by RSA's PKCS #5 standard. | ||
796 | * | ||
797 | * @param {bitArray|String} password The password. | ||
798 | * @param {bitArray|String} salt The salt. Should have lots of entropy. | ||
799 | * @param {Number} [count=1000] The number of iterations. Higher numbers make the function slower but more secure. | ||
800 | * @param {Number} [length] The length of the derived key. Defaults to the | ||
801 | output size of the hash function. | ||
802 | * @param {Object} [Prff=sjcl.misc.hmac] The pseudorandom function family. | ||
803 | * @return {bitArray} the derived key. | ||
804 | */ | ||
805 | sjcl.misc.pbkdf2 = function (password, salt, count, length, Prff) { | ||
806 | count = count || 1000; | ||
807 | |||
808 | if (length < 0 || count < 0) { | ||
809 | throw sjcl.exception.invalid("invalid params to pbkdf2"); | ||
810 | } | ||
811 | |||
812 | if (typeof password === "string") { | ||
813 | password = sjcl.codec.utf8String.toBits(password); | ||
814 | } | ||
815 | |||
816 | if (typeof salt === "string") { | ||
817 | salt = sjcl.codec.utf8String.toBits(salt); | ||
818 | } | ||
819 | |||
820 | Prff = Prff || sjcl.misc.hmac; | ||
821 | |||
822 | var prf = new Prff(password), | ||
823 | u, ui, i, j, k, out = [], b = sjcl.bitArray; | ||
824 | |||
825 | for (k = 1; 32 * out.length < (length || 1); k++) { | ||
826 | u = ui = prf.encrypt(b.concat(salt,[k])); | ||
827 | |||
828 | for (i=1; i<count; i++) { | ||
829 | ui = prf.encrypt(ui); | ||
830 | for (j=0; j<ui.length; j++) { | ||
831 | u[j] ^= ui[j]; | ||
832 | } | ||
833 | } | ||
834 | |||
835 | out = out.concat(u); | ||
836 | } | ||
837 | |||
838 | if (length) { out = b.clamp(out, length); } | ||
839 | |||
840 | return out; | ||
841 | }; | ||
842 | |||
843 | |||
844 | //// sha256.js | ||
845 | |||
846 | /** @fileOverview Javascript SHA-256 implementation. | ||
847 | * | ||
848 | * An older version of this implementation is available in the public | ||
849 | * domain, but this one is (c) Emily Stark, Mike Hamburg, Dan Boneh, | ||
850 | * Stanford University 2008-2010 and BSD-licensed for liability | ||
851 | * reasons. | ||
852 | * | ||
853 | * Special thanks to Aldo Cortesi for pointing out several bugs in | ||
854 | * this code. | ||
855 | * | ||
856 | * @author Emily Stark | ||
857 | * @author Mike Hamburg | ||
858 | * @author Dan Boneh | ||
859 | */ | ||
860 | |||
861 | /** | ||
862 | * Context for a SHA-256 operation in progress. | ||
863 | * @constructor | ||
864 | * @class Secure Hash Algorithm, 256 bits. | ||
865 | */ | ||
866 | sjcl.hash.sha256 = function (hash) { | ||
867 | if (!this._key[0]) { this._precompute(); } | ||
868 | if (hash) { | ||
869 | this._h = hash._h.slice(0); | ||
870 | this._buffer = hash._buffer.slice(0); | ||
871 | this._length = hash._length; | ||
872 | } else { | ||
873 | this.reset(); | ||
874 | } | ||
875 | }; | ||
876 | |||
877 | /** | ||
878 | * Hash a string or an array of words. | ||
879 | * @static | ||
880 | * @param {bitArray|String} data the data to hash. | ||
881 | * @return {bitArray} The hash value, an array of 16 big-endian words. | ||
882 | */ | ||
883 | sjcl.hash.sha256.hash = function (data) { | ||
884 | return (new sjcl.hash.sha256()).update(data).finalize(); | ||
885 | }; | ||
886 | |||
887 | sjcl.hash.sha256.prototype = { | ||
888 | /** | ||
889 | * The hash's block size, in bits. | ||
890 | * @constant | ||
891 | */ | ||
892 | blockSize: 512, | ||
893 | |||
894 | /** | ||
895 | * Reset the hash state. | ||
896 | * @return this | ||
897 | */ | ||
898 | reset:function () { | ||
899 | this._h = this._init.slice(0); | ||
900 | this._buffer = []; | ||
901 | this._length = 0; | ||
902 | return this; | ||
903 | }, | ||
904 | |||
905 | /** | ||
906 | * Input several words to the hash. | ||
907 | * @param {bitArray|String} data the data to hash. | ||
908 | * @return this | ||
909 | */ | ||
910 | update: function (data) { | ||
911 | if (typeof data === "string") { | ||
912 | data = sjcl.codec.utf8String.toBits(data); | ||
913 | } | ||
914 | var i, b = this._buffer = sjcl.bitArray.concat(this._buffer, data), | ||
915 | ol = this._length, | ||
916 | nl = this._length = ol + sjcl.bitArray.bitLength(data); | ||
917 | for (i = 512+ol & -512; i <= nl; i+= 512) { | ||
918 | this._block(b.splice(0,16)); | ||
919 | } | ||
920 | return this; | ||
921 | }, | ||
922 | |||
923 | /** | ||
924 | * Complete hashing and output the hash value. | ||
925 | * @return {bitArray} The hash value, an array of 8 big-endian words. | ||
926 | */ | ||
927 | finalize:function () { | ||
928 | var i, b = this._buffer, h = this._h; | ||
929 | |||
930 | // Round out and push the buffer | ||
931 | b = sjcl.bitArray.concat(b, [sjcl.bitArray.partial(1,1)]); | ||
932 | |||
933 | // Round out the buffer to a multiple of 16 words, less the 2 length words. | ||
934 | for (i = b.length + 2; i & 15; i++) { | ||
935 | b.push(0); | ||
936 | } | ||
937 | |||
938 | // append the length | ||
939 | b.push(Math.floor(this._length / 0x100000000)); | ||
940 | b.push(this._length | 0); | ||
941 | |||
942 | while (b.length) { | ||
943 | this._block(b.splice(0,16)); | ||
944 | } | ||
945 | |||
946 | this.reset(); | ||
947 | return h; | ||
948 | }, | ||
949 | |||
950 | /** | ||
951 | * The SHA-256 initialization vector, to be precomputed. | ||
952 | * @private | ||
953 | */ | ||
954 | _init:[], | ||
955 | /* | ||
956 | _init:[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19], | ||
957 | */ | ||
958 | |||
959 | /** | ||
960 | * The SHA-256 hash key, to be precomputed. | ||
961 | * @private | ||
962 | */ | ||
963 | _key:[], | ||
964 | /* | ||
965 | _key: | ||
966 | [0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, | ||
967 | 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, | ||
968 | 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, | ||
969 | 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, | ||
970 | 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, | ||
971 | 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, | ||
972 | 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, | ||
973 | 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2], | ||
974 | */ | ||
975 | |||
976 | |||
977 | /** | ||
978 | * Function to precompute _init and _key. | ||
979 | * @private | ||
980 | */ | ||
981 | _precompute: function () { | ||
982 | var i = 0, prime = 2, factor; | ||
983 | |||
984 | function frac(x) { return (x-Math.floor(x)) * 0x100000000 | 0; } | ||
985 | |||
986 | outer: for (; i<64; prime++) { | ||
987 | for (factor=2; factor*factor <= prime; factor++) { | ||
988 | if (prime % factor === 0) { | ||
989 | // not a prime | ||
990 | continue outer; | ||
991 | } | ||
992 | } | ||
993 | |||
994 | if (i<8) { | ||
995 | this._init[i] = frac(Math.pow(prime, 1/2)); | ||
996 | } | ||
997 | this._key[i] = frac(Math.pow(prime, 1/3)); | ||
998 | i++; | ||
999 | } | ||
1000 | }, | ||
1001 | |||
1002 | /** | ||
1003 | * Perform one cycle of SHA-256. | ||
1004 | * @param {bitArray} words one block of words. | ||
1005 | * @private | ||
1006 | */ | ||
1007 | _block:function (words) { | ||
1008 | var i, tmp, a, b, | ||
1009 | w = words.slice(0), | ||
1010 | h = this._h, | ||
1011 | k = this._key, | ||
1012 | h0 = h[0], h1 = h[1], h2 = h[2], h3 = h[3], | ||
1013 | h4 = h[4], h5 = h[5], h6 = h[6], h7 = h[7]; | ||
1014 | |||
1015 | /* Rationale for placement of |0 : | ||
1016 | * If a value can overflow is original 32 bits by a factor of more than a few | ||
1017 | * million (2^23 ish), there is a possibility that it might overflow the | ||
1018 | * 53-bit mantissa and lose precision. | ||
1019 | * | ||
1020 | * To avoid this, we clamp back to 32 bits by |'ing with 0 on any value that | ||
1021 | * propagates around the loop, and on the hash state h[]. I don't believe | ||
1022 | * that the clamps on h4 and on h0 are strictly necessary, but it's close | ||
1023 | * (for h4 anyway), and better safe than sorry. | ||
1024 | * | ||
1025 | * The clamps on h[] are necessary for the output to be correct even in the | ||
1026 | * common case and for short inputs. | ||
1027 | */ | ||
1028 | for (i=0; i<64; i++) { | ||
1029 | // load up the input word for this round | ||
1030 | if (i<16) { | ||
1031 | tmp = w[i]; | ||
1032 | } else { | ||
1033 | a = w[(i+1 ) & 15]; | ||
1034 | b = w[(i+14) & 15]; | ||
1035 | tmp = w[i&15] = ((a>>>7 ^ a>>>18 ^ a>>>3 ^ a<<25 ^ a<<14) + | ||
1036 | (b>>>17 ^ b>>>19 ^ b>>>10 ^ b<<15 ^ b<<13) + | ||
1037 | w[i&15] + w[(i+9) & 15]) | 0; | ||
1038 | } | ||
1039 | |||
1040 | tmp = (tmp + h7 + (h4>>>6 ^ h4>>>11 ^ h4>>>25 ^ h4<<26 ^ h4<<21 ^ h4<<7) + (h6 ^ h4&(h5^h6)) + k[i]); // | 0; | ||
1041 | |||
1042 | // shift register | ||
1043 | h7 = h6; h6 = h5; h5 = h4; | ||
1044 | h4 = h3 + tmp | 0; | ||
1045 | h3 = h2; h2 = h1; h1 = h0; | ||
1046 | |||
1047 | h0 = (tmp + ((h1&h2) ^ (h3&(h1^h2))) + (h1>>>2 ^ h1>>>13 ^ h1>>>22 ^ h1<<30 ^ h1<<19 ^ h1<<10)) | 0; | ||
1048 | } | ||
1049 | |||
1050 | h[0] = h[0]+h0 | 0; | ||
1051 | h[1] = h[1]+h1 | 0; | ||
1052 | h[2] = h[2]+h2 | 0; | ||
1053 | h[3] = h[3]+h3 | 0; | ||
1054 | h[4] = h[4]+h4 | 0; | ||
1055 | h[5] = h[5]+h5 | 0; | ||
1056 | h[6] = h[6]+h6 | 0; | ||
1057 | h[7] = h[7]+h7 | 0; | ||
1058 | } | ||
1059 | }; | ||