Compare commits
550 Commits
Author | SHA1 | Date |
---|---|---|
dependabot[bot] | 4f4015a4f7 | |
dependabot[bot] | b73ce7bd2e | |
David Humphrey | 3279c2d65a | |
Ben Heidemann | e135305f25 | |
David Humphrey | 0b26979839 | |
Ben Heidemann | 7efc4cdc1d | |
David Humphrey | 4112d072b5 | |
David Humphrey | ee26394ead | |
David Humphrey | 9f8804f716 | |
David Humphrey | 621b6567e0 | |
David Humphrey | 4acd064a2b | |
David Humphrey | b283023286 | |
Arun Bose | 24697a3ed9 | |
dependabot[bot] | 5f872f0f24 | |
bcheidemann | 77abca991a | |
bcheidemann | 49ace4b2fb | |
bcheidemann | d055d8042e | |
bcheidemann | 576831370f | |
bcheidemann | 594ab2621f | |
Ben Heidemann | 75a2cc86cf | |
Ben Heidemann | a4b3726520 | |
Ben Heidemann | 21e7a4750a | |
Ben Heidemann | aa2df3a17c | |
Ben Heidemann | bd15462f6e | |
Ben Heidemann | 78ae19fbad | |
Ben Heidemann | b3caddcfec | |
Ben Heidemann | 11e05e131b | |
Ben Heidemann | fb100b165a | |
Ben Heidemann | e94543471b | |
Ben Heidemann | 20d4d5e720 | |
Ben Heidemann | 0295d19a7f | |
Ben Heidemann | 365a7d23a3 | |
Ben Heidemann | ea5e48b48b | |
Ben Heidemann | e82374ae2b | |
Ben Heidemann | 5bd05287d4 | |
Ben Heidemann | 1c34abf009 | |
Ben Heidemann | 8b4b0a6140 | |
Ben Heidemann | e489409b9c | |
Ben Heidemann | 0db08e31bb | |
Ben Heidemann | 1f02edf5b3 | |
Ben Heidemann | 708c84fc63 | |
Ben Heidemann | 4e45701b51 | |
Ben Heidemann | fe9ed6a648 | |
Ben Heidemann | 81ab65b95c | |
Ben Heidemann | 582352f754 | |
Ben Heidemann | 3b9fafc53e | |
Ben Heidemann | bfb50bf608 | |
Ben Heidemann | ce56539190 | |
Ben Heidemann | 0f812fc6a0 | |
Ben Heidemann | 767c83706b | |
Ben Heidemann | 6a20ac2c3f | |
Ben Heidemann | 2bcf7e560b | |
Ben Heidemann | d040763a73 | |
Ben Heidemann | fd90f32d4c | |
dependabot[bot] | e18104a60d | |
Ben Heidemann | 7bd6e5f4e1 | |
Ben Heidemann | 90db749ee5 | |
Ben Heidemann | f9c5473c49 | |
Ben Heidemann | f5ad682fd7 | |
Ben Heidemann | 7b1c3e85ce | |
Ben Heidemann | 51afeeaf54 | |
Ben Heidemann | cef6adfc37 | |
Ben Heidemann | 6590cb79bd | |
Ben Heidemann | 3e88aeca92 | |
Ben Heidemann | f8c9732be9 | |
David Humphrey | 200171d2a5 | |
David Humphrey | 095f78498f | |
David Humphrey | 5cf2495079 | |
David Humphrey | aacc8061cf | |
Ben Heidemann | c378288819 | |
Ben Heidemann | d1054753a6 | |
bcheidemann | 887ed9318a | |
Ben Heidemann | ce076729f6 | |
bcheidemann | a2151cab25 | |
bcheidemann | 3a8a59d362 | |
bcheidemann | 15be384940 | |
bcheidemann | 6027376efa | |
bcheidemann | 8b57d299f4 | |
bcheidemann | d6b29226aa | |
bcheidemann | da65e06e3c | |
bcheidemann | aa152955b5 | |
bcheidemann | d264113e0d | |
bcheidemann | ce809c4ac9 | |
dependabot[bot] | 3061328459 | |
David Humphrey | c0a41d67ff | |
David Humphrey | 4941d10e13 | |
David Humphrey | 07a00a3f77 | |
bcheidemann | 0f5fe64ae8 | |
bcheidemann | 7ec1fed51f | |
bcheidemann | a2f7ee044b | |
bcheidemann | 7415e45867 | |
bcheidemann | 986ad37597 | |
bcheidemann | 9c669564b2 | |
bcheidemann | 9d03788c1c | |
Ben Heidemann | a60d2b4cfc | |
bcheidemann | 417a4e97dd | |
bcheidemann | 4d4b6bf3f3 | |
bcheidemann | f12f01dca0 | |
bcheidemann | 128e10dc13 | |
bcheidemann | ceed84f377 | |
bcheidemann | 2a581726c6 | |
David Humphrey | 75f2a70c7b | |
David Humphrey | 9db879374d | |
David Humphrey | 98683fe261 | |
SillyFreak | f1fc53d88f | |
Rachael Scotchmer | 4aae53839a | |
dcoull | 94d5ff8795 | |
Charles M Drani | ee56794601 | |
rscotchmer | 914ba8b473 | |
Oleksii Polovyi | 2a4fa0f0fd | |
ApolllonDev | 9d3f220d92 | |
Abdirahman Guled | 3d10d6431c | |
Adel El Masery | 7ab6f5e7c6 | |
kwchan19 | 9487e8ecc6 | |
hoaianhkhang | e6f8ef2251 | |
Paul Moon | f2201e7a74 | |
otkach | 3447ec9c8a | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | fe17870a8f | |
David Humphrey | f4e0dce8d3 | |
Priyanka Dhiman | 34e5580a66 | |
Aqeel Parpia | c515865fb3 | |
Aqeel Parpia | 4887cc725f | |
Aqeel Parpia | 3471848b39 | |
David Humphrey | 9b3e567dd1 | |
David Humphrey | bf18093661 | |
David Humphrey | fa3186d322 | |
David Humphrey | 8a2e64f9ea | |
Alvin Valdez | 0ec51a198d | |
Oleksii Polovyi | 317cee5636 | |
cmchumak | 3c51bbb24f | |
Arash N | 9d4b264479 | |
Sahib Arora | b5e1d9a82b | |
Jacob Adach | da1aad5667 | |
Violet-XiaoWeiHuang | 05057c45d2 | |
Rachael Scotchmer | 4ba9eded4c | |
Woosle Park | 8eaaeeed17 | |
Brandon Wissmann | 3b4bf42604 | |
Harsh Patel | 701849eb5a | |
DavidLi119 | 87513997a2 | |
bonbon12 | 1e660a9d07 | |
Iryna Thompson | 3f619fdcb8 | |
Vincent Logozzo | 43bba422d9 | |
Priyam Brahmbhatt | 7e46fcde8f | |
OlenaVyshnevska | fc545ee3c7 | |
Yuansheng Lu | e5481efa9b | |
Vladimir Rozin | 5918cf6ae7 | |
jatinkumar | 0380a8153c | |
Nathaniel Ngo | 4a39dcc2f0 | |
andrewkoung | 4de0bbfafd | |
Priyanka Dhiman | 7cdef6d963 | |
David Humphrey | 26b47ee094 | |
David Humphrey | 5f10cc2fde | |
David Humphrey | 4e9593f5e8 | |
David Humphrey | 01d76ba0df | |
David Humphrey | dd7536827b | |
David Humphrey | c6e1d51612 | |
David Humphrey | c0acdb97d6 | |
David Humphrey | f4ff2e9ed9 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 85a8c21dc1 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 9c13a2d248 | |
David Humphrey | 1ad81f9bae | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | bc861bfd4a | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 11c91acdcf | |
David Humphrey | ace4222a82 | |
David Humphrey | 7301024382 | |
David Humphrey | 6ec8cd6191 | |
David Humphrey | 52baa2523d | |
David Humphrey | d4bfcd71c2 | |
David Humphrey | 4f427ed8d7 | |
David Humphrey | 22731267a9 | |
David Humphrey | 9cb4ff7c0a | |
David Humphrey | 3dea503289 | |
David Humphrey | 909a66efd7 | |
David Humphrey | ea236cf43b | |
David Humphrey | f053c738b8 | |
David Humphrey | 3afbcca8b3 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | b4c3d1f1ae | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 3f400d17bf | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 1f3b9e79bf | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | bfe4385a83 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 5cc21c72fb | |
Julia Yatsenko | 9f7f93776e | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 69758613db | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 1ae7a220b4 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | b5fe85caaa | |
David Humphrey | d0178539f5 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | f738cbc17d | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | b7312bfa1e | |
Vince | b0809272a1 | |
Vince | fb76c0ec1e | |
qwang135 | 9a7d3514d8 | |
Yuecheng Wu | 848cc7d3de | |
David Humphrey | ba188169d6 | |
mordax | 62cbe11a93 | |
mordax | ef80713c33 | |
Alexei Kozachenko | 0eb7066a86 | |
David Humphrey | 158f6241b6 | |
Dan Lin | 4a5d8c1222 | |
kwkofler | 443b582038 | |
David Humphrey | 83bd64fd58 | |
imedqq | 783e7a9e67 | |
imedqq | 2aa6cf2b5f | |
David Humphrey | acef2c93b0 | |
Deepanjali Gerangal | 94fd5ba829 | |
Deepanjali Gerangal | e3a285ae54 | |
Petr Bouianov | 1775c24d37 | |
chen yuzhou | 3d7ff3e08d | |
chen yuzhou | 1e1c704f7e | |
chen yuzhou | e1124993ba | |
David Humphrey | 97d2d1bfe3 | |
David Humphrey | 2841b2eba7 | |
Mera-Gangapersaud | 0352dad66c | |
David Humphrey | 307fc3e32c | |
David Humphrey | 33339b81d7 | |
Adam | 7e941bb304 | |
Adam | db237e617b | |
Adam | bb9dd2e67c | |
Pooch11 | 0a1aa0fecc | |
Pooch11 | d894a4cf16 | |
David Humphrey | 16e6b3e1c9 | |
Dragomegak | af3815c54b | |
Dragomegak | 0748951ca8 | |
Dragomegak | 265f0b1d0d | |
David Humphrey | 1c450ae8e7 | |
PopeSpaceous | 0395c4beae | |
jagmeetb | 1abcb0369b | |
David Humphrey | d1dd5fef61 | |
Josh Mayers | e85880dc8b | |
David Humphrey | 97a6004091 | |
chen yuzhou | 0e75661b4b | |
David Humphrey | 5218057d80 | |
David Humphrey | 61a1f5e020 | |
Deepanjali Gerangal | 0f93a04e40 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 0f94c476e7 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 0ed97864ec | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | f5678ebe20 | |
kwkofler | 97fb82769a | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 7d196763f8 | |
kwkofler | 6a5d9073f3 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | a107fe21d7 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | d7945d745d | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 923b999e89 | |
David Humphrey | 9acedc2beb | |
David Humphrey | 395406609d | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | cc6e3f7edf | |
David Humphrey | 43d2632069 | |
David Humphrey | 7ab229a64c | |
yatsenko-julia | f57c7330d3 | |
David Humphrey | 89cfef0f07 | |
David Humphrey | d1cf1286cb | |
David Humphrey | 2135ee17e9 | |
David Humphrey | 725bfbf30c | |
yuzhouChen | 89626107cc | |
Susan Truong | a25d71b524 | |
Alan K | d1afe9719d | |
Deepanjali Gerangal | 400b2c3c88 | |
David Humphrey | ea95badc5b | |
Rikku-x | a5fc0e699a | |
Alexander Ponomaroff | ce030b91fa | |
Deepanjali Gerangal | 5568c27bec | |
Volodymyr Klymenko | bfcb5a6a94 | |
ThomasNolte | 3bbabfcb4a | |
Shawn Pang | 1eab5f0ffd | |
yatsenko-julia | 73f0f19bb9 | |
bblarney | 707d404db0 | |
VictorKubrak | a447b2dd45 | |
AHKol | 8aa8dda4d6 | |
Stephen Ward | 08b0b3001e | |
Stephen Ward | 675773b92a | |
Janice | 41510e7da4 | |
jrkong | b1c4f04f83 | |
Stephen Ward | ee67cb39de | |
Stephen Ward | e11c101600 | |
Stephen Ward | 7a6a4160e6 | |
pynnl | c33f22b464 | |
Julia McGeoghan | 389dedd3c0 | |
yuzhouChen | 8504cc7e2a | |
yevseytsev | 27659d45da | |
Stephen Truong | 934ef8bfa7 | |
Ruihui Yan | c7ea45a18b | |
Sean | 009821290f | |
Thanh Nguyen | 2f3c384868 | |
giantpanpan | beea03dbae | |
ywpark1 | 3e0da99040 | |
dleung25 | 02bd6d8a62 | |
Jeffrey Espiritu | 7e27c8be2c | |
Casva | e77361107e | |
Daniel Bogomazov | 87230ce1e3 | |
Huda Al Dallal | 2e2e2f9d64 | |
rdittrich97 | 0354c7e13e | |
y2s82 | 1156f420c4 | |
Nick Skuybeda | 86b6b2a907 | |
Chaya Danzinger | a8759b1e38 | |
David Humphrey | c84dd14f5e | |
rhayes2 | 31b3c40d74 | |
rhayes2 | 7a716e033b | |
rhayes2 | 395de63751 | |
rhayes2 | 7f155a0f40 | |
rhayes2 | 294685d6cb | |
Stephen Ward | 62b85d1442 | |
Stephen Ward | 30752c9109 | |
Stephen Ward | f3a7170133 | |
Stephen Ward | 833ac62c45 | |
Stephen Ward | 78b3452d5d | |
Stephen Ward | e7811eb53b | |
rhayes2 | 546b4567d2 | |
Corey James | e3a1187ef9 | |
rhayes2 | 499c72daaf | |
Stephen Ward | add00ce563 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 5e4de6b698 | |
0xazure | fd3de6be2c | |
Dmytro | 353290a08f | |
Alan K | de45918cbc | |
David Humphrey | 53f5b0c50b | |
David Humphrey | 7798b1cb87 | |
David Humphrey | 0da0e60194 | |
David Humphrey | dc8fa4cb96 | |
David Humphrey | 3a44c1756a | |
David Humphrey | 8d553b78e0 | |
David Humphrey | b92151cdc5 | |
David Humphrey | bcf4d9834a | |
David Humphrey | ed11b01234 | |
David Humphrey | 0980ec4608 | |
David Humphrey | a31044cc8d | |
David Humphrey | 454d5bc801 | |
David Humphrey | d41885e9d0 | |
David Humphrey | 0e00af661a | |
David Humphrey | f89b616fdc | |
David Humphrey | cbcddee3be | |
David Humphrey | 1a738dd2bb | |
David Humphrey | 9e08d96c96 | |
David Humphrey | 980d5d0917 | |
David Humphrey | a8e373e4b9 | |
David Humphrey | 86e57d60db | |
David Humphrey | 054094c852 | |
David Humphrey | cafff52c3a | |
David Humphrey | 1c7b40c895 | |
David Humphrey | 7258a2913e | |
David Humphrey | bb8743eda1 | |
David Humphrey | 94e6a98cb8 | |
David Humphrey | ee8e2a665a | |
David Humphrey | a93ae13c99 | |
David Humphrey | ab87c7f14a | |
David Humphrey | 49931722cc | |
David Humphrey | 3e1c3deb51 | |
David Humphrey | a8c3fa85db | |
David Humphrey | 51c81edb5b | |
David Humphrey | 8e900a3a88 | |
David Humphrey | 4a066064f4 | |
David Humphrey | e5b6026b91 | |
David Humphrey | a900d8df6d | |
David Humphrey | 2ad0d0eb8b | |
Alan K | 04f9c57cd8 | |
David Humphrey | e155c2d1a0 | |
David Humphrey | 9832807dd1 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 65bbc17ccb | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | c15145cc03 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | d61c61aab8 | |
Alan K | 2e90fdae0c | |
David Humphrey | 9ded3ea1eb | |
David Humphrey | 3da99f0133 | |
David Humphrey | 31cd579682 | |
David Humphrey | b7ecae4af1 | |
David Humphrey | 46698f30e2 | |
David Humphrey | c71a91f72f | |
David Humphrey | eee8200e23 | |
David Humphrey | 1087371fc4 | |
David Humphrey | 4e73ef8d9b | |
David Humphrey | 9508833b37 | |
David Humphrey | e77a8bacd3 | |
David Humphrey | bf1d0e41d6 | |
David Humphrey | c526445a43 | |
David Humphrey | 0aaaeacd1a | |
David Humphrey | ee412d4abe | |
David Humphrey | 9244e9be6e | |
David Humphrey | 2efb956411 | |
David Humphrey | 93633da622 | |
David Humphrey | 2e627cfe5b | |
Alan K | b026537f09 | |
Alan K | f771f48e8b | |
David Humphrey | 2a4674d11f | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 18a470e264 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 3650b798ed | |
David Humphrey | 6d3cec89ee | |
Santiago Castro | 68cbd54524 | |
David Humphrey | c8f217fbcd | |
orthographic-pedant | 3ddb877276 | |
Alan K | 525e11f203 | |
Alan K | ddc41f49a5 | |
Alan K | 9f625c0d0f | |
Alan K | 8325b5a9d7 | |
Alan K | d66114e20c | |
Kieran Sedgwick | 9101db2344 | |
Alan K | 4de8bc4b81 | |
Alan K | 047536c013 | |
David Humphrey | 6549a98b6a | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 03896eef05 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | c85fa1851f | |
Kieran Sedgwick | f338991ace | |
Kieran Sedgwick | 1df35e1834 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | a13297449d | |
David Humphrey | f143ea0ce7 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 17fb8993c3 | |
Gideon Thomas | e9c4cb6d7a | |
Alan K | 78f9ce824d | |
Kieran Sedgwick | 4dc2bce59d | |
Kieran Sedgwick | 0f63c0988c | |
Kieran Sedgwick | af0698a859 | |
Alan K | db4274f1d2 | |
Kieran Sedgwick | 4b01317189 | |
Alan K | 28e981c0c1 | |
Gideon Thomas | 67dba10d49 | |
Alan K | 841360de71 | |
Gideon Thomas | 8c4de99a98 | |
Alan K | 2347e12db2 | |
Alan K | fbb55c86e6 | |
Alan K | db23ae2bd2 | |
Alan K | ef9df89517 | |
Alan K | 4e31547270 | |
Alan K | 830c6adde6 | |
Alan K | 8c0f8eaac8 | |
Alan K | 2b6d54cbf4 | |
Alan K | 5798beb99f | |
Alan K | 9e3f48d783 | |
Alan K | f812ad406d | |
Alan K | 68070d0768 | |
gideonthomas | d28100c422 | |
yoavgurevich | 32265e92d7 | |
yoavgurevich | d720f65d23 | |
yoavgurevich | b4efa7d2a4 | |
Alan K | e39129a7f4 | |
Alan K | f160f540a0 | |
Alan K | d6c77abfa0 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 21b602ef66 | |
Alan K | 76d256f744 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 4cdcca1a8d | |
Gideon Thomas | 286074f519 | |
Alan K | b1cf2d7dfb | |
Gideon Thomas | 91f7bf0319 | |
Alan K | 1283535d75 | |
Kieran Sedgwick | 63f5fdeb6c | |
Kieran Sedgwick | 0d4110ff6f | |
Alan K | f8ca6e8208 | |
Alan K | 9612cbcbdc | |
Kieran Sedgwick | 483d3fef72 | |
Kieran Sedgwick | a05faf0b2a | |
Kieran Sedgwick | 3178ad9a45 | |
Kieran Sedgwick | c4c13c1535 | |
Alan K | 62be361fdc | |
Alan K | 9b51e10742 | |
Alan K | 94411e3b8d | |
Alan K | f0829b69ca | |
Alan K | ba9902fb93 | |
David Humphrey | a3afbe472b | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | f9e21cd576 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 1a4be5e2fd | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 570b40f9ca | |
Alan K | 4dd322c560 | |
Alan K | ce2184b8c1 | |
Alan K | 04d612c97b | |
Alan K | c113907f62 | |
Ali Al Dallal | ab1c793137 | |
Alan K | 3b43204587 | |
Ali Al Dallal | a37f262f41 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 108558e7e6 | |
Alan K | 44b32b849d | |
gideonthomas | 8c00b856bc | |
Alan K | af5eea103a | |
gideonthomas | 19eea4f502 | |
Alan K | ed60c0b1fb | |
Alan K | 2da47dafbb | |
gideonthomas | 9f60ce8a71 | |
Alan K | 284a7cf5cf | |
Alan K | b1e428a4e7 | |
Alan K | 44af0709c3 | |
Ali Al Dallal | 5a75de1881 | |
Alan K | 5dfebed4c7 | |
David Humphrey | 9a05ef3c17 | |
Pomax | 15c25e7ff9 | |
David Humphrey | fb20e6789a | |
Pomax | cdd38f2db4 | |
Pomax | 3344338c2e | |
David Humphrey | 41bf256751 | |
Ali Al Dallal | adf039943d | |
Alan K | a9551d8a56 | |
Alan K | 4126321996 | |
Alan K | 08f4b7e528 | |
Alan K | 3134c0be46 | |
Alan K | e79a6302ce | |
gideonthomas | f451ed96cc | |
Alan K | 16dfb79de9 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | ba5f3fdbcd | |
Alan K | 27a5e6ee26 | |
Alan K | cf2469f270 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 057b43ae02 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 4bba2512b0 | |
Alan K | e01e422fe9 | |
Alan K | fa9d4967fd | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | fe0d6ce680 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 29f50ac2fd | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 851d863652 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | ee9ea82cfb | |
Alan K | d11e84d268 | |
Alan K | 533c37d9ec | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 84112410ba | |
Alan K | 3e9b77a37a | |
David Humphrey | a467711c90 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | ed0137dece | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 4b1f95c6c9 | |
David Humphrey | 14a469510f | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 2590a886ac | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 1a2774b152 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | b3da2f7681 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | c916c0a407 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 76118694bf | |
Alan K | 270d705f12 | |
Alan K | 98d89cc12c | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | d44b37c13d | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | e8c88be4ba | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | d55bf23f1b | |
Alan K | 2d653d474e | |
Bobby Richter | 65ddff6ae7 | |
secretrobotron | 77e0ee7117 | |
secretrobotron | eb79a956ea | |
secretrobotron | af1943b5c9 | |
Alan K | 4b01276c28 | |
Alan K | 63132bddcb | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 2114f65f09 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 5b785037f0 | |
Alan K | e9eae3549b | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 9d704e80c9 | |
Alan K | 79e9008175 | |
Alan K | ef4de22586 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | e063edc6fc | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 064e986d26 | |
Alan K | 10f1f43d93 | |
Alan K | 3ab2701ad9 | |
Alan K | 15a3174956 | |
Alan K | 9d93191672 | |
Alan K | b83fea22b5 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 2eae45f402 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 4623b568fb | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 2992f7417b | |
Alan K | 2c005d0390 | |
Alan K | 1392bf35aa | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 4d10ba29a9 | |
Alan K | 5b521675c4 | |
Alan K | 95a6200dbb | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 08f037ce53 | |
David Humphrey (:humph) david.humphrey@senecacollege.ca | 6716a1ff1a |
|
@ -0,0 +1 @@
|
|||
tests/dist/
|
|
@ -0,0 +1,36 @@
|
|||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"mocha": true,
|
||||
"node": true
|
||||
},
|
||||
"extends": "eslint:recommended",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2017,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"rules": {
|
||||
"indent": [
|
||||
"error",
|
||||
2
|
||||
],
|
||||
"linebreak-style": [
|
||||
"error",
|
||||
"unix"
|
||||
],
|
||||
"quotes": [
|
||||
"error",
|
||||
"single"
|
||||
],
|
||||
"semi": [
|
||||
"error",
|
||||
"always"
|
||||
],
|
||||
"eqeqeq": [
|
||||
"error",
|
||||
"always"
|
||||
]
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
* text=auto eol=lf
|
|
@ -0,0 +1,27 @@
|
|||
name: node-js-ci
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches:
|
||||
- master
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ${{matrix.os}}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
||||
node: ['14', '16']
|
||||
|
||||
name: Node ${{ matrix.node }} on ${{ matrix.os }}
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Test
|
||||
uses: actions/setup-node@v2.4.1
|
||||
with:
|
||||
node-version: ${{ matrix.node }}
|
||||
- run: npm install
|
||||
- run: npm test
|
|
@ -1,6 +1,13 @@
|
|||
node_modules
|
||||
bower_components
|
||||
.env
|
||||
*~
|
||||
dist/filer-test.js
|
||||
dist/filer-issue225.js
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
# Parcel build dirs
|
||||
.cache
|
||||
tests/dist
|
||||
|
||||
# nyc code coverage
|
||||
.nyc_output
|
||||
coverage
|
||||
|
|
|
@ -0,0 +1,17 @@
|
|||
{
|
||||
"hooks": {
|
||||
"before:init": ["npm run test"],
|
||||
"before:bump": ["npm run build"]
|
||||
},
|
||||
"git": {
|
||||
"pushRepo": "git@github.com:filerjs/filer.git",
|
||||
"tagName": "v${version}"
|
||||
},
|
||||
"npm": {
|
||||
"publish": true
|
||||
},
|
||||
"github": {
|
||||
"pushRepo": "git@github.com:filerjs/filer.git",
|
||||
"release": true
|
||||
}
|
||||
}
|
31
.travis.yml
31
.travis.yml
|
@ -1,9 +1,32 @@
|
|||
sudo: false
|
||||
language: node_js
|
||||
|
||||
node_js:
|
||||
- "0.10"
|
||||
before_install: npm install -g grunt-cli
|
||||
- "lts/*"
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- "node_modules"
|
||||
|
||||
os:
|
||||
- linux
|
||||
- osx
|
||||
|
||||
# Setup headless Firefox and Chrome support
|
||||
# https://docs.travis-ci.com/user/gui-and-headless-browsers/#Using-the-Chrome-addon-in-the-headless-mode
|
||||
env:
|
||||
- MOZ_HEADLESS=1
|
||||
addons:
|
||||
chrome: stable
|
||||
firefox: latest
|
||||
before_install:
|
||||
- google-chrome-stable --headless --disable-gpu --remote-debugging-port=9222 http://localhost &
|
||||
|
||||
after_success:
|
||||
- npm install -g codecov
|
||||
- npm run coverage
|
||||
- codecov
|
||||
|
||||
notifications:
|
||||
email: false
|
||||
irc: "irc.mozilla.org#filer"
|
||||
env:
|
||||
- "FILER_UPSTREAM_URI=\"default\" FILER_UPSTREAM_BRANCH=\"default\" FILER_UPSTREAM_REMOTE_NAME=\"default\""
|
||||
|
|
2
AUTHORS
2
AUTHORS
|
@ -5,3 +5,5 @@ Barry Tulchinsky <barry.tulchinsky@gmail.com> (@btulchinsky)
|
|||
Kieran Sedgwick <kieran.sedgwick@gmail.com> (@sedge)
|
||||
Yoav Gurevich <ygurevich@ymail.com>
|
||||
Gideon Thomas <r.gideonthomas@gmail.com>
|
||||
Abdirahman Guled <aguled2@myseneca.ca>
|
||||
Ben Heidemann <ben@heidemann.co.uk>
|
|
@ -9,78 +9,67 @@ message and I'll update it.
|
|||
|
||||
## Setup
|
||||
|
||||
The Filer build system is based on [grunt](http://gruntjs.com/). To get a working build system
|
||||
do the following:
|
||||
To get a working build system do the following:
|
||||
|
||||
```
|
||||
npm install
|
||||
npm install -g grunt-cli
|
||||
```
|
||||
|
||||
You can now run the following grunt tasks:
|
||||
* `grunt check` will run [JSHint](http://www.jshint.com/) on your code (do this before submitting a pull request) to catch errors
|
||||
* `grunt develop` will create a single file version of the library for testing in `dist/idbfs.js`
|
||||
* `grunt release` like `develop` but will also create a minified version of the library in `dist/idbfs.min.js`
|
||||
* `grunt test` or `grunt test-node` will run [JSHint](http://www.jshint.com/) on your code and the test suite in the context of `nodejs`
|
||||
* `grunt test-browser` will run [JSHint](http://www.jshint.com/) and start a localhost server on port `1234`. Navigating to `localhost:1234/tests/index.html` will run the test suite in the context of the browser. **NOTE:** When finished, you will have to manually shut off the server by pressing `cmd/ctrl`+`c` in the same terminal session you ran `grunt test-browser`.
|
||||
Next, make sure you have installed Chrome and Firefox, which are needed for
|
||||
running headless versions of the tests with `npm test`.
|
||||
|
||||
Once you've done some hacking and you'd like to have your work merged, you'll need to
|
||||
make a pull request. If you're patch includes code, make sure to check that all the
|
||||
unit tests pass, including any new tests you wrote. Finally, make sure you add yourself
|
||||
to the `AUTHORS` file.
|
||||
|
||||
=======
|
||||
### Releasing a new version
|
||||
=======
|
||||
|
||||
`grunt publish` will:
|
||||
|
||||
* Run the `grunt release` task
|
||||
* Bump `bower.json` & `package.json` version numbers according to a [Semver](http://semver.org/) compatible scheme (see ["How to Publish"](#how-to-publish) below)
|
||||
* Create a git tag at the new version number
|
||||
* Create a release commit including `dist/filer.js`, `dist/filer.min.js`, `bower.json` and `package.json`
|
||||
* Push tag & commit to `origin/develop`
|
||||
* Update the `gh-pages` branch with the contents of the `develop` branch
|
||||
* Force push the `gh-pages` branch to `origin/gh-pages`
|
||||
* Publish the new version of the module to NPM
|
||||
|
||||
#### How to configure
|
||||
1. Copy `env.sample` to `.env`
|
||||
2. Modify as needed, or leave alone for defaults
|
||||
|
||||
#### How to Publish
|
||||
`grunt publish` can be run in four ways:
|
||||
|
||||
1. `grunt publish` - does a patch (x.x.X) bump
|
||||
2. `grunt publish:patch` - also does a patch (x.x.X) bump
|
||||
3. `grunt publish:minor` - does a minor (x.X.x) bump
|
||||
4. `grunt publish:major` - does a major (X.x.x) bump
|
||||
|
||||
The user *must* be on their local `develop` branch before running any form of `grunt publish`, or else the task will fail loudly.
|
||||
|
||||
=======
|
||||
## Tests
|
||||
|
||||
Tests are writting using [Mocha](http://visionmedia.github.io/mocha/) and [Chai](http://chaijs.com/api/bdd/).
|
||||
You can run the tests in your browser by running `grunt test-browser` and opening the `tests` directory @ `http://localhost:1234/tests`, or in a nodejs context by running `grunt test`.
|
||||
Tests are written using [Mocha](https://mochajs.org/) and [Chai](http://chaijs.com/api/bdd/).
|
||||
There are a number of ways to run the tests. The preferred way is:
|
||||
|
||||
```
|
||||
npm test
|
||||
```
|
||||
|
||||
This will do a build, run the linting, start a server, and load the tests into
|
||||
headless versions of Chrome and Firefox.
|
||||
|
||||
If you want more control over how tests are run, you can use other scripts:
|
||||
|
||||
* Linting is done via `npm run lint` or `npm run eslint`, both of which will run `eslint` on the `src` and `tests` directories. You can also use `npm run lint:fix` or `npm run eslint:fix`, which will run `eslint` with `--fix` on the `src` and `tests` directories, automatically fixing minor issues. Linting is run by default as part of `npm test`
|
||||
|
||||
* In headless versions of Chrome and Firefox using `npm test`. A report at the end will tell you what happened with each browser. Browser tests are preferred because they also test our providers (e.g., IndexedDB). They do take longer to run. You can also use `npm run karma-mocha-firefox` or `npm run karma-mocha-chrome` to run the tests in only one of the two headless browsers.
|
||||
|
||||
* In node.js using the Memory provider using `npm run test:node`. These run much faster, but don't run all tests (e.g., providers, watches).
|
||||
|
||||
* If you need to debug browser tests, or want to run them in a different browser, use `npm run test:manual`, which will start a server and you can point your browser to [http://localhost:1234](http://localhost:1234). Running the tests this way will also automatically watch your files, and hot-reload your code and tests, which is useful for debugging and trial/error testing.
|
||||
|
||||
* If you need to debug node.js test runs, you can do so using `npm run test:node-debug`. Then, open Chrome and browse to [chrome://inspect](chrome://inspect) and click on your tests in the inspector. The easiest way to get a breakpoint is to manually add a `debugger` keyword to your test code where you want the tests to stop.
|
||||
|
||||
> Tip: you can add `skip()` to any `it()` or `describe()` in Mocha to skip a test, or `only()` to have only that test run. For example: `describe.skip(...)` or `it.only(...)`.
|
||||
|
||||
* If you want to run migration tests separate from unit tests, use `npm run test:migrations`. Migration tests run at the end of a typical `npm test` run. If you need to create a new migration test, see [`tools/fs-image.js`](tools/fs-image.js) for details on how to generate a filesystem image, and [tests/filesystems/images/README.md](tests/filesystems/images/README.md) for more docs.
|
||||
|
||||
* If you want to manually generate coverage info for the tests, use `npm run coverage`. This is done automatically in Travis, so you shouldn't need to do it. You can see [https://codecov.io/gh/filerjs/filer](https://codecov.io/gh/filerjs/filer) for detailed reports.
|
||||
|
||||
There are a number of configurable options for the test suite, which are set via query string params.
|
||||
First, you can choose which filer source to use (i.e., src/, dist/filer-test.js, dist/filer.js or dist/filer.min.js).
|
||||
The default is to use what is in /dist/filer-test.js, and you can switch to other versions like so:
|
||||
First, you can choose which filer source to use (i.e., src/, dist/filer-test.js, dist/filer.js or dist/filer.min.js). The default is to use what is in /dist/filer-test.js, and you can switch to other versions like so:
|
||||
|
||||
* tests/index.html?filer-dist/filer.js
|
||||
* tests/index.html?filer-dist/filer.min.js
|
||||
* tests/index.html?filer-src/filer.js (from src)
|
||||
|
||||
Second, you can specify which provider to use for all non-provider specific tests (i.e., most of the tests).
|
||||
The default provider is `Memory`, and you can switch it like so:
|
||||
|
||||
* tests/index.html?filer-provider=memory
|
||||
* tests/index.html?filer-provider=indexeddb
|
||||
* tests/index.html?filer-provider=websql
|
||||
|
||||
If you're writing tests, make sure you write them in the same style as existing tests, which are
|
||||
provider agnostic. See `tests/lib/test-utils.js` and how it gets used in various tests as
|
||||
an example.
|
||||
provider agnostic. See [`tests/lib/test-utils.js`](tests/lib/test-utils.js) and how it gets used
|
||||
in various tests as an example.
|
||||
|
||||
## Communication
|
||||
## Releases
|
||||
|
||||
If you'd like to talk to someone about the project, you can reach us on irc.mozilla.org in the #filer or #mofodev channel. Look for "ack" or "humph".
|
||||
In order to perform a release, you'll need commit access to the main Filer repo,
|
||||
as well as access to publish to Filer's npm module. To do a release:
|
||||
|
||||
1. Make sure you have a .env file, with your `GITHUB_TOKEN` included. See [`env.sample`](env.sample) for more info on how to create one.
|
||||
1. Login to the `npm` registry if you haven't already using `npm login`
|
||||
1. Run `npm run release`. Releases are done interactively using [release-it](https://www.npmjs.com/package/release-it), and our config is defined in [`.release-it.json`](.release-it.json).
|
||||
|
|
2
LICENSE
2
LICENSE
|
@ -1,4 +1,4 @@
|
|||
Copyright (c) 2013, Alan Kligman
|
||||
Copyright (c) 2013 - 2019 Alan Kligman and the Filer contributors
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||
|
|
19
bower.json
19
bower.json
|
@ -1,19 +0,0 @@
|
|||
{
|
||||
"name": "filer",
|
||||
"version": "0.0.15",
|
||||
"main": "dist/filer.js",
|
||||
"devDependencies": {
|
||||
"mocha": "1.17.1",
|
||||
"chai": "1.9.0"
|
||||
},
|
||||
"ignore": [
|
||||
"build",
|
||||
"examples",
|
||||
"package.json",
|
||||
"tests",
|
||||
"gruntfile.js",
|
||||
"node_modules",
|
||||
"src",
|
||||
"tools"
|
||||
]
|
||||
}
|
|
@ -1,5 +0,0 @@
|
|||
module.exports = (function() {
|
||||
var habitat = require('habitat');
|
||||
habitat.load();
|
||||
return new habitat();
|
||||
})();
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
13
env.sample
13
env.sample
|
@ -1,14 +1,9 @@
|
|||
###
|
||||
# Dev ENVIRONMENT file
|
||||
#
|
||||
# Copy to .env to use defaults
|
||||
# Copy to .env to use defaults when releasing via `npm release`
|
||||
###
|
||||
|
||||
# GIT (upstream) url to publish to
|
||||
export FILER_UPSTREAM_URI="git@github.com:js-platform/filer.git"
|
||||
|
||||
# GIT (upstream) branch to publish to
|
||||
export FILER_UPSTREAM_BRANCH="develop"
|
||||
|
||||
# Remote name for upstream repo
|
||||
export FILER_UPSTREAM_REMOTE_NAME="origin"
|
||||
# GitHub Personal Access Token (to push releases)
|
||||
# https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/
|
||||
GITHUB_TOKEN=
|
||||
|
|
|
@ -1,163 +0,0 @@
|
|||
#indexedDBViewer {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
font-family: Courier;
|
||||
font-size: 12px;
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
right: 0px;
|
||||
height: 100%;
|
||||
z-index: 999999;
|
||||
background-color: lightgray;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
#indexedDBViewer li {
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
list-style: none;
|
||||
}
|
||||
|
||||
#indexedDBViewer ul {
|
||||
list-style: none;
|
||||
margin: 0px;
|
||||
padding: 0px 0px 0px 15px;
|
||||
}
|
||||
|
||||
#indexedDBViewer h1 {
|
||||
padding: 0px 0px 5px 0px;
|
||||
margin: 0px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
#indexedDBViewerHeader {
|
||||
height: 15px;
|
||||
width: 100%;
|
||||
cursor: row-resize;
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
#indexedDBViewerHeader span {
|
||||
cursor: pointer;
|
||||
height: 13px;
|
||||
width: 13px;
|
||||
padding-left: 0px;
|
||||
padding-right: 0px;
|
||||
border: 1px solid black;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#indexedDBViewerNavigation {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
min-width: 200px;
|
||||
vertical-align: top;
|
||||
padding: 2px 2px 2px 2px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#indexedDBViewerContent {
|
||||
display: inline-block;
|
||||
height: 100%;
|
||||
width: auto;
|
||||
min-width: 400px;
|
||||
vertical-align: top;
|
||||
padding: 2px 2px 2px 12px;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoresTable {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoresRowHeaderName {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoresRowHeaderKeyPath {
|
||||
width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoresRowHeaderAutoIncrement {
|
||||
width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexTable {
|
||||
width: 100%
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderName {
|
||||
width: auto;
|
||||
min-width: 150px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderKeyPath {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderObjectStore {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderMultiEntry {
|
||||
width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderUnique {
|
||||
width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoreRowHeaderKey {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoreRowHeaderValue {
|
||||
width: auto;
|
||||
min-width: 400px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderKey {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderPrimaryKey {
|
||||
width: auto;
|
||||
min-width: 100px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentIndexRowHeaderValue {
|
||||
width: auto;
|
||||
min-width: 400px;
|
||||
text-align: left;
|
||||
}
|
||||
|
||||
#indexedDBViewerContentObjectStoreTable td, #indexedDBViewerContentIndexTable td {
|
||||
vertical-align: top;
|
||||
text-align: left;
|
||||
padding: 0px;
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
#indexedDBViewer .clickable {
|
||||
cursor: pointer;
|
||||
}
|
|
@ -1,317 +0,0 @@
|
|||
/// <reference path="jquery-1.7.2.js" />
|
||||
/// <reference path="Linq2IndexedDB.js" />
|
||||
|
||||
$(function () {
|
||||
function initializeViewer() {
|
||||
var placeholder = $("#indexedDBViewer");
|
||||
var dbName = placeholder.attr("data-dbName");
|
||||
createHeader('indexedDBViewerHeader', placeholder);
|
||||
var navigation = retrieveOrCreateElement('indexedDBViewerNavigation', 'div', placeholder);
|
||||
var menu = retrieveOrCreateElement('indexedDBViewerMenu', 'ul', navigation);
|
||||
var menuOverview = expandableListItem('indexedDBViewerMenuOverview', dbName, menu, viewDb, { dbName: dbName, objectStore: null, index: null });
|
||||
|
||||
navigation.addClass('nav');
|
||||
|
||||
linq2indexedDB.prototype.core.db(dbName).then(function () {
|
||||
var connection = arguments[0][0];
|
||||
|
||||
linq2indexedDB.prototype.core.dbStructureChanged.addListener(linq2indexedDB.prototype.core.databaseEvents.databaseBlocked, function () {
|
||||
connection.close();
|
||||
});
|
||||
|
||||
var menuObjectStores = retrieveOrCreateElement('indexedDBViewerMenuObjectStores', 'ul', menuOverview);
|
||||
|
||||
for (var i = 0; i < connection.objectStoreNames.length; i++) {
|
||||
var storeName = connection.objectStoreNames[i];
|
||||
var menuObjectStore = expandableListItem('indexedDBViewerMenuObjectStore' + storeName, storeName, menuObjectStores, viewDb, { dbName: dbName, objectStore: storeName, index: null });
|
||||
|
||||
linq2indexedDB.prototype.core.objectStore(linq2indexedDB.prototype.core.transaction(connection, storeName, linq2indexedDB.prototype.core.transactionTypes.READ_ONLY, false), storeName).then(function (args) {
|
||||
var store = args[1];
|
||||
|
||||
var menuObjectStore = retrieveOrCreateElement('indexedDBViewerMenuObjectStore' + storeName, 'li', menuObjectStores);
|
||||
var menuIndexes = retrieveOrCreateElement('indexedDBViewerMenuObjectStore' + store.name + 'Indexes', 'ul', menuObjectStore);
|
||||
|
||||
for (var j = 0; j < store.indexNames.length; j++) {
|
||||
var indexName = store.indexNames[i];
|
||||
expandableListItem('indexedDBViewerMenuObjectStore' + store.name + 'Index' + indexName, indexName, menuIndexes, viewDb, { dbName: dbName, objectStore: store.name, index: indexName });
|
||||
}
|
||||
});
|
||||
}
|
||||
}, null, function (args) {
|
||||
if (args[1].type == "upgradeneeded") {
|
||||
args[0].abort();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function viewDb(e) {
|
||||
var dbName = e.data.dbName;
|
||||
var objectStore = e.data.objectStore;
|
||||
var index = e.data.index;
|
||||
var content = retrieveOrCreateElement('indexedDBViewerContent', 'div', $("#indexedDBViewer"));
|
||||
content.empty();
|
||||
|
||||
if (objectStore != null) {
|
||||
if (index != null) {
|
||||
retrieveOrCreateElement('indexedDBViewerContentGeneral', 'h1', content).text(index);
|
||||
}
|
||||
else {
|
||||
retrieveOrCreateElement('indexedDBViewerContentGeneral', 'h1', content).text(objectStore);
|
||||
}
|
||||
}
|
||||
|
||||
linq2indexedDB.prototype.core.db(dbName).then(function () {
|
||||
var connection = arguments[0][0];
|
||||
|
||||
if (objectStore == null) {
|
||||
retrieveOrCreateElement('indexedDBViewerContentGeneral', 'h1', content).text("General");
|
||||
retrieveOrCreateElement('indexedDBViewerContentGeneralName', 'span', content).text("Name: " + connection.name);
|
||||
content.append("<br/>");
|
||||
retrieveOrCreateElement('indexedDBViewerContentGeneralVersion', 'span', content).text("Version: " + connection.version);
|
||||
content.append("<br/>");
|
||||
content.append("<br/>");
|
||||
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStores', 'h1', content).text("Object stores");
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresTable', 'table', content);
|
||||
content.append("<br/>");
|
||||
content.append("<br/>");
|
||||
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndex', 'h1', content).text("Indexes");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexTable', 'table', content);
|
||||
content.append("<br/>");
|
||||
}
|
||||
|
||||
linq2indexedDB.prototype.core.dbStructureChanged.addListener(linq2indexedDB.prototype.core.databaseEvents.databaseBlocked, function () {
|
||||
connection.close();
|
||||
});
|
||||
|
||||
for (var i = 0; i < connection.objectStoreNames.length; i++) {
|
||||
var storeName = connection.objectStoreNames[i];
|
||||
linq2indexedDB.prototype.core.objectStore(linq2indexedDB.prototype.core.transaction(connection, storeName, linq2indexedDB.prototype.core.transactionTypes.READ_ONLY, false), storeName).then(function (args) {
|
||||
var store = args[1];
|
||||
if (objectStore == null) {
|
||||
viewObjectStoreDefinition(store.name, store.keyPath, store.autoIncrement, content);
|
||||
}
|
||||
else {
|
||||
if (index == null && store.name == objectStore) {
|
||||
linq2indexedDB.prototype.core.cursor(store).then(function () {
|
||||
|
||||
}, function () {
|
||||
}, function (args1) {
|
||||
var keyValue = args1[0];
|
||||
viewObjectStoreData(keyValue.key, keyValue.data, content);
|
||||
});
|
||||
}
|
||||
}
|
||||
for (var j = 0; j < store.indexNames.length; j++) {
|
||||
linq2indexedDB.prototype.core.index(store, store.indexNames[j], false).then(function (args1) {
|
||||
var ix = args1[1];
|
||||
if (objectStore == null) {
|
||||
viewIndexDefinition(ix.name, ix.keyPath, ix.objectStore.name, ix.multiEntry || ix.multiRow, ix.unique, content);
|
||||
}
|
||||
else {
|
||||
if (index != null && ix.name == index) {
|
||||
linq2indexedDB.prototype.core.cursor(ix).then(function () {
|
||||
var x = 1;
|
||||
}, function () {
|
||||
}, function (args1) {
|
||||
var keyValue = args1[0];
|
||||
viewIndexData(args1[1].key, args1[1].primaryKey, keyValue.data, content);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
function viewObjectStoreDefinition(name, keyPath, autoIncrement, parent) {
|
||||
var table = retrieveOrCreateElement('indexedDBViewerContentObjectStoresTable', 'table', parent);
|
||||
var headerRow = retrieveOrCreateElement('indexedDBViewerContentObjectStoresRowHeader', 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRowHeaderName', 'th', headerRow).text("name");
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRowHeaderKeyPath', 'th', headerRow).text("keyPath");
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRowHeaderAutoIncrement', 'th', headerRow).text("autoIncrement");
|
||||
|
||||
|
||||
var dataRow = retrieveOrCreateElement('indexedDBViewerContentObjectStoresRow' + name, 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRow' + name + 'Name', 'td', dataRow).text(name);
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRow' + name + 'KeyPath', 'td', dataRow).text(keyPath);
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoresRow' + name + 'AutoIncrement', 'td', dataRow).text(autoIncrement);
|
||||
}
|
||||
|
||||
function viewIndexDefinition(name, keyPath, objectStore, multiEntry, unique, parent) {
|
||||
var table = retrieveOrCreateElement('indexedDBViewerContentIndexTable', 'table', parent);
|
||||
var headerRow = retrieveOrCreateElement('indexedDBViewerContentIndexRowHeader', 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderName', 'th', headerRow).text("name");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderKeyPath', 'th', headerRow).text("keyPath");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderObjectStore', 'th', headerRow).text("objectStore");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderMultiEntry', 'th', headerRow).text("multiEntry");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderUnique', 'th', headerRow).text("unique");
|
||||
|
||||
|
||||
var dataRow = retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name, 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name + 'Name', 'td', dataRow).text(name);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name + 'KeyPath', 'td', dataRow).text(keyPath);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name + 'ObjectStore', 'td', dataRow).text(objectStore);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name + 'MultiEntry', 'td', dataRow).text(multiEntry);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRow' + name + 'Unique', 'td', dataRow).text(unique);
|
||||
}
|
||||
|
||||
function viewObjectStoreData(key, value, parent) {
|
||||
var table = retrieveOrCreateElement('indexedDBViewerContentObjectStoreTable', 'table', parent);
|
||||
var headerRow = retrieveOrCreateElement('indexedDBViewerContentObjectStoreRowHeader', 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoreRowHeaderKey', 'th', headerRow).text("key");
|
||||
retrieveOrCreateElement('indexedDBViewerContentObjectStoreRowHeaderValue', 'th', headerRow).text("value");
|
||||
|
||||
|
||||
var dataRow = retrieveOrCreateElement('indexedDBViewerContentObjectStoreRow' + key, 'tr', table);
|
||||
viewData(key, retrieveOrCreateElement('indexedDBViewerContentObjectStoreRow' + key + 'Key', 'td', dataRow));
|
||||
viewData(value, retrieveOrCreateElement('indexedDBViewerContentObjectStoreRow' + key + 'Value', 'td', dataRow));
|
||||
}
|
||||
|
||||
function viewIndexData(key, primaryKey, value, parent) {
|
||||
var table = retrieveOrCreateElement('indexedDBViewerContentIndexTable', 'table', parent);
|
||||
var headerRow = retrieveOrCreateElement('indexedDBViewerContentIndexRowHeader', 'tr', table);
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderKey', 'th', headerRow).text("key");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderPrimaryKey', 'th', headerRow).text("primary key");
|
||||
retrieveOrCreateElement('indexedDBViewerContentIndexRowHeaderValue', 'th', headerRow).text("value");
|
||||
|
||||
|
||||
var dataRow = retrieveOrCreateElement('indexedDBViewerContentIndexRow' + primaryKey, 'tr', table);
|
||||
viewData(key, retrieveOrCreateElement('indexedDBViewerContentIndexRow' + primaryKey + 'Key', 'td', dataRow));
|
||||
viewData(primaryKey, retrieveOrCreateElement('indexedDBViewerContentIndexRow' + primaryKey + 'PrimaryKey', 'td', dataRow));
|
||||
viewData(value, retrieveOrCreateElement('indexedDBViewerContentIndexRow' + primaryKey + 'Value', 'td', dataRow));
|
||||
}
|
||||
|
||||
function viewData(value, parent, propName) {
|
||||
var text;
|
||||
|
||||
if (propName) {
|
||||
text = propName + value;
|
||||
}
|
||||
else {
|
||||
parent = retrieveOrCreateElement(null, 'ul', parent);
|
||||
text = value;
|
||||
}
|
||||
|
||||
if (typeof (value) === "object" && !(value instanceof Date)) {
|
||||
var object = expandableListItem(null, text, parent);
|
||||
var properties = retrieveOrCreateElement(null, 'ul', object);
|
||||
for (prop in value) {
|
||||
viewData(value[prop], properties, prop + ": ");
|
||||
}
|
||||
object.find('.expendable')[0].click();
|
||||
}
|
||||
else {
|
||||
retrieveOrCreateElement(null, 'li', parent).text(text);
|
||||
}
|
||||
}
|
||||
|
||||
function expandableListItem(id, text, parent, clickEvent, clickEventData) {
|
||||
var li = retrieveOrCreateElement(id, 'li', parent);
|
||||
var col = retrieveOrCreateElement(null, 'span', li);
|
||||
col.text(' - ');
|
||||
col.data('status', 'open');
|
||||
col.click(function () {
|
||||
if ($(this).data('status') == 'closed') {
|
||||
$($($(this)[0].parentElement).find('ul')[0]).show();
|
||||
col.text(' - ');
|
||||
col.data('status', 'open');
|
||||
}
|
||||
else if ($(this).data('status') == 'open') {
|
||||
$($($(this)[0].parentElement).find('ul')[0]).hide();
|
||||
col.text(' + ');
|
||||
col.data('status', 'closed');
|
||||
}
|
||||
});
|
||||
col.addClass("clickable");
|
||||
col.addClass("expendable");
|
||||
|
||||
var item = retrieveOrCreateElement(null, 'span', li);
|
||||
item.text(text);
|
||||
|
||||
if (clickEvent) {
|
||||
item.click(clickEventData, clickEvent);
|
||||
item.addClass("clickable");
|
||||
}
|
||||
|
||||
return li;
|
||||
}
|
||||
|
||||
function createHeader(id, parent) {
|
||||
var header = retrieveOrCreateElement(id, 'div', parent);
|
||||
var col = retrieveOrCreateElement(null, 'span', header);
|
||||
col.text(' - ');
|
||||
col.data('status', 'open');
|
||||
col.addClass("clickable");
|
||||
col.addClass("expendable");
|
||||
col.click(function () {
|
||||
if ($(this).data('status') == 'closed') {
|
||||
$('#indexedDBViewer').height(170);
|
||||
$('#indexedDBViewer').width('100%');
|
||||
$('#indexedDBViewerNavigation').show();
|
||||
$('#indexedDBViewerContent').show();
|
||||
col.text(' - ');
|
||||
col.data('status', 'open');
|
||||
}
|
||||
else if ($(this).data('status') == 'open') {
|
||||
$('#indexedDBViewer').height($(this).outerHeight());
|
||||
$('#indexedDBViewer').width($(this).outerWidth());
|
||||
$('#indexedDBViewerNavigation').hide();
|
||||
$('#indexedDBViewerContent').hide();
|
||||
col.text(' + ');
|
||||
col.data('status', 'closed');
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function retrieveOrCreateElement(id, element, parent) {
|
||||
var el;
|
||||
|
||||
if (id && id != null && id != '') {
|
||||
if ($('#' + id).length > 0) {
|
||||
el = $('#' + id);
|
||||
} else {
|
||||
el = $('<' + element + ' id="' + id + '"></' + element + '>');
|
||||
parent.append(el);
|
||||
}
|
||||
}
|
||||
else {
|
||||
el = $('<' + element + '></' + element + '>');
|
||||
parent.append(el);
|
||||
}
|
||||
|
||||
return el;
|
||||
}
|
||||
|
||||
initializeViewer();
|
||||
|
||||
// mousedown, mousemove, mouseup and mouseleave for resizing the placeholder
|
||||
$(window).bind('mousedown', function (event) {
|
||||
var location = $(window).height() - $("#indexedDBViewer").height();
|
||||
if ((location - 2) <= event.pageY && event.pageY <= (location + 5)) {
|
||||
$(window).bind('mousemove', resize);
|
||||
}
|
||||
});
|
||||
|
||||
$(window).bind('mouseup', function () {
|
||||
$(window).unbind('mousemove', resize);
|
||||
});
|
||||
|
||||
$(window).bind('mouseleave', function () {
|
||||
$(window).unbind('mousemove', resize);
|
||||
});
|
||||
|
||||
function resize(event) {
|
||||
var pageHeight = $(window).height();
|
||||
if (pageHeight - event.pageY >= 50) {
|
||||
$("#indexedDBViewer").height(pageHeight - event.pageY);
|
||||
var height = $("#indexedDBViewer").height() - $("#indexedDBViewerHeader").height();
|
||||
$("#indexedDBViewerNavigation").height(height);
|
||||
$("#indexedDBViewerContent").height(height);
|
||||
}
|
||||
}
|
||||
});
|
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,149 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<progress id="progress" value=0></progress>
|
||||
<div id="output"></div>
|
||||
<div id="stderr"></div>
|
||||
</body>
|
||||
<script src="../dist/filer.js"></script>
|
||||
<script type="text/javascript" src="https://rawgithub.com/tmcw/simple-statistics/master/src/simple_statistics.js"></script>
|
||||
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
|
||||
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
|
||||
<script src="../lib/require.js"></script>
|
||||
<script>
|
||||
|
||||
require.config({
|
||||
baseUrl: "../lib",
|
||||
paths: {
|
||||
"src": "../src",
|
||||
"tests": "../tests",
|
||||
"Filer": "../src/index",
|
||||
"util": "../tests/lib/test-utils"
|
||||
}
|
||||
});
|
||||
|
||||
function nextTick(cb) {
|
||||
setTimeout(cb, 0);
|
||||
}
|
||||
|
||||
function parse_query() {
|
||||
var query = window.location.search.substring(1);
|
||||
var parsed = {};
|
||||
query.split('&').forEach(function(pair) {
|
||||
pair = pair.split('=');
|
||||
var key = decodeURIComponent(pair[0]);
|
||||
var value = decodeURIComponent(pair[1]);
|
||||
parsed[key] = value;
|
||||
});
|
||||
return parsed;
|
||||
}
|
||||
|
||||
require(["Filer", "util"], function(Filer, util) {
|
||||
|
||||
function time(test, cb) {
|
||||
var start = performance.now();
|
||||
function done() {
|
||||
var end = performance.now();
|
||||
cb(end - start);
|
||||
}
|
||||
test(done);
|
||||
}
|
||||
|
||||
var random_data = new Uint8Array(1024); // 1kB buffer
|
||||
var read_buffer = new Uint8Array(1024);
|
||||
|
||||
function run(iter) {
|
||||
iter = (undefined == iter) ? 0 : iter;
|
||||
|
||||
function before() {
|
||||
util.setup(function() {
|
||||
nextTick(during);
|
||||
});
|
||||
}
|
||||
|
||||
function during() {
|
||||
var fs = util.fs();
|
||||
|
||||
window.crypto.getRandomValues(random_data);
|
||||
time(function(done) {
|
||||
fs.mkdir('/tmp', function(err) {
|
||||
fs.stat('/tmp', function(err, stats) {
|
||||
fs.open('/tmp/test', 'w', function(err, fd) {
|
||||
fs.write(fd, random_data, null, null, null, function(err, nbytes) {
|
||||
fs.close(fd, function(err) {
|
||||
fs.stat('/tmp/test', function(err, stats) {
|
||||
fs.open('/tmp/test', 'r', function(err, fd) {
|
||||
fs.read(fd, read_buffer, null, null, null, function(err, nbytes) {
|
||||
fs.close(fd, function(err) {
|
||||
fs.unlink('/tmp/test', function(err) {
|
||||
done();
|
||||
});});});});});});});});});});
|
||||
}, after);
|
||||
}
|
||||
|
||||
function after(dt) {
|
||||
util.cleanup(complete.bind(null, iter, dt));
|
||||
}
|
||||
|
||||
before();
|
||||
}
|
||||
|
||||
var results = [];
|
||||
function complete(iter, result) {
|
||||
results.push(result);
|
||||
|
||||
if(++iter < iterations) {
|
||||
nextTick(run.bind(null, iter));
|
||||
} else {
|
||||
do_stats();
|
||||
}
|
||||
|
||||
progress.value = iter;
|
||||
}
|
||||
|
||||
function do_stats() {
|
||||
var output = document.getElementById("output");
|
||||
var stats = {
|
||||
mean: ss.mean(results) + " ms",
|
||||
min: ss.min(results),
|
||||
max: ss.max(results),
|
||||
med_abs_dev: ss.median_absolute_deviation(results),
|
||||
};
|
||||
|
||||
var t = document.createElement("table");
|
||||
var tbody = document.createElement("tbody");
|
||||
var keys = Object.keys(stats);
|
||||
keys.forEach(function(key) {
|
||||
var row = document.createElement("tr");
|
||||
|
||||
var key_cell = document.createElement("td");
|
||||
var key_cell_text = document.createTextNode(key);
|
||||
key_cell.appendChild(key_cell_text);
|
||||
row.appendChild(key_cell);
|
||||
|
||||
var val_cell = document.createElement("td");
|
||||
var val_cell_text = document.createTextNode(stats[key]);
|
||||
val_cell.appendChild(val_cell_text);
|
||||
row.appendChild(val_cell);
|
||||
|
||||
tbody.appendChild(row);
|
||||
});
|
||||
|
||||
t.appendChild(tbody);
|
||||
output.appendChild(t);
|
||||
}
|
||||
|
||||
var query = parse_query();
|
||||
var iterations = query.iterations || 10;
|
||||
var progress = document.getElementById("progress");
|
||||
progress.max = iterations;
|
||||
|
||||
run();
|
||||
|
||||
});
|
||||
|
||||
</script>
|
||||
</html>
|
|
@ -1,31 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="stdout"></div>
|
||||
</body>
|
||||
<script src="../dist/filer.js"></script>
|
||||
<script>
|
||||
window.Filer = Filer;
|
||||
var fs = new Filer.FileSystem({
|
||||
name: 'local',
|
||||
flags: ['FORMAT']
|
||||
});
|
||||
|
||||
//var buffer = new Uint8Array([1, 2, 3, 4, 5, 6, 7, 8]);
|
||||
//console.log('buffer', buffer);
|
||||
//var data = new Uint8Array(buffer.length);
|
||||
|
||||
try {
|
||||
fs.readdir('\u0000', function(error, files) {
|
||||
if(error) throw error;
|
||||
console.log('contents:', files);
|
||||
});
|
||||
} catch(e) {
|
||||
console.error(e);
|
||||
}
|
||||
|
||||
</script>
|
||||
</html>
|
|
@ -1,35 +0,0 @@
|
|||
var write_buffer = new Uint8Array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]);
|
||||
var read_buffer = new Uint8Array(16);
|
||||
|
||||
var fs = new Filer.FileSystem('local');
|
||||
fs.mkdir('/tmp');
|
||||
fs.open('/tmp/', 'w+', function(error, fd) {
|
||||
if(error) return console.error(error);
|
||||
fs.write(fd, ...);
|
||||
fs.read(fd, ...);
|
||||
});
|
||||
|
||||
fs.then(
|
||||
function() {
|
||||
return this.mkdir('/tmp');
|
||||
}
|
||||
);
|
||||
|
||||
var fd = fs.open('/myfile.txt', fs.RW);
|
||||
|
||||
fd.then(
|
||||
function() {
|
||||
return this.write(write_buffer);
|
||||
}
|
||||
).then(
|
||||
function(nbytes) {
|
||||
this.seek(-nbytes);
|
||||
return this.read(read_buffer);
|
||||
}
|
||||
).then(
|
||||
function(nbytes) {
|
||||
console.log(read_buffer);
|
||||
}
|
||||
);
|
||||
|
||||
});
|
|
@ -1,14 +0,0 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<link rel='stylesheet' href='IndexedDBViewer.css'></link>
|
||||
</head>
|
||||
<script src="jquery-1.10.0.min.js"></script>
|
||||
<script src="Linq2IndexedDB.js"></script>
|
||||
<script src="IndexedDBViewer.js"></script>
|
||||
<body>
|
||||
<div id="stdout"></div>
|
||||
<div id="indexedDBViewer" data-dbName="local"></div>
|
||||
</body>
|
||||
</html>
|
231
gruntfile.js
231
gruntfile.js
|
@ -1,231 +0,0 @@
|
|||
var semver = require('semver'),
|
||||
fs = require('fs'),
|
||||
currentVersion = JSON.parse(fs.readFileSync('./package.json', 'utf8')).version,
|
||||
env = require('./config/environment');
|
||||
|
||||
// Globals
|
||||
var PROMPT_CONFIRM_CONFIG = 'confirmation',
|
||||
GIT_BRANCH = env.get('FILER_UPSTREAM_BRANCH'),
|
||||
GIT_REMOTE = env.get('FILER_UPSTREAM_REMOTE_NAME'),
|
||||
GIT_FULL_REMOTE = env.get('FILER_UPSTREAM_URI') + ' ' + GIT_BRANCH;
|
||||
|
||||
module.exports = function(grunt) {
|
||||
|
||||
// Project configuration.
|
||||
grunt.initConfig({
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
|
||||
clean: ['dist/filer-test.js', 'dist/filer-issue225.js'],
|
||||
|
||||
uglify: {
|
||||
options: {
|
||||
banner: '/*! <%= pkg.name %> <%= pkg.version %> <%= grunt.template.today("yyyy-mm-dd") %> */\n'
|
||||
},
|
||||
develop: {
|
||||
src: 'dist/filer.js',
|
||||
dest: 'dist/filer.min.js'
|
||||
}
|
||||
},
|
||||
|
||||
jshint: {
|
||||
// Don't bother with src/path.js
|
||||
all: [
|
||||
'gruntfile.js',
|
||||
'config/environment.js',
|
||||
'src/constants.js',
|
||||
'src/errors.js',
|
||||
'src/fs.js',
|
||||
'src/index.js',
|
||||
'src/shared.js',
|
||||
'src/shell.js',
|
||||
'src/fswatcher.js',
|
||||
'src/environment.js',
|
||||
'src/providers/**/*.js',
|
||||
'src/adapters/**/*.js',
|
||||
'src/directory-entry.js',
|
||||
'src/open-file-description.js',
|
||||
'src/super-node.js',
|
||||
'src/node.js',
|
||||
'src/stats.js',
|
||||
'src/filesystem/**/*.js'
|
||||
]
|
||||
},
|
||||
|
||||
browserify: {
|
||||
filerDist: {
|
||||
src: "./src/index.js",
|
||||
dest: "./dist/filer.js",
|
||||
options: {
|
||||
browserifyOptions: {
|
||||
commondir: false
|
||||
},
|
||||
bundleOptions: {
|
||||
standalone: 'Filer'
|
||||
},
|
||||
exclude: ["./node_modules/request/index.js"]
|
||||
}
|
||||
},
|
||||
filerTest: {
|
||||
src: "./tests/index.js",
|
||||
dest: "./dist/filer-test.js"
|
||||
},
|
||||
// See tests/bugs/issue225.js
|
||||
filerIssue225: {
|
||||
src: "./src/index.js",
|
||||
dest: "./dist/filer-issue225.js",
|
||||
options: {
|
||||
browserifyOptions: {
|
||||
commondir: false
|
||||
},
|
||||
bundleOptions: {
|
||||
standalone: 'Filer'
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
shell: {
|
||||
mocha: {
|
||||
// Run all tests (e.g., tests require()'ed in tests/index.js) and also tests/bugs/issue225.js
|
||||
// separately, since it can't be included in a browserify build.
|
||||
command: './node_modules/.bin/mocha --reporter list tests/index.js && ./node_modules/.bin/mocha --reporter list tests/bugs/issue225.js'
|
||||
}
|
||||
},
|
||||
|
||||
bump: {
|
||||
options: {
|
||||
files: ['package.json', 'bower.json'],
|
||||
commit: true,
|
||||
commitMessage: 'v%VERSION%',
|
||||
commitFiles: ['package.json', 'bower.json', './dist/filer.js', './dist/filer.min.js'],
|
||||
createTag: true,
|
||||
tagName: 'v%VERSION%',
|
||||
tagMessage: 'v%VERSION%',
|
||||
push: true,
|
||||
pushTo: GIT_FULL_REMOTE
|
||||
}
|
||||
},
|
||||
|
||||
'npm-checkBranch': {
|
||||
options: {
|
||||
branch: GIT_BRANCH
|
||||
}
|
||||
},
|
||||
|
||||
'npm-publish': {
|
||||
options: {
|
||||
abortIfDirty: false
|
||||
}
|
||||
},
|
||||
|
||||
prompt: {
|
||||
confirm: {
|
||||
options: {
|
||||
questions: [
|
||||
{
|
||||
config: PROMPT_CONFIRM_CONFIG,
|
||||
type: 'confirm',
|
||||
message: 'Bump version from ' + (currentVersion).cyan +
|
||||
' to ' + semver.inc(currentVersion, "patch").yellow + '?',
|
||||
default: false
|
||||
}
|
||||
],
|
||||
then: function(results) {
|
||||
if (!results[PROMPT_CONFIRM_CONFIG]) {
|
||||
return grunt.fatal('User aborted...');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
gitcheckout: {
|
||||
publish: {
|
||||
options: {
|
||||
branch: 'gh-pages',
|
||||
overwrite: true
|
||||
}
|
||||
},
|
||||
revert: {
|
||||
options: {
|
||||
branch: GIT_BRANCH
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
gitpush: {
|
||||
publish: {
|
||||
options: {
|
||||
remote: GIT_REMOTE,
|
||||
branch: 'gh-pages',
|
||||
force: true
|
||||
},
|
||||
}
|
||||
},
|
||||
connect: {
|
||||
serverForNode: {
|
||||
options: {
|
||||
port: 1234,
|
||||
base: '.'
|
||||
}
|
||||
},
|
||||
serverForBrowser: {
|
||||
options: {
|
||||
port: 1234,
|
||||
base: '.',
|
||||
keepalive: true
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
grunt.loadNpmTasks('grunt-contrib-clean');
|
||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
||||
grunt.loadNpmTasks('grunt-contrib-jshint');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-bump');
|
||||
grunt.loadNpmTasks('grunt-npm');
|
||||
grunt.loadNpmTasks('grunt-git');
|
||||
grunt.loadNpmTasks('grunt-prompt');
|
||||
grunt.loadNpmTasks('grunt-shell');
|
||||
grunt.loadNpmTasks('grunt-contrib-connect');
|
||||
grunt.loadNpmTasks('grunt-browserify');
|
||||
|
||||
grunt.registerTask('develop', ['clean', 'browserify:filerDist']);
|
||||
grunt.registerTask('build-tests', ['clean', 'browserify:filerTest']);
|
||||
grunt.registerTask('release', ['test', 'develop', 'uglify']);
|
||||
|
||||
grunt.registerTask('publish', 'Publish filer as a new version to NPM, bower and github.', function(patchLevel) {
|
||||
var allLevels = ['patch', 'minor', 'major'];
|
||||
|
||||
// No level specified defaults to 'patch'
|
||||
patchLevel = (patchLevel || 'patch').toLowerCase();
|
||||
|
||||
// Fail out if the patch level isn't recognized
|
||||
if (allLevels.filter(function(el) { return el == patchLevel; }).length === 0) {
|
||||
return grunt.fatal('Patch level not recognized! "Patch", "minor" or "major" only.');
|
||||
}
|
||||
|
||||
// Set prompt message
|
||||
var promptOpts = grunt.config('prompt.confirm.options');
|
||||
promptOpts.questions[0].message = 'Bump version from ' + (currentVersion).cyan +
|
||||
' to ' + semver.inc(currentVersion, patchLevel).yellow + '?';
|
||||
grunt.config('prompt.confirm.options', promptOpts);
|
||||
|
||||
grunt.task.run([
|
||||
'prompt:confirm',
|
||||
'checkBranch',
|
||||
'release',
|
||||
'bump:' + patchLevel,
|
||||
'gitcheckout:publish',
|
||||
'gitpush:publish',
|
||||
'gitcheckout:revert',
|
||||
'npm-publish'
|
||||
]);
|
||||
});
|
||||
grunt.registerTask('test-node', ['jshint', 'browserify:filerIssue225', 'connect:serverForNode', 'shell:mocha']);
|
||||
grunt.registerTask('test-browser', ['jshint', 'build-tests', 'connect:serverForBrowser']);
|
||||
grunt.registerTask('test', ['clean', 'test-node']);
|
||||
|
||||
grunt.registerTask('default', ['test']);
|
||||
};
|
|
@ -0,0 +1,28 @@
|
|||
module.exports = function(config) {
|
||||
config.set({
|
||||
singleRun: true,
|
||||
basePath: '',
|
||||
files: [
|
||||
'node_modules/regenerator-runtime/runtime.js',
|
||||
'tests/dist/index.js'
|
||||
],
|
||||
frameworks: ['mocha', 'chai'],
|
||||
reporters: ['mocha', 'summary'],
|
||||
client: {
|
||||
captureConsole: true,
|
||||
mocha: {
|
||||
ui: 'bdd',
|
||||
timeout: 5000,
|
||||
slow: 250
|
||||
}
|
||||
},
|
||||
summaryReporter: {
|
||||
// 'failed', 'skipped' or 'all'
|
||||
show: 'failed',
|
||||
// Limit the spec label to this length
|
||||
specLength: 50,
|
||||
// Show an 'all' column as a summary
|
||||
overviewColumn: true
|
||||
}
|
||||
});
|
||||
};
|
885
lib/async.js
885
lib/async.js
|
@ -1,7 +1,7 @@
|
|||
/*global setImmediate: false, setTimeout: false, console: false */
|
||||
|
||||
/**
|
||||
* https://raw.github.com/caolan/async/master/lib/async.js Feb 18, 2014
|
||||
* async.js shim, based on https://raw.github.com/caolan/async/master/lib/async.js Feb 18, 2014
|
||||
* Used under MIT - https://github.com/caolan/async/blob/master/LICENSE
|
||||
*/
|
||||
|
||||
|
@ -9,74 +9,7 @@
|
|||
|
||||
var async = {};
|
||||
|
||||
// global on the server, window in the browser
|
||||
var root, previous_async;
|
||||
|
||||
root = this;
|
||||
if (root != null) {
|
||||
previous_async = root.async;
|
||||
}
|
||||
|
||||
async.noConflict = function () {
|
||||
root.async = previous_async;
|
||||
return async;
|
||||
};
|
||||
|
||||
function only_once(fn) {
|
||||
var called = false;
|
||||
return function() {
|
||||
if (called) throw new Error("Callback was already called.");
|
||||
called = true;
|
||||
fn.apply(root, arguments);
|
||||
}
|
||||
}
|
||||
|
||||
//// cross-browser compatiblity functions ////
|
||||
|
||||
var _each = function (arr, iterator) {
|
||||
if (arr.forEach) {
|
||||
return arr.forEach(iterator);
|
||||
}
|
||||
for (var i = 0; i < arr.length; i += 1) {
|
||||
iterator(arr[i], i, arr);
|
||||
}
|
||||
};
|
||||
|
||||
var _map = function (arr, iterator) {
|
||||
if (arr.map) {
|
||||
return arr.map(iterator);
|
||||
}
|
||||
var results = [];
|
||||
_each(arr, function (x, i, a) {
|
||||
results.push(iterator(x, i, a));
|
||||
});
|
||||
return results;
|
||||
};
|
||||
|
||||
var _reduce = function (arr, iterator, memo) {
|
||||
if (arr.reduce) {
|
||||
return arr.reduce(iterator, memo);
|
||||
}
|
||||
_each(arr, function (x, i, a) {
|
||||
memo = iterator(memo, x, i, a);
|
||||
});
|
||||
return memo;
|
||||
};
|
||||
|
||||
var _keys = function (obj) {
|
||||
if (Object.keys) {
|
||||
return Object.keys(obj);
|
||||
}
|
||||
var keys = [];
|
||||
for (var k in obj) {
|
||||
if (obj.hasOwnProperty(k)) {
|
||||
keys.push(k);
|
||||
}
|
||||
}
|
||||
return keys;
|
||||
};
|
||||
|
||||
//// exported async module functions ////
|
||||
// async.js functions used in Filer
|
||||
|
||||
//// nextTick implementation with browser-compatible fallback ////
|
||||
if (typeof process === 'undefined' || !(process.nextTick)) {
|
||||
|
@ -107,29 +40,6 @@
|
|||
}
|
||||
}
|
||||
|
||||
async.each = function (arr, iterator, callback) {
|
||||
callback = callback || function () {};
|
||||
if (!arr.length) {
|
||||
return callback();
|
||||
}
|
||||
var completed = 0;
|
||||
_each(arr, function (x) {
|
||||
iterator(x, only_once(function (err) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
callback = function () {};
|
||||
}
|
||||
else {
|
||||
completed += 1;
|
||||
if (completed >= arr.length) {
|
||||
callback(null);
|
||||
}
|
||||
}
|
||||
}));
|
||||
});
|
||||
};
|
||||
async.forEach = async.each;
|
||||
|
||||
async.eachSeries = function (arr, iterator, callback) {
|
||||
callback = callback || function () {};
|
||||
if (!arr.length) {
|
||||
|
@ -145,7 +55,7 @@
|
|||
else {
|
||||
completed += 1;
|
||||
if (completed >= arr.length) {
|
||||
callback(null);
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
iterate();
|
||||
|
@ -157,795 +67,6 @@
|
|||
};
|
||||
async.forEachSeries = async.eachSeries;
|
||||
|
||||
async.eachLimit = function (arr, limit, iterator, callback) {
|
||||
var fn = _eachLimit(limit);
|
||||
fn.apply(null, [arr, iterator, callback]);
|
||||
};
|
||||
async.forEachLimit = async.eachLimit;
|
||||
|
||||
var _eachLimit = function (limit) {
|
||||
|
||||
return function (arr, iterator, callback) {
|
||||
callback = callback || function () {};
|
||||
if (!arr.length || limit <= 0) {
|
||||
return callback();
|
||||
}
|
||||
var completed = 0;
|
||||
var started = 0;
|
||||
var running = 0;
|
||||
|
||||
(function replenish () {
|
||||
if (completed >= arr.length) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
while (running < limit && started < arr.length) {
|
||||
started += 1;
|
||||
running += 1;
|
||||
iterator(arr[started - 1], function (err) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
callback = function () {};
|
||||
}
|
||||
else {
|
||||
completed += 1;
|
||||
running -= 1;
|
||||
if (completed >= arr.length) {
|
||||
callback();
|
||||
}
|
||||
else {
|
||||
replenish();
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
})();
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var doParallel = function (fn) {
|
||||
return function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
return fn.apply(null, [async.each].concat(args));
|
||||
};
|
||||
};
|
||||
var doParallelLimit = function(limit, fn) {
|
||||
return function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
return fn.apply(null, [_eachLimit(limit)].concat(args));
|
||||
};
|
||||
};
|
||||
var doSeries = function (fn) {
|
||||
return function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
return fn.apply(null, [async.eachSeries].concat(args));
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
var _asyncMap = function (eachfn, arr, iterator, callback) {
|
||||
var results = [];
|
||||
arr = _map(arr, function (x, i) {
|
||||
return {index: i, value: x};
|
||||
});
|
||||
eachfn(arr, function (x, callback) {
|
||||
iterator(x.value, function (err, v) {
|
||||
results[x.index] = v;
|
||||
callback(err);
|
||||
});
|
||||
}, function (err) {
|
||||
callback(err, results);
|
||||
});
|
||||
};
|
||||
async.map = doParallel(_asyncMap);
|
||||
async.mapSeries = doSeries(_asyncMap);
|
||||
async.mapLimit = function (arr, limit, iterator, callback) {
|
||||
return _mapLimit(limit)(arr, iterator, callback);
|
||||
};
|
||||
|
||||
var _mapLimit = function(limit) {
|
||||
return doParallelLimit(limit, _asyncMap);
|
||||
};
|
||||
|
||||
// reduce only has a series version, as doing reduce in parallel won't
|
||||
// work in many situations.
|
||||
async.reduce = function (arr, memo, iterator, callback) {
|
||||
async.eachSeries(arr, function (x, callback) {
|
||||
iterator(memo, x, function (err, v) {
|
||||
memo = v;
|
||||
callback(err);
|
||||
});
|
||||
}, function (err) {
|
||||
callback(err, memo);
|
||||
});
|
||||
};
|
||||
// inject alias
|
||||
async.inject = async.reduce;
|
||||
// foldl alias
|
||||
async.foldl = async.reduce;
|
||||
|
||||
async.reduceRight = function (arr, memo, iterator, callback) {
|
||||
var reversed = _map(arr, function (x) {
|
||||
return x;
|
||||
}).reverse();
|
||||
async.reduce(reversed, memo, iterator, callback);
|
||||
};
|
||||
// foldr alias
|
||||
async.foldr = async.reduceRight;
|
||||
|
||||
var _filter = function (eachfn, arr, iterator, callback) {
|
||||
var results = [];
|
||||
arr = _map(arr, function (x, i) {
|
||||
return {index: i, value: x};
|
||||
});
|
||||
eachfn(arr, function (x, callback) {
|
||||
iterator(x.value, function (v) {
|
||||
if (v) {
|
||||
results.push(x);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, function (err) {
|
||||
callback(_map(results.sort(function (a, b) {
|
||||
return a.index - b.index;
|
||||
}), function (x) {
|
||||
return x.value;
|
||||
}));
|
||||
});
|
||||
};
|
||||
async.filter = doParallel(_filter);
|
||||
async.filterSeries = doSeries(_filter);
|
||||
// select alias
|
||||
async.select = async.filter;
|
||||
async.selectSeries = async.filterSeries;
|
||||
|
||||
var _reject = function (eachfn, arr, iterator, callback) {
|
||||
var results = [];
|
||||
arr = _map(arr, function (x, i) {
|
||||
return {index: i, value: x};
|
||||
});
|
||||
eachfn(arr, function (x, callback) {
|
||||
iterator(x.value, function (v) {
|
||||
if (!v) {
|
||||
results.push(x);
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, function (err) {
|
||||
callback(_map(results.sort(function (a, b) {
|
||||
return a.index - b.index;
|
||||
}), function (x) {
|
||||
return x.value;
|
||||
}));
|
||||
});
|
||||
};
|
||||
async.reject = doParallel(_reject);
|
||||
async.rejectSeries = doSeries(_reject);
|
||||
|
||||
var _detect = function (eachfn, arr, iterator, main_callback) {
|
||||
eachfn(arr, function (x, callback) {
|
||||
iterator(x, function (result) {
|
||||
if (result) {
|
||||
main_callback(x);
|
||||
main_callback = function () {};
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
}, function (err) {
|
||||
main_callback();
|
||||
});
|
||||
};
|
||||
async.detect = doParallel(_detect);
|
||||
async.detectSeries = doSeries(_detect);
|
||||
|
||||
async.some = function (arr, iterator, main_callback) {
|
||||
async.each(arr, function (x, callback) {
|
||||
iterator(x, function (v) {
|
||||
if (v) {
|
||||
main_callback(true);
|
||||
main_callback = function () {};
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, function (err) {
|
||||
main_callback(false);
|
||||
});
|
||||
};
|
||||
// any alias
|
||||
async.any = async.some;
|
||||
|
||||
async.every = function (arr, iterator, main_callback) {
|
||||
async.each(arr, function (x, callback) {
|
||||
iterator(x, function (v) {
|
||||
if (!v) {
|
||||
main_callback(false);
|
||||
main_callback = function () {};
|
||||
}
|
||||
callback();
|
||||
});
|
||||
}, function (err) {
|
||||
main_callback(true);
|
||||
});
|
||||
};
|
||||
// all alias
|
||||
async.all = async.every;
|
||||
|
||||
async.sortBy = function (arr, iterator, callback) {
|
||||
async.map(arr, function (x, callback) {
|
||||
iterator(x, function (err, criteria) {
|
||||
if (err) {
|
||||
callback(err);
|
||||
}
|
||||
else {
|
||||
callback(null, {value: x, criteria: criteria});
|
||||
}
|
||||
});
|
||||
}, function (err, results) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
else {
|
||||
var fn = function (left, right) {
|
||||
var a = left.criteria, b = right.criteria;
|
||||
return a < b ? -1 : a > b ? 1 : 0;
|
||||
};
|
||||
callback(null, _map(results.sort(fn), function (x) {
|
||||
return x.value;
|
||||
}));
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async.auto = function (tasks, callback) {
|
||||
callback = callback || function () {};
|
||||
var keys = _keys(tasks);
|
||||
if (!keys.length) {
|
||||
return callback(null);
|
||||
}
|
||||
|
||||
var results = {};
|
||||
|
||||
var listeners = [];
|
||||
var addListener = function (fn) {
|
||||
listeners.unshift(fn);
|
||||
};
|
||||
var removeListener = function (fn) {
|
||||
for (var i = 0; i < listeners.length; i += 1) {
|
||||
if (listeners[i] === fn) {
|
||||
listeners.splice(i, 1);
|
||||
return;
|
||||
}
|
||||
}
|
||||
};
|
||||
var taskComplete = function () {
|
||||
_each(listeners.slice(0), function (fn) {
|
||||
fn();
|
||||
});
|
||||
};
|
||||
|
||||
addListener(function () {
|
||||
if (_keys(results).length === keys.length) {
|
||||
callback(null, results);
|
||||
callback = function () {};
|
||||
}
|
||||
});
|
||||
|
||||
_each(keys, function (k) {
|
||||
var task = (tasks[k] instanceof Function) ? [tasks[k]]: tasks[k];
|
||||
var taskCallback = function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (args.length <= 1) {
|
||||
args = args[0];
|
||||
}
|
||||
if (err) {
|
||||
var safeResults = {};
|
||||
_each(_keys(results), function(rkey) {
|
||||
safeResults[rkey] = results[rkey];
|
||||
});
|
||||
safeResults[k] = args;
|
||||
callback(err, safeResults);
|
||||
// stop subsequent errors hitting callback multiple times
|
||||
callback = function () {};
|
||||
}
|
||||
else {
|
||||
results[k] = args;
|
||||
async.setImmediate(taskComplete);
|
||||
}
|
||||
};
|
||||
var requires = task.slice(0, Math.abs(task.length - 1)) || [];
|
||||
var ready = function () {
|
||||
return _reduce(requires, function (a, x) {
|
||||
return (a && results.hasOwnProperty(x));
|
||||
}, true) && !results.hasOwnProperty(k);
|
||||
};
|
||||
if (ready()) {
|
||||
task[task.length - 1](taskCallback, results);
|
||||
}
|
||||
else {
|
||||
var listener = function () {
|
||||
if (ready()) {
|
||||
removeListener(listener);
|
||||
task[task.length - 1](taskCallback, results);
|
||||
}
|
||||
};
|
||||
addListener(listener);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async.waterfall = function (tasks, callback) {
|
||||
callback = callback || function () {};
|
||||
if (tasks.constructor !== Array) {
|
||||
var err = new Error('First argument to waterfall must be an array of functions');
|
||||
return callback(err);
|
||||
}
|
||||
if (!tasks.length) {
|
||||
return callback();
|
||||
}
|
||||
var wrapIterator = function (iterator) {
|
||||
return function (err) {
|
||||
if (err) {
|
||||
callback.apply(null, arguments);
|
||||
callback = function () {};
|
||||
}
|
||||
else {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
var next = iterator.next();
|
||||
if (next) {
|
||||
args.push(wrapIterator(next));
|
||||
}
|
||||
else {
|
||||
args.push(callback);
|
||||
}
|
||||
async.setImmediate(function () {
|
||||
iterator.apply(null, args);
|
||||
});
|
||||
}
|
||||
};
|
||||
};
|
||||
wrapIterator(async.iterator(tasks))();
|
||||
};
|
||||
|
||||
var _parallel = function(eachfn, tasks, callback) {
|
||||
callback = callback || function () {};
|
||||
if (tasks.constructor === Array) {
|
||||
eachfn.map(tasks, function (fn, callback) {
|
||||
if (fn) {
|
||||
fn(function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (args.length <= 1) {
|
||||
args = args[0];
|
||||
}
|
||||
callback.call(null, err, args);
|
||||
});
|
||||
}
|
||||
}, callback);
|
||||
}
|
||||
else {
|
||||
var results = {};
|
||||
eachfn.each(_keys(tasks), function (k, callback) {
|
||||
tasks[k](function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (args.length <= 1) {
|
||||
args = args[0];
|
||||
}
|
||||
results[k] = args;
|
||||
callback(err);
|
||||
});
|
||||
}, function (err) {
|
||||
callback(err, results);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
async.parallel = function (tasks, callback) {
|
||||
_parallel({ map: async.map, each: async.each }, tasks, callback);
|
||||
};
|
||||
|
||||
async.parallelLimit = function(tasks, limit, callback) {
|
||||
_parallel({ map: _mapLimit(limit), each: _eachLimit(limit) }, tasks, callback);
|
||||
};
|
||||
|
||||
async.series = function (tasks, callback) {
|
||||
callback = callback || function () {};
|
||||
if (tasks.constructor === Array) {
|
||||
async.mapSeries(tasks, function (fn, callback) {
|
||||
if (fn) {
|
||||
fn(function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (args.length <= 1) {
|
||||
args = args[0];
|
||||
}
|
||||
callback.call(null, err, args);
|
||||
});
|
||||
}
|
||||
}, callback);
|
||||
}
|
||||
else {
|
||||
var results = {};
|
||||
async.eachSeries(_keys(tasks), function (k, callback) {
|
||||
tasks[k](function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (args.length <= 1) {
|
||||
args = args[0];
|
||||
}
|
||||
results[k] = args;
|
||||
callback(err);
|
||||
});
|
||||
}, function (err) {
|
||||
callback(err, results);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
async.iterator = function (tasks) {
|
||||
var makeCallback = function (index) {
|
||||
var fn = function () {
|
||||
if (tasks.length) {
|
||||
tasks[index].apply(null, arguments);
|
||||
}
|
||||
return fn.next();
|
||||
};
|
||||
fn.next = function () {
|
||||
return (index < tasks.length - 1) ? makeCallback(index + 1): null;
|
||||
};
|
||||
return fn;
|
||||
};
|
||||
return makeCallback(0);
|
||||
};
|
||||
|
||||
async.apply = function (fn) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
return function () {
|
||||
return fn.apply(
|
||||
null, args.concat(Array.prototype.slice.call(arguments))
|
||||
);
|
||||
};
|
||||
};
|
||||
|
||||
var _concat = function (eachfn, arr, fn, callback) {
|
||||
var r = [];
|
||||
eachfn(arr, function (x, cb) {
|
||||
fn(x, function (err, y) {
|
||||
r = r.concat(y || []);
|
||||
cb(err);
|
||||
});
|
||||
}, function (err) {
|
||||
callback(err, r);
|
||||
});
|
||||
};
|
||||
async.concat = doParallel(_concat);
|
||||
async.concatSeries = doSeries(_concat);
|
||||
|
||||
async.whilst = function (test, iterator, callback) {
|
||||
if (test()) {
|
||||
iterator(function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
async.whilst(test, iterator, callback);
|
||||
});
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
async.doWhilst = function (iterator, test, callback) {
|
||||
iterator(function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
if (test()) {
|
||||
async.doWhilst(iterator, test, callback);
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async.until = function (test, iterator, callback) {
|
||||
if (!test()) {
|
||||
iterator(function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
async.until(test, iterator, callback);
|
||||
});
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
};
|
||||
|
||||
async.doUntil = function (iterator, test, callback) {
|
||||
iterator(function (err) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
if (!test()) {
|
||||
async.doUntil(iterator, test, callback);
|
||||
}
|
||||
else {
|
||||
callback();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
async.queue = function (worker, concurrency) {
|
||||
if (concurrency === undefined) {
|
||||
concurrency = 1;
|
||||
}
|
||||
function _insert(q, data, pos, callback) {
|
||||
if(data.constructor !== Array) {
|
||||
data = [data];
|
||||
}
|
||||
_each(data, function(task) {
|
||||
var item = {
|
||||
data: task,
|
||||
callback: typeof callback === 'function' ? callback : null
|
||||
};
|
||||
|
||||
if (pos) {
|
||||
q.tasks.unshift(item);
|
||||
} else {
|
||||
q.tasks.push(item);
|
||||
}
|
||||
|
||||
if (q.saturated && q.tasks.length === concurrency) {
|
||||
q.saturated();
|
||||
}
|
||||
async.setImmediate(q.process);
|
||||
});
|
||||
}
|
||||
|
||||
var workers = 0;
|
||||
var q = {
|
||||
tasks: [],
|
||||
concurrency: concurrency,
|
||||
saturated: null,
|
||||
empty: null,
|
||||
drain: null,
|
||||
push: function (data, callback) {
|
||||
_insert(q, data, false, callback);
|
||||
},
|
||||
unshift: function (data, callback) {
|
||||
_insert(q, data, true, callback);
|
||||
},
|
||||
process: function () {
|
||||
if (workers < q.concurrency && q.tasks.length) {
|
||||
var task = q.tasks.shift();
|
||||
if (q.empty && q.tasks.length === 0) {
|
||||
q.empty();
|
||||
}
|
||||
workers += 1;
|
||||
var next = function () {
|
||||
workers -= 1;
|
||||
if (task.callback) {
|
||||
task.callback.apply(task, arguments);
|
||||
}
|
||||
if (q.drain && q.tasks.length + workers === 0) {
|
||||
q.drain();
|
||||
}
|
||||
q.process();
|
||||
};
|
||||
var cb = only_once(next);
|
||||
worker(task.data, cb);
|
||||
}
|
||||
},
|
||||
length: function () {
|
||||
return q.tasks.length;
|
||||
},
|
||||
running: function () {
|
||||
return workers;
|
||||
}
|
||||
};
|
||||
return q;
|
||||
};
|
||||
|
||||
async.cargo = function (worker, payload) {
|
||||
var working = false,
|
||||
tasks = [];
|
||||
|
||||
var cargo = {
|
||||
tasks: tasks,
|
||||
payload: payload,
|
||||
saturated: null,
|
||||
empty: null,
|
||||
drain: null,
|
||||
push: function (data, callback) {
|
||||
if(data.constructor !== Array) {
|
||||
data = [data];
|
||||
}
|
||||
_each(data, function(task) {
|
||||
tasks.push({
|
||||
data: task,
|
||||
callback: typeof callback === 'function' ? callback : null
|
||||
});
|
||||
if (cargo.saturated && tasks.length === payload) {
|
||||
cargo.saturated();
|
||||
}
|
||||
});
|
||||
async.setImmediate(cargo.process);
|
||||
},
|
||||
process: function process() {
|
||||
if (working) return;
|
||||
if (tasks.length === 0) {
|
||||
if(cargo.drain) cargo.drain();
|
||||
return;
|
||||
}
|
||||
|
||||
var ts = typeof payload === 'number'
|
||||
? tasks.splice(0, payload)
|
||||
: tasks.splice(0);
|
||||
|
||||
var ds = _map(ts, function (task) {
|
||||
return task.data;
|
||||
});
|
||||
|
||||
if(cargo.empty) cargo.empty();
|
||||
working = true;
|
||||
worker(ds, function () {
|
||||
working = false;
|
||||
|
||||
var args = arguments;
|
||||
_each(ts, function (data) {
|
||||
if (data.callback) {
|
||||
data.callback.apply(null, args);
|
||||
}
|
||||
});
|
||||
|
||||
process();
|
||||
});
|
||||
},
|
||||
length: function () {
|
||||
return tasks.length;
|
||||
},
|
||||
running: function () {
|
||||
return working;
|
||||
}
|
||||
};
|
||||
return cargo;
|
||||
};
|
||||
|
||||
var _console_fn = function (name) {
|
||||
return function (fn) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
fn.apply(null, args.concat([function (err) {
|
||||
var args = Array.prototype.slice.call(arguments, 1);
|
||||
if (typeof console !== 'undefined') {
|
||||
if (err) {
|
||||
if (console.error) {
|
||||
console.error(err);
|
||||
}
|
||||
}
|
||||
else if (console[name]) {
|
||||
_each(args, function (x) {
|
||||
console[name](x);
|
||||
});
|
||||
}
|
||||
}
|
||||
}]));
|
||||
};
|
||||
};
|
||||
async.log = _console_fn('log');
|
||||
async.dir = _console_fn('dir');
|
||||
/*async.info = _console_fn('info');
|
||||
async.warn = _console_fn('warn');
|
||||
async.error = _console_fn('error');*/
|
||||
|
||||
async.memoize = function (fn, hasher) {
|
||||
var memo = {};
|
||||
var queues = {};
|
||||
hasher = hasher || function (x) {
|
||||
return x;
|
||||
};
|
||||
var memoized = function () {
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var callback = args.pop();
|
||||
var key = hasher.apply(null, args);
|
||||
if (key in memo) {
|
||||
callback.apply(null, memo[key]);
|
||||
}
|
||||
else if (key in queues) {
|
||||
queues[key].push(callback);
|
||||
}
|
||||
else {
|
||||
queues[key] = [callback];
|
||||
fn.apply(null, args.concat([function () {
|
||||
memo[key] = arguments;
|
||||
var q = queues[key];
|
||||
delete queues[key];
|
||||
for (var i = 0, l = q.length; i < l; i++) {
|
||||
q[i].apply(null, arguments);
|
||||
}
|
||||
}]));
|
||||
}
|
||||
};
|
||||
memoized.memo = memo;
|
||||
memoized.unmemoized = fn;
|
||||
return memoized;
|
||||
};
|
||||
|
||||
async.unmemoize = function (fn) {
|
||||
return function () {
|
||||
return (fn.unmemoized || fn).apply(null, arguments);
|
||||
};
|
||||
};
|
||||
|
||||
async.times = function (count, iterator, callback) {
|
||||
var counter = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
counter.push(i);
|
||||
}
|
||||
return async.map(counter, iterator, callback);
|
||||
};
|
||||
|
||||
async.timesSeries = function (count, iterator, callback) {
|
||||
var counter = [];
|
||||
for (var i = 0; i < count; i++) {
|
||||
counter.push(i);
|
||||
}
|
||||
return async.mapSeries(counter, iterator, callback);
|
||||
};
|
||||
|
||||
async.compose = function (/* functions... */) {
|
||||
var fns = Array.prototype.reverse.call(arguments);
|
||||
return function () {
|
||||
var that = this;
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var callback = args.pop();
|
||||
async.reduce(fns, args, function (newargs, fn, cb) {
|
||||
fn.apply(that, newargs.concat([function () {
|
||||
var err = arguments[0];
|
||||
var nextargs = Array.prototype.slice.call(arguments, 1);
|
||||
cb(err, nextargs);
|
||||
}]))
|
||||
},
|
||||
function (err, results) {
|
||||
callback.apply(that, [err].concat(results));
|
||||
});
|
||||
};
|
||||
};
|
||||
|
||||
var _applyEach = function (eachfn, fns /*args...*/) {
|
||||
var go = function () {
|
||||
var that = this;
|
||||
var args = Array.prototype.slice.call(arguments);
|
||||
var callback = args.pop();
|
||||
return eachfn(fns, function (fn, cb) {
|
||||
fn.apply(that, args.concat([cb]));
|
||||
},
|
||||
callback);
|
||||
};
|
||||
if (arguments.length > 2) {
|
||||
var args = Array.prototype.slice.call(arguments, 2);
|
||||
return go.apply(this, args);
|
||||
}
|
||||
else {
|
||||
return go;
|
||||
}
|
||||
};
|
||||
async.applyEach = doParallel(_applyEach);
|
||||
async.applyEachSeries = doSeries(_applyEach);
|
||||
|
||||
async.forever = function (fn, callback) {
|
||||
function next(err) {
|
||||
if (err) {
|
||||
if (callback) {
|
||||
return callback(err);
|
||||
}
|
||||
throw err;
|
||||
}
|
||||
fn(next);
|
||||
}
|
||||
next();
|
||||
};
|
||||
|
||||
// AMD / RequireJS
|
||||
if (typeof define !== 'undefined' && define.amd) {
|
||||
define([], function () {
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var r=CryptoJS,u=r.lib.BlockCipher,o=r.algo,g=[],v=[],w=[],x=[],y=[],z=[],p=[],q=[],s=[],t=[];(function(){for(var b=[],c=0;256>c;c++)b[c]=128>c?c<<1:c<<1^283;for(var a=0,f=0,c=0;256>c;c++){var d=f^f<<1^f<<2^f<<3^f<<4,d=d>>>8^d&255^99;g[a]=d;v[d]=a;var e=b[a],A=b[e],h=b[A],i=257*b[d]^16843008*d;w[a]=i<<24|i>>>8;x[a]=i<<16|i>>>16;y[a]=i<<8|i>>>24;z[a]=i;i=16843009*h^65537*A^257*e^16843008*a;p[d]=i<<24|i>>>8;q[d]=i<<16|i>>>16;s[d]=i<<8|i>>>24;t[d]=i;a?(a=e^b[b[b[h^e]]],f^=b[b[f]]):a=f=1}})();
|
||||
var B=[0,1,2,4,8,16,32,64,128,27,54],o=o.AES=u.extend({_doReset:function(){for(var b=this._key,c=b.words,a=b.sigBytes/4,b=4*((this._nRounds=a+6)+1),f=this._keySchedule=[],d=0;d<b;d++)if(d<a)f[d]=c[d];else{var e=f[d-1];d%a?6<a&&4==d%a&&(e=g[e>>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255]):(e=e<<8|e>>>24,e=g[e>>>24]<<24|g[e>>>16&255]<<16|g[e>>>8&255]<<8|g[e&255],e^=B[d/a|0]<<24);f[d]=f[d-a]^e}c=this._invKeySchedule=[];for(a=0;a<b;a++)d=b-a,e=a%4?f[d]:f[d-4],c[a]=4>a||4>=d?e:p[g[e>>>24]]^q[g[e>>>
|
||||
16&255]]^s[g[e>>>8&255]]^t[g[e&255]]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._keySchedule,w,x,y,z,g)},decryptBlock:function(b,c){var a=b[c+1];b[c+1]=b[c+3];b[c+3]=a;this._doCryptBlock(b,c,this._invKeySchedule,p,q,s,t,v);a=b[c+1];b[c+1]=b[c+3];b[c+3]=a},_doCryptBlock:function(b,c,a,f,d,e,g,h){for(var i=this._nRounds,k=b[c]^a[0],l=b[c+1]^a[1],m=b[c+2]^a[2],j=b[c+3]^a[3],n=4,r=1;r<i;r++)var o=f[k>>>24]^d[l>>>16&255]^e[m>>>8&255]^g[j&255]^a[n++],p=f[l>>>24]^d[m>>>16&255]^e[j>>>8&255]^
|
||||
g[k&255]^a[n++],q=f[m>>>24]^d[j>>>16&255]^e[k>>>8&255]^g[l&255]^a[n++],j=f[j>>>24]^d[k>>>16&255]^e[l>>>8&255]^g[m&255]^a[n++],k=o,l=p,m=q;o=(h[k>>>24]<<24|h[l>>>16&255]<<16|h[m>>>8&255]<<8|h[j&255])^a[n++];p=(h[l>>>24]<<24|h[m>>>16&255]<<16|h[j>>>8&255]<<8|h[k&255])^a[n++];q=(h[m>>>24]<<24|h[j>>>16&255]<<16|h[k>>>8&255]<<8|h[l&255])^a[n++];j=(h[j>>>24]<<24|h[k>>>16&255]<<16|h[l>>>8&255]<<8|h[m&255])^a[n++];b[c]=o;b[c+1]=p;b[c+2]=q;b[c+3]=j},keySize:8});r.AES=u._createHelper(o)})();
|
|
@ -1,213 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var BlockCipher = C_lib.BlockCipher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Lookup tables
|
||||
var SBOX = [];
|
||||
var INV_SBOX = [];
|
||||
var SUB_MIX_0 = [];
|
||||
var SUB_MIX_1 = [];
|
||||
var SUB_MIX_2 = [];
|
||||
var SUB_MIX_3 = [];
|
||||
var INV_SUB_MIX_0 = [];
|
||||
var INV_SUB_MIX_1 = [];
|
||||
var INV_SUB_MIX_2 = [];
|
||||
var INV_SUB_MIX_3 = [];
|
||||
|
||||
// Compute lookup tables
|
||||
(function () {
|
||||
// Compute double table
|
||||
var d = [];
|
||||
for (var i = 0; i < 256; i++) {
|
||||
if (i < 128) {
|
||||
d[i] = i << 1;
|
||||
} else {
|
||||
d[i] = (i << 1) ^ 0x11b;
|
||||
}
|
||||
}
|
||||
|
||||
// Walk GF(2^8)
|
||||
var x = 0;
|
||||
var xi = 0;
|
||||
for (var i = 0; i < 256; i++) {
|
||||
// Compute sbox
|
||||
var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
|
||||
sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
|
||||
SBOX[x] = sx;
|
||||
INV_SBOX[sx] = x;
|
||||
|
||||
// Compute multiplication
|
||||
var x2 = d[x];
|
||||
var x4 = d[x2];
|
||||
var x8 = d[x4];
|
||||
|
||||
// Compute sub bytes, mix columns tables
|
||||
var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
|
||||
SUB_MIX_0[x] = (t << 24) | (t >>> 8);
|
||||
SUB_MIX_1[x] = (t << 16) | (t >>> 16);
|
||||
SUB_MIX_2[x] = (t << 8) | (t >>> 24);
|
||||
SUB_MIX_3[x] = t;
|
||||
|
||||
// Compute inv sub bytes, inv mix columns tables
|
||||
var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
|
||||
INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
|
||||
INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
|
||||
INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
|
||||
INV_SUB_MIX_3[sx] = t;
|
||||
|
||||
// Compute next counter
|
||||
if (!x) {
|
||||
x = xi = 1;
|
||||
} else {
|
||||
x = x2 ^ d[d[d[x8 ^ x2]]];
|
||||
xi ^= d[d[xi]];
|
||||
}
|
||||
}
|
||||
}());
|
||||
|
||||
// Precomputed Rcon lookup
|
||||
var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
|
||||
|
||||
/**
|
||||
* AES block cipher algorithm.
|
||||
*/
|
||||
var AES = C_algo.AES = BlockCipher.extend({
|
||||
_doReset: function () {
|
||||
// Shortcuts
|
||||
var key = this._key;
|
||||
var keyWords = key.words;
|
||||
var keySize = key.sigBytes / 4;
|
||||
|
||||
// Compute number of rounds
|
||||
var nRounds = this._nRounds = keySize + 6
|
||||
|
||||
// Compute number of key schedule rows
|
||||
var ksRows = (nRounds + 1) * 4;
|
||||
|
||||
// Compute key schedule
|
||||
var keySchedule = this._keySchedule = [];
|
||||
for (var ksRow = 0; ksRow < ksRows; ksRow++) {
|
||||
if (ksRow < keySize) {
|
||||
keySchedule[ksRow] = keyWords[ksRow];
|
||||
} else {
|
||||
var t = keySchedule[ksRow - 1];
|
||||
|
||||
if (!(ksRow % keySize)) {
|
||||
// Rot word
|
||||
t = (t << 8) | (t >>> 24);
|
||||
|
||||
// Sub word
|
||||
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
|
||||
|
||||
// Mix Rcon
|
||||
t ^= RCON[(ksRow / keySize) | 0] << 24;
|
||||
} else if (keySize > 6 && ksRow % keySize == 4) {
|
||||
// Sub word
|
||||
t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
|
||||
}
|
||||
|
||||
keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
|
||||
}
|
||||
}
|
||||
|
||||
// Compute inv key schedule
|
||||
var invKeySchedule = this._invKeySchedule = [];
|
||||
for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
|
||||
var ksRow = ksRows - invKsRow;
|
||||
|
||||
if (invKsRow % 4) {
|
||||
var t = keySchedule[ksRow];
|
||||
} else {
|
||||
var t = keySchedule[ksRow - 4];
|
||||
}
|
||||
|
||||
if (invKsRow < 4 || ksRow <= 4) {
|
||||
invKeySchedule[invKsRow] = t;
|
||||
} else {
|
||||
invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
|
||||
INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
encryptBlock: function (M, offset) {
|
||||
this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
|
||||
},
|
||||
|
||||
decryptBlock: function (M, offset) {
|
||||
// Swap 2nd and 4th rows
|
||||
var t = M[offset + 1];
|
||||
M[offset + 1] = M[offset + 3];
|
||||
M[offset + 3] = t;
|
||||
|
||||
this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
|
||||
|
||||
// Inv swap 2nd and 4th rows
|
||||
var t = M[offset + 1];
|
||||
M[offset + 1] = M[offset + 3];
|
||||
M[offset + 3] = t;
|
||||
},
|
||||
|
||||
_doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
|
||||
// Shortcut
|
||||
var nRounds = this._nRounds;
|
||||
|
||||
// Get input, add round key
|
||||
var s0 = M[offset] ^ keySchedule[0];
|
||||
var s1 = M[offset + 1] ^ keySchedule[1];
|
||||
var s2 = M[offset + 2] ^ keySchedule[2];
|
||||
var s3 = M[offset + 3] ^ keySchedule[3];
|
||||
|
||||
// Key schedule row counter
|
||||
var ksRow = 4;
|
||||
|
||||
// Rounds
|
||||
for (var round = 1; round < nRounds; round++) {
|
||||
// Shift rows, sub bytes, mix columns, add round key
|
||||
var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
|
||||
var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
|
||||
var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
|
||||
var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
|
||||
|
||||
// Update state
|
||||
s0 = t0;
|
||||
s1 = t1;
|
||||
s2 = t2;
|
||||
s3 = t3;
|
||||
}
|
||||
|
||||
// Shift rows, sub bytes, add round key
|
||||
var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
|
||||
var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
|
||||
var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
|
||||
var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
|
||||
|
||||
// Set output
|
||||
M[offset] = t0;
|
||||
M[offset + 1] = t1;
|
||||
M[offset + 2] = t2;
|
||||
M[offset + 3] = t3;
|
||||
},
|
||||
|
||||
keySize: 256/32
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.AES = BlockCipher._createHelper(AES);
|
||||
}());
|
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.lib.Cipher||function(r){var f=CryptoJS,e=f.lib,i=e.Base,j=e.WordArray,o=e.BufferedBlockAlgorithm,p=f.enc.Base64,s=f.algo.EvpKDF,l=e.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){o.reset.call(this);this._doReset()},process:function(a){this._append(a);
|
||||
return this._process()},finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(a){return{encrypt:function(b,c,d){return("string"==typeof c?q:g).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?q:g).decrypt(a,b,c,d)}}}}()});e.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var k=f.mode={},t=e.BlockCipherMode=i.extend({createEncryptor:function(a,
|
||||
b){return this.Encryptor.create(a,b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a;this._iv=b}}),k=k.CBC=function(){function a(a,b,m){var h=this._iv;h?this._iv=r:h=this._prevBlock;for(var e=0;e<m;e++)a[b+e]^=h[e]}var b=t.extend();b.Encryptor=b.extend({processBlock:function(b,d){var m=this._cipher,e=m.blockSize;a.call(this,b,d,e);m.encryptBlock(b,d);this._prevBlock=b.slice(d,d+e)}});b.Decryptor=b.extend({processBlock:function(b,d){var e=this._cipher,
|
||||
h=e.blockSize,f=b.slice(d,d+h);e.decryptBlock(b,d);a.call(this,b,d,h);this._prevBlock=f}});return b}(),u=(f.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,e=[],f=0;f<c;f+=4)e.push(d);c=j.create(e,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};e.BlockCipher=l.extend({cfg:l.cfg.extend({mode:k,padding:u}),reset:function(){l.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=a.createEncryptor;
|
||||
else c=a.createDecryptor,this._minBufferSize=1;this._mode=c.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var n=e.CipherParams=i.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),k=(f.format={}).OpenSSL=
|
||||
{stringify:function(a){var b=a.ciphertext,a=a.salt,b=(a?j.create([1398893684,1701076831]).concat(a).concat(b):b).toString(p);return b=b.replace(/(.{64})/g,"$1\n")},parse:function(a){var a=p.parse(a),b=a.words;if(1398893684==b[0]&&1701076831==b[1]){var c=j.create(b.slice(2,4));b.splice(0,4);a.sigBytes-=16}return n.create({ciphertext:a,salt:c})}},g=e.SerializableCipher=i.extend({cfg:i.extend({format:k}),encrypt:function(a,b,c,d){var d=this.cfg.extend(d),e=a.createEncryptor(c,d),b=e.finalize(b),e=e.cfg;
|
||||
return n.create({ciphertext:b,key:c,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:d.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a):a}}),f=(f.kdf={}).OpenSSL={compute:function(a,b,c,d){d||(d=j.random(8));a=s.create({keySize:b+c}).compute(a,d);c=j.create(a.words.slice(b),4*c);a.sigBytes=4*b;return n.create({key:a,iv:c,
|
||||
salt:d})}},q=e.PasswordBasedCipher=g.extend({cfg:g.cfg.extend({kdf:f}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);c=d.kdf.compute(c,a.keySize,a.ivSize);d.iv=c.iv;a=g.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.compute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return g.decrypt.call(this,a,b,c.key,d)}})}();
|
|
@ -1,869 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Cipher core components.
|
||||
*/
|
||||
CryptoJS.lib.Cipher || (function (undefined) {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Base = C_lib.Base;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
|
||||
var C_enc = C.enc;
|
||||
var Utf8 = C_enc.Utf8;
|
||||
var Base64 = C_enc.Base64;
|
||||
var C_algo = C.algo;
|
||||
var EvpKDF = C_algo.EvpKDF;
|
||||
|
||||
/**
|
||||
* Abstract base cipher template.
|
||||
*
|
||||
* @property {number} keySize This cipher's key size. Default: 4 (128 bits)
|
||||
* @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
|
||||
* @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
|
||||
* @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
|
||||
*/
|
||||
var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {WordArray} iv The IV to use for this operation.
|
||||
*/
|
||||
cfg: Base.extend(),
|
||||
|
||||
/**
|
||||
* Creates this cipher in encryption mode.
|
||||
*
|
||||
* @param {WordArray} key The key.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {Cipher} A cipher instance.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
|
||||
*/
|
||||
createEncryptor: function (key, cfg) {
|
||||
return this.create(this._ENC_XFORM_MODE, key, cfg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates this cipher in decryption mode.
|
||||
*
|
||||
* @param {WordArray} key The key.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {Cipher} A cipher instance.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
|
||||
*/
|
||||
createDecryptor: function (key, cfg) {
|
||||
return this.create(this._DEC_XFORM_MODE, key, cfg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes a newly created cipher.
|
||||
*
|
||||
* @param {number} xformMode Either the encryption or decryption transormation mode constant.
|
||||
* @param {WordArray} key The key.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
|
||||
*/
|
||||
init: function (xformMode, key, cfg) {
|
||||
// Apply config defaults
|
||||
this.cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Store transform mode and key
|
||||
this._xformMode = xformMode;
|
||||
this._key = key;
|
||||
|
||||
// Set initial values
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/**
|
||||
* Resets this cipher to its initial state.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* cipher.reset();
|
||||
*/
|
||||
reset: function () {
|
||||
// Reset data buffer
|
||||
BufferedBlockAlgorithm.reset.call(this);
|
||||
|
||||
// Perform concrete-cipher logic
|
||||
this._doReset();
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds data to be encrypted or decrypted.
|
||||
*
|
||||
* @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
|
||||
*
|
||||
* @return {WordArray} The data after processing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var encrypted = cipher.process('data');
|
||||
* var encrypted = cipher.process(wordArray);
|
||||
*/
|
||||
process: function (dataUpdate) {
|
||||
// Append
|
||||
this._append(dataUpdate);
|
||||
|
||||
// Process available blocks
|
||||
return this._process();
|
||||
},
|
||||
|
||||
/**
|
||||
* Finalizes the encryption or decryption process.
|
||||
* Note that the finalize operation is effectively a destructive, read-once operation.
|
||||
*
|
||||
* @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
|
||||
*
|
||||
* @return {WordArray} The data after final processing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var encrypted = cipher.finalize();
|
||||
* var encrypted = cipher.finalize('data');
|
||||
* var encrypted = cipher.finalize(wordArray);
|
||||
*/
|
||||
finalize: function (dataUpdate) {
|
||||
// Final data update
|
||||
if (dataUpdate) {
|
||||
this._append(dataUpdate);
|
||||
}
|
||||
|
||||
// Perform concrete-cipher logic
|
||||
var finalProcessedData = this._doFinalize();
|
||||
|
||||
return finalProcessedData;
|
||||
},
|
||||
|
||||
keySize: 128/32,
|
||||
|
||||
ivSize: 128/32,
|
||||
|
||||
_ENC_XFORM_MODE: 1,
|
||||
|
||||
_DEC_XFORM_MODE: 2,
|
||||
|
||||
/**
|
||||
* Creates shortcut functions to a cipher's object interface.
|
||||
*
|
||||
* @param {Cipher} cipher The cipher to create a helper for.
|
||||
*
|
||||
* @return {Object} An object with encrypt and decrypt shortcut functions.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
|
||||
*/
|
||||
_createHelper: (function () {
|
||||
function selectCipherStrategy(key) {
|
||||
if (typeof key == 'string') {
|
||||
return PasswordBasedCipher;
|
||||
} else {
|
||||
return SerializableCipher;
|
||||
}
|
||||
}
|
||||
|
||||
return function (cipher) {
|
||||
return {
|
||||
encrypt: function (message, key, cfg) {
|
||||
return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
|
||||
},
|
||||
|
||||
decrypt: function (ciphertext, key, cfg) {
|
||||
return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
|
||||
}
|
||||
};
|
||||
};
|
||||
}())
|
||||
});
|
||||
|
||||
/**
|
||||
* Abstract base stream cipher template.
|
||||
*
|
||||
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
|
||||
*/
|
||||
var StreamCipher = C_lib.StreamCipher = Cipher.extend({
|
||||
_doFinalize: function () {
|
||||
// Process partial blocks
|
||||
var finalProcessedBlocks = this._process(!!'flush');
|
||||
|
||||
return finalProcessedBlocks;
|
||||
},
|
||||
|
||||
blockSize: 1
|
||||
});
|
||||
|
||||
/**
|
||||
* Mode namespace.
|
||||
*/
|
||||
var C_mode = C.mode = {};
|
||||
|
||||
/**
|
||||
* Abstract base block cipher mode template.
|
||||
*/
|
||||
var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
|
||||
/**
|
||||
* Creates this mode for encryption.
|
||||
*
|
||||
* @param {Cipher} cipher A block cipher instance.
|
||||
* @param {Array} iv The IV words.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
|
||||
*/
|
||||
createEncryptor: function (cipher, iv) {
|
||||
return this.Encryptor.create(cipher, iv);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates this mode for decryption.
|
||||
*
|
||||
* @param {Cipher} cipher A block cipher instance.
|
||||
* @param {Array} iv The IV words.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
|
||||
*/
|
||||
createDecryptor: function (cipher, iv) {
|
||||
return this.Decryptor.create(cipher, iv);
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes a newly created mode.
|
||||
*
|
||||
* @param {Cipher} cipher A block cipher instance.
|
||||
* @param {Array} iv The IV words.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
|
||||
*/
|
||||
init: function (cipher, iv) {
|
||||
this._cipher = cipher;
|
||||
this._iv = iv;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Cipher Block Chaining mode.
|
||||
*/
|
||||
var CBC = C_mode.CBC = (function () {
|
||||
/**
|
||||
* Abstract base CBC mode.
|
||||
*/
|
||||
var CBC = BlockCipherMode.extend();
|
||||
|
||||
/**
|
||||
* CBC encryptor.
|
||||
*/
|
||||
CBC.Encryptor = CBC.extend({
|
||||
/**
|
||||
* Processes the data block at offset.
|
||||
*
|
||||
* @param {Array} words The data words to operate on.
|
||||
* @param {number} offset The offset where the block starts.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* mode.processBlock(data.words, offset);
|
||||
*/
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher;
|
||||
var blockSize = cipher.blockSize;
|
||||
|
||||
// XOR and encrypt
|
||||
xorBlock.call(this, words, offset, blockSize);
|
||||
cipher.encryptBlock(words, offset);
|
||||
|
||||
// Remember this block to use with next block
|
||||
this._prevBlock = words.slice(offset, offset + blockSize);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* CBC decryptor.
|
||||
*/
|
||||
CBC.Decryptor = CBC.extend({
|
||||
/**
|
||||
* Processes the data block at offset.
|
||||
*
|
||||
* @param {Array} words The data words to operate on.
|
||||
* @param {number} offset The offset where the block starts.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* mode.processBlock(data.words, offset);
|
||||
*/
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher;
|
||||
var blockSize = cipher.blockSize;
|
||||
|
||||
// Remember this block to use with next block
|
||||
var thisBlock = words.slice(offset, offset + blockSize);
|
||||
|
||||
// Decrypt and XOR
|
||||
cipher.decryptBlock(words, offset);
|
||||
xorBlock.call(this, words, offset, blockSize);
|
||||
|
||||
// This block becomes the previous block
|
||||
this._prevBlock = thisBlock;
|
||||
}
|
||||
});
|
||||
|
||||
function xorBlock(words, offset, blockSize) {
|
||||
// Shortcut
|
||||
var iv = this._iv;
|
||||
|
||||
// Choose mixing block
|
||||
if (iv) {
|
||||
var block = iv;
|
||||
|
||||
// Remove IV for subsequent blocks
|
||||
this._iv = undefined;
|
||||
} else {
|
||||
var block = this._prevBlock;
|
||||
}
|
||||
|
||||
// XOR block
|
||||
for (var i = 0; i < blockSize; i++) {
|
||||
words[offset + i] ^= block[i];
|
||||
}
|
||||
}
|
||||
|
||||
return CBC;
|
||||
}());
|
||||
|
||||
/**
|
||||
* Padding namespace.
|
||||
*/
|
||||
var C_pad = C.pad = {};
|
||||
|
||||
/**
|
||||
* PKCS #5/7 padding strategy.
|
||||
*/
|
||||
var Pkcs7 = C_pad.Pkcs7 = {
|
||||
/**
|
||||
* Pads data using the algorithm defined in PKCS #5/7.
|
||||
*
|
||||
* @param {WordArray} data The data to pad.
|
||||
* @param {number} blockSize The multiple that the data should be padded to.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* CryptoJS.pad.Pkcs7.pad(wordArray, 4);
|
||||
*/
|
||||
pad: function (data, blockSize) {
|
||||
// Shortcut
|
||||
var blockSizeBytes = blockSize * 4;
|
||||
|
||||
// Count padding bytes
|
||||
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
|
||||
|
||||
// Create padding word
|
||||
var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
|
||||
|
||||
// Create padding
|
||||
var paddingWords = [];
|
||||
for (var i = 0; i < nPaddingBytes; i += 4) {
|
||||
paddingWords.push(paddingWord);
|
||||
}
|
||||
var padding = WordArray.create(paddingWords, nPaddingBytes);
|
||||
|
||||
// Add padding
|
||||
data.concat(padding);
|
||||
},
|
||||
|
||||
/**
|
||||
* Unpads data that had been padded using the algorithm defined in PKCS #5/7.
|
||||
*
|
||||
* @param {WordArray} data The data to unpad.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* CryptoJS.pad.Pkcs7.unpad(wordArray);
|
||||
*/
|
||||
unpad: function (data) {
|
||||
// Get number of padding bytes from last byte
|
||||
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
|
||||
|
||||
// Remove padding
|
||||
data.sigBytes -= nPaddingBytes;
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Abstract base block cipher template.
|
||||
*
|
||||
* @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
|
||||
*/
|
||||
var BlockCipher = C_lib.BlockCipher = Cipher.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {Mode} mode The block mode to use. Default: CryptoJS.mode.CBC
|
||||
* @property {Padding} padding The padding strategy to use. Default: CryptoJS.pad.Pkcs7
|
||||
*/
|
||||
cfg: Cipher.cfg.extend({
|
||||
mode: CBC,
|
||||
padding: Pkcs7
|
||||
}),
|
||||
|
||||
reset: function () {
|
||||
// Reset cipher
|
||||
Cipher.reset.call(this);
|
||||
|
||||
// Shortcuts
|
||||
var cfg = this.cfg;
|
||||
var iv = cfg.iv;
|
||||
var mode = cfg.mode;
|
||||
|
||||
// Reset block mode
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
var modeCreator = mode.createEncryptor;
|
||||
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
|
||||
var modeCreator = mode.createDecryptor;
|
||||
|
||||
// Keep at least one block in the buffer for unpadding
|
||||
this._minBufferSize = 1;
|
||||
}
|
||||
this._mode = modeCreator.call(mode, this, iv && iv.words);
|
||||
},
|
||||
|
||||
_doProcessBlock: function (words, offset) {
|
||||
this._mode.processBlock(words, offset);
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
// Shortcut
|
||||
var padding = this.cfg.padding;
|
||||
|
||||
// Finalize
|
||||
if (this._xformMode == this._ENC_XFORM_MODE) {
|
||||
// Pad data
|
||||
padding.pad(this._data, this.blockSize);
|
||||
|
||||
// Process final blocks
|
||||
var finalProcessedBlocks = this._process(!!'flush');
|
||||
} else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
|
||||
// Process final blocks
|
||||
var finalProcessedBlocks = this._process(!!'flush');
|
||||
|
||||
// Unpad data
|
||||
padding.unpad(finalProcessedBlocks);
|
||||
}
|
||||
|
||||
return finalProcessedBlocks;
|
||||
},
|
||||
|
||||
blockSize: 128/32
|
||||
});
|
||||
|
||||
/**
|
||||
* A collection of cipher parameters.
|
||||
*
|
||||
* @property {WordArray} ciphertext The raw ciphertext.
|
||||
* @property {WordArray} key The key to this ciphertext.
|
||||
* @property {WordArray} iv The IV used in the ciphering operation.
|
||||
* @property {WordArray} salt The salt used with a key derivation function.
|
||||
* @property {Cipher} algorithm The cipher algorithm.
|
||||
* @property {Mode} mode The block mode used in the ciphering operation.
|
||||
* @property {Padding} padding The padding scheme used in the ciphering operation.
|
||||
* @property {number} blockSize The block size of the cipher.
|
||||
* @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
|
||||
*/
|
||||
var CipherParams = C_lib.CipherParams = Base.extend({
|
||||
/**
|
||||
* Initializes a newly created cipher params object.
|
||||
*
|
||||
* @param {Object} cipherParams An object with any of the possible cipher parameters.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var cipherParams = CryptoJS.lib.CipherParams.create({
|
||||
* ciphertext: ciphertextWordArray,
|
||||
* key: keyWordArray,
|
||||
* iv: ivWordArray,
|
||||
* salt: saltWordArray,
|
||||
* algorithm: CryptoJS.algo.AES,
|
||||
* mode: CryptoJS.mode.CBC,
|
||||
* padding: CryptoJS.pad.PKCS7,
|
||||
* blockSize: 4,
|
||||
* formatter: CryptoJS.format.OpenSSL
|
||||
* });
|
||||
*/
|
||||
init: function (cipherParams) {
|
||||
this.mixIn(cipherParams);
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts this cipher params object to a string.
|
||||
*
|
||||
* @param {Format} formatter (Optional) The formatting strategy to use.
|
||||
*
|
||||
* @return {string} The stringified cipher params.
|
||||
*
|
||||
* @throws Error If neither the formatter nor the default formatter is set.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var string = cipherParams + '';
|
||||
* var string = cipherParams.toString();
|
||||
* var string = cipherParams.toString(CryptoJS.format.OpenSSL);
|
||||
*/
|
||||
toString: function (formatter) {
|
||||
return (formatter || this.formatter).stringify(this);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Format namespace.
|
||||
*/
|
||||
var C_format = C.format = {};
|
||||
|
||||
/**
|
||||
* OpenSSL formatting strategy.
|
||||
*/
|
||||
var OpenSSLFormatter = C_format.OpenSSL = {
|
||||
/**
|
||||
* Converts a cipher params object to an OpenSSL-compatible string.
|
||||
*
|
||||
* @param {CipherParams} cipherParams The cipher params object.
|
||||
*
|
||||
* @return {string} The OpenSSL-compatible string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
|
||||
*/
|
||||
stringify: function (cipherParams) {
|
||||
// Shortcuts
|
||||
var ciphertext = cipherParams.ciphertext;
|
||||
var salt = cipherParams.salt;
|
||||
|
||||
// Format
|
||||
if (salt) {
|
||||
var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
|
||||
} else {
|
||||
var wordArray = ciphertext;
|
||||
}
|
||||
var openSSLStr = wordArray.toString(Base64);
|
||||
|
||||
// Limit lines to 64 characters
|
||||
openSSLStr = openSSLStr.replace(/(.{64})/g, '$1\n');
|
||||
|
||||
return openSSLStr;
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts an OpenSSL-compatible string to a cipher params object.
|
||||
*
|
||||
* @param {string} openSSLStr The OpenSSL-compatible string.
|
||||
*
|
||||
* @return {CipherParams} The cipher params object.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
|
||||
*/
|
||||
parse: function (openSSLStr) {
|
||||
// Parse base64
|
||||
var ciphertext = Base64.parse(openSSLStr);
|
||||
|
||||
// Shortcut
|
||||
var ciphertextWords = ciphertext.words;
|
||||
|
||||
// Test for salt
|
||||
if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
|
||||
// Extract salt
|
||||
var salt = WordArray.create(ciphertextWords.slice(2, 4));
|
||||
|
||||
// Remove salt from ciphertext
|
||||
ciphertextWords.splice(0, 4);
|
||||
ciphertext.sigBytes -= 16;
|
||||
}
|
||||
|
||||
return CipherParams.create({ ciphertext: ciphertext, salt: salt });
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A cipher wrapper that returns ciphertext as a serializable cipher params object.
|
||||
*/
|
||||
var SerializableCipher = C_lib.SerializableCipher = Base.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string.
|
||||
* Default: CryptoJS.format.OpenSSL
|
||||
*/
|
||||
cfg: Base.extend({
|
||||
format: OpenSSLFormatter
|
||||
}),
|
||||
|
||||
/**
|
||||
* Encrypts a message.
|
||||
*
|
||||
* @param {Cipher} cipher The cipher algorithm to use.
|
||||
* @param {WordArray|string} message The message to encrypt.
|
||||
* @param {WordArray} key The key.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {CipherParams} A cipher params object.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
|
||||
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
|
||||
* var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
||||
*/
|
||||
encrypt: function (cipher, message, key, cfg) {
|
||||
// Apply config defaults
|
||||
cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Encrypt
|
||||
var encryptor = cipher.createEncryptor(key, cfg);
|
||||
var ciphertext = encryptor.finalize(message);
|
||||
|
||||
// Shortcut
|
||||
var cipherCfg = encryptor.cfg;
|
||||
|
||||
// Create and return serializable cipher params
|
||||
return CipherParams.create({
|
||||
ciphertext: ciphertext,
|
||||
key: key,
|
||||
iv: cipherCfg.iv,
|
||||
algorithm: cipher,
|
||||
mode: cipherCfg.mode,
|
||||
padding: cipherCfg.padding,
|
||||
blockSize: cipher.blockSize,
|
||||
formatter: cfg.format
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* Decrypts serialized ciphertext.
|
||||
*
|
||||
* @param {Cipher} cipher The cipher algorithm to use.
|
||||
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
||||
* @param {WordArray} key The key.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {WordArray} The plaintext.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
||||
* var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
|
||||
*/
|
||||
decrypt: function (cipher, ciphertext, key, cfg) {
|
||||
// Apply config defaults
|
||||
cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Convert string to CipherParams
|
||||
ciphertext = this._parse(ciphertext, cfg.format);
|
||||
|
||||
// Decrypt
|
||||
var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
|
||||
|
||||
return plaintext;
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts serialized ciphertext to CipherParams,
|
||||
* else assumes CipherParams already and returns ciphertext unchanged.
|
||||
*
|
||||
* @param {CipherParams|string} ciphertext The ciphertext.
|
||||
* @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
|
||||
*
|
||||
* @return {CipherParams} The unserialized ciphertext.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
|
||||
*/
|
||||
_parse: function (ciphertext, format) {
|
||||
if (typeof ciphertext == 'string') {
|
||||
return format.parse(ciphertext);
|
||||
} else {
|
||||
return ciphertext;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Key derivation function namespace.
|
||||
*/
|
||||
var C_kdf = C.kdf = {};
|
||||
|
||||
/**
|
||||
* OpenSSL key derivation function.
|
||||
*/
|
||||
var OpenSSLKdf = C_kdf.OpenSSL = {
|
||||
/**
|
||||
* Derives a key and IV from a password.
|
||||
*
|
||||
* @param {string} password The password to derive from.
|
||||
* @param {number} keySize The size in words of the key to generate.
|
||||
* @param {number} ivSize The size in words of the IV to generate.
|
||||
* @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
|
||||
*
|
||||
* @return {CipherParams} A cipher params object with the key, IV, and salt.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var derivedParams = CryptoJS.kdf.OpenSSL.compute('Password', 256/32, 128/32);
|
||||
* var derivedParams = CryptoJS.kdf.OpenSSL.compute('Password', 256/32, 128/32, 'saltsalt');
|
||||
*/
|
||||
compute: function (password, keySize, ivSize, salt) {
|
||||
// Generate random salt
|
||||
if (!salt) {
|
||||
salt = WordArray.random(64/8);
|
||||
}
|
||||
|
||||
// Derive key and IV
|
||||
var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
|
||||
|
||||
// Separate key and IV
|
||||
var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
|
||||
key.sigBytes = keySize * 4;
|
||||
|
||||
// Return params
|
||||
return CipherParams.create({ key: key, iv: iv, salt: salt });
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* A serializable cipher wrapper that derives the key from a password,
|
||||
* and returns ciphertext as a serializable cipher params object.
|
||||
*/
|
||||
var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {KDF} kdf The key derivation function to use to generate a key and IV from a password.
|
||||
* Default: CryptoJS.kdf.OpenSSL
|
||||
*/
|
||||
cfg: SerializableCipher.cfg.extend({
|
||||
kdf: OpenSSLKdf
|
||||
}),
|
||||
|
||||
/**
|
||||
* Encrypts a message using a password.
|
||||
*
|
||||
* @param {Cipher} cipher The cipher algorithm to use.
|
||||
* @param {WordArray|string} message The message to encrypt.
|
||||
* @param {string} password The password.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {CipherParams} A cipher params object.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
|
||||
* var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
|
||||
*/
|
||||
encrypt: function (cipher, message, password, cfg) {
|
||||
// Apply config defaults
|
||||
cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Derive key and other params
|
||||
var derivedParams = cfg.kdf.compute(password, cipher.keySize, cipher.ivSize);
|
||||
|
||||
// Add IV to config
|
||||
cfg.iv = derivedParams.iv;
|
||||
|
||||
// Encrypt
|
||||
var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
|
||||
|
||||
// Mix in derived params
|
||||
ciphertext.mixIn(derivedParams);
|
||||
|
||||
return ciphertext;
|
||||
},
|
||||
|
||||
/**
|
||||
* Decrypts serialized ciphertext using a password.
|
||||
*
|
||||
* @param {Cipher} cipher The cipher algorithm to use.
|
||||
* @param {CipherParams|string} ciphertext The ciphertext to decrypt.
|
||||
* @param {string} password The password.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this operation.
|
||||
*
|
||||
* @return {WordArray} The plaintext.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
|
||||
* var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
|
||||
*/
|
||||
decrypt: function (cipher, ciphertext, password, cfg) {
|
||||
// Apply config defaults
|
||||
cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Convert string to CipherParams
|
||||
ciphertext = this._parse(ciphertext, cfg.format);
|
||||
|
||||
// Derive key and other params
|
||||
var derivedParams = cfg.kdf.compute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
|
||||
|
||||
// Add IV to config
|
||||
cfg.iv = derivedParams.iv;
|
||||
|
||||
// Decrypt
|
||||
var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
|
||||
|
||||
return plaintext;
|
||||
}
|
||||
});
|
||||
}());
|
|
@ -1,12 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(h,o){var f={},j=f.lib={},k=j.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;b&&c.mixIn(b);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),i=j.WordArray=k.extend({init:function(a,b){a=
|
||||
this.words=a||[];this.sigBytes=b!=o?b:4*a.length},toString:function(a){return(a||p).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var e=0;e<a;e++)b[d+e>>>2]|=(c[e>>>2]>>>24-8*(e%4)&255)<<24-8*((d+e)%4);else if(65535<c.length)for(e=0;e<a;e+=4)b[d+e>>>2]=c[e>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=
|
||||
k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c<a;c+=4)b.push(4294967296*h.random()|0);return i.create(b,a)}}),l=f.enc={},p=l.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,c=[],d=0;d<a;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return i.create(c,b/2)}},n=l.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return i.create(c,b)}},q=l.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},m=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=q.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,f=d/(4*e),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*e,d=h.min(4*a,d);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(c,g);g=c.splice(0,a);b.sigBytes-=d}return i.create(g,d)},clone:function(){var a=k.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});j.Hasher=m.extend({init:function(){this.reset()},
|
||||
reset:function(){m.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=m.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return r.HMAC.create(a,c).finalize(b)}}});var r=f.algo={};return f}(Math);
|
|
@ -1,719 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* CryptoJS core components.
|
||||
*/
|
||||
var CryptoJS = CryptoJS || (function (Math, undefined) {
|
||||
/**
|
||||
* CryptoJS namespace.
|
||||
*/
|
||||
var C = {};
|
||||
|
||||
/**
|
||||
* Library namespace.
|
||||
*/
|
||||
var C_lib = C.lib = {};
|
||||
|
||||
/**
|
||||
* Base object for prototypal inheritance.
|
||||
*/
|
||||
var Base = C_lib.Base = (function () {
|
||||
function F() {}
|
||||
|
||||
return {
|
||||
/**
|
||||
* Creates a new object that inherits from this object.
|
||||
*
|
||||
* @param {Object} overrides Properties to copy into the new object.
|
||||
*
|
||||
* @return {Object} The new object.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var MyType = CryptoJS.lib.Base.extend({
|
||||
* field: 'value',
|
||||
*
|
||||
* method: function () {
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
extend: function (overrides) {
|
||||
// Spawn
|
||||
F.prototype = this;
|
||||
var subtype = new F();
|
||||
|
||||
// Augment
|
||||
if (overrides) {
|
||||
subtype.mixIn(overrides);
|
||||
}
|
||||
|
||||
// Reference supertype
|
||||
subtype.$super = this;
|
||||
|
||||
return subtype;
|
||||
},
|
||||
|
||||
/**
|
||||
* Extends this object and runs the init method.
|
||||
* Arguments to create() will be passed to init().
|
||||
*
|
||||
* @return {Object} The new object.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var instance = MyType.create();
|
||||
*/
|
||||
create: function () {
|
||||
var instance = this.extend();
|
||||
instance.init.apply(instance, arguments);
|
||||
|
||||
return instance;
|
||||
},
|
||||
|
||||
/**
|
||||
* Initializes a newly created object.
|
||||
* Override this method to add some logic when your objects are created.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var MyType = CryptoJS.lib.Base.extend({
|
||||
* init: function () {
|
||||
* // ...
|
||||
* }
|
||||
* });
|
||||
*/
|
||||
init: function () {
|
||||
},
|
||||
|
||||
/**
|
||||
* Copies properties into this object.
|
||||
*
|
||||
* @param {Object} properties The properties to mix in.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* MyType.mixIn({
|
||||
* field: 'value'
|
||||
* });
|
||||
*/
|
||||
mixIn: function (properties) {
|
||||
for (var propertyName in properties) {
|
||||
if (properties.hasOwnProperty(propertyName)) {
|
||||
this[propertyName] = properties[propertyName];
|
||||
}
|
||||
}
|
||||
|
||||
// IE won't copy toString using the loop above
|
||||
// Other non-enumerable properties are:
|
||||
// hasOwnProperty, isPrototypeOf, propertyIsEnumerable,
|
||||
// toLocaleString, valueOf
|
||||
if (properties.hasOwnProperty('toString')) {
|
||||
this.toString = properties.toString;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a copy of this object.
|
||||
*
|
||||
* @return {Object} The clone.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var clone = instance.clone();
|
||||
*/
|
||||
clone: function () {
|
||||
return this.$super.extend(this);
|
||||
}
|
||||
};
|
||||
}());
|
||||
|
||||
/**
|
||||
* An array of 32-bit words.
|
||||
*
|
||||
* @property {Array} words The array of 32-bit words.
|
||||
* @property {number} sigBytes The number of significant bytes in this word array.
|
||||
*/
|
||||
var WordArray = C_lib.WordArray = Base.extend({
|
||||
/**
|
||||
* Initializes a newly created word array.
|
||||
*
|
||||
* @param {Array} words (Optional) An array of 32-bit words.
|
||||
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.lib.WordArray.create();
|
||||
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
|
||||
* var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
|
||||
*/
|
||||
init: function (words, sigBytes) {
|
||||
words = this.words = words || [];
|
||||
|
||||
if (sigBytes != undefined) {
|
||||
this.sigBytes = sigBytes;
|
||||
} else {
|
||||
this.sigBytes = words.length * 4;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts this word array to a string.
|
||||
*
|
||||
* @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
|
||||
*
|
||||
* @return {string} The stringified word array.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var string = wordArray + '';
|
||||
* var string = wordArray.toString();
|
||||
* var string = wordArray.toString(CryptoJS.enc.Utf8);
|
||||
*/
|
||||
toString: function (encoder) {
|
||||
return (encoder || Hex).stringify(this);
|
||||
},
|
||||
|
||||
/**
|
||||
* Concatenates a word array to this word array.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array to append.
|
||||
*
|
||||
* @return {WordArray} This word array.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* wordArray1.concat(wordArray2);
|
||||
*/
|
||||
concat: function (wordArray) {
|
||||
// Shortcuts
|
||||
var thisWords = this.words;
|
||||
var thatWords = wordArray.words;
|
||||
var thisSigBytes = this.sigBytes;
|
||||
var thatSigBytes = wordArray.sigBytes;
|
||||
|
||||
// Clamp excess bits
|
||||
this.clamp();
|
||||
|
||||
// Concat
|
||||
if (thisSigBytes % 4) {
|
||||
// Copy one byte at a time
|
||||
for (var i = 0; i < thatSigBytes; i++) {
|
||||
var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
|
||||
}
|
||||
} else if (thatWords.length > 0xffff) {
|
||||
// Copy one word at a time
|
||||
for (var i = 0; i < thatSigBytes; i += 4) {
|
||||
thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
|
||||
}
|
||||
} else {
|
||||
// Copy all words at once
|
||||
thisWords.push.apply(thisWords, thatWords);
|
||||
}
|
||||
this.sigBytes += thatSigBytes;
|
||||
|
||||
// Chainable
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Removes insignificant bits.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* wordArray.clamp();
|
||||
*/
|
||||
clamp: function () {
|
||||
// Shortcuts
|
||||
var words = this.words;
|
||||
var sigBytes = this.sigBytes;
|
||||
|
||||
// Clamp
|
||||
words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
|
||||
words.length = Math.ceil(sigBytes / 4);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a copy of this word array.
|
||||
*
|
||||
* @return {WordArray} The clone.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var clone = wordArray.clone();
|
||||
*/
|
||||
clone: function () {
|
||||
var clone = Base.clone.call(this);
|
||||
clone.words = this.words.slice(0);
|
||||
|
||||
return clone;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a word array filled with random bytes.
|
||||
*
|
||||
* @param {number} nBytes The number of random bytes to generate.
|
||||
*
|
||||
* @return {WordArray} The random word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.lib.WordArray.random(16);
|
||||
*/
|
||||
random: function (nBytes) {
|
||||
var words = [];
|
||||
for (var i = 0; i < nBytes; i += 4) {
|
||||
words.push((Math.random() * 0x100000000) | 0);
|
||||
}
|
||||
|
||||
return WordArray.create(words, nBytes);
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Encoder namespace.
|
||||
*/
|
||||
var C_enc = C.enc = {};
|
||||
|
||||
/**
|
||||
* Hex encoding strategy.
|
||||
*/
|
||||
var Hex = C_enc.Hex = {
|
||||
/**
|
||||
* Converts a word array to a hex string.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array.
|
||||
*
|
||||
* @return {string} The hex string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hexString = CryptoJS.enc.Hex.stringify(wordArray);
|
||||
*/
|
||||
stringify: function (wordArray) {
|
||||
// Shortcuts
|
||||
var words = wordArray.words;
|
||||
var sigBytes = wordArray.sigBytes;
|
||||
|
||||
// Convert
|
||||
var hexChars = [];
|
||||
for (var i = 0; i < sigBytes; i++) {
|
||||
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
hexChars.push((bite >>> 4).toString(16));
|
||||
hexChars.push((bite & 0x0f).toString(16));
|
||||
}
|
||||
|
||||
return hexChars.join('');
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a hex string to a word array.
|
||||
*
|
||||
* @param {string} hexStr The hex string.
|
||||
*
|
||||
* @return {WordArray} The word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.enc.Hex.parse(hexString);
|
||||
*/
|
||||
parse: function (hexStr) {
|
||||
// Shortcut
|
||||
var hexStrLength = hexStr.length;
|
||||
|
||||
// Convert
|
||||
var words = [];
|
||||
for (var i = 0; i < hexStrLength; i += 2) {
|
||||
words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
|
||||
}
|
||||
|
||||
return WordArray.create(words, hexStrLength / 2);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Latin1 encoding strategy.
|
||||
*/
|
||||
var Latin1 = C_enc.Latin1 = {
|
||||
/**
|
||||
* Converts a word array to a Latin1 string.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array.
|
||||
*
|
||||
* @return {string} The Latin1 string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
|
||||
*/
|
||||
stringify: function (wordArray) {
|
||||
// Shortcuts
|
||||
var words = wordArray.words;
|
||||
var sigBytes = wordArray.sigBytes;
|
||||
|
||||
// Convert
|
||||
var latin1Chars = [];
|
||||
for (var i = 0; i < sigBytes; i++) {
|
||||
var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
latin1Chars.push(String.fromCharCode(bite));
|
||||
}
|
||||
|
||||
return latin1Chars.join('');
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a Latin1 string to a word array.
|
||||
*
|
||||
* @param {string} latin1Str The Latin1 string.
|
||||
*
|
||||
* @return {WordArray} The word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
|
||||
*/
|
||||
parse: function (latin1Str) {
|
||||
// Shortcut
|
||||
var latin1StrLength = latin1Str.length;
|
||||
|
||||
// Convert
|
||||
var words = [];
|
||||
for (var i = 0; i < latin1StrLength; i++) {
|
||||
words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
|
||||
}
|
||||
|
||||
return WordArray.create(words, latin1StrLength);
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* UTF-8 encoding strategy.
|
||||
*/
|
||||
var Utf8 = C_enc.Utf8 = {
|
||||
/**
|
||||
* Converts a word array to a UTF-8 string.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array.
|
||||
*
|
||||
* @return {string} The UTF-8 string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
|
||||
*/
|
||||
stringify: function (wordArray) {
|
||||
try {
|
||||
return decodeURIComponent(escape(Latin1.stringify(wordArray)));
|
||||
} catch (e) {
|
||||
throw new Error('Malformed UTF-8 data');
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a UTF-8 string to a word array.
|
||||
*
|
||||
* @param {string} utf8Str The UTF-8 string.
|
||||
*
|
||||
* @return {WordArray} The word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
|
||||
*/
|
||||
parse: function (utf8Str) {
|
||||
return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Abstract buffered block algorithm template.
|
||||
* The property blockSize must be implemented in a concrete subtype.
|
||||
*
|
||||
* @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
|
||||
*/
|
||||
var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
|
||||
/**
|
||||
* Resets this block algorithm's data buffer to its initial state.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* bufferedBlockAlgorithm.reset();
|
||||
*/
|
||||
reset: function () {
|
||||
// Initial values
|
||||
this._data = WordArray.create();
|
||||
this._nDataBytes = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Adds new data to this block algorithm's buffer.
|
||||
*
|
||||
* @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* bufferedBlockAlgorithm._append('data');
|
||||
* bufferedBlockAlgorithm._append(wordArray);
|
||||
*/
|
||||
_append: function (data) {
|
||||
// Convert string to WordArray, else assume WordArray already
|
||||
if (typeof data == 'string') {
|
||||
data = Utf8.parse(data);
|
||||
}
|
||||
|
||||
// Append
|
||||
this._data.concat(data);
|
||||
this._nDataBytes += data.sigBytes;
|
||||
},
|
||||
|
||||
/**
|
||||
* Processes available data blocks.
|
||||
* This method invokes _doProcessBlock(dataWords, offset), which must be implemented by a concrete subtype.
|
||||
*
|
||||
* @param {boolean} flush Whether all blocks and partial blocks should be processed.
|
||||
*
|
||||
* @return {WordArray} The data after processing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var processedData = bufferedBlockAlgorithm._process();
|
||||
* var processedData = bufferedBlockAlgorithm._process(!!'flush');
|
||||
*/
|
||||
_process: function (flush) {
|
||||
// Shortcuts
|
||||
var data = this._data;
|
||||
var dataWords = data.words;
|
||||
var dataSigBytes = data.sigBytes;
|
||||
var blockSize = this.blockSize;
|
||||
var blockSizeBytes = blockSize * 4;
|
||||
|
||||
// Count blocks ready
|
||||
var nBlocksReady = dataSigBytes / blockSizeBytes;
|
||||
if (flush) {
|
||||
// Round up to include partial blocks
|
||||
nBlocksReady = Math.ceil(nBlocksReady);
|
||||
} else {
|
||||
// Round down to include only full blocks,
|
||||
// less the number of blocks that must remain in the buffer
|
||||
nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
|
||||
}
|
||||
|
||||
// Count words ready
|
||||
var nWordsReady = nBlocksReady * blockSize;
|
||||
|
||||
// Count bytes ready
|
||||
var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
|
||||
|
||||
// Process blocks
|
||||
if (nWordsReady) {
|
||||
for (var offset = 0; offset < nWordsReady; offset += blockSize) {
|
||||
// Perform concrete-algorithm logic
|
||||
this._doProcessBlock(dataWords, offset);
|
||||
}
|
||||
|
||||
// Remove processed words
|
||||
var processedWords = dataWords.splice(0, nWordsReady);
|
||||
data.sigBytes -= nBytesReady;
|
||||
}
|
||||
|
||||
// Return processed words
|
||||
return WordArray.create(processedWords, nBytesReady);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a copy of this object.
|
||||
*
|
||||
* @return {Object} The clone.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var clone = bufferedBlockAlgorithm.clone();
|
||||
*/
|
||||
clone: function () {
|
||||
var clone = Base.clone.call(this);
|
||||
clone._data = this._data.clone();
|
||||
|
||||
return clone;
|
||||
},
|
||||
|
||||
_minBufferSize: 0
|
||||
});
|
||||
|
||||
/**
|
||||
* Abstract hasher template.
|
||||
*
|
||||
* @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
|
||||
*/
|
||||
var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*/
|
||||
// cfg: Base.extend(),
|
||||
|
||||
/**
|
||||
* Initializes a newly created hasher.
|
||||
*
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this hash computation.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hasher = CryptoJS.algo.SHA256.create();
|
||||
*/
|
||||
init: function (cfg) {
|
||||
// Apply config defaults
|
||||
// this.cfg = this.cfg.extend(cfg);
|
||||
|
||||
// Set initial values
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/**
|
||||
* Resets this hasher to its initial state.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* hasher.reset();
|
||||
*/
|
||||
reset: function () {
|
||||
// Reset data buffer
|
||||
BufferedBlockAlgorithm.reset.call(this);
|
||||
|
||||
// Perform concrete-hasher logic
|
||||
this._doReset();
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates this hasher with a message.
|
||||
*
|
||||
* @param {WordArray|string} messageUpdate The message to append.
|
||||
*
|
||||
* @return {Hasher} This hasher.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* hasher.update('message');
|
||||
* hasher.update(wordArray);
|
||||
*/
|
||||
update: function (messageUpdate) {
|
||||
// Append
|
||||
this._append(messageUpdate);
|
||||
|
||||
// Update the hash
|
||||
this._process();
|
||||
|
||||
// Chainable
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finalizes the hash computation.
|
||||
* Note that the finalize operation is effectively a destructive, read-once operation.
|
||||
*
|
||||
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = hasher.finalize();
|
||||
* var hash = hasher.finalize('message');
|
||||
* var hash = hasher.finalize(wordArray);
|
||||
*/
|
||||
finalize: function (messageUpdate) {
|
||||
// Final message update
|
||||
if (messageUpdate) {
|
||||
this._append(messageUpdate);
|
||||
}
|
||||
|
||||
// Perform concrete-hasher logic
|
||||
this._doFinalize();
|
||||
|
||||
return this._hash;
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a copy of this object.
|
||||
*
|
||||
* @return {Object} The clone.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var clone = hasher.clone();
|
||||
*/
|
||||
clone: function () {
|
||||
var clone = BufferedBlockAlgorithm.clone.call(this);
|
||||
clone._hash = this._hash.clone();
|
||||
|
||||
return clone;
|
||||
},
|
||||
|
||||
blockSize: 512/32,
|
||||
|
||||
/**
|
||||
* Creates a shortcut function to a hasher's object interface.
|
||||
*
|
||||
* @param {Hasher} hasher The hasher to create a helper for.
|
||||
*
|
||||
* @return {Function} The shortcut function.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
|
||||
*/
|
||||
_createHelper: function (hasher) {
|
||||
return function (message, cfg) {
|
||||
return hasher.create(cfg).finalize(message);
|
||||
};
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {Hasher} hasher The hasher to use in this HMAC helper.
|
||||
*
|
||||
* @return {Function} The shortcut function.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
|
||||
*/
|
||||
_createHmacHelper: function (hasher) {
|
||||
return function (message, key) {
|
||||
return C_algo.HMAC.create(hasher, key).finalize(message);
|
||||
};
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Algorithm namespace.
|
||||
*/
|
||||
var C_algo = C.algo = {};
|
||||
|
||||
return C;
|
||||
}(Math));
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var h=CryptoJS,i=h.lib.WordArray;h.enc.Base64={stringify:function(b){var e=b.words,f=b.sigBytes,c=this._map;b.clamp();for(var b=[],a=0;a<f;a+=3)for(var d=(e[a>>>2]>>>24-8*(a%4)&255)<<16|(e[a+1>>>2]>>>24-8*((a+1)%4)&255)<<8|e[a+2>>>2]>>>24-8*((a+2)%4)&255,g=0;4>g&&a+0.75*g<f;g++)b.push(c.charAt(d>>>6*(3-g)&63));if(e=c.charAt(64))for(;b.length%4;)b.push(e);return b.join("")},parse:function(b){var b=b.replace(/\s/g,""),e=b.length,f=this._map,c=f.charAt(64);c&&(c=b.indexOf(c),-1!=c&&(e=c));
|
||||
for(var c=[],a=0,d=0;d<e;d++)if(d%4){var g=f.indexOf(b.charAt(d-1))<<2*(d%4),h=f.indexOf(b.charAt(d))>>>6-2*(d%4);c[a>>>2]|=(g|h)<<24-8*(a%4);a++}return i.create(c,a)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
|
@ -1,112 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var C_enc = C.enc;
|
||||
|
||||
/**
|
||||
* Base64 encoding strategy.
|
||||
*/
|
||||
var Base64 = C_enc.Base64 = {
|
||||
/**
|
||||
* Converts a word array to a Base64 string.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array.
|
||||
*
|
||||
* @return {string} The Base64 string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var base64String = CryptoJS.enc.Base64.stringify(wordArray);
|
||||
*/
|
||||
stringify: function (wordArray) {
|
||||
// Shortcuts
|
||||
var words = wordArray.words;
|
||||
var sigBytes = wordArray.sigBytes;
|
||||
var map = this._map;
|
||||
|
||||
// Clamp excess bits
|
||||
wordArray.clamp();
|
||||
|
||||
// Convert
|
||||
var base64Chars = [];
|
||||
for (var i = 0; i < sigBytes; i += 3) {
|
||||
var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
|
||||
var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
|
||||
var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
|
||||
|
||||
var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
|
||||
|
||||
for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
|
||||
base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
|
||||
}
|
||||
}
|
||||
|
||||
// Add padding
|
||||
var paddingChar = map.charAt(64);
|
||||
if (paddingChar) {
|
||||
while (base64Chars.length % 4) {
|
||||
base64Chars.push(paddingChar);
|
||||
}
|
||||
}
|
||||
|
||||
return base64Chars.join('');
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a Base64 string to a word array.
|
||||
*
|
||||
* @param {string} base64Str The Base64 string.
|
||||
*
|
||||
* @return {WordArray} The word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.enc.Base64.parse(base64String);
|
||||
*/
|
||||
parse: function (base64Str) {
|
||||
// Ignore whitespaces
|
||||
base64Str = base64Str.replace(/\s/g, '');
|
||||
|
||||
// Shortcuts
|
||||
var base64StrLength = base64Str.length;
|
||||
var map = this._map;
|
||||
|
||||
// Ignore padding
|
||||
var paddingChar = map.charAt(64);
|
||||
if (paddingChar) {
|
||||
var paddingIndex = base64Str.indexOf(paddingChar);
|
||||
if (paddingIndex != -1) {
|
||||
base64StrLength = paddingIndex;
|
||||
}
|
||||
}
|
||||
|
||||
// Convert
|
||||
var words = [];
|
||||
var nBytes = 0;
|
||||
for (var i = 0; i < base64StrLength; i++) {
|
||||
if (i % 4) {
|
||||
var bitsHigh = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
|
||||
var bitsLow = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
|
||||
words[nBytes >>> 2] |= (bitsHigh | bitsLow) << (24 - (nBytes % 4) * 8);
|
||||
nBytes++;
|
||||
}
|
||||
}
|
||||
|
||||
return WordArray.create(words, nBytes);
|
||||
},
|
||||
|
||||
_map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
|
||||
};
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var e=CryptoJS,f=e.lib.WordArray;e.enc.Utf16={stringify:function(b){for(var d=b.words,b=b.sigBytes,c=[],a=0;a<b;a+=2)c.push(String.fromCharCode(d[a>>>2]>>>16-8*(a%4)&65535));return c.join("")},parse:function(b){for(var d=b.length,c=[],a=0;a<d;a++)c[a>>>1]|=b.charCodeAt(a)<<16-16*(a%2);return f.create(c,2*d)}}})();
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var C_enc = C.enc;
|
||||
|
||||
/**
|
||||
* UTF-16 BE encoding strategy.
|
||||
*/
|
||||
var Utf16 = C_enc.Utf16 = {
|
||||
/**
|
||||
* Converts a word array to a UTF-16 string.
|
||||
*
|
||||
* @param {WordArray} wordArray The word array.
|
||||
*
|
||||
* @return {string} The UTF-16 string.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
|
||||
*/
|
||||
stringify: function (wordArray) {
|
||||
// Shortcuts
|
||||
var words = wordArray.words;
|
||||
var sigBytes = wordArray.sigBytes;
|
||||
|
||||
// Convert
|
||||
var utf16Chars = [];
|
||||
for (var i = 0; i < sigBytes; i += 2) {
|
||||
var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
|
||||
utf16Chars.push(String.fromCharCode(codePoint));
|
||||
}
|
||||
|
||||
return utf16Chars.join('');
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts a UTF-16 string to a word array.
|
||||
*
|
||||
* @param {string} utf16Str The UTF-16 string.
|
||||
*
|
||||
* @return {WordArray} The word array.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
|
||||
*/
|
||||
parse: function (utf16Str) {
|
||||
// Shortcut
|
||||
var utf16StrLength = utf16Str.length;
|
||||
|
||||
// Convert
|
||||
var words = [];
|
||||
for (var i = 0; i < utf16StrLength; i++) {
|
||||
words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
|
||||
}
|
||||
|
||||
return WordArray.create(words, utf16StrLength * 2);
|
||||
}
|
||||
};
|
||||
}());
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var b=CryptoJS,a=b.lib,f=a.Base,j=a.WordArray,a=b.algo,k=a.EvpKDF=f.extend({cfg:f.extend({keySize:4,hasher:a.MD5,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,d=c.hasher.create(),g=j.create(),f=g.words,h=c.keySize,c=c.iterations;f.length<h;){e&&d.update(e);var e=d.update(a).finalize(b);d.reset();for(var i=1;i<c;i++)e=d.finalize(e),d.reset();g.concat(e)}g.sigBytes=4*h;return g}});b.EvpKDF=function(a,b,c){return k.create(c).compute(a,
|
||||
b)}})();
|
|
@ -1,118 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Base = C_lib.Base;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var C_algo = C.algo;
|
||||
var MD5 = C_algo.MD5;
|
||||
|
||||
/**
|
||||
* This key derivation function is meant to conform with EVP_BytesToKey.
|
||||
* www.openssl.org/docs/crypto/EVP_BytesToKey.html
|
||||
*/
|
||||
var EvpKDF = C_algo.EvpKDF = Base.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
||||
* @property {Hasher} hasher The hash algorithm to use. Default: CryptoJS.algo.MD5
|
||||
* @property {number} iterations The number of iterations to perform. Default: 1
|
||||
*/
|
||||
cfg: Base.extend({
|
||||
keySize: 128/32,
|
||||
hasher: MD5,
|
||||
iterations: 1
|
||||
}),
|
||||
|
||||
/**
|
||||
* Initializes a newly created key derivation function.
|
||||
*
|
||||
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var kdf = CryptoJS.algo.EvpKDF.create();
|
||||
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
|
||||
* var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
|
||||
*/
|
||||
init: function (cfg) {
|
||||
this.cfg = this.cfg.extend(cfg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Derives a key from a password.
|
||||
*
|
||||
* @param {WordArray|string} password The password.
|
||||
* @param {WordArray|string} salt A salt.
|
||||
*
|
||||
* @return {WordArray} The derived key.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var key = kdf.compute(password, salt);
|
||||
*/
|
||||
compute: function (password, salt) {
|
||||
// Shortcut
|
||||
var cfg = this.cfg;
|
||||
|
||||
// Init hasher
|
||||
var hasher = cfg.hasher.create();
|
||||
|
||||
// Initial values
|
||||
var derivedKey = WordArray.create();
|
||||
|
||||
// Shortcuts
|
||||
var derivedKeyWords = derivedKey.words;
|
||||
var keySize = cfg.keySize;
|
||||
var iterations = cfg.iterations;
|
||||
|
||||
// Generate key
|
||||
while (derivedKeyWords.length < keySize) {
|
||||
if (block) {
|
||||
hasher.update(block);
|
||||
}
|
||||
var block = hasher.update(password).finalize(salt);
|
||||
hasher.reset();
|
||||
|
||||
// Iterations
|
||||
for (var i = 1; i < iterations; i++) {
|
||||
block = hasher.finalize(block);
|
||||
hasher.reset();
|
||||
}
|
||||
|
||||
derivedKey.concat(block);
|
||||
}
|
||||
derivedKey.sigBytes = keySize * 4;
|
||||
|
||||
return derivedKey;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Derives a key from a password.
|
||||
*
|
||||
* @param {WordArray|string} password The password.
|
||||
* @param {WordArray|string} salt A salt.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this computation.
|
||||
*
|
||||
* @return {WordArray} The derived key.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var key = CryptoJS.EvpKDF(password, salt);
|
||||
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
|
||||
* var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
|
||||
*/
|
||||
C.EvpKDF = function (password, salt, cfg) {
|
||||
return EvpKDF.create(cfg).compute(password, salt);
|
||||
};
|
||||
}());
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var c=CryptoJS,j=c.enc.Utf8;c.algo.HMAC=c.lib.Base.extend({init:function(a,b){a=this._hasher=a.create();"string"==typeof b&&(b=j.parse(b));var c=a.blockSize,e=4*c;b.sigBytes>e&&(b=a.finalize(b));for(var f=this._oKey=b.clone(),g=this._iKey=b.clone(),h=f.words,i=g.words,d=0;d<c;d++)h[d]^=1549556828,i[d]^=909522486;f.sigBytes=g.sigBytes=e;this.reset()},reset:function(){var a=this._hasher;a.reset();a.update(this._iKey)},update:function(a){this._hasher.update(a);return this},finalize:function(a){var b=
|
||||
this._hasher,a=b.finalize(a);b.reset();return b.finalize(this._oKey.clone().concat(a))}})})();
|
|
@ -1,128 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Base = C_lib.Base;
|
||||
var C_enc = C.enc;
|
||||
var Utf8 = C_enc.Utf8;
|
||||
var C_algo = C.algo;
|
||||
|
||||
/**
|
||||
* HMAC algorithm.
|
||||
*/
|
||||
var HMAC = C_algo.HMAC = Base.extend({
|
||||
/**
|
||||
* Initializes a newly created HMAC.
|
||||
*
|
||||
* @param {Hasher} hasher The hash algorithm to use.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
|
||||
*/
|
||||
init: function (hasher, key) {
|
||||
// Init hasher
|
||||
hasher = this._hasher = hasher.create();
|
||||
|
||||
// Convert string to WordArray, else assume WordArray already
|
||||
if (typeof key == 'string') {
|
||||
key = Utf8.parse(key);
|
||||
}
|
||||
|
||||
// Shortcuts
|
||||
var hasherBlockSize = hasher.blockSize;
|
||||
var hasherBlockSizeBytes = hasherBlockSize * 4;
|
||||
|
||||
// Allow arbitrary length keys
|
||||
if (key.sigBytes > hasherBlockSizeBytes) {
|
||||
key = hasher.finalize(key);
|
||||
}
|
||||
|
||||
// Clone key for inner and outer pads
|
||||
var oKey = this._oKey = key.clone();
|
||||
var iKey = this._iKey = key.clone();
|
||||
|
||||
// Shortcuts
|
||||
var oKeyWords = oKey.words;
|
||||
var iKeyWords = iKey.words;
|
||||
|
||||
// XOR keys with pad constants
|
||||
for (var i = 0; i < hasherBlockSize; i++) {
|
||||
oKeyWords[i] ^= 0x5c5c5c5c;
|
||||
iKeyWords[i] ^= 0x36363636;
|
||||
}
|
||||
oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
|
||||
|
||||
// Set initial values
|
||||
this.reset();
|
||||
},
|
||||
|
||||
/**
|
||||
* Resets this HMAC to its initial state.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* hmacHasher.reset();
|
||||
*/
|
||||
reset: function () {
|
||||
// Shortcut
|
||||
var hasher = this._hasher;
|
||||
|
||||
// Reset
|
||||
hasher.reset();
|
||||
hasher.update(this._iKey);
|
||||
},
|
||||
|
||||
/**
|
||||
* Updates this HMAC with a message.
|
||||
*
|
||||
* @param {WordArray|string} messageUpdate The message to append.
|
||||
*
|
||||
* @return {HMAC} This HMAC instance.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* hmacHasher.update('message');
|
||||
* hmacHasher.update(wordArray);
|
||||
*/
|
||||
update: function (messageUpdate) {
|
||||
this._hasher.update(messageUpdate);
|
||||
|
||||
// Chainable
|
||||
return this;
|
||||
},
|
||||
|
||||
/**
|
||||
* Finalizes the HMAC computation.
|
||||
* Note that the finalize operation is effectively a destructive, read-once operation.
|
||||
*
|
||||
* @param {WordArray|string} messageUpdate (Optional) A final message update.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = hmacHasher.finalize();
|
||||
* var hmac = hmacHasher.finalize('message');
|
||||
* var hmac = hmacHasher.finalize(wordArray);
|
||||
*/
|
||||
finalize: function (messageUpdate) {
|
||||
// Shortcut
|
||||
var hasher = this._hasher;
|
||||
|
||||
// Compute HMAC
|
||||
var innerHash = hasher.finalize(messageUpdate);
|
||||
hasher.reset();
|
||||
var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
|
||||
|
||||
return hmac;
|
||||
}
|
||||
});
|
||||
}());
|
|
@ -1,10 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(q){function k(b,c,a,f,d,e,g){b=b+(c&a|~c&f)+d+g;return(b<<e|b>>>32-e)+c}function l(b,c,a,f,d,e,g){b=b+(c&f|a&~f)+d+g;return(b<<e|b>>>32-e)+c}function m(b,c,a,f,d,e,g){b=b+(c^a^f)+d+g;return(b<<e|b>>>32-e)+c}function n(b,c,a,f,d,e,g){b=b+(a^(c|~f))+d+g;return(b<<e|b>>>32-e)+c}var o=CryptoJS,j=o.lib,r=j.WordArray,j=j.Hasher,p=o.algo,i=[];(function(){for(var b=0;64>b;b++)i[b]=4294967296*q.abs(q.sin(b+1))|0})();p=p.MD5=j.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(b,c){for(var a=0;16>a;a++){var f=c+a,d=b[f];b[f]=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360}for(var f=this._hash.words,d=f[0],e=f[1],g=f[2],h=f[3],a=0;64>a;a+=4)16>a?(d=k(d,e,g,h,b[c+a],7,i[a]),h=k(h,d,e,g,b[c+a+1],12,i[a+1]),g=k(g,h,d,e,b[c+a+2],17,i[a+2]),e=k(e,g,h,d,b[c+a+3],22,i[a+3])):32>a?(d=l(d,e,g,h,b[c+(a+1)%16],5,i[a]),h=l(h,d,e,g,b[c+(a+6)%16],9,i[a+1]),g=l(g,h,d,e,b[c+(a+11)%16],14,i[a+2]),e=l(e,g,h,d,b[c+a%16],20,i[a+3])):48>a?(d=
|
||||
m(d,e,g,h,b[c+(3*a+5)%16],4,i[a]),h=m(h,d,e,g,b[c+(3*a+8)%16],11,i[a+1]),g=m(g,h,d,e,b[c+(3*a+11)%16],16,i[a+2]),e=m(e,g,h,d,b[c+(3*a+14)%16],23,i[a+3])):(d=n(d,e,g,h,b[c+3*a%16],6,i[a]),h=n(h,d,e,g,b[c+(3*a+7)%16],10,i[a+1]),g=n(g,h,d,e,b[c+(3*a+14)%16],15,i[a+2]),e=n(e,g,h,d,b[c+(3*a+5)%16],21,i[a+3]));f[0]=f[0]+d|0;f[1]=f[1]+e|0;f[2]=f[2]+g|0;f[3]=f[3]+h|0},_doFinalize:function(){var b=this._data,c=b.words,a=8*this._nDataBytes,f=8*b.sigBytes;c[f>>>5]|=128<<24-f%32;c[(f+64>>>9<<4)+14]=(a<<8|a>>>
|
||||
24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(c.length+1);this._process();b=this._hash.words;for(c=0;4>c;c++)a=b[c],b[c]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});o.MD5=j._createHelper(p);o.HmacMD5=j._createHmacHelper(p)})(Math);
|
|
@ -1,173 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function (Math) {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var Hasher = C_lib.Hasher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Constants table
|
||||
var T = [];
|
||||
|
||||
// Compute constants
|
||||
(function () {
|
||||
for (var i = 0; i < 64; i++) {
|
||||
T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
|
||||
}
|
||||
}());
|
||||
|
||||
/**
|
||||
* MD5 hash algorithm.
|
||||
*/
|
||||
var MD5 = C_algo.MD5 = Hasher.extend({
|
||||
_doReset: function () {
|
||||
this._hash = WordArray.create([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476]);
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
// Swap endian
|
||||
for (var i = 0; i < 16; i++) {
|
||||
// Shortcuts
|
||||
var offset_i = offset + i;
|
||||
var M_offset_i = M[offset_i];
|
||||
|
||||
// Swap
|
||||
M[offset_i] = (
|
||||
(((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
|
||||
(((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
|
||||
);
|
||||
}
|
||||
|
||||
// Shortcut
|
||||
var H = this._hash.words;
|
||||
|
||||
// Working variables
|
||||
var a = H[0];
|
||||
var b = H[1];
|
||||
var c = H[2];
|
||||
var d = H[3];
|
||||
|
||||
// Computation
|
||||
for (var i = 0; i < 64; i += 4) {
|
||||
if (i < 16) {
|
||||
a = FF(a, b, c, d, M[offset + i], 7, T[i]);
|
||||
d = FF(d, a, b, c, M[offset + i + 1], 12, T[i + 1]);
|
||||
c = FF(c, d, a, b, M[offset + i + 2], 17, T[i + 2]);
|
||||
b = FF(b, c, d, a, M[offset + i + 3], 22, T[i + 3]);
|
||||
} else if (i < 32) {
|
||||
a = GG(a, b, c, d, M[offset + ((i + 1) % 16)], 5, T[i]);
|
||||
d = GG(d, a, b, c, M[offset + ((i + 6) % 16)], 9, T[i + 1]);
|
||||
c = GG(c, d, a, b, M[offset + ((i + 11) % 16)], 14, T[i + 2]);
|
||||
b = GG(b, c, d, a, M[offset + (i % 16)], 20, T[i + 3]);
|
||||
} else if (i < 48) {
|
||||
a = HH(a, b, c, d, M[offset + ((i * 3 + 5) % 16)], 4, T[i]);
|
||||
d = HH(d, a, b, c, M[offset + ((i * 3 + 8) % 16)], 11, T[i + 1]);
|
||||
c = HH(c, d, a, b, M[offset + ((i * 3 + 11) % 16)], 16, T[i + 2]);
|
||||
b = HH(b, c, d, a, M[offset + ((i * 3 + 14) % 16)], 23, T[i + 3]);
|
||||
} else /* if (i < 64) */ {
|
||||
a = II(a, b, c, d, M[offset + ((i * 3) % 16)], 6, T[i]);
|
||||
d = II(d, a, b, c, M[offset + ((i * 3 + 7) % 16)], 10, T[i + 1]);
|
||||
c = II(c, d, a, b, M[offset + ((i * 3 + 14) % 16)], 15, T[i + 2]);
|
||||
b = II(b, c, d, a, M[offset + ((i * 3 + 5) % 16)], 21, T[i + 3]);
|
||||
}
|
||||
}
|
||||
|
||||
// Intermediate hash value
|
||||
H[0] = (H[0] + a) | 0;
|
||||
H[1] = (H[1] + b) | 0;
|
||||
H[2] = (H[2] + c) | 0;
|
||||
H[3] = (H[3] + d) | 0;
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
// Shortcuts
|
||||
var data = this._data;
|
||||
var dataWords = data.words;
|
||||
|
||||
var nBitsTotal = this._nDataBytes * 8;
|
||||
var nBitsLeft = data.sigBytes * 8;
|
||||
|
||||
// Add padding
|
||||
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
|
||||
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
|
||||
(((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
|
||||
(((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
|
||||
);
|
||||
data.sigBytes = (dataWords.length + 1) * 4;
|
||||
|
||||
// Hash final blocks
|
||||
this._process();
|
||||
|
||||
// Shortcut
|
||||
var H = this._hash.words;
|
||||
|
||||
// Swap endian
|
||||
for (var i = 0; i < 4; i++) {
|
||||
// Shortcut
|
||||
var H_i = H[i];
|
||||
|
||||
// Swap
|
||||
H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
|
||||
(((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function FF(a, b, c, d, x, s, t) {
|
||||
var n = a + ((b & c) | (~b & d)) + x + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
}
|
||||
|
||||
function GG(a, b, c, d, x, s, t) {
|
||||
var n = a + ((b & d) | (c & ~d)) + x + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
}
|
||||
|
||||
function HH(a, b, c, d, x, s, t) {
|
||||
var n = a + (b ^ c ^ d) + x + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
}
|
||||
|
||||
function II(a, b, c, d, x, s, t) {
|
||||
var n = a + (c ^ (b | ~d)) + x + t;
|
||||
return ((n << s) | (n >>> (32 - s))) + b;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.MD5('message');
|
||||
* var hash = CryptoJS.MD5(wordArray);
|
||||
*/
|
||||
C.MD5 = Hasher._createHelper(MD5);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacMD5(message, key);
|
||||
*/
|
||||
C.HmacMD5 = Hasher._createHmacHelper(MD5);
|
||||
}(Math));
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.mode.CFB=function(){function g(c,b,e,a){var d=this._iv;d?(d=d.slice(0),this._iv=void 0):d=this._prevBlock;a.encryptBlock(d,0);for(a=0;a<e;a++)c[b+a]^=d[a]}var f=CryptoJS.lib.BlockCipherMode.extend();f.Encryptor=f.extend({processBlock:function(c,b){var e=this._cipher,a=e.blockSize;g.call(this,c,b,a,e);this._prevBlock=c.slice(b,b+a)}});f.Decryptor=f.extend({processBlock:function(c,b){var e=this._cipher,a=e.blockSize,d=c.slice(b,b+a);g.call(this,c,b,a,e);this._prevBlock=d}});return f}();
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Cipher Feedback block mode.
|
||||
*/
|
||||
CryptoJS.mode.CFB = (function () {
|
||||
var CFB = CryptoJS.lib.BlockCipherMode.extend();
|
||||
|
||||
CFB.Encryptor = CFB.extend({
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher;
|
||||
var blockSize = cipher.blockSize;
|
||||
|
||||
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
||||
|
||||
// Remember this block to use with next block
|
||||
this._prevBlock = words.slice(offset, offset + blockSize);
|
||||
}
|
||||
});
|
||||
|
||||
CFB.Decryptor = CFB.extend({
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher;
|
||||
var blockSize = cipher.blockSize;
|
||||
|
||||
// Remember this block to use with next block
|
||||
var thisBlock = words.slice(offset, offset + blockSize);
|
||||
|
||||
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
||||
|
||||
// This block becomes the previous block
|
||||
this._prevBlock = thisBlock;
|
||||
}
|
||||
});
|
||||
|
||||
function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
|
||||
// Shortcut
|
||||
var iv = this._iv;
|
||||
|
||||
// Generate keystream
|
||||
if (iv) {
|
||||
var keystream = iv.slice(0);
|
||||
|
||||
// Remove IV for subsequent blocks
|
||||
this._iv = undefined;
|
||||
} else {
|
||||
var keystream = this._prevBlock;
|
||||
}
|
||||
cipher.encryptBlock(keystream, 0);
|
||||
|
||||
// Encrypt
|
||||
for (var i = 0; i < blockSize; i++) {
|
||||
words[offset + i] ^= keystream[i];
|
||||
}
|
||||
}
|
||||
|
||||
return CFB;
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.mode.CTR=function(){var b=CryptoJS.lib.BlockCipherMode.extend(),g=b.Encryptor=b.extend({processBlock:function(b,f){var a=this._cipher,e=a.blockSize,c=this._iv,d=this._counter;c&&(d=this._counter=c.slice(0),this._iv=void 0);c=d.slice(0);a.encryptBlock(c,0);d[e-1]=d[e-1]+1|0;for(a=0;a<e;a++)b[f+a]^=c[a]}});b.Decryptor=g;return b}();
|
|
@ -1,44 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Counter block mode.
|
||||
*/
|
||||
CryptoJS.mode.CTR = (function () {
|
||||
var CTR = CryptoJS.lib.BlockCipherMode.extend();
|
||||
|
||||
var Encryptor = CTR.Encryptor = CTR.extend({
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher
|
||||
var blockSize = cipher.blockSize;
|
||||
var iv = this._iv;
|
||||
var counter = this._counter;
|
||||
|
||||
// Generate keystream
|
||||
if (iv) {
|
||||
counter = this._counter = iv.slice(0);
|
||||
|
||||
// Remove IV for subsequent blocks
|
||||
this._iv = undefined;
|
||||
}
|
||||
var keystream = counter.slice(0);
|
||||
cipher.encryptBlock(keystream, 0);
|
||||
|
||||
// Increment counter
|
||||
counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
|
||||
|
||||
// Encrypt
|
||||
for (var i = 0; i < blockSize; i++) {
|
||||
words[offset + i] ^= keystream[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
CTR.Decryptor = Encryptor;
|
||||
|
||||
return CTR;
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.mode.ECB=function(){var a=CryptoJS.lib.BlockCipherMode.extend();a.Encryptor=a.extend({processBlock:function(a,b){this._cipher.encryptBlock(a,b)}});a.Decryptor=a.extend({processBlock:function(a,b){this._cipher.decryptBlock(a,b)}});return a}();
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Electronic Codebook block mode.
|
||||
*/
|
||||
CryptoJS.mode.ECB = (function () {
|
||||
var ECB = CryptoJS.lib.BlockCipherMode.extend();
|
||||
|
||||
ECB.Encryptor = ECB.extend({
|
||||
processBlock: function (words, offset) {
|
||||
this._cipher.encryptBlock(words, offset);
|
||||
}
|
||||
});
|
||||
|
||||
ECB.Decryptor = ECB.extend({
|
||||
processBlock: function (words, offset) {
|
||||
this._cipher.decryptBlock(words, offset);
|
||||
}
|
||||
});
|
||||
|
||||
return ECB;
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.mode.OFB=function(){var b=CryptoJS.lib.BlockCipherMode.extend(),d=b.Encryptor=b.extend({processBlock:function(b,e){var a=this._cipher,d=a.blockSize,f=this._iv,c=this._keystream;f&&(c=this._keystream=f.slice(0),this._iv=void 0);a.encryptBlock(c,0);for(a=0;a<d;a++)b[e+a]^=c[a]}});b.Decryptor=d;return b}();
|
|
@ -1,40 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Output Feedback block mode.
|
||||
*/
|
||||
CryptoJS.mode.OFB = (function () {
|
||||
var OFB = CryptoJS.lib.BlockCipherMode.extend();
|
||||
|
||||
var Encryptor = OFB.Encryptor = OFB.extend({
|
||||
processBlock: function (words, offset) {
|
||||
// Shortcuts
|
||||
var cipher = this._cipher
|
||||
var blockSize = cipher.blockSize;
|
||||
var iv = this._iv;
|
||||
var keystream = this._keystream;
|
||||
|
||||
// Generate keystream
|
||||
if (iv) {
|
||||
keystream = this._keystream = iv.slice(0);
|
||||
|
||||
// Remove IV for subsequent blocks
|
||||
this._iv = undefined;
|
||||
}
|
||||
cipher.encryptBlock(keystream, 0);
|
||||
|
||||
// Encrypt
|
||||
for (var i = 0; i < blockSize; i++) {
|
||||
words[offset + i] ^= keystream[i];
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
OFB.Decryptor = Encryptor;
|
||||
|
||||
return OFB;
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.pad.AnsiX923={pad:function(a,d){var b=a.sigBytes,c=4*d,c=c-b%c,b=b+c-1;a.clamp();a.words[b>>>2]|=c<<24-8*(b%4);a.sigBytes+=c},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
|
|
@ -1,35 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* ANSI X.923 padding strategy.
|
||||
*/
|
||||
CryptoJS.pad.AnsiX923 = {
|
||||
pad: function (data, blockSize) {
|
||||
// Shortcuts
|
||||
var dataSigBytes = data.sigBytes;
|
||||
var blockSizeBytes = blockSize * 4;
|
||||
|
||||
// Count padding bytes
|
||||
var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
|
||||
|
||||
// Compute last byte position
|
||||
var lastBytePos = dataSigBytes + nPaddingBytes - 1;
|
||||
|
||||
// Pad
|
||||
data.clamp();
|
||||
data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
|
||||
data.sigBytes += nPaddingBytes;
|
||||
},
|
||||
|
||||
unpad: function (data) {
|
||||
// Get number of padding bytes from last byte
|
||||
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
|
||||
|
||||
// Remove padding
|
||||
data.sigBytes -= nPaddingBytes;
|
||||
}
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.pad.Iso10126={pad:function(a,c){var b=4*c,b=b-a.sigBytes%b;a.concat(CryptoJS.lib.WordArray.random(b-1)).concat(CryptoJS.lib.WordArray.create([b<<24],1))},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* ISO 10126 padding strategy.
|
||||
*/
|
||||
CryptoJS.pad.Iso10126 = {
|
||||
pad: function (data, blockSize) {
|
||||
// Shortcut
|
||||
var blockSizeBytes = blockSize * 4;
|
||||
|
||||
// Count padding bytes
|
||||
var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
|
||||
|
||||
// Pad
|
||||
data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
|
||||
concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
|
||||
},
|
||||
|
||||
unpad: function (data) {
|
||||
// Get number of padding bytes from last byte
|
||||
var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
|
||||
|
||||
// Remove padding
|
||||
data.sigBytes -= nPaddingBytes;
|
||||
}
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.pad.Iso97971={pad:function(a,b){a.concat(CryptoJS.lib.WordArray.create([2147483648],1));CryptoJS.pad.ZeroPadding.pad(a,b)},unpad:function(a){CryptoJS.pad.ZeroPadding.unpad(a);a.sigBytes--}};
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* ISO/IEC 9797-1 Padding Method 2.
|
||||
*/
|
||||
CryptoJS.pad.Iso97971 = {
|
||||
pad: function (data, blockSize) {
|
||||
// Add 0x80 byte
|
||||
data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
|
||||
|
||||
// Zero pad the rest
|
||||
CryptoJS.pad.ZeroPadding.pad(data, blockSize);
|
||||
},
|
||||
|
||||
unpad: function (data) {
|
||||
// Remove zero padding
|
||||
CryptoJS.pad.ZeroPadding.unpad(data);
|
||||
|
||||
// Remove one more byte -- the 0x80 byte
|
||||
data.sigBytes--;
|
||||
}
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.pad.NoPadding={pad:function(){},unpad:function(){}};
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* A noop padding strategy.
|
||||
*/
|
||||
CryptoJS.pad.NoPadding = {
|
||||
pad: function () {
|
||||
},
|
||||
|
||||
unpad: function () {
|
||||
}
|
||||
};
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
CryptoJS.pad.ZeroPadding={pad:function(a,c){var b=4*c;a.clamp();a.sigBytes+=b-(a.sigBytes%b||b)},unpad:function(a){for(var c=a.words,b=a.sigBytes-1;!(c[b>>>2]>>>24-8*(b%4)&255);)b--;a.sigBytes=b+1}};
|
|
@ -1,31 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
/**
|
||||
* Zero padding strategy.
|
||||
*/
|
||||
CryptoJS.pad.ZeroPadding = {
|
||||
pad: function (data, blockSize) {
|
||||
// Shortcut
|
||||
var blockSizeBytes = blockSize * 4;
|
||||
|
||||
// Pad
|
||||
data.clamp();
|
||||
data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
|
||||
},
|
||||
|
||||
unpad: function (data) {
|
||||
// Shortcut
|
||||
var dataWords = data.words;
|
||||
|
||||
// Unpad
|
||||
var i = data.sigBytes - 1;
|
||||
while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
|
||||
i--;
|
||||
}
|
||||
data.sigBytes = i + 1;
|
||||
}
|
||||
};
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var b=CryptoJS,a=b.lib,d=a.Base,l=a.WordArray,a=b.algo,o=a.HMAC,k=a.PBKDF2=d.extend({cfg:d.extend({keySize:4,hasher:a.SHA1,iterations:1}),init:function(a){this.cfg=this.cfg.extend(a)},compute:function(a,b){for(var c=this.cfg,f=o.create(c.hasher,a),g=l.create(),d=l.create([1]),k=g.words,p=d.words,m=c.keySize,c=c.iterations;k.length<m;){var h=f.update(b).finalize(d);f.reset();for(var i=h.words,q=i.length,j=h,n=1;n<c;n++){j=f.finalize(j);f.reset();for(var r=j.words,e=0;e<q;e++)i[e]^=r[e]}g.concat(h);
|
||||
p[0]++}g.sigBytes=4*m;return g}});b.PBKDF2=function(a,b,c){return k.create(c).compute(a,b)}})();
|
|
@ -1,131 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Base = C_lib.Base;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var C_algo = C.algo;
|
||||
var SHA1 = C_algo.SHA1;
|
||||
var HMAC = C_algo.HMAC;
|
||||
|
||||
/**
|
||||
* Password-Based Key Derivation Function 2 algorithm.
|
||||
*/
|
||||
var PBKDF2 = C_algo.PBKDF2 = Base.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
||||
* @property {Hasher} hasher The hasher to use. Default: CryptoJS.algo.SHA1
|
||||
* @property {number} iterations The number of iterations to perform. Default: 1
|
||||
*/
|
||||
cfg: Base.extend({
|
||||
keySize: 128/32,
|
||||
hasher: SHA1,
|
||||
iterations: 1
|
||||
}),
|
||||
|
||||
/**
|
||||
* Initializes a newly created key derivation function.
|
||||
*
|
||||
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var kdf = CryptoJS.algo.PBKDF2.create();
|
||||
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
|
||||
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
|
||||
*/
|
||||
init: function (cfg) {
|
||||
this.cfg = this.cfg.extend(cfg);
|
||||
},
|
||||
|
||||
/**
|
||||
* Computes the Password-Based Key Derivation Function 2.
|
||||
*
|
||||
* @param {WordArray|string} password The password.
|
||||
* @param {WordArray|string} salt A salt.
|
||||
*
|
||||
* @return {WordArray} The derived key.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var key = kdf.compute(password, salt);
|
||||
*/
|
||||
compute: function (password, salt) {
|
||||
// Shortcut
|
||||
var cfg = this.cfg;
|
||||
|
||||
// Init HMAC
|
||||
var hmac = HMAC.create(cfg.hasher, password);
|
||||
|
||||
// Initial values
|
||||
var derivedKey = WordArray.create();
|
||||
var blockIndex = WordArray.create([0x00000001]);
|
||||
|
||||
// Shortcuts
|
||||
var derivedKeyWords = derivedKey.words;
|
||||
var blockIndexWords = blockIndex.words;
|
||||
var keySize = cfg.keySize;
|
||||
var iterations = cfg.iterations;
|
||||
|
||||
// Generate key
|
||||
while (derivedKeyWords.length < keySize) {
|
||||
var block = hmac.update(salt).finalize(blockIndex);
|
||||
hmac.reset();
|
||||
|
||||
// Shortcuts
|
||||
var blockWords = block.words;
|
||||
var blockWordsLength = blockWords.length;
|
||||
|
||||
// Iterations
|
||||
var intermediate = block;
|
||||
for (var i = 1; i < iterations; i++) {
|
||||
intermediate = hmac.finalize(intermediate);
|
||||
hmac.reset();
|
||||
|
||||
// Shortcut
|
||||
var intermediateWords = intermediate.words;
|
||||
|
||||
// XOR intermediate with block
|
||||
for (var j = 0; j < blockWordsLength; j++) {
|
||||
blockWords[j] ^= intermediateWords[j];
|
||||
}
|
||||
}
|
||||
|
||||
derivedKey.concat(block);
|
||||
blockIndexWords[0]++;
|
||||
}
|
||||
derivedKey.sigBytes = keySize * 4;
|
||||
|
||||
return derivedKey;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Computes the Password-Based Key Derivation Function 2.
|
||||
*
|
||||
* @param {WordArray|string} password The password.
|
||||
* @param {WordArray|string} salt A salt.
|
||||
* @param {Object} cfg (Optional) The configuration options to use for this computation.
|
||||
*
|
||||
* @return {WordArray} The derived key.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var key = CryptoJS.PBKDF2(password, salt);
|
||||
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
|
||||
* var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
|
||||
*/
|
||||
C.PBKDF2 = function (password, salt, cfg) {
|
||||
return PBKDF2.create(cfg).compute(password, salt);
|
||||
};
|
||||
}());
|
|
@ -1,10 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){function k(){var c=this._X,b=this._C;b[0]=b[0]+1295307597+this._b|0;b[1]=b[1]+3545052371+(1295307597>b[0]>>>0?1:0)|0;b[2]=b[2]+886263092+(3545052371>b[1]>>>0?1:0)|0;b[3]=b[3]+1295307597+(886263092>b[2]>>>0?1:0)|0;b[4]=b[4]+3545052371+(1295307597>b[3]>>>0?1:0)|0;b[5]=b[5]+886263092+(3545052371>b[4]>>>0?1:0)|0;b[6]=b[6]+1295307597+(886263092>b[5]>>>0?1:0)|0;b[7]=b[7]+3545052371+(1295307597>b[6]>>>0?1:0)|0;this._b=3545052371>b[7]>>>0?1:0;for(var a=0;8>a;a++){var d=c[a]+b[a],e=d&65535,g=d>>>
|
||||
16;h[a]=((e*e>>>17)+e*g>>>15)+g*g^((d&4294901760)*d|0)+((d&65535)*d|0)}var b=h[0],a=h[1],d=h[2],e=h[3],g=h[4],f=h[5],i=h[6],j=h[7];c[0]=b+(j<<16|j>>>16)+(i<<16|i>>>16)|0;c[1]=a+(b<<8|b>>>24)+j|0;c[2]=d+(a<<16|a>>>16)+(b<<16|b>>>16)|0;c[3]=e+(d<<8|d>>>24)+a|0;c[4]=g+(e<<16|e>>>16)+(d<<16|d>>>16)|0;c[5]=f+(g<<8|g>>>24)+e|0;c[6]=i+(f<<16|f>>>16)+(g<<16|g>>>16)|0;c[7]=j+(i<<8|i>>>24)+f|0}var l=CryptoJS,m=l.lib.StreamCipher,f=[],h=[],n=l.algo.Rabbit=m.extend({_doReset:function(){for(var c=this._key.words,
|
||||
b=c[0],a=c[1],d=c[2],e=c[3],c=this._X=[b,e<<16|d>>>16,a,b<<16|e>>>16,d,a<<16|b>>>16,e,d<<16|a>>>16],b=this._C=[d<<16|d>>>16,b&4294901760|a&65535,e<<16|e>>>16,a&4294901760|d&65535,b<<16|b>>>16,d&4294901760|e&65535,a<<16|a>>>16,e&4294901760|b&65535],a=this._b=0;4>a;a++)k.call(this);for(a=0;8>a;a++)b[a]^=c[a+4&7];if(c=this.cfg.iv){a=c.words;c=a[0];a=a[1];c=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360;a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;d=c>>>16|a&4294901760;e=a<<16|c&65535;b[0]^=c;b[1]^=
|
||||
d;b[2]^=a;b[3]^=e;b[4]^=c;b[5]^=d;b[6]^=a;b[7]^=e;for(a=0;4>a;a++)k.call(this)}},_doProcessBlock:function(c,b){var a=this._X;k.call(this);f[0]=a[0]^a[5]>>>16^a[3]<<16;f[1]=a[2]^a[7]>>>16^a[5]<<16;f[2]=a[4]^a[1]>>>16^a[7]<<16;f[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++){var d=f[a],d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;c[b+a]^=d}},blockSize:4,ivSize:2});l.Rabbit=m._createHelper(n)})();
|
|
@ -1,186 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var StreamCipher = C_lib.StreamCipher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Reusable objects
|
||||
var S = [];
|
||||
var G = [];
|
||||
|
||||
/**
|
||||
* Rabbit stream cipher algorithm
|
||||
*/
|
||||
var Rabbit = C_algo.Rabbit = StreamCipher.extend({
|
||||
_doReset: function () {
|
||||
// Shortcuts
|
||||
var K = this._key.words;
|
||||
|
||||
var K0 = K[0];
|
||||
var K1 = K[1];
|
||||
var K2 = K[2];
|
||||
var K3 = K[3];
|
||||
|
||||
// Generate initial state values
|
||||
var X = this._X = [
|
||||
K0, (K3 << 16) | (K2 >>> 16),
|
||||
K1, (K0 << 16) | (K3 >>> 16),
|
||||
K2, (K1 << 16) | (K0 >>> 16),
|
||||
K3, (K2 << 16) | (K1 >>> 16)
|
||||
];
|
||||
|
||||
// Generate initial counter values
|
||||
var C = this._C = [
|
||||
(K2 << 16) | (K2 >>> 16), (K0 & 0xffff0000) | (K1 & 0x0000ffff),
|
||||
(K3 << 16) | (K3 >>> 16), (K1 & 0xffff0000) | (K2 & 0x0000ffff),
|
||||
(K0 << 16) | (K0 >>> 16), (K2 & 0xffff0000) | (K3 & 0x0000ffff),
|
||||
(K1 << 16) | (K1 >>> 16), (K3 & 0xffff0000) | (K0 & 0x0000ffff)
|
||||
];
|
||||
|
||||
// Carry bit
|
||||
this._b = 0;
|
||||
|
||||
// Iterate the system four times
|
||||
for (var i = 0; i < 4; i++) {
|
||||
nextState.call(this);
|
||||
}
|
||||
|
||||
// Modify the counters
|
||||
for (var i = 0; i < 8; i++) {
|
||||
C[i] ^= X[(i + 4) & 7];
|
||||
}
|
||||
|
||||
// Shortcut
|
||||
var iv = this.cfg.iv;
|
||||
|
||||
// IV setup
|
||||
if (iv) {
|
||||
// Shortcuts
|
||||
var IV = iv.words;
|
||||
var IV0 = IV[0];
|
||||
var IV1 = IV[1];
|
||||
|
||||
// Generate four subvectors
|
||||
var i0 = (((IV0 << 8) | (IV0 >>> 24)) & 0x00ff00ff) | (((IV0 << 24) | (IV0 >>> 8)) & 0xff00ff00);
|
||||
var i2 = (((IV1 << 8) | (IV1 >>> 24)) & 0x00ff00ff) | (((IV1 << 24) | (IV1 >>> 8)) & 0xff00ff00);
|
||||
var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
|
||||
var i3 = (i2 << 16) | (i0 & 0x0000ffff);
|
||||
|
||||
// Modify counter values
|
||||
C[0] ^= i0;
|
||||
C[1] ^= i1;
|
||||
C[2] ^= i2;
|
||||
C[3] ^= i3;
|
||||
C[4] ^= i0;
|
||||
C[5] ^= i1;
|
||||
C[6] ^= i2;
|
||||
C[7] ^= i3;
|
||||
|
||||
// Iterate the system four times
|
||||
for (var i = 0; i < 4; i++) {
|
||||
nextState.call(this);
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
// Shortcut
|
||||
var X = this._X;
|
||||
|
||||
// Iterate the system
|
||||
nextState.call(this);
|
||||
|
||||
// Generate four keystream words
|
||||
S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
|
||||
S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
|
||||
S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
|
||||
S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
|
||||
|
||||
for (var i = 0; i < 4; i++) {
|
||||
// Shortcut
|
||||
var Si = S[i];
|
||||
|
||||
// Swap endian
|
||||
Si = (((Si << 8) | (Si >>> 24)) & 0x00ff00ff) |
|
||||
(((Si << 24) | (Si >>> 8)) & 0xff00ff00);
|
||||
|
||||
// Encrypt
|
||||
M[offset + i] ^= Si;
|
||||
}
|
||||
},
|
||||
|
||||
blockSize: 128/32,
|
||||
|
||||
ivSize: 64/32
|
||||
});
|
||||
|
||||
function nextState() {
|
||||
// Shortcuts
|
||||
var X = this._X;
|
||||
var C = this._C;
|
||||
|
||||
// Calculate new counter values
|
||||
C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
|
||||
C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < 0x4d34d34d ? 1 : 0)) | 0;
|
||||
C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < 0xd34d34d3 ? 1 : 0)) | 0;
|
||||
C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < 0x34d34d34 ? 1 : 0)) | 0;
|
||||
C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < 0x4d34d34d ? 1 : 0)) | 0;
|
||||
C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < 0xd34d34d3 ? 1 : 0)) | 0;
|
||||
C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < 0x34d34d34 ? 1 : 0)) | 0;
|
||||
C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < 0x4d34d34d ? 1 : 0)) | 0;
|
||||
this._b = (C[7] >>> 0) < 0xd34d34d3 ? 1 : 0;
|
||||
|
||||
// Calculate the g-values
|
||||
for (var i = 0; i < 8; i++) {
|
||||
var gx = X[i] + C[i];
|
||||
|
||||
// Construct high and low argument for squaring
|
||||
var ga = gx & 0xffff;
|
||||
var gb = gx >>> 16;
|
||||
|
||||
// Calculate high and low result of squaring
|
||||
var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
|
||||
var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
|
||||
|
||||
// High XOR low
|
||||
G[i] = gh ^ gl;
|
||||
}
|
||||
|
||||
// Shortcuts
|
||||
var G0 = G[0];
|
||||
var G1 = G[1];
|
||||
var G2 = G[2];
|
||||
var G3 = G[3];
|
||||
var G4 = G[4];
|
||||
var G5 = G[5];
|
||||
var G6 = G[6];
|
||||
var G7 = G[7];
|
||||
|
||||
// Calculate new state values
|
||||
X[0] = (G0 + ((G7 << 16) | (G7 >>> 16)) + ((G6 << 16) | (G6 >>> 16))) | 0;
|
||||
X[1] = (G1 + ((G0 << 8) | (G0 >>> 24)) + G7) | 0;
|
||||
X[2] = (G2 + ((G1 << 16) | (G1 >>> 16)) + ((G0 << 16) | (G0 >>> 16))) | 0;
|
||||
X[3] = (G3 + ((G2 << 8) | (G2 >>> 24)) + G1) | 0;
|
||||
X[4] = (G4 + ((G3 << 16) | (G3 >>> 16)) + ((G2 << 16) | (G2 >>> 16))) | 0;
|
||||
X[5] = (G5 + ((G4 << 8) | (G4 >>> 24)) + G3) | 0;
|
||||
X[6] = (G6 + ((G5 << 16) | (G5 >>> 16)) + ((G4 << 16) | (G4 >>> 16))) | 0;
|
||||
X[7] = (G7 + ((G6 << 8) | (G6 >>> 24)) + G5) | 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.Rabbit = StreamCipher._createHelper(Rabbit);
|
||||
}());
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){function k(){for(var a=this._S,d=this._i,c=this._j,b=0,e=0;4>e;e++){var d=(d+1)%256,c=(c+a[d])%256,f=a[d];a[d]=a[c];a[c]=f;b|=a[(a[d]+a[c])%256]<<24-8*e}this._i=d;this._j=c;return b}var g=CryptoJS,j=g.lib.StreamCipher,h=g.algo,i=h.RC4=j.extend({_doReset:function(){for(var a=this._key,d=a.words,a=a.sigBytes,c=this._S=[],b=0;256>b;b++)c[b]=b;for(var e=b=0;256>b;b++){var f=b%a,e=(e+c[b]+(d[f>>>2]>>>24-8*(f%4)&255))%256,f=c[b];c[b]=c[e];c[e]=f}this._i=this._j=0},_doProcessBlock:function(a,
|
||||
d){a[d]^=k.call(this)},keySize:8,ivSize:0});g.RC4=j._createHelper(i);h=h.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var a=this.cfg.drop;0<a;a--)k.call(this)}});g.RC4Drop=j._createHelper(h)})();
|
|
@ -1,125 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var StreamCipher = C_lib.StreamCipher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
/**
|
||||
* RC4 stream cipher algorithm.
|
||||
*/
|
||||
var RC4 = C_algo.RC4 = StreamCipher.extend({
|
||||
_doReset: function () {
|
||||
// Shortcuts
|
||||
var key = this._key;
|
||||
var keyWords = key.words;
|
||||
var keySigBytes = key.sigBytes;
|
||||
|
||||
// Init sbox
|
||||
var S = this._S = [];
|
||||
for (var i = 0; i < 256; i++) {
|
||||
S[i] = i;
|
||||
}
|
||||
|
||||
// Key setup
|
||||
for (var i = 0, j = 0; i < 256; i++) {
|
||||
var keyByteIndex = i % keySigBytes;
|
||||
var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
|
||||
|
||||
j = (j + S[i] + keyByte) % 256;
|
||||
|
||||
// Swap
|
||||
var t = S[i];
|
||||
S[i] = S[j];
|
||||
S[j] = t;
|
||||
}
|
||||
|
||||
// Counters
|
||||
this._i = this._j = 0;
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
M[offset] ^= generateKeystreamWord.call(this);
|
||||
},
|
||||
|
||||
keySize: 256/32,
|
||||
|
||||
ivSize: 0
|
||||
});
|
||||
|
||||
function generateKeystreamWord() {
|
||||
// Shortcuts
|
||||
var S = this._S;
|
||||
var i = this._i;
|
||||
var j = this._j;
|
||||
|
||||
// Generate keystream word
|
||||
var keystreamWord = 0;
|
||||
for (var n = 0; n < 4; n++) {
|
||||
i = (i + 1) % 256;
|
||||
j = (j + S[i]) % 256;
|
||||
|
||||
// Swap
|
||||
var t = S[i];
|
||||
S[i] = S[j];
|
||||
S[j] = t;
|
||||
|
||||
keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
|
||||
}
|
||||
|
||||
// Update counters
|
||||
this._i = i;
|
||||
this._j = j;
|
||||
|
||||
return keystreamWord;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.RC4 = StreamCipher._createHelper(RC4);
|
||||
|
||||
/**
|
||||
* RC4-drop stream cipher algorithm.
|
||||
*/
|
||||
var RC4Drop = C_algo.RC4Drop = RC4.extend({
|
||||
/**
|
||||
* Configuration options.
|
||||
*
|
||||
* @property {number} drop The number of keystream words to drop. Default 192
|
||||
*/
|
||||
cfg: RC4.cfg.extend({
|
||||
drop: 192
|
||||
}),
|
||||
|
||||
_doReset: function () {
|
||||
RC4._doReset.call(this);
|
||||
|
||||
// Drop
|
||||
for (var i = this.cfg.drop; i > 0; i--) {
|
||||
generateKeystreamWord.call(this);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.RC4Drop = StreamCipher._createHelper(RC4Drop);
|
||||
}());
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var d=CryptoJS,c=d.lib,l=c.WordArray,c=c.Hasher,j=[],k=d.algo.SHA1=c.extend({_doReset:function(){this._hash=l.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(c,m){for(var a=this._hash.words,e=a[0],f=a[1],h=a[2],i=a[3],d=a[4],b=0;80>b;b++){if(16>b)j[b]=c[m+b]|0;else{var g=j[b-3]^j[b-8]^j[b-14]^j[b-16];j[b]=g<<1|g>>>31}g=(e<<5|e>>>27)+d+j[b];g=20>b?g+((f&h|~f&i)+1518500249):40>b?g+((f^h^i)+1859775393):60>b?g+((f&h|f&i|h&i)-1894007588):g+((f^h^i)-
|
||||
899497514);d=i;i=h;h=f<<30|f>>>2;f=e;e=g}a[0]=a[0]+e|0;a[1]=a[1]+f|0;a[2]=a[2]+h|0;a[3]=a[3]+i|0;a[4]=a[4]+d|0},_doFinalize:function(){var d=this._data,c=d.words,a=8*this._nDataBytes,e=8*d.sigBytes;c[e>>>5]|=128<<24-e%32;c[(e+64>>>9<<4)+15]=a;d.sigBytes=4*c.length;this._process()}});d.SHA1=c._createHelper(k);d.HmacSHA1=c._createHmacHelper(k)})();
|
|
@ -1,121 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var Hasher = C_lib.Hasher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Reusable object
|
||||
var W = [];
|
||||
|
||||
/**
|
||||
* SHA-1 hash algorithm.
|
||||
*/
|
||||
var SHA1 = C_algo.SHA1 = Hasher.extend({
|
||||
_doReset: function () {
|
||||
this._hash = WordArray.create([0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0]);
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
// Shortcut
|
||||
var H = this._hash.words;
|
||||
|
||||
// Working variables
|
||||
var a = H[0];
|
||||
var b = H[1];
|
||||
var c = H[2];
|
||||
var d = H[3];
|
||||
var e = H[4];
|
||||
|
||||
// Computation
|
||||
for (var i = 0; i < 80; i++) {
|
||||
if (i < 16) {
|
||||
W[i] = M[offset + i] | 0;
|
||||
} else {
|
||||
var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
|
||||
W[i] = (n << 1) | (n >>> 31);
|
||||
}
|
||||
|
||||
var t = ((a << 5) | (a >>> 27)) + e + W[i];
|
||||
if (i < 20) {
|
||||
t += ((b & c) | (~b & d)) + 0x5a827999;
|
||||
} else if (i < 40) {
|
||||
t += (b ^ c ^ d) + 0x6ed9eba1;
|
||||
} else if (i < 60) {
|
||||
t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
|
||||
} else /* if (i < 80) */ {
|
||||
t += (b ^ c ^ d) - 0x359d3e2a;
|
||||
}
|
||||
|
||||
e = d;
|
||||
d = c;
|
||||
c = (b << 30) | (b >>> 2);
|
||||
b = a;
|
||||
a = t;
|
||||
}
|
||||
|
||||
// Intermediate hash value
|
||||
H[0] = (H[0] + a) | 0;
|
||||
H[1] = (H[1] + b) | 0;
|
||||
H[2] = (H[2] + c) | 0;
|
||||
H[3] = (H[3] + d) | 0;
|
||||
H[4] = (H[4] + e) | 0;
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
// Shortcuts
|
||||
var data = this._data;
|
||||
var dataWords = data.words;
|
||||
|
||||
var nBitsTotal = this._nDataBytes * 8;
|
||||
var nBitsLeft = data.sigBytes * 8;
|
||||
|
||||
// Add padding
|
||||
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
|
||||
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
|
||||
data.sigBytes = dataWords.length * 4;
|
||||
|
||||
// Hash final blocks
|
||||
this._process();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.SHA1('message');
|
||||
* var hash = CryptoJS.SHA1(wordArray);
|
||||
*/
|
||||
C.SHA1 = Hasher._createHelper(SHA1);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacSHA1(message, key);
|
||||
*/
|
||||
C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var b=CryptoJS,d=b.lib.WordArray,a=b.algo,c=a.SHA256,a=a.SHA224=c.extend({_doReset:function(){this._hash=d.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){c._doFinalize.call(this);this._hash.sigBytes-=4}});b.SHA224=c._createHelper(a);b.HmacSHA224=c._createHmacHelper(a)})();
|
|
@ -1,64 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var C_algo = C.algo;
|
||||
var SHA256 = C_algo.SHA256;
|
||||
|
||||
/**
|
||||
* SHA-224 hash algorithm.
|
||||
*/
|
||||
var SHA224 = C_algo.SHA224 = SHA256.extend({
|
||||
_doReset: function () {
|
||||
this._hash = WordArray.create([
|
||||
0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
|
||||
0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
|
||||
]);
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
SHA256._doFinalize.call(this);
|
||||
|
||||
this._hash.sigBytes -= 4;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.SHA224('message');
|
||||
* var hash = CryptoJS.SHA224(wordArray);
|
||||
*/
|
||||
C.SHA224 = SHA256._createHelper(SHA224);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacSHA224(message, key);
|
||||
*/
|
||||
C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
|
||||
}());
|
|
@ -1,9 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(k){var h=CryptoJS,i=h.lib,r=i.WordArray,i=i.Hasher,c=h.algo,p=[],q=[];(function(){function g(a){for(var b=k.sqrt(a),d=2;d<=b;d++)if(!(a%d))return!1;return!0}function d(a){return 4294967296*(a-(a|0))|0}for(var a=2,b=0;64>b;)g(a)&&(8>b&&(p[b]=d(k.pow(a,0.5))),q[b]=d(k.pow(a,1/3)),b++),a++})();var g=[],c=c.SHA256=i.extend({_doReset:function(){this._hash=r.create(p.slice(0))},_doProcessBlock:function(i,d){for(var a=this._hash.words,b=a[0],m=a[1],n=a[2],h=a[3],f=a[4],c=a[5],o=a[6],k=a[7],e=0;64>
|
||||
e;e++){if(16>e)g[e]=i[d+e]|0;else{var j=g[e-15],l=g[e-2];g[e]=((j<<25|j>>>7)^(j<<14|j>>>18)^j>>>3)+g[e-7]+((l<<15|l>>>17)^(l<<13|l>>>19)^l>>>10)+g[e-16]}j=k+((f<<26|f>>>6)^(f<<21|f>>>11)^(f<<7|f>>>25))+(f&c^~f&o)+q[e]+g[e];l=((b<<30|b>>>2)^(b<<19|b>>>13)^(b<<10|b>>>22))+(b&m^b&n^m&n);k=o;o=c;c=f;f=h+j|0;h=n;n=m;m=b;b=j+l|0}a[0]=a[0]+b|0;a[1]=a[1]+m|0;a[2]=a[2]+n|0;a[3]=a[3]+h|0;a[4]=a[4]+f|0;a[5]=a[5]+c|0;a[6]=a[6]+o|0;a[7]=a[7]+k|0},_doFinalize:function(){var c=this._data,d=c.words,a=8*this._nDataBytes,
|
||||
b=8*c.sigBytes;d[b>>>5]|=128<<24-b%32;d[(b+64>>>9<<4)+15]=a;c.sigBytes=4*d.length;this._process()}});h.SHA256=i._createHelper(c);h.HmacSHA256=i._createHmacHelper(c)})(Math);
|
|
@ -1,174 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function (Math) {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var Hasher = C_lib.Hasher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Initialization and round constants tables
|
||||
var H = [];
|
||||
var K = [];
|
||||
|
||||
// Compute constants
|
||||
(function () {
|
||||
function isPrime(n) {
|
||||
var sqrtN = Math.sqrt(n);
|
||||
for (var factor = 2; factor <= sqrtN; factor++) {
|
||||
if (!(n % factor)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
function getFractionalBits(n) {
|
||||
return ((n - (n | 0)) * 0x100000000) | 0;
|
||||
}
|
||||
|
||||
var n = 2;
|
||||
var nPrime = 0;
|
||||
while (nPrime < 64) {
|
||||
if (isPrime(n)) {
|
||||
if (nPrime < 8) {
|
||||
H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
|
||||
}
|
||||
K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
|
||||
|
||||
nPrime++;
|
||||
}
|
||||
|
||||
n++;
|
||||
}
|
||||
}());
|
||||
|
||||
// Reusable object
|
||||
var W = [];
|
||||
|
||||
/**
|
||||
* SHA-256 hash algorithm.
|
||||
*/
|
||||
var SHA256 = C_algo.SHA256 = Hasher.extend({
|
||||
_doReset: function () {
|
||||
this._hash = WordArray.create(H.slice(0));
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
// Shortcut
|
||||
var H = this._hash.words;
|
||||
|
||||
// Working variables
|
||||
var a = H[0];
|
||||
var b = H[1];
|
||||
var c = H[2];
|
||||
var d = H[3];
|
||||
var e = H[4];
|
||||
var f = H[5];
|
||||
var g = H[6];
|
||||
var h = H[7];
|
||||
|
||||
// Computation
|
||||
for (var i = 0; i < 64; i++) {
|
||||
if (i < 16) {
|
||||
W[i] = M[offset + i] | 0;
|
||||
} else {
|
||||
var gamma0x = W[i - 15];
|
||||
var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
|
||||
((gamma0x << 14) | (gamma0x >>> 18)) ^
|
||||
(gamma0x >>> 3);
|
||||
|
||||
var gamma1x = W[i - 2];
|
||||
var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
|
||||
((gamma1x << 13) | (gamma1x >>> 19)) ^
|
||||
(gamma1x >>> 10);
|
||||
|
||||
W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
|
||||
}
|
||||
|
||||
var ch = (e & f) ^ (~e & g);
|
||||
var maj = (a & b) ^ (a & c) ^ (b & c);
|
||||
|
||||
var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
|
||||
var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
|
||||
|
||||
var t1 = h + sigma1 + ch + K[i] + W[i];
|
||||
var t2 = sigma0 + maj;
|
||||
|
||||
h = g;
|
||||
g = f;
|
||||
f = e;
|
||||
e = (d + t1) | 0;
|
||||
d = c;
|
||||
c = b;
|
||||
b = a;
|
||||
a = (t1 + t2) | 0;
|
||||
}
|
||||
|
||||
// Intermediate hash value
|
||||
H[0] = (H[0] + a) | 0;
|
||||
H[1] = (H[1] + b) | 0;
|
||||
H[2] = (H[2] + c) | 0;
|
||||
H[3] = (H[3] + d) | 0;
|
||||
H[4] = (H[4] + e) | 0;
|
||||
H[5] = (H[5] + f) | 0;
|
||||
H[6] = (H[6] + g) | 0;
|
||||
H[7] = (H[7] + h) | 0;
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
// Shortcuts
|
||||
var data = this._data;
|
||||
var dataWords = data.words;
|
||||
|
||||
var nBitsTotal = this._nDataBytes * 8;
|
||||
var nBitsLeft = data.sigBytes * 8;
|
||||
|
||||
// Add padding
|
||||
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
|
||||
dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
|
||||
data.sigBytes = dataWords.length * 4;
|
||||
|
||||
// Hash final blocks
|
||||
this._process();
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.SHA256('message');
|
||||
* var hash = CryptoJS.SHA256(wordArray);
|
||||
*/
|
||||
C.SHA256 = Hasher._createHelper(SHA256);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacSHA256(message, key);
|
||||
*/
|
||||
C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
|
||||
}(Math));
|
|
@ -1,8 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){var c=CryptoJS,a=c.x64,b=a.Word,e=a.WordArray,a=c.algo,d=a.SHA512,a=a.SHA384=d.extend({_doReset:function(){this._hash=e.create([b.create(3418070365,3238371032),b.create(1654270250,914150663),b.create(2438529370,812702999),b.create(355462360,4144912697),b.create(1731405415,4290775857),b.create(2394180231,1750603025),b.create(3675008525,1694076839),b.create(1203062813,3204075428)])},_doFinalize:function(){d._doFinalize.call(this);this._hash.sigBytes-=16}});c.SHA384=d._createHelper(a);c.HmacSHA384=
|
||||
d._createHmacHelper(a)})();
|
|
@ -1,67 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_x64 = C.x64;
|
||||
var X64Word = C_x64.Word;
|
||||
var X64WordArray = C_x64.WordArray;
|
||||
var C_algo = C.algo;
|
||||
var SHA512 = C_algo.SHA512;
|
||||
|
||||
/**
|
||||
* SHA-384 hash algorithm.
|
||||
*/
|
||||
var SHA384 = C_algo.SHA384 = SHA512.extend({
|
||||
_doReset: function () {
|
||||
this._hash = X64WordArray.create([
|
||||
X64Word.create(0xcbbb9d5d, 0xc1059ed8), X64Word.create(0x629a292a, 0x367cd507),
|
||||
X64Word.create(0x9159015a, 0x3070dd17), X64Word.create(0x152fecd8, 0xf70e5939),
|
||||
X64Word.create(0x67332667, 0xffc00b31), X64Word.create(0x8eb44a87, 0x68581511),
|
||||
X64Word.create(0xdb0c2e0d, 0x64f98fa7), X64Word.create(0x47b5481d, 0xbefa4fa4)
|
||||
]);
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
SHA512._doFinalize.call(this);
|
||||
|
||||
this._hash.sigBytes -= 16;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.SHA384('message');
|
||||
* var hash = CryptoJS.SHA384(wordArray);
|
||||
*/
|
||||
C.SHA384 = SHA512._createHelper(SHA384);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacSHA384(message, key);
|
||||
*/
|
||||
C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
|
||||
}());
|
|
@ -1,15 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){function a(){return v.create.apply(v,arguments)}var d=CryptoJS,r=d.lib.Hasher,e=d.x64,v=e.Word,S=e.WordArray,e=d.algo,da=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),
|
||||
a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,
|
||||
2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),
|
||||
a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,
|
||||
3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],s=[];(function(){for(var T=0;80>T;T++)s[T]=a()})();e=e.SHA512=r.extend({_doReset:function(){this._hash=S.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,e){for(var f=this._hash.words,C=f[0],d=f[1],D=f[2],E=f[3],F=f[4],G=f[5],H=
|
||||
f[6],f=f[7],r=C.high,I=C.low,v=d.high,J=d.low,X=D.high,K=D.low,Y=E.high,L=E.low,Z=F.high,M=F.low,$=G.high,N=G.low,aa=H.high,O=H.low,ba=f.high,P=f.low,j=r,g=I,w=v,t=J,x=X,u=K,U=Y,y=L,k=Z,h=M,Q=$,z=N,R=aa,A=O,V=ba,B=P,l=0;80>l;l++){var o=s[l];if(16>l)var i=o.high=a[e+2*l]|0,b=o.low=a[e+2*l+1]|0;else{var i=s[l-15],b=i.high,m=i.low,i=(m<<31|b>>>1)^(m<<24|b>>>8)^b>>>7,m=(b<<31|m>>>1)^(b<<24|m>>>8)^(b<<25|m>>>7),q=s[l-2],b=q.high,c=q.low,q=(c<<13|b>>>19)^(b<<3|c>>>29)^b>>>6,c=(b<<13|c>>>19)^(c<<3|b>>>29)^
|
||||
(b<<26|c>>>6),b=s[l-7],W=b.high,p=s[l-16],n=p.high,p=p.low,b=m+b.low,i=i+W+(b>>>0<m>>>0?1:0),b=b+c,i=i+q+(b>>>0<c>>>0?1:0),b=b+p,i=i+n+(b>>>0<p>>>0?1:0);o.high=i;o.low=b}var W=k&Q^~k&R,p=h&z^~h&A,o=j&w^j&x^w&x,S=g&t^g&u^t&u,m=(g<<4|j>>>28)^(j<<30|g>>>2)^(j<<25|g>>>7),q=(j<<4|g>>>28)^(g<<30|j>>>2)^(g<<25|j>>>7),c=da[l],ea=c.high,ca=c.low,c=B+((k<<18|h>>>14)^(k<<14|h>>>18)^(h<<23|k>>>9)),n=V+((h<<18|k>>>14)^(h<<14|k>>>18)^(k<<23|h>>>9))+(c>>>0<B>>>0?1:0),c=c+p,n=n+W+(c>>>0<p>>>0?1:0),c=c+ca,n=n+ea+
|
||||
(c>>>0<ca>>>0?1:0),c=c+b,n=n+i+(c>>>0<b>>>0?1:0),b=q+S,o=m+o+(b>>>0<q>>>0?1:0),V=R,B=A,R=Q,A=z,Q=k,z=h,h=y+c|0,k=U+n+(h>>>0<y>>>0?1:0)|0,U=x,y=u,x=w,u=t,w=j,t=g,g=c+b|0,j=n+o+(g>>>0<c>>>0?1:0)|0}I=C.low=I+g|0;C.high=r+j+(I>>>0<g>>>0?1:0)|0;J=d.low=J+t|0;d.high=v+w+(J>>>0<t>>>0?1:0)|0;K=D.low=K+u|0;D.high=X+x+(K>>>0<u>>>0?1:0)|0;L=E.low=L+y|0;E.high=Y+U+(L>>>0<y>>>0?1:0)|0;M=F.low=M+h|0;F.high=Z+k+(M>>>0<h>>>0?1:0)|0;N=G.low=N+z|0;G.high=$+Q+(N>>>0<z>>>0?1:0)|0;O=H.low=O+A|0;H.high=aa+R+(O>>>0<A>>>
|
||||
0?1:0)|0;P=f.low=P+B|0;f.high=ba+V+(P>>>0<B>>>0?1:0)|0},_doFinalize:function(){var a=this._data,d=a.words,f=8*this._nDataBytes,e=8*a.sigBytes;d[e>>>5]|=128<<24-e%32;d[(e+128>>>10<<5)+31]=f;a.sigBytes=4*d.length;this._process();this._hash=this._hash.toX32()},blockSize:32});d.SHA512=r._createHelper(e);d.HmacSHA512=r._createHmacHelper(e)})();
|
|
@ -1,306 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Hasher = C_lib.Hasher;
|
||||
var C_x64 = C.x64;
|
||||
var X64Word = C_x64.Word;
|
||||
var X64WordArray = C_x64.WordArray;
|
||||
var C_algo = C.algo;
|
||||
|
||||
function X64Word_create() {
|
||||
return X64Word.create.apply(X64Word, arguments);
|
||||
}
|
||||
|
||||
// Constants
|
||||
var K = [
|
||||
X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
|
||||
X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
|
||||
X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
|
||||
X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
|
||||
X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
|
||||
X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
|
||||
X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
|
||||
X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
|
||||
X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
|
||||
X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
|
||||
X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
|
||||
X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
|
||||
X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
|
||||
X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
|
||||
X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
|
||||
X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
|
||||
X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
|
||||
X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
|
||||
X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
|
||||
X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
|
||||
X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
|
||||
X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
|
||||
X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
|
||||
X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
|
||||
X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
|
||||
X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
|
||||
X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
|
||||
X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
|
||||
X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
|
||||
X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
|
||||
X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
|
||||
X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
|
||||
X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
|
||||
X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
|
||||
X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
|
||||
X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
|
||||
X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
|
||||
X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
|
||||
X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
|
||||
X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
|
||||
];
|
||||
|
||||
// Reusable objects
|
||||
var W = [];
|
||||
(function () {
|
||||
for (var i = 0; i < 80; i++) {
|
||||
W[i] = X64Word_create();
|
||||
}
|
||||
}());
|
||||
|
||||
/**
|
||||
* SHA-512 hash algorithm.
|
||||
*/
|
||||
var SHA512 = C_algo.SHA512 = Hasher.extend({
|
||||
_doReset: function () {
|
||||
this._hash = X64WordArray.create([
|
||||
X64Word_create(0x6a09e667, 0xf3bcc908), X64Word_create(0xbb67ae85, 0x84caa73b),
|
||||
X64Word_create(0x3c6ef372, 0xfe94f82b), X64Word_create(0xa54ff53a, 0x5f1d36f1),
|
||||
X64Word_create(0x510e527f, 0xade682d1), X64Word_create(0x9b05688c, 0x2b3e6c1f),
|
||||
X64Word_create(0x1f83d9ab, 0xfb41bd6b), X64Word_create(0x5be0cd19, 0x137e2179)
|
||||
]);
|
||||
},
|
||||
|
||||
_doProcessBlock: function (M, offset) {
|
||||
// Shortcuts
|
||||
var H = this._hash.words;
|
||||
|
||||
var H0 = H[0];
|
||||
var H1 = H[1];
|
||||
var H2 = H[2];
|
||||
var H3 = H[3];
|
||||
var H4 = H[4];
|
||||
var H5 = H[5];
|
||||
var H6 = H[6];
|
||||
var H7 = H[7];
|
||||
|
||||
var H0h = H0.high;
|
||||
var H0l = H0.low;
|
||||
var H1h = H1.high;
|
||||
var H1l = H1.low;
|
||||
var H2h = H2.high;
|
||||
var H2l = H2.low;
|
||||
var H3h = H3.high;
|
||||
var H3l = H3.low;
|
||||
var H4h = H4.high;
|
||||
var H4l = H4.low;
|
||||
var H5h = H5.high;
|
||||
var H5l = H5.low;
|
||||
var H6h = H6.high;
|
||||
var H6l = H6.low;
|
||||
var H7h = H7.high;
|
||||
var H7l = H7.low;
|
||||
|
||||
// Working variables
|
||||
var ah = H0h;
|
||||
var al = H0l;
|
||||
var bh = H1h;
|
||||
var bl = H1l;
|
||||
var ch = H2h;
|
||||
var cl = H2l;
|
||||
var dh = H3h;
|
||||
var dl = H3l;
|
||||
var eh = H4h;
|
||||
var el = H4l;
|
||||
var fh = H5h;
|
||||
var fl = H5l;
|
||||
var gh = H6h;
|
||||
var gl = H6l;
|
||||
var hh = H7h;
|
||||
var hl = H7l;
|
||||
|
||||
// Rounds
|
||||
for (var i = 0; i < 80; i++) {
|
||||
// Shortcut
|
||||
var Wi = W[i];
|
||||
|
||||
// Extend message
|
||||
if (i < 16) {
|
||||
var Wih = Wi.high = M[offset + i * 2] | 0;
|
||||
var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
|
||||
} else {
|
||||
// Gamma0
|
||||
var gamma0x = W[i - 15];
|
||||
var gamma0xh = gamma0x.high;
|
||||
var gamma0xl = gamma0x.low;
|
||||
var gamma0h = ((gamma0xl << 31) | (gamma0xh >>> 1)) ^ ((gamma0xl << 24) | (gamma0xh >>> 8)) ^ (gamma0xh >>> 7);
|
||||
var gamma0l = ((gamma0xh << 31) | (gamma0xl >>> 1)) ^ ((gamma0xh << 24) | (gamma0xl >>> 8)) ^ ((gamma0xh << 25) | (gamma0xl >>> 7));
|
||||
|
||||
// Gamma1
|
||||
var gamma1x = W[i - 2];
|
||||
var gamma1xh = gamma1x.high;
|
||||
var gamma1xl = gamma1x.low;
|
||||
var gamma1h = ((gamma1xl << 13) | (gamma1xh >>> 19)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
|
||||
var gamma1l = ((gamma1xh << 13) | (gamma1xl >>> 19)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xh << 26) | (gamma1xl >>> 6));
|
||||
|
||||
// Shortcuts
|
||||
var Wi7 = W[i - 7];
|
||||
var Wi7h = Wi7.high;
|
||||
var Wi7l = Wi7.low;
|
||||
|
||||
var Wi16 = W[i - 16];
|
||||
var Wi16h = Wi16.high;
|
||||
var Wi16l = Wi16.low;
|
||||
|
||||
// W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
|
||||
var Wil = gamma0l + Wi7l;
|
||||
var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
|
||||
var Wil = Wil + gamma1l;
|
||||
var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
|
||||
var Wil = Wil + Wi16l;
|
||||
var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
|
||||
|
||||
Wi.high = Wih;
|
||||
Wi.low = Wil;
|
||||
}
|
||||
|
||||
// Ch
|
||||
var chh = (eh & fh) ^ (~eh & gh);
|
||||
var chl = (el & fl) ^ (~el & gl);
|
||||
|
||||
// Maj
|
||||
var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
|
||||
var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
|
||||
|
||||
// Sigma0
|
||||
var sigma0h = ((al << 4) | (ah >>> 28)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
|
||||
var sigma0l = ((ah << 4) | (al >>> 28)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
|
||||
|
||||
// Sigma1
|
||||
var sigma1h = ((el << 18) | (eh >>> 14)) ^ ((el << 14) | (eh >>> 18)) ^ ((eh << 23) | (el >>> 9));
|
||||
var sigma1l = ((eh << 18) | (el >>> 14)) ^ ((eh << 14) | (el >>> 18)) ^ ((el << 23) | (eh >>> 9));
|
||||
|
||||
// Shortcuts
|
||||
var Ki = K[i];
|
||||
var Kih = Ki.high;
|
||||
var Kil = Ki.low;
|
||||
|
||||
// t1 = h + sigma1 + ch + K[i] + W[i]
|
||||
var t1l = hl + sigma1l;
|
||||
var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
|
||||
var t1l = t1l + chl;
|
||||
var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
|
||||
var t1l = t1l + Kil;
|
||||
var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
|
||||
var t1l = t1l + Wil;
|
||||
var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
|
||||
|
||||
// t2 = sigma0 + maj
|
||||
var t2l = sigma0l + majl;
|
||||
var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
|
||||
|
||||
// Update working variables
|
||||
hh = gh;
|
||||
hl = gl;
|
||||
gh = fh;
|
||||
gl = fl;
|
||||
fh = eh;
|
||||
fl = el;
|
||||
el = (dl + t1l) | 0;
|
||||
eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
|
||||
dh = ch;
|
||||
dl = cl;
|
||||
ch = bh;
|
||||
cl = bl;
|
||||
bh = ah;
|
||||
bl = al;
|
||||
al = (t1l + t2l) | 0;
|
||||
ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
|
||||
}
|
||||
|
||||
// Intermediate hash value
|
||||
H0l = H0.low = (H0l + al) | 0;
|
||||
H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0)) | 0;
|
||||
H1l = H1.low = (H1l + bl) | 0;
|
||||
H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0)) | 0;
|
||||
H2l = H2.low = (H2l + cl) | 0;
|
||||
H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0)) | 0;
|
||||
H3l = H3.low = (H3l + dl) | 0;
|
||||
H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
|
||||
H4l = H4.low = (H4l + el) | 0;
|
||||
H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0)) | 0;
|
||||
H5l = H5.low = (H5l + fl) | 0;
|
||||
H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0)) | 0;
|
||||
H6l = H6.low = (H6l + gl) | 0;
|
||||
H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0)) | 0;
|
||||
H7l = H7.low = (H7l + hl) | 0;
|
||||
H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0)) | 0;
|
||||
},
|
||||
|
||||
_doFinalize: function () {
|
||||
// Shortcuts
|
||||
var data = this._data;
|
||||
var dataWords = data.words;
|
||||
|
||||
var nBitsTotal = this._nDataBytes * 8;
|
||||
var nBitsLeft = data.sigBytes * 8;
|
||||
|
||||
// Add padding
|
||||
dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
|
||||
dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
|
||||
data.sigBytes = dataWords.length * 4;
|
||||
|
||||
// Hash final blocks
|
||||
this._process();
|
||||
|
||||
// Convert hash to 32-bit word array before returning
|
||||
this._hash = this._hash.toX32();
|
||||
},
|
||||
|
||||
blockSize: 1024/32
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut function to the hasher's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
*
|
||||
* @return {WordArray} The hash.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hash = CryptoJS.SHA512('message');
|
||||
* var hash = CryptoJS.SHA512(wordArray);
|
||||
*/
|
||||
C.SHA512 = Hasher._createHelper(SHA512);
|
||||
|
||||
/**
|
||||
* Shortcut function to the HMAC's object interface.
|
||||
*
|
||||
* @param {WordArray|string} message The message to hash.
|
||||
* @param {WordArray|string} key The secret key.
|
||||
*
|
||||
* @return {WordArray} The HMAC.
|
||||
*
|
||||
* @static
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var hmac = CryptoJS.HmacSHA512(message, key);
|
||||
*/
|
||||
C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
|
||||
}());
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(){function i(b,c){var a=(this._lBlock>>>b^this._rBlock)&c;this._rBlock^=a;this._lBlock^=a<<b}function k(b,c){var a=(this._rBlock>>>b^this._lBlock)&c;this._lBlock^=a;this._rBlock^=a<<b}var h=CryptoJS,e=h.lib,m=e.WordArray,e=e.BlockCipher,g=h.algo,o=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],n=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,
|
||||
55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],p=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],q=[{"0":8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,
|
||||
2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,
|
||||
1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{"0":1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,
|
||||
75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,
|
||||
276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{"0":260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,
|
||||
14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,
|
||||
17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{"0":2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,
|
||||
98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,
|
||||
1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{"0":128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,
|
||||
10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,
|
||||
83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{"0":268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,
|
||||
2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{"0":1048576,
|
||||
16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,
|
||||
496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{"0":134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,
|
||||
2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,
|
||||
2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],r=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=g.DES=e.extend({_doReset:function(){for(var b=this._key.words,c=[],a=0;56>a;a++){var f=o[a]-1;c[a]=b[f>>>5]>>>31-f%32&1}b=this._subKeys=[];for(f=0;16>f;f++){for(var d=b[f]=[],e=p[f],a=0;24>a;a++)d[a/6|0]|=c[(n[a]-1+e)%28]<<31-a%6,d[4+(a/6|0)]|=c[28+(n[a+24]-1+e)%28]<<31-a%6;d[0]=d[0]<<1|d[0]>>>31;for(a=1;7>a;a++)d[a]>>>=
|
||||
4*(a-1)+3;d[7]=d[7]<<5|d[7]>>>27}c=this._invSubKeys=[];for(a=0;16>a;a++)c[a]=b[15-a]},encryptBlock:function(b,c){this._doCryptBlock(b,c,this._subKeys)},decryptBlock:function(b,c){this._doCryptBlock(b,c,this._invSubKeys)},_doCryptBlock:function(b,c,a){this._lBlock=b[c];this._rBlock=b[c+1];i.call(this,4,252645135);i.call(this,16,65535);k.call(this,2,858993459);k.call(this,8,16711935);i.call(this,1,1431655765);for(var f=0;16>f;f++){for(var d=a[f],e=this._lBlock,h=this._rBlock,g=0,j=0;8>j;j++)g|=q[j][((h^
|
||||
d[j])&r[j])>>>0];this._lBlock=h;this._rBlock=e^g}a=this._lBlock;this._lBlock=this._rBlock;this._rBlock=a;i.call(this,1,1431655765);k.call(this,8,16711935);k.call(this,2,858993459);i.call(this,16,65535);i.call(this,4,252645135);b[c]=this._lBlock;b[c+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});h.DES=e._createHelper(l);g=g.TripleDES=e.extend({_doReset:function(){var b=this._key.words;this._des1=l.createEncryptor(m.create(b.slice(0,2)));this._des2=l.createEncryptor(m.create(b.slice(2,4)));this._des3=
|
||||
l.createEncryptor(m.create(b.slice(4,6)))},encryptBlock:function(b,c){this._des1.encryptBlock(b,c);this._des2.decryptBlock(b,c);this._des3.encryptBlock(b,c)},decryptBlock:function(b,c){this._des3.decryptBlock(b,c);this._des2.encryptBlock(b,c);this._des1.decryptBlock(b,c)},keySize:6,ivSize:2,blockSize:2});h.TripleDES=e._createHelper(g)})();
|
|
@ -1,372 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function () {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var WordArray = C_lib.WordArray;
|
||||
var BlockCipher = C_lib.BlockCipher;
|
||||
var C_algo = C.algo;
|
||||
|
||||
// Permuted Choice 1 constants
|
||||
var PC1 = [
|
||||
57, 49, 41, 33, 25, 17, 9, 1,
|
||||
58, 50, 42, 34, 26, 18, 10, 2,
|
||||
59, 51, 43, 35, 27, 19, 11, 3,
|
||||
60, 52, 44, 36, 63, 55, 47, 39,
|
||||
31, 23, 15, 7, 62, 54, 46, 38,
|
||||
30, 22, 14, 6, 61, 53, 45, 37,
|
||||
29, 21, 13, 5, 28, 20, 12, 4
|
||||
];
|
||||
|
||||
// Permuted Choice 2 constants
|
||||
var PC2 = [
|
||||
14, 17, 11, 24, 1, 5,
|
||||
3, 28, 15, 6, 21, 10,
|
||||
23, 19, 12, 4, 26, 8,
|
||||
16, 7, 27, 20, 13, 2,
|
||||
41, 52, 31, 37, 47, 55,
|
||||
30, 40, 51, 45, 33, 48,
|
||||
44, 49, 39, 56, 34, 53,
|
||||
46, 42, 50, 36, 29, 32
|
||||
];
|
||||
|
||||
// Cumulative bit shift constants
|
||||
var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
|
||||
|
||||
// SBOXes and precomputed round permutation constants
|
||||
var SBOX_P = [
|
||||
{
|
||||
0x00000000: 0x00808200, 0x10000000: 0x00008000, 0x20000000: 0x00808002, 0x30000000: 0x00000002,
|
||||
0x40000000: 0x00000200, 0x50000000: 0x00808202, 0x60000000: 0x00800202, 0x70000000: 0x00800000,
|
||||
0x80000000: 0x00000202, 0x90000000: 0x00800200, 0xa0000000: 0x00008200, 0xb0000000: 0x00808000,
|
||||
0xc0000000: 0x00008002, 0xd0000000: 0x00800002, 0xe0000000: 0x00000000, 0xf0000000: 0x00008202,
|
||||
0x08000000: 0x00000000, 0x18000000: 0x00808202, 0x28000000: 0x00008202, 0x38000000: 0x00008000,
|
||||
0x48000000: 0x00808200, 0x58000000: 0x00000200, 0x68000000: 0x00808002, 0x78000000: 0x00000002,
|
||||
0x88000000: 0x00800200, 0x98000000: 0x00008200, 0xa8000000: 0x00808000, 0xb8000000: 0x00800202,
|
||||
0xc8000000: 0x00800002, 0xd8000000: 0x00008002, 0xe8000000: 0x00000202, 0xf8000000: 0x00800000,
|
||||
0x00000001: 0x00008000, 0x10000001: 0x00000002, 0x20000001: 0x00808200, 0x30000001: 0x00800000,
|
||||
0x40000001: 0x00808002, 0x50000001: 0x00008200, 0x60000001: 0x00000200, 0x70000001: 0x00800202,
|
||||
0x80000001: 0x00808202, 0x90000001: 0x00808000, 0xa0000001: 0x00800002, 0xb0000001: 0x00008202,
|
||||
0xc0000001: 0x00000202, 0xd0000001: 0x00800200, 0xe0000001: 0x00008002, 0xf0000001: 0x00000000,
|
||||
0x08000001: 0x00808202, 0x18000001: 0x00808000, 0x28000001: 0x00800000, 0x38000001: 0x00000200,
|
||||
0x48000001: 0x00008000, 0x58000001: 0x00800002, 0x68000001: 0x00000002, 0x78000001: 0x00008202,
|
||||
0x88000001: 0x00008002, 0x98000001: 0x00800202, 0xa8000001: 0x00000202, 0xb8000001: 0x00808200,
|
||||
0xc8000001: 0x00800200, 0xd8000001: 0x00000000, 0xe8000001: 0x00008200, 0xf8000001: 0x00808002
|
||||
},
|
||||
{
|
||||
0x00000000: 0x40084010, 0x01000000: 0x00004000, 0x02000000: 0x00080000, 0x03000000: 0x40080010,
|
||||
0x04000000: 0x40000010, 0x05000000: 0x40084000, 0x06000000: 0x40004000, 0x07000000: 0x00000010,
|
||||
0x08000000: 0x00084000, 0x09000000: 0x40004010, 0x0a000000: 0x40000000, 0x0b000000: 0x00084010,
|
||||
0x0c000000: 0x00080010, 0x0d000000: 0x00000000, 0x0e000000: 0x00004010, 0x0f000000: 0x40080000,
|
||||
0x00800000: 0x40004000, 0x01800000: 0x00084010, 0x02800000: 0x00000010, 0x03800000: 0x40004010,
|
||||
0x04800000: 0x40084010, 0x05800000: 0x40000000, 0x06800000: 0x00080000, 0x07800000: 0x40080010,
|
||||
0x08800000: 0x00080010, 0x09800000: 0x00000000, 0x0a800000: 0x00004000, 0x0b800000: 0x40080000,
|
||||
0x0c800000: 0x40000010, 0x0d800000: 0x00084000, 0x0e800000: 0x40084000, 0x0f800000: 0x00004010,
|
||||
0x10000000: 0x00000000, 0x11000000: 0x40080010, 0x12000000: 0x40004010, 0x13000000: 0x40084000,
|
||||
0x14000000: 0x40080000, 0x15000000: 0x00000010, 0x16000000: 0x00084010, 0x17000000: 0x00004000,
|
||||
0x18000000: 0x00004010, 0x19000000: 0x00080000, 0x1a000000: 0x00080010, 0x1b000000: 0x40000010,
|
||||
0x1c000000: 0x00084000, 0x1d000000: 0x40004000, 0x1e000000: 0x40000000, 0x1f000000: 0x40084010,
|
||||
0x10800000: 0x00084010, 0x11800000: 0x00080000, 0x12800000: 0x40080000, 0x13800000: 0x00004000,
|
||||
0x14800000: 0x40004000, 0x15800000: 0x40084010, 0x16800000: 0x00000010, 0x17800000: 0x40000000,
|
||||
0x18800000: 0x40084000, 0x19800000: 0x40000010, 0x1a800000: 0x40004010, 0x1b800000: 0x00080010,
|
||||
0x1c800000: 0x00000000, 0x1d800000: 0x00004010, 0x1e800000: 0x40080010, 0x1f800000: 0x00084000
|
||||
},
|
||||
{
|
||||
0x00000000: 0x00000104, 0x00100000: 0x00000000, 0x00200000: 0x04000100, 0x00300000: 0x00010104,
|
||||
0x00400000: 0x00010004, 0x00500000: 0x04000004, 0x00600000: 0x04010104, 0x00700000: 0x04010000,
|
||||
0x00800000: 0x04000000, 0x00900000: 0x04010100, 0x00a00000: 0x00010100, 0x00b00000: 0x04010004,
|
||||
0x00c00000: 0x04000104, 0x00d00000: 0x00010000, 0x00e00000: 0x00000004, 0x00f00000: 0x00000100,
|
||||
0x00080000: 0x04010100, 0x00180000: 0x04010004, 0x00280000: 0x00000000, 0x00380000: 0x04000100,
|
||||
0x00480000: 0x04000004, 0x00580000: 0x00010000, 0x00680000: 0x00010004, 0x00780000: 0x00000104,
|
||||
0x00880000: 0x00000004, 0x00980000: 0x00000100, 0x00a80000: 0x04010000, 0x00b80000: 0x00010104,
|
||||
0x00c80000: 0x00010100, 0x00d80000: 0x04000104, 0x00e80000: 0x04010104, 0x00f80000: 0x04000000,
|
||||
0x01000000: 0x04010100, 0x01100000: 0x00010004, 0x01200000: 0x00010000, 0x01300000: 0x04000100,
|
||||
0x01400000: 0x00000100, 0x01500000: 0x04010104, 0x01600000: 0x04000004, 0x01700000: 0x00000000,
|
||||
0x01800000: 0x04000104, 0x01900000: 0x04000000, 0x01a00000: 0x00000004, 0x01b00000: 0x00010100,
|
||||
0x01c00000: 0x04010000, 0x01d00000: 0x00000104, 0x01e00000: 0x00010104, 0x01f00000: 0x04010004,
|
||||
0x01080000: 0x04000000, 0x01180000: 0x00000104, 0x01280000: 0x04010100, 0x01380000: 0x00000000,
|
||||
0x01480000: 0x00010004, 0x01580000: 0x04000100, 0x01680000: 0x00000100, 0x01780000: 0x04010004,
|
||||
0x01880000: 0x00010000, 0x01980000: 0x04010104, 0x01a80000: 0x00010104, 0x01b80000: 0x04000004,
|
||||
0x01c80000: 0x04000104, 0x01d80000: 0x04010000, 0x01e80000: 0x00000004, 0x01f80000: 0x00010100
|
||||
},
|
||||
{
|
||||
0x00000000: 0x80401000, 0x00010000: 0x80001040, 0x00020000: 0x00401040, 0x00030000: 0x80400000,
|
||||
0x00040000: 0x00000000, 0x00050000: 0x00401000, 0x00060000: 0x80000040, 0x00070000: 0x00400040,
|
||||
0x00080000: 0x80000000, 0x00090000: 0x00400000, 0x000a0000: 0x00000040, 0x000b0000: 0x80001000,
|
||||
0x000c0000: 0x80400040, 0x000d0000: 0x00001040, 0x000e0000: 0x00001000, 0x000f0000: 0x80401040,
|
||||
0x00008000: 0x80001040, 0x00018000: 0x00000040, 0x00028000: 0x80400040, 0x00038000: 0x80001000,
|
||||
0x00048000: 0x00401000, 0x00058000: 0x80401040, 0x00068000: 0x00000000, 0x00078000: 0x80400000,
|
||||
0x00088000: 0x00001000, 0x00098000: 0x80401000, 0x000a8000: 0x00400000, 0x000b8000: 0x00001040,
|
||||
0x000c8000: 0x80000000, 0x000d8000: 0x00400040, 0x000e8000: 0x00401040, 0x000f8000: 0x80000040,
|
||||
0x00100000: 0x00400040, 0x00110000: 0x00401000, 0x00120000: 0x80000040, 0x00130000: 0x00000000,
|
||||
0x00140000: 0x00001040, 0x00150000: 0x80400040, 0x00160000: 0x80401000, 0x00170000: 0x80001040,
|
||||
0x00180000: 0x80401040, 0x00190000: 0x80000000, 0x001a0000: 0x80400000, 0x001b0000: 0x00401040,
|
||||
0x001c0000: 0x80001000, 0x001d0000: 0x00400000, 0x001e0000: 0x00000040, 0x001f0000: 0x00001000,
|
||||
0x00108000: 0x80400000, 0x00118000: 0x80401040, 0x00128000: 0x00000000, 0x00138000: 0x00401000,
|
||||
0x00148000: 0x00400040, 0x00158000: 0x80000000, 0x00168000: 0x80001040, 0x00178000: 0x00000040,
|
||||
0x00188000: 0x80000040, 0x00198000: 0x00001000, 0x001a8000: 0x80001000, 0x001b8000: 0x80400040,
|
||||
0x001c8000: 0x00001040, 0x001d8000: 0x80401000, 0x001e8000: 0x00400000, 0x001f8000: 0x00401040
|
||||
},
|
||||
{
|
||||
0x00000000: 0x00000080, 0x00001000: 0x01040000, 0x00002000: 0x00040000, 0x00003000: 0x20000000,
|
||||
0x00004000: 0x20040080, 0x00005000: 0x01000080, 0x00006000: 0x21000080, 0x00007000: 0x00040080,
|
||||
0x00008000: 0x01000000, 0x00009000: 0x20040000, 0x0000a000: 0x20000080, 0x0000b000: 0x21040080,
|
||||
0x0000c000: 0x21040000, 0x0000d000: 0x00000000, 0x0000e000: 0x01040080, 0x0000f000: 0x21000000,
|
||||
0x00000800: 0x01040080, 0x00001800: 0x21000080, 0x00002800: 0x00000080, 0x00003800: 0x01040000,
|
||||
0x00004800: 0x00040000, 0x00005800: 0x20040080, 0x00006800: 0x21040000, 0x00007800: 0x20000000,
|
||||
0x00008800: 0x20040000, 0x00009800: 0x00000000, 0x0000a800: 0x21040080, 0x0000b800: 0x01000080,
|
||||
0x0000c800: 0x20000080, 0x0000d800: 0x21000000, 0x0000e800: 0x01000000, 0x0000f800: 0x00040080,
|
||||
0x00010000: 0x00040000, 0x00011000: 0x00000080, 0x00012000: 0x20000000, 0x00013000: 0x21000080,
|
||||
0x00014000: 0x01000080, 0x00015000: 0x21040000, 0x00016000: 0x20040080, 0x00017000: 0x01000000,
|
||||
0x00018000: 0x21040080, 0x00019000: 0x21000000, 0x0001a000: 0x01040000, 0x0001b000: 0x20040000,
|
||||
0x0001c000: 0x00040080, 0x0001d000: 0x20000080, 0x0001e000: 0x00000000, 0x0001f000: 0x01040080,
|
||||
0x00010800: 0x21000080, 0x00011800: 0x01000000, 0x00012800: 0x01040000, 0x00013800: 0x20040080,
|
||||
0x00014800: 0x20000000, 0x00015800: 0x01040080, 0x00016800: 0x00000080, 0x00017800: 0x21040000,
|
||||
0x00018800: 0x00040080, 0x00019800: 0x21040080, 0x0001a800: 0x00000000, 0x0001b800: 0x21000000,
|
||||
0x0001c800: 0x01000080, 0x0001d800: 0x00040000, 0x0001e800: 0x20040000, 0x0001f800: 0x20000080
|
||||
},
|
||||
{
|
||||
0x00000000: 0x10000008, 0x00000100: 0x00002000, 0x00000200: 0x10200000, 0x00000300: 0x10202008,
|
||||
0x00000400: 0x10002000, 0x00000500: 0x00200000, 0x00000600: 0x00200008, 0x00000700: 0x10000000,
|
||||
0x00000800: 0x00000000, 0x00000900: 0x10002008, 0x00000a00: 0x00202000, 0x00000b00: 0x00000008,
|
||||
0x00000c00: 0x10200008, 0x00000d00: 0x00202008, 0x00000e00: 0x00002008, 0x00000f00: 0x10202000,
|
||||
0x00000080: 0x10200000, 0x00000180: 0x10202008, 0x00000280: 0x00000008, 0x00000380: 0x00200000,
|
||||
0x00000480: 0x00202008, 0x00000580: 0x10000008, 0x00000680: 0x10002000, 0x00000780: 0x00002008,
|
||||
0x00000880: 0x00200008, 0x00000980: 0x00002000, 0x00000a80: 0x10002008, 0x00000b80: 0x10200008,
|
||||
0x00000c80: 0x00000000, 0x00000d80: 0x10202000, 0x00000e80: 0x00202000, 0x00000f80: 0x10000000,
|
||||
0x00001000: 0x10002000, 0x00001100: 0x10200008, 0x00001200: 0x10202008, 0x00001300: 0x00002008,
|
||||
0x00001400: 0x00200000, 0x00001500: 0x10000000, 0x00001600: 0x10000008, 0x00001700: 0x00202000,
|
||||
0x00001800: 0x00202008, 0x00001900: 0x00000000, 0x00001a00: 0x00000008, 0x00001b00: 0x10200000,
|
||||
0x00001c00: 0x00002000, 0x00001d00: 0x10002008, 0x00001e00: 0x10202000, 0x00001f00: 0x00200008,
|
||||
0x00001080: 0x00000008, 0x00001180: 0x00202000, 0x00001280: 0x00200000, 0x00001380: 0x10000008,
|
||||
0x00001480: 0x10002000, 0x00001580: 0x00002008, 0x00001680: 0x10202008, 0x00001780: 0x10200000,
|
||||
0x00001880: 0x10202000, 0x00001980: 0x10200008, 0x00001a80: 0x00002000, 0x00001b80: 0x00202008,
|
||||
0x00001c80: 0x00200008, 0x00001d80: 0x00000000, 0x00001e80: 0x10000000, 0x00001f80: 0x10002008
|
||||
},
|
||||
{
|
||||
0x00000000: 0x00100000, 0x00000010: 0x02000401, 0x00000020: 0x00000400, 0x00000030: 0x00100401,
|
||||
0x00000040: 0x02100401, 0x00000050: 0x00000000, 0x00000060: 0x00000001, 0x00000070: 0x02100001,
|
||||
0x00000080: 0x02000400, 0x00000090: 0x00100001, 0x000000a0: 0x02000001, 0x000000b0: 0x02100400,
|
||||
0x000000c0: 0x02100000, 0x000000d0: 0x00000401, 0x000000e0: 0x00100400, 0x000000f0: 0x02000000,
|
||||
0x00000008: 0x02100001, 0x00000018: 0x00000000, 0x00000028: 0x02000401, 0x00000038: 0x02100400,
|
||||
0x00000048: 0x00100000, 0x00000058: 0x02000001, 0x00000068: 0x02000000, 0x00000078: 0x00000401,
|
||||
0x00000088: 0x00100401, 0x00000098: 0x02000400, 0x000000a8: 0x02100000, 0x000000b8: 0x00100001,
|
||||
0x000000c8: 0x00000400, 0x000000d8: 0x02100401, 0x000000e8: 0x00000001, 0x000000f8: 0x00100400,
|
||||
0x00000100: 0x02000000, 0x00000110: 0x00100000, 0x00000120: 0x02000401, 0x00000130: 0x02100001,
|
||||
0x00000140: 0x00100001, 0x00000150: 0x02000400, 0x00000160: 0x02100400, 0x00000170: 0x00100401,
|
||||
0x00000180: 0x00000401, 0x00000190: 0x02100401, 0x000001a0: 0x00100400, 0x000001b0: 0x00000001,
|
||||
0x000001c0: 0x00000000, 0x000001d0: 0x02100000, 0x000001e0: 0x02000001, 0x000001f0: 0x00000400,
|
||||
0x00000108: 0x00100400, 0x00000118: 0x02000401, 0x00000128: 0x02100001, 0x00000138: 0x00000001,
|
||||
0x00000148: 0x02000000, 0x00000158: 0x00100000, 0x00000168: 0x00000401, 0x00000178: 0x02100400,
|
||||
0x00000188: 0x02000001, 0x00000198: 0x02100000, 0x000001a8: 0x00000000, 0x000001b8: 0x02100401,
|
||||
0x000001c8: 0x00100401, 0x000001d8: 0x00000400, 0x000001e8: 0x02000400, 0x000001f8: 0x00100001
|
||||
},
|
||||
{
|
||||
0x00000000: 0x08000820, 0x00000001: 0x00020000, 0x00000002: 0x08000000, 0x00000003: 0x00000020,
|
||||
0x00000004: 0x00020020, 0x00000005: 0x08020820, 0x00000006: 0x08020800, 0x00000007: 0x00000800,
|
||||
0x00000008: 0x08020000, 0x00000009: 0x08000800, 0x0000000a: 0x00020800, 0x0000000b: 0x08020020,
|
||||
0x0000000c: 0x00000820, 0x0000000d: 0x00000000, 0x0000000e: 0x08000020, 0x0000000f: 0x00020820,
|
||||
0x80000000: 0x00000800, 0x80000001: 0x08020820, 0x80000002: 0x08000820, 0x80000003: 0x08000000,
|
||||
0x80000004: 0x08020000, 0x80000005: 0x00020800, 0x80000006: 0x00020820, 0x80000007: 0x00000020,
|
||||
0x80000008: 0x08000020, 0x80000009: 0x00000820, 0x8000000a: 0x00020020, 0x8000000b: 0x08020800,
|
||||
0x8000000c: 0x00000000, 0x8000000d: 0x08020020, 0x8000000e: 0x08000800, 0x8000000f: 0x00020000,
|
||||
0x00000010: 0x00020820, 0x00000011: 0x08020800, 0x00000012: 0x00000020, 0x00000013: 0x00000800,
|
||||
0x00000014: 0x08000800, 0x00000015: 0x08000020, 0x00000016: 0x08020020, 0x00000017: 0x00020000,
|
||||
0x00000018: 0x00000000, 0x00000019: 0x00020020, 0x0000001a: 0x08020000, 0x0000001b: 0x08000820,
|
||||
0x0000001c: 0x08020820, 0x0000001d: 0x00020800, 0x0000001e: 0x00000820, 0x0000001f: 0x08000000,
|
||||
0x80000010: 0x00020000, 0x80000011: 0x00000800, 0x80000012: 0x08020020, 0x80000013: 0x00020820,
|
||||
0x80000014: 0x00000020, 0x80000015: 0x08020000, 0x80000016: 0x08000000, 0x80000017: 0x08000820,
|
||||
0x80000018: 0x08020820, 0x80000019: 0x08000020, 0x8000001a: 0x08000800, 0x8000001b: 0x00000000,
|
||||
0x8000001c: 0x00020800, 0x8000001d: 0x00000820, 0x8000001e: 0x00020020, 0x8000001f: 0x08020800
|
||||
}
|
||||
];
|
||||
|
||||
// Masks that select the SBOX input
|
||||
var SBOX_MASK = [
|
||||
0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
|
||||
0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
|
||||
];
|
||||
|
||||
/**
|
||||
* DES block cipher algorithm.
|
||||
*/
|
||||
var DES = C_algo.DES = BlockCipher.extend({
|
||||
_doReset: function () {
|
||||
// Shortcuts
|
||||
var key = this._key;
|
||||
var keyWords = key.words;
|
||||
|
||||
// Select 56 bits according to PC1
|
||||
var keyBits = [];
|
||||
for (var i = 0; i < 56; i++) {
|
||||
var keyBitPos = PC1[i] - 1;
|
||||
keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
|
||||
}
|
||||
|
||||
// Assemble 16 subkeys
|
||||
var subKeys = this._subKeys = [];
|
||||
for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
|
||||
// Create subkey
|
||||
var subKey = subKeys[nSubKey] = [];
|
||||
|
||||
// Shortcut
|
||||
var bitShift = BIT_SHIFTS[nSubKey];
|
||||
|
||||
// Select 48 bits according to PC2
|
||||
for (var i = 0; i < 24; i++) {
|
||||
// Select from the left 28 key bits
|
||||
subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
|
||||
|
||||
// Select from the right 28 key bits
|
||||
subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
|
||||
}
|
||||
|
||||
// Since each subkey is applied to an expanded 32-bit input,
|
||||
// the subkey can be broken into 8 values scaled to 32-bits,
|
||||
// which allows the key to be used without expansion
|
||||
subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
|
||||
for (var i = 1; i < 7; i++) {
|
||||
subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
|
||||
}
|
||||
subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
|
||||
}
|
||||
|
||||
// Compute inverse subkeys
|
||||
var invSubKeys = this._invSubKeys = [];
|
||||
for (var i = 0; i < 16; i++) {
|
||||
invSubKeys[i] = subKeys[15 - i];
|
||||
}
|
||||
},
|
||||
|
||||
encryptBlock: function (M, offset) {
|
||||
this._doCryptBlock(M, offset, this._subKeys);
|
||||
},
|
||||
|
||||
decryptBlock: function (M, offset) {
|
||||
this._doCryptBlock(M, offset, this._invSubKeys);
|
||||
},
|
||||
|
||||
_doCryptBlock: function (M, offset, subKeys) {
|
||||
// Get input
|
||||
this._lBlock = M[offset];
|
||||
this._rBlock = M[offset + 1];
|
||||
|
||||
// Initial permutation
|
||||
exchangeLR.call(this, 4, 0x0f0f0f0f);
|
||||
exchangeLR.call(this, 16, 0x0000ffff);
|
||||
exchangeRL.call(this, 2, 0x33333333);
|
||||
exchangeRL.call(this, 8, 0x00ff00ff);
|
||||
exchangeLR.call(this, 1, 0x55555555);
|
||||
|
||||
// Rounds
|
||||
for (var round = 0; round < 16; round++) {
|
||||
// Shortcuts
|
||||
var subKey = subKeys[round];
|
||||
var lBlock = this._lBlock;
|
||||
var rBlock = this._rBlock;
|
||||
|
||||
// Feistel function
|
||||
var f = 0;
|
||||
for (var i = 0; i < 8; i++) {
|
||||
f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
|
||||
}
|
||||
this._lBlock = rBlock;
|
||||
this._rBlock = lBlock ^ f;
|
||||
}
|
||||
|
||||
// Undo swap from last round
|
||||
var t = this._lBlock;
|
||||
this._lBlock = this._rBlock;
|
||||
this._rBlock = t;
|
||||
|
||||
// Final permutation
|
||||
exchangeLR.call(this, 1, 0x55555555);
|
||||
exchangeRL.call(this, 8, 0x00ff00ff);
|
||||
exchangeRL.call(this, 2, 0x33333333);
|
||||
exchangeLR.call(this, 16, 0x0000ffff);
|
||||
exchangeLR.call(this, 4, 0x0f0f0f0f);
|
||||
|
||||
// Set output
|
||||
M[offset] = this._lBlock;
|
||||
M[offset + 1] = this._rBlock;
|
||||
},
|
||||
|
||||
keySize: 64/32,
|
||||
|
||||
ivSize: 64/32,
|
||||
|
||||
blockSize: 64/32
|
||||
});
|
||||
|
||||
// Swap bits across the left and right words
|
||||
function exchangeLR(offset, mask) {
|
||||
var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
|
||||
this._rBlock ^= t;
|
||||
this._lBlock ^= t << offset;
|
||||
}
|
||||
|
||||
function exchangeRL(offset, mask) {
|
||||
var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
|
||||
this._lBlock ^= t;
|
||||
this._rBlock ^= t << offset;
|
||||
}
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.DES = BlockCipher._createHelper(DES);
|
||||
|
||||
/**
|
||||
* Triple-DES block cipher algorithm.
|
||||
*/
|
||||
var TripleDES = C_algo.TripleDES = BlockCipher.extend({
|
||||
_doReset: function () {
|
||||
// Shortcuts
|
||||
var key = this._key;
|
||||
var keyWords = key.words;
|
||||
|
||||
// Create DES instances
|
||||
this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
|
||||
this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
|
||||
this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
|
||||
},
|
||||
|
||||
encryptBlock: function (M, offset) {
|
||||
this._des1.encryptBlock(M, offset);
|
||||
this._des2.decryptBlock(M, offset);
|
||||
this._des3.encryptBlock(M, offset);
|
||||
},
|
||||
|
||||
decryptBlock: function (M, offset) {
|
||||
this._des3.decryptBlock(M, offset);
|
||||
this._des2.encryptBlock(M, offset);
|
||||
this._des1.decryptBlock(M, offset);
|
||||
},
|
||||
|
||||
keySize: 192/32,
|
||||
|
||||
ivSize: 64/32,
|
||||
|
||||
blockSize: 64/32
|
||||
});
|
||||
|
||||
/**
|
||||
* Shortcut functions to the cipher's object interface.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
|
||||
* var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
|
||||
*/
|
||||
C.TripleDES = BlockCipher._createHelper(TripleDES);
|
||||
}());
|
|
@ -1,7 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function(g){var a=CryptoJS,f=a.lib,e=f.Base,h=f.WordArray,a=a.x64={};a.Word=e.extend({init:function(b,c){this.high=b;this.low=c}});a.WordArray=e.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=g?c:8*b.length},toX32:function(){for(var b=this.words,c=b.length,a=[],d=0;d<c;d++){var e=b[d];a.push(e.high);a.push(e.low)}return h.create(a,this.sigBytes)},clone:function(){for(var b=e.clone.call(this),c=b.words=this.words.slice(0),a=c.length,d=0;d<a;d++)c[d]=c[d].clone();return b}})})();
|
|
@ -1,293 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
(function (undefined) {
|
||||
// Shortcuts
|
||||
var C = CryptoJS;
|
||||
var C_lib = C.lib;
|
||||
var Base = C_lib.Base;
|
||||
var X32WordArray = C_lib.WordArray;
|
||||
|
||||
/**
|
||||
* x64 namespace.
|
||||
*/
|
||||
var C_x64 = C.x64 = {};
|
||||
|
||||
/**
|
||||
* A 64-bit word.
|
||||
*
|
||||
* @property {number} high The high 32 bits.
|
||||
* @property {number} low The low 32 bits.
|
||||
*/
|
||||
var X64Word = C_x64.Word = Base.extend({
|
||||
/**
|
||||
* Initializes a newly created 64-bit word.
|
||||
*
|
||||
* @param {number} high The high 32 bits.
|
||||
* @param {number} low The low 32 bits.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
|
||||
*/
|
||||
init: function (high, low) {
|
||||
this.high = high;
|
||||
this.low = low;
|
||||
}
|
||||
|
||||
/**
|
||||
* Bitwise NOTs this word.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after negating.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var negated = x64Word.not();
|
||||
*/
|
||||
// not: function () {
|
||||
// var high = ~this.high;
|
||||
// var low = ~this.low;
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Bitwise ANDs this word with the passed word.
|
||||
*
|
||||
* @param {X64Word} word The x64-Word to AND with this word.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after ANDing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var anded = x64Word.and(anotherX64Word);
|
||||
*/
|
||||
// and: function (word) {
|
||||
// var high = this.high & word.high;
|
||||
// var low = this.low & word.low;
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Bitwise ORs this word with the passed word.
|
||||
*
|
||||
* @param {X64Word} word The x64-Word to OR with this word.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after ORing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var ored = x64Word.or(anotherX64Word);
|
||||
*/
|
||||
// or: function (word) {
|
||||
// var high = this.high | word.high;
|
||||
// var low = this.low | word.low;
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Bitwise XORs this word with the passed word.
|
||||
*
|
||||
* @param {X64Word} word The x64-Word to XOR with this word.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after XORing.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var xored = x64Word.xor(anotherX64Word);
|
||||
*/
|
||||
// xor: function (word) {
|
||||
// var high = this.high ^ word.high;
|
||||
// var low = this.low ^ word.low;
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Shifts this word n bits to the left.
|
||||
*
|
||||
* @param {number} n The number of bits to shift.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after shifting.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var shifted = x64Word.shiftL(25);
|
||||
*/
|
||||
// shiftL: function (n) {
|
||||
// if (n < 32) {
|
||||
// var high = (this.high << n) | (this.low >>> (32 - n));
|
||||
// var low = this.low << n;
|
||||
// } else {
|
||||
// var high = this.low << (n - 32);
|
||||
// var low = 0;
|
||||
// }
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Shifts this word n bits to the right.
|
||||
*
|
||||
* @param {number} n The number of bits to shift.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after shifting.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var shifted = x64Word.shiftR(7);
|
||||
*/
|
||||
// shiftR: function (n) {
|
||||
// if (n < 32) {
|
||||
// var low = (this.low >>> n) | (this.high << (32 - n));
|
||||
// var high = this.high >>> n;
|
||||
// } else {
|
||||
// var low = this.high >>> (n - 32);
|
||||
// var high = 0;
|
||||
// }
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// },
|
||||
|
||||
/**
|
||||
* Rotates this word n bits to the left.
|
||||
*
|
||||
* @param {number} n The number of bits to rotate.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after rotating.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var rotated = x64Word.rotL(25);
|
||||
*/
|
||||
// rotL: function (n) {
|
||||
// return this.shiftL(n).or(this.shiftR(64 - n));
|
||||
// },
|
||||
|
||||
/**
|
||||
* Rotates this word n bits to the right.
|
||||
*
|
||||
* @param {number} n The number of bits to rotate.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after rotating.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var rotated = x64Word.rotR(7);
|
||||
*/
|
||||
// rotR: function (n) {
|
||||
// return this.shiftR(n).or(this.shiftL(64 - n));
|
||||
// },
|
||||
|
||||
/**
|
||||
* Adds this word with the passed word.
|
||||
*
|
||||
* @param {X64Word} word The x64-Word to add with this word.
|
||||
*
|
||||
* @return {X64Word} A new x64-Word object after adding.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var added = x64Word.add(anotherX64Word);
|
||||
*/
|
||||
// add: function (word) {
|
||||
// var low = (this.low + word.low) | 0;
|
||||
// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
|
||||
// var high = (this.high + word.high + carry) | 0;
|
||||
|
||||
// return X64Word.create(high, low);
|
||||
// }
|
||||
});
|
||||
|
||||
/**
|
||||
* An array of 64-bit words.
|
||||
*
|
||||
* @property {Array} words The array of CryptoJS.x64.Word objects.
|
||||
* @property {number} sigBytes The number of significant bytes in this word array.
|
||||
*/
|
||||
var X64WordArray = C_x64.WordArray = Base.extend({
|
||||
/**
|
||||
* Initializes a newly created word array.
|
||||
*
|
||||
* @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
|
||||
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var wordArray = CryptoJS.x64.WordArray.create();
|
||||
*
|
||||
* var wordArray = CryptoJS.x64.WordArray.create([
|
||||
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
|
||||
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
|
||||
* ]);
|
||||
*
|
||||
* var wordArray = CryptoJS.x64.WordArray.create([
|
||||
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
|
||||
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
|
||||
* ], 10);
|
||||
*/
|
||||
init: function (words, sigBytes) {
|
||||
words = this.words = words || [];
|
||||
|
||||
if (sigBytes != undefined) {
|
||||
this.sigBytes = sigBytes;
|
||||
} else {
|
||||
this.sigBytes = words.length * 8;
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Converts this 64-bit word array to a 32-bit word array.
|
||||
*
|
||||
* @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var x32WordArray = x64WordArray.toX32();
|
||||
*/
|
||||
toX32: function () {
|
||||
// Shortcuts
|
||||
var x64Words = this.words;
|
||||
var x64WordsLength = x64Words.length;
|
||||
|
||||
// Convert
|
||||
var x32Words = [];
|
||||
for (var i = 0; i < x64WordsLength; i++) {
|
||||
var x64Word = x64Words[i];
|
||||
x32Words.push(x64Word.high);
|
||||
x32Words.push(x64Word.low);
|
||||
}
|
||||
|
||||
return X32WordArray.create(x32Words, this.sigBytes);
|
||||
},
|
||||
|
||||
/**
|
||||
* Creates a copy of this word array.
|
||||
*
|
||||
* @return {X64WordArray} The clone.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* var clone = x64WordArray.clone();
|
||||
*/
|
||||
clone: function () {
|
||||
var clone = Base.clone.call(this);
|
||||
|
||||
// Clone "words" array
|
||||
var words = clone.words = this.words.slice(0);
|
||||
|
||||
// Clone each X64Word object
|
||||
var wordsLength = words.length;
|
||||
for (var i = 0; i < wordsLength; i++) {
|
||||
words[i] = words[i].clone();
|
||||
}
|
||||
|
||||
return clone;
|
||||
}
|
||||
});
|
||||
}());
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(p,h){var i={},l=i.lib={},r=l.Base=function(){function a(){}return{extend:function(e){a.prototype=this;var c=new a;e&&c.mixIn(e);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),o=l.WordArray=r.extend({init:function(a,e){a=
|
||||
this.words=a||[];this.sigBytes=e!=h?e:4*a.length},toString:function(a){return(a||s).stringify(this)},concat:function(a){var e=this.words,c=a.words,b=this.sigBytes,a=a.sigBytes;this.clamp();if(b%4)for(var d=0;d<a;d++)e[b+d>>>2]|=(c[d>>>2]>>>24-8*(d%4)&255)<<24-8*((b+d)%4);else if(65535<c.length)for(d=0;d<a;d+=4)e[b+d>>>2]=c[d>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=p.ceil(e/4)},clone:function(){var a=
|
||||
r.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c<a;c+=4)e.push(4294967296*p.random()|0);return o.create(e,a)}}),m=i.enc={},s=m.Hex={stringify:function(a){for(var e=a.words,a=a.sigBytes,c=[],b=0;b<a;b++){var d=e[b>>>2]>>>24-8*(b%4)&255;c.push((d>>>4).toString(16));c.push((d&15).toString(16))}return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b<e;b+=2)c[b>>>3]|=parseInt(a.substr(b,2),16)<<24-4*(b%8);return o.create(c,e/2)}},n=m.Latin1={stringify:function(a){for(var e=
|
||||
a.words,a=a.sigBytes,c=[],b=0;b<a;b++)c.push(String.fromCharCode(e[b>>>2]>>>24-8*(b%4)&255));return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b<e;b++)c[b>>>2]|=(a.charCodeAt(b)&255)<<24-8*(b%4);return o.create(c,e)}},k=m.Utf8={stringify:function(a){try{return decodeURIComponent(escape(n.stringify(a)))}catch(e){throw Error("Malformed UTF-8 data");}},parse:function(a){return n.parse(unescape(encodeURIComponent(a)))}},f=l.BufferedBlockAlgorithm=r.extend({reset:function(){this._data=o.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var e=this._data,c=e.words,b=e.sigBytes,d=this.blockSize,q=b/(4*d),q=a?p.ceil(q):p.max((q|0)-this._minBufferSize,0),a=q*d,b=p.min(4*a,b);if(a){for(var j=0;j<a;j+=d)this._doProcessBlock(c,j);j=c.splice(0,a);e.sigBytes-=b}return o.create(j,b)},clone:function(){var a=r.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});l.Hasher=f.extend({init:function(){this.reset()},
|
||||
reset:function(){f.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=f.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(e,c){return a.create(c).finalize(e)}},_createHmacHelper:function(a){return function(e,c){return g.HMAC.create(a,c).finalize(e)}}});var g=i.algo={};return i}(Math);
|
||||
(function(){var p=CryptoJS,h=p.lib.WordArray;p.enc.Base64={stringify:function(i){var l=i.words,h=i.sigBytes,o=this._map;i.clamp();for(var i=[],m=0;m<h;m+=3)for(var s=(l[m>>>2]>>>24-8*(m%4)&255)<<16|(l[m+1>>>2]>>>24-8*((m+1)%4)&255)<<8|l[m+2>>>2]>>>24-8*((m+2)%4)&255,n=0;4>n&&m+0.75*n<h;n++)i.push(o.charAt(s>>>6*(3-n)&63));if(l=o.charAt(64))for(;i.length%4;)i.push(l);return i.join("")},parse:function(i){var i=i.replace(/\s/g,""),l=i.length,r=this._map,o=r.charAt(64);o&&(o=i.indexOf(o),-1!=o&&(l=o));
|
||||
for(var o=[],m=0,s=0;s<l;s++)if(s%4){var n=r.indexOf(i.charAt(s-1))<<2*(s%4),k=r.indexOf(i.charAt(s))>>>6-2*(s%4);o[m>>>2]|=(n|k)<<24-8*(m%4);m++}return h.create(o,m)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
||||
(function(p){function h(f,g,a,e,c,b,d){f=f+(g&a|~g&e)+c+d;return(f<<b|f>>>32-b)+g}function i(f,g,a,e,c,b,d){f=f+(g&e|a&~e)+c+d;return(f<<b|f>>>32-b)+g}function l(f,g,a,e,c,b,d){f=f+(g^a^e)+c+d;return(f<<b|f>>>32-b)+g}function r(f,g,a,e,c,b,d){f=f+(a^(g|~e))+c+d;return(f<<b|f>>>32-b)+g}var o=CryptoJS,m=o.lib,s=m.WordArray,m=m.Hasher,n=o.algo,k=[];(function(){for(var f=0;64>f;f++)k[f]=4294967296*p.abs(p.sin(f+1))|0})();n=n.MD5=m.extend({_doReset:function(){this._hash=s.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(f,g){for(var a=0;16>a;a++){var e=g+a,c=f[e];f[e]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var e=this._hash.words,c=e[0],b=e[1],d=e[2],q=e[3],a=0;64>a;a+=4)16>a?(c=h(c,b,d,q,f[g+a],7,k[a]),q=h(q,c,b,d,f[g+a+1],12,k[a+1]),d=h(d,q,c,b,f[g+a+2],17,k[a+2]),b=h(b,d,q,c,f[g+a+3],22,k[a+3])):32>a?(c=i(c,b,d,q,f[g+(a+1)%16],5,k[a]),q=i(q,c,b,d,f[g+(a+6)%16],9,k[a+1]),d=i(d,q,c,b,f[g+(a+11)%16],14,k[a+2]),b=i(b,d,q,c,f[g+a%16],20,k[a+3])):48>a?(c=
|
||||
l(c,b,d,q,f[g+(3*a+5)%16],4,k[a]),q=l(q,c,b,d,f[g+(3*a+8)%16],11,k[a+1]),d=l(d,q,c,b,f[g+(3*a+11)%16],16,k[a+2]),b=l(b,d,q,c,f[g+(3*a+14)%16],23,k[a+3])):(c=r(c,b,d,q,f[g+3*a%16],6,k[a]),q=r(q,c,b,d,f[g+(3*a+7)%16],10,k[a+1]),d=r(d,q,c,b,f[g+(3*a+14)%16],15,k[a+2]),b=r(b,d,q,c,f[g+(3*a+5)%16],21,k[a+3]));e[0]=e[0]+c|0;e[1]=e[1]+b|0;e[2]=e[2]+d|0;e[3]=e[3]+q|0},_doFinalize:function(){var f=this._data,g=f.words,a=8*this._nDataBytes,e=8*f.sigBytes;g[e>>>5]|=128<<24-e%32;g[(e+64>>>9<<4)+14]=(a<<8|a>>>
|
||||
24)&16711935|(a<<24|a>>>8)&4278255360;f.sigBytes=4*(g.length+1);this._process();f=this._hash.words;for(g=0;4>g;g++)a=f[g],f[g]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});o.MD5=m._createHelper(n);o.HmacMD5=m._createHmacHelper(n)})(Math);
|
||||
(function(){var p=CryptoJS,h=p.lib,i=h.Base,l=h.WordArray,h=p.algo,r=h.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:h.MD5,iterations:1}),init:function(i){this.cfg=this.cfg.extend(i)},compute:function(i,m){for(var h=this.cfg,n=h.hasher.create(),k=l.create(),f=k.words,g=h.keySize,h=h.iterations;f.length<g;){a&&n.update(a);var a=n.update(i).finalize(m);n.reset();for(var e=1;e<h;e++)a=n.finalize(a),n.reset();k.concat(a)}k.sigBytes=4*g;return k}});p.EvpKDF=function(i,l,h){return r.create(h).compute(i,
|
||||
l)}})();
|
||||
CryptoJS.lib.Cipher||function(p){var h=CryptoJS,i=h.lib,l=i.Base,r=i.WordArray,o=i.BufferedBlockAlgorithm,m=h.enc.Base64,s=h.algo.EvpKDF,n=i.Cipher=o.extend({cfg:l.extend(),createEncryptor:function(b,d){return this.create(this._ENC_XFORM_MODE,b,d)},createDecryptor:function(b,d){return this.create(this._DEC_XFORM_MODE,b,d)},init:function(b,d,a){this.cfg=this.cfg.extend(a);this._xformMode=b;this._key=d;this.reset()},reset:function(){o.reset.call(this);this._doReset()},process:function(b){this._append(b);return this._process()},
|
||||
finalize:function(b){b&&this._append(b);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(b){return{encrypt:function(a,q,j){return("string"==typeof q?c:e).encrypt(b,a,q,j)},decrypt:function(a,q,j){return("string"==typeof q?c:e).decrypt(b,a,q,j)}}}}()});i.StreamCipher=n.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var k=h.mode={},f=i.BlockCipherMode=l.extend({createEncryptor:function(b,a){return this.Encryptor.create(b,
|
||||
a)},createDecryptor:function(b,a){return this.Decryptor.create(b,a)},init:function(b,a){this._cipher=b;this._iv=a}}),k=k.CBC=function(){function b(b,a,d){var c=this._iv;c?this._iv=p:c=this._prevBlock;for(var e=0;e<d;e++)b[a+e]^=c[e]}var a=f.extend();a.Encryptor=a.extend({processBlock:function(a,d){var c=this._cipher,e=c.blockSize;b.call(this,a,d,e);c.encryptBlock(a,d);this._prevBlock=a.slice(d,d+e)}});a.Decryptor=a.extend({processBlock:function(a,d){var c=this._cipher,e=c.blockSize,f=a.slice(d,d+
|
||||
e);c.decryptBlock(a,d);b.call(this,a,d,e);this._prevBlock=f}});return a}(),g=(h.pad={}).Pkcs7={pad:function(b,a){for(var c=4*a,c=c-b.sigBytes%c,e=c<<24|c<<16|c<<8|c,f=[],g=0;g<c;g+=4)f.push(e);c=r.create(f,c);b.concat(c)},unpad:function(b){b.sigBytes-=b.words[b.sigBytes-1>>>2]&255}};i.BlockCipher=n.extend({cfg:n.cfg.extend({mode:k,padding:g}),reset:function(){n.reset.call(this);var b=this.cfg,a=b.iv,b=b.mode;if(this._xformMode==this._ENC_XFORM_MODE)var c=b.createEncryptor;else c=b.createDecryptor,
|
||||
this._minBufferSize=1;this._mode=c.call(b,this,a&&a.words)},_doProcessBlock:function(b,a){this._mode.processBlock(b,a)},_doFinalize:function(){var b=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){b.pad(this._data,this.blockSize);var a=this._process(!0)}else a=this._process(!0),b.unpad(a);return a},blockSize:4});var a=i.CipherParams=l.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),k=(h.format={}).OpenSSL={stringify:function(a){var d=
|
||||
a.ciphertext,a=a.salt,d=(a?r.create([1398893684,1701076831]).concat(a).concat(d):d).toString(m);return d=d.replace(/(.{64})/g,"$1\n")},parse:function(b){var b=m.parse(b),d=b.words;if(1398893684==d[0]&&1701076831==d[1]){var c=r.create(d.slice(2,4));d.splice(0,4);b.sigBytes-=16}return a.create({ciphertext:b,salt:c})}},e=i.SerializableCipher=l.extend({cfg:l.extend({format:k}),encrypt:function(b,d,c,e){var e=this.cfg.extend(e),f=b.createEncryptor(c,e),d=f.finalize(d),f=f.cfg;return a.create({ciphertext:d,
|
||||
key:c,iv:f.iv,algorithm:b,mode:f.mode,padding:f.padding,blockSize:b.blockSize,formatter:e.format})},decrypt:function(a,c,e,f){f=this.cfg.extend(f);c=this._parse(c,f.format);return a.createDecryptor(e,f).finalize(c.ciphertext)},_parse:function(a,c){return"string"==typeof a?c.parse(a):a}}),h=(h.kdf={}).OpenSSL={compute:function(b,c,e,f){f||(f=r.random(8));b=s.create({keySize:c+e}).compute(b,f);e=r.create(b.words.slice(c),4*e);b.sigBytes=4*c;return a.create({key:b,iv:e,salt:f})}},c=i.PasswordBasedCipher=
|
||||
e.extend({cfg:e.cfg.extend({kdf:h}),encrypt:function(a,c,f,j){j=this.cfg.extend(j);f=j.kdf.compute(f,a.keySize,a.ivSize);j.iv=f.iv;a=e.encrypt.call(this,a,c,f.key,j);a.mixIn(f);return a},decrypt:function(a,c,f,j){j=this.cfg.extend(j);c=this._parse(c,j.format);f=j.kdf.compute(f,a.keySize,a.ivSize,c.salt);j.iv=f.iv;return e.decrypt.call(this,a,c,f.key,j)}})}();
|
||||
(function(){var p=CryptoJS,h=p.lib.BlockCipher,i=p.algo,l=[],r=[],o=[],m=[],s=[],n=[],k=[],f=[],g=[],a=[];(function(){for(var c=[],b=0;256>b;b++)c[b]=128>b?b<<1:b<<1^283;for(var d=0,e=0,b=0;256>b;b++){var j=e^e<<1^e<<2^e<<3^e<<4,j=j>>>8^j&255^99;l[d]=j;r[j]=d;var i=c[d],h=c[i],p=c[h],t=257*c[j]^16843008*j;o[d]=t<<24|t>>>8;m[d]=t<<16|t>>>16;s[d]=t<<8|t>>>24;n[d]=t;t=16843009*p^65537*h^257*i^16843008*d;k[j]=t<<24|t>>>8;f[j]=t<<16|t>>>16;g[j]=t<<8|t>>>24;a[j]=t;d?(d=i^c[c[c[p^i]]],e^=c[c[e]]):d=e=1}})();
|
||||
var e=[0,1,2,4,8,16,32,64,128,27,54],i=i.AES=h.extend({_doReset:function(){for(var c=this._key,b=c.words,d=c.sigBytes/4,c=4*((this._nRounds=d+6)+1),i=this._keySchedule=[],j=0;j<c;j++)if(j<d)i[j]=b[j];else{var h=i[j-1];j%d?6<d&&4==j%d&&(h=l[h>>>24]<<24|l[h>>>16&255]<<16|l[h>>>8&255]<<8|l[h&255]):(h=h<<8|h>>>24,h=l[h>>>24]<<24|l[h>>>16&255]<<16|l[h>>>8&255]<<8|l[h&255],h^=e[j/d|0]<<24);i[j]=i[j-d]^h}b=this._invKeySchedule=[];for(d=0;d<c;d++)j=c-d,h=d%4?i[j]:i[j-4],b[d]=4>d||4>=j?h:k[l[h>>>24]]^f[l[h>>>
|
||||
16&255]]^g[l[h>>>8&255]]^a[l[h&255]]},encryptBlock:function(a,b){this._doCryptBlock(a,b,this._keySchedule,o,m,s,n,l)},decryptBlock:function(c,b){var d=c[b+1];c[b+1]=c[b+3];c[b+3]=d;this._doCryptBlock(c,b,this._invKeySchedule,k,f,g,a,r);d=c[b+1];c[b+1]=c[b+3];c[b+3]=d},_doCryptBlock:function(a,b,d,e,f,h,i,g){for(var l=this._nRounds,k=a[b]^d[0],m=a[b+1]^d[1],o=a[b+2]^d[2],n=a[b+3]^d[3],p=4,r=1;r<l;r++)var s=e[k>>>24]^f[m>>>16&255]^h[o>>>8&255]^i[n&255]^d[p++],u=e[m>>>24]^f[o>>>16&255]^h[n>>>8&255]^
|
||||
i[k&255]^d[p++],v=e[o>>>24]^f[n>>>16&255]^h[k>>>8&255]^i[m&255]^d[p++],n=e[n>>>24]^f[k>>>16&255]^h[m>>>8&255]^i[o&255]^d[p++],k=s,m=u,o=v;s=(g[k>>>24]<<24|g[m>>>16&255]<<16|g[o>>>8&255]<<8|g[n&255])^d[p++];u=(g[m>>>24]<<24|g[o>>>16&255]<<16|g[n>>>8&255]<<8|g[k&255])^d[p++];v=(g[o>>>24]<<24|g[n>>>16&255]<<16|g[k>>>8&255]<<8|g[m&255])^d[p++];n=(g[n>>>24]<<24|g[k>>>16&255]<<16|g[m>>>8&255]<<8|g[o&255])^d[p++];a[b]=s;a[b+1]=u;a[b+2]=v;a[b+3]=n},keySize:8});p.AES=h._createHelper(i)})();
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(l,q){var g={},i=g.lib={},p=i.Base=function(){function a(){}return{extend:function(f){a.prototype=this;var c=new a;f&&c.mixIn(f);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),m=i.WordArray=p.extend({init:function(a,f){a=
|
||||
this.words=a||[];this.sigBytes=f!=q?f:4*a.length},toString:function(a){return(a||r).stringify(this)},concat:function(a){var f=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b<a;b++)f[d+b>>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535<c.length)for(b=0;b<a;b+=4)f[d+b>>>2]=c[b>>>2];else f.push.apply(f,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=l.ceil(b/4)},clone:function(){var a=
|
||||
p.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c<a;c+=4)b.push(4294967296*l.random()|0);return m.create(b,a)}}),n=g.enc={},r=n.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,c=[],d=0;d<a;d++){var e=b[d>>>2]>>>24-8*(d%4)&255;c.push((e>>>4).toString(16));c.push((e&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return m.create(c,b/2)}},o=n.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return m.create(c,b)}},j=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(o.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return o.parse(unescape(encodeURIComponent(a)))}},b=i.BufferedBlockAlgorithm=p.extend({reset:function(){this._data=m.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,e=this.blockSize,h=d/(4*e),h=a?l.ceil(h):l.max((h|0)-this._minBufferSize,0),a=h*e,d=l.min(4*a,d);if(a){for(var g=0;g<a;g+=e)this._doProcessBlock(c,g);g=c.splice(0,a);b.sigBytes-=d}return m.create(g,d)},clone:function(){var a=p.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});i.Hasher=b.extend({init:function(){this.reset()},
|
||||
reset:function(){b.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=b.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return e.HMAC.create(a,c).finalize(b)}}});var e=g.algo={};return g}(Math);
|
||||
(function(l){function q(b,e,a,f,c,d,g){b=b+(e&a|~e&f)+c+g;return(b<<d|b>>>32-d)+e}function g(b,e,a,f,c,d,g){b=b+(e&f|a&~f)+c+g;return(b<<d|b>>>32-d)+e}function i(b,e,a,f,c,d,g){b=b+(e^a^f)+c+g;return(b<<d|b>>>32-d)+e}function p(b,e,a,f,c,d,g){b=b+(a^(e|~f))+c+g;return(b<<d|b>>>32-d)+e}var m=CryptoJS,n=m.lib,r=n.WordArray,n=n.Hasher,o=m.algo,j=[];(function(){for(var b=0;64>b;b++)j[b]=4294967296*l.abs(l.sin(b+1))|0})();o=o.MD5=n.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(b,e){for(var a=0;16>a;a++){var f=e+a,c=b[f];b[f]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var f=this._hash.words,c=f[0],d=f[1],k=f[2],h=f[3],a=0;64>a;a+=4)16>a?(c=q(c,d,k,h,b[e+a],7,j[a]),h=q(h,c,d,k,b[e+a+1],12,j[a+1]),k=q(k,h,c,d,b[e+a+2],17,j[a+2]),d=q(d,k,h,c,b[e+a+3],22,j[a+3])):32>a?(c=g(c,d,k,h,b[e+(a+1)%16],5,j[a]),h=g(h,c,d,k,b[e+(a+6)%16],9,j[a+1]),k=g(k,h,c,d,b[e+(a+11)%16],14,j[a+2]),d=g(d,k,h,c,b[e+a%16],20,j[a+3])):48>a?(c=
|
||||
i(c,d,k,h,b[e+(3*a+5)%16],4,j[a]),h=i(h,c,d,k,b[e+(3*a+8)%16],11,j[a+1]),k=i(k,h,c,d,b[e+(3*a+11)%16],16,j[a+2]),d=i(d,k,h,c,b[e+(3*a+14)%16],23,j[a+3])):(c=p(c,d,k,h,b[e+3*a%16],6,j[a]),h=p(h,c,d,k,b[e+(3*a+7)%16],10,j[a+1]),k=p(k,h,c,d,b[e+(3*a+14)%16],15,j[a+2]),d=p(d,k,h,c,b[e+(3*a+5)%16],21,j[a+3]));f[0]=f[0]+c|0;f[1]=f[1]+d|0;f[2]=f[2]+k|0;f[3]=f[3]+h|0},_doFinalize:function(){var b=this._data,e=b.words,a=8*this._nDataBytes,f=8*b.sigBytes;e[f>>>5]|=128<<24-f%32;e[(f+64>>>9<<4)+14]=(a<<8|a>>>
|
||||
24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(e.length+1);this._process();b=this._hash.words;for(e=0;4>e;e++)a=b[e],b[e]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});m.MD5=n._createHelper(o);m.HmacMD5=n._createHmacHelper(o)})(Math);
|
||||
(function(){var l=CryptoJS,q=l.enc.Utf8;l.algo.HMAC=l.lib.Base.extend({init:function(g,i){g=this._hasher=g.create();"string"==typeof i&&(i=q.parse(i));var l=g.blockSize,m=4*l;i.sigBytes>m&&(i=g.finalize(i));for(var n=this._oKey=i.clone(),r=this._iKey=i.clone(),o=n.words,j=r.words,b=0;b<l;b++)o[b]^=1549556828,j[b]^=909522486;n.sigBytes=r.sigBytes=m;this.reset()},reset:function(){var g=this._hasher;g.reset();g.update(this._iKey)},update:function(g){this._hasher.update(g);return this},finalize:function(g){var i=
|
||||
this._hasher,g=i.finalize(g);i.reset();return i.finalize(this._oKey.clone().concat(g))}})})();
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(i,j){var f={},b=f.lib={},m=b.Base=function(){function a(){}return{extend:function(e){a.prototype=this;var c=new a;e&&c.mixIn(e);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),l=b.WordArray=m.extend({init:function(a,e){a=
|
||||
this.words=a||[];this.sigBytes=e!=j?e:4*a.length},toString:function(a){return(a||d).stringify(this)},concat:function(a){var e=this.words,c=a.words,o=this.sigBytes,a=a.sigBytes;this.clamp();if(o%4)for(var b=0;b<a;b++)e[o+b>>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((o+b)%4);else if(65535<c.length)for(b=0;b<a;b+=4)e[o+b>>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=i.ceil(e/4)},clone:function(){var a=
|
||||
m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c<a;c+=4)e.push(4294967296*i.random()|0);return l.create(e,a)}}),n=f.enc={},d=n.Hex={stringify:function(a){for(var e=a.words,a=a.sigBytes,c=[],b=0;b<a;b++){var d=e[b>>>2]>>>24-8*(b%4)&255;c.push((d>>>4).toString(16));c.push((d&15).toString(16))}return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b<e;b+=2)c[b>>>3]|=parseInt(a.substr(b,2),16)<<24-4*(b%8);return l.create(c,e/2)}},h=n.Latin1={stringify:function(a){for(var e=
|
||||
a.words,a=a.sigBytes,b=[],d=0;d<a;d++)b.push(String.fromCharCode(e[d>>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return l.create(c,b)}},k=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(h.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return h.parse(unescape(encodeURIComponent(a)))}},g=b.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=l.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,g=d/(4*f),g=a?i.ceil(g):i.max((g|0)-this._minBufferSize,0),a=g*f,d=i.min(4*a,d);if(a){for(var h=0;h<a;h+=f)this._doProcessBlock(c,h);h=c.splice(0,a);b.sigBytes-=d}return l.create(h,d)},clone:function(){var a=m.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});b.Hasher=g.extend({init:function(){this.reset()},
|
||||
reset:function(){g.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=g.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return p.HMAC.create(a,c).finalize(b)}}});var p=f.algo={};return f}(Math);
|
||||
(function(){var i=CryptoJS,j=i.lib,f=j.WordArray,j=j.Hasher,b=[],m=i.algo.SHA1=j.extend({_doReset:function(){this._hash=f.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,i){for(var d=this._hash.words,h=d[0],k=d[1],g=d[2],j=d[3],a=d[4],e=0;80>e;e++){if(16>e)b[e]=f[i+e]|0;else{var c=b[e-3]^b[e-8]^b[e-14]^b[e-16];b[e]=c<<1|c>>>31}c=(h<<5|h>>>27)+a+b[e];c=20>e?c+((k&g|~k&j)+1518500249):40>e?c+((k^g^j)+1859775393):60>e?c+((k&g|k&j|g&j)-1894007588):c+((k^g^j)-
|
||||
899497514);a=j;j=g;g=k<<30|k>>>2;k=h;h=c}d[0]=d[0]+h|0;d[1]=d[1]+k|0;d[2]=d[2]+g|0;d[3]=d[3]+j|0;d[4]=d[4]+a|0},_doFinalize:function(){var b=this._data,f=b.words,d=8*this._nDataBytes,h=8*b.sigBytes;f[h>>>5]|=128<<24-h%32;f[(h+64>>>9<<4)+15]=d;b.sigBytes=4*f.length;this._process()}});i.SHA1=j._createHelper(m);i.HmacSHA1=j._createHmacHelper(m)})();
|
||||
(function(){var i=CryptoJS,j=i.enc.Utf8;i.algo.HMAC=i.lib.Base.extend({init:function(f,b){f=this._hasher=f.create();"string"==typeof b&&(b=j.parse(b));var i=f.blockSize,l=4*i;b.sigBytes>l&&(b=f.finalize(b));for(var n=this._oKey=b.clone(),d=this._iKey=b.clone(),h=n.words,k=d.words,g=0;g<i;g++)h[g]^=1549556828,k[g]^=909522486;n.sigBytes=d.sigBytes=l;this.reset()},reset:function(){var f=this._hasher;f.reset();f.update(this._iKey)},update:function(f){this._hasher.update(f);return this},finalize:function(f){var b=
|
||||
this._hasher,f=b.finalize(f);b.reset();return b.finalize(this._oKey.clone().concat(f))}})})();
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(h,j){var d={},f=d.lib={},k=f.Base=function(){function a(){}return{extend:function(n){a.prototype=this;var e=new a;n&&e.mixIn(n);e.$super=this;return e},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var e in a)a.hasOwnProperty(e)&&(this[e]=a[e]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),i=f.WordArray=k.extend({init:function(a,n){a=
|
||||
this.words=a||[];this.sigBytes=n!=j?n:4*a.length},toString:function(a){return(a||l).stringify(this)},concat:function(a){var n=this.words,e=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var b=0;b<a;b++)n[c+b>>>2]|=(e[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535<e.length)for(b=0;b<a;b+=4)n[c+b>>>2]=e[b>>>2];else n.push.apply(n,e);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=
|
||||
k.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],e=0;e<a;e+=4)b.push(4294967296*h.random()|0);return i.create(b,a)}}),o=d.enc={},l=o.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,e=[],c=0;c<a;c++){var d=b[c>>>2]>>>24-8*(c%4)&255;e.push((d>>>4).toString(16));e.push((d&15).toString(16))}return e.join("")},parse:function(a){for(var b=a.length,e=[],c=0;c<b;c+=2)e[c>>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return i.create(e,b/2)}},r=o.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,e=[],c=0;c<a;c++)e.push(String.fromCharCode(b[c>>>2]>>>24-8*(c%4)&255));return e.join("")},parse:function(a){for(var b=a.length,e=[],c=0;c<b;c++)e[c>>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return i.create(e,b)}},s=o.Utf8={stringify:function(a){try{return decodeURIComponent(escape(r.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return r.parse(unescape(encodeURIComponent(a)))}},b=f.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=i.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=s.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,e=b.words,c=b.sigBytes,d=this.blockSize,f=c/(4*d),f=a?h.ceil(f):h.max((f|0)-this._minBufferSize,0),a=f*d,c=h.min(4*a,c);if(a){for(var g=0;g<a;g+=d)this._doProcessBlock(e,g);g=e.splice(0,a);b.sigBytes-=c}return i.create(g,c)},clone:function(){var a=k.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});f.Hasher=b.extend({init:function(){this.reset()},
|
||||
reset:function(){b.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=b.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,e){return a.create(e).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return g.HMAC.create(a,e).finalize(b)}}});var g=d.algo={};return d}(Math);
|
||||
(function(h){var j=CryptoJS,d=j.lib,f=d.WordArray,d=d.Hasher,k=j.algo,i=[],o=[];(function(){function d(a){for(var b=h.sqrt(a),e=2;e<=b;e++)if(!(a%e))return!1;return!0}function f(a){return 4294967296*(a-(a|0))|0}for(var b=2,g=0;64>g;)d(b)&&(8>g&&(i[g]=f(h.pow(b,0.5))),o[g]=f(h.pow(b,1/3)),g++),b++})();var l=[],k=k.SHA256=d.extend({_doReset:function(){this._hash=f.create(i.slice(0))},_doProcessBlock:function(d,f){for(var b=this._hash.words,g=b[0],a=b[1],h=b[2],e=b[3],c=b[4],k=b[5],i=b[6],j=b[7],m=0;64>
|
||||
m;m++){if(16>m)l[m]=d[f+m]|0;else{var p=l[m-15],q=l[m-2];l[m]=((p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3)+l[m-7]+((q<<15|q>>>17)^(q<<13|q>>>19)^q>>>10)+l[m-16]}p=j+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&k^~c&i)+o[m]+l[m];q=((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+(g&a^g&h^a&h);j=i;i=k;k=c;c=e+p|0;e=h;h=a;a=g;g=p+q|0}b[0]=b[0]+g|0;b[1]=b[1]+a|0;b[2]=b[2]+h|0;b[3]=b[3]+e|0;b[4]=b[4]+c|0;b[5]=b[5]+k|0;b[6]=b[6]+i|0;b[7]=b[7]+j|0},_doFinalize:function(){var d=this._data,f=d.words,b=8*this._nDataBytes,
|
||||
g=8*d.sigBytes;f[g>>>5]|=128<<24-g%32;f[(g+64>>>9<<4)+15]=b;d.sigBytes=4*f.length;this._process()}});j.SHA256=d._createHelper(k);j.HmacSHA256=d._createHmacHelper(k)})(Math);
|
||||
(function(){var h=CryptoJS,j=h.lib.WordArray,d=h.algo,f=d.SHA256,d=d.SHA224=f.extend({_doReset:function(){this._hash=j.create([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){f._doFinalize.call(this);this._hash.sigBytes-=4}});h.SHA224=f._createHelper(d);h.HmacSHA224=f._createHmacHelper(d)})();
|
||||
(function(){var h=CryptoJS,j=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(d,f){d=this._hasher=d.create();"string"==typeof f&&(f=j.parse(f));var h=d.blockSize,i=4*h;f.sigBytes>i&&(f=d.finalize(f));for(var o=this._oKey=f.clone(),l=this._iKey=f.clone(),r=o.words,s=l.words,b=0;b<h;b++)r[b]^=1549556828,s[b]^=909522486;o.sigBytes=l.sigBytes=i;this.reset()},reset:function(){var d=this._hasher;d.reset();d.update(this._iKey)},update:function(d){this._hasher.update(d);return this},finalize:function(d){var f=
|
||||
this._hasher,d=f.finalize(d);f.reset();return f.finalize(this._oKey.clone().concat(d))}})})();
|
|
@ -1,17 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(h,i){var e={},f=e.lib={},l=f.Base=function(){function a(){}return{extend:function(j){a.prototype=this;var d=new a;j&&d.mixIn(j);d.$super=this;return d},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var d in a)a.hasOwnProperty(d)&&(this[d]=a[d]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),k=f.WordArray=l.extend({init:function(a,j){a=
|
||||
this.words=a||[];this.sigBytes=j!=i?j:4*a.length},toString:function(a){return(a||m).stringify(this)},concat:function(a){var j=this.words,d=a.words,c=this.sigBytes,a=a.sigBytes;this.clamp();if(c%4)for(var b=0;b<a;b++)j[c+b>>>2]|=(d[b>>>2]>>>24-8*(b%4)&255)<<24-8*((c+b)%4);else if(65535<d.length)for(b=0;b<a;b+=4)j[c+b>>>2]=d[b>>>2];else j.push.apply(j,d);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=h.ceil(b/4)},clone:function(){var a=
|
||||
l.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],d=0;d<a;d+=4)b.push(4294967296*h.random()|0);return k.create(b,a)}}),o=e.enc={},m=o.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,d=[],c=0;c<a;c++){var e=b[c>>>2]>>>24-8*(c%4)&255;d.push((e>>>4).toString(16));d.push((e&15).toString(16))}return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c+=2)d[c>>>3]|=parseInt(a.substr(c,2),16)<<24-4*(c%8);return k.create(d,b/2)}},q=o.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,d=[],c=0;c<a;c++)d.push(String.fromCharCode(b[c>>>2]>>>24-8*(c%4)&255));return d.join("")},parse:function(a){for(var b=a.length,d=[],c=0;c<b;c++)d[c>>>2]|=(a.charCodeAt(c)&255)<<24-8*(c%4);return k.create(d,b)}},r=o.Utf8={stringify:function(a){try{return decodeURIComponent(escape(q.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return q.parse(unescape(encodeURIComponent(a)))}},b=f.BufferedBlockAlgorithm=l.extend({reset:function(){this._data=k.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=r.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,d=b.words,c=b.sigBytes,e=this.blockSize,g=c/(4*e),g=a?h.ceil(g):h.max((g|0)-this._minBufferSize,0),a=g*e,c=h.min(4*a,c);if(a){for(var f=0;f<a;f+=e)this._doProcessBlock(d,f);f=d.splice(0,a);b.sigBytes-=c}return k.create(f,c)},clone:function(){var a=l.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});f.Hasher=b.extend({init:function(){this.reset()},
|
||||
reset:function(){b.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=b.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,d){return a.create(d).finalize(b)}},_createHmacHelper:function(a){return function(b,d){return g.HMAC.create(a,d).finalize(b)}}});var g=e.algo={};return e}(Math);
|
||||
(function(h){var i=CryptoJS,e=i.lib,f=e.WordArray,e=e.Hasher,l=i.algo,k=[],o=[];(function(){function e(a){for(var b=h.sqrt(a),d=2;d<=b;d++)if(!(a%d))return!1;return!0}function f(a){return 4294967296*(a-(a|0))|0}for(var b=2,g=0;64>g;)e(b)&&(8>g&&(k[g]=f(h.pow(b,0.5))),o[g]=f(h.pow(b,1/3)),g++),b++})();var m=[],l=l.SHA256=e.extend({_doReset:function(){this._hash=f.create(k.slice(0))},_doProcessBlock:function(e,f){for(var b=this._hash.words,g=b[0],a=b[1],j=b[2],d=b[3],c=b[4],h=b[5],l=b[6],k=b[7],n=0;64>
|
||||
n;n++){if(16>n)m[n]=e[f+n]|0;else{var i=m[n-15],p=m[n-2];m[n]=((i<<25|i>>>7)^(i<<14|i>>>18)^i>>>3)+m[n-7]+((p<<15|p>>>17)^(p<<13|p>>>19)^p>>>10)+m[n-16]}i=k+((c<<26|c>>>6)^(c<<21|c>>>11)^(c<<7|c>>>25))+(c&h^~c&l)+o[n]+m[n];p=((g<<30|g>>>2)^(g<<19|g>>>13)^(g<<10|g>>>22))+(g&a^g&j^a&j);k=l;l=h;h=c;c=d+i|0;d=j;j=a;a=g;g=i+p|0}b[0]=b[0]+g|0;b[1]=b[1]+a|0;b[2]=b[2]+j|0;b[3]=b[3]+d|0;b[4]=b[4]+c|0;b[5]=b[5]+h|0;b[6]=b[6]+l|0;b[7]=b[7]+k|0},_doFinalize:function(){var e=this._data,f=e.words,b=8*this._nDataBytes,
|
||||
g=8*e.sigBytes;f[g>>>5]|=128<<24-g%32;f[(g+64>>>9<<4)+15]=b;e.sigBytes=4*f.length;this._process()}});i.SHA256=e._createHelper(l);i.HmacSHA256=e._createHmacHelper(l)})(Math);
|
||||
(function(){var h=CryptoJS,i=h.enc.Utf8;h.algo.HMAC=h.lib.Base.extend({init:function(e,f){e=this._hasher=e.create();"string"==typeof f&&(f=i.parse(f));var h=e.blockSize,k=4*h;f.sigBytes>k&&(f=e.finalize(f));for(var o=this._oKey=f.clone(),m=this._iKey=f.clone(),q=o.words,r=m.words,b=0;b<h;b++)q[b]^=1549556828,r[b]^=909522486;o.sigBytes=m.sigBytes=k;this.reset()},reset:function(){var e=this._hasher;e.reset();e.update(this._iKey)},update:function(e){this._hasher.update(e);return this},finalize:function(e){var f=
|
||||
this._hasher,e=f.finalize(e);f.reset();return f.finalize(this._oKey.clone().concat(e))}})})();
|
|
@ -1,26 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(a,d){var b={},c=b.lib={},i=c.Base=function(){function a(){}return{extend:function(j){a.prototype=this;var f=new a;j&&f.mixIn(j);f.$super=this;return f},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var u in a)a.hasOwnProperty(u)&&(this[u]=a[u]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),k=c.WordArray=i.extend({init:function(a,j){a=
|
||||
this.words=a||[];this.sigBytes=j!=d?j:4*a.length},toString:function(a){return(a||q).stringify(this)},concat:function(a){var j=this.words,f=a.words,e=this.sigBytes,a=a.sigBytes;this.clamp();if(e%4)for(var b=0;b<a;b++)j[e+b>>>2]|=(f[b>>>2]>>>24-8*(b%4)&255)<<24-8*((e+b)%4);else if(65535<f.length)for(b=0;b<a;b+=4)j[e+b>>>2]=f[b>>>2];else j.push.apply(j,f);this.sigBytes+=a;return this},clamp:function(){var u=this.words,b=this.sigBytes;u[b>>>2]&=4294967295<<32-8*(b%4);u.length=a.ceil(b/4)},clone:function(){var a=
|
||||
i.clone.call(this);a.words=this.words.slice(0);return a},random:function(u){for(var b=[],f=0;f<u;f+=4)b.push(4294967296*a.random()|0);return k.create(b,u)}}),x=b.enc={},q=x.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,f=[],e=0;e<a;e++){var c=b[e>>>2]>>>24-8*(e%4)&255;f.push((c>>>4).toString(16));f.push((c&15).toString(16))}return f.join("")},parse:function(a){for(var b=a.length,f=[],e=0;e<b;e+=2)f[e>>>3]|=parseInt(a.substr(e,2),16)<<24-4*(e%8);return k.create(f,b/2)}},l=x.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,f=[],e=0;e<a;e++)f.push(String.fromCharCode(b[e>>>2]>>>24-8*(e%4)&255));return f.join("")},parse:function(a){for(var b=a.length,f=[],e=0;e<b;e++)f[e>>>2]|=(a.charCodeAt(e)&255)<<24-8*(e%4);return k.create(f,b)}},A=x.Utf8={stringify:function(a){try{return decodeURIComponent(escape(l.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return l.parse(unescape(encodeURIComponent(a)))}},m=c.BufferedBlockAlgorithm=i.extend({reset:function(){this._data=k.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=A.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(b){var c=this._data,f=c.words,e=c.sigBytes,m=this.blockSize,l=e/(4*m),l=b?a.ceil(l):a.max((l|0)-this._minBufferSize,0),b=l*m,e=a.min(4*b,e);if(b){for(var d=0;d<b;d+=m)this._doProcessBlock(f,d);d=f.splice(0,b);c.sigBytes-=e}return k.create(d,e)},clone:function(){var a=i.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});c.Hasher=m.extend({init:function(){this.reset()},
|
||||
reset:function(){m.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=m.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return ga.HMAC.create(a,c).finalize(b)}}});var ga=b.algo={};return b}(Math);
|
||||
(function(a){var d=CryptoJS,b=d.lib,c=b.Base,i=b.WordArray,d=d.x64={};d.Word=c.extend({init:function(a,b){this.high=a;this.low=b}});d.WordArray=c.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=a?c:8*b.length},toX32:function(){for(var a=this.words,b=a.length,c=[],d=0;d<b;d++){var A=a[d];c.push(A.high);c.push(A.low)}return i.create(c,this.sigBytes)},clone:function(){for(var a=c.clone.call(this),b=a.words=this.words.slice(0),d=b.length,l=0;l<d;l++)b[l]=b[l].clone();return a}})})();
|
||||
(function(){function a(){return i.create.apply(i,arguments)}var d=CryptoJS,b=d.lib.Hasher,c=d.x64,i=c.Word,k=c.WordArray,c=d.algo,x=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),
|
||||
a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,
|
||||
2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),
|
||||
a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,
|
||||
3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],q=[];(function(){for(var b=0;80>b;b++)q[b]=a()})();c=c.SHA512=b.extend({_doReset:function(){this._hash=k.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,d=c[0],i=c[1],j=c[2],f=c[3],e=c[4],k=c[5],K=
|
||||
c[6],c=c[7],Y=d.high,L=d.low,Z=i.high,M=i.low,$=j.high,N=j.low,aa=f.high,O=f.low,ba=e.high,P=e.low,ca=k.high,Q=k.low,da=K.high,R=K.low,ea=c.high,S=c.low,r=Y,n=L,E=Z,C=M,F=$,D=N,V=aa,G=O,s=ba,o=P,T=ca,H=Q,U=da,I=R,W=ea,J=S,t=0;80>t;t++){var y=q[t];if(16>t)var p=y.high=a[b+2*t]|0,g=y.low=a[b+2*t+1]|0;else{var p=q[t-15],g=p.high,v=p.low,p=(v<<31|g>>>1)^(v<<24|g>>>8)^g>>>7,v=(g<<31|v>>>1)^(g<<24|v>>>8)^(g<<25|v>>>7),B=q[t-2],g=B.high,h=B.low,B=(h<<13|g>>>19)^(g<<3|h>>>29)^g>>>6,h=(g<<13|h>>>19)^(h<<3|
|
||||
g>>>29)^(g<<26|h>>>6),g=q[t-7],X=g.high,z=q[t-16],w=z.high,z=z.low,g=v+g.low,p=p+X+(g>>>0<v>>>0?1:0),g=g+h,p=p+B+(g>>>0<h>>>0?1:0),g=g+z,p=p+w+(g>>>0<z>>>0?1:0);y.high=p;y.low=g}var X=s&T^~s&U,z=o&H^~o&I,y=r&E^r&F^E&F,ha=n&C^n&D^C&D,v=(n<<4|r>>>28)^(r<<30|n>>>2)^(r<<25|n>>>7),B=(r<<4|n>>>28)^(n<<30|r>>>2)^(n<<25|r>>>7),h=x[t],ia=h.high,fa=h.low,h=J+((s<<18|o>>>14)^(s<<14|o>>>18)^(o<<23|s>>>9)),w=W+((o<<18|s>>>14)^(o<<14|s>>>18)^(s<<23|o>>>9))+(h>>>0<J>>>0?1:0),h=h+z,w=w+X+(h>>>0<z>>>0?1:0),h=h+fa,
|
||||
w=w+ia+(h>>>0<fa>>>0?1:0),h=h+g,w=w+p+(h>>>0<g>>>0?1:0),g=B+ha,y=v+y+(g>>>0<B>>>0?1:0),W=U,J=I,U=T,I=H,T=s,H=o,o=G+h|0,s=V+w+(o>>>0<G>>>0?1:0)|0,V=F,G=D,F=E,D=C,E=r,C=n,n=h+g|0,r=w+y+(n>>>0<h>>>0?1:0)|0}L=d.low=L+n|0;d.high=Y+r+(L>>>0<n>>>0?1:0)|0;M=i.low=M+C|0;i.high=Z+E+(M>>>0<C>>>0?1:0)|0;N=j.low=N+D|0;j.high=$+F+(N>>>0<D>>>0?1:0)|0;O=f.low=O+G|0;f.high=aa+V+(O>>>0<G>>>0?1:0)|0;P=e.low=P+o|0;e.high=ba+s+(P>>>0<o>>>0?1:0)|0;Q=k.low=Q+H|0;k.high=ca+T+(Q>>>0<H>>>0?1:0)|0;R=K.low=R+I|0;K.high=da+U+
|
||||
(R>>>0<I>>>0?1:0)|0;S=c.low=S+J|0;c.high=ea+W+(S>>>0<J>>>0?1:0)|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,d=8*a.sigBytes;b[d>>>5]|=128<<24-d%32;b[(d+128>>>10<<5)+31]=c;a.sigBytes=4*b.length;this._process();this._hash=this._hash.toX32()},blockSize:32});d.SHA512=b._createHelper(c);d.HmacSHA512=b._createHmacHelper(c)})();
|
||||
(function(){var a=CryptoJS,d=a.x64,b=d.Word,c=d.WordArray,d=a.algo,i=d.SHA512,d=d.SHA384=i.extend({_doReset:function(){this._hash=c.create([b.create(3418070365,3238371032),b.create(1654270250,914150663),b.create(2438529370,812702999),b.create(355462360,4144912697),b.create(1731405415,4290775857),b.create(2394180231,1750603025),b.create(3675008525,1694076839),b.create(1203062813,3204075428)])},_doFinalize:function(){i._doFinalize.call(this);this._hash.sigBytes-=16}});a.SHA384=i._createHelper(d);a.HmacSHA384=
|
||||
i._createHmacHelper(d)})();
|
||||
(function(){var a=CryptoJS,d=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,c){a=this._hasher=a.create();"string"==typeof c&&(c=d.parse(c));var i=a.blockSize,k=4*i;c.sigBytes>k&&(c=a.finalize(c));for(var x=this._oKey=c.clone(),q=this._iKey=c.clone(),l=x.words,A=q.words,m=0;m<i;m++)l[m]^=1549556828,A[m]^=909522486;x.sigBytes=q.sigBytes=k;this.reset()},reset:function(){var a=this._hasher;a.reset();a.update(this._iKey)},update:function(a){this._hasher.update(a);return this},finalize:function(a){var c=
|
||||
this._hasher,a=c.finalize(a);c.reset();return c.finalize(this._oKey.clone().concat(a))}})})();
|
|
@ -1,24 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(a,g){var c={},b=c.lib={},k=b.Base=function(){function a(){}return{extend:function(h){a.prototype=this;var e=new a;h&&e.mixIn(h);e.$super=this;return e},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var m in a)a.hasOwnProperty(m)&&(this[m]=a[m]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),n=b.WordArray=k.extend({init:function(a,h){a=
|
||||
this.words=a||[];this.sigBytes=h!=g?h:4*a.length},toString:function(a){return(a||r).stringify(this)},concat:function(a){var h=this.words,e=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b<a;b++)h[d+b>>>2]|=(e[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535<e.length)for(b=0;b<a;b+=4)h[d+b>>>2]=e[b>>>2];else h.push.apply(h,e);this.sigBytes+=a;return this},clamp:function(){var m=this.words,h=this.sigBytes;m[h>>>2]&=4294967295<<32-8*(h%4);m.length=a.ceil(h/4)},clone:function(){var a=
|
||||
k.clone.call(this);a.words=this.words.slice(0);return a},random:function(m){for(var h=[],b=0;b<m;b+=4)h.push(4294967296*a.random()|0);return n.create(h,m)}}),x=c.enc={},r=x.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,e=[],d=0;d<a;d++){var l=b[d>>>2]>>>24-8*(d%4)&255;e.push((l>>>4).toString(16));e.push((l&15).toString(16))}return e.join("")},parse:function(a){for(var b=a.length,e=[],d=0;d<b;d+=2)e[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return n.create(e,b/2)}},j=x.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,e=[],d=0;d<a;d++)e.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return e.join("")},parse:function(a){for(var b=a.length,e=[],d=0;d<b;d++)e[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return n.create(e,b)}},J=x.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},l=b.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=n.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=J.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(b){var h=this._data,e=h.words,d=h.sigBytes,l=this.blockSize,c=d/(4*l),c=b?a.ceil(c):a.max((c|0)-this._minBufferSize,0),b=c*l,d=a.min(4*b,d);if(b){for(var j=0;j<b;j+=l)this._doProcessBlock(e,j);j=e.splice(0,b);h.sigBytes-=d}return n.create(j,d)},clone:function(){var a=k.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});b.Hasher=l.extend({init:function(){this.reset()},
|
||||
reset:function(){l.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=l.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,e){return a.create(e).finalize(b)}},_createHmacHelper:function(a){return function(b,e){return fa.HMAC.create(a,e).finalize(b)}}});var fa=c.algo={};return c}(Math);
|
||||
(function(a){var g=CryptoJS,c=g.lib,b=c.Base,k=c.WordArray,g=g.x64={};g.Word=b.extend({init:function(a,b){this.high=a;this.low=b}});g.WordArray=b.extend({init:function(b,c){b=this.words=b||[];this.sigBytes=c!=a?c:8*b.length},toX32:function(){for(var a=this.words,b=a.length,c=[],j=0;j<b;j++){var g=a[j];c.push(g.high);c.push(g.low)}return k.create(c,this.sigBytes)},clone:function(){for(var a=b.clone.call(this),c=a.words=this.words.slice(0),g=c.length,j=0;j<g;j++)c[j]=c[j].clone();return a}})})();
|
||||
(function(){function a(){return k.create.apply(k,arguments)}var g=CryptoJS,c=g.lib.Hasher,b=g.x64,k=b.Word,n=b.WordArray,b=g.algo,x=[a(1116352408,3609767458),a(1899447441,602891725),a(3049323471,3964484399),a(3921009573,2173295548),a(961987163,4081628472),a(1508970993,3053834265),a(2453635748,2937671579),a(2870763221,3664609560),a(3624381080,2734883394),a(310598401,1164996542),a(607225278,1323610764),a(1426881987,3590304994),a(1925078388,4068182383),a(2162078206,991336113),a(2614888103,633803317),
|
||||
a(3248222580,3479774868),a(3835390401,2666613458),a(4022224774,944711139),a(264347078,2341262773),a(604807628,2007800933),a(770255983,1495990901),a(1249150122,1856431235),a(1555081692,3175218132),a(1996064986,2198950837),a(2554220882,3999719339),a(2821834349,766784016),a(2952996808,2566594879),a(3210313671,3203337956),a(3336571891,1034457026),a(3584528711,2466948901),a(113926993,3758326383),a(338241895,168717936),a(666307205,1188179964),a(773529912,1546045734),a(1294757372,1522805485),a(1396182291,
|
||||
2643833823),a(1695183700,2343527390),a(1986661051,1014477480),a(2177026350,1206759142),a(2456956037,344077627),a(2730485921,1290863460),a(2820302411,3158454273),a(3259730800,3505952657),a(3345764771,106217008),a(3516065817,3606008344),a(3600352804,1432725776),a(4094571909,1467031594),a(275423344,851169720),a(430227734,3100823752),a(506948616,1363258195),a(659060556,3750685593),a(883997877,3785050280),a(958139571,3318307427),a(1322822218,3812723403),a(1537002063,2003034995),a(1747873779,3602036899),
|
||||
a(1955562222,1575990012),a(2024104815,1125592928),a(2227730452,2716904306),a(2361852424,442776044),a(2428436474,593698344),a(2756734187,3733110249),a(3204031479,2999351573),a(3329325298,3815920427),a(3391569614,3928383900),a(3515267271,566280711),a(3940187606,3454069534),a(4118630271,4000239992),a(116418474,1914138554),a(174292421,2731055270),a(289380356,3203993006),a(460393269,320620315),a(685471733,587496836),a(852142971,1086792851),a(1017036298,365543100),a(1126000580,2618297676),a(1288033470,
|
||||
3409855158),a(1501505948,4234509866),a(1607167915,987167468),a(1816402316,1246189591)],r=[];(function(){for(var b=0;80>b;b++)r[b]=a()})();b=b.SHA512=c.extend({_doReset:function(){this._hash=n.create([a(1779033703,4089235720),a(3144134277,2227873595),a(1013904242,4271175723),a(2773480762,1595750129),a(1359893119,2917565137),a(2600822924,725511199),a(528734635,4215389547),a(1541459225,327033209)])},_doProcessBlock:function(a,b){for(var c=this._hash.words,g=c[0],m=c[1],h=c[2],e=c[3],d=c[4],k=c[5],n=
|
||||
c[6],c=c[7],X=g.high,K=g.low,Y=m.high,L=m.low,Z=h.high,M=h.low,$=e.high,N=e.low,aa=d.high,O=d.low,ba=k.high,P=k.low,ca=n.high,Q=n.low,da=c.high,R=c.low,s=X,o=K,D=Y,B=L,E=Z,C=M,U=$,F=N,t=aa,p=O,S=ba,G=P,T=ca,H=Q,V=da,I=R,u=0;80>u;u++){var y=r[u];if(16>u)var q=y.high=a[b+2*u]|0,f=y.low=a[b+2*u+1]|0;else{var q=r[u-15],f=q.high,v=q.low,q=(v<<31|f>>>1)^(v<<24|f>>>8)^f>>>7,v=(f<<31|v>>>1)^(f<<24|v>>>8)^(f<<25|v>>>7),A=r[u-2],f=A.high,i=A.low,A=(i<<13|f>>>19)^(f<<3|i>>>29)^f>>>6,i=(f<<13|i>>>19)^(i<<3|f>>>
|
||||
29)^(f<<26|i>>>6),f=r[u-7],W=f.high,z=r[u-16],w=z.high,z=z.low,f=v+f.low,q=q+W+(f>>>0<v>>>0?1:0),f=f+i,q=q+A+(f>>>0<i>>>0?1:0),f=f+z,q=q+w+(f>>>0<z>>>0?1:0);y.high=q;y.low=f}var W=t&S^~t&T,z=p&G^~p&H,y=s&D^s&E^D&E,ga=o&B^o&C^B&C,v=(o<<4|s>>>28)^(s<<30|o>>>2)^(s<<25|o>>>7),A=(s<<4|o>>>28)^(o<<30|s>>>2)^(o<<25|s>>>7),i=x[u],ha=i.high,ea=i.low,i=I+((t<<18|p>>>14)^(t<<14|p>>>18)^(p<<23|t>>>9)),w=V+((p<<18|t>>>14)^(p<<14|t>>>18)^(t<<23|p>>>9))+(i>>>0<I>>>0?1:0),i=i+z,w=w+W+(i>>>0<z>>>0?1:0),i=i+ea,w=w+
|
||||
ha+(i>>>0<ea>>>0?1:0),i=i+f,w=w+q+(i>>>0<f>>>0?1:0),f=A+ga,y=v+y+(f>>>0<A>>>0?1:0),V=T,I=H,T=S,H=G,S=t,G=p,p=F+i|0,t=U+w+(p>>>0<F>>>0?1:0)|0,U=E,F=C,E=D,C=B,D=s,B=o,o=i+f|0,s=w+y+(o>>>0<i>>>0?1:0)|0}K=g.low=K+o|0;g.high=X+s+(K>>>0<o>>>0?1:0)|0;L=m.low=L+B|0;m.high=Y+D+(L>>>0<B>>>0?1:0)|0;M=h.low=M+C|0;h.high=Z+E+(M>>>0<C>>>0?1:0)|0;N=e.low=N+F|0;e.high=$+U+(N>>>0<F>>>0?1:0)|0;O=d.low=O+p|0;d.high=aa+t+(O>>>0<p>>>0?1:0)|0;P=k.low=P+G|0;k.high=ba+S+(P>>>0<G>>>0?1:0)|0;Q=n.low=Q+H|0;n.high=ca+T+(Q>>>
|
||||
0<H>>>0?1:0)|0;R=c.low=R+I|0;c.high=da+V+(R>>>0<I>>>0?1:0)|0},_doFinalize:function(){var a=this._data,b=a.words,c=8*this._nDataBytes,g=8*a.sigBytes;b[g>>>5]|=128<<24-g%32;b[(g+128>>>10<<5)+31]=c;a.sigBytes=4*b.length;this._process();this._hash=this._hash.toX32()},blockSize:32});g.SHA512=c._createHelper(b);g.HmacSHA512=c._createHmacHelper(b)})();
|
||||
(function(){var a=CryptoJS,g=a.enc.Utf8;a.algo.HMAC=a.lib.Base.extend({init:function(a,b){a=this._hasher=a.create();"string"==typeof b&&(b=g.parse(b));var k=a.blockSize,n=4*k;b.sigBytes>n&&(b=a.finalize(b));for(var x=this._oKey=b.clone(),r=this._iKey=b.clone(),j=x.words,J=r.words,l=0;l<k;l++)j[l]^=1549556828,J[l]^=909522486;x.sigBytes=r.sigBytes=n;this.reset()},reset:function(){var a=this._hasher;a.reset();a.update(this._iKey)},update:function(a){this._hasher.update(a);return this},finalize:function(a){var b=
|
||||
this._hasher,a=b.finalize(a);b.reset();return b.finalize(this._oKey.clone().concat(a))}})})();
|
|
@ -1,16 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(o,q){var l={},m=l.lib={},n=m.Base=function(){function a(){}return{extend:function(e){a.prototype=this;var c=new a;e&&c.mixIn(e);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),j=m.WordArray=n.extend({init:function(a,e){a=
|
||||
this.words=a||[];this.sigBytes=e!=q?e:4*a.length},toString:function(a){return(a||r).stringify(this)},concat:function(a){var e=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var b=0;b<a;b++)e[d+b>>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((d+b)%4);else if(65535<c.length)for(b=0;b<a;b+=4)e[d+b>>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=o.ceil(e/4)},clone:function(){var a=
|
||||
n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c<a;c+=4)e.push(4294967296*o.random()|0);return j.create(e,a)}}),k=l.enc={},r=k.Hex={stringify:function(a){for(var e=a.words,a=a.sigBytes,c=[],d=0;d<a;d++){var b=e[d>>>2]>>>24-8*(d%4)&255;c.push((b>>>4).toString(16));c.push((b&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return j.create(c,b/2)}},p=k.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return j.create(c,b)}},h=k.Utf8={stringify:function(a){try{return decodeURIComponent(escape(p.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return p.parse(unescape(encodeURIComponent(a)))}},b=m.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=j.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=h.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,i=d/(4*f),i=a?o.ceil(i):o.max((i|0)-this._minBufferSize,0),a=i*f,d=o.min(4*a,d);if(a){for(var h=0;h<a;h+=f)this._doProcessBlock(c,h);h=c.splice(0,a);b.sigBytes-=d}return j.create(h,d)},clone:function(){var a=n.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});m.Hasher=b.extend({init:function(){this.reset()},
|
||||
reset:function(){b.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=b.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return f.HMAC.create(a,c).finalize(b)}}});var f=l.algo={};return l}(Math);
|
||||
(function(o){function q(b,f,a,e,c,d,g){b=b+(f&a|~f&e)+c+g;return(b<<d|b>>>32-d)+f}function l(b,f,a,e,c,d,g){b=b+(f&e|a&~e)+c+g;return(b<<d|b>>>32-d)+f}function m(b,f,a,e,c,d,g){b=b+(f^a^e)+c+g;return(b<<d|b>>>32-d)+f}function n(b,f,a,e,c,d,g){b=b+(a^(f|~e))+c+g;return(b<<d|b>>>32-d)+f}var j=CryptoJS,k=j.lib,r=k.WordArray,k=k.Hasher,p=j.algo,h=[];(function(){for(var b=0;64>b;b++)h[b]=4294967296*o.abs(o.sin(b+1))|0})();p=p.MD5=k.extend({_doReset:function(){this._hash=r.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(b,f){for(var a=0;16>a;a++){var e=f+a,c=b[e];b[e]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var e=this._hash.words,c=e[0],d=e[1],g=e[2],i=e[3],a=0;64>a;a+=4)16>a?(c=q(c,d,g,i,b[f+a],7,h[a]),i=q(i,c,d,g,b[f+a+1],12,h[a+1]),g=q(g,i,c,d,b[f+a+2],17,h[a+2]),d=q(d,g,i,c,b[f+a+3],22,h[a+3])):32>a?(c=l(c,d,g,i,b[f+(a+1)%16],5,h[a]),i=l(i,c,d,g,b[f+(a+6)%16],9,h[a+1]),g=l(g,i,c,d,b[f+(a+11)%16],14,h[a+2]),d=l(d,g,i,c,b[f+a%16],20,h[a+3])):48>a?(c=
|
||||
m(c,d,g,i,b[f+(3*a+5)%16],4,h[a]),i=m(i,c,d,g,b[f+(3*a+8)%16],11,h[a+1]),g=m(g,i,c,d,b[f+(3*a+11)%16],16,h[a+2]),d=m(d,g,i,c,b[f+(3*a+14)%16],23,h[a+3])):(c=n(c,d,g,i,b[f+3*a%16],6,h[a]),i=n(i,c,d,g,b[f+(3*a+7)%16],10,h[a+1]),g=n(g,i,c,d,b[f+(3*a+14)%16],15,h[a+2]),d=n(d,g,i,c,b[f+(3*a+5)%16],21,h[a+3]));e[0]=e[0]+c|0;e[1]=e[1]+d|0;e[2]=e[2]+g|0;e[3]=e[3]+i|0},_doFinalize:function(){var b=this._data,f=b.words,a=8*this._nDataBytes,e=8*b.sigBytes;f[e>>>5]|=128<<24-e%32;f[(e+64>>>9<<4)+14]=(a<<8|a>>>
|
||||
24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(f.length+1);this._process();b=this._hash.words;for(f=0;4>f;f++)a=b[f],b[f]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});j.MD5=k._createHelper(p);j.HmacMD5=k._createHmacHelper(p)})(Math);
|
|
@ -1,18 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(g,i){var f={},b=f.lib={},m=b.Base=function(){function a(){}return{extend:function(e){a.prototype=this;var c=new a;e&&c.mixIn(e);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),l=b.WordArray=m.extend({init:function(a,e){a=
|
||||
this.words=a||[];this.sigBytes=e!=i?e:4*a.length},toString:function(a){return(a||d).stringify(this)},concat:function(a){var e=this.words,c=a.words,o=this.sigBytes,a=a.sigBytes;this.clamp();if(o%4)for(var b=0;b<a;b++)e[o+b>>>2]|=(c[b>>>2]>>>24-8*(b%4)&255)<<24-8*((o+b)%4);else if(65535<c.length)for(b=0;b<a;b+=4)e[o+b>>>2]=c[b>>>2];else e.push.apply(e,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,e=this.sigBytes;a[e>>>2]&=4294967295<<32-8*(e%4);a.length=g.ceil(e/4)},clone:function(){var a=
|
||||
m.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var e=[],c=0;c<a;c+=4)e.push(4294967296*g.random()|0);return l.create(e,a)}}),n=f.enc={},d=n.Hex={stringify:function(a){for(var e=a.words,a=a.sigBytes,c=[],b=0;b<a;b++){var d=e[b>>>2]>>>24-8*(b%4)&255;c.push((d>>>4).toString(16));c.push((d&15).toString(16))}return c.join("")},parse:function(a){for(var e=a.length,c=[],b=0;b<e;b+=2)c[b>>>3]|=parseInt(a.substr(b,2),16)<<24-4*(b%8);return l.create(c,e/2)}},j=n.Latin1={stringify:function(a){for(var e=
|
||||
a.words,a=a.sigBytes,b=[],d=0;d<a;d++)b.push(String.fromCharCode(e[d>>>2]>>>24-8*(d%4)&255));return b.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return l.create(c,b)}},k=n.Utf8={stringify:function(a){try{return decodeURIComponent(escape(j.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return j.parse(unescape(encodeURIComponent(a)))}},h=b.BufferedBlockAlgorithm=m.extend({reset:function(){this._data=l.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=k.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,j=this.blockSize,h=d/(4*j),h=a?g.ceil(h):g.max((h|0)-this._minBufferSize,0),a=h*j,d=g.min(4*a,d);if(a){for(var f=0;f<a;f+=j)this._doProcessBlock(c,f);f=c.splice(0,a);b.sigBytes-=d}return l.create(f,d)},clone:function(){var a=m.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});b.Hasher=h.extend({init:function(){this.reset()},
|
||||
reset:function(){h.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=h.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return u.HMAC.create(a,c).finalize(b)}}});var u=f.algo={};return f}(Math);
|
||||
(function(){var g=CryptoJS,i=g.lib,f=i.WordArray,i=i.Hasher,b=[],m=g.algo.SHA1=i.extend({_doReset:function(){this._hash=f.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(f,n){for(var d=this._hash.words,j=d[0],k=d[1],h=d[2],g=d[3],a=d[4],e=0;80>e;e++){if(16>e)b[e]=f[n+e]|0;else{var c=b[e-3]^b[e-8]^b[e-14]^b[e-16];b[e]=c<<1|c>>>31}c=(j<<5|j>>>27)+a+b[e];c=20>e?c+((k&h|~k&g)+1518500249):40>e?c+((k^h^g)+1859775393):60>e?c+((k&h|k&g|h&g)-1894007588):c+((k^h^g)-
|
||||
899497514);a=g;g=h;h=k<<30|k>>>2;k=j;j=c}d[0]=d[0]+j|0;d[1]=d[1]+k|0;d[2]=d[2]+h|0;d[3]=d[3]+g|0;d[4]=d[4]+a|0},_doFinalize:function(){var b=this._data,f=b.words,d=8*this._nDataBytes,j=8*b.sigBytes;f[j>>>5]|=128<<24-j%32;f[(j+64>>>9<<4)+15]=d;b.sigBytes=4*f.length;this._process()}});g.SHA1=i._createHelper(m);g.HmacSHA1=i._createHmacHelper(m)})();
|
||||
(function(){var g=CryptoJS,i=g.enc.Utf8;g.algo.HMAC=g.lib.Base.extend({init:function(f,b){f=this._hasher=f.create();"string"==typeof b&&(b=i.parse(b));var g=f.blockSize,l=4*g;b.sigBytes>l&&(b=f.finalize(b));for(var n=this._oKey=b.clone(),d=this._iKey=b.clone(),j=n.words,k=d.words,h=0;h<g;h++)j[h]^=1549556828,k[h]^=909522486;n.sigBytes=d.sigBytes=l;this.reset()},reset:function(){var f=this._hasher;f.reset();f.update(this._iKey)},update:function(f){this._hasher.update(f);return this},finalize:function(f){var b=
|
||||
this._hasher,f=b.finalize(f);b.reset();return b.finalize(this._oKey.clone().concat(f))}})})();
|
||||
(function(){var g=CryptoJS,i=g.lib,f=i.Base,b=i.WordArray,i=g.algo,m=i.HMAC,l=i.PBKDF2=f.extend({cfg:f.extend({keySize:4,hasher:i.SHA1,iterations:1}),init:function(b){this.cfg=this.cfg.extend(b)},compute:function(f,d){for(var g=this.cfg,k=m.create(g.hasher,f),h=b.create(),i=b.create([1]),a=h.words,e=i.words,c=g.keySize,g=g.iterations;a.length<c;){var l=k.update(d).finalize(i);k.reset();for(var q=l.words,t=q.length,r=l,s=1;s<g;s++){r=k.finalize(r);k.reset();for(var v=r.words,p=0;p<t;p++)q[p]^=v[p]}h.concat(l);
|
||||
e[0]++}h.sigBytes=4*c;return h}});g.PBKDF2=function(b,d,f){return l.create(f).compute(b,d)}})();
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(n,l){var i={},j=i.lib={},k=j.Base=function(){function b(){}return{extend:function(p){b.prototype=this;var a=new b;p&&a.mixIn(p);a.$super=this;return a},create:function(){var b=this.extend();b.init.apply(b,arguments);return b},init:function(){},mixIn:function(b){for(var a in b)b.hasOwnProperty(a)&&(this[a]=b[a]);b.hasOwnProperty("toString")&&(this.toString=b.toString)},clone:function(){return this.$super.extend(this)}}}(),e=j.WordArray=k.extend({init:function(b,a){b=
|
||||
this.words=b||[];this.sigBytes=a!=l?a:4*b.length},toString:function(b){return(b||c).stringify(this)},concat:function(b){var a=this.words,c=b.words,g=this.sigBytes,b=b.sigBytes;this.clamp();if(g%4)for(var h=0;h<b;h++)a[g+h>>>2]|=(c[h>>>2]>>>24-8*(h%4)&255)<<24-8*((g+h)%4);else if(65535<c.length)for(h=0;h<b;h+=4)a[g+h>>>2]=c[h>>>2];else a.push.apply(a,c);this.sigBytes+=b;return this},clamp:function(){var b=this.words,a=this.sigBytes;b[a>>>2]&=4294967295<<32-8*(a%4);b.length=n.ceil(a/4)},clone:function(){var b=
|
||||
k.clone.call(this);b.words=this.words.slice(0);return b},random:function(b){for(var a=[],c=0;c<b;c+=4)a.push(4294967296*n.random()|0);return e.create(a,b)}}),d=i.enc={},c=d.Hex={stringify:function(b){for(var a=b.words,b=b.sigBytes,c=[],g=0;g<b;g++){var h=a[g>>>2]>>>24-8*(g%4)&255;c.push((h>>>4).toString(16));c.push((h&15).toString(16))}return c.join("")},parse:function(b){for(var a=b.length,c=[],g=0;g<a;g+=2)c[g>>>3]|=parseInt(b.substr(g,2),16)<<24-4*(g%8);return e.create(c,a/2)}},a=d.Latin1={stringify:function(b){for(var a=
|
||||
b.words,b=b.sigBytes,c=[],g=0;g<b;g++)c.push(String.fromCharCode(a[g>>>2]>>>24-8*(g%4)&255));return c.join("")},parse:function(b){for(var a=b.length,c=[],g=0;g<a;g++)c[g>>>2]|=(b.charCodeAt(g)&255)<<24-8*(g%4);return e.create(c,a)}},f=d.Utf8={stringify:function(b){try{return decodeURIComponent(escape(a.stringify(b)))}catch(c){throw Error("Malformed UTF-8 data");}},parse:function(b){return a.parse(unescape(encodeURIComponent(b)))}},o=j.BufferedBlockAlgorithm=k.extend({reset:function(){this._data=e.create();
|
||||
this._nDataBytes=0},_append:function(b){"string"==typeof b&&(b=f.parse(b));this._data.concat(b);this._nDataBytes+=b.sigBytes},_process:function(b){var a=this._data,c=a.words,g=a.sigBytes,h=this.blockSize,m=g/(4*h),m=b?n.ceil(m):n.max((m|0)-this._minBufferSize,0),b=m*h,g=n.min(4*b,g);if(b){for(var o=0;o<b;o+=h)this._doProcessBlock(c,o);o=c.splice(0,b);a.sigBytes-=g}return e.create(o,g)},clone:function(){var b=k.clone.call(this);b._data=this._data.clone();return b},_minBufferSize:0});j.Hasher=o.extend({init:function(){this.reset()},
|
||||
reset:function(){o.reset.call(this);this._doReset()},update:function(b){this._append(b);this._process();return this},finalize:function(b){b&&this._append(b);this._doFinalize();return this._hash},clone:function(){var b=o.clone.call(this);b._hash=this._hash.clone();return b},blockSize:16,_createHelper:function(b){return function(a,c){return b.create(c).finalize(a)}},_createHmacHelper:function(b){return function(a,c){return q.HMAC.create(b,c).finalize(a)}}});var q=i.algo={};return i}(Math);
|
||||
(function(){var n=CryptoJS,l=n.lib.WordArray;n.enc.Base64={stringify:function(i){var j=i.words,k=i.sigBytes,e=this._map;i.clamp();for(var i=[],d=0;d<k;d+=3)for(var c=(j[d>>>2]>>>24-8*(d%4)&255)<<16|(j[d+1>>>2]>>>24-8*((d+1)%4)&255)<<8|j[d+2>>>2]>>>24-8*((d+2)%4)&255,a=0;4>a&&d+0.75*a<k;a++)i.push(e.charAt(c>>>6*(3-a)&63));if(j=e.charAt(64))for(;i.length%4;)i.push(j);return i.join("")},parse:function(i){var i=i.replace(/\s/g,""),j=i.length,k=this._map,e=k.charAt(64);e&&(e=i.indexOf(e),-1!=e&&(j=e));
|
||||
for(var e=[],d=0,c=0;c<j;c++)if(c%4){var a=k.indexOf(i.charAt(c-1))<<2*(c%4),f=k.indexOf(i.charAt(c))>>>6-2*(c%4);e[d>>>2]|=(a|f)<<24-8*(d%4);d++}return l.create(e,d)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
||||
(function(n){function l(a,c,b,d,f,g,h){a=a+(c&b|~c&d)+f+h;return(a<<g|a>>>32-g)+c}function i(a,c,b,d,f,g,h){a=a+(c&d|b&~d)+f+h;return(a<<g|a>>>32-g)+c}function j(a,c,b,d,f,g,h){a=a+(c^b^d)+f+h;return(a<<g|a>>>32-g)+c}function k(a,c,b,d,f,g,h){a=a+(b^(c|~d))+f+h;return(a<<g|a>>>32-g)+c}var e=CryptoJS,d=e.lib,c=d.WordArray,d=d.Hasher,a=e.algo,f=[];(function(){for(var a=0;64>a;a++)f[a]=4294967296*n.abs(n.sin(a+1))|0})();a=a.MD5=d.extend({_doReset:function(){this._hash=c.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(a,c){for(var b=0;16>b;b++){var d=c+b,e=a[d];a[d]=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360}for(var d=this._hash.words,e=d[0],g=d[1],h=d[2],m=d[3],b=0;64>b;b+=4)16>b?(e=l(e,g,h,m,a[c+b],7,f[b]),m=l(m,e,g,h,a[c+b+1],12,f[b+1]),h=l(h,m,e,g,a[c+b+2],17,f[b+2]),g=l(g,h,m,e,a[c+b+3],22,f[b+3])):32>b?(e=i(e,g,h,m,a[c+(b+1)%16],5,f[b]),m=i(m,e,g,h,a[c+(b+6)%16],9,f[b+1]),h=i(h,m,e,g,a[c+(b+11)%16],14,f[b+2]),g=i(g,h,m,e,a[c+b%16],20,f[b+3])):48>b?(e=
|
||||
j(e,g,h,m,a[c+(3*b+5)%16],4,f[b]),m=j(m,e,g,h,a[c+(3*b+8)%16],11,f[b+1]),h=j(h,m,e,g,a[c+(3*b+11)%16],16,f[b+2]),g=j(g,h,m,e,a[c+(3*b+14)%16],23,f[b+3])):(e=k(e,g,h,m,a[c+3*b%16],6,f[b]),m=k(m,e,g,h,a[c+(3*b+7)%16],10,f[b+1]),h=k(h,m,e,g,a[c+(3*b+14)%16],15,f[b+2]),g=k(g,h,m,e,a[c+(3*b+5)%16],21,f[b+3]));d[0]=d[0]+e|0;d[1]=d[1]+g|0;d[2]=d[2]+h|0;d[3]=d[3]+m|0},_doFinalize:function(){var a=this._data,c=a.words,b=8*this._nDataBytes,d=8*a.sigBytes;c[d>>>5]|=128<<24-d%32;c[(d+64>>>9<<4)+14]=(b<<8|b>>>
|
||||
24)&16711935|(b<<24|b>>>8)&4278255360;a.sigBytes=4*(c.length+1);this._process();a=this._hash.words;for(c=0;4>c;c++)b=a[c],a[c]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360}});e.MD5=d._createHelper(a);e.HmacMD5=d._createHmacHelper(a)})(Math);
|
||||
(function(){var n=CryptoJS,l=n.lib,i=l.Base,j=l.WordArray,l=n.algo,k=l.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:l.MD5,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,d){for(var c=this.cfg,a=c.hasher.create(),f=j.create(),i=f.words,k=c.keySize,c=c.iterations;i.length<k;){b&&a.update(b);var b=a.update(e).finalize(d);a.reset();for(var l=1;l<c;l++)b=a.finalize(b),a.reset();f.concat(b)}f.sigBytes=4*k;return f}});n.EvpKDF=function(e,d,c){return k.create(c).compute(e,
|
||||
d)}})();
|
||||
CryptoJS.lib.Cipher||function(n){var l=CryptoJS,i=l.lib,j=i.Base,k=i.WordArray,e=i.BufferedBlockAlgorithm,d=l.enc.Base64,c=l.algo.EvpKDF,a=i.Cipher=e.extend({cfg:j.extend(),createEncryptor:function(a,b){return this.create(this._ENC_XFORM_MODE,a,b)},createDecryptor:function(a,b){return this.create(this._DEC_XFORM_MODE,a,b)},init:function(a,b,c){this.cfg=this.cfg.extend(c);this._xformMode=a;this._key=b;this.reset()},reset:function(){e.reset.call(this);this._doReset()},process:function(a){this._append(a);return this._process()},
|
||||
finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(a){return{encrypt:function(b,c,d){return("string"==typeof c?r:p).encrypt(a,b,c,d)},decrypt:function(b,c,d){return("string"==typeof c?r:p).decrypt(a,b,c,d)}}}}()});i.StreamCipher=a.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var f=l.mode={},o=i.BlockCipherMode=j.extend({createEncryptor:function(a,b){return this.Encryptor.create(a,
|
||||
b)},createDecryptor:function(a,b){return this.Decryptor.create(a,b)},init:function(a,b){this._cipher=a;this._iv=b}}),f=f.CBC=function(){function a(b,c,g){var d=this._iv;d?this._iv=n:d=this._prevBlock;for(var h=0;h<g;h++)b[c+h]^=d[h]}var b=o.extend();b.Encryptor=b.extend({processBlock:function(b,c){var d=this._cipher,h=d.blockSize;a.call(this,b,c,h);d.encryptBlock(b,c);this._prevBlock=b.slice(c,c+h)}});b.Decryptor=b.extend({processBlock:function(b,c){var d=this._cipher,h=d.blockSize,f=b.slice(c,c+
|
||||
h);d.decryptBlock(b,c);a.call(this,b,c,h);this._prevBlock=f}});return b}(),q=(l.pad={}).Pkcs7={pad:function(a,b){for(var c=4*b,c=c-a.sigBytes%c,d=c<<24|c<<16|c<<8|c,f=[],e=0;e<c;e+=4)f.push(d);c=k.create(f,c);a.concat(c)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};i.BlockCipher=a.extend({cfg:a.cfg.extend({mode:f,padding:q}),reset:function(){a.reset.call(this);var b=this.cfg,c=b.iv,b=b.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=b.createEncryptor;else d=b.createDecryptor,
|
||||
this._minBufferSize=1;this._mode=d.call(b,this,c&&c.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var b=i.CipherParams=j.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),f=(l.format={}).OpenSSL={stringify:function(a){var b=
|
||||
a.ciphertext,a=a.salt,b=(a?k.create([1398893684,1701076831]).concat(a).concat(b):b).toString(d);return b=b.replace(/(.{64})/g,"$1\n")},parse:function(a){var a=d.parse(a),c=a.words;if(1398893684==c[0]&&1701076831==c[1]){var f=k.create(c.slice(2,4));c.splice(0,4);a.sigBytes-=16}return b.create({ciphertext:a,salt:f})}},p=i.SerializableCipher=j.extend({cfg:j.extend({format:f}),encrypt:function(a,c,d,f){var f=this.cfg.extend(f),e=a.createEncryptor(d,f),c=e.finalize(c),e=e.cfg;return b.create({ciphertext:c,
|
||||
key:d,iv:e.iv,algorithm:a,mode:e.mode,padding:e.padding,blockSize:a.blockSize,formatter:f.format})},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);return a.createDecryptor(c,d).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a):a}}),l=(l.kdf={}).OpenSSL={compute:function(a,d,f,e){e||(e=k.random(8));a=c.create({keySize:d+f}).compute(a,e);f=k.create(a.words.slice(d),4*f);a.sigBytes=4*d;return b.create({key:a,iv:f,salt:e})}},r=i.PasswordBasedCipher=
|
||||
p.extend({cfg:p.cfg.extend({kdf:l}),encrypt:function(a,b,c,d){d=this.cfg.extend(d);c=d.kdf.compute(c,a.keySize,a.ivSize);d.iv=c.iv;a=p.encrypt.call(this,a,b,c.key,d);a.mixIn(c);return a},decrypt:function(a,b,c,d){d=this.cfg.extend(d);b=this._parse(b,d.format);c=d.kdf.compute(c,a.keySize,a.ivSize,b.salt);d.iv=c.iv;return p.decrypt.call(this,a,b,c.key,d)}})}();
|
||||
(function(){function n(){var d=this._X,c=this._C;c[0]=c[0]+1295307597+this._b|0;c[1]=c[1]+3545052371+(1295307597>c[0]>>>0?1:0)|0;c[2]=c[2]+886263092+(3545052371>c[1]>>>0?1:0)|0;c[3]=c[3]+1295307597+(886263092>c[2]>>>0?1:0)|0;c[4]=c[4]+3545052371+(1295307597>c[3]>>>0?1:0)|0;c[5]=c[5]+886263092+(3545052371>c[4]>>>0?1:0)|0;c[6]=c[6]+1295307597+(886263092>c[5]>>>0?1:0)|0;c[7]=c[7]+3545052371+(1295307597>c[6]>>>0?1:0)|0;this._b=3545052371>c[7]>>>0?1:0;for(var a=0;8>a;a++){var f=d[a]+c[a],e=f&65535,i=f>>>
|
||||
16;k[a]=((e*e>>>17)+e*i>>>15)+i*i^((f&4294901760)*f|0)+((f&65535)*f|0)}var c=k[0],a=k[1],f=k[2],e=k[3],i=k[4],b=k[5],j=k[6],l=k[7];d[0]=c+(l<<16|l>>>16)+(j<<16|j>>>16)|0;d[1]=a+(c<<8|c>>>24)+l|0;d[2]=f+(a<<16|a>>>16)+(c<<16|c>>>16)|0;d[3]=e+(f<<8|f>>>24)+a|0;d[4]=i+(e<<16|e>>>16)+(f<<16|f>>>16)|0;d[5]=b+(i<<8|i>>>24)+e|0;d[6]=j+(b<<16|b>>>16)+(i<<16|i>>>16)|0;d[7]=l+(j<<8|j>>>24)+b|0}var l=CryptoJS,i=l.lib.StreamCipher,j=[],k=[],e=l.algo.Rabbit=i.extend({_doReset:function(){for(var d=this._key.words,
|
||||
c=d[0],a=d[1],f=d[2],e=d[3],d=this._X=[c,e<<16|f>>>16,a,c<<16|e>>>16,f,a<<16|c>>>16,e,f<<16|a>>>16],c=this._C=[f<<16|f>>>16,c&4294901760|a&65535,e<<16|e>>>16,a&4294901760|f&65535,c<<16|c>>>16,f&4294901760|e&65535,a<<16|a>>>16,e&4294901760|c&65535],a=this._b=0;4>a;a++)n.call(this);for(a=0;8>a;a++)c[a]^=d[a+4&7];if(d=this.cfg.iv){a=d.words;d=a[0];a=a[1];d=(d<<8|d>>>24)&16711935|(d<<24|d>>>8)&4278255360;a=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360;f=d>>>16|a&4294901760;e=a<<16|d&65535;c[0]^=d;c[1]^=
|
||||
f;c[2]^=a;c[3]^=e;c[4]^=d;c[5]^=f;c[6]^=a;c[7]^=e;for(a=0;4>a;a++)n.call(this)}},_doProcessBlock:function(d,c){var a=this._X;n.call(this);j[0]=a[0]^a[5]>>>16^a[3]<<16;j[1]=a[2]^a[7]>>>16^a[5]<<16;j[2]=a[4]^a[1]>>>16^a[7]<<16;j[3]=a[6]^a[3]>>>16^a[1]<<16;for(a=0;4>a;a++){var e=j[a],e=(e<<8|e>>>24)&16711935|(e<<24|e>>>8)&4278255360;d[c+a]^=e}},blockSize:4,ivSize:2});l.Rabbit=i._createHelper(e)})();
|
|
@ -1,30 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(p,j){var h={},m=h.lib={},n=m.Base=function(){function a(){}return{extend:function(d){a.prototype=this;var c=new a;d&&c.mixIn(d);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),b=m.WordArray=n.extend({init:function(a,d){a=
|
||||
this.words=a||[];this.sigBytes=d!=j?d:4*a.length},toString:function(a){return(a||q).stringify(this)},concat:function(a){var d=this.words,c=a.words,g=this.sigBytes,a=a.sigBytes;this.clamp();if(g%4)for(var f=0;f<a;f++)d[g+f>>>2]|=(c[f>>>2]>>>24-8*(f%4)&255)<<24-8*((g+f)%4);else if(65535<c.length)for(f=0;f<a;f+=4)d[g+f>>>2]=c[f>>>2];else d.push.apply(d,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,d=this.sigBytes;a[d>>>2]&=4294967295<<32-8*(d%4);a.length=p.ceil(d/4)},clone:function(){var a=
|
||||
n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var d=[],c=0;c<a;c+=4)d.push(4294967296*p.random()|0);return b.create(d,a)}}),i=h.enc={},q=i.Hex={stringify:function(a){for(var d=a.words,a=a.sigBytes,c=[],g=0;g<a;g++){var f=d[g>>>2]>>>24-8*(g%4)&255;c.push((f>>>4).toString(16));c.push((f&15).toString(16))}return c.join("")},parse:function(a){for(var d=a.length,c=[],g=0;g<d;g+=2)c[g>>>3]|=parseInt(a.substr(g,2),16)<<24-4*(g%8);return b.create(c,d/2)}},k=i.Latin1={stringify:function(a){for(var d=
|
||||
a.words,a=a.sigBytes,c=[],g=0;g<a;g++)c.push(String.fromCharCode(d[g>>>2]>>>24-8*(g%4)&255));return c.join("")},parse:function(a){for(var d=a.length,c=[],g=0;g<d;g++)c[g>>>2]|=(a.charCodeAt(g)&255)<<24-8*(g%4);return b.create(c,d)}},l=i.Utf8={stringify:function(a){try{return decodeURIComponent(escape(k.stringify(a)))}catch(d){throw Error("Malformed UTF-8 data");}},parse:function(a){return k.parse(unescape(encodeURIComponent(a)))}},e=m.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=b.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=l.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var d=this._data,c=d.words,g=d.sigBytes,f=this.blockSize,o=g/(4*f),o=a?p.ceil(o):p.max((o|0)-this._minBufferSize,0),a=o*f,g=p.min(4*a,g);if(a){for(var e=0;e<a;e+=f)this._doProcessBlock(c,e);e=c.splice(0,a);d.sigBytes-=g}return b.create(e,g)},clone:function(){var a=n.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});m.Hasher=e.extend({init:function(){this.reset()},
|
||||
reset:function(){e.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=e.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(d,c){return a.create(c).finalize(d)}},_createHmacHelper:function(a){return function(d,c){return r.HMAC.create(a,c).finalize(d)}}});var r=h.algo={};return h}(Math);
|
||||
(function(){var p=CryptoJS,j=p.lib.WordArray;p.enc.Base64={stringify:function(h){var m=h.words,j=h.sigBytes,b=this._map;h.clamp();for(var h=[],i=0;i<j;i+=3)for(var q=(m[i>>>2]>>>24-8*(i%4)&255)<<16|(m[i+1>>>2]>>>24-8*((i+1)%4)&255)<<8|m[i+2>>>2]>>>24-8*((i+2)%4)&255,k=0;4>k&&i+0.75*k<j;k++)h.push(b.charAt(q>>>6*(3-k)&63));if(m=b.charAt(64))for(;h.length%4;)h.push(m);return h.join("")},parse:function(h){var h=h.replace(/\s/g,""),m=h.length,n=this._map,b=n.charAt(64);b&&(b=h.indexOf(b),-1!=b&&(m=b));
|
||||
for(var b=[],i=0,q=0;q<m;q++)if(q%4){var k=n.indexOf(h.charAt(q-1))<<2*(q%4),l=n.indexOf(h.charAt(q))>>>6-2*(q%4);b[i>>>2]|=(k|l)<<24-8*(i%4);i++}return j.create(b,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}})();
|
||||
(function(p){function j(e,b,a,d,c,g,f){e=e+(b&a|~b&d)+c+f;return(e<<g|e>>>32-g)+b}function h(e,b,a,d,c,g,f){e=e+(b&d|a&~d)+c+f;return(e<<g|e>>>32-g)+b}function m(e,b,a,d,c,g,f){e=e+(b^a^d)+c+f;return(e<<g|e>>>32-g)+b}function n(e,b,a,d,c,g,f){e=e+(a^(b|~d))+c+f;return(e<<g|e>>>32-g)+b}var b=CryptoJS,i=b.lib,q=i.WordArray,i=i.Hasher,k=b.algo,l=[];(function(){for(var e=0;64>e;e++)l[e]=4294967296*p.abs(p.sin(e+1))|0})();k=k.MD5=i.extend({_doReset:function(){this._hash=q.create([1732584193,4023233417,
|
||||
2562383102,271733878])},_doProcessBlock:function(e,b){for(var a=0;16>a;a++){var d=b+a,c=e[d];e[d]=(c<<8|c>>>24)&16711935|(c<<24|c>>>8)&4278255360}for(var d=this._hash.words,c=d[0],g=d[1],f=d[2],o=d[3],a=0;64>a;a+=4)16>a?(c=j(c,g,f,o,e[b+a],7,l[a]),o=j(o,c,g,f,e[b+a+1],12,l[a+1]),f=j(f,o,c,g,e[b+a+2],17,l[a+2]),g=j(g,f,o,c,e[b+a+3],22,l[a+3])):32>a?(c=h(c,g,f,o,e[b+(a+1)%16],5,l[a]),o=h(o,c,g,f,e[b+(a+6)%16],9,l[a+1]),f=h(f,o,c,g,e[b+(a+11)%16],14,l[a+2]),g=h(g,f,o,c,e[b+a%16],20,l[a+3])):48>a?(c=
|
||||
m(c,g,f,o,e[b+(3*a+5)%16],4,l[a]),o=m(o,c,g,f,e[b+(3*a+8)%16],11,l[a+1]),f=m(f,o,c,g,e[b+(3*a+11)%16],16,l[a+2]),g=m(g,f,o,c,e[b+(3*a+14)%16],23,l[a+3])):(c=n(c,g,f,o,e[b+3*a%16],6,l[a]),o=n(o,c,g,f,e[b+(3*a+7)%16],10,l[a+1]),f=n(f,o,c,g,e[b+(3*a+14)%16],15,l[a+2]),g=n(g,f,o,c,e[b+(3*a+5)%16],21,l[a+3]));d[0]=d[0]+c|0;d[1]=d[1]+g|0;d[2]=d[2]+f|0;d[3]=d[3]+o|0},_doFinalize:function(){var b=this._data,i=b.words,a=8*this._nDataBytes,d=8*b.sigBytes;i[d>>>5]|=128<<24-d%32;i[(d+64>>>9<<4)+14]=(a<<8|a>>>
|
||||
24)&16711935|(a<<24|a>>>8)&4278255360;b.sigBytes=4*(i.length+1);this._process();b=this._hash.words;for(i=0;4>i;i++)a=b[i],b[i]=(a<<8|a>>>24)&16711935|(a<<24|a>>>8)&4278255360}});b.MD5=i._createHelper(k);b.HmacMD5=i._createHmacHelper(k)})(Math);
|
||||
(function(){var p=CryptoJS,j=p.lib,h=j.Base,m=j.WordArray,j=p.algo,n=j.EvpKDF=h.extend({cfg:h.extend({keySize:4,hasher:j.MD5,iterations:1}),init:function(b){this.cfg=this.cfg.extend(b)},compute:function(b,i){for(var h=this.cfg,k=h.hasher.create(),l=m.create(),e=l.words,j=h.keySize,h=h.iterations;e.length<j;){a&&k.update(a);var a=k.update(b).finalize(i);k.reset();for(var d=1;d<h;d++)a=k.finalize(a),k.reset();l.concat(a)}l.sigBytes=4*j;return l}});p.EvpKDF=function(b,i,h){return n.create(h).compute(b,
|
||||
i)}})();
|
||||
CryptoJS.lib.Cipher||function(p){var j=CryptoJS,h=j.lib,m=h.Base,n=h.WordArray,b=h.BufferedBlockAlgorithm,i=j.enc.Base64,q=j.algo.EvpKDF,k=h.Cipher=b.extend({cfg:m.extend(),createEncryptor:function(g,a){return this.create(this._ENC_XFORM_MODE,g,a)},createDecryptor:function(g,a){return this.create(this._DEC_XFORM_MODE,g,a)},init:function(a,f,b){this.cfg=this.cfg.extend(b);this._xformMode=a;this._key=f;this.reset()},reset:function(){b.reset.call(this);this._doReset()},process:function(a){this._append(a);return this._process()},
|
||||
finalize:function(a){a&&this._append(a);return this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){return function(a){return{encrypt:function(f,b,e){return("string"==typeof b?c:d).encrypt(a,f,b,e)},decrypt:function(f,b,e){return("string"==typeof b?c:d).decrypt(a,f,b,e)}}}}()});h.StreamCipher=k.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=j.mode={},e=h.BlockCipherMode=m.extend({createEncryptor:function(a,f){return this.Encryptor.create(a,
|
||||
f)},createDecryptor:function(a,f){return this.Decryptor.create(a,f)},init:function(a,f){this._cipher=a;this._iv=f}}),l=l.CBC=function(){function a(g,f,b){var d=this._iv;d?this._iv=p:d=this._prevBlock;for(var c=0;c<b;c++)g[f+c]^=d[c]}var f=e.extend();f.Encryptor=f.extend({processBlock:function(f,b){var d=this._cipher,c=d.blockSize;a.call(this,f,b,c);d.encryptBlock(f,b);this._prevBlock=f.slice(b,b+c)}});f.Decryptor=f.extend({processBlock:function(f,b){var d=this._cipher,c=d.blockSize,e=f.slice(b,b+
|
||||
c);d.decryptBlock(f,b);a.call(this,f,b,c);this._prevBlock=e}});return f}(),r=(j.pad={}).Pkcs7={pad:function(a,f){for(var b=4*f,b=b-a.sigBytes%b,d=b<<24|b<<16|b<<8|b,c=[],e=0;e<b;e+=4)c.push(d);b=n.create(c,b);a.concat(b)},unpad:function(a){a.sigBytes-=a.words[a.sigBytes-1>>>2]&255}};h.BlockCipher=k.extend({cfg:k.cfg.extend({mode:l,padding:r}),reset:function(){k.reset.call(this);var a=this.cfg,b=a.iv,a=a.mode;if(this._xformMode==this._ENC_XFORM_MODE)var d=a.createEncryptor;else d=a.createDecryptor,
|
||||
this._minBufferSize=1;this._mode=d.call(a,this,b&&b.words)},_doProcessBlock:function(a,b){this._mode.processBlock(a,b)},_doFinalize:function(){var a=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){a.pad(this._data,this.blockSize);var b=this._process(!0)}else b=this._process(!0),a.unpad(b);return b},blockSize:4});var a=h.CipherParams=m.extend({init:function(a){this.mixIn(a)},toString:function(a){return(a||this.formatter).stringify(this)}}),l=(j.format={}).OpenSSL={stringify:function(a){var b=
|
||||
a.ciphertext,a=a.salt,b=(a?n.create([1398893684,1701076831]).concat(a).concat(b):b).toString(i);return b=b.replace(/(.{64})/g,"$1\n")},parse:function(b){var b=i.parse(b),f=b.words;if(1398893684==f[0]&&1701076831==f[1]){var d=n.create(f.slice(2,4));f.splice(0,4);b.sigBytes-=16}return a.create({ciphertext:b,salt:d})}},d=h.SerializableCipher=m.extend({cfg:m.extend({format:l}),encrypt:function(b,f,d,c){var c=this.cfg.extend(c),e=b.createEncryptor(d,c),f=e.finalize(f),e=e.cfg;return a.create({ciphertext:f,
|
||||
key:d,iv:e.iv,algorithm:b,mode:e.mode,padding:e.padding,blockSize:b.blockSize,formatter:c.format})},decrypt:function(a,b,d,c){c=this.cfg.extend(c);b=this._parse(b,c.format);return a.createDecryptor(d,c).finalize(b.ciphertext)},_parse:function(a,b){return"string"==typeof a?b.parse(a):a}}),j=(j.kdf={}).OpenSSL={compute:function(b,d,c,e){e||(e=n.random(8));b=q.create({keySize:d+c}).compute(b,e);c=n.create(b.words.slice(d),4*c);b.sigBytes=4*d;return a.create({key:b,iv:c,salt:e})}},c=h.PasswordBasedCipher=
|
||||
d.extend({cfg:d.cfg.extend({kdf:j}),encrypt:function(a,b,c,e){e=this.cfg.extend(e);c=e.kdf.compute(c,a.keySize,a.ivSize);e.iv=c.iv;a=d.encrypt.call(this,a,b,c.key,e);a.mixIn(c);return a},decrypt:function(a,b,c,e){e=this.cfg.extend(e);b=this._parse(b,e.format);c=e.kdf.compute(c,a.keySize,a.ivSize,b.salt);e.iv=c.iv;return d.decrypt.call(this,a,b,c.key,e)}})}();
|
||||
(function(){function p(){for(var b=this._S,i=this._i,h=this._j,k=0,l=0;4>l;l++){var i=(i+1)%256,h=(h+b[i])%256,e=b[i];b[i]=b[h];b[h]=e;k|=b[(b[i]+b[h])%256]<<24-8*l}this._i=i;this._j=h;return k}var j=CryptoJS,h=j.lib.StreamCipher,m=j.algo,n=m.RC4=h.extend({_doReset:function(){for(var b=this._key,h=b.words,b=b.sigBytes,j=this._S=[],k=0;256>k;k++)j[k]=k;for(var l=k=0;256>k;k++){var e=k%b,l=(l+j[k]+(h[e>>>2]>>>24-8*(e%4)&255))%256,e=j[k];j[k]=j[l];j[l]=e}this._i=this._j=0},_doProcessBlock:function(b,
|
||||
h){b[h]^=p.call(this)},keySize:8,ivSize:0});j.RC4=h._createHelper(n);m=m.RC4Drop=n.extend({cfg:n.cfg.extend({drop:192}),_doReset:function(){n._doReset.call(this);for(var b=this.cfg.drop;0<b;b--)p.call(this)}});j.RC4Drop=h._createHelper(m)})();
|
|
@ -1,14 +0,0 @@
|
|||
/*
|
||||
CryptoJS v3.0.2
|
||||
code.google.com/p/crypto-js
|
||||
(c) 2009-2012 by Jeff Mott. All rights reserved.
|
||||
code.google.com/p/crypto-js/wiki/License
|
||||
*/
|
||||
var CryptoJS=CryptoJS||function(i,m){var p={},h=p.lib={},n=h.Base=function(){function a(){}return{extend:function(b){a.prototype=this;var c=new a;b&&c.mixIn(b);c.$super=this;return c},create:function(){var a=this.extend();a.init.apply(a,arguments);return a},init:function(){},mixIn:function(a){for(var c in a)a.hasOwnProperty(c)&&(this[c]=a[c]);a.hasOwnProperty("toString")&&(this.toString=a.toString)},clone:function(){return this.$super.extend(this)}}}(),o=h.WordArray=n.extend({init:function(a,b){a=
|
||||
this.words=a||[];this.sigBytes=b!=m?b:4*a.length},toString:function(a){return(a||e).stringify(this)},concat:function(a){var b=this.words,c=a.words,d=this.sigBytes,a=a.sigBytes;this.clamp();if(d%4)for(var f=0;f<a;f++)b[d+f>>>2]|=(c[f>>>2]>>>24-8*(f%4)&255)<<24-8*((d+f)%4);else if(65535<c.length)for(f=0;f<a;f+=4)b[d+f>>>2]=c[f>>>2];else b.push.apply(b,c);this.sigBytes+=a;return this},clamp:function(){var a=this.words,b=this.sigBytes;a[b>>>2]&=4294967295<<32-8*(b%4);a.length=i.ceil(b/4)},clone:function(){var a=
|
||||
n.clone.call(this);a.words=this.words.slice(0);return a},random:function(a){for(var b=[],c=0;c<a;c+=4)b.push(4294967296*i.random()|0);return o.create(b,a)}}),q=p.enc={},e=q.Hex={stringify:function(a){for(var b=a.words,a=a.sigBytes,c=[],d=0;d<a;d++){var f=b[d>>>2]>>>24-8*(d%4)&255;c.push((f>>>4).toString(16));c.push((f&15).toString(16))}return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d+=2)c[d>>>3]|=parseInt(a.substr(d,2),16)<<24-4*(d%8);return o.create(c,b/2)}},g=q.Latin1={stringify:function(a){for(var b=
|
||||
a.words,a=a.sigBytes,c=[],d=0;d<a;d++)c.push(String.fromCharCode(b[d>>>2]>>>24-8*(d%4)&255));return c.join("")},parse:function(a){for(var b=a.length,c=[],d=0;d<b;d++)c[d>>>2]|=(a.charCodeAt(d)&255)<<24-8*(d%4);return o.create(c,b)}},j=q.Utf8={stringify:function(a){try{return decodeURIComponent(escape(g.stringify(a)))}catch(b){throw Error("Malformed UTF-8 data");}},parse:function(a){return g.parse(unescape(encodeURIComponent(a)))}},k=h.BufferedBlockAlgorithm=n.extend({reset:function(){this._data=o.create();
|
||||
this._nDataBytes=0},_append:function(a){"string"==typeof a&&(a=j.parse(a));this._data.concat(a);this._nDataBytes+=a.sigBytes},_process:function(a){var b=this._data,c=b.words,d=b.sigBytes,f=this.blockSize,e=d/(4*f),e=a?i.ceil(e):i.max((e|0)-this._minBufferSize,0),a=e*f,d=i.min(4*a,d);if(a){for(var g=0;g<a;g+=f)this._doProcessBlock(c,g);g=c.splice(0,a);b.sigBytes-=d}return o.create(g,d)},clone:function(){var a=n.clone.call(this);a._data=this._data.clone();return a},_minBufferSize:0});h.Hasher=k.extend({init:function(){this.reset()},
|
||||
reset:function(){k.reset.call(this);this._doReset()},update:function(a){this._append(a);this._process();return this},finalize:function(a){a&&this._append(a);this._doFinalize();return this._hash},clone:function(){var a=k.clone.call(this);a._hash=this._hash.clone();return a},blockSize:16,_createHelper:function(a){return function(b,c){return a.create(c).finalize(b)}},_createHmacHelper:function(a){return function(b,c){return l.HMAC.create(a,c).finalize(b)}}});var l=p.algo={};return p}(Math);
|
||||
(function(){var i=CryptoJS,m=i.lib,p=m.WordArray,m=m.Hasher,h=[],n=i.algo.SHA1=m.extend({_doReset:function(){this._hash=p.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(o,i){for(var e=this._hash.words,g=e[0],j=e[1],k=e[2],l=e[3],a=e[4],b=0;80>b;b++){if(16>b)h[b]=o[i+b]|0;else{var c=h[b-3]^h[b-8]^h[b-14]^h[b-16];h[b]=c<<1|c>>>31}c=(g<<5|g>>>27)+a+h[b];c=20>b?c+((j&k|~j&l)+1518500249):40>b?c+((j^k^l)+1859775393):60>b?c+((j&k|j&l|k&l)-1894007588):c+((j^k^l)-
|
||||
899497514);a=l;l=k;k=j<<30|j>>>2;j=g;g=c}e[0]=e[0]+g|0;e[1]=e[1]+j|0;e[2]=e[2]+k|0;e[3]=e[3]+l|0;e[4]=e[4]+a|0},_doFinalize:function(){var i=this._data,h=i.words,e=8*this._nDataBytes,g=8*i.sigBytes;h[g>>>5]|=128<<24-g%32;h[(g+64>>>9<<4)+15]=e;i.sigBytes=4*h.length;this._process()}});i.SHA1=m._createHelper(n);i.HmacSHA1=m._createHmacHelper(n)})();
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue