CryptoJS.js 190 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981298229832984298529862987298829892990299129922993299429952996299729982999300030013002300330043005300630073008300930103011301230133014301530163017301830193020302130223023302430253026302730283029303030313032303330343035303630373038303930403041304230433044304530463047304830493050305130523053305430553056305730583059306030613062306330643065306630673068306930703071307230733074307530763077307830793080308130823083308430853086308730883089309030913092309330943095309630973098309931003101310231033104310531063107310831093110311131123113311431153116311731183119312031213122312331243125312631273128312931303131313231333134313531363137313831393140314131423143314431453146314731483149315031513152315331543155315631573158315931603161316231633164316531663167316831693170317131723173317431753176317731783179318031813182318331843185318631873188318931903191319231933194319531963197319831993200320132023203320432053206320732083209321032113212321332143215321632173218321932203221322232233224322532263227322832293230323132323233323432353236323732383239324032413242324332443245324632473248324932503251325232533254325532563257325832593260326132623263326432653266326732683269327032713272327332743275327632773278327932803281328232833284328532863287328832893290329132923293329432953296329732983299330033013302330333043305330633073308330933103311331233133314331533163317331833193320332133223323332433253326332733283329333033313332333333343335333633373338333933403341334233433344334533463347334833493350335133523353335433553356335733583359336033613362336333643365336633673368336933703371337233733374337533763377337833793380338133823383338433853386338733883389339033913392339333943395339633973398339934003401340234033404340534063407340834093410341134123413341434153416341734183419342034213422342334243425342634273428342934303431343234333434343534363437343834393440344134423443344434453446344734483449345034513452345334543455345634573458345934603461346234633464346534663467346834693470347134723473347434753476347734783479348034813482348334843485348634873488348934903491349234933494349534963497349834993500350135023503350435053506350735083509351035113512351335143515351635173518351935203521352235233524352535263527352835293530353135323533353435353536353735383539354035413542354335443545354635473548354935503551355235533554355535563557355835593560356135623563356435653566356735683569357035713572357335743575357635773578357935803581358235833584358535863587358835893590359135923593359435953596359735983599360036013602360336043605360636073608360936103611361236133614361536163617361836193620362136223623362436253626362736283629363036313632363336343635363636373638363936403641364236433644364536463647364836493650365136523653365436553656365736583659366036613662366336643665366636673668366936703671367236733674367536763677367836793680368136823683368436853686368736883689369036913692369336943695369636973698369937003701370237033704370537063707370837093710371137123713371437153716371737183719372037213722372337243725372637273728372937303731373237333734373537363737373837393740374137423743374437453746374737483749375037513752375337543755375637573758375937603761376237633764376537663767376837693770377137723773377437753776377737783779378037813782378337843785378637873788378937903791379237933794379537963797379837993800380138023803380438053806380738083809381038113812381338143815381638173818381938203821382238233824382538263827382838293830383138323833383438353836383738383839384038413842384338443845384638473848384938503851385238533854385538563857385838593860386138623863386438653866386738683869387038713872387338743875387638773878387938803881388238833884388538863887388838893890389138923893389438953896389738983899390039013902390339043905390639073908390939103911391239133914391539163917391839193920392139223923392439253926392739283929393039313932393339343935393639373938393939403941394239433944394539463947394839493950395139523953395439553956395739583959396039613962396339643965396639673968396939703971397239733974397539763977397839793980398139823983398439853986398739883989399039913992399339943995399639973998399940004001400240034004400540064007400840094010401140124013401440154016401740184019402040214022402340244025402640274028402940304031403240334034403540364037403840394040404140424043404440454046404740484049405040514052405340544055405640574058405940604061406240634064406540664067406840694070407140724073407440754076407740784079408040814082408340844085408640874088408940904091409240934094409540964097409840994100410141024103410441054106410741084109411041114112411341144115411641174118411941204121412241234124412541264127412841294130413141324133413441354136413741384139414041414142414341444145414641474148414941504151415241534154415541564157415841594160416141624163416441654166416741684169417041714172417341744175417641774178417941804181418241834184418541864187418841894190419141924193419441954196419741984199420042014202420342044205420642074208420942104211421242134214421542164217421842194220422142224223422442254226422742284229423042314232423342344235423642374238423942404241424242434244424542464247424842494250425142524253425442554256425742584259426042614262426342644265426642674268426942704271427242734274427542764277427842794280428142824283428442854286428742884289429042914292429342944295429642974298429943004301430243034304430543064307430843094310431143124313431443154316431743184319432043214322432343244325432643274328432943304331433243334334433543364337433843394340434143424343434443454346434743484349435043514352435343544355435643574358435943604361436243634364436543664367436843694370437143724373437443754376437743784379438043814382438343844385438643874388438943904391439243934394439543964397439843994400440144024403440444054406440744084409441044114412441344144415441644174418441944204421442244234424442544264427442844294430443144324433443444354436443744384439444044414442444344444445444644474448444944504451445244534454445544564457445844594460446144624463446444654466446744684469447044714472447344744475447644774478447944804481448244834484448544864487448844894490449144924493449444954496449744984499450045014502450345044505450645074508450945104511451245134514451545164517451845194520452145224523452445254526452745284529453045314532453345344535453645374538453945404541454245434544454545464547454845494550455145524553455445554556455745584559456045614562456345644565456645674568456945704571457245734574457545764577457845794580458145824583458445854586458745884589459045914592459345944595459645974598459946004601460246034604460546064607460846094610461146124613461446154616461746184619462046214622462346244625462646274628462946304631463246334634463546364637463846394640464146424643464446454646464746484649465046514652465346544655465646574658465946604661466246634664466546664667466846694670467146724673467446754676467746784679468046814682468346844685468646874688468946904691469246934694469546964697469846994700470147024703470447054706470747084709471047114712471347144715471647174718471947204721472247234724472547264727472847294730473147324733473447354736473747384739474047414742474347444745474647474748474947504751475247534754475547564757475847594760476147624763476447654766476747684769477047714772477347744775477647774778477947804781478247834784478547864787478847894790479147924793479447954796479747984799480048014802480348044805480648074808480948104811481248134814481548164817481848194820482148224823482448254826482748284829483048314832483348344835483648374838483948404841484248434844484548464847484848494850485148524853485448554856485748584859486048614862486348644865486648674868486948704871487248734874487548764877487848794880488148824883488448854886488748884889489048914892489348944895489648974898489949004901490249034904490549064907490849094910491149124913491449154916491749184919492049214922492349244925492649274928492949304931493249334934493549364937493849394940494149424943494449454946494749484949495049514952495349544955495649574958495949604961496249634964496549664967496849694970497149724973497449754976497749784979498049814982498349844985498649874988498949904991499249934994499549964997499849995000500150025003500450055006500750085009501050115012501350145015501650175018501950205021502250235024502550265027502850295030503150325033503450355036503750385039504050415042504350445045504650475048504950505051505250535054505550565057505850595060506150625063506450655066506750685069507050715072507350745075507650775078507950805081508250835084508550865087508850895090509150925093509450955096509750985099510051015102510351045105510651075108510951105111511251135114511551165117511851195120512151225123512451255126512751285129513051315132513351345135513651375138513951405141514251435144514551465147514851495150515151525153515451555156515751585159516051615162516351645165516651675168516951705171517251735174517551765177517851795180518151825183518451855186518751885189519051915192519351945195519651975198519952005201520252035204520552065207520852095210521152125213521452155216521752185219522052215222522352245225522652275228522952305231523252335234523552365237523852395240524152425243524452455246524752485249525052515252525352545255525652575258525952605261526252635264526552665267526852695270527152725273527452755276527752785279528052815282528352845285528652875288528952905291529252935294529552965297529852995300530153025303530453055306530753085309531053115312531353145315531653175318531953205321532253235324532553265327532853295330533153325333533453355336533753385339534053415342534353445345534653475348534953505351535253535354535553565357535853595360536153625363536453655366536753685369537053715372
  1. function createCryptoJS() {
  2. var __getOwnPropNames = Object.getOwnPropertyNames;
  3. var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
  4. get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
  5. }) : x)(function (x) {
  6. if (typeof require !== "undefined")
  7. return require.apply(this, arguments);
  8. throw new Error('Dynamic require of "' + x + '" is not supported');
  9. });
  10. var __commonJS = (cb, mod) => function __require2() {
  11. return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
  12. };
  13. // (disabled):crypto
  14. var require_crypto = __commonJS({
  15. "(disabled):crypto"() {
  16. }
  17. });
  18. // core.js
  19. var require_core = __commonJS({
  20. "core.js"(exports, module) {
  21. (function (root, factory) {
  22. if (typeof exports === "object") {
  23. module.exports = exports = factory();
  24. } else if (typeof define === "function" && define.amd) {
  25. define([], factory);
  26. } else {
  27. root.CryptoJS = factory();
  28. }
  29. })(exports, function () {
  30. var CryptoJS = CryptoJS || function (Math2, undefined2) {
  31. var crypto;
  32. if (typeof window !== "undefined" && window.crypto) {
  33. crypto = window.crypto;
  34. }
  35. if (typeof self !== "undefined" && self.crypto) {
  36. crypto = self.crypto;
  37. }
  38. if (typeof globalThis !== "undefined" && globalThis.crypto) {
  39. crypto = globalThis.crypto;
  40. }
  41. if (!crypto && typeof window !== "undefined" && window.msCrypto) {
  42. crypto = window.msCrypto;
  43. }
  44. if (!crypto && typeof global !== "undefined" && global.crypto) {
  45. crypto = global.crypto;
  46. }
  47. if (!crypto && typeof __require === "function") {
  48. try {
  49. crypto = require_crypto();
  50. } catch (err) {
  51. }
  52. }
  53. var cryptoSecureRandomInt = function () {
  54. if (crypto) {
  55. if (typeof crypto.getRandomValues === "function") {
  56. try {
  57. return crypto.getRandomValues(new Uint32Array(1))[0];
  58. } catch (err) {
  59. }
  60. }
  61. if (typeof crypto.randomBytes === "function") {
  62. try {
  63. return crypto.randomBytes(4).readInt32LE();
  64. } catch (err) {
  65. }
  66. }
  67. }
  68. throw new Error("Native crypto module could not be used to get secure random number.");
  69. };
  70. var create = Object.create || function () {
  71. function F() {
  72. }
  73. return function (obj) {
  74. var subtype;
  75. F.prototype = obj;
  76. subtype = new F();
  77. F.prototype = null;
  78. return subtype;
  79. };
  80. }();
  81. var C = {};
  82. var C_lib = C.lib = {};
  83. var Base = C_lib.Base = function () {
  84. return {
  85. /**
  86. * Creates a new object that inherits from this object.
  87. *
  88. * @param {Object} overrides Properties to copy into the new object.
  89. *
  90. * @return {Object} The new object.
  91. *
  92. * @static
  93. *
  94. * @example
  95. *
  96. * var MyType = CryptoJS.lib.Base.extend({
  97. * field: 'value',
  98. *
  99. * method: function () {
  100. * }
  101. * });
  102. */
  103. extend: function (overrides) {
  104. var subtype = create(this);
  105. if (overrides) {
  106. subtype.mixIn(overrides);
  107. }
  108. if (!subtype.hasOwnProperty("init") || this.init === subtype.init) {
  109. subtype.init = function () {
  110. subtype.$super.init.apply(this, arguments);
  111. };
  112. }
  113. subtype.init.prototype = subtype;
  114. subtype.$super = this;
  115. return subtype;
  116. },
  117. /**
  118. * Extends this object and runs the init method.
  119. * Arguments to create() will be passed to init().
  120. *
  121. * @return {Object} The new object.
  122. *
  123. * @static
  124. *
  125. * @example
  126. *
  127. * var instance = MyType.create();
  128. */
  129. create: function () {
  130. var instance = this.extend();
  131. instance.init.apply(instance, arguments);
  132. return instance;
  133. },
  134. /**
  135. * Initializes a newly created object.
  136. * Override this method to add some logic when your objects are created.
  137. *
  138. * @example
  139. *
  140. * var MyType = CryptoJS.lib.Base.extend({
  141. * init: function () {
  142. * // ...
  143. * }
  144. * });
  145. */
  146. init: function () {
  147. },
  148. /**
  149. * Copies properties into this object.
  150. *
  151. * @param {Object} properties The properties to mix in.
  152. *
  153. * @example
  154. *
  155. * MyType.mixIn({
  156. * field: 'value'
  157. * });
  158. */
  159. mixIn: function (properties) {
  160. for (var propertyName in properties) {
  161. if (properties.hasOwnProperty(propertyName)) {
  162. this[propertyName] = properties[propertyName];
  163. }
  164. }
  165. if (properties.hasOwnProperty("toString")) {
  166. this.toString = properties.toString;
  167. }
  168. },
  169. /**
  170. * Creates a copy of this object.
  171. *
  172. * @return {Object} The clone.
  173. *
  174. * @example
  175. *
  176. * var clone = instance.clone();
  177. */
  178. clone: function () {
  179. return this.init.prototype.extend(this);
  180. }
  181. };
  182. }();
  183. var WordArray = C_lib.WordArray = Base.extend({
  184. /**
  185. * Initializes a newly created word array.
  186. *
  187. * @param {Array} words (Optional) An array of 32-bit words.
  188. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  189. *
  190. * @example
  191. *
  192. * var wordArray = CryptoJS.lib.WordArray.create();
  193. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  194. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  195. */
  196. init: function (words, sigBytes) {
  197. words = this.words = words || [];
  198. if (sigBytes != undefined2) {
  199. this.sigBytes = sigBytes;
  200. } else {
  201. this.sigBytes = words.length * 4;
  202. }
  203. },
  204. /**
  205. * Converts this word array to a string.
  206. *
  207. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  208. *
  209. * @return {string} The stringified word array.
  210. *
  211. * @example
  212. *
  213. * var string = wordArray + '';
  214. * var string = wordArray.toString();
  215. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  216. */
  217. toString: function (encoder) {
  218. return (encoder || Hex).stringify(this);
  219. },
  220. /**
  221. * Concatenates a word array to this word array.
  222. *
  223. * @param {WordArray} wordArray The word array to append.
  224. *
  225. * @return {WordArray} This word array.
  226. *
  227. * @example
  228. *
  229. * wordArray1.concat(wordArray2);
  230. */
  231. concat: function (wordArray) {
  232. var thisWords = this.words;
  233. var thatWords = wordArray.words;
  234. var thisSigBytes = this.sigBytes;
  235. var thatSigBytes = wordArray.sigBytes;
  236. this.clamp();
  237. if (thisSigBytes % 4) {
  238. for (var i = 0; i < thatSigBytes; i++) {
  239. var thatByte = thatWords[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  240. thisWords[thisSigBytes + i >>> 2] |= thatByte << 24 - (thisSigBytes + i) % 4 * 8;
  241. }
  242. } else {
  243. for (var j = 0; j < thatSigBytes; j += 4) {
  244. thisWords[thisSigBytes + j >>> 2] = thatWords[j >>> 2];
  245. }
  246. }
  247. this.sigBytes += thatSigBytes;
  248. return this;
  249. },
  250. /**
  251. * Removes insignificant bits.
  252. *
  253. * @example
  254. *
  255. * wordArray.clamp();
  256. */
  257. clamp: function () {
  258. var words = this.words;
  259. var sigBytes = this.sigBytes;
  260. words[sigBytes >>> 2] &= 4294967295 << 32 - sigBytes % 4 * 8;
  261. words.length = Math2.ceil(sigBytes / 4);
  262. },
  263. /**
  264. * Creates a copy of this word array.
  265. *
  266. * @return {WordArray} The clone.
  267. *
  268. * @example
  269. *
  270. * var clone = wordArray.clone();
  271. */
  272. clone: function () {
  273. var clone = Base.clone.call(this);
  274. clone.words = this.words.slice(0);
  275. return clone;
  276. },
  277. /**
  278. * Creates a word array filled with random bytes.
  279. *
  280. * @param {number} nBytes The number of random bytes to generate.
  281. *
  282. * @return {WordArray} The random word array.
  283. *
  284. * @static
  285. *
  286. * @example
  287. *
  288. * var wordArray = CryptoJS.lib.WordArray.random(16);
  289. */
  290. random: function (nBytes) {
  291. var words = [];
  292. for (var i = 0; i < nBytes; i += 4) {
  293. words.push(cryptoSecureRandomInt());
  294. }
  295. return new WordArray.init(words, nBytes);
  296. }
  297. });
  298. var C_enc = C.enc = {};
  299. var Hex = C_enc.Hex = {
  300. /**
  301. * Converts a word array to a hex string.
  302. *
  303. * @param {WordArray} wordArray The word array.
  304. *
  305. * @return {string} The hex string.
  306. *
  307. * @static
  308. *
  309. * @example
  310. *
  311. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  312. */
  313. stringify: function (wordArray) {
  314. var words = wordArray.words;
  315. var sigBytes = wordArray.sigBytes;
  316. var hexChars = [];
  317. for (var i = 0; i < sigBytes; i++) {
  318. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  319. hexChars.push((bite >>> 4).toString(16));
  320. hexChars.push((bite & 15).toString(16));
  321. }
  322. return hexChars.join("");
  323. },
  324. /**
  325. * Converts a hex string to a word array.
  326. *
  327. * @param {string} hexStr The hex string.
  328. *
  329. * @return {WordArray} The word array.
  330. *
  331. * @static
  332. *
  333. * @example
  334. *
  335. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  336. */
  337. parse: function (hexStr) {
  338. var hexStrLength = hexStr.length;
  339. var words = [];
  340. for (var i = 0; i < hexStrLength; i += 2) {
  341. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << 24 - i % 8 * 4;
  342. }
  343. return new WordArray.init(words, hexStrLength / 2);
  344. }
  345. };
  346. var Latin1 = C_enc.Latin1 = {
  347. /**
  348. * Converts a word array to a Latin1 string.
  349. *
  350. * @param {WordArray} wordArray The word array.
  351. *
  352. * @return {string} The Latin1 string.
  353. *
  354. * @static
  355. *
  356. * @example
  357. *
  358. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  359. */
  360. stringify: function (wordArray) {
  361. var words = wordArray.words;
  362. var sigBytes = wordArray.sigBytes;
  363. var latin1Chars = [];
  364. for (var i = 0; i < sigBytes; i++) {
  365. var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  366. latin1Chars.push(String.fromCharCode(bite));
  367. }
  368. return latin1Chars.join("");
  369. },
  370. /**
  371. * Converts a Latin1 string to a word array.
  372. *
  373. * @param {string} latin1Str The Latin1 string.
  374. *
  375. * @return {WordArray} The word array.
  376. *
  377. * @static
  378. *
  379. * @example
  380. *
  381. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  382. */
  383. parse: function (latin1Str) {
  384. var latin1StrLength = latin1Str.length;
  385. var words = [];
  386. for (var i = 0; i < latin1StrLength; i++) {
  387. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 255) << 24 - i % 4 * 8;
  388. }
  389. return new WordArray.init(words, latin1StrLength);
  390. }
  391. };
  392. var Utf8 = C_enc.Utf8 = {
  393. /**
  394. * Converts a word array to a UTF-8 string.
  395. *
  396. * @param {WordArray} wordArray The word array.
  397. *
  398. * @return {string} The UTF-8 string.
  399. *
  400. * @static
  401. *
  402. * @example
  403. *
  404. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  405. */
  406. stringify: function (wordArray) {
  407. try {
  408. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  409. } catch (e) {
  410. throw new Error("Malformed UTF-8 data");
  411. }
  412. },
  413. /**
  414. * Converts a UTF-8 string to a word array.
  415. *
  416. * @param {string} utf8Str The UTF-8 string.
  417. *
  418. * @return {WordArray} The word array.
  419. *
  420. * @static
  421. *
  422. * @example
  423. *
  424. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  425. */
  426. parse: function (utf8Str) {
  427. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  428. }
  429. };
  430. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  431. /**
  432. * Resets this block algorithm's data buffer to its initial state.
  433. *
  434. * @example
  435. *
  436. * bufferedBlockAlgorithm.reset();
  437. */
  438. reset: function () {
  439. this._data = new WordArray.init();
  440. this._nDataBytes = 0;
  441. },
  442. /**
  443. * Adds new data to this block algorithm's buffer.
  444. *
  445. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  446. *
  447. * @example
  448. *
  449. * bufferedBlockAlgorithm._append('data');
  450. * bufferedBlockAlgorithm._append(wordArray);
  451. */
  452. _append: function (data) {
  453. if (typeof data == "string") {
  454. data = Utf8.parse(data);
  455. }
  456. this._data.concat(data);
  457. this._nDataBytes += data.sigBytes;
  458. },
  459. /**
  460. * Processes available data blocks.
  461. *
  462. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  463. *
  464. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  465. *
  466. * @return {WordArray} The processed data.
  467. *
  468. * @example
  469. *
  470. * var processedData = bufferedBlockAlgorithm._process();
  471. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  472. */
  473. _process: function (doFlush) {
  474. var processedWords;
  475. var data = this._data;
  476. var dataWords = data.words;
  477. var dataSigBytes = data.sigBytes;
  478. var blockSize = this.blockSize;
  479. var blockSizeBytes = blockSize * 4;
  480. var nBlocksReady = dataSigBytes / blockSizeBytes;
  481. if (doFlush) {
  482. nBlocksReady = Math2.ceil(nBlocksReady);
  483. } else {
  484. nBlocksReady = Math2.max((nBlocksReady | 0) - this._minBufferSize, 0);
  485. }
  486. var nWordsReady = nBlocksReady * blockSize;
  487. var nBytesReady = Math2.min(nWordsReady * 4, dataSigBytes);
  488. if (nWordsReady) {
  489. for (var offset = 0; offset < nWordsReady; offset += blockSize) {
  490. this._doProcessBlock(dataWords, offset);
  491. }
  492. processedWords = dataWords.splice(0, nWordsReady);
  493. data.sigBytes -= nBytesReady;
  494. }
  495. return new WordArray.init(processedWords, nBytesReady);
  496. },
  497. /**
  498. * Creates a copy of this object.
  499. *
  500. * @return {Object} The clone.
  501. *
  502. * @example
  503. *
  504. * var clone = bufferedBlockAlgorithm.clone();
  505. */
  506. clone: function () {
  507. var clone = Base.clone.call(this);
  508. clone._data = this._data.clone();
  509. return clone;
  510. },
  511. _minBufferSize: 0
  512. });
  513. var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  514. /**
  515. * Configuration options.
  516. */
  517. cfg: Base.extend(),
  518. /**
  519. * Initializes a newly created hasher.
  520. *
  521. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  522. *
  523. * @example
  524. *
  525. * var hasher = CryptoJS.algo.SHA256.create();
  526. */
  527. init: function (cfg) {
  528. this.cfg = this.cfg.extend(cfg);
  529. this.reset();
  530. },
  531. /**
  532. * Resets this hasher to its initial state.
  533. *
  534. * @example
  535. *
  536. * hasher.reset();
  537. */
  538. reset: function () {
  539. BufferedBlockAlgorithm.reset.call(this);
  540. this._doReset();
  541. },
  542. /**
  543. * Updates this hasher with a message.
  544. *
  545. * @param {WordArray|string} messageUpdate The message to append.
  546. *
  547. * @return {Hasher} This hasher.
  548. *
  549. * @example
  550. *
  551. * hasher.update('message');
  552. * hasher.update(wordArray);
  553. */
  554. update: function (messageUpdate) {
  555. this._append(messageUpdate);
  556. this._process();
  557. return this;
  558. },
  559. /**
  560. * Finalizes the hash computation.
  561. * Note that the finalize operation is effectively a destructive, read-once operation.
  562. *
  563. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  564. *
  565. * @return {WordArray} The hash.
  566. *
  567. * @example
  568. *
  569. * var hash = hasher.finalize();
  570. * var hash = hasher.finalize('message');
  571. * var hash = hasher.finalize(wordArray);
  572. */
  573. finalize: function (messageUpdate) {
  574. if (messageUpdate) {
  575. this._append(messageUpdate);
  576. }
  577. var hash = this._doFinalize();
  578. return hash;
  579. },
  580. blockSize: 512 / 32,
  581. /**
  582. * Creates a shortcut function to a hasher's object interface.
  583. *
  584. * @param {Hasher} hasher The hasher to create a helper for.
  585. *
  586. * @return {Function} The shortcut function.
  587. *
  588. * @static
  589. *
  590. * @example
  591. *
  592. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  593. */
  594. _createHelper: function (hasher) {
  595. return function (message, cfg) {
  596. return new hasher.init(cfg).finalize(message);
  597. };
  598. },
  599. /**
  600. * Creates a shortcut function to the HMAC's object interface.
  601. *
  602. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  603. *
  604. * @return {Function} The shortcut function.
  605. *
  606. * @static
  607. *
  608. * @example
  609. *
  610. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  611. */
  612. _createHmacHelper: function (hasher) {
  613. return function (message, key) {
  614. return new C_algo.HMAC.init(hasher, key).finalize(message);
  615. };
  616. }
  617. });
  618. var C_algo = C.algo = {};
  619. return C;
  620. }(Math);
  621. return CryptoJS;
  622. });
  623. }
  624. });
  625. // x64-core.js
  626. var require_x64_core = __commonJS({
  627. "x64-core.js"(exports, module) {
  628. (function (root, factory) {
  629. if (typeof exports === "object") {
  630. module.exports = exports = factory(require_core());
  631. } else if (typeof define === "function" && define.amd) {
  632. define(["./core"], factory);
  633. } else {
  634. factory(root.CryptoJS);
  635. }
  636. })(exports, function (CryptoJS) {
  637. (function (undefined2) {
  638. var C = CryptoJS;
  639. var C_lib = C.lib;
  640. var Base = C_lib.Base;
  641. var X32WordArray = C_lib.WordArray;
  642. var C_x64 = C.x64 = {};
  643. var X64Word = C_x64.Word = Base.extend({
  644. /**
  645. * Initializes a newly created 64-bit word.
  646. *
  647. * @param {number} high The high 32 bits.
  648. * @param {number} low The low 32 bits.
  649. *
  650. * @example
  651. *
  652. * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
  653. */
  654. init: function (high, low) {
  655. this.high = high;
  656. this.low = low;
  657. }
  658. /**
  659. * Bitwise NOTs this word.
  660. *
  661. * @return {X64Word} A new x64-Word object after negating.
  662. *
  663. * @example
  664. *
  665. * var negated = x64Word.not();
  666. */
  667. // not: function () {
  668. // var high = ~this.high;
  669. // var low = ~this.low;
  670. // return X64Word.create(high, low);
  671. // },
  672. /**
  673. * Bitwise ANDs this word with the passed word.
  674. *
  675. * @param {X64Word} word The x64-Word to AND with this word.
  676. *
  677. * @return {X64Word} A new x64-Word object after ANDing.
  678. *
  679. * @example
  680. *
  681. * var anded = x64Word.and(anotherX64Word);
  682. */
  683. // and: function (word) {
  684. // var high = this.high & word.high;
  685. // var low = this.low & word.low;
  686. // return X64Word.create(high, low);
  687. // },
  688. /**
  689. * Bitwise ORs this word with the passed word.
  690. *
  691. * @param {X64Word} word The x64-Word to OR with this word.
  692. *
  693. * @return {X64Word} A new x64-Word object after ORing.
  694. *
  695. * @example
  696. *
  697. * var ored = x64Word.or(anotherX64Word);
  698. */
  699. // or: function (word) {
  700. // var high = this.high | word.high;
  701. // var low = this.low | word.low;
  702. // return X64Word.create(high, low);
  703. // },
  704. /**
  705. * Bitwise XORs this word with the passed word.
  706. *
  707. * @param {X64Word} word The x64-Word to XOR with this word.
  708. *
  709. * @return {X64Word} A new x64-Word object after XORing.
  710. *
  711. * @example
  712. *
  713. * var xored = x64Word.xor(anotherX64Word);
  714. */
  715. // xor: function (word) {
  716. // var high = this.high ^ word.high;
  717. // var low = this.low ^ word.low;
  718. // return X64Word.create(high, low);
  719. // },
  720. /**
  721. * Shifts this word n bits to the left.
  722. *
  723. * @param {number} n The number of bits to shift.
  724. *
  725. * @return {X64Word} A new x64-Word object after shifting.
  726. *
  727. * @example
  728. *
  729. * var shifted = x64Word.shiftL(25);
  730. */
  731. // shiftL: function (n) {
  732. // if (n < 32) {
  733. // var high = (this.high << n) | (this.low >>> (32 - n));
  734. // var low = this.low << n;
  735. // } else {
  736. // var high = this.low << (n - 32);
  737. // var low = 0;
  738. // }
  739. // return X64Word.create(high, low);
  740. // },
  741. /**
  742. * Shifts this word n bits to the right.
  743. *
  744. * @param {number} n The number of bits to shift.
  745. *
  746. * @return {X64Word} A new x64-Word object after shifting.
  747. *
  748. * @example
  749. *
  750. * var shifted = x64Word.shiftR(7);
  751. */
  752. // shiftR: function (n) {
  753. // if (n < 32) {
  754. // var low = (this.low >>> n) | (this.high << (32 - n));
  755. // var high = this.high >>> n;
  756. // } else {
  757. // var low = this.high >>> (n - 32);
  758. // var high = 0;
  759. // }
  760. // return X64Word.create(high, low);
  761. // },
  762. /**
  763. * Rotates this word n bits to the left.
  764. *
  765. * @param {number} n The number of bits to rotate.
  766. *
  767. * @return {X64Word} A new x64-Word object after rotating.
  768. *
  769. * @example
  770. *
  771. * var rotated = x64Word.rotL(25);
  772. */
  773. // rotL: function (n) {
  774. // return this.shiftL(n).or(this.shiftR(64 - n));
  775. // },
  776. /**
  777. * Rotates this word n bits to the right.
  778. *
  779. * @param {number} n The number of bits to rotate.
  780. *
  781. * @return {X64Word} A new x64-Word object after rotating.
  782. *
  783. * @example
  784. *
  785. * var rotated = x64Word.rotR(7);
  786. */
  787. // rotR: function (n) {
  788. // return this.shiftR(n).or(this.shiftL(64 - n));
  789. // },
  790. /**
  791. * Adds this word with the passed word.
  792. *
  793. * @param {X64Word} word The x64-Word to add with this word.
  794. *
  795. * @return {X64Word} A new x64-Word object after adding.
  796. *
  797. * @example
  798. *
  799. * var added = x64Word.add(anotherX64Word);
  800. */
  801. // add: function (word) {
  802. // var low = (this.low + word.low) | 0;
  803. // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
  804. // var high = (this.high + word.high + carry) | 0;
  805. // return X64Word.create(high, low);
  806. // }
  807. });
  808. var X64WordArray = C_x64.WordArray = Base.extend({
  809. /**
  810. * Initializes a newly created word array.
  811. *
  812. * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
  813. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  814. *
  815. * @example
  816. *
  817. * var wordArray = CryptoJS.x64.WordArray.create();
  818. *
  819. * var wordArray = CryptoJS.x64.WordArray.create([
  820. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  821. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  822. * ]);
  823. *
  824. * var wordArray = CryptoJS.x64.WordArray.create([
  825. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  826. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  827. * ], 10);
  828. */
  829. init: function (words, sigBytes) {
  830. words = this.words = words || [];
  831. if (sigBytes != undefined2) {
  832. this.sigBytes = sigBytes;
  833. } else {
  834. this.sigBytes = words.length * 8;
  835. }
  836. },
  837. /**
  838. * Converts this 64-bit word array to a 32-bit word array.
  839. *
  840. * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
  841. *
  842. * @example
  843. *
  844. * var x32WordArray = x64WordArray.toX32();
  845. */
  846. toX32: function () {
  847. var x64Words = this.words;
  848. var x64WordsLength = x64Words.length;
  849. var x32Words = [];
  850. for (var i = 0; i < x64WordsLength; i++) {
  851. var x64Word = x64Words[i];
  852. x32Words.push(x64Word.high);
  853. x32Words.push(x64Word.low);
  854. }
  855. return X32WordArray.create(x32Words, this.sigBytes);
  856. },
  857. /**
  858. * Creates a copy of this word array.
  859. *
  860. * @return {X64WordArray} The clone.
  861. *
  862. * @example
  863. *
  864. * var clone = x64WordArray.clone();
  865. */
  866. clone: function () {
  867. var clone = Base.clone.call(this);
  868. var words = clone.words = this.words.slice(0);
  869. var wordsLength = words.length;
  870. for (var i = 0; i < wordsLength; i++) {
  871. words[i] = words[i].clone();
  872. }
  873. return clone;
  874. }
  875. });
  876. })();
  877. return CryptoJS;
  878. });
  879. }
  880. });
  881. // lib-typedarrays.js
  882. var require_lib_typedarrays = __commonJS({
  883. "lib-typedarrays.js"(exports, module) {
  884. (function (root, factory) {
  885. if (typeof exports === "object") {
  886. module.exports = exports = factory(require_core());
  887. } else if (typeof define === "function" && define.amd) {
  888. define(["./core"], factory);
  889. } else {
  890. factory(root.CryptoJS);
  891. }
  892. })(exports, function (CryptoJS) {
  893. (function () {
  894. if (typeof ArrayBuffer != "function") {
  895. return;
  896. }
  897. var C = CryptoJS;
  898. var C_lib = C.lib;
  899. var WordArray = C_lib.WordArray;
  900. var superInit = WordArray.init;
  901. var subInit = WordArray.init = function (typedArray) {
  902. if (typedArray instanceof ArrayBuffer) {
  903. typedArray = new Uint8Array(typedArray);
  904. }
  905. if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {
  906. typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
  907. }
  908. if (typedArray instanceof Uint8Array) {
  909. var typedArrayByteLength = typedArray.byteLength;
  910. var words = [];
  911. for (var i = 0; i < typedArrayByteLength; i++) {
  912. words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;
  913. }
  914. superInit.call(this, words, typedArrayByteLength);
  915. } else {
  916. superInit.apply(this, arguments);
  917. }
  918. };
  919. subInit.prototype = WordArray;
  920. })();
  921. return CryptoJS.lib.WordArray;
  922. });
  923. }
  924. });
  925. // enc-utf16.js
  926. var require_enc_utf16 = __commonJS({
  927. "enc-utf16.js"(exports, module) {
  928. (function (root, factory) {
  929. if (typeof exports === "object") {
  930. module.exports = exports = factory(require_core());
  931. } else if (typeof define === "function" && define.amd) {
  932. define(["./core"], factory);
  933. } else {
  934. factory(root.CryptoJS);
  935. }
  936. })(exports, function (CryptoJS) {
  937. (function () {
  938. var C = CryptoJS;
  939. var C_lib = C.lib;
  940. var WordArray = C_lib.WordArray;
  941. var C_enc = C.enc;
  942. var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
  943. /**
  944. * Converts a word array to a UTF-16 BE string.
  945. *
  946. * @param {WordArray} wordArray The word array.
  947. *
  948. * @return {string} The UTF-16 BE string.
  949. *
  950. * @static
  951. *
  952. * @example
  953. *
  954. * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
  955. */
  956. stringify: function (wordArray) {
  957. var words = wordArray.words;
  958. var sigBytes = wordArray.sigBytes;
  959. var utf16Chars = [];
  960. for (var i = 0; i < sigBytes; i += 2) {
  961. var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 65535;
  962. utf16Chars.push(String.fromCharCode(codePoint));
  963. }
  964. return utf16Chars.join("");
  965. },
  966. /**
  967. * Converts a UTF-16 BE string to a word array.
  968. *
  969. * @param {string} utf16Str The UTF-16 BE string.
  970. *
  971. * @return {WordArray} The word array.
  972. *
  973. * @static
  974. *
  975. * @example
  976. *
  977. * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
  978. */
  979. parse: function (utf16Str) {
  980. var utf16StrLength = utf16Str.length;
  981. var words = [];
  982. for (var i = 0; i < utf16StrLength; i++) {
  983. words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;
  984. }
  985. return WordArray.create(words, utf16StrLength * 2);
  986. }
  987. };
  988. C_enc.Utf16LE = {
  989. /**
  990. * Converts a word array to a UTF-16 LE string.
  991. *
  992. * @param {WordArray} wordArray The word array.
  993. *
  994. * @return {string} The UTF-16 LE string.
  995. *
  996. * @static
  997. *
  998. * @example
  999. *
  1000. * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
  1001. */
  1002. stringify: function (wordArray) {
  1003. var words = wordArray.words;
  1004. var sigBytes = wordArray.sigBytes;
  1005. var utf16Chars = [];
  1006. for (var i = 0; i < sigBytes; i += 2) {
  1007. var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 65535);
  1008. utf16Chars.push(String.fromCharCode(codePoint));
  1009. }
  1010. return utf16Chars.join("");
  1011. },
  1012. /**
  1013. * Converts a UTF-16 LE string to a word array.
  1014. *
  1015. * @param {string} utf16Str The UTF-16 LE string.
  1016. *
  1017. * @return {WordArray} The word array.
  1018. *
  1019. * @static
  1020. *
  1021. * @example
  1022. *
  1023. * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
  1024. */
  1025. parse: function (utf16Str) {
  1026. var utf16StrLength = utf16Str.length;
  1027. var words = [];
  1028. for (var i = 0; i < utf16StrLength; i++) {
  1029. words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);
  1030. }
  1031. return WordArray.create(words, utf16StrLength * 2);
  1032. }
  1033. };
  1034. function swapEndian(word) {
  1035. return word << 8 & 4278255360 | word >>> 8 & 16711935;
  1036. }
  1037. })();
  1038. return CryptoJS.enc.Utf16;
  1039. });
  1040. }
  1041. });
  1042. // enc-base64.js
  1043. var require_enc_base64 = __commonJS({
  1044. "enc-base64.js"(exports, module) {
  1045. (function (root, factory) {
  1046. if (typeof exports === "object") {
  1047. module.exports = exports = factory(require_core());
  1048. } else if (typeof define === "function" && define.amd) {
  1049. define(["./core"], factory);
  1050. } else {
  1051. factory(root.CryptoJS);
  1052. }
  1053. })(exports, function (CryptoJS) {
  1054. (function () {
  1055. var C = CryptoJS;
  1056. var C_lib = C.lib;
  1057. var WordArray = C_lib.WordArray;
  1058. var C_enc = C.enc;
  1059. var Base64 = C_enc.Base64 = {
  1060. /**
  1061. * Converts a word array to a Base64 string.
  1062. *
  1063. * @param {WordArray} wordArray The word array.
  1064. *
  1065. * @return {string} The Base64 string.
  1066. *
  1067. * @static
  1068. *
  1069. * @example
  1070. *
  1071. * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
  1072. */
  1073. stringify: function (wordArray) {
  1074. var words = wordArray.words;
  1075. var sigBytes = wordArray.sigBytes;
  1076. var map = this._map;
  1077. wordArray.clamp();
  1078. var base64Chars = [];
  1079. for (var i = 0; i < sigBytes; i += 3) {
  1080. var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  1081. var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
  1082. var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
  1083. var triplet = byte1 << 16 | byte2 << 8 | byte3;
  1084. for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
  1085. base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
  1086. }
  1087. }
  1088. var paddingChar = map.charAt(64);
  1089. if (paddingChar) {
  1090. while (base64Chars.length % 4) {
  1091. base64Chars.push(paddingChar);
  1092. }
  1093. }
  1094. return base64Chars.join("");
  1095. },
  1096. /**
  1097. * Converts a Base64 string to a word array.
  1098. *
  1099. * @param {string} base64Str The Base64 string.
  1100. *
  1101. * @return {WordArray} The word array.
  1102. *
  1103. * @static
  1104. *
  1105. * @example
  1106. *
  1107. * var wordArray = CryptoJS.enc.Base64.parse(base64String);
  1108. */
  1109. parse: function (base64Str) {
  1110. var base64StrLength = base64Str.length;
  1111. var map = this._map;
  1112. var reverseMap = this._reverseMap;
  1113. if (!reverseMap) {
  1114. reverseMap = this._reverseMap = [];
  1115. for (var j = 0; j < map.length; j++) {
  1116. reverseMap[map.charCodeAt(j)] = j;
  1117. }
  1118. }
  1119. var paddingChar = map.charAt(64);
  1120. if (paddingChar) {
  1121. var paddingIndex = base64Str.indexOf(paddingChar);
  1122. if (paddingIndex !== -1) {
  1123. base64StrLength = paddingIndex;
  1124. }
  1125. }
  1126. return parseLoop(base64Str, base64StrLength, reverseMap);
  1127. },
  1128. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="
  1129. };
  1130. function parseLoop(base64Str, base64StrLength, reverseMap) {
  1131. var words = [];
  1132. var nBytes = 0;
  1133. for (var i = 0; i < base64StrLength; i++) {
  1134. if (i % 4) {
  1135. var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
  1136. var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
  1137. var bitsCombined = bits1 | bits2;
  1138. words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
  1139. nBytes++;
  1140. }
  1141. }
  1142. return WordArray.create(words, nBytes);
  1143. }
  1144. })();
  1145. return CryptoJS.enc.Base64;
  1146. });
  1147. }
  1148. });
  1149. // enc-base64url.js
  1150. var require_enc_base64url = __commonJS({
  1151. "enc-base64url.js"(exports, module) {
  1152. (function (root, factory) {
  1153. if (typeof exports === "object") {
  1154. module.exports = exports = factory(require_core());
  1155. } else if (typeof define === "function" && define.amd) {
  1156. define(["./core"], factory);
  1157. } else {
  1158. factory(root.CryptoJS);
  1159. }
  1160. })(exports, function (CryptoJS) {
  1161. (function () {
  1162. var C = CryptoJS;
  1163. var C_lib = C.lib;
  1164. var WordArray = C_lib.WordArray;
  1165. var C_enc = C.enc;
  1166. var Base64url = C_enc.Base64url = {
  1167. /**
  1168. * Converts a word array to a Base64url string.
  1169. *
  1170. * @param {WordArray} wordArray The word array.
  1171. *
  1172. * @param {boolean} urlSafe Whether to use url safe
  1173. *
  1174. * @return {string} The Base64url string.
  1175. *
  1176. * @static
  1177. *
  1178. * @example
  1179. *
  1180. * var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
  1181. */
  1182. stringify: function (wordArray, urlSafe = true) {
  1183. var words = wordArray.words;
  1184. var sigBytes = wordArray.sigBytes;
  1185. var map = urlSafe ? this._safe_map : this._map;
  1186. wordArray.clamp();
  1187. var base64Chars = [];
  1188. for (var i = 0; i < sigBytes; i += 3) {
  1189. var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
  1190. var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
  1191. var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
  1192. var triplet = byte1 << 16 | byte2 << 8 | byte3;
  1193. for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
  1194. base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
  1195. }
  1196. }
  1197. var paddingChar = map.charAt(64);
  1198. if (paddingChar) {
  1199. while (base64Chars.length % 4) {
  1200. base64Chars.push(paddingChar);
  1201. }
  1202. }
  1203. return base64Chars.join("");
  1204. },
  1205. /**
  1206. * Converts a Base64url string to a word array.
  1207. *
  1208. * @param {string} base64Str The Base64url string.
  1209. *
  1210. * @param {boolean} urlSafe Whether to use url safe
  1211. *
  1212. * @return {WordArray} The word array.
  1213. *
  1214. * @static
  1215. *
  1216. * @example
  1217. *
  1218. * var wordArray = CryptoJS.enc.Base64url.parse(base64String);
  1219. */
  1220. parse: function (base64Str, urlSafe = true) {
  1221. var base64StrLength = base64Str.length;
  1222. var map = urlSafe ? this._safe_map : this._map;
  1223. var reverseMap = this._reverseMap;
  1224. if (!reverseMap) {
  1225. reverseMap = this._reverseMap = [];
  1226. for (var j = 0; j < map.length; j++) {
  1227. reverseMap[map.charCodeAt(j)] = j;
  1228. }
  1229. }
  1230. var paddingChar = map.charAt(64);
  1231. if (paddingChar) {
  1232. var paddingIndex = base64Str.indexOf(paddingChar);
  1233. if (paddingIndex !== -1) {
  1234. base64StrLength = paddingIndex;
  1235. }
  1236. }
  1237. return parseLoop(base64Str, base64StrLength, reverseMap);
  1238. },
  1239. _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
  1240. _safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
  1241. };
  1242. function parseLoop(base64Str, base64StrLength, reverseMap) {
  1243. var words = [];
  1244. var nBytes = 0;
  1245. for (var i = 0; i < base64StrLength; i++) {
  1246. if (i % 4) {
  1247. var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
  1248. var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
  1249. var bitsCombined = bits1 | bits2;
  1250. words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
  1251. nBytes++;
  1252. }
  1253. }
  1254. return WordArray.create(words, nBytes);
  1255. }
  1256. })();
  1257. return CryptoJS.enc.Base64url;
  1258. });
  1259. }
  1260. });
  1261. // md5.js
  1262. var require_md5 = __commonJS({
  1263. "md5.js"(exports, module) {
  1264. (function (root, factory) {
  1265. if (typeof exports === "object") {
  1266. module.exports = exports = factory(require_core());
  1267. } else if (typeof define === "function" && define.amd) {
  1268. define(["./core"], factory);
  1269. } else {
  1270. factory(root.CryptoJS);
  1271. }
  1272. })(exports, function (CryptoJS) {
  1273. (function (Math2) {
  1274. var C = CryptoJS;
  1275. var C_lib = C.lib;
  1276. var WordArray = C_lib.WordArray;
  1277. var Hasher = C_lib.Hasher;
  1278. var C_algo = C.algo;
  1279. var T = [];
  1280. (function () {
  1281. for (var i = 0; i < 64; i++) {
  1282. T[i] = Math2.abs(Math2.sin(i + 1)) * 4294967296 | 0;
  1283. }
  1284. })();
  1285. var MD5 = C_algo.MD5 = Hasher.extend({
  1286. _doReset: function () {
  1287. this._hash = new WordArray.init([
  1288. 1732584193,
  1289. 4023233417,
  1290. 2562383102,
  1291. 271733878
  1292. ]);
  1293. },
  1294. _doProcessBlock: function (M, offset) {
  1295. for (var i = 0; i < 16; i++) {
  1296. var offset_i = offset + i;
  1297. var M_offset_i = M[offset_i];
  1298. M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
  1299. }
  1300. var H = this._hash.words;
  1301. var M_offset_0 = M[offset + 0];
  1302. var M_offset_1 = M[offset + 1];
  1303. var M_offset_2 = M[offset + 2];
  1304. var M_offset_3 = M[offset + 3];
  1305. var M_offset_4 = M[offset + 4];
  1306. var M_offset_5 = M[offset + 5];
  1307. var M_offset_6 = M[offset + 6];
  1308. var M_offset_7 = M[offset + 7];
  1309. var M_offset_8 = M[offset + 8];
  1310. var M_offset_9 = M[offset + 9];
  1311. var M_offset_10 = M[offset + 10];
  1312. var M_offset_11 = M[offset + 11];
  1313. var M_offset_12 = M[offset + 12];
  1314. var M_offset_13 = M[offset + 13];
  1315. var M_offset_14 = M[offset + 14];
  1316. var M_offset_15 = M[offset + 15];
  1317. var a = H[0];
  1318. var b = H[1];
  1319. var c = H[2];
  1320. var d = H[3];
  1321. a = FF(a, b, c, d, M_offset_0, 7, T[0]);
  1322. d = FF(d, a, b, c, M_offset_1, 12, T[1]);
  1323. c = FF(c, d, a, b, M_offset_2, 17, T[2]);
  1324. b = FF(b, c, d, a, M_offset_3, 22, T[3]);
  1325. a = FF(a, b, c, d, M_offset_4, 7, T[4]);
  1326. d = FF(d, a, b, c, M_offset_5, 12, T[5]);
  1327. c = FF(c, d, a, b, M_offset_6, 17, T[6]);
  1328. b = FF(b, c, d, a, M_offset_7, 22, T[7]);
  1329. a = FF(a, b, c, d, M_offset_8, 7, T[8]);
  1330. d = FF(d, a, b, c, M_offset_9, 12, T[9]);
  1331. c = FF(c, d, a, b, M_offset_10, 17, T[10]);
  1332. b = FF(b, c, d, a, M_offset_11, 22, T[11]);
  1333. a = FF(a, b, c, d, M_offset_12, 7, T[12]);
  1334. d = FF(d, a, b, c, M_offset_13, 12, T[13]);
  1335. c = FF(c, d, a, b, M_offset_14, 17, T[14]);
  1336. b = FF(b, c, d, a, M_offset_15, 22, T[15]);
  1337. a = GG(a, b, c, d, M_offset_1, 5, T[16]);
  1338. d = GG(d, a, b, c, M_offset_6, 9, T[17]);
  1339. c = GG(c, d, a, b, M_offset_11, 14, T[18]);
  1340. b = GG(b, c, d, a, M_offset_0, 20, T[19]);
  1341. a = GG(a, b, c, d, M_offset_5, 5, T[20]);
  1342. d = GG(d, a, b, c, M_offset_10, 9, T[21]);
  1343. c = GG(c, d, a, b, M_offset_15, 14, T[22]);
  1344. b = GG(b, c, d, a, M_offset_4, 20, T[23]);
  1345. a = GG(a, b, c, d, M_offset_9, 5, T[24]);
  1346. d = GG(d, a, b, c, M_offset_14, 9, T[25]);
  1347. c = GG(c, d, a, b, M_offset_3, 14, T[26]);
  1348. b = GG(b, c, d, a, M_offset_8, 20, T[27]);
  1349. a = GG(a, b, c, d, M_offset_13, 5, T[28]);
  1350. d = GG(d, a, b, c, M_offset_2, 9, T[29]);
  1351. c = GG(c, d, a, b, M_offset_7, 14, T[30]);
  1352. b = GG(b, c, d, a, M_offset_12, 20, T[31]);
  1353. a = HH(a, b, c, d, M_offset_5, 4, T[32]);
  1354. d = HH(d, a, b, c, M_offset_8, 11, T[33]);
  1355. c = HH(c, d, a, b, M_offset_11, 16, T[34]);
  1356. b = HH(b, c, d, a, M_offset_14, 23, T[35]);
  1357. a = HH(a, b, c, d, M_offset_1, 4, T[36]);
  1358. d = HH(d, a, b, c, M_offset_4, 11, T[37]);
  1359. c = HH(c, d, a, b, M_offset_7, 16, T[38]);
  1360. b = HH(b, c, d, a, M_offset_10, 23, T[39]);
  1361. a = HH(a, b, c, d, M_offset_13, 4, T[40]);
  1362. d = HH(d, a, b, c, M_offset_0, 11, T[41]);
  1363. c = HH(c, d, a, b, M_offset_3, 16, T[42]);
  1364. b = HH(b, c, d, a, M_offset_6, 23, T[43]);
  1365. a = HH(a, b, c, d, M_offset_9, 4, T[44]);
  1366. d = HH(d, a, b, c, M_offset_12, 11, T[45]);
  1367. c = HH(c, d, a, b, M_offset_15, 16, T[46]);
  1368. b = HH(b, c, d, a, M_offset_2, 23, T[47]);
  1369. a = II(a, b, c, d, M_offset_0, 6, T[48]);
  1370. d = II(d, a, b, c, M_offset_7, 10, T[49]);
  1371. c = II(c, d, a, b, M_offset_14, 15, T[50]);
  1372. b = II(b, c, d, a, M_offset_5, 21, T[51]);
  1373. a = II(a, b, c, d, M_offset_12, 6, T[52]);
  1374. d = II(d, a, b, c, M_offset_3, 10, T[53]);
  1375. c = II(c, d, a, b, M_offset_10, 15, T[54]);
  1376. b = II(b, c, d, a, M_offset_1, 21, T[55]);
  1377. a = II(a, b, c, d, M_offset_8, 6, T[56]);
  1378. d = II(d, a, b, c, M_offset_15, 10, T[57]);
  1379. c = II(c, d, a, b, M_offset_6, 15, T[58]);
  1380. b = II(b, c, d, a, M_offset_13, 21, T[59]);
  1381. a = II(a, b, c, d, M_offset_4, 6, T[60]);
  1382. d = II(d, a, b, c, M_offset_11, 10, T[61]);
  1383. c = II(c, d, a, b, M_offset_2, 15, T[62]);
  1384. b = II(b, c, d, a, M_offset_9, 21, T[63]);
  1385. H[0] = H[0] + a | 0;
  1386. H[1] = H[1] + b | 0;
  1387. H[2] = H[2] + c | 0;
  1388. H[3] = H[3] + d | 0;
  1389. },
  1390. _doFinalize: function () {
  1391. var data = this._data;
  1392. var dataWords = data.words;
  1393. var nBitsTotal = this._nDataBytes * 8;
  1394. var nBitsLeft = data.sigBytes * 8;
  1395. dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
  1396. var nBitsTotalH = Math2.floor(nBitsTotal / 4294967296);
  1397. var nBitsTotalL = nBitsTotal;
  1398. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = (nBitsTotalH << 8 | nBitsTotalH >>> 24) & 16711935 | (nBitsTotalH << 24 | nBitsTotalH >>> 8) & 4278255360;
  1399. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotalL << 8 | nBitsTotalL >>> 24) & 16711935 | (nBitsTotalL << 24 | nBitsTotalL >>> 8) & 4278255360;
  1400. data.sigBytes = (dataWords.length + 1) * 4;
  1401. this._process();
  1402. var hash = this._hash;
  1403. var H = hash.words;
  1404. for (var i = 0; i < 4; i++) {
  1405. var H_i = H[i];
  1406. H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
  1407. }
  1408. return hash;
  1409. },
  1410. clone: function () {
  1411. var clone = Hasher.clone.call(this);
  1412. clone._hash = this._hash.clone();
  1413. return clone;
  1414. }
  1415. });
  1416. function FF(a, b, c, d, x, s, t) {
  1417. var n = a + (b & c | ~b & d) + x + t;
  1418. return (n << s | n >>> 32 - s) + b;
  1419. }
  1420. function GG(a, b, c, d, x, s, t) {
  1421. var n = a + (b & d | c & ~d) + x + t;
  1422. return (n << s | n >>> 32 - s) + b;
  1423. }
  1424. function HH(a, b, c, d, x, s, t) {
  1425. var n = a + (b ^ c ^ d) + x + t;
  1426. return (n << s | n >>> 32 - s) + b;
  1427. }
  1428. function II(a, b, c, d, x, s, t) {
  1429. var n = a + (c ^ (b | ~d)) + x + t;
  1430. return (n << s | n >>> 32 - s) + b;
  1431. }
  1432. C.MD5 = Hasher._createHelper(MD5);
  1433. C.HmacMD5 = Hasher._createHmacHelper(MD5);
  1434. })(Math);
  1435. return CryptoJS.MD5;
  1436. });
  1437. }
  1438. });
  1439. // sha1.js
  1440. var require_sha1 = __commonJS({
  1441. "sha1.js"(exports, module) {
  1442. (function (root, factory) {
  1443. if (typeof exports === "object") {
  1444. module.exports = exports = factory(require_core());
  1445. } else if (typeof define === "function" && define.amd) {
  1446. define(["./core"], factory);
  1447. } else {
  1448. factory(root.CryptoJS);
  1449. }
  1450. })(exports, function (CryptoJS) {
  1451. (function () {
  1452. var C = CryptoJS;
  1453. var C_lib = C.lib;
  1454. var WordArray = C_lib.WordArray;
  1455. var Hasher = C_lib.Hasher;
  1456. var C_algo = C.algo;
  1457. var W = [];
  1458. var SHA1 = C_algo.SHA1 = Hasher.extend({
  1459. _doReset: function () {
  1460. this._hash = new WordArray.init([
  1461. 1732584193,
  1462. 4023233417,
  1463. 2562383102,
  1464. 271733878,
  1465. 3285377520
  1466. ]);
  1467. },
  1468. _doProcessBlock: function (M, offset) {
  1469. var H = this._hash.words;
  1470. var a = H[0];
  1471. var b = H[1];
  1472. var c = H[2];
  1473. var d = H[3];
  1474. var e = H[4];
  1475. for (var i = 0; i < 80; i++) {
  1476. if (i < 16) {
  1477. W[i] = M[offset + i] | 0;
  1478. } else {
  1479. var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
  1480. W[i] = n << 1 | n >>> 31;
  1481. }
  1482. var t = (a << 5 | a >>> 27) + e + W[i];
  1483. if (i < 20) {
  1484. t += (b & c | ~b & d) + 1518500249;
  1485. } else if (i < 40) {
  1486. t += (b ^ c ^ d) + 1859775393;
  1487. } else if (i < 60) {
  1488. t += (b & c | b & d | c & d) - 1894007588;
  1489. } else {
  1490. t += (b ^ c ^ d) - 899497514;
  1491. }
  1492. e = d;
  1493. d = c;
  1494. c = b << 30 | b >>> 2;
  1495. b = a;
  1496. a = t;
  1497. }
  1498. H[0] = H[0] + a | 0;
  1499. H[1] = H[1] + b | 0;
  1500. H[2] = H[2] + c | 0;
  1501. H[3] = H[3] + d | 0;
  1502. H[4] = H[4] + e | 0;
  1503. },
  1504. _doFinalize: function () {
  1505. var data = this._data;
  1506. var dataWords = data.words;
  1507. var nBitsTotal = this._nDataBytes * 8;
  1508. var nBitsLeft = data.sigBytes * 8;
  1509. dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
  1510. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math.floor(nBitsTotal / 4294967296);
  1511. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
  1512. data.sigBytes = dataWords.length * 4;
  1513. this._process();
  1514. return this._hash;
  1515. },
  1516. clone: function () {
  1517. var clone = Hasher.clone.call(this);
  1518. clone._hash = this._hash.clone();
  1519. return clone;
  1520. }
  1521. });
  1522. C.SHA1 = Hasher._createHelper(SHA1);
  1523. C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
  1524. })();
  1525. return CryptoJS.SHA1;
  1526. });
  1527. }
  1528. });
  1529. // sha256.js
  1530. var require_sha256 = __commonJS({
  1531. "sha256.js"(exports, module) {
  1532. (function (root, factory) {
  1533. if (typeof exports === "object") {
  1534. module.exports = exports = factory(require_core());
  1535. } else if (typeof define === "function" && define.amd) {
  1536. define(["./core"], factory);
  1537. } else {
  1538. factory(root.CryptoJS);
  1539. }
  1540. })(exports, function (CryptoJS) {
  1541. (function (Math2) {
  1542. var C = CryptoJS;
  1543. var C_lib = C.lib;
  1544. var WordArray = C_lib.WordArray;
  1545. var Hasher = C_lib.Hasher;
  1546. var C_algo = C.algo;
  1547. var H = [];
  1548. var K = [];
  1549. (function () {
  1550. function isPrime(n2) {
  1551. var sqrtN = Math2.sqrt(n2);
  1552. for (var factor = 2; factor <= sqrtN; factor++) {
  1553. if (!(n2 % factor)) {
  1554. return false;
  1555. }
  1556. }
  1557. return true;
  1558. }
  1559. function getFractionalBits(n2) {
  1560. return (n2 - (n2 | 0)) * 4294967296 | 0;
  1561. }
  1562. var n = 2;
  1563. var nPrime = 0;
  1564. while (nPrime < 64) {
  1565. if (isPrime(n)) {
  1566. if (nPrime < 8) {
  1567. H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2));
  1568. }
  1569. K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3));
  1570. nPrime++;
  1571. }
  1572. n++;
  1573. }
  1574. })();
  1575. var W = [];
  1576. var SHA256 = C_algo.SHA256 = Hasher.extend({
  1577. _doReset: function () {
  1578. this._hash = new WordArray.init(H.slice(0));
  1579. },
  1580. _doProcessBlock: function (M, offset) {
  1581. var H2 = this._hash.words;
  1582. var a = H2[0];
  1583. var b = H2[1];
  1584. var c = H2[2];
  1585. var d = H2[3];
  1586. var e = H2[4];
  1587. var f = H2[5];
  1588. var g = H2[6];
  1589. var h = H2[7];
  1590. for (var i = 0; i < 64; i++) {
  1591. if (i < 16) {
  1592. W[i] = M[offset + i] | 0;
  1593. } else {
  1594. var gamma0x = W[i - 15];
  1595. var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
  1596. var gamma1x = W[i - 2];
  1597. var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
  1598. W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
  1599. }
  1600. var ch = e & f ^ ~e & g;
  1601. var maj = a & b ^ a & c ^ b & c;
  1602. var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
  1603. var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
  1604. var t1 = h + sigma1 + ch + K[i] + W[i];
  1605. var t2 = sigma0 + maj;
  1606. h = g;
  1607. g = f;
  1608. f = e;
  1609. e = d + t1 | 0;
  1610. d = c;
  1611. c = b;
  1612. b = a;
  1613. a = t1 + t2 | 0;
  1614. }
  1615. H2[0] = H2[0] + a | 0;
  1616. H2[1] = H2[1] + b | 0;
  1617. H2[2] = H2[2] + c | 0;
  1618. H2[3] = H2[3] + d | 0;
  1619. H2[4] = H2[4] + e | 0;
  1620. H2[5] = H2[5] + f | 0;
  1621. H2[6] = H2[6] + g | 0;
  1622. H2[7] = H2[7] + h | 0;
  1623. },
  1624. _doFinalize: function () {
  1625. var data = this._data;
  1626. var dataWords = data.words;
  1627. var nBitsTotal = this._nDataBytes * 8;
  1628. var nBitsLeft = data.sigBytes * 8;
  1629. dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
  1630. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296);
  1631. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
  1632. data.sigBytes = dataWords.length * 4;
  1633. this._process();
  1634. return this._hash;
  1635. },
  1636. clone: function () {
  1637. var clone = Hasher.clone.call(this);
  1638. clone._hash = this._hash.clone();
  1639. return clone;
  1640. }
  1641. });
  1642. C.SHA256 = Hasher._createHelper(SHA256);
  1643. C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  1644. })(Math);
  1645. return CryptoJS.SHA256;
  1646. });
  1647. }
  1648. });
  1649. // sha224.js
  1650. var require_sha224 = __commonJS({
  1651. "sha224.js"(exports, module) {
  1652. (function (root, factory, undef) {
  1653. if (typeof exports === "object") {
  1654. module.exports = exports = factory(require_core(), require_sha256());
  1655. } else if (typeof define === "function" && define.amd) {
  1656. define(["./core", "./sha256"], factory);
  1657. } else {
  1658. factory(root.CryptoJS);
  1659. }
  1660. })(exports, function (CryptoJS) {
  1661. (function () {
  1662. var C = CryptoJS;
  1663. var C_lib = C.lib;
  1664. var WordArray = C_lib.WordArray;
  1665. var C_algo = C.algo;
  1666. var SHA256 = C_algo.SHA256;
  1667. var SHA224 = C_algo.SHA224 = SHA256.extend({
  1668. _doReset: function () {
  1669. this._hash = new WordArray.init([
  1670. 3238371032,
  1671. 914150663,
  1672. 812702999,
  1673. 4144912697,
  1674. 4290775857,
  1675. 1750603025,
  1676. 1694076839,
  1677. 3204075428
  1678. ]);
  1679. },
  1680. _doFinalize: function () {
  1681. var hash = SHA256._doFinalize.call(this);
  1682. hash.sigBytes -= 4;
  1683. return hash;
  1684. }
  1685. });
  1686. C.SHA224 = SHA256._createHelper(SHA224);
  1687. C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
  1688. })();
  1689. return CryptoJS.SHA224;
  1690. });
  1691. }
  1692. });
  1693. // sha512.js
  1694. var require_sha512 = __commonJS({
  1695. "sha512.js"(exports, module) {
  1696. (function (root, factory, undef) {
  1697. if (typeof exports === "object") {
  1698. module.exports = exports = factory(require_core(), require_x64_core());
  1699. } else if (typeof define === "function" && define.amd) {
  1700. define(["./core", "./x64-core"], factory);
  1701. } else {
  1702. factory(root.CryptoJS);
  1703. }
  1704. })(exports, function (CryptoJS) {
  1705. (function () {
  1706. var C = CryptoJS;
  1707. var C_lib = C.lib;
  1708. var Hasher = C_lib.Hasher;
  1709. var C_x64 = C.x64;
  1710. var X64Word = C_x64.Word;
  1711. var X64WordArray = C_x64.WordArray;
  1712. var C_algo = C.algo;
  1713. function X64Word_create() {
  1714. return X64Word.create.apply(X64Word, arguments);
  1715. }
  1716. var K = [
  1717. X64Word_create(1116352408, 3609767458),
  1718. X64Word_create(1899447441, 602891725),
  1719. X64Word_create(3049323471, 3964484399),
  1720. X64Word_create(3921009573, 2173295548),
  1721. X64Word_create(961987163, 4081628472),
  1722. X64Word_create(1508970993, 3053834265),
  1723. X64Word_create(2453635748, 2937671579),
  1724. X64Word_create(2870763221, 3664609560),
  1725. X64Word_create(3624381080, 2734883394),
  1726. X64Word_create(310598401, 1164996542),
  1727. X64Word_create(607225278, 1323610764),
  1728. X64Word_create(1426881987, 3590304994),
  1729. X64Word_create(1925078388, 4068182383),
  1730. X64Word_create(2162078206, 991336113),
  1731. X64Word_create(2614888103, 633803317),
  1732. X64Word_create(3248222580, 3479774868),
  1733. X64Word_create(3835390401, 2666613458),
  1734. X64Word_create(4022224774, 944711139),
  1735. X64Word_create(264347078, 2341262773),
  1736. X64Word_create(604807628, 2007800933),
  1737. X64Word_create(770255983, 1495990901),
  1738. X64Word_create(1249150122, 1856431235),
  1739. X64Word_create(1555081692, 3175218132),
  1740. X64Word_create(1996064986, 2198950837),
  1741. X64Word_create(2554220882, 3999719339),
  1742. X64Word_create(2821834349, 766784016),
  1743. X64Word_create(2952996808, 2566594879),
  1744. X64Word_create(3210313671, 3203337956),
  1745. X64Word_create(3336571891, 1034457026),
  1746. X64Word_create(3584528711, 2466948901),
  1747. X64Word_create(113926993, 3758326383),
  1748. X64Word_create(338241895, 168717936),
  1749. X64Word_create(666307205, 1188179964),
  1750. X64Word_create(773529912, 1546045734),
  1751. X64Word_create(1294757372, 1522805485),
  1752. X64Word_create(1396182291, 2643833823),
  1753. X64Word_create(1695183700, 2343527390),
  1754. X64Word_create(1986661051, 1014477480),
  1755. X64Word_create(2177026350, 1206759142),
  1756. X64Word_create(2456956037, 344077627),
  1757. X64Word_create(2730485921, 1290863460),
  1758. X64Word_create(2820302411, 3158454273),
  1759. X64Word_create(3259730800, 3505952657),
  1760. X64Word_create(3345764771, 106217008),
  1761. X64Word_create(3516065817, 3606008344),
  1762. X64Word_create(3600352804, 1432725776),
  1763. X64Word_create(4094571909, 1467031594),
  1764. X64Word_create(275423344, 851169720),
  1765. X64Word_create(430227734, 3100823752),
  1766. X64Word_create(506948616, 1363258195),
  1767. X64Word_create(659060556, 3750685593),
  1768. X64Word_create(883997877, 3785050280),
  1769. X64Word_create(958139571, 3318307427),
  1770. X64Word_create(1322822218, 3812723403),
  1771. X64Word_create(1537002063, 2003034995),
  1772. X64Word_create(1747873779, 3602036899),
  1773. X64Word_create(1955562222, 1575990012),
  1774. X64Word_create(2024104815, 1125592928),
  1775. X64Word_create(2227730452, 2716904306),
  1776. X64Word_create(2361852424, 442776044),
  1777. X64Word_create(2428436474, 593698344),
  1778. X64Word_create(2756734187, 3733110249),
  1779. X64Word_create(3204031479, 2999351573),
  1780. X64Word_create(3329325298, 3815920427),
  1781. X64Word_create(3391569614, 3928383900),
  1782. X64Word_create(3515267271, 566280711),
  1783. X64Word_create(3940187606, 3454069534),
  1784. X64Word_create(4118630271, 4000239992),
  1785. X64Word_create(116418474, 1914138554),
  1786. X64Word_create(174292421, 2731055270),
  1787. X64Word_create(289380356, 3203993006),
  1788. X64Word_create(460393269, 320620315),
  1789. X64Word_create(685471733, 587496836),
  1790. X64Word_create(852142971, 1086792851),
  1791. X64Word_create(1017036298, 365543100),
  1792. X64Word_create(1126000580, 2618297676),
  1793. X64Word_create(1288033470, 3409855158),
  1794. X64Word_create(1501505948, 4234509866),
  1795. X64Word_create(1607167915, 987167468),
  1796. X64Word_create(1816402316, 1246189591)
  1797. ];
  1798. var W = [];
  1799. (function () {
  1800. for (var i = 0; i < 80; i++) {
  1801. W[i] = X64Word_create();
  1802. }
  1803. })();
  1804. var SHA512 = C_algo.SHA512 = Hasher.extend({
  1805. _doReset: function () {
  1806. this._hash = new X64WordArray.init([
  1807. new X64Word.init(1779033703, 4089235720),
  1808. new X64Word.init(3144134277, 2227873595),
  1809. new X64Word.init(1013904242, 4271175723),
  1810. new X64Word.init(2773480762, 1595750129),
  1811. new X64Word.init(1359893119, 2917565137),
  1812. new X64Word.init(2600822924, 725511199),
  1813. new X64Word.init(528734635, 4215389547),
  1814. new X64Word.init(1541459225, 327033209)
  1815. ]);
  1816. },
  1817. _doProcessBlock: function (M, offset) {
  1818. var H = this._hash.words;
  1819. var H0 = H[0];
  1820. var H1 = H[1];
  1821. var H2 = H[2];
  1822. var H3 = H[3];
  1823. var H4 = H[4];
  1824. var H5 = H[5];
  1825. var H6 = H[6];
  1826. var H7 = H[7];
  1827. var H0h = H0.high;
  1828. var H0l = H0.low;
  1829. var H1h = H1.high;
  1830. var H1l = H1.low;
  1831. var H2h = H2.high;
  1832. var H2l = H2.low;
  1833. var H3h = H3.high;
  1834. var H3l = H3.low;
  1835. var H4h = H4.high;
  1836. var H4l = H4.low;
  1837. var H5h = H5.high;
  1838. var H5l = H5.low;
  1839. var H6h = H6.high;
  1840. var H6l = H6.low;
  1841. var H7h = H7.high;
  1842. var H7l = H7.low;
  1843. var ah = H0h;
  1844. var al = H0l;
  1845. var bh = H1h;
  1846. var bl = H1l;
  1847. var ch = H2h;
  1848. var cl = H2l;
  1849. var dh = H3h;
  1850. var dl = H3l;
  1851. var eh = H4h;
  1852. var el = H4l;
  1853. var fh = H5h;
  1854. var fl = H5l;
  1855. var gh = H6h;
  1856. var gl = H6l;
  1857. var hh = H7h;
  1858. var hl = H7l;
  1859. for (var i = 0; i < 80; i++) {
  1860. var Wil;
  1861. var Wih;
  1862. var Wi = W[i];
  1863. if (i < 16) {
  1864. Wih = Wi.high = M[offset + i * 2] | 0;
  1865. Wil = Wi.low = M[offset + i * 2 + 1] | 0;
  1866. } else {
  1867. var gamma0x = W[i - 15];
  1868. var gamma0xh = gamma0x.high;
  1869. var gamma0xl = gamma0x.low;
  1870. var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;
  1871. var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);
  1872. var gamma1x = W[i - 2];
  1873. var gamma1xh = gamma1x.high;
  1874. var gamma1xl = gamma1x.low;
  1875. var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;
  1876. var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);
  1877. var Wi7 = W[i - 7];
  1878. var Wi7h = Wi7.high;
  1879. var Wi7l = Wi7.low;
  1880. var Wi16 = W[i - 16];
  1881. var Wi16h = Wi16.high;
  1882. var Wi16l = Wi16.low;
  1883. Wil = gamma0l + Wi7l;
  1884. Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);
  1885. Wil = Wil + gamma1l;
  1886. Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);
  1887. Wil = Wil + Wi16l;
  1888. Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);
  1889. Wi.high = Wih;
  1890. Wi.low = Wil;
  1891. }
  1892. var chh = eh & fh ^ ~eh & gh;
  1893. var chl = el & fl ^ ~el & gl;
  1894. var majh = ah & bh ^ ah & ch ^ bh & ch;
  1895. var majl = al & bl ^ al & cl ^ bl & cl;
  1896. var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);
  1897. var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);
  1898. var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);
  1899. var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);
  1900. var Ki = K[i];
  1901. var Kih = Ki.high;
  1902. var Kil = Ki.low;
  1903. var t1l = hl + sigma1l;
  1904. var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);
  1905. var t1l = t1l + chl;
  1906. var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);
  1907. var t1l = t1l + Kil;
  1908. var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);
  1909. var t1l = t1l + Wil;
  1910. var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);
  1911. var t2l = sigma0l + majl;
  1912. var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);
  1913. hh = gh;
  1914. hl = gl;
  1915. gh = fh;
  1916. gl = fl;
  1917. fh = eh;
  1918. fl = el;
  1919. el = dl + t1l | 0;
  1920. eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
  1921. dh = ch;
  1922. dl = cl;
  1923. ch = bh;
  1924. cl = bl;
  1925. bh = ah;
  1926. bl = al;
  1927. al = t1l + t2l | 0;
  1928. ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;
  1929. }
  1930. H0l = H0.low = H0l + al;
  1931. H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);
  1932. H1l = H1.low = H1l + bl;
  1933. H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);
  1934. H2l = H2.low = H2l + cl;
  1935. H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);
  1936. H3l = H3.low = H3l + dl;
  1937. H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);
  1938. H4l = H4.low = H4l + el;
  1939. H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);
  1940. H5l = H5.low = H5l + fl;
  1941. H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);
  1942. H6l = H6.low = H6l + gl;
  1943. H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);
  1944. H7l = H7.low = H7l + hl;
  1945. H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);
  1946. },
  1947. _doFinalize: function () {
  1948. var data = this._data;
  1949. var dataWords = data.words;
  1950. var nBitsTotal = this._nDataBytes * 8;
  1951. var nBitsLeft = data.sigBytes * 8;
  1952. dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
  1953. dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 4294967296);
  1954. dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;
  1955. data.sigBytes = dataWords.length * 4;
  1956. this._process();
  1957. var hash = this._hash.toX32();
  1958. return hash;
  1959. },
  1960. clone: function () {
  1961. var clone = Hasher.clone.call(this);
  1962. clone._hash = this._hash.clone();
  1963. return clone;
  1964. },
  1965. blockSize: 1024 / 32
  1966. });
  1967. C.SHA512 = Hasher._createHelper(SHA512);
  1968. C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
  1969. })();
  1970. return CryptoJS.SHA512;
  1971. });
  1972. }
  1973. });
  1974. // sha384.js
  1975. var require_sha384 = __commonJS({
  1976. "sha384.js"(exports, module) {
  1977. (function (root, factory, undef) {
  1978. if (typeof exports === "object") {
  1979. module.exports = exports = factory(require_core(), require_x64_core(), require_sha512());
  1980. } else if (typeof define === "function" && define.amd) {
  1981. define(["./core", "./x64-core", "./sha512"], factory);
  1982. } else {
  1983. factory(root.CryptoJS);
  1984. }
  1985. })(exports, function (CryptoJS) {
  1986. (function () {
  1987. var C = CryptoJS;
  1988. var C_x64 = C.x64;
  1989. var X64Word = C_x64.Word;
  1990. var X64WordArray = C_x64.WordArray;
  1991. var C_algo = C.algo;
  1992. var SHA512 = C_algo.SHA512;
  1993. var SHA384 = C_algo.SHA384 = SHA512.extend({
  1994. _doReset: function () {
  1995. this._hash = new X64WordArray.init([
  1996. new X64Word.init(3418070365, 3238371032),
  1997. new X64Word.init(1654270250, 914150663),
  1998. new X64Word.init(2438529370, 812702999),
  1999. new X64Word.init(355462360, 4144912697),
  2000. new X64Word.init(1731405415, 4290775857),
  2001. new X64Word.init(2394180231, 1750603025),
  2002. new X64Word.init(3675008525, 1694076839),
  2003. new X64Word.init(1203062813, 3204075428)
  2004. ]);
  2005. },
  2006. _doFinalize: function () {
  2007. var hash = SHA512._doFinalize.call(this);
  2008. hash.sigBytes -= 16;
  2009. return hash;
  2010. }
  2011. });
  2012. C.SHA384 = SHA512._createHelper(SHA384);
  2013. C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
  2014. })();
  2015. return CryptoJS.SHA384;
  2016. });
  2017. }
  2018. });
  2019. // sha3.js
  2020. var require_sha3 = __commonJS({
  2021. "sha3.js"(exports, module) {
  2022. (function (root, factory, undef) {
  2023. if (typeof exports === "object") {
  2024. module.exports = exports = factory(require_core(), require_x64_core());
  2025. } else if (typeof define === "function" && define.amd) {
  2026. define(["./core", "./x64-core"], factory);
  2027. } else {
  2028. factory(root.CryptoJS);
  2029. }
  2030. })(exports, function (CryptoJS) {
  2031. (function (Math2) {
  2032. var C = CryptoJS;
  2033. var C_lib = C.lib;
  2034. var WordArray = C_lib.WordArray;
  2035. var Hasher = C_lib.Hasher;
  2036. var C_x64 = C.x64;
  2037. var X64Word = C_x64.Word;
  2038. var C_algo = C.algo;
  2039. var RHO_OFFSETS = [];
  2040. var PI_INDEXES = [];
  2041. var ROUND_CONSTANTS = [];
  2042. (function () {
  2043. var x = 1, y = 0;
  2044. for (var t = 0; t < 24; t++) {
  2045. RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;
  2046. var newX = y % 5;
  2047. var newY = (2 * x + 3 * y) % 5;
  2048. x = newX;
  2049. y = newY;
  2050. }
  2051. for (var x = 0; x < 5; x++) {
  2052. for (var y = 0; y < 5; y++) {
  2053. PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;
  2054. }
  2055. }
  2056. var LFSR = 1;
  2057. for (var i = 0; i < 24; i++) {
  2058. var roundConstantMsw = 0;
  2059. var roundConstantLsw = 0;
  2060. for (var j = 0; j < 7; j++) {
  2061. if (LFSR & 1) {
  2062. var bitPosition = (1 << j) - 1;
  2063. if (bitPosition < 32) {
  2064. roundConstantLsw ^= 1 << bitPosition;
  2065. } else {
  2066. roundConstantMsw ^= 1 << bitPosition - 32;
  2067. }
  2068. }
  2069. if (LFSR & 128) {
  2070. LFSR = LFSR << 1 ^ 113;
  2071. } else {
  2072. LFSR <<= 1;
  2073. }
  2074. }
  2075. ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
  2076. }
  2077. })();
  2078. var T = [];
  2079. (function () {
  2080. for (var i = 0; i < 25; i++) {
  2081. T[i] = X64Word.create();
  2082. }
  2083. })();
  2084. var SHA3 = C_algo.SHA3 = Hasher.extend({
  2085. /**
  2086. * Configuration options.
  2087. *
  2088. * @property {number} outputLength
  2089. * The desired number of bits in the output hash.
  2090. * Only values permitted are: 224, 256, 384, 512.
  2091. * Default: 512
  2092. */
  2093. cfg: Hasher.cfg.extend({
  2094. outputLength: 512
  2095. }),
  2096. _doReset: function () {
  2097. var state = this._state = [];
  2098. for (var i = 0; i < 25; i++) {
  2099. state[i] = new X64Word.init();
  2100. }
  2101. this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
  2102. },
  2103. _doProcessBlock: function (M, offset) {
  2104. var state = this._state;
  2105. var nBlockSizeLanes = this.blockSize / 2;
  2106. for (var i = 0; i < nBlockSizeLanes; i++) {
  2107. var M2i = M[offset + 2 * i];
  2108. var M2i1 = M[offset + 2 * i + 1];
  2109. M2i = (M2i << 8 | M2i >>> 24) & 16711935 | (M2i << 24 | M2i >>> 8) & 4278255360;
  2110. M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 16711935 | (M2i1 << 24 | M2i1 >>> 8) & 4278255360;
  2111. var lane = state[i];
  2112. lane.high ^= M2i1;
  2113. lane.low ^= M2i;
  2114. }
  2115. for (var round = 0; round < 24; round++) {
  2116. for (var x = 0; x < 5; x++) {
  2117. var tMsw = 0, tLsw = 0;
  2118. for (var y = 0; y < 5; y++) {
  2119. var lane = state[x + 5 * y];
  2120. tMsw ^= lane.high;
  2121. tLsw ^= lane.low;
  2122. }
  2123. var Tx = T[x];
  2124. Tx.high = tMsw;
  2125. Tx.low = tLsw;
  2126. }
  2127. for (var x = 0; x < 5; x++) {
  2128. var Tx4 = T[(x + 4) % 5];
  2129. var Tx1 = T[(x + 1) % 5];
  2130. var Tx1Msw = Tx1.high;
  2131. var Tx1Lsw = Tx1.low;
  2132. var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);
  2133. var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);
  2134. for (var y = 0; y < 5; y++) {
  2135. var lane = state[x + 5 * y];
  2136. lane.high ^= tMsw;
  2137. lane.low ^= tLsw;
  2138. }
  2139. }
  2140. for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
  2141. var tMsw;
  2142. var tLsw;
  2143. var lane = state[laneIndex];
  2144. var laneMsw = lane.high;
  2145. var laneLsw = lane.low;
  2146. var rhoOffset = RHO_OFFSETS[laneIndex];
  2147. if (rhoOffset < 32) {
  2148. tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;
  2149. tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;
  2150. } else {
  2151. tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;
  2152. tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;
  2153. }
  2154. var TPiLane = T[PI_INDEXES[laneIndex]];
  2155. TPiLane.high = tMsw;
  2156. TPiLane.low = tLsw;
  2157. }
  2158. var T0 = T[0];
  2159. var state0 = state[0];
  2160. T0.high = state0.high;
  2161. T0.low = state0.low;
  2162. for (var x = 0; x < 5; x++) {
  2163. for (var y = 0; y < 5; y++) {
  2164. var laneIndex = x + 5 * y;
  2165. var lane = state[laneIndex];
  2166. var TLane = T[laneIndex];
  2167. var Tx1Lane = T[(x + 1) % 5 + 5 * y];
  2168. var Tx2Lane = T[(x + 2) % 5 + 5 * y];
  2169. lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;
  2170. lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;
  2171. }
  2172. }
  2173. var lane = state[0];
  2174. var roundConstant = ROUND_CONSTANTS[round];
  2175. lane.high ^= roundConstant.high;
  2176. lane.low ^= roundConstant.low;
  2177. }
  2178. },
  2179. _doFinalize: function () {
  2180. var data = this._data;
  2181. var dataWords = data.words;
  2182. var nBitsTotal = this._nDataBytes * 8;
  2183. var nBitsLeft = data.sigBytes * 8;
  2184. var blockSizeBits = this.blockSize * 32;
  2185. dataWords[nBitsLeft >>> 5] |= 1 << 24 - nBitsLeft % 32;
  2186. dataWords[(Math2.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 128;
  2187. data.sigBytes = dataWords.length * 4;
  2188. this._process();
  2189. var state = this._state;
  2190. var outputLengthBytes = this.cfg.outputLength / 8;
  2191. var outputLengthLanes = outputLengthBytes / 8;
  2192. var hashWords = [];
  2193. for (var i = 0; i < outputLengthLanes; i++) {
  2194. var lane = state[i];
  2195. var laneMsw = lane.high;
  2196. var laneLsw = lane.low;
  2197. laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 16711935 | (laneMsw << 24 | laneMsw >>> 8) & 4278255360;
  2198. laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 16711935 | (laneLsw << 24 | laneLsw >>> 8) & 4278255360;
  2199. hashWords.push(laneLsw);
  2200. hashWords.push(laneMsw);
  2201. }
  2202. return new WordArray.init(hashWords, outputLengthBytes);
  2203. },
  2204. clone: function () {
  2205. var clone = Hasher.clone.call(this);
  2206. var state = clone._state = this._state.slice(0);
  2207. for (var i = 0; i < 25; i++) {
  2208. state[i] = state[i].clone();
  2209. }
  2210. return clone;
  2211. }
  2212. });
  2213. C.SHA3 = Hasher._createHelper(SHA3);
  2214. C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
  2215. })(Math);
  2216. return CryptoJS.SHA3;
  2217. });
  2218. }
  2219. });
  2220. // ripemd160.js
  2221. var require_ripemd160 = __commonJS({
  2222. "ripemd160.js"(exports, module) {
  2223. (function (root, factory) {
  2224. if (typeof exports === "object") {
  2225. module.exports = exports = factory(require_core());
  2226. } else if (typeof define === "function" && define.amd) {
  2227. define(["./core"], factory);
  2228. } else {
  2229. factory(root.CryptoJS);
  2230. }
  2231. })(exports, function (CryptoJS) {
  2232. (function (Math2) {
  2233. var C = CryptoJS;
  2234. var C_lib = C.lib;
  2235. var WordArray = C_lib.WordArray;
  2236. var Hasher = C_lib.Hasher;
  2237. var C_algo = C.algo;
  2238. var _zl = WordArray.create([
  2239. 0,
  2240. 1,
  2241. 2,
  2242. 3,
  2243. 4,
  2244. 5,
  2245. 6,
  2246. 7,
  2247. 8,
  2248. 9,
  2249. 10,
  2250. 11,
  2251. 12,
  2252. 13,
  2253. 14,
  2254. 15,
  2255. 7,
  2256. 4,
  2257. 13,
  2258. 1,
  2259. 10,
  2260. 6,
  2261. 15,
  2262. 3,
  2263. 12,
  2264. 0,
  2265. 9,
  2266. 5,
  2267. 2,
  2268. 14,
  2269. 11,
  2270. 8,
  2271. 3,
  2272. 10,
  2273. 14,
  2274. 4,
  2275. 9,
  2276. 15,
  2277. 8,
  2278. 1,
  2279. 2,
  2280. 7,
  2281. 0,
  2282. 6,
  2283. 13,
  2284. 11,
  2285. 5,
  2286. 12,
  2287. 1,
  2288. 9,
  2289. 11,
  2290. 10,
  2291. 0,
  2292. 8,
  2293. 12,
  2294. 4,
  2295. 13,
  2296. 3,
  2297. 7,
  2298. 15,
  2299. 14,
  2300. 5,
  2301. 6,
  2302. 2,
  2303. 4,
  2304. 0,
  2305. 5,
  2306. 9,
  2307. 7,
  2308. 12,
  2309. 2,
  2310. 10,
  2311. 14,
  2312. 1,
  2313. 3,
  2314. 8,
  2315. 11,
  2316. 6,
  2317. 15,
  2318. 13
  2319. ]);
  2320. var _zr = WordArray.create([
  2321. 5,
  2322. 14,
  2323. 7,
  2324. 0,
  2325. 9,
  2326. 2,
  2327. 11,
  2328. 4,
  2329. 13,
  2330. 6,
  2331. 15,
  2332. 8,
  2333. 1,
  2334. 10,
  2335. 3,
  2336. 12,
  2337. 6,
  2338. 11,
  2339. 3,
  2340. 7,
  2341. 0,
  2342. 13,
  2343. 5,
  2344. 10,
  2345. 14,
  2346. 15,
  2347. 8,
  2348. 12,
  2349. 4,
  2350. 9,
  2351. 1,
  2352. 2,
  2353. 15,
  2354. 5,
  2355. 1,
  2356. 3,
  2357. 7,
  2358. 14,
  2359. 6,
  2360. 9,
  2361. 11,
  2362. 8,
  2363. 12,
  2364. 2,
  2365. 10,
  2366. 0,
  2367. 4,
  2368. 13,
  2369. 8,
  2370. 6,
  2371. 4,
  2372. 1,
  2373. 3,
  2374. 11,
  2375. 15,
  2376. 0,
  2377. 5,
  2378. 12,
  2379. 2,
  2380. 13,
  2381. 9,
  2382. 7,
  2383. 10,
  2384. 14,
  2385. 12,
  2386. 15,
  2387. 10,
  2388. 4,
  2389. 1,
  2390. 5,
  2391. 8,
  2392. 7,
  2393. 6,
  2394. 2,
  2395. 13,
  2396. 14,
  2397. 0,
  2398. 3,
  2399. 9,
  2400. 11
  2401. ]);
  2402. var _sl = WordArray.create([
  2403. 11,
  2404. 14,
  2405. 15,
  2406. 12,
  2407. 5,
  2408. 8,
  2409. 7,
  2410. 9,
  2411. 11,
  2412. 13,
  2413. 14,
  2414. 15,
  2415. 6,
  2416. 7,
  2417. 9,
  2418. 8,
  2419. 7,
  2420. 6,
  2421. 8,
  2422. 13,
  2423. 11,
  2424. 9,
  2425. 7,
  2426. 15,
  2427. 7,
  2428. 12,
  2429. 15,
  2430. 9,
  2431. 11,
  2432. 7,
  2433. 13,
  2434. 12,
  2435. 11,
  2436. 13,
  2437. 6,
  2438. 7,
  2439. 14,
  2440. 9,
  2441. 13,
  2442. 15,
  2443. 14,
  2444. 8,
  2445. 13,
  2446. 6,
  2447. 5,
  2448. 12,
  2449. 7,
  2450. 5,
  2451. 11,
  2452. 12,
  2453. 14,
  2454. 15,
  2455. 14,
  2456. 15,
  2457. 9,
  2458. 8,
  2459. 9,
  2460. 14,
  2461. 5,
  2462. 6,
  2463. 8,
  2464. 6,
  2465. 5,
  2466. 12,
  2467. 9,
  2468. 15,
  2469. 5,
  2470. 11,
  2471. 6,
  2472. 8,
  2473. 13,
  2474. 12,
  2475. 5,
  2476. 12,
  2477. 13,
  2478. 14,
  2479. 11,
  2480. 8,
  2481. 5,
  2482. 6
  2483. ]);
  2484. var _sr = WordArray.create([
  2485. 8,
  2486. 9,
  2487. 9,
  2488. 11,
  2489. 13,
  2490. 15,
  2491. 15,
  2492. 5,
  2493. 7,
  2494. 7,
  2495. 8,
  2496. 11,
  2497. 14,
  2498. 14,
  2499. 12,
  2500. 6,
  2501. 9,
  2502. 13,
  2503. 15,
  2504. 7,
  2505. 12,
  2506. 8,
  2507. 9,
  2508. 11,
  2509. 7,
  2510. 7,
  2511. 12,
  2512. 7,
  2513. 6,
  2514. 15,
  2515. 13,
  2516. 11,
  2517. 9,
  2518. 7,
  2519. 15,
  2520. 11,
  2521. 8,
  2522. 6,
  2523. 6,
  2524. 14,
  2525. 12,
  2526. 13,
  2527. 5,
  2528. 14,
  2529. 13,
  2530. 13,
  2531. 7,
  2532. 5,
  2533. 15,
  2534. 5,
  2535. 8,
  2536. 11,
  2537. 14,
  2538. 14,
  2539. 6,
  2540. 14,
  2541. 6,
  2542. 9,
  2543. 12,
  2544. 9,
  2545. 12,
  2546. 5,
  2547. 15,
  2548. 8,
  2549. 8,
  2550. 5,
  2551. 12,
  2552. 9,
  2553. 12,
  2554. 5,
  2555. 14,
  2556. 6,
  2557. 8,
  2558. 13,
  2559. 6,
  2560. 5,
  2561. 15,
  2562. 13,
  2563. 11,
  2564. 11
  2565. ]);
  2566. var _hl = WordArray.create([0, 1518500249, 1859775393, 2400959708, 2840853838]);
  2567. var _hr = WordArray.create([1352829926, 1548603684, 1836072691, 2053994217, 0]);
  2568. var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
  2569. _doReset: function () {
  2570. this._hash = WordArray.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
  2571. },
  2572. _doProcessBlock: function (M, offset) {
  2573. for (var i = 0; i < 16; i++) {
  2574. var offset_i = offset + i;
  2575. var M_offset_i = M[offset_i];
  2576. M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
  2577. }
  2578. var H = this._hash.words;
  2579. var hl = _hl.words;
  2580. var hr = _hr.words;
  2581. var zl = _zl.words;
  2582. var zr = _zr.words;
  2583. var sl = _sl.words;
  2584. var sr = _sr.words;
  2585. var al, bl, cl, dl, el;
  2586. var ar, br, cr, dr, er;
  2587. ar = al = H[0];
  2588. br = bl = H[1];
  2589. cr = cl = H[2];
  2590. dr = dl = H[3];
  2591. er = el = H[4];
  2592. var t;
  2593. for (var i = 0; i < 80; i += 1) {
  2594. t = al + M[offset + zl[i]] | 0;
  2595. if (i < 16) {
  2596. t += f1(bl, cl, dl) + hl[0];
  2597. } else if (i < 32) {
  2598. t += f2(bl, cl, dl) + hl[1];
  2599. } else if (i < 48) {
  2600. t += f3(bl, cl, dl) + hl[2];
  2601. } else if (i < 64) {
  2602. t += f4(bl, cl, dl) + hl[3];
  2603. } else {
  2604. t += f5(bl, cl, dl) + hl[4];
  2605. }
  2606. t = t | 0;
  2607. t = rotl(t, sl[i]);
  2608. t = t + el | 0;
  2609. al = el;
  2610. el = dl;
  2611. dl = rotl(cl, 10);
  2612. cl = bl;
  2613. bl = t;
  2614. t = ar + M[offset + zr[i]] | 0;
  2615. if (i < 16) {
  2616. t += f5(br, cr, dr) + hr[0];
  2617. } else if (i < 32) {
  2618. t += f4(br, cr, dr) + hr[1];
  2619. } else if (i < 48) {
  2620. t += f3(br, cr, dr) + hr[2];
  2621. } else if (i < 64) {
  2622. t += f2(br, cr, dr) + hr[3];
  2623. } else {
  2624. t += f1(br, cr, dr) + hr[4];
  2625. }
  2626. t = t | 0;
  2627. t = rotl(t, sr[i]);
  2628. t = t + er | 0;
  2629. ar = er;
  2630. er = dr;
  2631. dr = rotl(cr, 10);
  2632. cr = br;
  2633. br = t;
  2634. }
  2635. t = H[1] + cl + dr | 0;
  2636. H[1] = H[2] + dl + er | 0;
  2637. H[2] = H[3] + el + ar | 0;
  2638. H[3] = H[4] + al + br | 0;
  2639. H[4] = H[0] + bl + cr | 0;
  2640. H[0] = t;
  2641. },
  2642. _doFinalize: function () {
  2643. var data = this._data;
  2644. var dataWords = data.words;
  2645. var nBitsTotal = this._nDataBytes * 8;
  2646. var nBitsLeft = data.sigBytes * 8;
  2647. dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
  2648. dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 16711935 | (nBitsTotal << 24 | nBitsTotal >>> 8) & 4278255360;
  2649. data.sigBytes = (dataWords.length + 1) * 4;
  2650. this._process();
  2651. var hash = this._hash;
  2652. var H = hash.words;
  2653. for (var i = 0; i < 5; i++) {
  2654. var H_i = H[i];
  2655. H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
  2656. }
  2657. return hash;
  2658. },
  2659. clone: function () {
  2660. var clone = Hasher.clone.call(this);
  2661. clone._hash = this._hash.clone();
  2662. return clone;
  2663. }
  2664. });
  2665. function f1(x, y, z) {
  2666. return x ^ y ^ z;
  2667. }
  2668. function f2(x, y, z) {
  2669. return x & y | ~x & z;
  2670. }
  2671. function f3(x, y, z) {
  2672. return (x | ~y) ^ z;
  2673. }
  2674. function f4(x, y, z) {
  2675. return x & z | y & ~z;
  2676. }
  2677. function f5(x, y, z) {
  2678. return x ^ (y | ~z);
  2679. }
  2680. function rotl(x, n) {
  2681. return x << n | x >>> 32 - n;
  2682. }
  2683. C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
  2684. C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
  2685. })(Math);
  2686. return CryptoJS.RIPEMD160;
  2687. });
  2688. }
  2689. });
  2690. // hmac.js
  2691. var require_hmac = __commonJS({
  2692. "hmac.js"(exports, module) {
  2693. (function (root, factory) {
  2694. if (typeof exports === "object") {
  2695. module.exports = exports = factory(require_core());
  2696. } else if (typeof define === "function" && define.amd) {
  2697. define(["./core"], factory);
  2698. } else {
  2699. factory(root.CryptoJS);
  2700. }
  2701. })(exports, function (CryptoJS) {
  2702. (function () {
  2703. var C = CryptoJS;
  2704. var C_lib = C.lib;
  2705. var Base = C_lib.Base;
  2706. var C_enc = C.enc;
  2707. var Utf8 = C_enc.Utf8;
  2708. var C_algo = C.algo;
  2709. var HMAC = C_algo.HMAC = Base.extend({
  2710. /**
  2711. * Initializes a newly created HMAC.
  2712. *
  2713. * @param {Hasher} hasher The hash algorithm to use.
  2714. * @param {WordArray|string} key The secret key.
  2715. *
  2716. * @example
  2717. *
  2718. * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
  2719. */
  2720. init: function (hasher, key) {
  2721. hasher = this._hasher = new hasher.init();
  2722. if (typeof key == "string") {
  2723. key = Utf8.parse(key);
  2724. }
  2725. var hasherBlockSize = hasher.blockSize;
  2726. var hasherBlockSizeBytes = hasherBlockSize * 4;
  2727. if (key.sigBytes > hasherBlockSizeBytes) {
  2728. key = hasher.finalize(key);
  2729. }
  2730. key.clamp();
  2731. var oKey = this._oKey = key.clone();
  2732. var iKey = this._iKey = key.clone();
  2733. var oKeyWords = oKey.words;
  2734. var iKeyWords = iKey.words;
  2735. for (var i = 0; i < hasherBlockSize; i++) {
  2736. oKeyWords[i] ^= 1549556828;
  2737. iKeyWords[i] ^= 909522486;
  2738. }
  2739. oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
  2740. this.reset();
  2741. },
  2742. /**
  2743. * Resets this HMAC to its initial state.
  2744. *
  2745. * @example
  2746. *
  2747. * hmacHasher.reset();
  2748. */
  2749. reset: function () {
  2750. var hasher = this._hasher;
  2751. hasher.reset();
  2752. hasher.update(this._iKey);
  2753. },
  2754. /**
  2755. * Updates this HMAC with a message.
  2756. *
  2757. * @param {WordArray|string} messageUpdate The message to append.
  2758. *
  2759. * @return {HMAC} This HMAC instance.
  2760. *
  2761. * @example
  2762. *
  2763. * hmacHasher.update('message');
  2764. * hmacHasher.update(wordArray);
  2765. */
  2766. update: function (messageUpdate) {
  2767. this._hasher.update(messageUpdate);
  2768. return this;
  2769. },
  2770. /**
  2771. * Finalizes the HMAC computation.
  2772. * Note that the finalize operation is effectively a destructive, read-once operation.
  2773. *
  2774. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  2775. *
  2776. * @return {WordArray} The HMAC.
  2777. *
  2778. * @example
  2779. *
  2780. * var hmac = hmacHasher.finalize();
  2781. * var hmac = hmacHasher.finalize('message');
  2782. * var hmac = hmacHasher.finalize(wordArray);
  2783. */
  2784. finalize: function (messageUpdate) {
  2785. var hasher = this._hasher;
  2786. var innerHash = hasher.finalize(messageUpdate);
  2787. hasher.reset();
  2788. var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
  2789. return hmac;
  2790. }
  2791. });
  2792. })();
  2793. });
  2794. }
  2795. });
  2796. // pbkdf2.js
  2797. var require_pbkdf2 = __commonJS({
  2798. "pbkdf2.js"(exports, module) {
  2799. (function (root, factory, undef) {
  2800. if (typeof exports === "object") {
  2801. module.exports = exports = factory(require_core(), require_sha1(), require_hmac());
  2802. } else if (typeof define === "function" && define.amd) {
  2803. define(["./core", "./sha1", "./hmac"], factory);
  2804. } else {
  2805. factory(root.CryptoJS);
  2806. }
  2807. })(exports, function (CryptoJS) {
  2808. (function () {
  2809. var C = CryptoJS;
  2810. var C_lib = C.lib;
  2811. var Base = C_lib.Base;
  2812. var WordArray = C_lib.WordArray;
  2813. var C_algo = C.algo;
  2814. var SHA1 = C_algo.SHA1;
  2815. var HMAC = C_algo.HMAC;
  2816. var PBKDF2 = C_algo.PBKDF2 = Base.extend({
  2817. /**
  2818. * Configuration options.
  2819. *
  2820. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  2821. * @property {Hasher} hasher The hasher to use. Default: SHA1
  2822. * @property {number} iterations The number of iterations to perform. Default: 1
  2823. */
  2824. cfg: Base.extend({
  2825. keySize: 128 / 32,
  2826. hasher: SHA1,
  2827. iterations: 1
  2828. }),
  2829. /**
  2830. * Initializes a newly created key derivation function.
  2831. *
  2832. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  2833. *
  2834. * @example
  2835. *
  2836. * var kdf = CryptoJS.algo.PBKDF2.create();
  2837. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
  2838. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
  2839. */
  2840. init: function (cfg) {
  2841. this.cfg = this.cfg.extend(cfg);
  2842. },
  2843. /**
  2844. * Computes the Password-Based Key Derivation Function 2.
  2845. *
  2846. * @param {WordArray|string} password The password.
  2847. * @param {WordArray|string} salt A salt.
  2848. *
  2849. * @return {WordArray} The derived key.
  2850. *
  2851. * @example
  2852. *
  2853. * var key = kdf.compute(password, salt);
  2854. */
  2855. compute: function (password, salt) {
  2856. var cfg = this.cfg;
  2857. var hmac = HMAC.create(cfg.hasher, password);
  2858. var derivedKey = WordArray.create();
  2859. var blockIndex = WordArray.create([1]);
  2860. var derivedKeyWords = derivedKey.words;
  2861. var blockIndexWords = blockIndex.words;
  2862. var keySize = cfg.keySize;
  2863. var iterations = cfg.iterations;
  2864. while (derivedKeyWords.length < keySize) {
  2865. var block = hmac.update(salt).finalize(blockIndex);
  2866. hmac.reset();
  2867. var blockWords = block.words;
  2868. var blockWordsLength = blockWords.length;
  2869. var intermediate = block;
  2870. for (var i = 1; i < iterations; i++) {
  2871. intermediate = hmac.finalize(intermediate);
  2872. hmac.reset();
  2873. var intermediateWords = intermediate.words;
  2874. for (var j = 0; j < blockWordsLength; j++) {
  2875. blockWords[j] ^= intermediateWords[j];
  2876. }
  2877. }
  2878. derivedKey.concat(block);
  2879. blockIndexWords[0]++;
  2880. }
  2881. derivedKey.sigBytes = keySize * 4;
  2882. return derivedKey;
  2883. }
  2884. });
  2885. C.PBKDF2 = function (password, salt, cfg) {
  2886. return PBKDF2.create(cfg).compute(password, salt);
  2887. };
  2888. })();
  2889. return CryptoJS.PBKDF2;
  2890. });
  2891. }
  2892. });
  2893. // evpkdf.js
  2894. var require_evpkdf = __commonJS({
  2895. "evpkdf.js"(exports, module) {
  2896. (function (root, factory, undef) {
  2897. if (typeof exports === "object") {
  2898. module.exports = exports = factory(require_core(), require_sha1(), require_hmac());
  2899. } else if (typeof define === "function" && define.amd) {
  2900. define(["./core", "./sha1", "./hmac"], factory);
  2901. } else {
  2902. factory(root.CryptoJS);
  2903. }
  2904. })(exports, function (CryptoJS) {
  2905. (function () {
  2906. var C = CryptoJS;
  2907. var C_lib = C.lib;
  2908. var Base = C_lib.Base;
  2909. var WordArray = C_lib.WordArray;
  2910. var C_algo = C.algo;
  2911. var MD5 = C_algo.MD5;
  2912. var EvpKDF = C_algo.EvpKDF = Base.extend({
  2913. /**
  2914. * Configuration options.
  2915. *
  2916. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  2917. * @property {Hasher} hasher The hash algorithm to use. Default: MD5
  2918. * @property {number} iterations The number of iterations to perform. Default: 1
  2919. */
  2920. cfg: Base.extend({
  2921. keySize: 128 / 32,
  2922. hasher: MD5,
  2923. iterations: 1
  2924. }),
  2925. /**
  2926. * Initializes a newly created key derivation function.
  2927. *
  2928. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  2929. *
  2930. * @example
  2931. *
  2932. * var kdf = CryptoJS.algo.EvpKDF.create();
  2933. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
  2934. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
  2935. */
  2936. init: function (cfg) {
  2937. this.cfg = this.cfg.extend(cfg);
  2938. },
  2939. /**
  2940. * Derives a key from a password.
  2941. *
  2942. * @param {WordArray|string} password The password.
  2943. * @param {WordArray|string} salt A salt.
  2944. *
  2945. * @return {WordArray} The derived key.
  2946. *
  2947. * @example
  2948. *
  2949. * var key = kdf.compute(password, salt);
  2950. */
  2951. compute: function (password, salt) {
  2952. var block;
  2953. var cfg = this.cfg;
  2954. var hasher = cfg.hasher.create();
  2955. var derivedKey = WordArray.create();
  2956. var derivedKeyWords = derivedKey.words;
  2957. var keySize = cfg.keySize;
  2958. var iterations = cfg.iterations;
  2959. while (derivedKeyWords.length < keySize) {
  2960. if (block) {
  2961. hasher.update(block);
  2962. }
  2963. block = hasher.update(password).finalize(salt);
  2964. hasher.reset();
  2965. for (var i = 1; i < iterations; i++) {
  2966. block = hasher.finalize(block);
  2967. hasher.reset();
  2968. }
  2969. derivedKey.concat(block);
  2970. }
  2971. derivedKey.sigBytes = keySize * 4;
  2972. return derivedKey;
  2973. }
  2974. });
  2975. C.EvpKDF = function (password, salt, cfg) {
  2976. return EvpKDF.create(cfg).compute(password, salt);
  2977. };
  2978. })();
  2979. return CryptoJS.EvpKDF;
  2980. });
  2981. }
  2982. });
  2983. // cipher-core.js
  2984. var require_cipher_core = __commonJS({
  2985. "cipher-core.js"(exports, module) {
  2986. (function (root, factory, undef) {
  2987. if (typeof exports === "object") {
  2988. module.exports = exports = factory(require_core(), require_evpkdf());
  2989. } else if (typeof define === "function" && define.amd) {
  2990. define(["./core", "./evpkdf"], factory);
  2991. } else {
  2992. factory(root.CryptoJS);
  2993. }
  2994. })(exports, function (CryptoJS) {
  2995. CryptoJS.lib.Cipher || function (undefined2) {
  2996. var C = CryptoJS;
  2997. var C_lib = C.lib;
  2998. var Base = C_lib.Base;
  2999. var WordArray = C_lib.WordArray;
  3000. var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
  3001. var C_enc = C.enc;
  3002. var Utf8 = C_enc.Utf8;
  3003. var Base64 = C_enc.Base64;
  3004. var C_algo = C.algo;
  3005. var EvpKDF = C_algo.EvpKDF;
  3006. var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
  3007. /**
  3008. * Configuration options.
  3009. *
  3010. * @property {WordArray} iv The IV to use for this operation.
  3011. */
  3012. cfg: Base.extend(),
  3013. /**
  3014. * Creates this cipher in encryption mode.
  3015. *
  3016. * @param {WordArray} key The key.
  3017. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3018. *
  3019. * @return {Cipher} A cipher instance.
  3020. *
  3021. * @static
  3022. *
  3023. * @example
  3024. *
  3025. * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
  3026. */
  3027. createEncryptor: function (key, cfg) {
  3028. return this.create(this._ENC_XFORM_MODE, key, cfg);
  3029. },
  3030. /**
  3031. * Creates this cipher in decryption mode.
  3032. *
  3033. * @param {WordArray} key The key.
  3034. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3035. *
  3036. * @return {Cipher} A cipher instance.
  3037. *
  3038. * @static
  3039. *
  3040. * @example
  3041. *
  3042. * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
  3043. */
  3044. createDecryptor: function (key, cfg) {
  3045. return this.create(this._DEC_XFORM_MODE, key, cfg);
  3046. },
  3047. /**
  3048. * Initializes a newly created cipher.
  3049. *
  3050. * @param {number} xformMode Either the encryption or decryption transormation mode constant.
  3051. * @param {WordArray} key The key.
  3052. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3053. *
  3054. * @example
  3055. *
  3056. * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
  3057. */
  3058. init: function (xformMode, key, cfg) {
  3059. this.cfg = this.cfg.extend(cfg);
  3060. this._xformMode = xformMode;
  3061. this._key = key;
  3062. this.reset();
  3063. },
  3064. /**
  3065. * Resets this cipher to its initial state.
  3066. *
  3067. * @example
  3068. *
  3069. * cipher.reset();
  3070. */
  3071. reset: function () {
  3072. BufferedBlockAlgorithm.reset.call(this);
  3073. this._doReset();
  3074. },
  3075. /**
  3076. * Adds data to be encrypted or decrypted.
  3077. *
  3078. * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
  3079. *
  3080. * @return {WordArray} The data after processing.
  3081. *
  3082. * @example
  3083. *
  3084. * var encrypted = cipher.process('data');
  3085. * var encrypted = cipher.process(wordArray);
  3086. */
  3087. process: function (dataUpdate) {
  3088. this._append(dataUpdate);
  3089. return this._process();
  3090. },
  3091. /**
  3092. * Finalizes the encryption or decryption process.
  3093. * Note that the finalize operation is effectively a destructive, read-once operation.
  3094. *
  3095. * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
  3096. *
  3097. * @return {WordArray} The data after final processing.
  3098. *
  3099. * @example
  3100. *
  3101. * var encrypted = cipher.finalize();
  3102. * var encrypted = cipher.finalize('data');
  3103. * var encrypted = cipher.finalize(wordArray);
  3104. */
  3105. finalize: function (dataUpdate) {
  3106. if (dataUpdate) {
  3107. this._append(dataUpdate);
  3108. }
  3109. var finalProcessedData = this._doFinalize();
  3110. return finalProcessedData;
  3111. },
  3112. keySize: 128 / 32,
  3113. ivSize: 128 / 32,
  3114. _ENC_XFORM_MODE: 1,
  3115. _DEC_XFORM_MODE: 2,
  3116. /**
  3117. * Creates shortcut functions to a cipher's object interface.
  3118. *
  3119. * @param {Cipher} cipher The cipher to create a helper for.
  3120. *
  3121. * @return {Object} An object with encrypt and decrypt shortcut functions.
  3122. *
  3123. * @static
  3124. *
  3125. * @example
  3126. *
  3127. * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
  3128. */
  3129. _createHelper: function () {
  3130. function selectCipherStrategy(key) {
  3131. if (typeof key == "string") {
  3132. return PasswordBasedCipher;
  3133. } else {
  3134. return SerializableCipher;
  3135. }
  3136. }
  3137. return function (cipher) {
  3138. return {
  3139. encrypt: function (message, key, cfg) {
  3140. return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
  3141. },
  3142. decrypt: function (ciphertext, key, cfg) {
  3143. return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
  3144. }
  3145. };
  3146. };
  3147. }()
  3148. });
  3149. var StreamCipher = C_lib.StreamCipher = Cipher.extend({
  3150. _doFinalize: function () {
  3151. var finalProcessedBlocks = this._process(true);
  3152. return finalProcessedBlocks;
  3153. },
  3154. blockSize: 1
  3155. });
  3156. var C_mode = C.mode = {};
  3157. var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
  3158. /**
  3159. * Creates this mode for encryption.
  3160. *
  3161. * @param {Cipher} cipher A block cipher instance.
  3162. * @param {Array} iv The IV words.
  3163. *
  3164. * @static
  3165. *
  3166. * @example
  3167. *
  3168. * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
  3169. */
  3170. createEncryptor: function (cipher, iv) {
  3171. return this.Encryptor.create(cipher, iv);
  3172. },
  3173. /**
  3174. * Creates this mode for decryption.
  3175. *
  3176. * @param {Cipher} cipher A block cipher instance.
  3177. * @param {Array} iv The IV words.
  3178. *
  3179. * @static
  3180. *
  3181. * @example
  3182. *
  3183. * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
  3184. */
  3185. createDecryptor: function (cipher, iv) {
  3186. return this.Decryptor.create(cipher, iv);
  3187. },
  3188. /**
  3189. * Initializes a newly created mode.
  3190. *
  3191. * @param {Cipher} cipher A block cipher instance.
  3192. * @param {Array} iv The IV words.
  3193. *
  3194. * @example
  3195. *
  3196. * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
  3197. */
  3198. init: function (cipher, iv) {
  3199. this._cipher = cipher;
  3200. this._iv = iv;
  3201. }
  3202. });
  3203. var CBC = C_mode.CBC = function () {
  3204. var CBC2 = BlockCipherMode.extend();
  3205. CBC2.Encryptor = CBC2.extend({
  3206. /**
  3207. * Processes the data block at offset.
  3208. *
  3209. * @param {Array} words The data words to operate on.
  3210. * @param {number} offset The offset where the block starts.
  3211. *
  3212. * @example
  3213. *
  3214. * mode.processBlock(data.words, offset);
  3215. */
  3216. processBlock: function (words, offset) {
  3217. var cipher = this._cipher;
  3218. var blockSize = cipher.blockSize;
  3219. xorBlock.call(this, words, offset, blockSize);
  3220. cipher.encryptBlock(words, offset);
  3221. this._prevBlock = words.slice(offset, offset + blockSize);
  3222. }
  3223. });
  3224. CBC2.Decryptor = CBC2.extend({
  3225. /**
  3226. * Processes the data block at offset.
  3227. *
  3228. * @param {Array} words The data words to operate on.
  3229. * @param {number} offset The offset where the block starts.
  3230. *
  3231. * @example
  3232. *
  3233. * mode.processBlock(data.words, offset);
  3234. */
  3235. processBlock: function (words, offset) {
  3236. var cipher = this._cipher;
  3237. var blockSize = cipher.blockSize;
  3238. var thisBlock = words.slice(offset, offset + blockSize);
  3239. cipher.decryptBlock(words, offset);
  3240. xorBlock.call(this, words, offset, blockSize);
  3241. this._prevBlock = thisBlock;
  3242. }
  3243. });
  3244. function xorBlock(words, offset, blockSize) {
  3245. var block;
  3246. var iv = this._iv;
  3247. if (iv) {
  3248. block = iv;
  3249. this._iv = undefined2;
  3250. } else {
  3251. block = this._prevBlock;
  3252. }
  3253. for (var i = 0; i < blockSize; i++) {
  3254. words[offset + i] ^= block[i];
  3255. }
  3256. }
  3257. return CBC2;
  3258. }();
  3259. var C_pad = C.pad = {};
  3260. var Pkcs7 = C_pad.Pkcs7 = {
  3261. /**
  3262. * Pads data using the algorithm defined in PKCS #5/7.
  3263. *
  3264. * @param {WordArray} data The data to pad.
  3265. * @param {number} blockSize The multiple that the data should be padded to.
  3266. *
  3267. * @static
  3268. *
  3269. * @example
  3270. *
  3271. * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
  3272. */
  3273. pad: function (data, blockSize) {
  3274. var blockSizeBytes = blockSize * 4;
  3275. var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  3276. var paddingWord = nPaddingBytes << 24 | nPaddingBytes << 16 | nPaddingBytes << 8 | nPaddingBytes;
  3277. var paddingWords = [];
  3278. for (var i = 0; i < nPaddingBytes; i += 4) {
  3279. paddingWords.push(paddingWord);
  3280. }
  3281. var padding = WordArray.create(paddingWords, nPaddingBytes);
  3282. data.concat(padding);
  3283. },
  3284. /**
  3285. * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
  3286. *
  3287. * @param {WordArray} data The data to unpad.
  3288. *
  3289. * @static
  3290. *
  3291. * @example
  3292. *
  3293. * CryptoJS.pad.Pkcs7.unpad(wordArray);
  3294. */
  3295. unpad: function (data) {
  3296. var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
  3297. data.sigBytes -= nPaddingBytes;
  3298. }
  3299. };
  3300. var BlockCipher = C_lib.BlockCipher = Cipher.extend({
  3301. /**
  3302. * Configuration options.
  3303. *
  3304. * @property {Mode} mode The block mode to use. Default: CBC
  3305. * @property {Padding} padding The padding strategy to use. Default: Pkcs7
  3306. */
  3307. cfg: Cipher.cfg.extend({
  3308. mode: CBC,
  3309. padding: Pkcs7
  3310. }),
  3311. reset: function () {
  3312. var modeCreator;
  3313. Cipher.reset.call(this);
  3314. var cfg = this.cfg;
  3315. var iv = cfg.iv;
  3316. var mode = cfg.mode;
  3317. if (this._xformMode == this._ENC_XFORM_MODE) {
  3318. modeCreator = mode.createEncryptor;
  3319. } else {
  3320. modeCreator = mode.createDecryptor;
  3321. this._minBufferSize = 1;
  3322. }
  3323. if (this._mode && this._mode.__creator == modeCreator) {
  3324. this._mode.init(this, iv && iv.words);
  3325. } else {
  3326. this._mode = modeCreator.call(mode, this, iv && iv.words);
  3327. this._mode.__creator = modeCreator;
  3328. }
  3329. },
  3330. _doProcessBlock: function (words, offset) {
  3331. this._mode.processBlock(words, offset);
  3332. },
  3333. _doFinalize: function () {
  3334. var finalProcessedBlocks;
  3335. var padding = this.cfg.padding;
  3336. if (this._xformMode == this._ENC_XFORM_MODE) {
  3337. padding.pad(this._data, this.blockSize);
  3338. finalProcessedBlocks = this._process(true);
  3339. } else {
  3340. finalProcessedBlocks = this._process(true);
  3341. padding.unpad(finalProcessedBlocks);
  3342. }
  3343. return finalProcessedBlocks;
  3344. },
  3345. blockSize: 128 / 32
  3346. });
  3347. var CipherParams = C_lib.CipherParams = Base.extend({
  3348. /**
  3349. * Initializes a newly created cipher params object.
  3350. *
  3351. * @param {Object} cipherParams An object with any of the possible cipher parameters.
  3352. *
  3353. * @example
  3354. *
  3355. * var cipherParams = CryptoJS.lib.CipherParams.create({
  3356. * ciphertext: ciphertextWordArray,
  3357. * key: keyWordArray,
  3358. * iv: ivWordArray,
  3359. * salt: saltWordArray,
  3360. * algorithm: CryptoJS.algo.AES,
  3361. * mode: CryptoJS.mode.CBC,
  3362. * padding: CryptoJS.pad.PKCS7,
  3363. * blockSize: 4,
  3364. * formatter: CryptoJS.format.OpenSSL
  3365. * });
  3366. */
  3367. init: function (cipherParams) {
  3368. this.mixIn(cipherParams);
  3369. },
  3370. /**
  3371. * Converts this cipher params object to a string.
  3372. *
  3373. * @param {Format} formatter (Optional) The formatting strategy to use.
  3374. *
  3375. * @return {string} The stringified cipher params.
  3376. *
  3377. * @throws Error If neither the formatter nor the default formatter is set.
  3378. *
  3379. * @example
  3380. *
  3381. * var string = cipherParams + '';
  3382. * var string = cipherParams.toString();
  3383. * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
  3384. */
  3385. toString: function (formatter) {
  3386. return (formatter || this.formatter).stringify(this);
  3387. }
  3388. });
  3389. var C_format = C.format = {};
  3390. var OpenSSLFormatter = C_format.OpenSSL = {
  3391. /**
  3392. * Converts a cipher params object to an OpenSSL-compatible string.
  3393. *
  3394. * @param {CipherParams} cipherParams The cipher params object.
  3395. *
  3396. * @return {string} The OpenSSL-compatible string.
  3397. *
  3398. * @static
  3399. *
  3400. * @example
  3401. *
  3402. * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
  3403. */
  3404. stringify: function (cipherParams) {
  3405. var wordArray;
  3406. var ciphertext = cipherParams.ciphertext;
  3407. var salt = cipherParams.salt;
  3408. if (salt) {
  3409. wordArray = WordArray.create([1398893684, 1701076831]).concat(salt).concat(ciphertext);
  3410. } else {
  3411. wordArray = ciphertext;
  3412. }
  3413. return wordArray.toString(Base64);
  3414. },
  3415. /**
  3416. * Converts an OpenSSL-compatible string to a cipher params object.
  3417. *
  3418. * @param {string} openSSLStr The OpenSSL-compatible string.
  3419. *
  3420. * @return {CipherParams} The cipher params object.
  3421. *
  3422. * @static
  3423. *
  3424. * @example
  3425. *
  3426. * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
  3427. */
  3428. parse: function (openSSLStr) {
  3429. var salt;
  3430. var ciphertext = Base64.parse(openSSLStr);
  3431. var ciphertextWords = ciphertext.words;
  3432. if (ciphertextWords[0] == 1398893684 && ciphertextWords[1] == 1701076831) {
  3433. salt = WordArray.create(ciphertextWords.slice(2, 4));
  3434. ciphertextWords.splice(0, 4);
  3435. ciphertext.sigBytes -= 16;
  3436. }
  3437. return CipherParams.create({ ciphertext, salt });
  3438. }
  3439. };
  3440. var SerializableCipher = C_lib.SerializableCipher = Base.extend({
  3441. /**
  3442. * Configuration options.
  3443. *
  3444. * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
  3445. */
  3446. cfg: Base.extend({
  3447. format: OpenSSLFormatter
  3448. }),
  3449. /**
  3450. * Encrypts a message.
  3451. *
  3452. * @param {Cipher} cipher The cipher algorithm to use.
  3453. * @param {WordArray|string} message The message to encrypt.
  3454. * @param {WordArray} key The key.
  3455. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3456. *
  3457. * @return {CipherParams} A cipher params object.
  3458. *
  3459. * @static
  3460. *
  3461. * @example
  3462. *
  3463. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
  3464. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
  3465. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3466. */
  3467. encrypt: function (cipher, message, key, cfg) {
  3468. cfg = this.cfg.extend(cfg);
  3469. var encryptor = cipher.createEncryptor(key, cfg);
  3470. var ciphertext = encryptor.finalize(message);
  3471. var cipherCfg = encryptor.cfg;
  3472. return CipherParams.create({
  3473. ciphertext,
  3474. key,
  3475. iv: cipherCfg.iv,
  3476. algorithm: cipher,
  3477. mode: cipherCfg.mode,
  3478. padding: cipherCfg.padding,
  3479. blockSize: cipher.blockSize,
  3480. formatter: cfg.format
  3481. });
  3482. },
  3483. /**
  3484. * Decrypts serialized ciphertext.
  3485. *
  3486. * @param {Cipher} cipher The cipher algorithm to use.
  3487. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3488. * @param {WordArray} key The key.
  3489. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3490. *
  3491. * @return {WordArray} The plaintext.
  3492. *
  3493. * @static
  3494. *
  3495. * @example
  3496. *
  3497. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3498. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3499. */
  3500. decrypt: function (cipher, ciphertext, key, cfg) {
  3501. cfg = this.cfg.extend(cfg);
  3502. ciphertext = this._parse(ciphertext, cfg.format);
  3503. var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
  3504. return plaintext;
  3505. },
  3506. /**
  3507. * Converts serialized ciphertext to CipherParams,
  3508. * else assumed CipherParams already and returns ciphertext unchanged.
  3509. *
  3510. * @param {CipherParams|string} ciphertext The ciphertext.
  3511. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
  3512. *
  3513. * @return {CipherParams} The unserialized ciphertext.
  3514. *
  3515. * @static
  3516. *
  3517. * @example
  3518. *
  3519. * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
  3520. */
  3521. _parse: function (ciphertext, format) {
  3522. if (typeof ciphertext == "string") {
  3523. return format.parse(ciphertext, this);
  3524. } else {
  3525. return ciphertext;
  3526. }
  3527. }
  3528. });
  3529. var C_kdf = C.kdf = {};
  3530. var OpenSSLKdf = C_kdf.OpenSSL = {
  3531. /**
  3532. * Derives a key and IV from a password.
  3533. *
  3534. * @param {string} password The password to derive from.
  3535. * @param {number} keySize The size in words of the key to generate.
  3536. * @param {number} ivSize The size in words of the IV to generate.
  3537. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
  3538. *
  3539. * @return {CipherParams} A cipher params object with the key, IV, and salt.
  3540. *
  3541. * @static
  3542. *
  3543. * @example
  3544. *
  3545. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
  3546. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
  3547. */
  3548. execute: function (password, keySize, ivSize, salt) {
  3549. if (!salt) {
  3550. salt = WordArray.random(64 / 8);
  3551. }
  3552. var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
  3553. var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
  3554. key.sigBytes = keySize * 4;
  3555. return CipherParams.create({ key, iv, salt });
  3556. }
  3557. };
  3558. var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
  3559. /**
  3560. * Configuration options.
  3561. *
  3562. * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
  3563. */
  3564. cfg: SerializableCipher.cfg.extend({
  3565. kdf: OpenSSLKdf
  3566. }),
  3567. /**
  3568. * Encrypts a message using a password.
  3569. *
  3570. * @param {Cipher} cipher The cipher algorithm to use.
  3571. * @param {WordArray|string} message The message to encrypt.
  3572. * @param {string} password The password.
  3573. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3574. *
  3575. * @return {CipherParams} A cipher params object.
  3576. *
  3577. * @static
  3578. *
  3579. * @example
  3580. *
  3581. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
  3582. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
  3583. */
  3584. encrypt: function (cipher, message, password, cfg) {
  3585. cfg = this.cfg.extend(cfg);
  3586. var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
  3587. cfg.iv = derivedParams.iv;
  3588. var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
  3589. ciphertext.mixIn(derivedParams);
  3590. return ciphertext;
  3591. },
  3592. /**
  3593. * Decrypts serialized ciphertext using a password.
  3594. *
  3595. * @param {Cipher} cipher The cipher algorithm to use.
  3596. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3597. * @param {string} password The password.
  3598. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3599. *
  3600. * @return {WordArray} The plaintext.
  3601. *
  3602. * @static
  3603. *
  3604. * @example
  3605. *
  3606. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
  3607. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
  3608. */
  3609. decrypt: function (cipher, ciphertext, password, cfg) {
  3610. cfg = this.cfg.extend(cfg);
  3611. ciphertext = this._parse(ciphertext, cfg.format);
  3612. var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
  3613. cfg.iv = derivedParams.iv;
  3614. var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
  3615. return plaintext;
  3616. }
  3617. });
  3618. }();
  3619. });
  3620. }
  3621. });
  3622. // mode-cfb.js
  3623. var require_mode_cfb = __commonJS({
  3624. "mode-cfb.js"(exports, module) {
  3625. (function (root, factory, undef) {
  3626. if (typeof exports === "object") {
  3627. module.exports = exports = factory(require_core(), require_cipher_core());
  3628. } else if (typeof define === "function" && define.amd) {
  3629. define(["./core", "./cipher-core"], factory);
  3630. } else {
  3631. factory(root.CryptoJS);
  3632. }
  3633. })(exports, function (CryptoJS) {
  3634. CryptoJS.mode.CFB = function () {
  3635. var CFB = CryptoJS.lib.BlockCipherMode.extend();
  3636. CFB.Encryptor = CFB.extend({
  3637. processBlock: function (words, offset) {
  3638. var cipher = this._cipher;
  3639. var blockSize = cipher.blockSize;
  3640. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  3641. this._prevBlock = words.slice(offset, offset + blockSize);
  3642. }
  3643. });
  3644. CFB.Decryptor = CFB.extend({
  3645. processBlock: function (words, offset) {
  3646. var cipher = this._cipher;
  3647. var blockSize = cipher.blockSize;
  3648. var thisBlock = words.slice(offset, offset + blockSize);
  3649. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  3650. this._prevBlock = thisBlock;
  3651. }
  3652. });
  3653. function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
  3654. var keystream;
  3655. var iv = this._iv;
  3656. if (iv) {
  3657. keystream = iv.slice(0);
  3658. this._iv = void 0;
  3659. } else {
  3660. keystream = this._prevBlock;
  3661. }
  3662. cipher.encryptBlock(keystream, 0);
  3663. for (var i = 0; i < blockSize; i++) {
  3664. words[offset + i] ^= keystream[i];
  3665. }
  3666. }
  3667. return CFB;
  3668. }();
  3669. return CryptoJS.mode.CFB;
  3670. });
  3671. }
  3672. });
  3673. // mode-ctr.js
  3674. var require_mode_ctr = __commonJS({
  3675. "mode-ctr.js"(exports, module) {
  3676. (function (root, factory, undef) {
  3677. if (typeof exports === "object") {
  3678. module.exports = exports = factory(require_core(), require_cipher_core());
  3679. } else if (typeof define === "function" && define.amd) {
  3680. define(["./core", "./cipher-core"], factory);
  3681. } else {
  3682. factory(root.CryptoJS);
  3683. }
  3684. })(exports, function (CryptoJS) {
  3685. CryptoJS.mode.CTR = function () {
  3686. var CTR = CryptoJS.lib.BlockCipherMode.extend();
  3687. var Encryptor = CTR.Encryptor = CTR.extend({
  3688. processBlock: function (words, offset) {
  3689. var cipher = this._cipher;
  3690. var blockSize = cipher.blockSize;
  3691. var iv = this._iv;
  3692. var counter = this._counter;
  3693. if (iv) {
  3694. counter = this._counter = iv.slice(0);
  3695. this._iv = void 0;
  3696. }
  3697. var keystream = counter.slice(0);
  3698. cipher.encryptBlock(keystream, 0);
  3699. counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;
  3700. for (var i = 0; i < blockSize; i++) {
  3701. words[offset + i] ^= keystream[i];
  3702. }
  3703. }
  3704. });
  3705. CTR.Decryptor = Encryptor;
  3706. return CTR;
  3707. }();
  3708. return CryptoJS.mode.CTR;
  3709. });
  3710. }
  3711. });
  3712. // mode-ctr-gladman.js
  3713. var require_mode_ctr_gladman = __commonJS({
  3714. "mode-ctr-gladman.js"(exports, module) {
  3715. (function (root, factory, undef) {
  3716. if (typeof exports === "object") {
  3717. module.exports = exports = factory(require_core(), require_cipher_core());
  3718. } else if (typeof define === "function" && define.amd) {
  3719. define(["./core", "./cipher-core"], factory);
  3720. } else {
  3721. factory(root.CryptoJS);
  3722. }
  3723. })(exports, function (CryptoJS) {
  3724. CryptoJS.mode.CTRGladman = function () {
  3725. var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
  3726. function incWord(word) {
  3727. if ((word >> 24 & 255) === 255) {
  3728. var b1 = word >> 16 & 255;
  3729. var b2 = word >> 8 & 255;
  3730. var b3 = word & 255;
  3731. if (b1 === 255) {
  3732. b1 = 0;
  3733. if (b2 === 255) {
  3734. b2 = 0;
  3735. if (b3 === 255) {
  3736. b3 = 0;
  3737. } else {
  3738. ++b3;
  3739. }
  3740. } else {
  3741. ++b2;
  3742. }
  3743. } else {
  3744. ++b1;
  3745. }
  3746. word = 0;
  3747. word += b1 << 16;
  3748. word += b2 << 8;
  3749. word += b3;
  3750. } else {
  3751. word += 1 << 24;
  3752. }
  3753. return word;
  3754. }
  3755. function incCounter(counter) {
  3756. if ((counter[0] = incWord(counter[0])) === 0) {
  3757. counter[1] = incWord(counter[1]);
  3758. }
  3759. return counter;
  3760. }
  3761. var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
  3762. processBlock: function (words, offset) {
  3763. var cipher = this._cipher;
  3764. var blockSize = cipher.blockSize;
  3765. var iv = this._iv;
  3766. var counter = this._counter;
  3767. if (iv) {
  3768. counter = this._counter = iv.slice(0);
  3769. this._iv = void 0;
  3770. }
  3771. incCounter(counter);
  3772. var keystream = counter.slice(0);
  3773. cipher.encryptBlock(keystream, 0);
  3774. for (var i = 0; i < blockSize; i++) {
  3775. words[offset + i] ^= keystream[i];
  3776. }
  3777. }
  3778. });
  3779. CTRGladman.Decryptor = Encryptor;
  3780. return CTRGladman;
  3781. }();
  3782. return CryptoJS.mode.CTRGladman;
  3783. });
  3784. }
  3785. });
  3786. // mode-ofb.js
  3787. var require_mode_ofb = __commonJS({
  3788. "mode-ofb.js"(exports, module) {
  3789. (function (root, factory, undef) {
  3790. if (typeof exports === "object") {
  3791. module.exports = exports = factory(require_core(), require_cipher_core());
  3792. } else if (typeof define === "function" && define.amd) {
  3793. define(["./core", "./cipher-core"], factory);
  3794. } else {
  3795. factory(root.CryptoJS);
  3796. }
  3797. })(exports, function (CryptoJS) {
  3798. CryptoJS.mode.OFB = function () {
  3799. var OFB = CryptoJS.lib.BlockCipherMode.extend();
  3800. var Encryptor = OFB.Encryptor = OFB.extend({
  3801. processBlock: function (words, offset) {
  3802. var cipher = this._cipher;
  3803. var blockSize = cipher.blockSize;
  3804. var iv = this._iv;
  3805. var keystream = this._keystream;
  3806. if (iv) {
  3807. keystream = this._keystream = iv.slice(0);
  3808. this._iv = void 0;
  3809. }
  3810. cipher.encryptBlock(keystream, 0);
  3811. for (var i = 0; i < blockSize; i++) {
  3812. words[offset + i] ^= keystream[i];
  3813. }
  3814. }
  3815. });
  3816. OFB.Decryptor = Encryptor;
  3817. return OFB;
  3818. }();
  3819. return CryptoJS.mode.OFB;
  3820. });
  3821. }
  3822. });
  3823. // mode-ecb.js
  3824. var require_mode_ecb = __commonJS({
  3825. "mode-ecb.js"(exports, module) {
  3826. (function (root, factory, undef) {
  3827. if (typeof exports === "object") {
  3828. module.exports = exports = factory(require_core(), require_cipher_core());
  3829. } else if (typeof define === "function" && define.amd) {
  3830. define(["./core", "./cipher-core"], factory);
  3831. } else {
  3832. factory(root.CryptoJS);
  3833. }
  3834. })(exports, function (CryptoJS) {
  3835. CryptoJS.mode.ECB = function () {
  3836. var ECB = CryptoJS.lib.BlockCipherMode.extend();
  3837. ECB.Encryptor = ECB.extend({
  3838. processBlock: function (words, offset) {
  3839. this._cipher.encryptBlock(words, offset);
  3840. }
  3841. });
  3842. ECB.Decryptor = ECB.extend({
  3843. processBlock: function (words, offset) {
  3844. this._cipher.decryptBlock(words, offset);
  3845. }
  3846. });
  3847. return ECB;
  3848. }();
  3849. return CryptoJS.mode.ECB;
  3850. });
  3851. }
  3852. });
  3853. // pad-ansix923.js
  3854. var require_pad_ansix923 = __commonJS({
  3855. "pad-ansix923.js"(exports, module) {
  3856. (function (root, factory, undef) {
  3857. if (typeof exports === "object") {
  3858. module.exports = exports = factory(require_core(), require_cipher_core());
  3859. } else if (typeof define === "function" && define.amd) {
  3860. define(["./core", "./cipher-core"], factory);
  3861. } else {
  3862. factory(root.CryptoJS);
  3863. }
  3864. })(exports, function (CryptoJS) {
  3865. CryptoJS.pad.AnsiX923 = {
  3866. pad: function (data, blockSize) {
  3867. var dataSigBytes = data.sigBytes;
  3868. var blockSizeBytes = blockSize * 4;
  3869. var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
  3870. var lastBytePos = dataSigBytes + nPaddingBytes - 1;
  3871. data.clamp();
  3872. data.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;
  3873. data.sigBytes += nPaddingBytes;
  3874. },
  3875. unpad: function (data) {
  3876. var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
  3877. data.sigBytes -= nPaddingBytes;
  3878. }
  3879. };
  3880. return CryptoJS.pad.Ansix923;
  3881. });
  3882. }
  3883. });
  3884. // pad-iso10126.js
  3885. var require_pad_iso10126 = __commonJS({
  3886. "pad-iso10126.js"(exports, module) {
  3887. (function (root, factory, undef) {
  3888. if (typeof exports === "object") {
  3889. module.exports = exports = factory(require_core(), require_cipher_core());
  3890. } else if (typeof define === "function" && define.amd) {
  3891. define(["./core", "./cipher-core"], factory);
  3892. } else {
  3893. factory(root.CryptoJS);
  3894. }
  3895. })(exports, function (CryptoJS) {
  3896. CryptoJS.pad.Iso10126 = {
  3897. pad: function (data, blockSize) {
  3898. var blockSizeBytes = blockSize * 4;
  3899. var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  3900. data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
  3901. },
  3902. unpad: function (data) {
  3903. var nPaddingBytes = data.words[data.sigBytes - 1 >>> 2] & 255;
  3904. data.sigBytes -= nPaddingBytes;
  3905. }
  3906. };
  3907. return CryptoJS.pad.Iso10126;
  3908. });
  3909. }
  3910. });
  3911. // pad-iso97971.js
  3912. var require_pad_iso97971 = __commonJS({
  3913. "pad-iso97971.js"(exports, module) {
  3914. (function (root, factory, undef) {
  3915. if (typeof exports === "object") {
  3916. module.exports = exports = factory(require_core(), require_cipher_core());
  3917. } else if (typeof define === "function" && define.amd) {
  3918. define(["./core", "./cipher-core"], factory);
  3919. } else {
  3920. factory(root.CryptoJS);
  3921. }
  3922. })(exports, function (CryptoJS) {
  3923. CryptoJS.pad.Iso97971 = {
  3924. pad: function (data, blockSize) {
  3925. data.concat(CryptoJS.lib.WordArray.create([2147483648], 1));
  3926. CryptoJS.pad.ZeroPadding.pad(data, blockSize);
  3927. },
  3928. unpad: function (data) {
  3929. CryptoJS.pad.ZeroPadding.unpad(data);
  3930. data.sigBytes--;
  3931. }
  3932. };
  3933. return CryptoJS.pad.Iso97971;
  3934. });
  3935. }
  3936. });
  3937. // pad-zeropadding.js
  3938. var require_pad_zeropadding = __commonJS({
  3939. "pad-zeropadding.js"(exports, module) {
  3940. (function (root, factory, undef) {
  3941. if (typeof exports === "object") {
  3942. module.exports = exports = factory(require_core(), require_cipher_core());
  3943. } else if (typeof define === "function" && define.amd) {
  3944. define(["./core", "./cipher-core"], factory);
  3945. } else {
  3946. factory(root.CryptoJS);
  3947. }
  3948. })(exports, function (CryptoJS) {
  3949. CryptoJS.pad.ZeroPadding = {
  3950. pad: function (data, blockSize) {
  3951. var blockSizeBytes = blockSize * 4;
  3952. data.clamp();
  3953. data.sigBytes += blockSizeBytes - (data.sigBytes % blockSizeBytes || blockSizeBytes);
  3954. },
  3955. unpad: function (data) {
  3956. var dataWords = data.words;
  3957. var i = data.sigBytes - 1;
  3958. for (var i = data.sigBytes - 1; i >= 0; i--) {
  3959. if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 255) {
  3960. data.sigBytes = i + 1;
  3961. break;
  3962. }
  3963. }
  3964. }
  3965. };
  3966. return CryptoJS.pad.ZeroPadding;
  3967. });
  3968. }
  3969. });
  3970. // pad-nopadding.js
  3971. var require_pad_nopadding = __commonJS({
  3972. "pad-nopadding.js"(exports, module) {
  3973. (function (root, factory, undef) {
  3974. if (typeof exports === "object") {
  3975. module.exports = exports = factory(require_core(), require_cipher_core());
  3976. } else if (typeof define === "function" && define.amd) {
  3977. define(["./core", "./cipher-core"], factory);
  3978. } else {
  3979. factory(root.CryptoJS);
  3980. }
  3981. })(exports, function (CryptoJS) {
  3982. CryptoJS.pad.NoPadding = {
  3983. pad: function () {
  3984. },
  3985. unpad: function () {
  3986. }
  3987. };
  3988. return CryptoJS.pad.NoPadding;
  3989. });
  3990. }
  3991. });
  3992. // format-hex.js
  3993. var require_format_hex = __commonJS({
  3994. "format-hex.js"(exports, module) {
  3995. (function (root, factory, undef) {
  3996. if (typeof exports === "object") {
  3997. module.exports = exports = factory(require_core(), require_cipher_core());
  3998. } else if (typeof define === "function" && define.amd) {
  3999. define(["./core", "./cipher-core"], factory);
  4000. } else {
  4001. factory(root.CryptoJS);
  4002. }
  4003. })(exports, function (CryptoJS) {
  4004. (function (undefined2) {
  4005. var C = CryptoJS;
  4006. var C_lib = C.lib;
  4007. var CipherParams = C_lib.CipherParams;
  4008. var C_enc = C.enc;
  4009. var Hex = C_enc.Hex;
  4010. var C_format = C.format;
  4011. var HexFormatter = C_format.Hex = {
  4012. /**
  4013. * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
  4014. *
  4015. * @param {CipherParams} cipherParams The cipher params object.
  4016. *
  4017. * @return {string} The hexadecimally encoded string.
  4018. *
  4019. * @static
  4020. *
  4021. * @example
  4022. *
  4023. * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
  4024. */
  4025. stringify: function (cipherParams) {
  4026. return cipherParams.ciphertext.toString(Hex);
  4027. },
  4028. /**
  4029. * Converts a hexadecimally encoded ciphertext string to a cipher params object.
  4030. *
  4031. * @param {string} input The hexadecimally encoded string.
  4032. *
  4033. * @return {CipherParams} The cipher params object.
  4034. *
  4035. * @static
  4036. *
  4037. * @example
  4038. *
  4039. * var cipherParams = CryptoJS.format.Hex.parse(hexString);
  4040. */
  4041. parse: function (input) {
  4042. var ciphertext = Hex.parse(input);
  4043. return CipherParams.create({ ciphertext });
  4044. }
  4045. };
  4046. })();
  4047. return CryptoJS.format.Hex;
  4048. });
  4049. }
  4050. });
  4051. // aes.js
  4052. var require_aes = __commonJS({
  4053. "aes.js"(exports, module) {
  4054. (function (root, factory, undef) {
  4055. if (typeof exports === "object") {
  4056. module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
  4057. } else if (typeof define === "function" && define.amd) {
  4058. define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
  4059. } else {
  4060. factory(root.CryptoJS);
  4061. }
  4062. })(exports, function (CryptoJS) {
  4063. (function () {
  4064. var C = CryptoJS;
  4065. var C_lib = C.lib;
  4066. var BlockCipher = C_lib.BlockCipher;
  4067. var C_algo = C.algo;
  4068. var SBOX = [];
  4069. var INV_SBOX = [];
  4070. var SUB_MIX_0 = [];
  4071. var SUB_MIX_1 = [];
  4072. var SUB_MIX_2 = [];
  4073. var SUB_MIX_3 = [];
  4074. var INV_SUB_MIX_0 = [];
  4075. var INV_SUB_MIX_1 = [];
  4076. var INV_SUB_MIX_2 = [];
  4077. var INV_SUB_MIX_3 = [];
  4078. (function () {
  4079. var d = [];
  4080. for (var i = 0; i < 256; i++) {
  4081. if (i < 128) {
  4082. d[i] = i << 1;
  4083. } else {
  4084. d[i] = i << 1 ^ 283;
  4085. }
  4086. }
  4087. var x = 0;
  4088. var xi = 0;
  4089. for (var i = 0; i < 256; i++) {
  4090. var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
  4091. sx = sx >>> 8 ^ sx & 255 ^ 99;
  4092. SBOX[x] = sx;
  4093. INV_SBOX[sx] = x;
  4094. var x2 = d[x];
  4095. var x4 = d[x2];
  4096. var x8 = d[x4];
  4097. var t = d[sx] * 257 ^ sx * 16843008;
  4098. SUB_MIX_0[x] = t << 24 | t >>> 8;
  4099. SUB_MIX_1[x] = t << 16 | t >>> 16;
  4100. SUB_MIX_2[x] = t << 8 | t >>> 24;
  4101. SUB_MIX_3[x] = t;
  4102. var t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
  4103. INV_SUB_MIX_0[sx] = t << 24 | t >>> 8;
  4104. INV_SUB_MIX_1[sx] = t << 16 | t >>> 16;
  4105. INV_SUB_MIX_2[sx] = t << 8 | t >>> 24;
  4106. INV_SUB_MIX_3[sx] = t;
  4107. if (!x) {
  4108. x = xi = 1;
  4109. } else {
  4110. x = x2 ^ d[d[d[x8 ^ x2]]];
  4111. xi ^= d[d[xi]];
  4112. }
  4113. }
  4114. })();
  4115. var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
  4116. var AES = C_algo.AES = BlockCipher.extend({
  4117. _doReset: function () {
  4118. var t;
  4119. if (this._nRounds && this._keyPriorReset === this._key) {
  4120. return;
  4121. }
  4122. var key = this._keyPriorReset = this._key;
  4123. var keyWords = key.words;
  4124. var keySize = key.sigBytes / 4;
  4125. var nRounds = this._nRounds = keySize + 6;
  4126. var ksRows = (nRounds + 1) * 4;
  4127. var keySchedule = this._keySchedule = [];
  4128. for (var ksRow = 0; ksRow < ksRows; ksRow++) {
  4129. if (ksRow < keySize) {
  4130. keySchedule[ksRow] = keyWords[ksRow];
  4131. } else {
  4132. t = keySchedule[ksRow - 1];
  4133. if (!(ksRow % keySize)) {
  4134. t = t << 8 | t >>> 24;
  4135. t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
  4136. t ^= RCON[ksRow / keySize | 0] << 24;
  4137. } else if (keySize > 6 && ksRow % keySize == 4) {
  4138. t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
  4139. }
  4140. keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
  4141. }
  4142. }
  4143. var invKeySchedule = this._invKeySchedule = [];
  4144. for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
  4145. var ksRow = ksRows - invKsRow;
  4146. if (invKsRow % 4) {
  4147. var t = keySchedule[ksRow];
  4148. } else {
  4149. var t = keySchedule[ksRow - 4];
  4150. }
  4151. if (invKsRow < 4 || ksRow <= 4) {
  4152. invKeySchedule[invKsRow] = t;
  4153. } else {
  4154. invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 255]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 255]] ^ INV_SUB_MIX_3[SBOX[t & 255]];
  4155. }
  4156. }
  4157. },
  4158. encryptBlock: function (M, offset) {
  4159. this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
  4160. },
  4161. decryptBlock: function (M, offset) {
  4162. var t = M[offset + 1];
  4163. M[offset + 1] = M[offset + 3];
  4164. M[offset + 3] = t;
  4165. this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
  4166. var t = M[offset + 1];
  4167. M[offset + 1] = M[offset + 3];
  4168. M[offset + 3] = t;
  4169. },
  4170. _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_02, SUB_MIX_12, SUB_MIX_22, SUB_MIX_32, SBOX2) {
  4171. var nRounds = this._nRounds;
  4172. var s0 = M[offset] ^ keySchedule[0];
  4173. var s1 = M[offset + 1] ^ keySchedule[1];
  4174. var s2 = M[offset + 2] ^ keySchedule[2];
  4175. var s3 = M[offset + 3] ^ keySchedule[3];
  4176. var ksRow = 4;
  4177. for (var round = 1; round < nRounds; round++) {
  4178. var t0 = SUB_MIX_02[s0 >>> 24] ^ SUB_MIX_12[s1 >>> 16 & 255] ^ SUB_MIX_22[s2 >>> 8 & 255] ^ SUB_MIX_32[s3 & 255] ^ keySchedule[ksRow++];
  4179. var t1 = SUB_MIX_02[s1 >>> 24] ^ SUB_MIX_12[s2 >>> 16 & 255] ^ SUB_MIX_22[s3 >>> 8 & 255] ^ SUB_MIX_32[s0 & 255] ^ keySchedule[ksRow++];
  4180. var t2 = SUB_MIX_02[s2 >>> 24] ^ SUB_MIX_12[s3 >>> 16 & 255] ^ SUB_MIX_22[s0 >>> 8 & 255] ^ SUB_MIX_32[s1 & 255] ^ keySchedule[ksRow++];
  4181. var t3 = SUB_MIX_02[s3 >>> 24] ^ SUB_MIX_12[s0 >>> 16 & 255] ^ SUB_MIX_22[s1 >>> 8 & 255] ^ SUB_MIX_32[s2 & 255] ^ keySchedule[ksRow++];
  4182. s0 = t0;
  4183. s1 = t1;
  4184. s2 = t2;
  4185. s3 = t3;
  4186. }
  4187. var t0 = (SBOX2[s0 >>> 24] << 24 | SBOX2[s1 >>> 16 & 255] << 16 | SBOX2[s2 >>> 8 & 255] << 8 | SBOX2[s3 & 255]) ^ keySchedule[ksRow++];
  4188. var t1 = (SBOX2[s1 >>> 24] << 24 | SBOX2[s2 >>> 16 & 255] << 16 | SBOX2[s3 >>> 8 & 255] << 8 | SBOX2[s0 & 255]) ^ keySchedule[ksRow++];
  4189. var t2 = (SBOX2[s2 >>> 24] << 24 | SBOX2[s3 >>> 16 & 255] << 16 | SBOX2[s0 >>> 8 & 255] << 8 | SBOX2[s1 & 255]) ^ keySchedule[ksRow++];
  4190. var t3 = (SBOX2[s3 >>> 24] << 24 | SBOX2[s0 >>> 16 & 255] << 16 | SBOX2[s1 >>> 8 & 255] << 8 | SBOX2[s2 & 255]) ^ keySchedule[ksRow++];
  4191. M[offset] = t0;
  4192. M[offset + 1] = t1;
  4193. M[offset + 2] = t2;
  4194. M[offset + 3] = t3;
  4195. },
  4196. keySize: 256 / 32
  4197. });
  4198. C.AES = BlockCipher._createHelper(AES);
  4199. })();
  4200. return CryptoJS.AES;
  4201. });
  4202. }
  4203. });
  4204. // tripledes.js
  4205. var require_tripledes = __commonJS({
  4206. "tripledes.js"(exports, module) {
  4207. (function (root, factory, undef) {
  4208. if (typeof exports === "object") {
  4209. module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
  4210. } else if (typeof define === "function" && define.amd) {
  4211. define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
  4212. } else {
  4213. factory(root.CryptoJS);
  4214. }
  4215. })(exports, function (CryptoJS) {
  4216. (function () {
  4217. var C = CryptoJS;
  4218. var C_lib = C.lib;
  4219. var WordArray = C_lib.WordArray;
  4220. var BlockCipher = C_lib.BlockCipher;
  4221. var C_algo = C.algo;
  4222. var PC1 = [
  4223. 57,
  4224. 49,
  4225. 41,
  4226. 33,
  4227. 25,
  4228. 17,
  4229. 9,
  4230. 1,
  4231. 58,
  4232. 50,
  4233. 42,
  4234. 34,
  4235. 26,
  4236. 18,
  4237. 10,
  4238. 2,
  4239. 59,
  4240. 51,
  4241. 43,
  4242. 35,
  4243. 27,
  4244. 19,
  4245. 11,
  4246. 3,
  4247. 60,
  4248. 52,
  4249. 44,
  4250. 36,
  4251. 63,
  4252. 55,
  4253. 47,
  4254. 39,
  4255. 31,
  4256. 23,
  4257. 15,
  4258. 7,
  4259. 62,
  4260. 54,
  4261. 46,
  4262. 38,
  4263. 30,
  4264. 22,
  4265. 14,
  4266. 6,
  4267. 61,
  4268. 53,
  4269. 45,
  4270. 37,
  4271. 29,
  4272. 21,
  4273. 13,
  4274. 5,
  4275. 28,
  4276. 20,
  4277. 12,
  4278. 4
  4279. ];
  4280. var PC2 = [
  4281. 14,
  4282. 17,
  4283. 11,
  4284. 24,
  4285. 1,
  4286. 5,
  4287. 3,
  4288. 28,
  4289. 15,
  4290. 6,
  4291. 21,
  4292. 10,
  4293. 23,
  4294. 19,
  4295. 12,
  4296. 4,
  4297. 26,
  4298. 8,
  4299. 16,
  4300. 7,
  4301. 27,
  4302. 20,
  4303. 13,
  4304. 2,
  4305. 41,
  4306. 52,
  4307. 31,
  4308. 37,
  4309. 47,
  4310. 55,
  4311. 30,
  4312. 40,
  4313. 51,
  4314. 45,
  4315. 33,
  4316. 48,
  4317. 44,
  4318. 49,
  4319. 39,
  4320. 56,
  4321. 34,
  4322. 53,
  4323. 46,
  4324. 42,
  4325. 50,
  4326. 36,
  4327. 29,
  4328. 32
  4329. ];
  4330. var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
  4331. var SBOX_P = [
  4332. {
  4333. 0: 8421888,
  4334. 268435456: 32768,
  4335. 536870912: 8421378,
  4336. 805306368: 2,
  4337. 1073741824: 512,
  4338. 1342177280: 8421890,
  4339. 1610612736: 8389122,
  4340. 1879048192: 8388608,
  4341. 2147483648: 514,
  4342. 2415919104: 8389120,
  4343. 2684354560: 33280,
  4344. 2952790016: 8421376,
  4345. 3221225472: 32770,
  4346. 3489660928: 8388610,
  4347. 3758096384: 0,
  4348. 4026531840: 33282,
  4349. 134217728: 0,
  4350. 402653184: 8421890,
  4351. 671088640: 33282,
  4352. 939524096: 32768,
  4353. 1207959552: 8421888,
  4354. 1476395008: 512,
  4355. 1744830464: 8421378,
  4356. 2013265920: 2,
  4357. 2281701376: 8389120,
  4358. 2550136832: 33280,
  4359. 2818572288: 8421376,
  4360. 3087007744: 8389122,
  4361. 3355443200: 8388610,
  4362. 3623878656: 32770,
  4363. 3892314112: 514,
  4364. 4160749568: 8388608,
  4365. 1: 32768,
  4366. 268435457: 2,
  4367. 536870913: 8421888,
  4368. 805306369: 8388608,
  4369. 1073741825: 8421378,
  4370. 1342177281: 33280,
  4371. 1610612737: 512,
  4372. 1879048193: 8389122,
  4373. 2147483649: 8421890,
  4374. 2415919105: 8421376,
  4375. 2684354561: 8388610,
  4376. 2952790017: 33282,
  4377. 3221225473: 514,
  4378. 3489660929: 8389120,
  4379. 3758096385: 32770,
  4380. 4026531841: 0,
  4381. 134217729: 8421890,
  4382. 402653185: 8421376,
  4383. 671088641: 8388608,
  4384. 939524097: 512,
  4385. 1207959553: 32768,
  4386. 1476395009: 8388610,
  4387. 1744830465: 2,
  4388. 2013265921: 33282,
  4389. 2281701377: 32770,
  4390. 2550136833: 8389122,
  4391. 2818572289: 514,
  4392. 3087007745: 8421888,
  4393. 3355443201: 8389120,
  4394. 3623878657: 0,
  4395. 3892314113: 33280,
  4396. 4160749569: 8421378
  4397. },
  4398. {
  4399. 0: 1074282512,
  4400. 16777216: 16384,
  4401. 33554432: 524288,
  4402. 50331648: 1074266128,
  4403. 67108864: 1073741840,
  4404. 83886080: 1074282496,
  4405. 100663296: 1073758208,
  4406. 117440512: 16,
  4407. 134217728: 540672,
  4408. 150994944: 1073758224,
  4409. 167772160: 1073741824,
  4410. 184549376: 540688,
  4411. 201326592: 524304,
  4412. 218103808: 0,
  4413. 234881024: 16400,
  4414. 251658240: 1074266112,
  4415. 8388608: 1073758208,
  4416. 25165824: 540688,
  4417. 41943040: 16,
  4418. 58720256: 1073758224,
  4419. 75497472: 1074282512,
  4420. 92274688: 1073741824,
  4421. 109051904: 524288,
  4422. 125829120: 1074266128,
  4423. 142606336: 524304,
  4424. 159383552: 0,
  4425. 176160768: 16384,
  4426. 192937984: 1074266112,
  4427. 209715200: 1073741840,
  4428. 226492416: 540672,
  4429. 243269632: 1074282496,
  4430. 260046848: 16400,
  4431. 268435456: 0,
  4432. 285212672: 1074266128,
  4433. 301989888: 1073758224,
  4434. 318767104: 1074282496,
  4435. 335544320: 1074266112,
  4436. 352321536: 16,
  4437. 369098752: 540688,
  4438. 385875968: 16384,
  4439. 402653184: 16400,
  4440. 419430400: 524288,
  4441. 436207616: 524304,
  4442. 452984832: 1073741840,
  4443. 469762048: 540672,
  4444. 486539264: 1073758208,
  4445. 503316480: 1073741824,
  4446. 520093696: 1074282512,
  4447. 276824064: 540688,
  4448. 293601280: 524288,
  4449. 310378496: 1074266112,
  4450. 327155712: 16384,
  4451. 343932928: 1073758208,
  4452. 360710144: 1074282512,
  4453. 377487360: 16,
  4454. 394264576: 1073741824,
  4455. 411041792: 1074282496,
  4456. 427819008: 1073741840,
  4457. 444596224: 1073758224,
  4458. 461373440: 524304,
  4459. 478150656: 0,
  4460. 494927872: 16400,
  4461. 511705088: 1074266128,
  4462. 528482304: 540672
  4463. },
  4464. {
  4465. 0: 260,
  4466. 1048576: 0,
  4467. 2097152: 67109120,
  4468. 3145728: 65796,
  4469. 4194304: 65540,
  4470. 5242880: 67108868,
  4471. 6291456: 67174660,
  4472. 7340032: 67174400,
  4473. 8388608: 67108864,
  4474. 9437184: 67174656,
  4475. 10485760: 65792,
  4476. 11534336: 67174404,
  4477. 12582912: 67109124,
  4478. 13631488: 65536,
  4479. 14680064: 4,
  4480. 15728640: 256,
  4481. 524288: 67174656,
  4482. 1572864: 67174404,
  4483. 2621440: 0,
  4484. 3670016: 67109120,
  4485. 4718592: 67108868,
  4486. 5767168: 65536,
  4487. 6815744: 65540,
  4488. 7864320: 260,
  4489. 8912896: 4,
  4490. 9961472: 256,
  4491. 11010048: 67174400,
  4492. 12058624: 65796,
  4493. 13107200: 65792,
  4494. 14155776: 67109124,
  4495. 15204352: 67174660,
  4496. 16252928: 67108864,
  4497. 16777216: 67174656,
  4498. 17825792: 65540,
  4499. 18874368: 65536,
  4500. 19922944: 67109120,
  4501. 20971520: 256,
  4502. 22020096: 67174660,
  4503. 23068672: 67108868,
  4504. 24117248: 0,
  4505. 25165824: 67109124,
  4506. 26214400: 67108864,
  4507. 27262976: 4,
  4508. 28311552: 65792,
  4509. 29360128: 67174400,
  4510. 30408704: 260,
  4511. 31457280: 65796,
  4512. 32505856: 67174404,
  4513. 17301504: 67108864,
  4514. 18350080: 260,
  4515. 19398656: 67174656,
  4516. 20447232: 0,
  4517. 21495808: 65540,
  4518. 22544384: 67109120,
  4519. 23592960: 256,
  4520. 24641536: 67174404,
  4521. 25690112: 65536,
  4522. 26738688: 67174660,
  4523. 27787264: 65796,
  4524. 28835840: 67108868,
  4525. 29884416: 67109124,
  4526. 30932992: 67174400,
  4527. 31981568: 4,
  4528. 33030144: 65792
  4529. },
  4530. {
  4531. 0: 2151682048,
  4532. 65536: 2147487808,
  4533. 131072: 4198464,
  4534. 196608: 2151677952,
  4535. 262144: 0,
  4536. 327680: 4198400,
  4537. 393216: 2147483712,
  4538. 458752: 4194368,
  4539. 524288: 2147483648,
  4540. 589824: 4194304,
  4541. 655360: 64,
  4542. 720896: 2147487744,
  4543. 786432: 2151678016,
  4544. 851968: 4160,
  4545. 917504: 4096,
  4546. 983040: 2151682112,
  4547. 32768: 2147487808,
  4548. 98304: 64,
  4549. 163840: 2151678016,
  4550. 229376: 2147487744,
  4551. 294912: 4198400,
  4552. 360448: 2151682112,
  4553. 425984: 0,
  4554. 491520: 2151677952,
  4555. 557056: 4096,
  4556. 622592: 2151682048,
  4557. 688128: 4194304,
  4558. 753664: 4160,
  4559. 819200: 2147483648,
  4560. 884736: 4194368,
  4561. 950272: 4198464,
  4562. 1015808: 2147483712,
  4563. 1048576: 4194368,
  4564. 1114112: 4198400,
  4565. 1179648: 2147483712,
  4566. 1245184: 0,
  4567. 1310720: 4160,
  4568. 1376256: 2151678016,
  4569. 1441792: 2151682048,
  4570. 1507328: 2147487808,
  4571. 1572864: 2151682112,
  4572. 1638400: 2147483648,
  4573. 1703936: 2151677952,
  4574. 1769472: 4198464,
  4575. 1835008: 2147487744,
  4576. 1900544: 4194304,
  4577. 1966080: 64,
  4578. 2031616: 4096,
  4579. 1081344: 2151677952,
  4580. 1146880: 2151682112,
  4581. 1212416: 0,
  4582. 1277952: 4198400,
  4583. 1343488: 4194368,
  4584. 1409024: 2147483648,
  4585. 1474560: 2147487808,
  4586. 1540096: 64,
  4587. 1605632: 2147483712,
  4588. 1671168: 4096,
  4589. 1736704: 2147487744,
  4590. 1802240: 2151678016,
  4591. 1867776: 4160,
  4592. 1933312: 2151682048,
  4593. 1998848: 4194304,
  4594. 2064384: 4198464
  4595. },
  4596. {
  4597. 0: 128,
  4598. 4096: 17039360,
  4599. 8192: 262144,
  4600. 12288: 536870912,
  4601. 16384: 537133184,
  4602. 20480: 16777344,
  4603. 24576: 553648256,
  4604. 28672: 262272,
  4605. 32768: 16777216,
  4606. 36864: 537133056,
  4607. 40960: 536871040,
  4608. 45056: 553910400,
  4609. 49152: 553910272,
  4610. 53248: 0,
  4611. 57344: 17039488,
  4612. 61440: 553648128,
  4613. 2048: 17039488,
  4614. 6144: 553648256,
  4615. 10240: 128,
  4616. 14336: 17039360,
  4617. 18432: 262144,
  4618. 22528: 537133184,
  4619. 26624: 553910272,
  4620. 30720: 536870912,
  4621. 34816: 537133056,
  4622. 38912: 0,
  4623. 43008: 553910400,
  4624. 47104: 16777344,
  4625. 51200: 536871040,
  4626. 55296: 553648128,
  4627. 59392: 16777216,
  4628. 63488: 262272,
  4629. 65536: 262144,
  4630. 69632: 128,
  4631. 73728: 536870912,
  4632. 77824: 553648256,
  4633. 81920: 16777344,
  4634. 86016: 553910272,
  4635. 90112: 537133184,
  4636. 94208: 16777216,
  4637. 98304: 553910400,
  4638. 102400: 553648128,
  4639. 106496: 17039360,
  4640. 110592: 537133056,
  4641. 114688: 262272,
  4642. 118784: 536871040,
  4643. 122880: 0,
  4644. 126976: 17039488,
  4645. 67584: 553648256,
  4646. 71680: 16777216,
  4647. 75776: 17039360,
  4648. 79872: 537133184,
  4649. 83968: 536870912,
  4650. 88064: 17039488,
  4651. 92160: 128,
  4652. 96256: 553910272,
  4653. 100352: 262272,
  4654. 104448: 553910400,
  4655. 108544: 0,
  4656. 112640: 553648128,
  4657. 116736: 16777344,
  4658. 120832: 262144,
  4659. 124928: 537133056,
  4660. 129024: 536871040
  4661. },
  4662. {
  4663. 0: 268435464,
  4664. 256: 8192,
  4665. 512: 270532608,
  4666. 768: 270540808,
  4667. 1024: 268443648,
  4668. 1280: 2097152,
  4669. 1536: 2097160,
  4670. 1792: 268435456,
  4671. 2048: 0,
  4672. 2304: 268443656,
  4673. 2560: 2105344,
  4674. 2816: 8,
  4675. 3072: 270532616,
  4676. 3328: 2105352,
  4677. 3584: 8200,
  4678. 3840: 270540800,
  4679. 128: 270532608,
  4680. 384: 270540808,
  4681. 640: 8,
  4682. 896: 2097152,
  4683. 1152: 2105352,
  4684. 1408: 268435464,
  4685. 1664: 268443648,
  4686. 1920: 8200,
  4687. 2176: 2097160,
  4688. 2432: 8192,
  4689. 2688: 268443656,
  4690. 2944: 270532616,
  4691. 3200: 0,
  4692. 3456: 270540800,
  4693. 3712: 2105344,
  4694. 3968: 268435456,
  4695. 4096: 268443648,
  4696. 4352: 270532616,
  4697. 4608: 270540808,
  4698. 4864: 8200,
  4699. 5120: 2097152,
  4700. 5376: 268435456,
  4701. 5632: 268435464,
  4702. 5888: 2105344,
  4703. 6144: 2105352,
  4704. 6400: 0,
  4705. 6656: 8,
  4706. 6912: 270532608,
  4707. 7168: 8192,
  4708. 7424: 268443656,
  4709. 7680: 270540800,
  4710. 7936: 2097160,
  4711. 4224: 8,
  4712. 4480: 2105344,
  4713. 4736: 2097152,
  4714. 4992: 268435464,
  4715. 5248: 268443648,
  4716. 5504: 8200,
  4717. 5760: 270540808,
  4718. 6016: 270532608,
  4719. 6272: 270540800,
  4720. 6528: 270532616,
  4721. 6784: 8192,
  4722. 7040: 2105352,
  4723. 7296: 2097160,
  4724. 7552: 0,
  4725. 7808: 268435456,
  4726. 8064: 268443656
  4727. },
  4728. {
  4729. 0: 1048576,
  4730. 16: 33555457,
  4731. 32: 1024,
  4732. 48: 1049601,
  4733. 64: 34604033,
  4734. 80: 0,
  4735. 96: 1,
  4736. 112: 34603009,
  4737. 128: 33555456,
  4738. 144: 1048577,
  4739. 160: 33554433,
  4740. 176: 34604032,
  4741. 192: 34603008,
  4742. 208: 1025,
  4743. 224: 1049600,
  4744. 240: 33554432,
  4745. 8: 34603009,
  4746. 24: 0,
  4747. 40: 33555457,
  4748. 56: 34604032,
  4749. 72: 1048576,
  4750. 88: 33554433,
  4751. 104: 33554432,
  4752. 120: 1025,
  4753. 136: 1049601,
  4754. 152: 33555456,
  4755. 168: 34603008,
  4756. 184: 1048577,
  4757. 200: 1024,
  4758. 216: 34604033,
  4759. 232: 1,
  4760. 248: 1049600,
  4761. 256: 33554432,
  4762. 272: 1048576,
  4763. 288: 33555457,
  4764. 304: 34603009,
  4765. 320: 1048577,
  4766. 336: 33555456,
  4767. 352: 34604032,
  4768. 368: 1049601,
  4769. 384: 1025,
  4770. 400: 34604033,
  4771. 416: 1049600,
  4772. 432: 1,
  4773. 448: 0,
  4774. 464: 34603008,
  4775. 480: 33554433,
  4776. 496: 1024,
  4777. 264: 1049600,
  4778. 280: 33555457,
  4779. 296: 34603009,
  4780. 312: 1,
  4781. 328: 33554432,
  4782. 344: 1048576,
  4783. 360: 1025,
  4784. 376: 34604032,
  4785. 392: 33554433,
  4786. 408: 34603008,
  4787. 424: 0,
  4788. 440: 34604033,
  4789. 456: 1049601,
  4790. 472: 1024,
  4791. 488: 33555456,
  4792. 504: 1048577
  4793. },
  4794. {
  4795. 0: 134219808,
  4796. 1: 131072,
  4797. 2: 134217728,
  4798. 3: 32,
  4799. 4: 131104,
  4800. 5: 134350880,
  4801. 6: 134350848,
  4802. 7: 2048,
  4803. 8: 134348800,
  4804. 9: 134219776,
  4805. 10: 133120,
  4806. 11: 134348832,
  4807. 12: 2080,
  4808. 13: 0,
  4809. 14: 134217760,
  4810. 15: 133152,
  4811. 2147483648: 2048,
  4812. 2147483649: 134350880,
  4813. 2147483650: 134219808,
  4814. 2147483651: 134217728,
  4815. 2147483652: 134348800,
  4816. 2147483653: 133120,
  4817. 2147483654: 133152,
  4818. 2147483655: 32,
  4819. 2147483656: 134217760,
  4820. 2147483657: 2080,
  4821. 2147483658: 131104,
  4822. 2147483659: 134350848,
  4823. 2147483660: 0,
  4824. 2147483661: 134348832,
  4825. 2147483662: 134219776,
  4826. 2147483663: 131072,
  4827. 16: 133152,
  4828. 17: 134350848,
  4829. 18: 32,
  4830. 19: 2048,
  4831. 20: 134219776,
  4832. 21: 134217760,
  4833. 22: 134348832,
  4834. 23: 131072,
  4835. 24: 0,
  4836. 25: 131104,
  4837. 26: 134348800,
  4838. 27: 134219808,
  4839. 28: 134350880,
  4840. 29: 133120,
  4841. 30: 2080,
  4842. 31: 134217728,
  4843. 2147483664: 131072,
  4844. 2147483665: 2048,
  4845. 2147483666: 134348832,
  4846. 2147483667: 133152,
  4847. 2147483668: 32,
  4848. 2147483669: 134348800,
  4849. 2147483670: 134217728,
  4850. 2147483671: 134219808,
  4851. 2147483672: 134350880,
  4852. 2147483673: 134217760,
  4853. 2147483674: 134219776,
  4854. 2147483675: 0,
  4855. 2147483676: 133120,
  4856. 2147483677: 2080,
  4857. 2147483678: 131104,
  4858. 2147483679: 134350848
  4859. }
  4860. ];
  4861. var SBOX_MASK = [
  4862. 4160749569,
  4863. 528482304,
  4864. 33030144,
  4865. 2064384,
  4866. 129024,
  4867. 8064,
  4868. 504,
  4869. 2147483679
  4870. ];
  4871. var DES = C_algo.DES = BlockCipher.extend({
  4872. _doReset: function () {
  4873. var key = this._key;
  4874. var keyWords = key.words;
  4875. var keyBits = [];
  4876. for (var i = 0; i < 56; i++) {
  4877. var keyBitPos = PC1[i] - 1;
  4878. keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;
  4879. }
  4880. var subKeys = this._subKeys = [];
  4881. for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
  4882. var subKey = subKeys[nSubKey] = [];
  4883. var bitShift = BIT_SHIFTS[nSubKey];
  4884. for (var i = 0; i < 24; i++) {
  4885. subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;
  4886. subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;
  4887. }
  4888. subKey[0] = subKey[0] << 1 | subKey[0] >>> 31;
  4889. for (var i = 1; i < 7; i++) {
  4890. subKey[i] = subKey[i] >>> (i - 1) * 4 + 3;
  4891. }
  4892. subKey[7] = subKey[7] << 5 | subKey[7] >>> 27;
  4893. }
  4894. var invSubKeys = this._invSubKeys = [];
  4895. for (var i = 0; i < 16; i++) {
  4896. invSubKeys[i] = subKeys[15 - i];
  4897. }
  4898. },
  4899. encryptBlock: function (M, offset) {
  4900. this._doCryptBlock(M, offset, this._subKeys);
  4901. },
  4902. decryptBlock: function (M, offset) {
  4903. this._doCryptBlock(M, offset, this._invSubKeys);
  4904. },
  4905. _doCryptBlock: function (M, offset, subKeys) {
  4906. this._lBlock = M[offset];
  4907. this._rBlock = M[offset + 1];
  4908. exchangeLR.call(this, 4, 252645135);
  4909. exchangeLR.call(this, 16, 65535);
  4910. exchangeRL.call(this, 2, 858993459);
  4911. exchangeRL.call(this, 8, 16711935);
  4912. exchangeLR.call(this, 1, 1431655765);
  4913. for (var round = 0; round < 16; round++) {
  4914. var subKey = subKeys[round];
  4915. var lBlock = this._lBlock;
  4916. var rBlock = this._rBlock;
  4917. var f = 0;
  4918. for (var i = 0; i < 8; i++) {
  4919. f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
  4920. }
  4921. this._lBlock = rBlock;
  4922. this._rBlock = lBlock ^ f;
  4923. }
  4924. var t = this._lBlock;
  4925. this._lBlock = this._rBlock;
  4926. this._rBlock = t;
  4927. exchangeLR.call(this, 1, 1431655765);
  4928. exchangeRL.call(this, 8, 16711935);
  4929. exchangeRL.call(this, 2, 858993459);
  4930. exchangeLR.call(this, 16, 65535);
  4931. exchangeLR.call(this, 4, 252645135);
  4932. M[offset] = this._lBlock;
  4933. M[offset + 1] = this._rBlock;
  4934. },
  4935. keySize: 64 / 32,
  4936. ivSize: 64 / 32,
  4937. blockSize: 64 / 32
  4938. });
  4939. function exchangeLR(offset, mask) {
  4940. var t = (this._lBlock >>> offset ^ this._rBlock) & mask;
  4941. this._rBlock ^= t;
  4942. this._lBlock ^= t << offset;
  4943. }
  4944. function exchangeRL(offset, mask) {
  4945. var t = (this._rBlock >>> offset ^ this._lBlock) & mask;
  4946. this._lBlock ^= t;
  4947. this._rBlock ^= t << offset;
  4948. }
  4949. C.DES = BlockCipher._createHelper(DES);
  4950. var TripleDES = C_algo.TripleDES = BlockCipher.extend({
  4951. _doReset: function () {
  4952. var key = this._key;
  4953. var keyWords = key.words;
  4954. if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
  4955. throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
  4956. }
  4957. var key1 = keyWords.slice(0, 2);
  4958. var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
  4959. var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
  4960. this._des1 = DES.createEncryptor(WordArray.create(key1));
  4961. this._des2 = DES.createEncryptor(WordArray.create(key2));
  4962. this._des3 = DES.createEncryptor(WordArray.create(key3));
  4963. },
  4964. encryptBlock: function (M, offset) {
  4965. this._des1.encryptBlock(M, offset);
  4966. this._des2.decryptBlock(M, offset);
  4967. this._des3.encryptBlock(M, offset);
  4968. },
  4969. decryptBlock: function (M, offset) {
  4970. this._des3.decryptBlock(M, offset);
  4971. this._des2.encryptBlock(M, offset);
  4972. this._des1.decryptBlock(M, offset);
  4973. },
  4974. keySize: 192 / 32,
  4975. ivSize: 64 / 32,
  4976. blockSize: 64 / 32
  4977. });
  4978. C.TripleDES = BlockCipher._createHelper(TripleDES);
  4979. })();
  4980. return CryptoJS.TripleDES;
  4981. });
  4982. }
  4983. });
  4984. // rc4.js
  4985. var require_rc4 = __commonJS({
  4986. "rc4.js"(exports, module) {
  4987. (function (root, factory, undef) {
  4988. if (typeof exports === "object") {
  4989. module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
  4990. } else if (typeof define === "function" && define.amd) {
  4991. define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
  4992. } else {
  4993. factory(root.CryptoJS);
  4994. }
  4995. })(exports, function (CryptoJS) {
  4996. (function () {
  4997. var C = CryptoJS;
  4998. var C_lib = C.lib;
  4999. var StreamCipher = C_lib.StreamCipher;
  5000. var C_algo = C.algo;
  5001. var RC4 = C_algo.RC4 = StreamCipher.extend({
  5002. _doReset: function () {
  5003. var key = this._key;
  5004. var keyWords = key.words;
  5005. var keySigBytes = key.sigBytes;
  5006. var S = this._S = [];
  5007. for (var i = 0; i < 256; i++) {
  5008. S[i] = i;
  5009. }
  5010. for (var i = 0, j = 0; i < 256; i++) {
  5011. var keyByteIndex = i % keySigBytes;
  5012. var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 255;
  5013. j = (j + S[i] + keyByte) % 256;
  5014. var t = S[i];
  5015. S[i] = S[j];
  5016. S[j] = t;
  5017. }
  5018. this._i = this._j = 0;
  5019. },
  5020. _doProcessBlock: function (M, offset) {
  5021. M[offset] ^= generateKeystreamWord.call(this);
  5022. },
  5023. keySize: 256 / 32,
  5024. ivSize: 0
  5025. });
  5026. function generateKeystreamWord() {
  5027. var S = this._S;
  5028. var i = this._i;
  5029. var j = this._j;
  5030. var keystreamWord = 0;
  5031. for (var n = 0; n < 4; n++) {
  5032. i = (i + 1) % 256;
  5033. j = (j + S[i]) % 256;
  5034. var t = S[i];
  5035. S[i] = S[j];
  5036. S[j] = t;
  5037. keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;
  5038. }
  5039. this._i = i;
  5040. this._j = j;
  5041. return keystreamWord;
  5042. }
  5043. C.RC4 = StreamCipher._createHelper(RC4);
  5044. var RC4Drop = C_algo.RC4Drop = RC4.extend({
  5045. /**
  5046. * Configuration options.
  5047. *
  5048. * @property {number} drop The number of keystream words to drop. Default 192
  5049. */
  5050. cfg: RC4.cfg.extend({
  5051. drop: 192
  5052. }),
  5053. _doReset: function () {
  5054. RC4._doReset.call(this);
  5055. for (var i = this.cfg.drop; i > 0; i--) {
  5056. generateKeystreamWord.call(this);
  5057. }
  5058. }
  5059. });
  5060. C.RC4Drop = StreamCipher._createHelper(RC4Drop);
  5061. })();
  5062. return CryptoJS.RC4;
  5063. });
  5064. }
  5065. });
  5066. // rabbit.js
  5067. var require_rabbit = __commonJS({
  5068. "rabbit.js"(exports, module) {
  5069. (function (root, factory, undef) {
  5070. if (typeof exports === "object") {
  5071. module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
  5072. } else if (typeof define === "function" && define.amd) {
  5073. define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
  5074. } else {
  5075. factory(root.CryptoJS);
  5076. }
  5077. })(exports, function (CryptoJS) {
  5078. (function () {
  5079. var C = CryptoJS;
  5080. var C_lib = C.lib;
  5081. var StreamCipher = C_lib.StreamCipher;
  5082. var C_algo = C.algo;
  5083. var S = [];
  5084. var C_ = [];
  5085. var G = [];
  5086. var Rabbit = C_algo.Rabbit = StreamCipher.extend({
  5087. _doReset: function () {
  5088. var K = this._key.words;
  5089. var iv = this.cfg.iv;
  5090. for (var i = 0; i < 4; i++) {
  5091. K[i] = (K[i] << 8 | K[i] >>> 24) & 16711935 | (K[i] << 24 | K[i] >>> 8) & 4278255360;
  5092. }
  5093. var X = this._X = [
  5094. K[0],
  5095. K[3] << 16 | K[2] >>> 16,
  5096. K[1],
  5097. K[0] << 16 | K[3] >>> 16,
  5098. K[2],
  5099. K[1] << 16 | K[0] >>> 16,
  5100. K[3],
  5101. K[2] << 16 | K[1] >>> 16
  5102. ];
  5103. var C2 = this._C = [
  5104. K[2] << 16 | K[2] >>> 16,
  5105. K[0] & 4294901760 | K[1] & 65535,
  5106. K[3] << 16 | K[3] >>> 16,
  5107. K[1] & 4294901760 | K[2] & 65535,
  5108. K[0] << 16 | K[0] >>> 16,
  5109. K[2] & 4294901760 | K[3] & 65535,
  5110. K[1] << 16 | K[1] >>> 16,
  5111. K[3] & 4294901760 | K[0] & 65535
  5112. ];
  5113. this._b = 0;
  5114. for (var i = 0; i < 4; i++) {
  5115. nextState.call(this);
  5116. }
  5117. for (var i = 0; i < 8; i++) {
  5118. C2[i] ^= X[i + 4 & 7];
  5119. }
  5120. if (iv) {
  5121. var IV = iv.words;
  5122. var IV_0 = IV[0];
  5123. var IV_1 = IV[1];
  5124. var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
  5125. var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
  5126. var i1 = i0 >>> 16 | i2 & 4294901760;
  5127. var i3 = i2 << 16 | i0 & 65535;
  5128. C2[0] ^= i0;
  5129. C2[1] ^= i1;
  5130. C2[2] ^= i2;
  5131. C2[3] ^= i3;
  5132. C2[4] ^= i0;
  5133. C2[5] ^= i1;
  5134. C2[6] ^= i2;
  5135. C2[7] ^= i3;
  5136. for (var i = 0; i < 4; i++) {
  5137. nextState.call(this);
  5138. }
  5139. }
  5140. },
  5141. _doProcessBlock: function (M, offset) {
  5142. var X = this._X;
  5143. nextState.call(this);
  5144. S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
  5145. S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
  5146. S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
  5147. S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
  5148. for (var i = 0; i < 4; i++) {
  5149. S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
  5150. M[offset + i] ^= S[i];
  5151. }
  5152. },
  5153. blockSize: 128 / 32,
  5154. ivSize: 64 / 32
  5155. });
  5156. function nextState() {
  5157. var X = this._X;
  5158. var C2 = this._C;
  5159. for (var i = 0; i < 8; i++) {
  5160. C_[i] = C2[i];
  5161. }
  5162. C2[0] = C2[0] + 1295307597 + this._b | 0;
  5163. C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
  5164. C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
  5165. C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
  5166. C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
  5167. C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
  5168. C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
  5169. C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
  5170. this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
  5171. for (var i = 0; i < 8; i++) {
  5172. var gx = X[i] + C2[i];
  5173. var ga = gx & 65535;
  5174. var gb = gx >>> 16;
  5175. var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
  5176. var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
  5177. G[i] = gh ^ gl;
  5178. }
  5179. X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
  5180. X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
  5181. X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
  5182. X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
  5183. X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
  5184. X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
  5185. X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
  5186. X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
  5187. }
  5188. C.Rabbit = StreamCipher._createHelper(Rabbit);
  5189. })();
  5190. return CryptoJS.Rabbit;
  5191. });
  5192. }
  5193. });
  5194. // rabbit-legacy.js
  5195. var require_rabbit_legacy = __commonJS({
  5196. "rabbit-legacy.js"(exports, module) {
  5197. (function (root, factory, undef) {
  5198. if (typeof exports === "object") {
  5199. module.exports = exports = factory(require_core(), require_enc_base64(), require_md5(), require_evpkdf(), require_cipher_core());
  5200. } else if (typeof define === "function" && define.amd) {
  5201. define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
  5202. } else {
  5203. factory(root.CryptoJS);
  5204. }
  5205. })(exports, function (CryptoJS) {
  5206. (function () {
  5207. var C = CryptoJS;
  5208. var C_lib = C.lib;
  5209. var StreamCipher = C_lib.StreamCipher;
  5210. var C_algo = C.algo;
  5211. var S = [];
  5212. var C_ = [];
  5213. var G = [];
  5214. var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
  5215. _doReset: function () {
  5216. var K = this._key.words;
  5217. var iv = this.cfg.iv;
  5218. var X = this._X = [
  5219. K[0],
  5220. K[3] << 16 | K[2] >>> 16,
  5221. K[1],
  5222. K[0] << 16 | K[3] >>> 16,
  5223. K[2],
  5224. K[1] << 16 | K[0] >>> 16,
  5225. K[3],
  5226. K[2] << 16 | K[1] >>> 16
  5227. ];
  5228. var C2 = this._C = [
  5229. K[2] << 16 | K[2] >>> 16,
  5230. K[0] & 4294901760 | K[1] & 65535,
  5231. K[3] << 16 | K[3] >>> 16,
  5232. K[1] & 4294901760 | K[2] & 65535,
  5233. K[0] << 16 | K[0] >>> 16,
  5234. K[2] & 4294901760 | K[3] & 65535,
  5235. K[1] << 16 | K[1] >>> 16,
  5236. K[3] & 4294901760 | K[0] & 65535
  5237. ];
  5238. this._b = 0;
  5239. for (var i = 0; i < 4; i++) {
  5240. nextState.call(this);
  5241. }
  5242. for (var i = 0; i < 8; i++) {
  5243. C2[i] ^= X[i + 4 & 7];
  5244. }
  5245. if (iv) {
  5246. var IV = iv.words;
  5247. var IV_0 = IV[0];
  5248. var IV_1 = IV[1];
  5249. var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
  5250. var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
  5251. var i1 = i0 >>> 16 | i2 & 4294901760;
  5252. var i3 = i2 << 16 | i0 & 65535;
  5253. C2[0] ^= i0;
  5254. C2[1] ^= i1;
  5255. C2[2] ^= i2;
  5256. C2[3] ^= i3;
  5257. C2[4] ^= i0;
  5258. C2[5] ^= i1;
  5259. C2[6] ^= i2;
  5260. C2[7] ^= i3;
  5261. for (var i = 0; i < 4; i++) {
  5262. nextState.call(this);
  5263. }
  5264. }
  5265. },
  5266. _doProcessBlock: function (M, offset) {
  5267. var X = this._X;
  5268. nextState.call(this);
  5269. S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
  5270. S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
  5271. S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
  5272. S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
  5273. for (var i = 0; i < 4; i++) {
  5274. S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
  5275. M[offset + i] ^= S[i];
  5276. }
  5277. },
  5278. blockSize: 128 / 32,
  5279. ivSize: 64 / 32
  5280. });
  5281. function nextState() {
  5282. var X = this._X;
  5283. var C2 = this._C;
  5284. for (var i = 0; i < 8; i++) {
  5285. C_[i] = C2[i];
  5286. }
  5287. C2[0] = C2[0] + 1295307597 + this._b | 0;
  5288. C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
  5289. C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
  5290. C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
  5291. C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
  5292. C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
  5293. C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
  5294. C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
  5295. this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
  5296. for (var i = 0; i < 8; i++) {
  5297. var gx = X[i] + C2[i];
  5298. var ga = gx & 65535;
  5299. var gb = gx >>> 16;
  5300. var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
  5301. var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
  5302. G[i] = gh ^ gl;
  5303. }
  5304. X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
  5305. X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
  5306. X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
  5307. X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
  5308. X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
  5309. X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
  5310. X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
  5311. X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
  5312. }
  5313. C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
  5314. })();
  5315. return CryptoJS.RabbitLegacy;
  5316. });
  5317. }
  5318. });
  5319. // index.js
  5320. var require_crypto_js_4_1 = __commonJS({
  5321. "index.js"(exports, module) {
  5322. (function (root, factory, undef) {
  5323. if (typeof exports === "object") {
  5324. module.exports = exports = factory(require_core(), require_x64_core(), require_lib_typedarrays(), require_enc_utf16(), require_enc_base64(), require_enc_base64url(), require_md5(), require_sha1(), require_sha256(), require_sha224(), require_sha512(), require_sha384(), require_sha3(), require_ripemd160(), require_hmac(), require_pbkdf2(), require_evpkdf(), require_cipher_core(), require_mode_cfb(), require_mode_ctr(), require_mode_ctr_gladman(), require_mode_ofb(), require_mode_ecb(), require_pad_ansix923(), require_pad_iso10126(), require_pad_iso97971(), require_pad_zeropadding(), require_pad_nopadding(), require_format_hex(), require_aes(), require_tripledes(), require_rc4(), require_rabbit(), require_rabbit_legacy());
  5325. } else if (typeof define === "function" && define.amd) {
  5326. define(["./core", "./x64-core", "./lib-typedarrays", "./enc-utf16", "./enc-base64", "./enc-base64url", "./md5", "./sha1", "./sha256", "./sha224", "./sha512", "./sha384", "./sha3", "./ripemd160", "./hmac", "./pbkdf2", "./evpkdf", "./cipher-core", "./mode-cfb", "./mode-ctr", "./mode-ctr-gladman", "./mode-ofb", "./mode-ecb", "./pad-ansix923", "./pad-iso10126", "./pad-iso97971", "./pad-zeropadding", "./pad-nopadding", "./format-hex", "./aes", "./tripledes", "./rc4", "./rabbit", "./rabbit-legacy"], factory);
  5327. } else {
  5328. root.CryptoJS = factory(root.CryptoJS);
  5329. }
  5330. })(exports, function (CryptoJS) {
  5331. return CryptoJS;
  5332. });
  5333. }
  5334. });
  5335. return require_crypto_js_4_1();
  5336. };