crypto.js 215 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428242924302431243224332434243524362437243824392440244124422443244424452446244724482449245024512452245324542455245624572458245924602461246224632464246524662467246824692470247124722473247424752476247724782479248024812482248324842485248624872488248924902491249224932494249524962497249824992500250125022503250425052506250725082509251025112512251325142515251625172518251925202521252225232524252525262527252825292530253125322533253425352536253725382539254025412542254325442545254625472548254925502551255225532554255525562557255825592560256125622563256425652566256725682569257025712572257325742575257625772578257925802581258225832584258525862587258825892590259125922593259425952596259725982599260026012602260326042605260626072608260926102611261226132614261526162617261826192620262126222623262426252626262726282629263026312632263326342635263626372638263926402641264226432644264526462647264826492650265126522653265426552656265726582659266026612662266326642665266626672668266926702671267226732674267526762677267826792680268126822683268426852686268726882689269026912692269326942695269626972698269927002701270227032704270527062707270827092710271127122713271427152716271727182719272027212722272327242725272627272728272927302731273227332734273527362737273827392740274127422743274427452746274727482749275027512752275327542755275627572758275927602761276227632764276527662767276827692770277127722773277427752776277727782779278027812782278327842785278627872788278927902791279227932794279527962797279827992800280128022803280428052806280728082809281028112812281328142815281628172818281928202821282228232824282528262827282828292830283128322833283428352836283728382839284028412842284328442845284628472848284928502851285228532854285528562857285828592860286128622863286428652866286728682869287028712872287328742875287628772878287928802881288228832884288528862887288828892890289128922893289428952896289728982899290029012902290329042905290629072908290929102911291229132914291529162917291829192920292129222923292429252926292729282929293029312932293329342935293629372938293929402941294229432944294529462947294829492950295129522953295429552956295729582959296029612962296329642965296629672968296929702971297229732974297529762977297829792980298129822983298429852986298729882989299029912992299329942995299629972998299930003001300230033004300530063007300830093010301130123013301430153016301730183019302030213022302330243025302630273028302930303031303230333034303530363037303830393040304130423043304430453046304730483049305030513052305330543055305630573058305930603061306230633064306530663067306830693070307130723073307430753076307730783079308030813082308330843085308630873088308930903091309230933094309530963097309830993100310131023103310431053106310731083109311031113112311331143115311631173118311931203121312231233124312531263127312831293130313131323133313431353136313731383139314031413142314331443145314631473148314931503151315231533154315531563157315831593160316131623163316431653166316731683169317031713172317331743175317631773178317931803181318231833184318531863187318831893190319131923193319431953196319731983199320032013202320332043205320632073208320932103211321232133214321532163217321832193220322132223223322432253226322732283229323032313232323332343235323632373238323932403241324232433244324532463247324832493250325132523253325432553256325732583259326032613262326332643265326632673268326932703271327232733274327532763277327832793280328132823283328432853286328732883289329032913292329332943295329632973298329933003301330233033304330533063307330833093310331133123313331433153316331733183319332033213322332333243325332633273328332933303331333233333334333533363337333833393340334133423343334433453346334733483349335033513352335333543355335633573358335933603361336233633364336533663367336833693370337133723373337433753376337733783379338033813382338333843385338633873388338933903391339233933394339533963397339833993400340134023403340434053406340734083409341034113412341334143415341634173418341934203421342234233424342534263427342834293430343134323433343434353436343734383439344034413442344334443445344634473448344934503451345234533454345534563457345834593460346134623463346434653466346734683469347034713472347334743475347634773478347934803481348234833484348534863487348834893490349134923493349434953496349734983499350035013502350335043505350635073508350935103511351235133514351535163517351835193520352135223523352435253526352735283529353035313532353335343535353635373538353935403541354235433544354535463547354835493550355135523553355435553556355735583559356035613562356335643565356635673568356935703571357235733574357535763577357835793580358135823583358435853586358735883589359035913592359335943595359635973598359936003601360236033604360536063607360836093610361136123613361436153616361736183619362036213622362336243625362636273628362936303631363236333634363536363637363836393640364136423643364436453646364736483649365036513652365336543655365636573658365936603661366236633664366536663667366836693670367136723673367436753676367736783679368036813682368336843685368636873688368936903691369236933694369536963697369836993700370137023703370437053706370737083709371037113712371337143715371637173718371937203721372237233724372537263727372837293730373137323733373437353736373737383739374037413742374337443745374637473748374937503751375237533754375537563757375837593760376137623763376437653766376737683769377037713772377337743775377637773778377937803781378237833784378537863787378837893790379137923793379437953796379737983799380038013802380338043805380638073808380938103811381238133814381538163817381838193820382138223823382438253826382738283829383038313832383338343835383638373838383938403841384238433844384538463847384838493850385138523853385438553856385738583859386038613862386338643865386638673868386938703871387238733874387538763877387838793880388138823883388438853886388738883889389038913892389338943895389638973898389939003901390239033904390539063907390839093910391139123913391439153916391739183919392039213922392339243925392639273928392939303931393239333934393539363937393839393940394139423943394439453946394739483949395039513952395339543955395639573958395939603961396239633964396539663967396839693970397139723973397439753976397739783979398039813982398339843985398639873988398939903991399239933994399539963997399839994000400140024003400440054006400740084009401040114012401340144015401640174018401940204021402240234024402540264027402840294030403140324033403440354036403740384039404040414042404340444045404640474048404940504051405240534054405540564057405840594060406140624063406440654066406740684069407040714072407340744075407640774078407940804081408240834084408540864087408840894090409140924093409440954096409740984099410041014102410341044105410641074108410941104111411241134114411541164117411841194120412141224123412441254126412741284129413041314132413341344135413641374138413941404141414241434144414541464147414841494150415141524153415441554156415741584159416041614162416341644165416641674168416941704171417241734174417541764177417841794180418141824183418441854186418741884189419041914192419341944195419641974198419942004201420242034204420542064207420842094210421142124213421442154216421742184219422042214222422342244225422642274228422942304231423242334234423542364237423842394240424142424243424442454246424742484249425042514252425342544255425642574258425942604261426242634264426542664267426842694270427142724273427442754276427742784279428042814282428342844285428642874288428942904291429242934294429542964297429842994300430143024303430443054306430743084309431043114312431343144315431643174318431943204321432243234324432543264327432843294330433143324333433443354336433743384339434043414342434343444345434643474348434943504351435243534354435543564357435843594360436143624363436443654366436743684369437043714372437343744375437643774378437943804381438243834384438543864387438843894390439143924393439443954396439743984399440044014402440344044405440644074408440944104411441244134414441544164417441844194420442144224423442444254426442744284429443044314432443344344435443644374438443944404441444244434444444544464447444844494450445144524453445444554456445744584459446044614462446344644465446644674468446944704471447244734474447544764477447844794480448144824483448444854486448744884489449044914492449344944495449644974498449945004501450245034504450545064507450845094510451145124513451445154516451745184519452045214522452345244525452645274528452945304531453245334534453545364537453845394540454145424543454445454546454745484549455045514552455345544555455645574558455945604561456245634564456545664567456845694570457145724573457445754576457745784579458045814582458345844585458645874588458945904591459245934594459545964597459845994600460146024603460446054606460746084609461046114612461346144615461646174618461946204621462246234624462546264627462846294630463146324633463446354636463746384639464046414642464346444645464646474648464946504651465246534654465546564657465846594660466146624663466446654666466746684669467046714672467346744675467646774678467946804681468246834684468546864687468846894690469146924693469446954696469746984699470047014702470347044705470647074708470947104711471247134714471547164717471847194720472147224723472447254726472747284729473047314732473347344735473647374738473947404741474247434744474547464747474847494750475147524753475447554756475747584759476047614762476347644765476647674768476947704771477247734774477547764777477847794780478147824783478447854786478747884789479047914792479347944795479647974798479948004801480248034804480548064807480848094810481148124813481448154816481748184819482048214822482348244825482648274828482948304831483248334834483548364837483848394840484148424843484448454846484748484849485048514852485348544855485648574858485948604861486248634864486548664867486848694870487148724873487448754876487748784879488048814882488348844885488648874888488948904891489248934894489548964897489848994900490149024903490449054906490749084909491049114912491349144915491649174918491949204921492249234924492549264927492849294930493149324933493449354936493749384939494049414942494349444945494649474948494949504951495249534954495549564957495849594960496149624963496449654966496749684969497049714972497349744975497649774978497949804981498249834984498549864987498849894990499149924993499449954996499749984999500050015002500350045005500650075008500950105011501250135014501550165017501850195020502150225023502450255026502750285029503050315032503350345035503650375038503950405041504250435044504550465047504850495050505150525053505450555056505750585059506050615062506350645065506650675068506950705071507250735074507550765077507850795080508150825083508450855086508750885089509050915092509350945095509650975098509951005101510251035104510551065107510851095110511151125113511451155116511751185119512051215122512351245125512651275128512951305131513251335134513551365137513851395140514151425143514451455146514751485149515051515152515351545155515651575158515951605161516251635164516551665167516851695170517151725173517451755176517751785179518051815182518351845185518651875188518951905191519251935194519551965197519851995200520152025203520452055206520752085209521052115212521352145215521652175218521952205221522252235224522552265227522852295230523152325233523452355236523752385239524052415242524352445245524652475248524952505251525252535254525552565257525852595260526152625263526452655266526752685269527052715272527352745275527652775278527952805281528252835284528552865287528852895290529152925293529452955296529752985299530053015302530353045305530653075308530953105311531253135314531553165317531853195320532153225323532453255326532753285329533053315332533353345335533653375338533953405341534253435344534553465347534853495350535153525353535453555356535753585359536053615362536353645365536653675368536953705371537253735374537553765377537853795380538153825383538453855386538753885389539053915392539353945395539653975398539954005401540254035404540554065407540854095410541154125413541454155416541754185419542054215422542354245425542654275428542954305431543254335434543554365437543854395440544154425443544454455446544754485449545054515452545354545455545654575458545954605461546254635464546554665467546854695470547154725473547454755476547754785479548054815482548354845485548654875488548954905491549254935494549554965497549854995500550155025503550455055506550755085509551055115512551355145515551655175518551955205521552255235524552555265527552855295530553155325533553455355536553755385539554055415542554355445545554655475548554955505551555255535554555555565557555855595560556155625563556455655566556755685569557055715572557355745575557655775578557955805581558255835584558555865587558855895590559155925593559455955596559755985599560056015602560356045605560656075608560956105611561256135614561556165617561856195620562156225623562456255626562756285629563056315632563356345635563656375638563956405641564256435644564556465647564856495650565156525653565456555656565756585659566056615662566356645665566656675668566956705671567256735674567556765677567856795680568156825683568456855686568756885689569056915692569356945695569656975698569957005701570257035704570557065707570857095710571157125713571457155716571757185719572057215722572357245725572657275728572957305731573257335734573557365737573857395740574157425743574457455746574757485749575057515752575357545755575657575758575957605761576257635764576557665767576857695770577157725773577457755776577757785779578057815782578357845785578657875788578957905791579257935794579557965797579857995800580158025803580458055806580758085809581058115812581358145815581658175818581958205821582258235824582558265827582858295830583158325833583458355836583758385839584058415842584358445845584658475848584958505851585258535854585558565857585858595860586158625863586458655866586758685869587058715872587358745875587658775878587958805881588258835884588558865887588858895890589158925893589458955896589758985899590059015902590359045905590659075908590959105911591259135914591559165917591859195920592159225923592459255926592759285929593059315932593359345935593659375938593959405941594259435944594559465947594859495950595159525953595459555956595759585959596059615962596359645965596659675968596959705971597259735974597559765977597859795980598159825983598459855986598759885989599059915992599359945995599659975998599960006001600260036004600560066007600860096010601160126013601460156016601760186019602060216022602360246025602660276028602960306031603260336034603560366037603860396040604160426043604460456046604760486049605060516052605360546055605660576058605960606061606260636064606560666067606860696070607160726073607460756076607760786079608060816082608360846085608660876088608960906091609260936094609560966097609860996100610161026103610461056106610761086109611061116112611361146115611661176118611961206121612261236124612561266127612861296130613161326133613461356136613761386139614061416142614361446145614661476148614961506151615261536154615561566157615861596160616161626163616461656166616761686169617061716172617361746175617661776178617961806181618261836184618561866187618861896190619161926193619461956196619761986199620062016202620362046205620662076208620962106211621262136214621562166217621862196220622162226223622462256226622762286229623062316232623362346235623662376238623962406241624262436244624562466247624862496250625162526253625462556256625762586259626062616262626362646265626662676268626962706271627262736274627562766277627862796280628162826283628462856286628762886289629062916292629362946295629662976298629963006301630263036304630563066307630863096310631163126313631463156316631763186319632063216322632363246325632663276328632963306331633263336334633563366337633863396340634163426343634463456346634763486349635063516352635363546355635663576358635963606361636263636364636563666367636863696370637163726373637463756376637763786379638063816382638363846385638663876388638963906391639263936394639563966397639863996400640164026403640464056406640764086409641064116412641364146415641664176418641964206421642264236424642564266427642864296430643164326433643464356436643764386439644064416442644364446445644664476448644964506451645264536454645564566457645864596460646164626463646464656466646764686469647064716472647364746475647664776478647964806481648264836484648564866487648864896490649164926493649464956496649764986499650065016502650365046505650665076508650965106511651265136514651565166517651865196520652165226523652465256526652765286529653065316532653365346535653665376538653965406541654265436544654565466547654865496550655165526553655465556556655765586559656065616562656365646565656665676568656965706571657265736574657565766577657865796580658165826583658465856586658765886589659065916592659365946595659665976598659966006601660266036604660566066607660866096610661166126613661466156616661766186619662066216622662366246625662666276628662966306631663266336634663566366637663866396640664166426643664466456646664766486649665066516652665366546655
  1. module.exports = (function () {
  2. const __MODS__ = {};
  3. const __DEFINE__ = function (modId, func, req) {
  4. const m = { exports: {}, _tempexports: {} }; __MODS__[modId] = { status: 0, func, req, m };
  5. };
  6. const __REQUIRE__ = function (modId, source) {
  7. if (!__MODS__[modId]) return require(source); if (!__MODS__[modId].status) {
  8. const { m } = __MODS__[modId]; m._exports = m._tempexports; const desp = Object.getOwnPropertyDescriptor(m, 'exports'); if (desp && desp.configurable) Object.defineProperty(m, 'exports', { set(val) {
  9. if (typeof val === 'object' && val !== m._exports) {
  10. m._exports.__proto__ = val.__proto__; Object.keys(val).forEach((k) => {
  11. m._exports[k] = val[k];
  12. });
  13. } m._tempexports = val;
  14. }, get() {
  15. return m._tempexports;
  16. } }); __MODS__[modId].status = 1; __MODS__[modId].func(__MODS__[modId].req, m, m.exports);
  17. } return __MODS__[modId].m.exports;
  18. };
  19. const __REQUIRE_WILDCARD__ = function (obj) {
  20. if (obj && obj.__esModule) {
  21. return obj;
  22. } const newObj = {}; if (obj != null) {
  23. for (const k in obj) {
  24. if (Object.prototype.hasOwnProperty.call(obj, k)) newObj[k] = obj[k];
  25. }
  26. } newObj.default = obj; return newObj;
  27. };
  28. const __REQUIRE_DEFAULT__ = function (obj) {
  29. return obj && obj.__esModule ? obj.default : obj;
  30. };
  31. __DEFINE__(1602206132880, function (require, module, exports) {
  32. ;(function (root, factory, undef) {
  33. if (typeof exports === 'object') {
  34. // CommonJS
  35. module.exports = exports = factory(require('./core'), require('./x64-core'), require('./lib-typedarrays'), require('./enc-utf16'), require('./enc-base64'), 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'));
  36. } else if (typeof define === 'function' && define.amd) {
  37. // AMD
  38. define(['./core', './x64-core', './lib-typedarrays', './enc-utf16', './enc-base64', './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);
  39. } else {
  40. // Global (browser)
  41. root.CryptoJS = factory(root.CryptoJS);
  42. }
  43. }(this, CryptoJS => CryptoJS));
  44. }, (modId) => {
  45. const map = { './core': 1602206132881, './x64-core': 1602206132882, './lib-typedarrays': 1602206132883, './enc-utf16': 1602206132884, './enc-base64': 1602206132885, './md5': 1602206132886, './sha1': 1602206132887, './sha256': 1602206132888, './sha224': 1602206132889, './sha512': 1602206132890, './sha384': 1602206132891, './sha3': 1602206132892, './ripemd160': 1602206132893, './hmac': 1602206132894, './pbkdf2': 1602206132895, './evpkdf': 1602206132896, './cipher-core': 1602206132897, './mode-cfb': 1602206132898, './mode-ctr': 1602206132899, './mode-ctr-gladman': 1602206132900, './mode-ofb': 1602206132901, './mode-ecb': 1602206132902, './pad-ansix923': 1602206132903, './pad-iso10126': 1602206132904, './pad-iso97971': 1602206132905, './pad-zeropadding': 1602206132906, './pad-nopadding': 1602206132907, './format-hex': 1602206132908, './aes': 1602206132909, './tripledes': 1602206132910, './rc4': 1602206132911, './rabbit': 1602206132912, './rabbit-legacy': 1602206132913 }; return __REQUIRE__(map[modId], modId);
  46. });
  47. __DEFINE__(1602206132881, function (require, module, exports) {
  48. ;(function (root, factory) {
  49. if (typeof exports === 'object') {
  50. // CommonJS
  51. module.exports = exports = factory();
  52. } else if (typeof define === 'function' && define.amd) {
  53. // AMD
  54. define([], factory);
  55. } else {
  56. // Global (browser)
  57. root.CryptoJS = factory();
  58. }
  59. }(this, () => {
  60. /* globals window, global, require*/
  61. /**
  62. * CryptoJS core components.
  63. */
  64. var CryptoJS = CryptoJS || (function (Math, undefined) {
  65. let crypto;
  66. // Native crypto from window (Browser)
  67. if (typeof window !== 'undefined' && window.crypto) {
  68. crypto = window.crypto;
  69. }
  70. // Native (experimental IE 11) crypto from window (Browser)
  71. if (!crypto && typeof window !== 'undefined' && window.msCrypto) {
  72. crypto = window.msCrypto;
  73. }
  74. // Native crypto from global (NodeJS)
  75. if (!crypto && typeof global !== 'undefined' && global.crypto) {
  76. crypto = global.crypto;
  77. }
  78. // Native crypto import via require (NodeJS)
  79. if (!crypto && typeof require === 'function') {
  80. try {
  81. crypto = require('crypto');
  82. } catch (err) {}
  83. }
  84. /*
  85. * Cryptographically secure pseudorandom number generator
  86. *
  87. * As Math.random() is cryptographically not safe to use
  88. */
  89. const cryptoSecureRandomInt = function () {
  90. if (crypto) {
  91. // Use getRandomValues method (Browser)
  92. if (typeof crypto.getRandomValues === 'function') {
  93. try {
  94. return crypto.getRandomValues(new Uint32Array(1))[0];
  95. } catch (err) {}
  96. }
  97. // Use randomBytes method (NodeJS)
  98. if (typeof crypto.randomBytes === 'function') {
  99. try {
  100. return crypto.randomBytes(4).readInt32LE();
  101. } catch (err) {}
  102. }
  103. }
  104. throw new Error('Native crypto module could not be used to get secure random number.');
  105. };
  106. /*
  107. * Local polyfill of Object.create
  108. */
  109. const create = Object.create || (function () {
  110. function F() {}
  111. return function (obj) {
  112. let subtype;
  113. F.prototype = obj;
  114. subtype = new F();
  115. F.prototype = null;
  116. return subtype;
  117. };
  118. }());
  119. /**
  120. * CryptoJS namespace.
  121. */
  122. const C = {};
  123. /**
  124. * Library namespace.
  125. */
  126. const C_lib = C.lib = {};
  127. /**
  128. * Base object for prototypal inheritance.
  129. */
  130. const Base = C_lib.Base = (function () {
  131. return {
  132. /**
  133. * Creates a new object that inherits from this object.
  134. *
  135. * @param {Object} overrides Properties to copy into the new object.
  136. *
  137. * @return {Object} The new object.
  138. *
  139. * @static
  140. *
  141. * @example
  142. *
  143. * var MyType = CryptoJS.lib.Base.extend({
  144. * field: 'value',
  145. *
  146. * method: function () {
  147. * }
  148. * });
  149. */
  150. extend(overrides) {
  151. // Spawn
  152. const subtype = create(this);
  153. // Augment
  154. if (overrides) {
  155. subtype.mixIn(overrides);
  156. }
  157. // Create default initializer
  158. if (!subtype.hasOwnProperty('init') || this.init === subtype.init) {
  159. subtype.init = function () {
  160. subtype.$super.init.apply(this, arguments);
  161. };
  162. }
  163. // Initializer's prototype is the subtype object
  164. subtype.init.prototype = subtype;
  165. // Reference supertype
  166. subtype.$super = this;
  167. return subtype;
  168. },
  169. /**
  170. * Extends this object and runs the init method.
  171. * Arguments to create() will be passed to init().
  172. *
  173. * @return {Object} The new object.
  174. *
  175. * @static
  176. *
  177. * @example
  178. *
  179. * var instance = MyType.create();
  180. */
  181. create() {
  182. const instance = this.extend();
  183. instance.init.apply(instance, arguments);
  184. return instance;
  185. },
  186. /**
  187. * Initializes a newly created object.
  188. * Override this method to add some logic when your objects are created.
  189. *
  190. * @example
  191. *
  192. * var MyType = CryptoJS.lib.Base.extend({
  193. * init: function () {
  194. * // ...
  195. * }
  196. * });
  197. */
  198. init() {
  199. },
  200. /**
  201. * Copies properties into this object.
  202. *
  203. * @param {Object} properties The properties to mix in.
  204. *
  205. * @example
  206. *
  207. * MyType.mixIn({
  208. * field: 'value'
  209. * });
  210. */
  211. mixIn(properties) {
  212. for (const propertyName in properties) {
  213. if (properties.hasOwnProperty(propertyName)) {
  214. this[propertyName] = properties[propertyName];
  215. }
  216. }
  217. // IE won't copy toString using the loop above
  218. if (properties.hasOwnProperty('toString')) {
  219. this.toString = properties.toString;
  220. }
  221. },
  222. /**
  223. * Creates a copy of this object.
  224. *
  225. * @return {Object} The clone.
  226. *
  227. * @example
  228. *
  229. * var clone = instance.clone();
  230. */
  231. clone() {
  232. return this.init.prototype.extend(this);
  233. },
  234. };
  235. }());
  236. /**
  237. * An array of 32-bit words.
  238. *
  239. * @property {Array} words The array of 32-bit words.
  240. * @property {number} sigBytes The number of significant bytes in this word array.
  241. */
  242. var WordArray = C_lib.WordArray = Base.extend({
  243. /**
  244. * Initializes a newly created word array.
  245. *
  246. * @param {Array} words (Optional) An array of 32-bit words.
  247. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  248. *
  249. * @example
  250. *
  251. * var wordArray = CryptoJS.lib.WordArray.create();
  252. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
  253. * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
  254. */
  255. init(words, sigBytes) {
  256. words = this.words = words || [];
  257. if (sigBytes != undefined) {
  258. this.sigBytes = sigBytes;
  259. } else {
  260. this.sigBytes = words.length * 4;
  261. }
  262. },
  263. /**
  264. * Converts this word array to a string.
  265. *
  266. * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
  267. *
  268. * @return {string} The stringified word array.
  269. *
  270. * @example
  271. *
  272. * var string = wordArray + '';
  273. * var string = wordArray.toString();
  274. * var string = wordArray.toString(CryptoJS.enc.Utf8);
  275. */
  276. toString(encoder) {
  277. return (encoder || Hex).stringify(this);
  278. },
  279. /**
  280. * Concatenates a word array to this word array.
  281. *
  282. * @param {WordArray} wordArray The word array to append.
  283. *
  284. * @return {WordArray} This word array.
  285. *
  286. * @example
  287. *
  288. * wordArray1.concat(wordArray2);
  289. */
  290. concat(wordArray) {
  291. // Shortcuts
  292. const thisWords = this.words;
  293. const thatWords = wordArray.words;
  294. const thisSigBytes = this.sigBytes;
  295. const thatSigBytes = wordArray.sigBytes;
  296. // Clamp excess bits
  297. this.clamp();
  298. // Concat
  299. if (thisSigBytes % 4) {
  300. // Copy one byte at a time
  301. for (var i = 0; i < thatSigBytes; i++) {
  302. const thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  303. thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
  304. }
  305. } else {
  306. // Copy one word at a time
  307. for (var i = 0; i < thatSigBytes; i += 4) {
  308. thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
  309. }
  310. }
  311. this.sigBytes += thatSigBytes;
  312. // Chainable
  313. return this;
  314. },
  315. /**
  316. * Removes insignificant bits.
  317. *
  318. * @example
  319. *
  320. * wordArray.clamp();
  321. */
  322. clamp() {
  323. // Shortcuts
  324. const { words } = this;
  325. const { sigBytes } = this;
  326. // Clamp
  327. words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
  328. words.length = Math.ceil(sigBytes / 4);
  329. },
  330. /**
  331. * Creates a copy of this word array.
  332. *
  333. * @return {WordArray} The clone.
  334. *
  335. * @example
  336. *
  337. * var clone = wordArray.clone();
  338. */
  339. clone() {
  340. const clone = Base.clone.call(this);
  341. clone.words = this.words.slice(0);
  342. return clone;
  343. },
  344. /**
  345. * Creates a word array filled with random bytes.
  346. *
  347. * @param {number} nBytes The number of random bytes to generate.
  348. *
  349. * @return {WordArray} The random word array.
  350. *
  351. * @static
  352. *
  353. * @example
  354. *
  355. * var wordArray = CryptoJS.lib.WordArray.random(16);
  356. */
  357. random(nBytes) {
  358. const words = [];
  359. for (let i = 0; i < nBytes; i += 4) {
  360. words.push(cryptoSecureRandomInt());
  361. }
  362. return new WordArray.init(words, nBytes);
  363. },
  364. });
  365. /**
  366. * Encoder namespace.
  367. */
  368. const C_enc = C.enc = {};
  369. /**
  370. * Hex encoding strategy.
  371. */
  372. var Hex = C_enc.Hex = {
  373. /**
  374. * Converts a word array to a hex string.
  375. *
  376. * @param {WordArray} wordArray The word array.
  377. *
  378. * @return {string} The hex string.
  379. *
  380. * @static
  381. *
  382. * @example
  383. *
  384. * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
  385. */
  386. stringify(wordArray) {
  387. // Shortcuts
  388. const { words } = wordArray;
  389. const { sigBytes } = wordArray;
  390. // Convert
  391. const hexChars = [];
  392. for (let i = 0; i < sigBytes; i++) {
  393. const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  394. hexChars.push((bite >>> 4).toString(16));
  395. hexChars.push((bite & 0x0f).toString(16));
  396. }
  397. return hexChars.join('');
  398. },
  399. /**
  400. * Converts a hex string to a word array.
  401. *
  402. * @param {string} hexStr The hex string.
  403. *
  404. * @return {WordArray} The word array.
  405. *
  406. * @static
  407. *
  408. * @example
  409. *
  410. * var wordArray = CryptoJS.enc.Hex.parse(hexString);
  411. */
  412. parse(hexStr) {
  413. // Shortcut
  414. const hexStrLength = hexStr.length;
  415. // Convert
  416. const words = [];
  417. for (let i = 0; i < hexStrLength; i += 2) {
  418. words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
  419. }
  420. return new WordArray.init(words, hexStrLength / 2);
  421. },
  422. };
  423. /**
  424. * Latin1 encoding strategy.
  425. */
  426. const Latin1 = C_enc.Latin1 = {
  427. /**
  428. * Converts a word array to a Latin1 string.
  429. *
  430. * @param {WordArray} wordArray The word array.
  431. *
  432. * @return {string} The Latin1 string.
  433. *
  434. * @static
  435. *
  436. * @example
  437. *
  438. * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
  439. */
  440. stringify(wordArray) {
  441. // Shortcuts
  442. const { words } = wordArray;
  443. const { sigBytes } = wordArray;
  444. // Convert
  445. const latin1Chars = [];
  446. for (let i = 0; i < sigBytes; i++) {
  447. const bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  448. latin1Chars.push(String.fromCharCode(bite));
  449. }
  450. return latin1Chars.join('');
  451. },
  452. /**
  453. * Converts a Latin1 string to a word array.
  454. *
  455. * @param {string} latin1Str The Latin1 string.
  456. *
  457. * @return {WordArray} The word array.
  458. *
  459. * @static
  460. *
  461. * @example
  462. *
  463. * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
  464. */
  465. parse(latin1Str) {
  466. // Shortcut
  467. const latin1StrLength = latin1Str.length;
  468. // Convert
  469. const words = [];
  470. for (let i = 0; i < latin1StrLength; i++) {
  471. words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
  472. }
  473. return new WordArray.init(words, latin1StrLength);
  474. },
  475. };
  476. /**
  477. * UTF-8 encoding strategy.
  478. */
  479. const Utf8 = C_enc.Utf8 = {
  480. /**
  481. * Converts a word array to a UTF-8 string.
  482. *
  483. * @param {WordArray} wordArray The word array.
  484. *
  485. * @return {string} The UTF-8 string.
  486. *
  487. * @static
  488. *
  489. * @example
  490. *
  491. * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
  492. */
  493. stringify(wordArray) {
  494. try {
  495. return decodeURIComponent(escape(Latin1.stringify(wordArray)));
  496. } catch (e) {
  497. throw new Error('Malformed UTF-8 data');
  498. }
  499. },
  500. /**
  501. * Converts a UTF-8 string to a word array.
  502. *
  503. * @param {string} utf8Str The UTF-8 string.
  504. *
  505. * @return {WordArray} The word array.
  506. *
  507. * @static
  508. *
  509. * @example
  510. *
  511. * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
  512. */
  513. parse(utf8Str) {
  514. return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
  515. },
  516. };
  517. /**
  518. * Abstract buffered block algorithm template.
  519. *
  520. * The property blockSize must be implemented in a concrete subtype.
  521. *
  522. * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
  523. */
  524. const BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
  525. /**
  526. * Resets this block algorithm's data buffer to its initial state.
  527. *
  528. * @example
  529. *
  530. * bufferedBlockAlgorithm.reset();
  531. */
  532. reset() {
  533. // Initial values
  534. this._data = new WordArray.init();
  535. this._nDataBytes = 0;
  536. },
  537. /**
  538. * Adds new data to this block algorithm's buffer.
  539. *
  540. * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
  541. *
  542. * @example
  543. *
  544. * bufferedBlockAlgorithm._append('data');
  545. * bufferedBlockAlgorithm._append(wordArray);
  546. */
  547. _append(data) {
  548. // Convert string to WordArray, else assume WordArray already
  549. if (typeof data === 'string') {
  550. data = Utf8.parse(data);
  551. }
  552. // Append
  553. this._data.concat(data);
  554. this._nDataBytes += data.sigBytes;
  555. },
  556. /**
  557. * Processes available data blocks.
  558. *
  559. * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
  560. *
  561. * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
  562. *
  563. * @return {WordArray} The processed data.
  564. *
  565. * @example
  566. *
  567. * var processedData = bufferedBlockAlgorithm._process();
  568. * var processedData = bufferedBlockAlgorithm._process(!!'flush');
  569. */
  570. _process(doFlush) {
  571. let processedWords;
  572. // Shortcuts
  573. const data = this._data;
  574. const dataWords = data.words;
  575. const dataSigBytes = data.sigBytes;
  576. const { blockSize } = this;
  577. const blockSizeBytes = blockSize * 4;
  578. // Count blocks ready
  579. let nBlocksReady = dataSigBytes / blockSizeBytes;
  580. if (doFlush) {
  581. // Round up to include partial blocks
  582. nBlocksReady = Math.ceil(nBlocksReady);
  583. } else {
  584. // Round down to include only full blocks,
  585. // less the number of blocks that must remain in the buffer
  586. nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
  587. }
  588. // Count words ready
  589. const nWordsReady = nBlocksReady * blockSize;
  590. // Count bytes ready
  591. const nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
  592. // Process blocks
  593. if (nWordsReady) {
  594. for (let offset = 0; offset < nWordsReady; offset += blockSize) {
  595. // Perform concrete-algorithm logic
  596. this._doProcessBlock(dataWords, offset);
  597. }
  598. // Remove processed words
  599. processedWords = dataWords.splice(0, nWordsReady);
  600. data.sigBytes -= nBytesReady;
  601. }
  602. // Return processed words
  603. return new WordArray.init(processedWords, nBytesReady);
  604. },
  605. /**
  606. * Creates a copy of this object.
  607. *
  608. * @return {Object} The clone.
  609. *
  610. * @example
  611. *
  612. * var clone = bufferedBlockAlgorithm.clone();
  613. */
  614. clone() {
  615. const clone = Base.clone.call(this);
  616. clone._data = this._data.clone();
  617. return clone;
  618. },
  619. _minBufferSize: 0,
  620. });
  621. /**
  622. * Abstract hasher template.
  623. *
  624. * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
  625. */
  626. const Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
  627. /**
  628. * Configuration options.
  629. */
  630. cfg: Base.extend(),
  631. /**
  632. * Initializes a newly created hasher.
  633. *
  634. * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
  635. *
  636. * @example
  637. *
  638. * var hasher = CryptoJS.algo.SHA256.create();
  639. */
  640. init(cfg) {
  641. // Apply config defaults
  642. this.cfg = this.cfg.extend(cfg);
  643. // Set initial values
  644. this.reset();
  645. },
  646. /**
  647. * Resets this hasher to its initial state.
  648. *
  649. * @example
  650. *
  651. * hasher.reset();
  652. */
  653. reset() {
  654. // Reset data buffer
  655. BufferedBlockAlgorithm.reset.call(this);
  656. // Perform concrete-hasher logic
  657. this._doReset();
  658. },
  659. /**
  660. * Updates this hasher with a message.
  661. *
  662. * @param {WordArray|string} messageUpdate The message to append.
  663. *
  664. * @return {Hasher} This hasher.
  665. *
  666. * @example
  667. *
  668. * hasher.update('message');
  669. * hasher.update(wordArray);
  670. */
  671. update(messageUpdate) {
  672. // Append
  673. this._append(messageUpdate);
  674. // Update the hash
  675. this._process();
  676. // Chainable
  677. return this;
  678. },
  679. /**
  680. * Finalizes the hash computation.
  681. * Note that the finalize operation is effectively a destructive, read-once operation.
  682. *
  683. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  684. *
  685. * @return {WordArray} The hash.
  686. *
  687. * @example
  688. *
  689. * var hash = hasher.finalize();
  690. * var hash = hasher.finalize('message');
  691. * var hash = hasher.finalize(wordArray);
  692. */
  693. finalize(messageUpdate) {
  694. // Final message update
  695. if (messageUpdate) {
  696. this._append(messageUpdate);
  697. }
  698. // Perform concrete-hasher logic
  699. const hash = this._doFinalize();
  700. return hash;
  701. },
  702. blockSize: 512 / 32,
  703. /**
  704. * Creates a shortcut function to a hasher's object interface.
  705. *
  706. * @param {Hasher} hasher The hasher to create a helper for.
  707. *
  708. * @return {Function} The shortcut function.
  709. *
  710. * @static
  711. *
  712. * @example
  713. *
  714. * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
  715. */
  716. _createHelper(hasher) {
  717. return function (message, cfg) {
  718. return new hasher.init(cfg).finalize(message);
  719. };
  720. },
  721. /**
  722. * Creates a shortcut function to the HMAC's object interface.
  723. *
  724. * @param {Hasher} hasher The hasher to use in this HMAC helper.
  725. *
  726. * @return {Function} The shortcut function.
  727. *
  728. * @static
  729. *
  730. * @example
  731. *
  732. * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
  733. */
  734. _createHmacHelper(hasher) {
  735. return function (message, key) {
  736. return new C_algo.HMAC.init(hasher, key).finalize(message);
  737. };
  738. },
  739. });
  740. /**
  741. * Algorithm namespace.
  742. */
  743. var C_algo = C.algo = {};
  744. return C;
  745. }(Math));
  746. return CryptoJS;
  747. }));
  748. }, (modId) => {
  749. const map = {}; return __REQUIRE__(map[modId], modId);
  750. });
  751. __DEFINE__(1602206132882, function (require, module, exports) {
  752. ;(function (root, factory) {
  753. if (typeof exports === 'object') {
  754. // CommonJS
  755. module.exports = exports = factory(require('./core'));
  756. } else if (typeof define === 'function' && define.amd) {
  757. // AMD
  758. define(['./core'], factory);
  759. } else {
  760. // Global (browser)
  761. factory(root.CryptoJS);
  762. }
  763. }(this, (CryptoJS) => {
  764. (function (undefined) {
  765. // Shortcuts
  766. const C = CryptoJS;
  767. const C_lib = C.lib;
  768. const { Base } = C_lib;
  769. const X32WordArray = C_lib.WordArray;
  770. /**
  771. * x64 namespace.
  772. */
  773. const C_x64 = C.x64 = {};
  774. /**
  775. * A 64-bit word.
  776. */
  777. const X64Word = C_x64.Word = Base.extend({
  778. /**
  779. * Initializes a newly created 64-bit word.
  780. *
  781. * @param {number} high The high 32 bits.
  782. * @param {number} low The low 32 bits.
  783. *
  784. * @example
  785. *
  786. * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
  787. */
  788. init(high, low) {
  789. this.high = high;
  790. this.low = low;
  791. },
  792. /**
  793. * Bitwise NOTs this word.
  794. *
  795. * @return {X64Word} A new x64-Word object after negating.
  796. *
  797. * @example
  798. *
  799. * var negated = x64Word.not();
  800. */
  801. // not: function () {
  802. // var high = ~this.high;
  803. // var low = ~this.low;
  804. // return X64Word.create(high, low);
  805. // },
  806. /**
  807. * Bitwise ANDs this word with the passed word.
  808. *
  809. * @param {X64Word} word The x64-Word to AND with this word.
  810. *
  811. * @return {X64Word} A new x64-Word object after ANDing.
  812. *
  813. * @example
  814. *
  815. * var anded = x64Word.and(anotherX64Word);
  816. */
  817. // and: function (word) {
  818. // var high = this.high & word.high;
  819. // var low = this.low & word.low;
  820. // return X64Word.create(high, low);
  821. // },
  822. /**
  823. * Bitwise ORs this word with the passed word.
  824. *
  825. * @param {X64Word} word The x64-Word to OR with this word.
  826. *
  827. * @return {X64Word} A new x64-Word object after ORing.
  828. *
  829. * @example
  830. *
  831. * var ored = x64Word.or(anotherX64Word);
  832. */
  833. // or: function (word) {
  834. // var high = this.high | word.high;
  835. // var low = this.low | word.low;
  836. // return X64Word.create(high, low);
  837. // },
  838. /**
  839. * Bitwise XORs this word with the passed word.
  840. *
  841. * @param {X64Word} word The x64-Word to XOR with this word.
  842. *
  843. * @return {X64Word} A new x64-Word object after XORing.
  844. *
  845. * @example
  846. *
  847. * var xored = x64Word.xor(anotherX64Word);
  848. */
  849. // xor: function (word) {
  850. // var high = this.high ^ word.high;
  851. // var low = this.low ^ word.low;
  852. // return X64Word.create(high, low);
  853. // },
  854. /**
  855. * Shifts this word n bits to the left.
  856. *
  857. * @param {number} n The number of bits to shift.
  858. *
  859. * @return {X64Word} A new x64-Word object after shifting.
  860. *
  861. * @example
  862. *
  863. * var shifted = x64Word.shiftL(25);
  864. */
  865. // shiftL: function (n) {
  866. // if (n < 32) {
  867. // var high = (this.high << n) | (this.low >>> (32 - n));
  868. // var low = this.low << n;
  869. // } else {
  870. // var high = this.low << (n - 32);
  871. // var low = 0;
  872. // }
  873. // return X64Word.create(high, low);
  874. // },
  875. /**
  876. * Shifts this word n bits to the right.
  877. *
  878. * @param {number} n The number of bits to shift.
  879. *
  880. * @return {X64Word} A new x64-Word object after shifting.
  881. *
  882. * @example
  883. *
  884. * var shifted = x64Word.shiftR(7);
  885. */
  886. // shiftR: function (n) {
  887. // if (n < 32) {
  888. // var low = (this.low >>> n) | (this.high << (32 - n));
  889. // var high = this.high >>> n;
  890. // } else {
  891. // var low = this.high >>> (n - 32);
  892. // var high = 0;
  893. // }
  894. // return X64Word.create(high, low);
  895. // },
  896. /**
  897. * Rotates this word n bits to the left.
  898. *
  899. * @param {number} n The number of bits to rotate.
  900. *
  901. * @return {X64Word} A new x64-Word object after rotating.
  902. *
  903. * @example
  904. *
  905. * var rotated = x64Word.rotL(25);
  906. */
  907. // rotL: function (n) {
  908. // return this.shiftL(n).or(this.shiftR(64 - n));
  909. // },
  910. /**
  911. * Rotates this word n bits to the right.
  912. *
  913. * @param {number} n The number of bits to rotate.
  914. *
  915. * @return {X64Word} A new x64-Word object after rotating.
  916. *
  917. * @example
  918. *
  919. * var rotated = x64Word.rotR(7);
  920. */
  921. // rotR: function (n) {
  922. // return this.shiftR(n).or(this.shiftL(64 - n));
  923. // },
  924. /**
  925. * Adds this word with the passed word.
  926. *
  927. * @param {X64Word} word The x64-Word to add with this word.
  928. *
  929. * @return {X64Word} A new x64-Word object after adding.
  930. *
  931. * @example
  932. *
  933. * var added = x64Word.add(anotherX64Word);
  934. */
  935. // add: function (word) {
  936. // var low = (this.low + word.low) | 0;
  937. // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
  938. // var high = (this.high + word.high + carry) | 0;
  939. // return X64Word.create(high, low);
  940. // }
  941. });
  942. /**
  943. * An array of 64-bit words.
  944. *
  945. * @property {Array} words The array of CryptoJS.x64.Word objects.
  946. * @property {number} sigBytes The number of significant bytes in this word array.
  947. */
  948. const X64WordArray = C_x64.WordArray = Base.extend({
  949. /**
  950. * Initializes a newly created word array.
  951. *
  952. * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
  953. * @param {number} sigBytes (Optional) The number of significant bytes in the words.
  954. *
  955. * @example
  956. *
  957. * var wordArray = CryptoJS.x64.WordArray.create();
  958. *
  959. * var wordArray = CryptoJS.x64.WordArray.create([
  960. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  961. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  962. * ]);
  963. *
  964. * var wordArray = CryptoJS.x64.WordArray.create([
  965. * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
  966. * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
  967. * ], 10);
  968. */
  969. init(words, sigBytes) {
  970. words = this.words = words || [];
  971. if (sigBytes != undefined) {
  972. this.sigBytes = sigBytes;
  973. } else {
  974. this.sigBytes = words.length * 8;
  975. }
  976. },
  977. /**
  978. * Converts this 64-bit word array to a 32-bit word array.
  979. *
  980. * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
  981. *
  982. * @example
  983. *
  984. * var x32WordArray = x64WordArray.toX32();
  985. */
  986. toX32() {
  987. // Shortcuts
  988. const x64Words = this.words;
  989. const x64WordsLength = x64Words.length;
  990. // Convert
  991. const x32Words = [];
  992. for (let i = 0; i < x64WordsLength; i++) {
  993. const x64Word = x64Words[i];
  994. x32Words.push(x64Word.high);
  995. x32Words.push(x64Word.low);
  996. }
  997. return X32WordArray.create(x32Words, this.sigBytes);
  998. },
  999. /**
  1000. * Creates a copy of this word array.
  1001. *
  1002. * @return {X64WordArray} The clone.
  1003. *
  1004. * @example
  1005. *
  1006. * var clone = x64WordArray.clone();
  1007. */
  1008. clone() {
  1009. const clone = Base.clone.call(this);
  1010. // Clone "words" array
  1011. const words = clone.words = this.words.slice(0);
  1012. // Clone each X64Word object
  1013. const wordsLength = words.length;
  1014. for (let i = 0; i < wordsLength; i++) {
  1015. words[i] = words[i].clone();
  1016. }
  1017. return clone;
  1018. },
  1019. });
  1020. }());
  1021. return CryptoJS;
  1022. }));
  1023. }, (modId) => {
  1024. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1025. });
  1026. __DEFINE__(1602206132883, function (require, module, exports) {
  1027. ;(function (root, factory) {
  1028. if (typeof exports === 'object') {
  1029. // CommonJS
  1030. module.exports = exports = factory(require('./core'));
  1031. } else if (typeof define === 'function' && define.amd) {
  1032. // AMD
  1033. define(['./core'], factory);
  1034. } else {
  1035. // Global (browser)
  1036. factory(root.CryptoJS);
  1037. }
  1038. }(this, (CryptoJS) => {
  1039. (function () {
  1040. // Check if typed arrays are supported
  1041. if (typeof ArrayBuffer !== 'function') {
  1042. return;
  1043. }
  1044. // Shortcuts
  1045. const C = CryptoJS;
  1046. const C_lib = C.lib;
  1047. const { WordArray } = C_lib;
  1048. // Reference original init
  1049. const superInit = WordArray.init;
  1050. // Augment WordArray.init to handle typed arrays
  1051. const subInit = WordArray.init = function (typedArray) {
  1052. // Convert buffers to uint8
  1053. if (typedArray instanceof ArrayBuffer) {
  1054. typedArray = new Uint8Array(typedArray);
  1055. }
  1056. // Convert other array views to uint8
  1057. if (
  1058. typedArray instanceof Int8Array
  1059. || (typeof Uint8ClampedArray !== 'undefined' && typedArray instanceof Uint8ClampedArray)
  1060. || typedArray instanceof Int16Array
  1061. || typedArray instanceof Uint16Array
  1062. || typedArray instanceof Int32Array
  1063. || typedArray instanceof Uint32Array
  1064. || typedArray instanceof Float32Array
  1065. || typedArray instanceof Float64Array
  1066. ) {
  1067. typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
  1068. }
  1069. // Handle Uint8Array
  1070. if (typedArray instanceof Uint8Array) {
  1071. // Shortcut
  1072. const typedArrayByteLength = typedArray.byteLength;
  1073. // Extract bytes
  1074. const words = [];
  1075. for (let i = 0; i < typedArrayByteLength; i++) {
  1076. words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
  1077. }
  1078. // Initialize this word array
  1079. superInit.call(this, words, typedArrayByteLength);
  1080. } else {
  1081. // Else call normal init
  1082. superInit.apply(this, arguments);
  1083. }
  1084. };
  1085. subInit.prototype = WordArray;
  1086. }());
  1087. return CryptoJS.lib.WordArray;
  1088. }));
  1089. }, (modId) => {
  1090. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1091. });
  1092. __DEFINE__(1602206132884, function (require, module, exports) {
  1093. ;(function (root, factory) {
  1094. if (typeof exports === 'object') {
  1095. // CommonJS
  1096. module.exports = exports = factory(require('./core'));
  1097. } else if (typeof define === 'function' && define.amd) {
  1098. // AMD
  1099. define(['./core'], factory);
  1100. } else {
  1101. // Global (browser)
  1102. factory(root.CryptoJS);
  1103. }
  1104. }(this, (CryptoJS) => {
  1105. (function () {
  1106. // Shortcuts
  1107. const C = CryptoJS;
  1108. const C_lib = C.lib;
  1109. const { WordArray } = C_lib;
  1110. const C_enc = C.enc;
  1111. /**
  1112. * UTF-16 BE encoding strategy.
  1113. */
  1114. const Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
  1115. /**
  1116. * Converts a word array to a UTF-16 BE string.
  1117. *
  1118. * @param {WordArray} wordArray The word array.
  1119. *
  1120. * @return {string} The UTF-16 BE string.
  1121. *
  1122. * @static
  1123. *
  1124. * @example
  1125. *
  1126. * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
  1127. */
  1128. stringify(wordArray) {
  1129. // Shortcuts
  1130. const { words } = wordArray;
  1131. const { sigBytes } = wordArray;
  1132. // Convert
  1133. const utf16Chars = [];
  1134. for (let i = 0; i < sigBytes; i += 2) {
  1135. const codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
  1136. utf16Chars.push(String.fromCharCode(codePoint));
  1137. }
  1138. return utf16Chars.join('');
  1139. },
  1140. /**
  1141. * Converts a UTF-16 BE string to a word array.
  1142. *
  1143. * @param {string} utf16Str The UTF-16 BE string.
  1144. *
  1145. * @return {WordArray} The word array.
  1146. *
  1147. * @static
  1148. *
  1149. * @example
  1150. *
  1151. * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
  1152. */
  1153. parse(utf16Str) {
  1154. // Shortcut
  1155. const utf16StrLength = utf16Str.length;
  1156. // Convert
  1157. const words = [];
  1158. for (let i = 0; i < utf16StrLength; i++) {
  1159. words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
  1160. }
  1161. return WordArray.create(words, utf16StrLength * 2);
  1162. },
  1163. };
  1164. /**
  1165. * UTF-16 LE encoding strategy.
  1166. */
  1167. C_enc.Utf16LE = {
  1168. /**
  1169. * Converts a word array to a UTF-16 LE string.
  1170. *
  1171. * @param {WordArray} wordArray The word array.
  1172. *
  1173. * @return {string} The UTF-16 LE string.
  1174. *
  1175. * @static
  1176. *
  1177. * @example
  1178. *
  1179. * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
  1180. */
  1181. stringify(wordArray) {
  1182. // Shortcuts
  1183. const { words } = wordArray;
  1184. const { sigBytes } = wordArray;
  1185. // Convert
  1186. const utf16Chars = [];
  1187. for (let i = 0; i < sigBytes; i += 2) {
  1188. const codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
  1189. utf16Chars.push(String.fromCharCode(codePoint));
  1190. }
  1191. return utf16Chars.join('');
  1192. },
  1193. /**
  1194. * Converts a UTF-16 LE string to a word array.
  1195. *
  1196. * @param {string} utf16Str The UTF-16 LE string.
  1197. *
  1198. * @return {WordArray} The word array.
  1199. *
  1200. * @static
  1201. *
  1202. * @example
  1203. *
  1204. * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
  1205. */
  1206. parse(utf16Str) {
  1207. // Shortcut
  1208. const utf16StrLength = utf16Str.length;
  1209. // Convert
  1210. const words = [];
  1211. for (let i = 0; i < utf16StrLength; i++) {
  1212. words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
  1213. }
  1214. return WordArray.create(words, utf16StrLength * 2);
  1215. },
  1216. };
  1217. function swapEndian(word) {
  1218. return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
  1219. }
  1220. }());
  1221. return CryptoJS.enc.Utf16;
  1222. }));
  1223. }, (modId) => {
  1224. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1225. });
  1226. __DEFINE__(1602206132885, function (require, module, exports) {
  1227. ;(function (root, factory) {
  1228. if (typeof exports === 'object') {
  1229. // CommonJS
  1230. module.exports = exports = factory(require('./core'));
  1231. } else if (typeof define === 'function' && define.amd) {
  1232. // AMD
  1233. define(['./core'], factory);
  1234. } else {
  1235. // Global (browser)
  1236. factory(root.CryptoJS);
  1237. }
  1238. }(this, (CryptoJS) => {
  1239. (function () {
  1240. // Shortcuts
  1241. const C = CryptoJS;
  1242. const C_lib = C.lib;
  1243. const { WordArray } = C_lib;
  1244. const C_enc = C.enc;
  1245. /**
  1246. * Base64 encoding strategy.
  1247. */
  1248. const Base64 = C_enc.Base64 = {
  1249. /**
  1250. * Converts a word array to a Base64 string.
  1251. *
  1252. * @param {WordArray} wordArray The word array.
  1253. *
  1254. * @return {string} The Base64 string.
  1255. *
  1256. * @static
  1257. *
  1258. * @example
  1259. *
  1260. * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
  1261. */
  1262. stringify(wordArray) {
  1263. // Shortcuts
  1264. const { words } = wordArray;
  1265. const { sigBytes } = wordArray;
  1266. const map = this._map;
  1267. // Clamp excess bits
  1268. wordArray.clamp();
  1269. // Convert
  1270. const base64Chars = [];
  1271. for (let i = 0; i < sigBytes; i += 3) {
  1272. const byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
  1273. const byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
  1274. const byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
  1275. const triplet = (byte1 << 16) | (byte2 << 8) | byte3;
  1276. for (let j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
  1277. base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
  1278. }
  1279. }
  1280. // Add padding
  1281. const paddingChar = map.charAt(64);
  1282. if (paddingChar) {
  1283. while (base64Chars.length % 4) {
  1284. base64Chars.push(paddingChar);
  1285. }
  1286. }
  1287. return base64Chars.join('');
  1288. },
  1289. /**
  1290. * Converts a Base64 string to a word array.
  1291. *
  1292. * @param {string} base64Str The Base64 string.
  1293. *
  1294. * @return {WordArray} The word array.
  1295. *
  1296. * @static
  1297. *
  1298. * @example
  1299. *
  1300. * var wordArray = CryptoJS.enc.Base64.parse(base64String);
  1301. */
  1302. parse(base64Str) {
  1303. // Shortcuts
  1304. let base64StrLength = base64Str.length;
  1305. const map = this._map;
  1306. let reverseMap = this._reverseMap;
  1307. if (!reverseMap) {
  1308. reverseMap = this._reverseMap = [];
  1309. for (let j = 0; j < map.length; j++) {
  1310. reverseMap[map.charCodeAt(j)] = j;
  1311. }
  1312. }
  1313. // Ignore padding
  1314. const paddingChar = map.charAt(64);
  1315. if (paddingChar) {
  1316. const paddingIndex = base64Str.indexOf(paddingChar);
  1317. if (paddingIndex !== -1) {
  1318. base64StrLength = paddingIndex;
  1319. }
  1320. }
  1321. // Convert
  1322. return parseLoop(base64Str, base64StrLength, reverseMap);
  1323. },
  1324. _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=',
  1325. };
  1326. function parseLoop(base64Str, base64StrLength, reverseMap) {
  1327. const words = [];
  1328. let nBytes = 0;
  1329. for (let i = 0; i < base64StrLength; i++) {
  1330. if (i % 4) {
  1331. const bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << ((i % 4) * 2);
  1332. const bits2 = reverseMap[base64Str.charCodeAt(i)] >>> (6 - (i % 4) * 2);
  1333. const bitsCombined = bits1 | bits2;
  1334. words[nBytes >>> 2] |= bitsCombined << (24 - (nBytes % 4) * 8);
  1335. nBytes++;
  1336. }
  1337. }
  1338. return WordArray.create(words, nBytes);
  1339. }
  1340. }());
  1341. return CryptoJS.enc.Base64;
  1342. }));
  1343. }, (modId) => {
  1344. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1345. });
  1346. __DEFINE__(1602206132886, function (require, module, exports) {
  1347. ;(function (root, factory) {
  1348. if (typeof exports === 'object') {
  1349. // CommonJS
  1350. module.exports = exports = factory(require('./core'));
  1351. } else if (typeof define === 'function' && define.amd) {
  1352. // AMD
  1353. define(['./core'], factory);
  1354. } else {
  1355. // Global (browser)
  1356. factory(root.CryptoJS);
  1357. }
  1358. }(this, (CryptoJS) => {
  1359. (function (Math) {
  1360. // Shortcuts
  1361. const C = CryptoJS;
  1362. const C_lib = C.lib;
  1363. const { WordArray } = C_lib;
  1364. const { Hasher } = C_lib;
  1365. const C_algo = C.algo;
  1366. // Constants table
  1367. const T = [];
  1368. // Compute constants
  1369. (function () {
  1370. for (let i = 0; i < 64; i++) {
  1371. T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
  1372. }
  1373. }());
  1374. /**
  1375. * MD5 hash algorithm.
  1376. */
  1377. const MD5 = C_algo.MD5 = Hasher.extend({
  1378. _doReset() {
  1379. this._hash = new WordArray.init([
  1380. 0x67452301, 0xefcdab89,
  1381. 0x98badcfe, 0x10325476,
  1382. ]);
  1383. },
  1384. _doProcessBlock(M, offset) {
  1385. // Swap endian
  1386. for (let i = 0; i < 16; i++) {
  1387. // Shortcuts
  1388. const offset_i = offset + i;
  1389. const M_offset_i = M[offset_i];
  1390. M[offset_i] = (
  1391. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff)
  1392. | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  1393. );
  1394. }
  1395. // Shortcuts
  1396. const H = this._hash.words;
  1397. const M_offset_0 = M[offset + 0];
  1398. const M_offset_1 = M[offset + 1];
  1399. const M_offset_2 = M[offset + 2];
  1400. const M_offset_3 = M[offset + 3];
  1401. const M_offset_4 = M[offset + 4];
  1402. const M_offset_5 = M[offset + 5];
  1403. const M_offset_6 = M[offset + 6];
  1404. const M_offset_7 = M[offset + 7];
  1405. const M_offset_8 = M[offset + 8];
  1406. const M_offset_9 = M[offset + 9];
  1407. const M_offset_10 = M[offset + 10];
  1408. const M_offset_11 = M[offset + 11];
  1409. const M_offset_12 = M[offset + 12];
  1410. const M_offset_13 = M[offset + 13];
  1411. const M_offset_14 = M[offset + 14];
  1412. const M_offset_15 = M[offset + 15];
  1413. // Working varialbes
  1414. let a = H[0];
  1415. let b = H[1];
  1416. let c = H[2];
  1417. let d = H[3];
  1418. // Computation
  1419. a = FF(a, b, c, d, M_offset_0, 7, T[0]);
  1420. d = FF(d, a, b, c, M_offset_1, 12, T[1]);
  1421. c = FF(c, d, a, b, M_offset_2, 17, T[2]);
  1422. b = FF(b, c, d, a, M_offset_3, 22, T[3]);
  1423. a = FF(a, b, c, d, M_offset_4, 7, T[4]);
  1424. d = FF(d, a, b, c, M_offset_5, 12, T[5]);
  1425. c = FF(c, d, a, b, M_offset_6, 17, T[6]);
  1426. b = FF(b, c, d, a, M_offset_7, 22, T[7]);
  1427. a = FF(a, b, c, d, M_offset_8, 7, T[8]);
  1428. d = FF(d, a, b, c, M_offset_9, 12, T[9]);
  1429. c = FF(c, d, a, b, M_offset_10, 17, T[10]);
  1430. b = FF(b, c, d, a, M_offset_11, 22, T[11]);
  1431. a = FF(a, b, c, d, M_offset_12, 7, T[12]);
  1432. d = FF(d, a, b, c, M_offset_13, 12, T[13]);
  1433. c = FF(c, d, a, b, M_offset_14, 17, T[14]);
  1434. b = FF(b, c, d, a, M_offset_15, 22, T[15]);
  1435. a = GG(a, b, c, d, M_offset_1, 5, T[16]);
  1436. d = GG(d, a, b, c, M_offset_6, 9, T[17]);
  1437. c = GG(c, d, a, b, M_offset_11, 14, T[18]);
  1438. b = GG(b, c, d, a, M_offset_0, 20, T[19]);
  1439. a = GG(a, b, c, d, M_offset_5, 5, T[20]);
  1440. d = GG(d, a, b, c, M_offset_10, 9, T[21]);
  1441. c = GG(c, d, a, b, M_offset_15, 14, T[22]);
  1442. b = GG(b, c, d, a, M_offset_4, 20, T[23]);
  1443. a = GG(a, b, c, d, M_offset_9, 5, T[24]);
  1444. d = GG(d, a, b, c, M_offset_14, 9, T[25]);
  1445. c = GG(c, d, a, b, M_offset_3, 14, T[26]);
  1446. b = GG(b, c, d, a, M_offset_8, 20, T[27]);
  1447. a = GG(a, b, c, d, M_offset_13, 5, T[28]);
  1448. d = GG(d, a, b, c, M_offset_2, 9, T[29]);
  1449. c = GG(c, d, a, b, M_offset_7, 14, T[30]);
  1450. b = GG(b, c, d, a, M_offset_12, 20, T[31]);
  1451. a = HH(a, b, c, d, M_offset_5, 4, T[32]);
  1452. d = HH(d, a, b, c, M_offset_8, 11, T[33]);
  1453. c = HH(c, d, a, b, M_offset_11, 16, T[34]);
  1454. b = HH(b, c, d, a, M_offset_14, 23, T[35]);
  1455. a = HH(a, b, c, d, M_offset_1, 4, T[36]);
  1456. d = HH(d, a, b, c, M_offset_4, 11, T[37]);
  1457. c = HH(c, d, a, b, M_offset_7, 16, T[38]);
  1458. b = HH(b, c, d, a, M_offset_10, 23, T[39]);
  1459. a = HH(a, b, c, d, M_offset_13, 4, T[40]);
  1460. d = HH(d, a, b, c, M_offset_0, 11, T[41]);
  1461. c = HH(c, d, a, b, M_offset_3, 16, T[42]);
  1462. b = HH(b, c, d, a, M_offset_6, 23, T[43]);
  1463. a = HH(a, b, c, d, M_offset_9, 4, T[44]);
  1464. d = HH(d, a, b, c, M_offset_12, 11, T[45]);
  1465. c = HH(c, d, a, b, M_offset_15, 16, T[46]);
  1466. b = HH(b, c, d, a, M_offset_2, 23, T[47]);
  1467. a = II(a, b, c, d, M_offset_0, 6, T[48]);
  1468. d = II(d, a, b, c, M_offset_7, 10, T[49]);
  1469. c = II(c, d, a, b, M_offset_14, 15, T[50]);
  1470. b = II(b, c, d, a, M_offset_5, 21, T[51]);
  1471. a = II(a, b, c, d, M_offset_12, 6, T[52]);
  1472. d = II(d, a, b, c, M_offset_3, 10, T[53]);
  1473. c = II(c, d, a, b, M_offset_10, 15, T[54]);
  1474. b = II(b, c, d, a, M_offset_1, 21, T[55]);
  1475. a = II(a, b, c, d, M_offset_8, 6, T[56]);
  1476. d = II(d, a, b, c, M_offset_15, 10, T[57]);
  1477. c = II(c, d, a, b, M_offset_6, 15, T[58]);
  1478. b = II(b, c, d, a, M_offset_13, 21, T[59]);
  1479. a = II(a, b, c, d, M_offset_4, 6, T[60]);
  1480. d = II(d, a, b, c, M_offset_11, 10, T[61]);
  1481. c = II(c, d, a, b, M_offset_2, 15, T[62]);
  1482. b = II(b, c, d, a, M_offset_9, 21, T[63]);
  1483. // Intermediate hash value
  1484. H[0] = (H[0] + a) | 0;
  1485. H[1] = (H[1] + b) | 0;
  1486. H[2] = (H[2] + c) | 0;
  1487. H[3] = (H[3] + d) | 0;
  1488. },
  1489. _doFinalize() {
  1490. // Shortcuts
  1491. const data = this._data;
  1492. const dataWords = data.words;
  1493. const nBitsTotal = this._nDataBytes * 8;
  1494. const nBitsLeft = data.sigBytes * 8;
  1495. // Add padding
  1496. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  1497. const nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
  1498. const nBitsTotalL = nBitsTotal;
  1499. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
  1500. (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff)
  1501. | (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
  1502. );
  1503. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  1504. (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff)
  1505. | (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
  1506. );
  1507. data.sigBytes = (dataWords.length + 1) * 4;
  1508. // Hash final blocks
  1509. this._process();
  1510. // Shortcuts
  1511. const hash = this._hash;
  1512. const H = hash.words;
  1513. // Swap endian
  1514. for (let i = 0; i < 4; i++) {
  1515. // Shortcut
  1516. const H_i = H[i];
  1517. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff)
  1518. | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
  1519. }
  1520. // Return final computed hash
  1521. return hash;
  1522. },
  1523. clone() {
  1524. const clone = Hasher.clone.call(this);
  1525. clone._hash = this._hash.clone();
  1526. return clone;
  1527. },
  1528. });
  1529. function FF(a, b, c, d, x, s, t) {
  1530. const n = a + ((b & c) | (~b & d)) + x + t;
  1531. return ((n << s) | (n >>> (32 - s))) + b;
  1532. }
  1533. function GG(a, b, c, d, x, s, t) {
  1534. const n = a + ((b & d) | (c & ~d)) + x + t;
  1535. return ((n << s) | (n >>> (32 - s))) + b;
  1536. }
  1537. function HH(a, b, c, d, x, s, t) {
  1538. const n = a + (b ^ c ^ d) + x + t;
  1539. return ((n << s) | (n >>> (32 - s))) + b;
  1540. }
  1541. function II(a, b, c, d, x, s, t) {
  1542. const n = a + (c ^ (b | ~d)) + x + t;
  1543. return ((n << s) | (n >>> (32 - s))) + b;
  1544. }
  1545. /**
  1546. * Shortcut function to the hasher's object interface.
  1547. *
  1548. * @param {WordArray|string} message The message to hash.
  1549. *
  1550. * @return {WordArray} The hash.
  1551. *
  1552. * @static
  1553. *
  1554. * @example
  1555. *
  1556. * var hash = CryptoJS.MD5('message');
  1557. * var hash = CryptoJS.MD5(wordArray);
  1558. */
  1559. C.MD5 = Hasher._createHelper(MD5);
  1560. /**
  1561. * Shortcut function to the HMAC's object interface.
  1562. *
  1563. * @param {WordArray|string} message The message to hash.
  1564. * @param {WordArray|string} key The secret key.
  1565. *
  1566. * @return {WordArray} The HMAC.
  1567. *
  1568. * @static
  1569. *
  1570. * @example
  1571. *
  1572. * var hmac = CryptoJS.HmacMD5(message, key);
  1573. */
  1574. C.HmacMD5 = Hasher._createHmacHelper(MD5);
  1575. }(Math));
  1576. return CryptoJS.MD5;
  1577. }));
  1578. }, (modId) => {
  1579. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1580. });
  1581. __DEFINE__(1602206132887, function (require, module, exports) {
  1582. ;(function (root, factory) {
  1583. if (typeof exports === 'object') {
  1584. // CommonJS
  1585. module.exports = exports = factory(require('./core'));
  1586. } else if (typeof define === 'function' && define.amd) {
  1587. // AMD
  1588. define(['./core'], factory);
  1589. } else {
  1590. // Global (browser)
  1591. factory(root.CryptoJS);
  1592. }
  1593. }(this, (CryptoJS) => {
  1594. (function () {
  1595. // Shortcuts
  1596. const C = CryptoJS;
  1597. const C_lib = C.lib;
  1598. const { WordArray } = C_lib;
  1599. const { Hasher } = C_lib;
  1600. const C_algo = C.algo;
  1601. // Reusable object
  1602. const W = [];
  1603. /**
  1604. * SHA-1 hash algorithm.
  1605. */
  1606. const SHA1 = C_algo.SHA1 = Hasher.extend({
  1607. _doReset() {
  1608. this._hash = new WordArray.init([
  1609. 0x67452301, 0xefcdab89,
  1610. 0x98badcfe, 0x10325476,
  1611. 0xc3d2e1f0,
  1612. ]);
  1613. },
  1614. _doProcessBlock(M, offset) {
  1615. // Shortcut
  1616. const H = this._hash.words;
  1617. // Working variables
  1618. let a = H[0];
  1619. let b = H[1];
  1620. let c = H[2];
  1621. let d = H[3];
  1622. let e = H[4];
  1623. // Computation
  1624. for (let i = 0; i < 80; i++) {
  1625. if (i < 16) {
  1626. W[i] = M[offset + i] | 0;
  1627. } else {
  1628. const n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
  1629. W[i] = (n << 1) | (n >>> 31);
  1630. }
  1631. let t = ((a << 5) | (a >>> 27)) + e + W[i];
  1632. if (i < 20) {
  1633. t += ((b & c) | (~b & d)) + 0x5a827999;
  1634. } else if (i < 40) {
  1635. t += (b ^ c ^ d) + 0x6ed9eba1;
  1636. } else if (i < 60) {
  1637. t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
  1638. } else /* if (i < 80) */ {
  1639. t += (b ^ c ^ d) - 0x359d3e2a;
  1640. }
  1641. e = d;
  1642. d = c;
  1643. c = (b << 30) | (b >>> 2);
  1644. b = a;
  1645. a = t;
  1646. }
  1647. // Intermediate hash value
  1648. H[0] = (H[0] + a) | 0;
  1649. H[1] = (H[1] + b) | 0;
  1650. H[2] = (H[2] + c) | 0;
  1651. H[3] = (H[3] + d) | 0;
  1652. H[4] = (H[4] + e) | 0;
  1653. },
  1654. _doFinalize() {
  1655. // Shortcuts
  1656. const data = this._data;
  1657. const dataWords = data.words;
  1658. const nBitsTotal = this._nDataBytes * 8;
  1659. const nBitsLeft = data.sigBytes * 8;
  1660. // Add padding
  1661. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  1662. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  1663. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  1664. data.sigBytes = dataWords.length * 4;
  1665. // Hash final blocks
  1666. this._process();
  1667. // Return final computed hash
  1668. return this._hash;
  1669. },
  1670. clone() {
  1671. const clone = Hasher.clone.call(this);
  1672. clone._hash = this._hash.clone();
  1673. return clone;
  1674. },
  1675. });
  1676. /**
  1677. * Shortcut function to the hasher's object interface.
  1678. *
  1679. * @param {WordArray|string} message The message to hash.
  1680. *
  1681. * @return {WordArray} The hash.
  1682. *
  1683. * @static
  1684. *
  1685. * @example
  1686. *
  1687. * var hash = CryptoJS.SHA1('message');
  1688. * var hash = CryptoJS.SHA1(wordArray);
  1689. */
  1690. C.SHA1 = Hasher._createHelper(SHA1);
  1691. /**
  1692. * Shortcut function to the HMAC's object interface.
  1693. *
  1694. * @param {WordArray|string} message The message to hash.
  1695. * @param {WordArray|string} key The secret key.
  1696. *
  1697. * @return {WordArray} The HMAC.
  1698. *
  1699. * @static
  1700. *
  1701. * @example
  1702. *
  1703. * var hmac = CryptoJS.HmacSHA1(message, key);
  1704. */
  1705. C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
  1706. }());
  1707. return CryptoJS.SHA1;
  1708. }));
  1709. }, (modId) => {
  1710. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1711. });
  1712. __DEFINE__(1602206132888, function (require, module, exports) {
  1713. ;(function (root, factory) {
  1714. if (typeof exports === 'object') {
  1715. // CommonJS
  1716. module.exports = exports = factory(require('./core'));
  1717. } else if (typeof define === 'function' && define.amd) {
  1718. // AMD
  1719. define(['./core'], factory);
  1720. } else {
  1721. // Global (browser)
  1722. factory(root.CryptoJS);
  1723. }
  1724. }(this, (CryptoJS) => {
  1725. (function (Math) {
  1726. // Shortcuts
  1727. const C = CryptoJS;
  1728. const C_lib = C.lib;
  1729. const { WordArray } = C_lib;
  1730. const { Hasher } = C_lib;
  1731. const C_algo = C.algo;
  1732. // Initialization and round constants tables
  1733. const H = [];
  1734. const K = [];
  1735. // Compute constants
  1736. (function () {
  1737. function isPrime(n) {
  1738. const sqrtN = Math.sqrt(n);
  1739. for (let factor = 2; factor <= sqrtN; factor++) {
  1740. if (!(n % factor)) {
  1741. return false;
  1742. }
  1743. }
  1744. return true;
  1745. }
  1746. function getFractionalBits(n) {
  1747. return ((n - (n | 0)) * 0x100000000) | 0;
  1748. }
  1749. let n = 2;
  1750. let nPrime = 0;
  1751. while (nPrime < 64) {
  1752. if (isPrime(n)) {
  1753. if (nPrime < 8) {
  1754. H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
  1755. }
  1756. K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
  1757. nPrime++;
  1758. }
  1759. n++;
  1760. }
  1761. }());
  1762. // Reusable object
  1763. const W = [];
  1764. /**
  1765. * SHA-256 hash algorithm.
  1766. */
  1767. const SHA256 = C_algo.SHA256 = Hasher.extend({
  1768. _doReset() {
  1769. this._hash = new WordArray.init(H.slice(0));
  1770. },
  1771. _doProcessBlock(M, offset) {
  1772. // Shortcut
  1773. const H = this._hash.words;
  1774. // Working variables
  1775. let a = H[0];
  1776. let b = H[1];
  1777. let c = H[2];
  1778. let d = H[3];
  1779. let e = H[4];
  1780. let f = H[5];
  1781. let g = H[6];
  1782. let h = H[7];
  1783. // Computation
  1784. for (let i = 0; i < 64; i++) {
  1785. if (i < 16) {
  1786. W[i] = M[offset + i] | 0;
  1787. } else {
  1788. const gamma0x = W[i - 15];
  1789. const gamma0 = ((gamma0x << 25) | (gamma0x >>> 7))
  1790. ^ ((gamma0x << 14) | (gamma0x >>> 18))
  1791. ^ (gamma0x >>> 3);
  1792. const gamma1x = W[i - 2];
  1793. const gamma1 = ((gamma1x << 15) | (gamma1x >>> 17))
  1794. ^ ((gamma1x << 13) | (gamma1x >>> 19))
  1795. ^ (gamma1x >>> 10);
  1796. W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
  1797. }
  1798. const ch = (e & f) ^ (~e & g);
  1799. const maj = (a & b) ^ (a & c) ^ (b & c);
  1800. const sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
  1801. const sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
  1802. const t1 = h + sigma1 + ch + K[i] + W[i];
  1803. const t2 = sigma0 + maj;
  1804. h = g;
  1805. g = f;
  1806. f = e;
  1807. e = (d + t1) | 0;
  1808. d = c;
  1809. c = b;
  1810. b = a;
  1811. a = (t1 + t2) | 0;
  1812. }
  1813. // Intermediate hash value
  1814. H[0] = (H[0] + a) | 0;
  1815. H[1] = (H[1] + b) | 0;
  1816. H[2] = (H[2] + c) | 0;
  1817. H[3] = (H[3] + d) | 0;
  1818. H[4] = (H[4] + e) | 0;
  1819. H[5] = (H[5] + f) | 0;
  1820. H[6] = (H[6] + g) | 0;
  1821. H[7] = (H[7] + h) | 0;
  1822. },
  1823. _doFinalize() {
  1824. // Shortcuts
  1825. const data = this._data;
  1826. const dataWords = data.words;
  1827. const nBitsTotal = this._nDataBytes * 8;
  1828. const nBitsLeft = data.sigBytes * 8;
  1829. // Add padding
  1830. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  1831. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
  1832. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
  1833. data.sigBytes = dataWords.length * 4;
  1834. // Hash final blocks
  1835. this._process();
  1836. // Return final computed hash
  1837. return this._hash;
  1838. },
  1839. clone() {
  1840. const clone = Hasher.clone.call(this);
  1841. clone._hash = this._hash.clone();
  1842. return clone;
  1843. },
  1844. });
  1845. /**
  1846. * Shortcut function to the hasher's object interface.
  1847. *
  1848. * @param {WordArray|string} message The message to hash.
  1849. *
  1850. * @return {WordArray} The hash.
  1851. *
  1852. * @static
  1853. *
  1854. * @example
  1855. *
  1856. * var hash = CryptoJS.SHA256('message');
  1857. * var hash = CryptoJS.SHA256(wordArray);
  1858. */
  1859. C.SHA256 = Hasher._createHelper(SHA256);
  1860. /**
  1861. * Shortcut function to the HMAC's object interface.
  1862. *
  1863. * @param {WordArray|string} message The message to hash.
  1864. * @param {WordArray|string} key The secret key.
  1865. *
  1866. * @return {WordArray} The HMAC.
  1867. *
  1868. * @static
  1869. *
  1870. * @example
  1871. *
  1872. * var hmac = CryptoJS.HmacSHA256(message, key);
  1873. */
  1874. C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
  1875. }(Math));
  1876. return CryptoJS.SHA256;
  1877. }));
  1878. }, (modId) => {
  1879. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  1880. });
  1881. __DEFINE__(1602206132889, function (require, module, exports) {
  1882. ;(function (root, factory, undef) {
  1883. if (typeof exports === 'object') {
  1884. // CommonJS
  1885. module.exports = exports = factory(require('./core'), require('./sha256'));
  1886. } else if (typeof define === 'function' && define.amd) {
  1887. // AMD
  1888. define(['./core', './sha256'], factory);
  1889. } else {
  1890. // Global (browser)
  1891. factory(root.CryptoJS);
  1892. }
  1893. }(this, (CryptoJS) => {
  1894. (function () {
  1895. // Shortcuts
  1896. const C = CryptoJS;
  1897. const C_lib = C.lib;
  1898. const { WordArray } = C_lib;
  1899. const C_algo = C.algo;
  1900. const { SHA256 } = C_algo;
  1901. /**
  1902. * SHA-224 hash algorithm.
  1903. */
  1904. const SHA224 = C_algo.SHA224 = SHA256.extend({
  1905. _doReset() {
  1906. this._hash = new WordArray.init([
  1907. 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
  1908. 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4,
  1909. ]);
  1910. },
  1911. _doFinalize() {
  1912. const hash = SHA256._doFinalize.call(this);
  1913. hash.sigBytes -= 4;
  1914. return hash;
  1915. },
  1916. });
  1917. /**
  1918. * Shortcut function to the hasher's object interface.
  1919. *
  1920. * @param {WordArray|string} message The message to hash.
  1921. *
  1922. * @return {WordArray} The hash.
  1923. *
  1924. * @static
  1925. *
  1926. * @example
  1927. *
  1928. * var hash = CryptoJS.SHA224('message');
  1929. * var hash = CryptoJS.SHA224(wordArray);
  1930. */
  1931. C.SHA224 = SHA256._createHelper(SHA224);
  1932. /**
  1933. * Shortcut function to the HMAC's object interface.
  1934. *
  1935. * @param {WordArray|string} message The message to hash.
  1936. * @param {WordArray|string} key The secret key.
  1937. *
  1938. * @return {WordArray} The HMAC.
  1939. *
  1940. * @static
  1941. *
  1942. * @example
  1943. *
  1944. * var hmac = CryptoJS.HmacSHA224(message, key);
  1945. */
  1946. C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
  1947. }());
  1948. return CryptoJS.SHA224;
  1949. }));
  1950. }, (modId) => {
  1951. const map = { './core': 1602206132881, './sha256': 1602206132888 }; return __REQUIRE__(map[modId], modId);
  1952. });
  1953. __DEFINE__(1602206132890, function (require, module, exports) {
  1954. ;(function (root, factory, undef) {
  1955. if (typeof exports === 'object') {
  1956. // CommonJS
  1957. module.exports = exports = factory(require('./core'), require('./x64-core'));
  1958. } else if (typeof define === 'function' && define.amd) {
  1959. // AMD
  1960. define(['./core', './x64-core'], factory);
  1961. } else {
  1962. // Global (browser)
  1963. factory(root.CryptoJS);
  1964. }
  1965. }(this, (CryptoJS) => {
  1966. (function () {
  1967. // Shortcuts
  1968. const C = CryptoJS;
  1969. const C_lib = C.lib;
  1970. const { Hasher } = C_lib;
  1971. const C_x64 = C.x64;
  1972. const X64Word = C_x64.Word;
  1973. const X64WordArray = C_x64.WordArray;
  1974. const C_algo = C.algo;
  1975. function X64Word_create() {
  1976. return X64Word.create.apply(X64Word, arguments);
  1977. }
  1978. // Constants
  1979. const K = [
  1980. X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
  1981. X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
  1982. X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
  1983. X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
  1984. X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
  1985. X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
  1986. X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
  1987. X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
  1988. X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
  1989. X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
  1990. X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
  1991. X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
  1992. X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
  1993. X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
  1994. X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
  1995. X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
  1996. X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
  1997. X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
  1998. X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
  1999. X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
  2000. X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
  2001. X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
  2002. X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
  2003. X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
  2004. X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
  2005. X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
  2006. X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
  2007. X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
  2008. X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
  2009. X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
  2010. X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
  2011. X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
  2012. X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
  2013. X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
  2014. X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
  2015. X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
  2016. X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
  2017. X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
  2018. X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
  2019. X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817),
  2020. ];
  2021. // Reusable objects
  2022. const W = [];
  2023. (function () {
  2024. for (let i = 0; i < 80; i++) {
  2025. W[i] = X64Word_create();
  2026. }
  2027. }());
  2028. /**
  2029. * SHA-512 hash algorithm.
  2030. */
  2031. const SHA512 = C_algo.SHA512 = Hasher.extend({
  2032. _doReset() {
  2033. this._hash = new X64WordArray.init([
  2034. new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
  2035. new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
  2036. new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
  2037. new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179),
  2038. ]);
  2039. },
  2040. _doProcessBlock(M, offset) {
  2041. // Shortcuts
  2042. const H = this._hash.words;
  2043. const H0 = H[0];
  2044. const H1 = H[1];
  2045. const H2 = H[2];
  2046. const H3 = H[3];
  2047. const H4 = H[4];
  2048. const H5 = H[5];
  2049. const H6 = H[6];
  2050. const H7 = H[7];
  2051. const H0h = H0.high;
  2052. let H0l = H0.low;
  2053. const H1h = H1.high;
  2054. let H1l = H1.low;
  2055. const H2h = H2.high;
  2056. let H2l = H2.low;
  2057. const H3h = H3.high;
  2058. let H3l = H3.low;
  2059. const H4h = H4.high;
  2060. let H4l = H4.low;
  2061. const H5h = H5.high;
  2062. let H5l = H5.low;
  2063. const H6h = H6.high;
  2064. let H6l = H6.low;
  2065. const H7h = H7.high;
  2066. let H7l = H7.low;
  2067. // Working variables
  2068. let ah = H0h;
  2069. let al = H0l;
  2070. let bh = H1h;
  2071. let bl = H1l;
  2072. let ch = H2h;
  2073. let cl = H2l;
  2074. let dh = H3h;
  2075. let dl = H3l;
  2076. let eh = H4h;
  2077. let el = H4l;
  2078. let fh = H5h;
  2079. let fl = H5l;
  2080. let gh = H6h;
  2081. let gl = H6l;
  2082. let hh = H7h;
  2083. let hl = H7l;
  2084. // Rounds
  2085. for (let i = 0; i < 80; i++) {
  2086. var Wil;
  2087. var Wih;
  2088. // Shortcut
  2089. const Wi = W[i];
  2090. // Extend message
  2091. if (i < 16) {
  2092. Wih = Wi.high = M[offset + i * 2] | 0;
  2093. Wil = Wi.low = M[offset + i * 2 + 1] | 0;
  2094. } else {
  2095. // Gamma0
  2096. const gamma0x = W[i - 15];
  2097. const gamma0xh = gamma0x.high;
  2098. const gamma0xl = gamma0x.low;
  2099. const gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
  2100. const gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
  2101. // Gamma1
  2102. const gamma1x = W[i - 2];
  2103. const gamma1xh = gamma1x.high;
  2104. const gamma1xl = gamma1x.low;
  2105. const gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
  2106. const gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
  2107. // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
  2108. const Wi7 = W[i - 7];
  2109. const Wi7h = Wi7.high;
  2110. const Wi7l = Wi7.low;
  2111. const Wi16 = W[i - 16];
  2112. const Wi16h = Wi16.high;
  2113. const Wi16l = Wi16.low;
  2114. Wil = gamma0l + Wi7l;
  2115. Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
  2116. Wil = Wil + gamma1l;
  2117. Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
  2118. Wil = Wil + Wi16l;
  2119. Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
  2120. Wi.high = Wih;
  2121. Wi.low = Wil;
  2122. }
  2123. const chh = (eh & fh) ^ (~eh & gh);
  2124. const chl = (el & fl) ^ (~el & gl);
  2125. const majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
  2126. const majl = (al & bl) ^ (al & cl) ^ (bl & cl);
  2127. const sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
  2128. const sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
  2129. const sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
  2130. const sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
  2131. // t1 = h + sigma1 + ch + K[i] + W[i]
  2132. const Ki = K[i];
  2133. const Kih = Ki.high;
  2134. const Kil = Ki.low;
  2135. var t1l = hl + sigma1l;
  2136. var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
  2137. var t1l = t1l + chl;
  2138. var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
  2139. var t1l = t1l + Kil;
  2140. var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
  2141. var t1l = t1l + Wil;
  2142. var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
  2143. // t2 = sigma0 + maj
  2144. const t2l = sigma0l + majl;
  2145. const t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
  2146. // Update working variables
  2147. hh = gh;
  2148. hl = gl;
  2149. gh = fh;
  2150. gl = fl;
  2151. fh = eh;
  2152. fl = el;
  2153. el = (dl + t1l) | 0;
  2154. eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
  2155. dh = ch;
  2156. dl = cl;
  2157. ch = bh;
  2158. cl = bl;
  2159. bh = ah;
  2160. bl = al;
  2161. al = (t1l + t2l) | 0;
  2162. ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
  2163. }
  2164. // Intermediate hash value
  2165. H0l = H0.low = (H0l + al);
  2166. H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
  2167. H1l = H1.low = (H1l + bl);
  2168. H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
  2169. H2l = H2.low = (H2l + cl);
  2170. H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
  2171. H3l = H3.low = (H3l + dl);
  2172. H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
  2173. H4l = H4.low = (H4l + el);
  2174. H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
  2175. H5l = H5.low = (H5l + fl);
  2176. H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
  2177. H6l = H6.low = (H6l + gl);
  2178. H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
  2179. H7l = H7.low = (H7l + hl);
  2180. H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
  2181. },
  2182. _doFinalize() {
  2183. // Shortcuts
  2184. const data = this._data;
  2185. const dataWords = data.words;
  2186. const nBitsTotal = this._nDataBytes * 8;
  2187. const nBitsLeft = data.sigBytes * 8;
  2188. // Add padding
  2189. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  2190. dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
  2191. dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
  2192. data.sigBytes = dataWords.length * 4;
  2193. // Hash final blocks
  2194. this._process();
  2195. // Convert hash to 32-bit word array before returning
  2196. const hash = this._hash.toX32();
  2197. // Return final computed hash
  2198. return hash;
  2199. },
  2200. clone() {
  2201. const clone = Hasher.clone.call(this);
  2202. clone._hash = this._hash.clone();
  2203. return clone;
  2204. },
  2205. blockSize: 1024 / 32,
  2206. });
  2207. /**
  2208. * Shortcut function to the hasher's object interface.
  2209. *
  2210. * @param {WordArray|string} message The message to hash.
  2211. *
  2212. * @return {WordArray} The hash.
  2213. *
  2214. * @static
  2215. *
  2216. * @example
  2217. *
  2218. * var hash = CryptoJS.SHA512('message');
  2219. * var hash = CryptoJS.SHA512(wordArray);
  2220. */
  2221. C.SHA512 = Hasher._createHelper(SHA512);
  2222. /**
  2223. * Shortcut function to the HMAC's object interface.
  2224. *
  2225. * @param {WordArray|string} message The message to hash.
  2226. * @param {WordArray|string} key The secret key.
  2227. *
  2228. * @return {WordArray} The HMAC.
  2229. *
  2230. * @static
  2231. *
  2232. * @example
  2233. *
  2234. * var hmac = CryptoJS.HmacSHA512(message, key);
  2235. */
  2236. C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
  2237. }());
  2238. return CryptoJS.SHA512;
  2239. }));
  2240. }, (modId) => {
  2241. const map = { './core': 1602206132881, './x64-core': 1602206132882 }; return __REQUIRE__(map[modId], modId);
  2242. });
  2243. __DEFINE__(1602206132891, function (require, module, exports) {
  2244. ;(function (root, factory, undef) {
  2245. if (typeof exports === 'object') {
  2246. // CommonJS
  2247. module.exports = exports = factory(require('./core'), require('./x64-core'), require('./sha512'));
  2248. } else if (typeof define === 'function' && define.amd) {
  2249. // AMD
  2250. define(['./core', './x64-core', './sha512'], factory);
  2251. } else {
  2252. // Global (browser)
  2253. factory(root.CryptoJS);
  2254. }
  2255. }(this, (CryptoJS) => {
  2256. (function () {
  2257. // Shortcuts
  2258. const C = CryptoJS;
  2259. const C_x64 = C.x64;
  2260. const X64Word = C_x64.Word;
  2261. const X64WordArray = C_x64.WordArray;
  2262. const C_algo = C.algo;
  2263. const { SHA512 } = C_algo;
  2264. /**
  2265. * SHA-384 hash algorithm.
  2266. */
  2267. const SHA384 = C_algo.SHA384 = SHA512.extend({
  2268. _doReset() {
  2269. this._hash = new X64WordArray.init([
  2270. new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
  2271. new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
  2272. new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
  2273. new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4),
  2274. ]);
  2275. },
  2276. _doFinalize() {
  2277. const hash = SHA512._doFinalize.call(this);
  2278. hash.sigBytes -= 16;
  2279. return hash;
  2280. },
  2281. });
  2282. /**
  2283. * Shortcut function to the hasher's object interface.
  2284. *
  2285. * @param {WordArray|string} message The message to hash.
  2286. *
  2287. * @return {WordArray} The hash.
  2288. *
  2289. * @static
  2290. *
  2291. * @example
  2292. *
  2293. * var hash = CryptoJS.SHA384('message');
  2294. * var hash = CryptoJS.SHA384(wordArray);
  2295. */
  2296. C.SHA384 = SHA512._createHelper(SHA384);
  2297. /**
  2298. * Shortcut function to the HMAC's object interface.
  2299. *
  2300. * @param {WordArray|string} message The message to hash.
  2301. * @param {WordArray|string} key The secret key.
  2302. *
  2303. * @return {WordArray} The HMAC.
  2304. *
  2305. * @static
  2306. *
  2307. * @example
  2308. *
  2309. * var hmac = CryptoJS.HmacSHA384(message, key);
  2310. */
  2311. C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
  2312. }());
  2313. return CryptoJS.SHA384;
  2314. }));
  2315. }, (modId) => {
  2316. const map = { './core': 1602206132881, './x64-core': 1602206132882, './sha512': 1602206132890 }; return __REQUIRE__(map[modId], modId);
  2317. });
  2318. __DEFINE__(1602206132892, function (require, module, exports) {
  2319. ;(function (root, factory, undef) {
  2320. if (typeof exports === 'object') {
  2321. // CommonJS
  2322. module.exports = exports = factory(require('./core'), require('./x64-core'));
  2323. } else if (typeof define === 'function' && define.amd) {
  2324. // AMD
  2325. define(['./core', './x64-core'], factory);
  2326. } else {
  2327. // Global (browser)
  2328. factory(root.CryptoJS);
  2329. }
  2330. }(this, (CryptoJS) => {
  2331. (function (Math) {
  2332. // Shortcuts
  2333. const C = CryptoJS;
  2334. const C_lib = C.lib;
  2335. const { WordArray } = C_lib;
  2336. const { Hasher } = C_lib;
  2337. const C_x64 = C.x64;
  2338. const X64Word = C_x64.Word;
  2339. const C_algo = C.algo;
  2340. // Constants tables
  2341. const RHO_OFFSETS = [];
  2342. const PI_INDEXES = [];
  2343. const ROUND_CONSTANTS = [];
  2344. // Compute Constants
  2345. (function () {
  2346. // Compute rho offset constants
  2347. var x = 1; var y = 0;
  2348. for (let t = 0; t < 24; t++) {
  2349. RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
  2350. const newX = y % 5;
  2351. const newY = (2 * x + 3 * y) % 5;
  2352. x = newX;
  2353. y = newY;
  2354. }
  2355. // Compute pi index constants
  2356. for (var x = 0; x < 5; x++) {
  2357. for (var y = 0; y < 5; y++) {
  2358. PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
  2359. }
  2360. }
  2361. // Compute round constants
  2362. let LFSR = 0x01;
  2363. for (let i = 0; i < 24; i++) {
  2364. let roundConstantMsw = 0;
  2365. let roundConstantLsw = 0;
  2366. for (let j = 0; j < 7; j++) {
  2367. if (LFSR & 0x01) {
  2368. const bitPosition = (1 << j) - 1;
  2369. if (bitPosition < 32) {
  2370. roundConstantLsw ^= 1 << bitPosition;
  2371. } else /* if (bitPosition >= 32) */ {
  2372. roundConstantMsw ^= 1 << (bitPosition - 32);
  2373. }
  2374. }
  2375. // Compute next LFSR
  2376. if (LFSR & 0x80) {
  2377. // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
  2378. LFSR = (LFSR << 1) ^ 0x71;
  2379. } else {
  2380. LFSR <<= 1;
  2381. }
  2382. }
  2383. ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
  2384. }
  2385. }());
  2386. // Reusable objects for temporary values
  2387. const T = [];
  2388. (function () {
  2389. for (let i = 0; i < 25; i++) {
  2390. T[i] = X64Word.create();
  2391. }
  2392. }());
  2393. /**
  2394. * SHA-3 hash algorithm.
  2395. */
  2396. const SHA3 = C_algo.SHA3 = Hasher.extend({
  2397. /**
  2398. * Configuration options.
  2399. *
  2400. * @property {number} outputLength
  2401. * The desired number of bits in the output hash.
  2402. * Only values permitted are: 224, 256, 384, 512.
  2403. * Default: 512
  2404. */
  2405. cfg: Hasher.cfg.extend({
  2406. outputLength: 512,
  2407. }),
  2408. _doReset() {
  2409. const state = this._state = [];
  2410. for (let i = 0; i < 25; i++) {
  2411. state[i] = new X64Word.init();
  2412. }
  2413. this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
  2414. },
  2415. _doProcessBlock(M, offset) {
  2416. // Shortcuts
  2417. const state = this._state;
  2418. const nBlockSizeLanes = this.blockSize / 2;
  2419. // Absorb
  2420. for (let i = 0; i < nBlockSizeLanes; i++) {
  2421. // Shortcuts
  2422. let M2i = M[offset + 2 * i];
  2423. let M2i1 = M[offset + 2 * i + 1];
  2424. // Swap endian
  2425. M2i = (
  2426. (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff)
  2427. | (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
  2428. );
  2429. M2i1 = (
  2430. (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff)
  2431. | (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
  2432. );
  2433. // Absorb message into state
  2434. var lane = state[i];
  2435. lane.high ^= M2i1;
  2436. lane.low ^= M2i;
  2437. }
  2438. // Rounds
  2439. for (let round = 0; round < 24; round++) {
  2440. // Theta
  2441. for (var x = 0; x < 5; x++) {
  2442. // Mix column lanes
  2443. var tMsw = 0; var tLsw = 0;
  2444. for (var y = 0; y < 5; y++) {
  2445. var lane = state[x + 5 * y];
  2446. tMsw ^= lane.high;
  2447. tLsw ^= lane.low;
  2448. }
  2449. // Temporary values
  2450. const Tx = T[x];
  2451. Tx.high = tMsw;
  2452. Tx.low = tLsw;
  2453. }
  2454. for (var x = 0; x < 5; x++) {
  2455. // Shortcuts
  2456. const Tx4 = T[(x + 4) % 5];
  2457. const Tx1 = T[(x + 1) % 5];
  2458. const Tx1Msw = Tx1.high;
  2459. const Tx1Lsw = Tx1.low;
  2460. // Mix surrounding columns
  2461. var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
  2462. var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
  2463. for (var y = 0; y < 5; y++) {
  2464. var lane = state[x + 5 * y];
  2465. lane.high ^= tMsw;
  2466. lane.low ^= tLsw;
  2467. }
  2468. }
  2469. // Rho Pi
  2470. for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
  2471. var tMsw;
  2472. var tLsw;
  2473. // Shortcuts
  2474. var lane = state[laneIndex];
  2475. const laneMsw = lane.high;
  2476. const laneLsw = lane.low;
  2477. const rhoOffset = RHO_OFFSETS[laneIndex];
  2478. // Rotate lanes
  2479. if (rhoOffset < 32) {
  2480. tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
  2481. tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
  2482. } else /* if (rhoOffset >= 32) */ {
  2483. tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
  2484. tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
  2485. }
  2486. // Transpose lanes
  2487. const TPiLane = T[PI_INDEXES[laneIndex]];
  2488. TPiLane.high = tMsw;
  2489. TPiLane.low = tLsw;
  2490. }
  2491. // Rho pi at x = y = 0
  2492. const T0 = T[0];
  2493. const state0 = state[0];
  2494. T0.high = state0.high;
  2495. T0.low = state0.low;
  2496. // Chi
  2497. for (var x = 0; x < 5; x++) {
  2498. for (var y = 0; y < 5; y++) {
  2499. // Shortcuts
  2500. var laneIndex = x + 5 * y;
  2501. var lane = state[laneIndex];
  2502. const TLane = T[laneIndex];
  2503. const Tx1Lane = T[((x + 1) % 5) + 5 * y];
  2504. const Tx2Lane = T[((x + 2) % 5) + 5 * y];
  2505. // Mix rows
  2506. lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
  2507. lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
  2508. }
  2509. }
  2510. // Iota
  2511. var lane = state[0];
  2512. const roundConstant = ROUND_CONSTANTS[round];
  2513. lane.high ^= roundConstant.high;
  2514. lane.low ^= roundConstant.low;
  2515. }
  2516. },
  2517. _doFinalize() {
  2518. // Shortcuts
  2519. const data = this._data;
  2520. const dataWords = data.words;
  2521. const nBitsTotal = this._nDataBytes * 8;
  2522. const nBitsLeft = data.sigBytes * 8;
  2523. const blockSizeBits = this.blockSize * 32;
  2524. // Add padding
  2525. dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
  2526. dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
  2527. data.sigBytes = dataWords.length * 4;
  2528. // Hash final blocks
  2529. this._process();
  2530. // Shortcuts
  2531. const state = this._state;
  2532. const outputLengthBytes = this.cfg.outputLength / 8;
  2533. const outputLengthLanes = outputLengthBytes / 8;
  2534. // Squeeze
  2535. const hashWords = [];
  2536. for (let i = 0; i < outputLengthLanes; i++) {
  2537. // Shortcuts
  2538. const lane = state[i];
  2539. let laneMsw = lane.high;
  2540. let laneLsw = lane.low;
  2541. // Swap endian
  2542. laneMsw = (
  2543. (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff)
  2544. | (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
  2545. );
  2546. laneLsw = (
  2547. (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff)
  2548. | (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
  2549. );
  2550. // Squeeze state to retrieve hash
  2551. hashWords.push(laneLsw);
  2552. hashWords.push(laneMsw);
  2553. }
  2554. // Return final computed hash
  2555. return new WordArray.init(hashWords, outputLengthBytes);
  2556. },
  2557. clone() {
  2558. const clone = Hasher.clone.call(this);
  2559. const state = clone._state = this._state.slice(0);
  2560. for (let i = 0; i < 25; i++) {
  2561. state[i] = state[i].clone();
  2562. }
  2563. return clone;
  2564. },
  2565. });
  2566. /**
  2567. * Shortcut function to the hasher's object interface.
  2568. *
  2569. * @param {WordArray|string} message The message to hash.
  2570. *
  2571. * @return {WordArray} The hash.
  2572. *
  2573. * @static
  2574. *
  2575. * @example
  2576. *
  2577. * var hash = CryptoJS.SHA3('message');
  2578. * var hash = CryptoJS.SHA3(wordArray);
  2579. */
  2580. C.SHA3 = Hasher._createHelper(SHA3);
  2581. /**
  2582. * Shortcut function to the HMAC's object interface.
  2583. *
  2584. * @param {WordArray|string} message The message to hash.
  2585. * @param {WordArray|string} key The secret key.
  2586. *
  2587. * @return {WordArray} The HMAC.
  2588. *
  2589. * @static
  2590. *
  2591. * @example
  2592. *
  2593. * var hmac = CryptoJS.HmacSHA3(message, key);
  2594. */
  2595. C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
  2596. }(Math));
  2597. return CryptoJS.SHA3;
  2598. }));
  2599. }, (modId) => {
  2600. const map = { './core': 1602206132881, './x64-core': 1602206132882 }; return __REQUIRE__(map[modId], modId);
  2601. });
  2602. __DEFINE__(1602206132893, function (require, module, exports) {
  2603. ;(function (root, factory) {
  2604. if (typeof exports === 'object') {
  2605. // CommonJS
  2606. module.exports = exports = factory(require('./core'));
  2607. } else if (typeof define === 'function' && define.amd) {
  2608. // AMD
  2609. define(['./core'], factory);
  2610. } else {
  2611. // Global (browser)
  2612. factory(root.CryptoJS);
  2613. }
  2614. }(this, (CryptoJS) => {
  2615. /** @preserve
  2616. (c) 2012 by Cédric Mesnil. All rights reserved.
  2617. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
  2618. - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2619. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  2620. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  2621. */
  2622. (function (Math) {
  2623. // Shortcuts
  2624. const C = CryptoJS;
  2625. const C_lib = C.lib;
  2626. const { WordArray } = C_lib;
  2627. const { Hasher } = C_lib;
  2628. const C_algo = C.algo;
  2629. // Constants table
  2630. const _zl = WordArray.create([
  2631. 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
  2632. 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
  2633. 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
  2634. 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
  2635. 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
  2636. const _zr = WordArray.create([
  2637. 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
  2638. 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
  2639. 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
  2640. 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
  2641. 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
  2642. const _sl = WordArray.create([
  2643. 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
  2644. 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
  2645. 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
  2646. 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
  2647. 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]);
  2648. const _sr = WordArray.create([
  2649. 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
  2650. 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
  2651. 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
  2652. 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
  2653. 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]);
  2654. const _hl = WordArray.create([0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
  2655. const _hr = WordArray.create([0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
  2656. /**
  2657. * RIPEMD160 hash algorithm.
  2658. */
  2659. const RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
  2660. _doReset() {
  2661. this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
  2662. },
  2663. _doProcessBlock(M, offset) {
  2664. // Swap endian
  2665. for (var i = 0; i < 16; i++) {
  2666. // Shortcuts
  2667. const offset_i = offset + i;
  2668. const M_offset_i = M[offset_i];
  2669. // Swap
  2670. M[offset_i] = (
  2671. (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff)
  2672. | (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
  2673. );
  2674. }
  2675. // Shortcut
  2676. const H = this._hash.words;
  2677. const hl = _hl.words;
  2678. const hr = _hr.words;
  2679. const zl = _zl.words;
  2680. const zr = _zr.words;
  2681. const sl = _sl.words;
  2682. const sr = _sr.words;
  2683. // Working variables
  2684. let al; let bl; let cl; let dl; let el;
  2685. let ar; let br; let cr; let dr; let er;
  2686. ar = al = H[0];
  2687. br = bl = H[1];
  2688. cr = cl = H[2];
  2689. dr = dl = H[3];
  2690. er = el = H[4];
  2691. // Computation
  2692. let t;
  2693. for (var i = 0; i < 80; i += 1) {
  2694. t = (al + M[offset + zl[i]]) | 0;
  2695. if (i < 16) {
  2696. t += f1(bl, cl, dl) + hl[0];
  2697. } else if (i < 32) {
  2698. t += f2(bl, cl, dl) + hl[1];
  2699. } else if (i < 48) {
  2700. t += f3(bl, cl, dl) + hl[2];
  2701. } else if (i < 64) {
  2702. t += f4(bl, cl, dl) + hl[3];
  2703. } else { // if (i<80) {
  2704. t += f5(bl, cl, dl) + hl[4];
  2705. }
  2706. t = t | 0;
  2707. t = rotl(t, sl[i]);
  2708. t = (t + el) | 0;
  2709. al = el;
  2710. el = dl;
  2711. dl = rotl(cl, 10);
  2712. cl = bl;
  2713. bl = t;
  2714. t = (ar + M[offset + zr[i]]) | 0;
  2715. if (i < 16) {
  2716. t += f5(br, cr, dr) + hr[0];
  2717. } else if (i < 32) {
  2718. t += f4(br, cr, dr) + hr[1];
  2719. } else if (i < 48) {
  2720. t += f3(br, cr, dr) + hr[2];
  2721. } else if (i < 64) {
  2722. t += f2(br, cr, dr) + hr[3];
  2723. } else { // if (i<80) {
  2724. t += f1(br, cr, dr) + hr[4];
  2725. }
  2726. t = t | 0;
  2727. t = rotl(t, sr[i]) ;
  2728. t = (t + er) | 0;
  2729. ar = er;
  2730. er = dr;
  2731. dr = rotl(cr, 10);
  2732. cr = br;
  2733. br = t;
  2734. }
  2735. // Intermediate hash value
  2736. t = (H[1] + cl + dr) | 0;
  2737. H[1] = (H[2] + dl + er) | 0;
  2738. H[2] = (H[3] + el + ar) | 0;
  2739. H[3] = (H[4] + al + br) | 0;
  2740. H[4] = (H[0] + bl + cr) | 0;
  2741. H[0] = t;
  2742. },
  2743. _doFinalize() {
  2744. // Shortcuts
  2745. const data = this._data;
  2746. const dataWords = data.words;
  2747. const nBitsTotal = this._nDataBytes * 8;
  2748. const nBitsLeft = data.sigBytes * 8;
  2749. // Add padding
  2750. dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
  2751. dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
  2752. (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff)
  2753. | (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
  2754. );
  2755. data.sigBytes = (dataWords.length + 1) * 4;
  2756. // Hash final blocks
  2757. this._process();
  2758. // Shortcuts
  2759. const hash = this._hash;
  2760. const H = hash.words;
  2761. // Swap endian
  2762. for (let i = 0; i < 5; i++) {
  2763. // Shortcut
  2764. const H_i = H[i];
  2765. // Swap
  2766. H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff)
  2767. | (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
  2768. }
  2769. // Return final computed hash
  2770. return hash;
  2771. },
  2772. clone() {
  2773. const clone = Hasher.clone.call(this);
  2774. clone._hash = this._hash.clone();
  2775. return clone;
  2776. },
  2777. });
  2778. function f1(x, y, z) {
  2779. return ((x) ^ (y) ^ (z));
  2780. }
  2781. function f2(x, y, z) {
  2782. return (((x) & (y)) | ((~x) & (z)));
  2783. }
  2784. function f3(x, y, z) {
  2785. return (((x) | (~(y))) ^ (z));
  2786. }
  2787. function f4(x, y, z) {
  2788. return (((x) & (z)) | ((y) & (~(z))));
  2789. }
  2790. function f5(x, y, z) {
  2791. return ((x) ^ ((y) | (~(z))));
  2792. }
  2793. function rotl(x, n) {
  2794. return (x << n) | (x >>> (32 - n));
  2795. }
  2796. /**
  2797. * Shortcut function to the hasher's object interface.
  2798. *
  2799. * @param {WordArray|string} message The message to hash.
  2800. *
  2801. * @return {WordArray} The hash.
  2802. *
  2803. * @static
  2804. *
  2805. * @example
  2806. *
  2807. * var hash = CryptoJS.RIPEMD160('message');
  2808. * var hash = CryptoJS.RIPEMD160(wordArray);
  2809. */
  2810. C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
  2811. /**
  2812. * Shortcut function to the HMAC's object interface.
  2813. *
  2814. * @param {WordArray|string} message The message to hash.
  2815. * @param {WordArray|string} key The secret key.
  2816. *
  2817. * @return {WordArray} The HMAC.
  2818. *
  2819. * @static
  2820. *
  2821. * @example
  2822. *
  2823. * var hmac = CryptoJS.HmacRIPEMD160(message, key);
  2824. */
  2825. C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
  2826. }(Math));
  2827. return CryptoJS.RIPEMD160;
  2828. }));
  2829. }, (modId) => {
  2830. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  2831. });
  2832. __DEFINE__(1602206132894, function (require, module, exports) {
  2833. ;(function (root, factory) {
  2834. if (typeof exports === 'object') {
  2835. // CommonJS
  2836. module.exports = exports = factory(require('./core'));
  2837. } else if (typeof define === 'function' && define.amd) {
  2838. // AMD
  2839. define(['./core'], factory);
  2840. } else {
  2841. // Global (browser)
  2842. factory(root.CryptoJS);
  2843. }
  2844. }(this, (CryptoJS) => {
  2845. (function () {
  2846. // Shortcuts
  2847. const C = CryptoJS;
  2848. const C_lib = C.lib;
  2849. const { Base } = C_lib;
  2850. const C_enc = C.enc;
  2851. const { Utf8 } = C_enc;
  2852. const C_algo = C.algo;
  2853. /**
  2854. * HMAC algorithm.
  2855. */
  2856. const HMAC = C_algo.HMAC = Base.extend({
  2857. /**
  2858. * Initializes a newly created HMAC.
  2859. *
  2860. * @param {Hasher} hasher The hash algorithm to use.
  2861. * @param {WordArray|string} key The secret key.
  2862. *
  2863. * @example
  2864. *
  2865. * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
  2866. */
  2867. init(hasher, key) {
  2868. // Init hasher
  2869. hasher = this._hasher = new hasher.init();
  2870. // Convert string to WordArray, else assume WordArray already
  2871. if (typeof key === 'string') {
  2872. key = Utf8.parse(key);
  2873. }
  2874. // Shortcuts
  2875. const hasherBlockSize = hasher.blockSize;
  2876. const hasherBlockSizeBytes = hasherBlockSize * 4;
  2877. // Allow arbitrary length keys
  2878. if (key.sigBytes > hasherBlockSizeBytes) {
  2879. key = hasher.finalize(key);
  2880. }
  2881. // Clamp excess bits
  2882. key.clamp();
  2883. // Clone key for inner and outer pads
  2884. const oKey = this._oKey = key.clone();
  2885. const iKey = this._iKey = key.clone();
  2886. // Shortcuts
  2887. const oKeyWords = oKey.words;
  2888. const iKeyWords = iKey.words;
  2889. // XOR keys with pad constants
  2890. for (let i = 0; i < hasherBlockSize; i++) {
  2891. oKeyWords[i] ^= 0x5c5c5c5c;
  2892. iKeyWords[i] ^= 0x36363636;
  2893. }
  2894. oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
  2895. // Set initial values
  2896. this.reset();
  2897. },
  2898. /**
  2899. * Resets this HMAC to its initial state.
  2900. *
  2901. * @example
  2902. *
  2903. * hmacHasher.reset();
  2904. */
  2905. reset() {
  2906. // Shortcut
  2907. const hasher = this._hasher;
  2908. // Reset
  2909. hasher.reset();
  2910. hasher.update(this._iKey);
  2911. },
  2912. /**
  2913. * Updates this HMAC with a message.
  2914. *
  2915. * @param {WordArray|string} messageUpdate The message to append.
  2916. *
  2917. * @return {HMAC} This HMAC instance.
  2918. *
  2919. * @example
  2920. *
  2921. * hmacHasher.update('message');
  2922. * hmacHasher.update(wordArray);
  2923. */
  2924. update(messageUpdate) {
  2925. this._hasher.update(messageUpdate);
  2926. // Chainable
  2927. return this;
  2928. },
  2929. /**
  2930. * Finalizes the HMAC computation.
  2931. * Note that the finalize operation is effectively a destructive, read-once operation.
  2932. *
  2933. * @param {WordArray|string} messageUpdate (Optional) A final message update.
  2934. *
  2935. * @return {WordArray} The HMAC.
  2936. *
  2937. * @example
  2938. *
  2939. * var hmac = hmacHasher.finalize();
  2940. * var hmac = hmacHasher.finalize('message');
  2941. * var hmac = hmacHasher.finalize(wordArray);
  2942. */
  2943. finalize(messageUpdate) {
  2944. // Shortcut
  2945. const hasher = this._hasher;
  2946. // Compute HMAC
  2947. const innerHash = hasher.finalize(messageUpdate);
  2948. hasher.reset();
  2949. const hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
  2950. return hmac;
  2951. },
  2952. });
  2953. }());
  2954. }));
  2955. }, (modId) => {
  2956. const map = { './core': 1602206132881 }; return __REQUIRE__(map[modId], modId);
  2957. });
  2958. __DEFINE__(1602206132895, function (require, module, exports) {
  2959. ;(function (root, factory, undef) {
  2960. if (typeof exports === 'object') {
  2961. // CommonJS
  2962. module.exports = exports = factory(require('./core'), require('./sha1'), require('./hmac'));
  2963. } else if (typeof define === 'function' && define.amd) {
  2964. // AMD
  2965. define(['./core', './sha1', './hmac'], factory);
  2966. } else {
  2967. // Global (browser)
  2968. factory(root.CryptoJS);
  2969. }
  2970. }(this, (CryptoJS) => {
  2971. (function () {
  2972. // Shortcuts
  2973. const C = CryptoJS;
  2974. const C_lib = C.lib;
  2975. const { Base } = C_lib;
  2976. const { WordArray } = C_lib;
  2977. const C_algo = C.algo;
  2978. const { SHA1 } = C_algo;
  2979. const { HMAC } = C_algo;
  2980. /**
  2981. * Password-Based Key Derivation Function 2 algorithm.
  2982. */
  2983. const PBKDF2 = C_algo.PBKDF2 = Base.extend({
  2984. /**
  2985. * Configuration options.
  2986. *
  2987. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  2988. * @property {Hasher} hasher The hasher to use. Default: SHA1
  2989. * @property {number} iterations The number of iterations to perform. Default: 1
  2990. */
  2991. cfg: Base.extend({
  2992. keySize: 128 / 32,
  2993. hasher: SHA1,
  2994. iterations: 1,
  2995. }),
  2996. /**
  2997. * Initializes a newly created key derivation function.
  2998. *
  2999. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  3000. *
  3001. * @example
  3002. *
  3003. * var kdf = CryptoJS.algo.PBKDF2.create();
  3004. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
  3005. * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
  3006. */
  3007. init(cfg) {
  3008. this.cfg = this.cfg.extend(cfg);
  3009. },
  3010. /**
  3011. * Computes the Password-Based Key Derivation Function 2.
  3012. *
  3013. * @param {WordArray|string} password The password.
  3014. * @param {WordArray|string} salt A salt.
  3015. *
  3016. * @return {WordArray} The derived key.
  3017. *
  3018. * @example
  3019. *
  3020. * var key = kdf.compute(password, salt);
  3021. */
  3022. compute(password, salt) {
  3023. // Shortcut
  3024. const { cfg } = this;
  3025. // Init HMAC
  3026. const hmac = HMAC.create(cfg.hasher, password);
  3027. // Initial values
  3028. const derivedKey = WordArray.create();
  3029. const blockIndex = WordArray.create([0x00000001]);
  3030. // Shortcuts
  3031. const derivedKeyWords = derivedKey.words;
  3032. const blockIndexWords = blockIndex.words;
  3033. const { keySize } = cfg;
  3034. const { iterations } = cfg;
  3035. // Generate key
  3036. while (derivedKeyWords.length < keySize) {
  3037. const block = hmac.update(salt).finalize(blockIndex);
  3038. hmac.reset();
  3039. // Shortcuts
  3040. const blockWords = block.words;
  3041. const blockWordsLength = blockWords.length;
  3042. // Iterations
  3043. let intermediate = block;
  3044. for (let i = 1; i < iterations; i++) {
  3045. intermediate = hmac.finalize(intermediate);
  3046. hmac.reset();
  3047. // Shortcut
  3048. const intermediateWords = intermediate.words;
  3049. // XOR intermediate with block
  3050. for (let j = 0; j < blockWordsLength; j++) {
  3051. blockWords[j] ^= intermediateWords[j];
  3052. }
  3053. }
  3054. derivedKey.concat(block);
  3055. blockIndexWords[0]++;
  3056. }
  3057. derivedKey.sigBytes = keySize * 4;
  3058. return derivedKey;
  3059. },
  3060. });
  3061. /**
  3062. * Computes the Password-Based Key Derivation Function 2.
  3063. *
  3064. * @param {WordArray|string} password The password.
  3065. * @param {WordArray|string} salt A salt.
  3066. * @param {Object} cfg (Optional) The configuration options to use for this computation.
  3067. *
  3068. * @return {WordArray} The derived key.
  3069. *
  3070. * @static
  3071. *
  3072. * @example
  3073. *
  3074. * var key = CryptoJS.PBKDF2(password, salt);
  3075. * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
  3076. * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
  3077. */
  3078. C.PBKDF2 = function (password, salt, cfg) {
  3079. return PBKDF2.create(cfg).compute(password, salt);
  3080. };
  3081. }());
  3082. return CryptoJS.PBKDF2;
  3083. }));
  3084. }, (modId) => {
  3085. const map = { './core': 1602206132881, './sha1': 1602206132887, './hmac': 1602206132894 }; return __REQUIRE__(map[modId], modId);
  3086. });
  3087. __DEFINE__(1602206132896, function (require, module, exports) {
  3088. ;(function (root, factory, undef) {
  3089. if (typeof exports === 'object') {
  3090. // CommonJS
  3091. module.exports = exports = factory(require('./core'), require('./sha1'), require('./hmac'));
  3092. } else if (typeof define === 'function' && define.amd) {
  3093. // AMD
  3094. define(['./core', './sha1', './hmac'], factory);
  3095. } else {
  3096. // Global (browser)
  3097. factory(root.CryptoJS);
  3098. }
  3099. }(this, (CryptoJS) => {
  3100. (function () {
  3101. // Shortcuts
  3102. const C = CryptoJS;
  3103. const C_lib = C.lib;
  3104. const { Base } = C_lib;
  3105. const { WordArray } = C_lib;
  3106. const C_algo = C.algo;
  3107. const { MD5 } = C_algo;
  3108. /**
  3109. * This key derivation function is meant to conform with EVP_BytesToKey.
  3110. * www.openssl.org/docs/crypto/EVP_BytesToKey.html
  3111. */
  3112. const EvpKDF = C_algo.EvpKDF = Base.extend({
  3113. /**
  3114. * Configuration options.
  3115. *
  3116. * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
  3117. * @property {Hasher} hasher The hash algorithm to use. Default: MD5
  3118. * @property {number} iterations The number of iterations to perform. Default: 1
  3119. */
  3120. cfg: Base.extend({
  3121. keySize: 128 / 32,
  3122. hasher: MD5,
  3123. iterations: 1,
  3124. }),
  3125. /**
  3126. * Initializes a newly created key derivation function.
  3127. *
  3128. * @param {Object} cfg (Optional) The configuration options to use for the derivation.
  3129. *
  3130. * @example
  3131. *
  3132. * var kdf = CryptoJS.algo.EvpKDF.create();
  3133. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
  3134. * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
  3135. */
  3136. init(cfg) {
  3137. this.cfg = this.cfg.extend(cfg);
  3138. },
  3139. /**
  3140. * Derives a key from a password.
  3141. *
  3142. * @param {WordArray|string} password The password.
  3143. * @param {WordArray|string} salt A salt.
  3144. *
  3145. * @return {WordArray} The derived key.
  3146. *
  3147. * @example
  3148. *
  3149. * var key = kdf.compute(password, salt);
  3150. */
  3151. compute(password, salt) {
  3152. let block;
  3153. // Shortcut
  3154. const { cfg } = this;
  3155. // Init hasher
  3156. const hasher = cfg.hasher.create();
  3157. // Initial values
  3158. const derivedKey = WordArray.create();
  3159. // Shortcuts
  3160. const derivedKeyWords = derivedKey.words;
  3161. const { keySize } = cfg;
  3162. const { iterations } = cfg;
  3163. // Generate key
  3164. while (derivedKeyWords.length < keySize) {
  3165. if (block) {
  3166. hasher.update(block);
  3167. }
  3168. block = hasher.update(password).finalize(salt);
  3169. hasher.reset();
  3170. // Iterations
  3171. for (let i = 1; i < iterations; i++) {
  3172. block = hasher.finalize(block);
  3173. hasher.reset();
  3174. }
  3175. derivedKey.concat(block);
  3176. }
  3177. derivedKey.sigBytes = keySize * 4;
  3178. return derivedKey;
  3179. },
  3180. });
  3181. /**
  3182. * Derives a key from a password.
  3183. *
  3184. * @param {WordArray|string} password The password.
  3185. * @param {WordArray|string} salt A salt.
  3186. * @param {Object} cfg (Optional) The configuration options to use for this computation.
  3187. *
  3188. * @return {WordArray} The derived key.
  3189. *
  3190. * @static
  3191. *
  3192. * @example
  3193. *
  3194. * var key = CryptoJS.EvpKDF(password, salt);
  3195. * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
  3196. * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
  3197. */
  3198. C.EvpKDF = function (password, salt, cfg) {
  3199. return EvpKDF.create(cfg).compute(password, salt);
  3200. };
  3201. }());
  3202. return CryptoJS.EvpKDF;
  3203. }));
  3204. }, (modId) => {
  3205. const map = { './core': 1602206132881, './sha1': 1602206132887, './hmac': 1602206132894 }; return __REQUIRE__(map[modId], modId);
  3206. });
  3207. __DEFINE__(1602206132897, function (require, module, exports) {
  3208. ;(function (root, factory, undef) {
  3209. if (typeof exports === 'object') {
  3210. // CommonJS
  3211. module.exports = exports = factory(require('./core'), require('./evpkdf'));
  3212. } else if (typeof define === 'function' && define.amd) {
  3213. // AMD
  3214. define(['./core', './evpkdf'], factory);
  3215. } else {
  3216. // Global (browser)
  3217. factory(root.CryptoJS);
  3218. }
  3219. }(this, (CryptoJS) => {
  3220. /**
  3221. * Cipher core components.
  3222. */
  3223. CryptoJS.lib.Cipher || (function (undefined) {
  3224. // Shortcuts
  3225. const C = CryptoJS;
  3226. const C_lib = C.lib;
  3227. const { Base } = C_lib;
  3228. const { WordArray } = C_lib;
  3229. const { BufferedBlockAlgorithm } = C_lib;
  3230. const C_enc = C.enc;
  3231. const { Utf8 } = C_enc;
  3232. const { Base64 } = C_enc;
  3233. const C_algo = C.algo;
  3234. const { EvpKDF } = C_algo;
  3235. /**
  3236. * Abstract base cipher template.
  3237. *
  3238. * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
  3239. * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
  3240. * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
  3241. * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
  3242. */
  3243. const Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
  3244. /**
  3245. * Configuration options.
  3246. *
  3247. * @property {WordArray} iv The IV to use for this operation.
  3248. */
  3249. cfg: Base.extend(),
  3250. /**
  3251. * Creates this cipher in encryption mode.
  3252. *
  3253. * @param {WordArray} key The key.
  3254. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3255. *
  3256. * @return {Cipher} A cipher instance.
  3257. *
  3258. * @static
  3259. *
  3260. * @example
  3261. *
  3262. * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
  3263. */
  3264. createEncryptor(key, cfg) {
  3265. return this.create(this._ENC_XFORM_MODE, key, cfg);
  3266. },
  3267. /**
  3268. * Creates this cipher in decryption mode.
  3269. *
  3270. * @param {WordArray} key The key.
  3271. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3272. *
  3273. * @return {Cipher} A cipher instance.
  3274. *
  3275. * @static
  3276. *
  3277. * @example
  3278. *
  3279. * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
  3280. */
  3281. createDecryptor(key, cfg) {
  3282. return this.create(this._DEC_XFORM_MODE, key, cfg);
  3283. },
  3284. /**
  3285. * Initializes a newly created cipher.
  3286. *
  3287. * @param {number} xformMode Either the encryption or decryption transormation mode constant.
  3288. * @param {WordArray} key The key.
  3289. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3290. *
  3291. * @example
  3292. *
  3293. * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
  3294. */
  3295. init(xformMode, key, cfg) {
  3296. // Apply config defaults
  3297. this.cfg = this.cfg.extend(cfg);
  3298. // Store transform mode and key
  3299. this._xformMode = xformMode;
  3300. this._key = key;
  3301. // Set initial values
  3302. this.reset();
  3303. },
  3304. /**
  3305. * Resets this cipher to its initial state.
  3306. *
  3307. * @example
  3308. *
  3309. * cipher.reset();
  3310. */
  3311. reset() {
  3312. // Reset data buffer
  3313. BufferedBlockAlgorithm.reset.call(this);
  3314. // Perform concrete-cipher logic
  3315. this._doReset();
  3316. },
  3317. /**
  3318. * Adds data to be encrypted or decrypted.
  3319. *
  3320. * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
  3321. *
  3322. * @return {WordArray} The data after processing.
  3323. *
  3324. * @example
  3325. *
  3326. * var encrypted = cipher.process('data');
  3327. * var encrypted = cipher.process(wordArray);
  3328. */
  3329. process(dataUpdate) {
  3330. // Append
  3331. this._append(dataUpdate);
  3332. // Process available blocks
  3333. return this._process();
  3334. },
  3335. /**
  3336. * Finalizes the encryption or decryption process.
  3337. * Note that the finalize operation is effectively a destructive, read-once operation.
  3338. *
  3339. * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
  3340. *
  3341. * @return {WordArray} The data after final processing.
  3342. *
  3343. * @example
  3344. *
  3345. * var encrypted = cipher.finalize();
  3346. * var encrypted = cipher.finalize('data');
  3347. * var encrypted = cipher.finalize(wordArray);
  3348. */
  3349. finalize(dataUpdate) {
  3350. // Final data update
  3351. if (dataUpdate) {
  3352. this._append(dataUpdate);
  3353. }
  3354. // Perform concrete-cipher logic
  3355. const finalProcessedData = this._doFinalize();
  3356. return finalProcessedData;
  3357. },
  3358. keySize: 128 / 32,
  3359. ivSize: 128 / 32,
  3360. _ENC_XFORM_MODE: 1,
  3361. _DEC_XFORM_MODE: 2,
  3362. /**
  3363. * Creates shortcut functions to a cipher's object interface.
  3364. *
  3365. * @param {Cipher} cipher The cipher to create a helper for.
  3366. *
  3367. * @return {Object} An object with encrypt and decrypt shortcut functions.
  3368. *
  3369. * @static
  3370. *
  3371. * @example
  3372. *
  3373. * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
  3374. */
  3375. _createHelper: (function () {
  3376. function selectCipherStrategy(key) {
  3377. if (typeof key === 'string') {
  3378. return PasswordBasedCipher;
  3379. }
  3380. return SerializableCipher;
  3381. }
  3382. return function (cipher) {
  3383. return {
  3384. encrypt(message, key, cfg) {
  3385. return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
  3386. },
  3387. decrypt(ciphertext, key, cfg) {
  3388. return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
  3389. },
  3390. };
  3391. };
  3392. }()),
  3393. });
  3394. /**
  3395. * Abstract base stream cipher template.
  3396. *
  3397. * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
  3398. */
  3399. const StreamCipher = C_lib.StreamCipher = Cipher.extend({
  3400. _doFinalize() {
  3401. // Process partial blocks
  3402. const finalProcessedBlocks = this._process(!!'flush');
  3403. return finalProcessedBlocks;
  3404. },
  3405. blockSize: 1,
  3406. });
  3407. /**
  3408. * Mode namespace.
  3409. */
  3410. const C_mode = C.mode = {};
  3411. /**
  3412. * Abstract base block cipher mode template.
  3413. */
  3414. const BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
  3415. /**
  3416. * Creates this mode for encryption.
  3417. *
  3418. * @param {Cipher} cipher A block cipher instance.
  3419. * @param {Array} iv The IV words.
  3420. *
  3421. * @static
  3422. *
  3423. * @example
  3424. *
  3425. * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
  3426. */
  3427. createEncryptor(cipher, iv) {
  3428. return this.Encryptor.create(cipher, iv);
  3429. },
  3430. /**
  3431. * Creates this mode for decryption.
  3432. *
  3433. * @param {Cipher} cipher A block cipher instance.
  3434. * @param {Array} iv The IV words.
  3435. *
  3436. * @static
  3437. *
  3438. * @example
  3439. *
  3440. * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
  3441. */
  3442. createDecryptor(cipher, iv) {
  3443. return this.Decryptor.create(cipher, iv);
  3444. },
  3445. /**
  3446. * Initializes a newly created mode.
  3447. *
  3448. * @param {Cipher} cipher A block cipher instance.
  3449. * @param {Array} iv The IV words.
  3450. *
  3451. * @example
  3452. *
  3453. * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
  3454. */
  3455. init(cipher, iv) {
  3456. this._cipher = cipher;
  3457. this._iv = iv;
  3458. },
  3459. });
  3460. /**
  3461. * Cipher Block Chaining mode.
  3462. */
  3463. const CBC = C_mode.CBC = (function () {
  3464. /**
  3465. * Abstract base CBC mode.
  3466. */
  3467. const CBC = BlockCipherMode.extend();
  3468. /**
  3469. * CBC encryptor.
  3470. */
  3471. CBC.Encryptor = CBC.extend({
  3472. /**
  3473. * Processes the data block at offset.
  3474. *
  3475. * @param {Array} words The data words to operate on.
  3476. * @param {number} offset The offset where the block starts.
  3477. *
  3478. * @example
  3479. *
  3480. * mode.processBlock(data.words, offset);
  3481. */
  3482. processBlock(words, offset) {
  3483. // Shortcuts
  3484. const cipher = this._cipher;
  3485. const { blockSize } = cipher;
  3486. // XOR and encrypt
  3487. xorBlock.call(this, words, offset, blockSize);
  3488. cipher.encryptBlock(words, offset);
  3489. // Remember this block to use with next block
  3490. this._prevBlock = words.slice(offset, offset + blockSize);
  3491. },
  3492. });
  3493. /**
  3494. * CBC decryptor.
  3495. */
  3496. CBC.Decryptor = CBC.extend({
  3497. /**
  3498. * Processes the data block at offset.
  3499. *
  3500. * @param {Array} words The data words to operate on.
  3501. * @param {number} offset The offset where the block starts.
  3502. *
  3503. * @example
  3504. *
  3505. * mode.processBlock(data.words, offset);
  3506. */
  3507. processBlock(words, offset) {
  3508. // Shortcuts
  3509. const cipher = this._cipher;
  3510. const { blockSize } = cipher;
  3511. // Remember this block to use with next block
  3512. const thisBlock = words.slice(offset, offset + blockSize);
  3513. // Decrypt and XOR
  3514. cipher.decryptBlock(words, offset);
  3515. xorBlock.call(this, words, offset, blockSize);
  3516. // This block becomes the previous block
  3517. this._prevBlock = thisBlock;
  3518. },
  3519. });
  3520. function xorBlock(words, offset, blockSize) {
  3521. let block;
  3522. // Shortcut
  3523. const iv = this._iv;
  3524. // Choose mixing block
  3525. if (iv) {
  3526. block = iv;
  3527. // Remove IV for subsequent blocks
  3528. this._iv = undefined;
  3529. } else {
  3530. block = this._prevBlock;
  3531. }
  3532. // XOR blocks
  3533. for (let i = 0; i < blockSize; i++) {
  3534. words[offset + i] ^= block[i];
  3535. }
  3536. }
  3537. return CBC;
  3538. }());
  3539. /**
  3540. * Padding namespace.
  3541. */
  3542. const C_pad = C.pad = {};
  3543. /**
  3544. * PKCS #5/7 padding strategy.
  3545. */
  3546. const Pkcs7 = C_pad.Pkcs7 = {
  3547. /**
  3548. * Pads data using the algorithm defined in PKCS #5/7.
  3549. *
  3550. * @param {WordArray} data The data to pad.
  3551. * @param {number} blockSize The multiple that the data should be padded to.
  3552. *
  3553. * @static
  3554. *
  3555. * @example
  3556. *
  3557. * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
  3558. */
  3559. pad(data, blockSize) {
  3560. // Shortcut
  3561. const blockSizeBytes = blockSize * 4;
  3562. // Count padding bytes
  3563. const nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  3564. // Create padding word
  3565. const paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
  3566. // Create padding
  3567. const paddingWords = [];
  3568. for (let i = 0; i < nPaddingBytes; i += 4) {
  3569. paddingWords.push(paddingWord);
  3570. }
  3571. const padding = WordArray.create(paddingWords, nPaddingBytes);
  3572. // Add padding
  3573. data.concat(padding);
  3574. },
  3575. /**
  3576. * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
  3577. *
  3578. * @param {WordArray} data The data to unpad.
  3579. *
  3580. * @static
  3581. *
  3582. * @example
  3583. *
  3584. * CryptoJS.pad.Pkcs7.unpad(wordArray);
  3585. */
  3586. unpad(data) {
  3587. // Get number of padding bytes from last byte
  3588. const nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  3589. // Remove padding
  3590. data.sigBytes -= nPaddingBytes;
  3591. },
  3592. };
  3593. /**
  3594. * Abstract base block cipher template.
  3595. *
  3596. * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
  3597. */
  3598. const BlockCipher = C_lib.BlockCipher = Cipher.extend({
  3599. /**
  3600. * Configuration options.
  3601. *
  3602. * @property {Mode} mode The block mode to use. Default: CBC
  3603. * @property {Padding} padding The padding strategy to use. Default: Pkcs7
  3604. */
  3605. cfg: Cipher.cfg.extend({
  3606. mode: CBC,
  3607. padding: Pkcs7,
  3608. }),
  3609. reset() {
  3610. let modeCreator;
  3611. // Reset cipher
  3612. Cipher.reset.call(this);
  3613. // Shortcuts
  3614. const { cfg } = this;
  3615. const { iv } = cfg;
  3616. const { mode } = cfg;
  3617. // Reset block mode
  3618. if (this._xformMode == this._ENC_XFORM_MODE) {
  3619. modeCreator = mode.createEncryptor;
  3620. } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
  3621. modeCreator = mode.createDecryptor;
  3622. // Keep at least one block in the buffer for unpadding
  3623. this._minBufferSize = 1;
  3624. }
  3625. if (this._mode && this._mode.__creator == modeCreator) {
  3626. this._mode.init(this, iv && iv.words);
  3627. } else {
  3628. this._mode = modeCreator.call(mode, this, iv && iv.words);
  3629. this._mode.__creator = modeCreator;
  3630. }
  3631. },
  3632. _doProcessBlock(words, offset) {
  3633. this._mode.processBlock(words, offset);
  3634. },
  3635. _doFinalize() {
  3636. let finalProcessedBlocks;
  3637. // Shortcut
  3638. const { padding } = this.cfg;
  3639. // Finalize
  3640. if (this._xformMode == this._ENC_XFORM_MODE) {
  3641. // Pad data
  3642. padding.pad(this._data, this.blockSize);
  3643. // Process final blocks
  3644. finalProcessedBlocks = this._process(!!'flush');
  3645. } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
  3646. // Process final blocks
  3647. finalProcessedBlocks = this._process(!!'flush');
  3648. // Unpad data
  3649. padding.unpad(finalProcessedBlocks);
  3650. }
  3651. return finalProcessedBlocks;
  3652. },
  3653. blockSize: 128 / 32,
  3654. });
  3655. /**
  3656. * A collection of cipher parameters.
  3657. *
  3658. * @property {WordArray} ciphertext The raw ciphertext.
  3659. * @property {WordArray} key The key to this ciphertext.
  3660. * @property {WordArray} iv The IV used in the ciphering operation.
  3661. * @property {WordArray} salt The salt used with a key derivation function.
  3662. * @property {Cipher} algorithm The cipher algorithm.
  3663. * @property {Mode} mode The block mode used in the ciphering operation.
  3664. * @property {Padding} padding The padding scheme used in the ciphering operation.
  3665. * @property {number} blockSize The block size of the cipher.
  3666. * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
  3667. */
  3668. const CipherParams = C_lib.CipherParams = Base.extend({
  3669. /**
  3670. * Initializes a newly created cipher params object.
  3671. *
  3672. * @param {Object} cipherParams An object with any of the possible cipher parameters.
  3673. *
  3674. * @example
  3675. *
  3676. * var cipherParams = CryptoJS.lib.CipherParams.create({
  3677. * ciphertext: ciphertextWordArray,
  3678. * key: keyWordArray,
  3679. * iv: ivWordArray,
  3680. * salt: saltWordArray,
  3681. * algorithm: CryptoJS.algo.AES,
  3682. * mode: CryptoJS.mode.CBC,
  3683. * padding: CryptoJS.pad.PKCS7,
  3684. * blockSize: 4,
  3685. * formatter: CryptoJS.format.OpenSSL
  3686. * });
  3687. */
  3688. init(cipherParams) {
  3689. this.mixIn(cipherParams);
  3690. },
  3691. /**
  3692. * Converts this cipher params object to a string.
  3693. *
  3694. * @param {Format} formatter (Optional) The formatting strategy to use.
  3695. *
  3696. * @return {string} The stringified cipher params.
  3697. *
  3698. * @throws Error If neither the formatter nor the default formatter is set.
  3699. *
  3700. * @example
  3701. *
  3702. * var string = cipherParams + '';
  3703. * var string = cipherParams.toString();
  3704. * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
  3705. */
  3706. toString(formatter) {
  3707. return (formatter || this.formatter).stringify(this);
  3708. },
  3709. });
  3710. /**
  3711. * Format namespace.
  3712. */
  3713. const C_format = C.format = {};
  3714. /**
  3715. * OpenSSL formatting strategy.
  3716. */
  3717. const OpenSSLFormatter = C_format.OpenSSL = {
  3718. /**
  3719. * Converts a cipher params object to an OpenSSL-compatible string.
  3720. *
  3721. * @param {CipherParams} cipherParams The cipher params object.
  3722. *
  3723. * @return {string} The OpenSSL-compatible string.
  3724. *
  3725. * @static
  3726. *
  3727. * @example
  3728. *
  3729. * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
  3730. */
  3731. stringify(cipherParams) {
  3732. let wordArray;
  3733. // Shortcuts
  3734. const { ciphertext } = cipherParams;
  3735. const { salt } = cipherParams;
  3736. // Format
  3737. if (salt) {
  3738. wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt)
  3739. .concat(ciphertext);
  3740. } else {
  3741. wordArray = ciphertext;
  3742. }
  3743. return wordArray.toString(Base64);
  3744. },
  3745. /**
  3746. * Converts an OpenSSL-compatible string to a cipher params object.
  3747. *
  3748. * @param {string} openSSLStr The OpenSSL-compatible string.
  3749. *
  3750. * @return {CipherParams} The cipher params object.
  3751. *
  3752. * @static
  3753. *
  3754. * @example
  3755. *
  3756. * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
  3757. */
  3758. parse(openSSLStr) {
  3759. let salt;
  3760. // Parse base64
  3761. const ciphertext = Base64.parse(openSSLStr);
  3762. // Shortcut
  3763. const ciphertextWords = ciphertext.words;
  3764. // Test for salt
  3765. if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
  3766. // Extract salt
  3767. salt = WordArray.create(ciphertextWords.slice(2, 4));
  3768. // Remove salt from ciphertext
  3769. ciphertextWords.splice(0, 4);
  3770. ciphertext.sigBytes -= 16;
  3771. }
  3772. return CipherParams.create({ ciphertext, salt });
  3773. },
  3774. };
  3775. /**
  3776. * A cipher wrapper that returns ciphertext as a serializable cipher params object.
  3777. */
  3778. var SerializableCipher = C_lib.SerializableCipher = Base.extend({
  3779. /**
  3780. * Configuration options.
  3781. *
  3782. * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
  3783. */
  3784. cfg: Base.extend({
  3785. format: OpenSSLFormatter,
  3786. }),
  3787. /**
  3788. * Encrypts a message.
  3789. *
  3790. * @param {Cipher} cipher The cipher algorithm to use.
  3791. * @param {WordArray|string} message The message to encrypt.
  3792. * @param {WordArray} key The key.
  3793. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3794. *
  3795. * @return {CipherParams} A cipher params object.
  3796. *
  3797. * @static
  3798. *
  3799. * @example
  3800. *
  3801. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
  3802. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
  3803. * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3804. */
  3805. encrypt(cipher, message, key, cfg) {
  3806. // Apply config defaults
  3807. cfg = this.cfg.extend(cfg);
  3808. // Encrypt
  3809. const encryptor = cipher.createEncryptor(key, cfg);
  3810. const ciphertext = encryptor.finalize(message);
  3811. // Shortcut
  3812. const cipherCfg = encryptor.cfg;
  3813. // Create and return serializable cipher params
  3814. return CipherParams.create({
  3815. ciphertext,
  3816. key,
  3817. iv: cipherCfg.iv,
  3818. algorithm: cipher,
  3819. mode: cipherCfg.mode,
  3820. padding: cipherCfg.padding,
  3821. blockSize: cipher.blockSize,
  3822. formatter: cfg.format,
  3823. });
  3824. },
  3825. /**
  3826. * Decrypts serialized ciphertext.
  3827. *
  3828. * @param {Cipher} cipher The cipher algorithm to use.
  3829. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3830. * @param {WordArray} key The key.
  3831. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3832. *
  3833. * @return {WordArray} The plaintext.
  3834. *
  3835. * @static
  3836. *
  3837. * @example
  3838. *
  3839. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3840. * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
  3841. */
  3842. decrypt(cipher, ciphertext, key, cfg) {
  3843. // Apply config defaults
  3844. cfg = this.cfg.extend(cfg);
  3845. // Convert string to CipherParams
  3846. ciphertext = this._parse(ciphertext, cfg.format);
  3847. // Decrypt
  3848. const plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
  3849. return plaintext;
  3850. },
  3851. /**
  3852. * Converts serialized ciphertext to CipherParams,
  3853. * else assumed CipherParams already and returns ciphertext unchanged.
  3854. *
  3855. * @param {CipherParams|string} ciphertext The ciphertext.
  3856. * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
  3857. *
  3858. * @return {CipherParams} The unserialized ciphertext.
  3859. *
  3860. * @static
  3861. *
  3862. * @example
  3863. *
  3864. * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
  3865. */
  3866. _parse(ciphertext, format) {
  3867. if (typeof ciphertext === 'string') {
  3868. return format.parse(ciphertext, this);
  3869. }
  3870. return ciphertext;
  3871. },
  3872. });
  3873. /**
  3874. * Key derivation function namespace.
  3875. */
  3876. const C_kdf = C.kdf = {};
  3877. /**
  3878. * OpenSSL key derivation function.
  3879. */
  3880. const OpenSSLKdf = C_kdf.OpenSSL = {
  3881. /**
  3882. * Derives a key and IV from a password.
  3883. *
  3884. * @param {string} password The password to derive from.
  3885. * @param {number} keySize The size in words of the key to generate.
  3886. * @param {number} ivSize The size in words of the IV to generate.
  3887. * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
  3888. *
  3889. * @return {CipherParams} A cipher params object with the key, IV, and salt.
  3890. *
  3891. * @static
  3892. *
  3893. * @example
  3894. *
  3895. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
  3896. * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
  3897. */
  3898. execute(password, keySize, ivSize, salt) {
  3899. // Generate random salt
  3900. if (!salt) {
  3901. salt = WordArray.random(64 / 8);
  3902. }
  3903. // Derive key and IV
  3904. const key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
  3905. // Separate key and IV
  3906. const iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
  3907. key.sigBytes = keySize * 4;
  3908. // Return params
  3909. return CipherParams.create({ key, iv, salt });
  3910. },
  3911. };
  3912. /**
  3913. * A serializable cipher wrapper that derives the key from a password,
  3914. * and returns ciphertext as a serializable cipher params object.
  3915. */
  3916. var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
  3917. /**
  3918. * Configuration options.
  3919. *
  3920. * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
  3921. */
  3922. cfg: SerializableCipher.cfg.extend({
  3923. kdf: OpenSSLKdf,
  3924. }),
  3925. /**
  3926. * Encrypts a message using a password.
  3927. *
  3928. * @param {Cipher} cipher The cipher algorithm to use.
  3929. * @param {WordArray|string} message The message to encrypt.
  3930. * @param {string} password The password.
  3931. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3932. *
  3933. * @return {CipherParams} A cipher params object.
  3934. *
  3935. * @static
  3936. *
  3937. * @example
  3938. *
  3939. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
  3940. * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
  3941. */
  3942. encrypt(cipher, message, password, cfg) {
  3943. // Apply config defaults
  3944. cfg = this.cfg.extend(cfg);
  3945. // Derive key and other params
  3946. const derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
  3947. // Add IV to config
  3948. cfg.iv = derivedParams.iv;
  3949. // Encrypt
  3950. const ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
  3951. // Mix in derived params
  3952. ciphertext.mixIn(derivedParams);
  3953. return ciphertext;
  3954. },
  3955. /**
  3956. * Decrypts serialized ciphertext using a password.
  3957. *
  3958. * @param {Cipher} cipher The cipher algorithm to use.
  3959. * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
  3960. * @param {string} password The password.
  3961. * @param {Object} cfg (Optional) The configuration options to use for this operation.
  3962. *
  3963. * @return {WordArray} The plaintext.
  3964. *
  3965. * @static
  3966. *
  3967. * @example
  3968. *
  3969. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
  3970. * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
  3971. */
  3972. decrypt(cipher, ciphertext, password, cfg) {
  3973. // Apply config defaults
  3974. cfg = this.cfg.extend(cfg);
  3975. // Convert string to CipherParams
  3976. ciphertext = this._parse(ciphertext, cfg.format);
  3977. // Derive key and other params
  3978. const derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
  3979. // Add IV to config
  3980. cfg.iv = derivedParams.iv;
  3981. // Decrypt
  3982. const plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
  3983. return plaintext;
  3984. },
  3985. });
  3986. }());
  3987. }));
  3988. }, (modId) => {
  3989. const map = { './core': 1602206132881, './evpkdf': 1602206132896 }; return __REQUIRE__(map[modId], modId);
  3990. });
  3991. __DEFINE__(1602206132898, function (require, module, exports) {
  3992. ;(function (root, factory, undef) {
  3993. if (typeof exports === 'object') {
  3994. // CommonJS
  3995. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  3996. } else if (typeof define === 'function' && define.amd) {
  3997. // AMD
  3998. define(['./core', './cipher-core'], factory);
  3999. } else {
  4000. // Global (browser)
  4001. factory(root.CryptoJS);
  4002. }
  4003. }(this, (CryptoJS) => {
  4004. /**
  4005. * Cipher Feedback block mode.
  4006. */
  4007. CryptoJS.mode.CFB = (function () {
  4008. const CFB = CryptoJS.lib.BlockCipherMode.extend();
  4009. CFB.Encryptor = CFB.extend({
  4010. processBlock(words, offset) {
  4011. // Shortcuts
  4012. const cipher = this._cipher;
  4013. const { blockSize } = cipher;
  4014. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  4015. // Remember this block to use with next block
  4016. this._prevBlock = words.slice(offset, offset + blockSize);
  4017. },
  4018. });
  4019. CFB.Decryptor = CFB.extend({
  4020. processBlock(words, offset) {
  4021. // Shortcuts
  4022. const cipher = this._cipher;
  4023. const { blockSize } = cipher;
  4024. // Remember this block to use with next block
  4025. const thisBlock = words.slice(offset, offset + blockSize);
  4026. generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
  4027. // This block becomes the previous block
  4028. this._prevBlock = thisBlock;
  4029. },
  4030. });
  4031. function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
  4032. let keystream;
  4033. // Shortcut
  4034. const iv = this._iv;
  4035. // Generate keystream
  4036. if (iv) {
  4037. keystream = iv.slice(0);
  4038. // Remove IV for subsequent blocks
  4039. this._iv = undefined;
  4040. } else {
  4041. keystream = this._prevBlock;
  4042. }
  4043. cipher.encryptBlock(keystream, 0);
  4044. // Encrypt
  4045. for (let i = 0; i < blockSize; i++) {
  4046. words[offset + i] ^= keystream[i];
  4047. }
  4048. }
  4049. return CFB;
  4050. }());
  4051. return CryptoJS.mode.CFB;
  4052. }));
  4053. }, (modId) => {
  4054. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4055. });
  4056. __DEFINE__(1602206132899, function (require, module, exports) {
  4057. ;(function (root, factory, undef) {
  4058. if (typeof exports === 'object') {
  4059. // CommonJS
  4060. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4061. } else if (typeof define === 'function' && define.amd) {
  4062. // AMD
  4063. define(['./core', './cipher-core'], factory);
  4064. } else {
  4065. // Global (browser)
  4066. factory(root.CryptoJS);
  4067. }
  4068. }(this, (CryptoJS) => {
  4069. /**
  4070. * Counter block mode.
  4071. */
  4072. CryptoJS.mode.CTR = (function () {
  4073. const CTR = CryptoJS.lib.BlockCipherMode.extend();
  4074. const Encryptor = CTR.Encryptor = CTR.extend({
  4075. processBlock(words, offset) {
  4076. // Shortcuts
  4077. const cipher = this._cipher;
  4078. const { blockSize } = cipher;
  4079. const iv = this._iv;
  4080. let counter = this._counter;
  4081. // Generate keystream
  4082. if (iv) {
  4083. counter = this._counter = iv.slice(0);
  4084. // Remove IV for subsequent blocks
  4085. this._iv = undefined;
  4086. }
  4087. const keystream = counter.slice(0);
  4088. cipher.encryptBlock(keystream, 0);
  4089. // Increment counter
  4090. counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0;
  4091. // Encrypt
  4092. for (let i = 0; i < blockSize; i++) {
  4093. words[offset + i] ^= keystream[i];
  4094. }
  4095. },
  4096. });
  4097. CTR.Decryptor = Encryptor;
  4098. return CTR;
  4099. }());
  4100. return CryptoJS.mode.CTR;
  4101. }));
  4102. }, (modId) => {
  4103. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4104. });
  4105. __DEFINE__(1602206132900, function (require, module, exports) {
  4106. ;(function (root, factory, undef) {
  4107. if (typeof exports === 'object') {
  4108. // CommonJS
  4109. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4110. } else if (typeof define === 'function' && define.amd) {
  4111. // AMD
  4112. define(['./core', './cipher-core'], factory);
  4113. } else {
  4114. // Global (browser)
  4115. factory(root.CryptoJS);
  4116. }
  4117. }(this, (CryptoJS) => {
  4118. /** @preserve
  4119. * Counter block mode compatible with Dr Brian Gladman fileenc.c
  4120. * derived from CryptoJS.mode.CTR
  4121. * Jan Hruby jhruby.web@gmail.com
  4122. */
  4123. CryptoJS.mode.CTRGladman = (function () {
  4124. const CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
  4125. function incWord(word) {
  4126. if (((word >> 24) & 0xff) === 0xff) { // overflow
  4127. let b1 = (word >> 16) & 0xff;
  4128. let b2 = (word >> 8) & 0xff;
  4129. let b3 = word & 0xff;
  4130. if (b1 === 0xff) // overflow b1
  4131. {
  4132. b1 = 0;
  4133. if (b2 === 0xff) {
  4134. b2 = 0;
  4135. if (b3 === 0xff) {
  4136. b3 = 0;
  4137. } else {
  4138. ++b3;
  4139. }
  4140. } else {
  4141. ++b2;
  4142. }
  4143. } else {
  4144. ++b1;
  4145. }
  4146. word = 0;
  4147. word += (b1 << 16);
  4148. word += (b2 << 8);
  4149. word += b3;
  4150. } else {
  4151. word += (0x01 << 24);
  4152. }
  4153. return word;
  4154. }
  4155. function incCounter(counter) {
  4156. if ((counter[0] = incWord(counter[0])) === 0) {
  4157. // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
  4158. counter[1] = incWord(counter[1]);
  4159. }
  4160. return counter;
  4161. }
  4162. const Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
  4163. processBlock(words, offset) {
  4164. // Shortcuts
  4165. const cipher = this._cipher;
  4166. const { blockSize } = cipher;
  4167. const iv = this._iv;
  4168. let counter = this._counter;
  4169. // Generate keystream
  4170. if (iv) {
  4171. counter = this._counter = iv.slice(0);
  4172. // Remove IV for subsequent blocks
  4173. this._iv = undefined;
  4174. }
  4175. incCounter(counter);
  4176. const keystream = counter.slice(0);
  4177. cipher.encryptBlock(keystream, 0);
  4178. // Encrypt
  4179. for (let i = 0; i < blockSize; i++) {
  4180. words[offset + i] ^= keystream[i];
  4181. }
  4182. },
  4183. });
  4184. CTRGladman.Decryptor = Encryptor;
  4185. return CTRGladman;
  4186. }());
  4187. return CryptoJS.mode.CTRGladman;
  4188. }));
  4189. }, (modId) => {
  4190. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4191. });
  4192. __DEFINE__(1602206132901, function (require, module, exports) {
  4193. ;(function (root, factory, undef) {
  4194. if (typeof exports === 'object') {
  4195. // CommonJS
  4196. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4197. } else if (typeof define === 'function' && define.amd) {
  4198. // AMD
  4199. define(['./core', './cipher-core'], factory);
  4200. } else {
  4201. // Global (browser)
  4202. factory(root.CryptoJS);
  4203. }
  4204. }(this, (CryptoJS) => {
  4205. /**
  4206. * Output Feedback block mode.
  4207. */
  4208. CryptoJS.mode.OFB = (function () {
  4209. const OFB = CryptoJS.lib.BlockCipherMode.extend();
  4210. const Encryptor = OFB.Encryptor = OFB.extend({
  4211. processBlock(words, offset) {
  4212. // Shortcuts
  4213. const cipher = this._cipher;
  4214. const { blockSize } = cipher;
  4215. const iv = this._iv;
  4216. let keystream = this._keystream;
  4217. // Generate keystream
  4218. if (iv) {
  4219. keystream = this._keystream = iv.slice(0);
  4220. // Remove IV for subsequent blocks
  4221. this._iv = undefined;
  4222. }
  4223. cipher.encryptBlock(keystream, 0);
  4224. // Encrypt
  4225. for (let i = 0; i < blockSize; i++) {
  4226. words[offset + i] ^= keystream[i];
  4227. }
  4228. },
  4229. });
  4230. OFB.Decryptor = Encryptor;
  4231. return OFB;
  4232. }());
  4233. return CryptoJS.mode.OFB;
  4234. }));
  4235. }, (modId) => {
  4236. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4237. });
  4238. __DEFINE__(1602206132902, function (require, module, exports) {
  4239. ;(function (root, factory, undef) {
  4240. if (typeof exports === 'object') {
  4241. // CommonJS
  4242. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4243. } else if (typeof define === 'function' && define.amd) {
  4244. // AMD
  4245. define(['./core', './cipher-core'], factory);
  4246. } else {
  4247. // Global (browser)
  4248. factory(root.CryptoJS);
  4249. }
  4250. }(this, (CryptoJS) => {
  4251. /**
  4252. * Electronic Codebook block mode.
  4253. */
  4254. CryptoJS.mode.ECB = (function () {
  4255. const ECB = CryptoJS.lib.BlockCipherMode.extend();
  4256. ECB.Encryptor = ECB.extend({
  4257. processBlock(words, offset) {
  4258. this._cipher.encryptBlock(words, offset);
  4259. },
  4260. });
  4261. ECB.Decryptor = ECB.extend({
  4262. processBlock(words, offset) {
  4263. this._cipher.decryptBlock(words, offset);
  4264. },
  4265. });
  4266. return ECB;
  4267. }());
  4268. return CryptoJS.mode.ECB;
  4269. }));
  4270. }, (modId) => {
  4271. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4272. });
  4273. __DEFINE__(1602206132903, function (require, module, exports) {
  4274. ;(function (root, factory, undef) {
  4275. if (typeof exports === 'object') {
  4276. // CommonJS
  4277. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4278. } else if (typeof define === 'function' && define.amd) {
  4279. // AMD
  4280. define(['./core', './cipher-core'], factory);
  4281. } else {
  4282. // Global (browser)
  4283. factory(root.CryptoJS);
  4284. }
  4285. }(this, (CryptoJS) => {
  4286. /**
  4287. * ANSI X.923 padding strategy.
  4288. */
  4289. CryptoJS.pad.AnsiX923 = {
  4290. pad(data, blockSize) {
  4291. // Shortcuts
  4292. const dataSigBytes = data.sigBytes;
  4293. const blockSizeBytes = blockSize * 4;
  4294. // Count padding bytes
  4295. const nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
  4296. // Compute last byte position
  4297. const lastBytePos = dataSigBytes + nPaddingBytes - 1;
  4298. // Pad
  4299. data.clamp();
  4300. data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
  4301. data.sigBytes += nPaddingBytes;
  4302. },
  4303. unpad(data) {
  4304. // Get number of padding bytes from last byte
  4305. const nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  4306. // Remove padding
  4307. data.sigBytes -= nPaddingBytes;
  4308. },
  4309. };
  4310. return CryptoJS.pad.Ansix923;
  4311. }));
  4312. }, (modId) => {
  4313. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4314. });
  4315. __DEFINE__(1602206132904, function (require, module, exports) {
  4316. ;(function (root, factory, undef) {
  4317. if (typeof exports === 'object') {
  4318. // CommonJS
  4319. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4320. } else if (typeof define === 'function' && define.amd) {
  4321. // AMD
  4322. define(['./core', './cipher-core'], factory);
  4323. } else {
  4324. // Global (browser)
  4325. factory(root.CryptoJS);
  4326. }
  4327. }(this, (CryptoJS) => {
  4328. /**
  4329. * ISO 10126 padding strategy.
  4330. */
  4331. CryptoJS.pad.Iso10126 = {
  4332. pad(data, blockSize) {
  4333. // Shortcut
  4334. const blockSizeBytes = blockSize * 4;
  4335. // Count padding bytes
  4336. const nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
  4337. // Pad
  4338. data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
  4339. concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
  4340. },
  4341. unpad(data) {
  4342. // Get number of padding bytes from last byte
  4343. const nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
  4344. // Remove padding
  4345. data.sigBytes -= nPaddingBytes;
  4346. },
  4347. };
  4348. return CryptoJS.pad.Iso10126;
  4349. }));
  4350. }, (modId) => {
  4351. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4352. });
  4353. __DEFINE__(1602206132905, function (require, module, exports) {
  4354. ;(function (root, factory, undef) {
  4355. if (typeof exports === 'object') {
  4356. // CommonJS
  4357. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4358. } else if (typeof define === 'function' && define.amd) {
  4359. // AMD
  4360. define(['./core', './cipher-core'], factory);
  4361. } else {
  4362. // Global (browser)
  4363. factory(root.CryptoJS);
  4364. }
  4365. }(this, (CryptoJS) => {
  4366. /**
  4367. * ISO/IEC 9797-1 Padding Method 2.
  4368. */
  4369. CryptoJS.pad.Iso97971 = {
  4370. pad(data, blockSize) {
  4371. // Add 0x80 byte
  4372. data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
  4373. // Zero pad the rest
  4374. CryptoJS.pad.ZeroPadding.pad(data, blockSize);
  4375. },
  4376. unpad(data) {
  4377. // Remove zero padding
  4378. CryptoJS.pad.ZeroPadding.unpad(data);
  4379. // Remove one more byte -- the 0x80 byte
  4380. data.sigBytes--;
  4381. },
  4382. };
  4383. return CryptoJS.pad.Iso97971;
  4384. }));
  4385. }, (modId) => {
  4386. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4387. });
  4388. __DEFINE__(1602206132906, function (require, module, exports) {
  4389. ;(function (root, factory, undef) {
  4390. if (typeof exports === 'object') {
  4391. // CommonJS
  4392. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4393. } else if (typeof define === 'function' && define.amd) {
  4394. // AMD
  4395. define(['./core', './cipher-core'], factory);
  4396. } else {
  4397. // Global (browser)
  4398. factory(root.CryptoJS);
  4399. }
  4400. }(this, (CryptoJS) => {
  4401. /**
  4402. * Zero padding strategy.
  4403. */
  4404. CryptoJS.pad.ZeroPadding = {
  4405. pad(data, blockSize) {
  4406. // Shortcut
  4407. const blockSizeBytes = blockSize * 4;
  4408. // Pad
  4409. data.clamp();
  4410. data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
  4411. },
  4412. unpad(data) {
  4413. // Shortcut
  4414. const dataWords = data.words;
  4415. // Unpad
  4416. var i = data.sigBytes - 1;
  4417. for (var i = data.sigBytes - 1; i >= 0; i--) {
  4418. if (((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
  4419. data.sigBytes = i + 1;
  4420. break;
  4421. }
  4422. }
  4423. },
  4424. };
  4425. return CryptoJS.pad.ZeroPadding;
  4426. }));
  4427. }, (modId) => {
  4428. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4429. });
  4430. __DEFINE__(1602206132907, function (require, module, exports) {
  4431. ;(function (root, factory, undef) {
  4432. if (typeof exports === 'object') {
  4433. // CommonJS
  4434. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4435. } else if (typeof define === 'function' && define.amd) {
  4436. // AMD
  4437. define(['./core', './cipher-core'], factory);
  4438. } else {
  4439. // Global (browser)
  4440. factory(root.CryptoJS);
  4441. }
  4442. }(this, (CryptoJS) => {
  4443. /**
  4444. * A noop padding strategy.
  4445. */
  4446. CryptoJS.pad.NoPadding = {
  4447. pad() {
  4448. },
  4449. unpad() {
  4450. },
  4451. };
  4452. return CryptoJS.pad.NoPadding;
  4453. }));
  4454. }, (modId) => {
  4455. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4456. });
  4457. __DEFINE__(1602206132908, function (require, module, exports) {
  4458. ;(function (root, factory, undef) {
  4459. if (typeof exports === 'object') {
  4460. // CommonJS
  4461. module.exports = exports = factory(require('./core'), require('./cipher-core'));
  4462. } else if (typeof define === 'function' && define.amd) {
  4463. // AMD
  4464. define(['./core', './cipher-core'], factory);
  4465. } else {
  4466. // Global (browser)
  4467. factory(root.CryptoJS);
  4468. }
  4469. }(this, (CryptoJS) => {
  4470. (function (undefined) {
  4471. // Shortcuts
  4472. const C = CryptoJS;
  4473. const C_lib = C.lib;
  4474. const { CipherParams } = C_lib;
  4475. const C_enc = C.enc;
  4476. const { Hex } = C_enc;
  4477. const C_format = C.format;
  4478. const HexFormatter = C_format.Hex = {
  4479. /**
  4480. * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
  4481. *
  4482. * @param {CipherParams} cipherParams The cipher params object.
  4483. *
  4484. * @return {string} The hexadecimally encoded string.
  4485. *
  4486. * @static
  4487. *
  4488. * @example
  4489. *
  4490. * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
  4491. */
  4492. stringify(cipherParams) {
  4493. return cipherParams.ciphertext.toString(Hex);
  4494. },
  4495. /**
  4496. * Converts a hexadecimally encoded ciphertext string to a cipher params object.
  4497. *
  4498. * @param {string} input The hexadecimally encoded string.
  4499. *
  4500. * @return {CipherParams} The cipher params object.
  4501. *
  4502. * @static
  4503. *
  4504. * @example
  4505. *
  4506. * var cipherParams = CryptoJS.format.Hex.parse(hexString);
  4507. */
  4508. parse(input) {
  4509. const ciphertext = Hex.parse(input);
  4510. return CipherParams.create({ ciphertext });
  4511. },
  4512. };
  4513. }());
  4514. return CryptoJS.format.Hex;
  4515. }));
  4516. }, (modId) => {
  4517. const map = { './core': 1602206132881, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4518. });
  4519. __DEFINE__(1602206132909, function (require, module, exports) {
  4520. ;(function (root, factory, undef) {
  4521. if (typeof exports === 'object') {
  4522. // CommonJS
  4523. module.exports = exports = factory(require('./core'), require('./enc-base64'), require('./md5'), require('./evpkdf'), require('./cipher-core'));
  4524. } else if (typeof define === 'function' && define.amd) {
  4525. // AMD
  4526. define(['./core', './enc-base64', './md5', './evpkdf', './cipher-core'], factory);
  4527. } else {
  4528. // Global (browser)
  4529. factory(root.CryptoJS);
  4530. }
  4531. }(this, (CryptoJS) => {
  4532. (function () {
  4533. // Shortcuts
  4534. const C = CryptoJS;
  4535. const C_lib = C.lib;
  4536. const { BlockCipher } = C_lib;
  4537. const C_algo = C.algo;
  4538. // Lookup tables
  4539. const SBOX = [];
  4540. const INV_SBOX = [];
  4541. const SUB_MIX_0 = [];
  4542. const SUB_MIX_1 = [];
  4543. const SUB_MIX_2 = [];
  4544. const SUB_MIX_3 = [];
  4545. const INV_SUB_MIX_0 = [];
  4546. const INV_SUB_MIX_1 = [];
  4547. const INV_SUB_MIX_2 = [];
  4548. const INV_SUB_MIX_3 = [];
  4549. // Compute lookup tables
  4550. (function () {
  4551. // Compute double table
  4552. const d = [];
  4553. for (var i = 0; i < 256; i++) {
  4554. if (i < 128) {
  4555. d[i] = i << 1;
  4556. } else {
  4557. d[i] = (i << 1) ^ 0x11b;
  4558. }
  4559. }
  4560. // Walk GF(2^8)
  4561. let x = 0;
  4562. let xi = 0;
  4563. for (var i = 0; i < 256; i++) {
  4564. // Compute sbox
  4565. let sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
  4566. sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
  4567. SBOX[x] = sx;
  4568. INV_SBOX[sx] = x;
  4569. // Compute multiplication
  4570. const x2 = d[x];
  4571. const x4 = d[x2];
  4572. const x8 = d[x4];
  4573. // Compute sub bytes, mix columns tables
  4574. var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
  4575. SUB_MIX_0[x] = (t << 24) | (t >>> 8);
  4576. SUB_MIX_1[x] = (t << 16) | (t >>> 16);
  4577. SUB_MIX_2[x] = (t << 8) | (t >>> 24);
  4578. SUB_MIX_3[x] = t;
  4579. // Compute inv sub bytes, inv mix columns tables
  4580. var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
  4581. INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
  4582. INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
  4583. INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
  4584. INV_SUB_MIX_3[sx] = t;
  4585. // Compute next counter
  4586. if (!x) {
  4587. x = xi = 1;
  4588. } else {
  4589. x = x2 ^ d[d[d[x8 ^ x2]]];
  4590. xi ^= d[d[xi]];
  4591. }
  4592. }
  4593. }());
  4594. // Precomputed Rcon lookup
  4595. const RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
  4596. /**
  4597. * AES block cipher algorithm.
  4598. */
  4599. const AES = C_algo.AES = BlockCipher.extend({
  4600. _doReset() {
  4601. var t;
  4602. // Skip reset of nRounds has been set before and key did not change
  4603. if (this._nRounds && this._keyPriorReset === this._key) {
  4604. return;
  4605. }
  4606. // Shortcuts
  4607. const key = this._keyPriorReset = this._key;
  4608. const keyWords = key.words;
  4609. const keySize = key.sigBytes / 4;
  4610. // Compute number of rounds
  4611. const nRounds = this._nRounds = keySize + 6;
  4612. // Compute number of key schedule rows
  4613. const ksRows = (nRounds + 1) * 4;
  4614. // Compute key schedule
  4615. const keySchedule = this._keySchedule = [];
  4616. for (var ksRow = 0; ksRow < ksRows; ksRow++) {
  4617. if (ksRow < keySize) {
  4618. keySchedule[ksRow] = keyWords[ksRow];
  4619. } else {
  4620. t = keySchedule[ksRow - 1];
  4621. if (!(ksRow % keySize)) {
  4622. // Rot word
  4623. t = (t << 8) | (t >>> 24);
  4624. // Sub word
  4625. t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
  4626. // Mix Rcon
  4627. t ^= RCON[(ksRow / keySize) | 0] << 24;
  4628. } else if (keySize > 6 && ksRow % keySize == 4) {
  4629. // Sub word
  4630. t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
  4631. }
  4632. keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
  4633. }
  4634. }
  4635. // Compute inv key schedule
  4636. const invKeySchedule = this._invKeySchedule = [];
  4637. for (let invKsRow = 0; invKsRow < ksRows; invKsRow++) {
  4638. var ksRow = ksRows - invKsRow;
  4639. if (invKsRow % 4) {
  4640. var t = keySchedule[ksRow];
  4641. } else {
  4642. var t = keySchedule[ksRow - 4];
  4643. }
  4644. if (invKsRow < 4 || ksRow <= 4) {
  4645. invKeySchedule[invKsRow] = t;
  4646. } else {
  4647. invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]]
  4648. ^ INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
  4649. }
  4650. }
  4651. },
  4652. encryptBlock(M, offset) {
  4653. this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
  4654. },
  4655. decryptBlock(M, offset) {
  4656. // Swap 2nd and 4th rows
  4657. var t = M[offset + 1];
  4658. M[offset + 1] = M[offset + 3];
  4659. M[offset + 3] = t;
  4660. this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
  4661. // Inv swap 2nd and 4th rows
  4662. var t = M[offset + 1];
  4663. M[offset + 1] = M[offset + 3];
  4664. M[offset + 3] = t;
  4665. },
  4666. _doCryptBlock(M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
  4667. // Shortcut
  4668. const nRounds = this._nRounds;
  4669. // Get input, add round key
  4670. let s0 = M[offset] ^ keySchedule[0];
  4671. let s1 = M[offset + 1] ^ keySchedule[1];
  4672. let s2 = M[offset + 2] ^ keySchedule[2];
  4673. let s3 = M[offset + 3] ^ keySchedule[3];
  4674. // Key schedule row counter
  4675. let ksRow = 4;
  4676. // Rounds
  4677. for (let round = 1; round < nRounds; round++) {
  4678. // Shift rows, sub bytes, mix columns, add round key
  4679. var t0 = SUB_MIX_0[s0 >>> 24] ^ SUB_MIX_1[(s1 >>> 16) & 0xff] ^ SUB_MIX_2[(s2 >>> 8) & 0xff] ^ SUB_MIX_3[s3 & 0xff] ^ keySchedule[ksRow++];
  4680. var t1 = SUB_MIX_0[s1 >>> 24] ^ SUB_MIX_1[(s2 >>> 16) & 0xff] ^ SUB_MIX_2[(s3 >>> 8) & 0xff] ^ SUB_MIX_3[s0 & 0xff] ^ keySchedule[ksRow++];
  4681. var t2 = SUB_MIX_0[s2 >>> 24] ^ SUB_MIX_1[(s3 >>> 16) & 0xff] ^ SUB_MIX_2[(s0 >>> 8) & 0xff] ^ SUB_MIX_3[s1 & 0xff] ^ keySchedule[ksRow++];
  4682. var t3 = SUB_MIX_0[s3 >>> 24] ^ SUB_MIX_1[(s0 >>> 16) & 0xff] ^ SUB_MIX_2[(s1 >>> 8) & 0xff] ^ SUB_MIX_3[s2 & 0xff] ^ keySchedule[ksRow++];
  4683. // Update state
  4684. s0 = t0;
  4685. s1 = t1;
  4686. s2 = t2;
  4687. s3 = t3;
  4688. }
  4689. // Shift rows, sub bytes, add round key
  4690. var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
  4691. var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
  4692. var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
  4693. var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
  4694. // Set output
  4695. M[offset] = t0;
  4696. M[offset + 1] = t1;
  4697. M[offset + 2] = t2;
  4698. M[offset + 3] = t3;
  4699. },
  4700. keySize: 256 / 32,
  4701. });
  4702. /**
  4703. * Shortcut functions to the cipher's object interface.
  4704. *
  4705. * @example
  4706. *
  4707. * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
  4708. * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
  4709. */
  4710. C.AES = BlockCipher._createHelper(AES);
  4711. }());
  4712. return CryptoJS.AES;
  4713. }));
  4714. }, (modId) => {
  4715. const map = { './core': 1602206132881, './enc-base64': 1602206132885, './md5': 1602206132886, './evpkdf': 1602206132896, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  4716. });
  4717. __DEFINE__(1602206132910, function (require, module, exports) {
  4718. ;(function (root, factory, undef) {
  4719. if (typeof exports === 'object') {
  4720. // CommonJS
  4721. module.exports = exports = factory(require('./core'), require('./enc-base64'), require('./md5'), require('./evpkdf'), require('./cipher-core'));
  4722. } else if (typeof define === 'function' && define.amd) {
  4723. // AMD
  4724. define(['./core', './enc-base64', './md5', './evpkdf', './cipher-core'], factory);
  4725. } else {
  4726. // Global (browser)
  4727. factory(root.CryptoJS);
  4728. }
  4729. }(this, (CryptoJS) => {
  4730. (function () {
  4731. // Shortcuts
  4732. const C = CryptoJS;
  4733. const C_lib = C.lib;
  4734. const { WordArray } = C_lib;
  4735. const { BlockCipher } = C_lib;
  4736. const C_algo = C.algo;
  4737. // Permuted Choice 1 constants
  4738. const PC1 = [
  4739. 57, 49, 41, 33, 25, 17, 9, 1,
  4740. 58, 50, 42, 34, 26, 18, 10, 2,
  4741. 59, 51, 43, 35, 27, 19, 11, 3,
  4742. 60, 52, 44, 36, 63, 55, 47, 39,
  4743. 31, 23, 15, 7, 62, 54, 46, 38,
  4744. 30, 22, 14, 6, 61, 53, 45, 37,
  4745. 29, 21, 13, 5, 28, 20, 12, 4,
  4746. ];
  4747. // Permuted Choice 2 constants
  4748. const PC2 = [
  4749. 14, 17, 11, 24, 1, 5,
  4750. 3, 28, 15, 6, 21, 10,
  4751. 23, 19, 12, 4, 26, 8,
  4752. 16, 7, 27, 20, 13, 2,
  4753. 41, 52, 31, 37, 47, 55,
  4754. 30, 40, 51, 45, 33, 48,
  4755. 44, 49, 39, 56, 34, 53,
  4756. 46, 42, 50, 36, 29, 32,
  4757. ];
  4758. // Cumulative bit shift constants
  4759. const BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
  4760. // SBOXes and round permutation constants
  4761. const SBOX_P = [
  4762. {
  4763. 0x0: 0x808200,
  4764. 0x10000000: 0x8000,
  4765. 0x20000000: 0x808002,
  4766. 0x30000000: 0x2,
  4767. 0x40000000: 0x200,
  4768. 0x50000000: 0x808202,
  4769. 0x60000000: 0x800202,
  4770. 0x70000000: 0x800000,
  4771. 0x80000000: 0x202,
  4772. 0x90000000: 0x800200,
  4773. 0xa0000000: 0x8200,
  4774. 0xb0000000: 0x808000,
  4775. 0xc0000000: 0x8002,
  4776. 0xd0000000: 0x800002,
  4777. 0xe0000000: 0x0,
  4778. 0xf0000000: 0x8202,
  4779. 0x8000000: 0x0,
  4780. 0x18000000: 0x808202,
  4781. 0x28000000: 0x8202,
  4782. 0x38000000: 0x8000,
  4783. 0x48000000: 0x808200,
  4784. 0x58000000: 0x200,
  4785. 0x68000000: 0x808002,
  4786. 0x78000000: 0x2,
  4787. 0x88000000: 0x800200,
  4788. 0x98000000: 0x8200,
  4789. 0xa8000000: 0x808000,
  4790. 0xb8000000: 0x800202,
  4791. 0xc8000000: 0x800002,
  4792. 0xd8000000: 0x8002,
  4793. 0xe8000000: 0x202,
  4794. 0xf8000000: 0x800000,
  4795. 0x1: 0x8000,
  4796. 0x10000001: 0x2,
  4797. 0x20000001: 0x808200,
  4798. 0x30000001: 0x800000,
  4799. 0x40000001: 0x808002,
  4800. 0x50000001: 0x8200,
  4801. 0x60000001: 0x200,
  4802. 0x70000001: 0x800202,
  4803. 0x80000001: 0x808202,
  4804. 0x90000001: 0x808000,
  4805. 0xa0000001: 0x800002,
  4806. 0xb0000001: 0x8202,
  4807. 0xc0000001: 0x202,
  4808. 0xd0000001: 0x800200,
  4809. 0xe0000001: 0x8002,
  4810. 0xf0000001: 0x0,
  4811. 0x8000001: 0x808202,
  4812. 0x18000001: 0x808000,
  4813. 0x28000001: 0x800000,
  4814. 0x38000001: 0x200,
  4815. 0x48000001: 0x8000,
  4816. 0x58000001: 0x800002,
  4817. 0x68000001: 0x2,
  4818. 0x78000001: 0x8202,
  4819. 0x88000001: 0x8002,
  4820. 0x98000001: 0x800202,
  4821. 0xa8000001: 0x202,
  4822. 0xb8000001: 0x808200,
  4823. 0xc8000001: 0x800200,
  4824. 0xd8000001: 0x0,
  4825. 0xe8000001: 0x8200,
  4826. 0xf8000001: 0x808002,
  4827. },
  4828. {
  4829. 0x0: 0x40084010,
  4830. 0x1000000: 0x4000,
  4831. 0x2000000: 0x80000,
  4832. 0x3000000: 0x40080010,
  4833. 0x4000000: 0x40000010,
  4834. 0x5000000: 0x40084000,
  4835. 0x6000000: 0x40004000,
  4836. 0x7000000: 0x10,
  4837. 0x8000000: 0x84000,
  4838. 0x9000000: 0x40004010,
  4839. 0xa000000: 0x40000000,
  4840. 0xb000000: 0x84010,
  4841. 0xc000000: 0x80010,
  4842. 0xd000000: 0x0,
  4843. 0xe000000: 0x4010,
  4844. 0xf000000: 0x40080000,
  4845. 0x800000: 0x40004000,
  4846. 0x1800000: 0x84010,
  4847. 0x2800000: 0x10,
  4848. 0x3800000: 0x40004010,
  4849. 0x4800000: 0x40084010,
  4850. 0x5800000: 0x40000000,
  4851. 0x6800000: 0x80000,
  4852. 0x7800000: 0x40080010,
  4853. 0x8800000: 0x80010,
  4854. 0x9800000: 0x0,
  4855. 0xa800000: 0x4000,
  4856. 0xb800000: 0x40080000,
  4857. 0xc800000: 0x40000010,
  4858. 0xd800000: 0x84000,
  4859. 0xe800000: 0x40084000,
  4860. 0xf800000: 0x4010,
  4861. 0x10000000: 0x0,
  4862. 0x11000000: 0x40080010,
  4863. 0x12000000: 0x40004010,
  4864. 0x13000000: 0x40084000,
  4865. 0x14000000: 0x40080000,
  4866. 0x15000000: 0x10,
  4867. 0x16000000: 0x84010,
  4868. 0x17000000: 0x4000,
  4869. 0x18000000: 0x4010,
  4870. 0x19000000: 0x80000,
  4871. 0x1a000000: 0x80010,
  4872. 0x1b000000: 0x40000010,
  4873. 0x1c000000: 0x84000,
  4874. 0x1d000000: 0x40004000,
  4875. 0x1e000000: 0x40000000,
  4876. 0x1f000000: 0x40084010,
  4877. 0x10800000: 0x84010,
  4878. 0x11800000: 0x80000,
  4879. 0x12800000: 0x40080000,
  4880. 0x13800000: 0x4000,
  4881. 0x14800000: 0x40004000,
  4882. 0x15800000: 0x40084010,
  4883. 0x16800000: 0x10,
  4884. 0x17800000: 0x40000000,
  4885. 0x18800000: 0x40084000,
  4886. 0x19800000: 0x40000010,
  4887. 0x1a800000: 0x40004010,
  4888. 0x1b800000: 0x80010,
  4889. 0x1c800000: 0x0,
  4890. 0x1d800000: 0x4010,
  4891. 0x1e800000: 0x40080010,
  4892. 0x1f800000: 0x84000,
  4893. },
  4894. {
  4895. 0x0: 0x104,
  4896. 0x100000: 0x0,
  4897. 0x200000: 0x4000100,
  4898. 0x300000: 0x10104,
  4899. 0x400000: 0x10004,
  4900. 0x500000: 0x4000004,
  4901. 0x600000: 0x4010104,
  4902. 0x700000: 0x4010000,
  4903. 0x800000: 0x4000000,
  4904. 0x900000: 0x4010100,
  4905. 0xa00000: 0x10100,
  4906. 0xb00000: 0x4010004,
  4907. 0xc00000: 0x4000104,
  4908. 0xd00000: 0x10000,
  4909. 0xe00000: 0x4,
  4910. 0xf00000: 0x100,
  4911. 0x80000: 0x4010100,
  4912. 0x180000: 0x4010004,
  4913. 0x280000: 0x0,
  4914. 0x380000: 0x4000100,
  4915. 0x480000: 0x4000004,
  4916. 0x580000: 0x10000,
  4917. 0x680000: 0x10004,
  4918. 0x780000: 0x104,
  4919. 0x880000: 0x4,
  4920. 0x980000: 0x100,
  4921. 0xa80000: 0x4010000,
  4922. 0xb80000: 0x10104,
  4923. 0xc80000: 0x10100,
  4924. 0xd80000: 0x4000104,
  4925. 0xe80000: 0x4010104,
  4926. 0xf80000: 0x4000000,
  4927. 0x1000000: 0x4010100,
  4928. 0x1100000: 0x10004,
  4929. 0x1200000: 0x10000,
  4930. 0x1300000: 0x4000100,
  4931. 0x1400000: 0x100,
  4932. 0x1500000: 0x4010104,
  4933. 0x1600000: 0x4000004,
  4934. 0x1700000: 0x0,
  4935. 0x1800000: 0x4000104,
  4936. 0x1900000: 0x4000000,
  4937. 0x1a00000: 0x4,
  4938. 0x1b00000: 0x10100,
  4939. 0x1c00000: 0x4010000,
  4940. 0x1d00000: 0x104,
  4941. 0x1e00000: 0x10104,
  4942. 0x1f00000: 0x4010004,
  4943. 0x1080000: 0x4000000,
  4944. 0x1180000: 0x104,
  4945. 0x1280000: 0x4010100,
  4946. 0x1380000: 0x0,
  4947. 0x1480000: 0x10004,
  4948. 0x1580000: 0x4000100,
  4949. 0x1680000: 0x100,
  4950. 0x1780000: 0x4010004,
  4951. 0x1880000: 0x10000,
  4952. 0x1980000: 0x4010104,
  4953. 0x1a80000: 0x10104,
  4954. 0x1b80000: 0x4000004,
  4955. 0x1c80000: 0x4000104,
  4956. 0x1d80000: 0x4010000,
  4957. 0x1e80000: 0x4,
  4958. 0x1f80000: 0x10100,
  4959. },
  4960. {
  4961. 0x0: 0x80401000,
  4962. 0x10000: 0x80001040,
  4963. 0x20000: 0x401040,
  4964. 0x30000: 0x80400000,
  4965. 0x40000: 0x0,
  4966. 0x50000: 0x401000,
  4967. 0x60000: 0x80000040,
  4968. 0x70000: 0x400040,
  4969. 0x80000: 0x80000000,
  4970. 0x90000: 0x400000,
  4971. 0xa0000: 0x40,
  4972. 0xb0000: 0x80001000,
  4973. 0xc0000: 0x80400040,
  4974. 0xd0000: 0x1040,
  4975. 0xe0000: 0x1000,
  4976. 0xf0000: 0x80401040,
  4977. 0x8000: 0x80001040,
  4978. 0x18000: 0x40,
  4979. 0x28000: 0x80400040,
  4980. 0x38000: 0x80001000,
  4981. 0x48000: 0x401000,
  4982. 0x58000: 0x80401040,
  4983. 0x68000: 0x0,
  4984. 0x78000: 0x80400000,
  4985. 0x88000: 0x1000,
  4986. 0x98000: 0x80401000,
  4987. 0xa8000: 0x400000,
  4988. 0xb8000: 0x1040,
  4989. 0xc8000: 0x80000000,
  4990. 0xd8000: 0x400040,
  4991. 0xe8000: 0x401040,
  4992. 0xf8000: 0x80000040,
  4993. 0x100000: 0x400040,
  4994. 0x110000: 0x401000,
  4995. 0x120000: 0x80000040,
  4996. 0x130000: 0x0,
  4997. 0x140000: 0x1040,
  4998. 0x150000: 0x80400040,
  4999. 0x160000: 0x80401000,
  5000. 0x170000: 0x80001040,
  5001. 0x180000: 0x80401040,
  5002. 0x190000: 0x80000000,
  5003. 0x1a0000: 0x80400000,
  5004. 0x1b0000: 0x401040,
  5005. 0x1c0000: 0x80001000,
  5006. 0x1d0000: 0x400000,
  5007. 0x1e0000: 0x40,
  5008. 0x1f0000: 0x1000,
  5009. 0x108000: 0x80400000,
  5010. 0x118000: 0x80401040,
  5011. 0x128000: 0x0,
  5012. 0x138000: 0x401000,
  5013. 0x148000: 0x400040,
  5014. 0x158000: 0x80000000,
  5015. 0x168000: 0x80001040,
  5016. 0x178000: 0x40,
  5017. 0x188000: 0x80000040,
  5018. 0x198000: 0x1000,
  5019. 0x1a8000: 0x80001000,
  5020. 0x1b8000: 0x80400040,
  5021. 0x1c8000: 0x1040,
  5022. 0x1d8000: 0x80401000,
  5023. 0x1e8000: 0x400000,
  5024. 0x1f8000: 0x401040,
  5025. },
  5026. {
  5027. 0x0: 0x80,
  5028. 0x1000: 0x1040000,
  5029. 0x2000: 0x40000,
  5030. 0x3000: 0x20000000,
  5031. 0x4000: 0x20040080,
  5032. 0x5000: 0x1000080,
  5033. 0x6000: 0x21000080,
  5034. 0x7000: 0x40080,
  5035. 0x8000: 0x1000000,
  5036. 0x9000: 0x20040000,
  5037. 0xa000: 0x20000080,
  5038. 0xb000: 0x21040080,
  5039. 0xc000: 0x21040000,
  5040. 0xd000: 0x0,
  5041. 0xe000: 0x1040080,
  5042. 0xf000: 0x21000000,
  5043. 0x800: 0x1040080,
  5044. 0x1800: 0x21000080,
  5045. 0x2800: 0x80,
  5046. 0x3800: 0x1040000,
  5047. 0x4800: 0x40000,
  5048. 0x5800: 0x20040080,
  5049. 0x6800: 0x21040000,
  5050. 0x7800: 0x20000000,
  5051. 0x8800: 0x20040000,
  5052. 0x9800: 0x0,
  5053. 0xa800: 0x21040080,
  5054. 0xb800: 0x1000080,
  5055. 0xc800: 0x20000080,
  5056. 0xd800: 0x21000000,
  5057. 0xe800: 0x1000000,
  5058. 0xf800: 0x40080,
  5059. 0x10000: 0x40000,
  5060. 0x11000: 0x80,
  5061. 0x12000: 0x20000000,
  5062. 0x13000: 0x21000080,
  5063. 0x14000: 0x1000080,
  5064. 0x15000: 0x21040000,
  5065. 0x16000: 0x20040080,
  5066. 0x17000: 0x1000000,
  5067. 0x18000: 0x21040080,
  5068. 0x19000: 0x21000000,
  5069. 0x1a000: 0x1040000,
  5070. 0x1b000: 0x20040000,
  5071. 0x1c000: 0x40080,
  5072. 0x1d000: 0x20000080,
  5073. 0x1e000: 0x0,
  5074. 0x1f000: 0x1040080,
  5075. 0x10800: 0x21000080,
  5076. 0x11800: 0x1000000,
  5077. 0x12800: 0x1040000,
  5078. 0x13800: 0x20040080,
  5079. 0x14800: 0x20000000,
  5080. 0x15800: 0x1040080,
  5081. 0x16800: 0x80,
  5082. 0x17800: 0x21040000,
  5083. 0x18800: 0x40080,
  5084. 0x19800: 0x21040080,
  5085. 0x1a800: 0x0,
  5086. 0x1b800: 0x21000000,
  5087. 0x1c800: 0x1000080,
  5088. 0x1d800: 0x40000,
  5089. 0x1e800: 0x20040000,
  5090. 0x1f800: 0x20000080,
  5091. },
  5092. {
  5093. 0x0: 0x10000008,
  5094. 0x100: 0x2000,
  5095. 0x200: 0x10200000,
  5096. 0x300: 0x10202008,
  5097. 0x400: 0x10002000,
  5098. 0x500: 0x200000,
  5099. 0x600: 0x200008,
  5100. 0x700: 0x10000000,
  5101. 0x800: 0x0,
  5102. 0x900: 0x10002008,
  5103. 0xa00: 0x202000,
  5104. 0xb00: 0x8,
  5105. 0xc00: 0x10200008,
  5106. 0xd00: 0x202008,
  5107. 0xe00: 0x2008,
  5108. 0xf00: 0x10202000,
  5109. 0x80: 0x10200000,
  5110. 0x180: 0x10202008,
  5111. 0x280: 0x8,
  5112. 0x380: 0x200000,
  5113. 0x480: 0x202008,
  5114. 0x580: 0x10000008,
  5115. 0x680: 0x10002000,
  5116. 0x780: 0x2008,
  5117. 0x880: 0x200008,
  5118. 0x980: 0x2000,
  5119. 0xa80: 0x10002008,
  5120. 0xb80: 0x10200008,
  5121. 0xc80: 0x0,
  5122. 0xd80: 0x10202000,
  5123. 0xe80: 0x202000,
  5124. 0xf80: 0x10000000,
  5125. 0x1000: 0x10002000,
  5126. 0x1100: 0x10200008,
  5127. 0x1200: 0x10202008,
  5128. 0x1300: 0x2008,
  5129. 0x1400: 0x200000,
  5130. 0x1500: 0x10000000,
  5131. 0x1600: 0x10000008,
  5132. 0x1700: 0x202000,
  5133. 0x1800: 0x202008,
  5134. 0x1900: 0x0,
  5135. 0x1a00: 0x8,
  5136. 0x1b00: 0x10200000,
  5137. 0x1c00: 0x2000,
  5138. 0x1d00: 0x10002008,
  5139. 0x1e00: 0x10202000,
  5140. 0x1f00: 0x200008,
  5141. 0x1080: 0x8,
  5142. 0x1180: 0x202000,
  5143. 0x1280: 0x200000,
  5144. 0x1380: 0x10000008,
  5145. 0x1480: 0x10002000,
  5146. 0x1580: 0x2008,
  5147. 0x1680: 0x10202008,
  5148. 0x1780: 0x10200000,
  5149. 0x1880: 0x10202000,
  5150. 0x1980: 0x10200008,
  5151. 0x1a80: 0x2000,
  5152. 0x1b80: 0x202008,
  5153. 0x1c80: 0x200008,
  5154. 0x1d80: 0x0,
  5155. 0x1e80: 0x10000000,
  5156. 0x1f80: 0x10002008,
  5157. },
  5158. {
  5159. 0x0: 0x100000,
  5160. 0x10: 0x2000401,
  5161. 0x20: 0x400,
  5162. 0x30: 0x100401,
  5163. 0x40: 0x2100401,
  5164. 0x50: 0x0,
  5165. 0x60: 0x1,
  5166. 0x70: 0x2100001,
  5167. 0x80: 0x2000400,
  5168. 0x90: 0x100001,
  5169. 0xa0: 0x2000001,
  5170. 0xb0: 0x2100400,
  5171. 0xc0: 0x2100000,
  5172. 0xd0: 0x401,
  5173. 0xe0: 0x100400,
  5174. 0xf0: 0x2000000,
  5175. 0x8: 0x2100001,
  5176. 0x18: 0x0,
  5177. 0x28: 0x2000401,
  5178. 0x38: 0x2100400,
  5179. 0x48: 0x100000,
  5180. 0x58: 0x2000001,
  5181. 0x68: 0x2000000,
  5182. 0x78: 0x401,
  5183. 0x88: 0x100401,
  5184. 0x98: 0x2000400,
  5185. 0xa8: 0x2100000,
  5186. 0xb8: 0x100001,
  5187. 0xc8: 0x400,
  5188. 0xd8: 0x2100401,
  5189. 0xe8: 0x1,
  5190. 0xf8: 0x100400,
  5191. 0x100: 0x2000000,
  5192. 0x110: 0x100000,
  5193. 0x120: 0x2000401,
  5194. 0x130: 0x2100001,
  5195. 0x140: 0x100001,
  5196. 0x150: 0x2000400,
  5197. 0x160: 0x2100400,
  5198. 0x170: 0x100401,
  5199. 0x180: 0x401,
  5200. 0x190: 0x2100401,
  5201. 0x1a0: 0x100400,
  5202. 0x1b0: 0x1,
  5203. 0x1c0: 0x0,
  5204. 0x1d0: 0x2100000,
  5205. 0x1e0: 0x2000001,
  5206. 0x1f0: 0x400,
  5207. 0x108: 0x100400,
  5208. 0x118: 0x2000401,
  5209. 0x128: 0x2100001,
  5210. 0x138: 0x1,
  5211. 0x148: 0x2000000,
  5212. 0x158: 0x100000,
  5213. 0x168: 0x401,
  5214. 0x178: 0x2100400,
  5215. 0x188: 0x2000001,
  5216. 0x198: 0x2100000,
  5217. 0x1a8: 0x0,
  5218. 0x1b8: 0x2100401,
  5219. 0x1c8: 0x100401,
  5220. 0x1d8: 0x400,
  5221. 0x1e8: 0x2000400,
  5222. 0x1f8: 0x100001,
  5223. },
  5224. {
  5225. 0x0: 0x8000820,
  5226. 0x1: 0x20000,
  5227. 0x2: 0x8000000,
  5228. 0x3: 0x20,
  5229. 0x4: 0x20020,
  5230. 0x5: 0x8020820,
  5231. 0x6: 0x8020800,
  5232. 0x7: 0x800,
  5233. 0x8: 0x8020000,
  5234. 0x9: 0x8000800,
  5235. 0xa: 0x20800,
  5236. 0xb: 0x8020020,
  5237. 0xc: 0x820,
  5238. 0xd: 0x0,
  5239. 0xe: 0x8000020,
  5240. 0xf: 0x20820,
  5241. 0x80000000: 0x800,
  5242. 0x80000001: 0x8020820,
  5243. 0x80000002: 0x8000820,
  5244. 0x80000003: 0x8000000,
  5245. 0x80000004: 0x8020000,
  5246. 0x80000005: 0x20800,
  5247. 0x80000006: 0x20820,
  5248. 0x80000007: 0x20,
  5249. 0x80000008: 0x8000020,
  5250. 0x80000009: 0x820,
  5251. 0x8000000a: 0x20020,
  5252. 0x8000000b: 0x8020800,
  5253. 0x8000000c: 0x0,
  5254. 0x8000000d: 0x8020020,
  5255. 0x8000000e: 0x8000800,
  5256. 0x8000000f: 0x20000,
  5257. 0x10: 0x20820,
  5258. 0x11: 0x8020800,
  5259. 0x12: 0x20,
  5260. 0x13: 0x800,
  5261. 0x14: 0x8000800,
  5262. 0x15: 0x8000020,
  5263. 0x16: 0x8020020,
  5264. 0x17: 0x20000,
  5265. 0x18: 0x0,
  5266. 0x19: 0x20020,
  5267. 0x1a: 0x8020000,
  5268. 0x1b: 0x8000820,
  5269. 0x1c: 0x8020820,
  5270. 0x1d: 0x20800,
  5271. 0x1e: 0x820,
  5272. 0x1f: 0x8000000,
  5273. 0x80000010: 0x20000,
  5274. 0x80000011: 0x800,
  5275. 0x80000012: 0x8020020,
  5276. 0x80000013: 0x20820,
  5277. 0x80000014: 0x20,
  5278. 0x80000015: 0x8020000,
  5279. 0x80000016: 0x8000000,
  5280. 0x80000017: 0x8000820,
  5281. 0x80000018: 0x8020820,
  5282. 0x80000019: 0x8000020,
  5283. 0x8000001a: 0x8000800,
  5284. 0x8000001b: 0x0,
  5285. 0x8000001c: 0x20800,
  5286. 0x8000001d: 0x820,
  5287. 0x8000001e: 0x20020,
  5288. 0x8000001f: 0x8020800,
  5289. },
  5290. ];
  5291. // Masks that select the SBOX input
  5292. const SBOX_MASK = [
  5293. 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
  5294. 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f,
  5295. ];
  5296. /**
  5297. * DES block cipher algorithm.
  5298. */
  5299. const DES = C_algo.DES = BlockCipher.extend({
  5300. _doReset() {
  5301. // Shortcuts
  5302. const key = this._key;
  5303. const keyWords = key.words;
  5304. // Select 56 bits according to PC1
  5305. const keyBits = [];
  5306. for (var i = 0; i < 56; i++) {
  5307. const keyBitPos = PC1[i] - 1;
  5308. keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
  5309. }
  5310. // Assemble 16 subkeys
  5311. const subKeys = this._subKeys = [];
  5312. for (let nSubKey = 0; nSubKey < 16; nSubKey++) {
  5313. // Create subkey
  5314. const subKey = subKeys[nSubKey] = [];
  5315. // Shortcut
  5316. const bitShift = BIT_SHIFTS[nSubKey];
  5317. // Select 48 bits according to PC2
  5318. for (var i = 0; i < 24; i++) {
  5319. // Select from the left 28 key bits
  5320. subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
  5321. // Select from the right 28 key bits
  5322. subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
  5323. }
  5324. // Since each subkey is applied to an expanded 32-bit input,
  5325. // the subkey can be broken into 8 values scaled to 32-bits,
  5326. // which allows the key to be used without expansion
  5327. subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
  5328. for (var i = 1; i < 7; i++) {
  5329. subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
  5330. }
  5331. subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
  5332. }
  5333. // Compute inverse subkeys
  5334. const invSubKeys = this._invSubKeys = [];
  5335. for (var i = 0; i < 16; i++) {
  5336. invSubKeys[i] = subKeys[15 - i];
  5337. }
  5338. },
  5339. encryptBlock(M, offset) {
  5340. this._doCryptBlock(M, offset, this._subKeys);
  5341. },
  5342. decryptBlock(M, offset) {
  5343. this._doCryptBlock(M, offset, this._invSubKeys);
  5344. },
  5345. _doCryptBlock(M, offset, subKeys) {
  5346. // Get input
  5347. this._lBlock = M[offset];
  5348. this._rBlock = M[offset + 1];
  5349. // Initial permutation
  5350. exchangeLR.call(this, 4, 0x0f0f0f0f);
  5351. exchangeLR.call(this, 16, 0x0000ffff);
  5352. exchangeRL.call(this, 2, 0x33333333);
  5353. exchangeRL.call(this, 8, 0x00ff00ff);
  5354. exchangeLR.call(this, 1, 0x55555555);
  5355. // Rounds
  5356. for (let round = 0; round < 16; round++) {
  5357. // Shortcuts
  5358. const subKey = subKeys[round];
  5359. const lBlock = this._lBlock;
  5360. const rBlock = this._rBlock;
  5361. // Feistel function
  5362. let f = 0;
  5363. for (let i = 0; i < 8; i++) {
  5364. f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
  5365. }
  5366. this._lBlock = rBlock;
  5367. this._rBlock = lBlock ^ f;
  5368. }
  5369. // Undo swap from last round
  5370. const t = this._lBlock;
  5371. this._lBlock = this._rBlock;
  5372. this._rBlock = t;
  5373. // Final permutation
  5374. exchangeLR.call(this, 1, 0x55555555);
  5375. exchangeRL.call(this, 8, 0x00ff00ff);
  5376. exchangeRL.call(this, 2, 0x33333333);
  5377. exchangeLR.call(this, 16, 0x0000ffff);
  5378. exchangeLR.call(this, 4, 0x0f0f0f0f);
  5379. // Set output
  5380. M[offset] = this._lBlock;
  5381. M[offset + 1] = this._rBlock;
  5382. },
  5383. keySize: 64 / 32,
  5384. ivSize: 64 / 32,
  5385. blockSize: 64 / 32,
  5386. });
  5387. // Swap bits across the left and right words
  5388. function exchangeLR(offset, mask) {
  5389. const t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
  5390. this._rBlock ^= t;
  5391. this._lBlock ^= t << offset;
  5392. }
  5393. function exchangeRL(offset, mask) {
  5394. const t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
  5395. this._lBlock ^= t;
  5396. this._rBlock ^= t << offset;
  5397. }
  5398. /**
  5399. * Shortcut functions to the cipher's object interface.
  5400. *
  5401. * @example
  5402. *
  5403. * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
  5404. * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
  5405. */
  5406. C.DES = BlockCipher._createHelper(DES);
  5407. /**
  5408. * Triple-DES block cipher algorithm.
  5409. */
  5410. const TripleDES = C_algo.TripleDES = BlockCipher.extend({
  5411. _doReset() {
  5412. // Shortcuts
  5413. const key = this._key;
  5414. const keyWords = key.words;
  5415. // Make sure the key length is valid (64, 128 or >= 192 bit)
  5416. if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
  5417. throw new Error('Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.');
  5418. }
  5419. // Extend the key according to the keying options defined in 3DES standard
  5420. const key1 = keyWords.slice(0, 2);
  5421. const key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
  5422. const key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
  5423. // Create DES instances
  5424. this._des1 = DES.createEncryptor(WordArray.create(key1));
  5425. this._des2 = DES.createEncryptor(WordArray.create(key2));
  5426. this._des3 = DES.createEncryptor(WordArray.create(key3));
  5427. },
  5428. encryptBlock(M, offset) {
  5429. this._des1.encryptBlock(M, offset);
  5430. this._des2.decryptBlock(M, offset);
  5431. this._des3.encryptBlock(M, offset);
  5432. },
  5433. decryptBlock(M, offset) {
  5434. this._des3.decryptBlock(M, offset);
  5435. this._des2.encryptBlock(M, offset);
  5436. this._des1.decryptBlock(M, offset);
  5437. },
  5438. keySize: 192 / 32,
  5439. ivSize: 64 / 32,
  5440. blockSize: 64 / 32,
  5441. });
  5442. /**
  5443. * Shortcut functions to the cipher's object interface.
  5444. *
  5445. * @example
  5446. *
  5447. * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
  5448. * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
  5449. */
  5450. C.TripleDES = BlockCipher._createHelper(TripleDES);
  5451. }());
  5452. return CryptoJS.TripleDES;
  5453. }));
  5454. }, (modId) => {
  5455. const map = { './core': 1602206132881, './enc-base64': 1602206132885, './md5': 1602206132886, './evpkdf': 1602206132896, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  5456. });
  5457. __DEFINE__(1602206132911, function (require, module, exports) {
  5458. ;(function (root, factory, undef) {
  5459. if (typeof exports === 'object') {
  5460. // CommonJS
  5461. module.exports = exports = factory(require('./core'), require('./enc-base64'), require('./md5'), require('./evpkdf'), require('./cipher-core'));
  5462. } else if (typeof define === 'function' && define.amd) {
  5463. // AMD
  5464. define(['./core', './enc-base64', './md5', './evpkdf', './cipher-core'], factory);
  5465. } else {
  5466. // Global (browser)
  5467. factory(root.CryptoJS);
  5468. }
  5469. }(this, (CryptoJS) => {
  5470. (function () {
  5471. // Shortcuts
  5472. const C = CryptoJS;
  5473. const C_lib = C.lib;
  5474. const { StreamCipher } = C_lib;
  5475. const C_algo = C.algo;
  5476. /**
  5477. * RC4 stream cipher algorithm.
  5478. */
  5479. const RC4 = C_algo.RC4 = StreamCipher.extend({
  5480. _doReset() {
  5481. // Shortcuts
  5482. const key = this._key;
  5483. const keyWords = key.words;
  5484. const keySigBytes = key.sigBytes;
  5485. // Init sbox
  5486. const S = this._S = [];
  5487. for (var i = 0; i < 256; i++) {
  5488. S[i] = i;
  5489. }
  5490. // Key setup
  5491. for (var i = 0, j = 0; i < 256; i++) {
  5492. const keyByteIndex = i % keySigBytes;
  5493. const keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
  5494. j = (j + S[i] + keyByte) % 256;
  5495. // Swap
  5496. const t = S[i];
  5497. S[i] = S[j];
  5498. S[j] = t;
  5499. }
  5500. // Counters
  5501. this._i = this._j = 0;
  5502. },
  5503. _doProcessBlock(M, offset) {
  5504. M[offset] ^= generateKeystreamWord.call(this);
  5505. },
  5506. keySize: 256 / 32,
  5507. ivSize: 0,
  5508. });
  5509. function generateKeystreamWord() {
  5510. // Shortcuts
  5511. const S = this._S;
  5512. let i = this._i;
  5513. let j = this._j;
  5514. // Generate keystream word
  5515. let keystreamWord = 0;
  5516. for (let n = 0; n < 4; n++) {
  5517. i = (i + 1) % 256;
  5518. j = (j + S[i]) % 256;
  5519. // Swap
  5520. const t = S[i];
  5521. S[i] = S[j];
  5522. S[j] = t;
  5523. keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
  5524. }
  5525. // Update counters
  5526. this._i = i;
  5527. this._j = j;
  5528. return keystreamWord;
  5529. }
  5530. /**
  5531. * Shortcut functions to the cipher's object interface.
  5532. *
  5533. * @example
  5534. *
  5535. * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
  5536. * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
  5537. */
  5538. C.RC4 = StreamCipher._createHelper(RC4);
  5539. /**
  5540. * Modified RC4 stream cipher algorithm.
  5541. */
  5542. const RC4Drop = C_algo.RC4Drop = RC4.extend({
  5543. /**
  5544. * Configuration options.
  5545. *
  5546. * @property {number} drop The number of keystream words to drop. Default 192
  5547. */
  5548. cfg: RC4.cfg.extend({
  5549. drop: 192,
  5550. }),
  5551. _doReset() {
  5552. RC4._doReset.call(this);
  5553. // Drop
  5554. for (let i = this.cfg.drop; i > 0; i--) {
  5555. generateKeystreamWord.call(this);
  5556. }
  5557. },
  5558. });
  5559. /**
  5560. * Shortcut functions to the cipher's object interface.
  5561. *
  5562. * @example
  5563. *
  5564. * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
  5565. * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
  5566. */
  5567. C.RC4Drop = StreamCipher._createHelper(RC4Drop);
  5568. }());
  5569. return CryptoJS.RC4;
  5570. }));
  5571. }, (modId) => {
  5572. const map = { './core': 1602206132881, './enc-base64': 1602206132885, './md5': 1602206132886, './evpkdf': 1602206132896, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  5573. });
  5574. __DEFINE__(1602206132912, function (require, module, exports) {
  5575. ;(function (root, factory, undef) {
  5576. if (typeof exports === 'object') {
  5577. // CommonJS
  5578. module.exports = exports = factory(require('./core'), require('./enc-base64'), require('./md5'), require('./evpkdf'), require('./cipher-core'));
  5579. } else if (typeof define === 'function' && define.amd) {
  5580. // AMD
  5581. define(['./core', './enc-base64', './md5', './evpkdf', './cipher-core'], factory);
  5582. } else {
  5583. // Global (browser)
  5584. factory(root.CryptoJS);
  5585. }
  5586. }(this, (CryptoJS) => {
  5587. (function () {
  5588. // Shortcuts
  5589. const C = CryptoJS;
  5590. const C_lib = C.lib;
  5591. const { StreamCipher } = C_lib;
  5592. const C_algo = C.algo;
  5593. // Reusable objects
  5594. const S = [];
  5595. const C_ = [];
  5596. const G = [];
  5597. /**
  5598. * Rabbit stream cipher algorithm
  5599. */
  5600. const Rabbit = C_algo.Rabbit = StreamCipher.extend({
  5601. _doReset() {
  5602. // Shortcuts
  5603. const K = this._key.words;
  5604. const { iv } = this.cfg;
  5605. // Swap endian
  5606. for (var i = 0; i < 4; i++) {
  5607. K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff)
  5608. | (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
  5609. }
  5610. // Generate initial state values
  5611. const X = this._X = [
  5612. K[0], (K[3] << 16) | (K[2] >>> 16),
  5613. K[1], (K[0] << 16) | (K[3] >>> 16),
  5614. K[2], (K[1] << 16) | (K[0] >>> 16),
  5615. K[3], (K[2] << 16) | (K[1] >>> 16),
  5616. ];
  5617. // Generate initial counter values
  5618. const C = this._C = [
  5619. (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
  5620. (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
  5621. (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
  5622. (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff),
  5623. ];
  5624. // Carry bit
  5625. this._b = 0;
  5626. // Iterate the system four times
  5627. for (var i = 0; i < 4; i++) {
  5628. nextState.call(this);
  5629. }
  5630. // Modify the counters
  5631. for (var i = 0; i < 8; i++) {
  5632. C[i] ^= X[(i + 4) & 7];
  5633. }
  5634. // IV setup
  5635. if (iv) {
  5636. // Shortcuts
  5637. const IV = iv.words;
  5638. const IV_0 = IV[0];
  5639. const IV_1 = IV[1];
  5640. // Generate four subvectors
  5641. const i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
  5642. const i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
  5643. const i1 = (i0 >>> 16) | (i2 & 0xffff0000);
  5644. const i3 = (i2 << 16) | (i0 & 0x0000ffff);
  5645. // Modify counter values
  5646. C[0] ^= i0;
  5647. C[1] ^= i1;
  5648. C[2] ^= i2;
  5649. C[3] ^= i3;
  5650. C[4] ^= i0;
  5651. C[5] ^= i1;
  5652. C[6] ^= i2;
  5653. C[7] ^= i3;
  5654. // Iterate the system four times
  5655. for (var i = 0; i < 4; i++) {
  5656. nextState.call(this);
  5657. }
  5658. }
  5659. },
  5660. _doProcessBlock(M, offset) {
  5661. // Shortcut
  5662. const X = this._X;
  5663. // Iterate the system
  5664. nextState.call(this);
  5665. // Generate four keystream words
  5666. S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
  5667. S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
  5668. S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
  5669. S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
  5670. for (let i = 0; i < 4; i++) {
  5671. // Swap endian
  5672. S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff)
  5673. | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
  5674. // Encrypt
  5675. M[offset + i] ^= S[i];
  5676. }
  5677. },
  5678. blockSize: 128 / 32,
  5679. ivSize: 64 / 32,
  5680. });
  5681. function nextState() {
  5682. // Shortcuts
  5683. const X = this._X;
  5684. const C = this._C;
  5685. // Save old counter values
  5686. for (var i = 0; i < 8; i++) {
  5687. C_[i] = C[i];
  5688. }
  5689. // Calculate new counter values
  5690. C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
  5691. C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
  5692. C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
  5693. C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
  5694. C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
  5695. C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
  5696. C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
  5697. C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
  5698. this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
  5699. // Calculate the g-values
  5700. for (var i = 0; i < 8; i++) {
  5701. const gx = X[i] + C[i];
  5702. // Construct high and low argument for squaring
  5703. const ga = gx & 0xffff;
  5704. const gb = gx >>> 16;
  5705. // Calculate high and low result of squaring
  5706. const gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
  5707. const gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
  5708. // High XOR low
  5709. G[i] = gh ^ gl;
  5710. }
  5711. // Calculate new state values
  5712. X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
  5713. X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
  5714. X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
  5715. X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
  5716. X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
  5717. X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
  5718. X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
  5719. X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
  5720. }
  5721. /**
  5722. * Shortcut functions to the cipher's object interface.
  5723. *
  5724. * @example
  5725. *
  5726. * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
  5727. * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
  5728. */
  5729. C.Rabbit = StreamCipher._createHelper(Rabbit);
  5730. }());
  5731. return CryptoJS.Rabbit;
  5732. }));
  5733. }, (modId) => {
  5734. const map = { './core': 1602206132881, './enc-base64': 1602206132885, './md5': 1602206132886, './evpkdf': 1602206132896, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  5735. });
  5736. __DEFINE__(1602206132913, function (require, module, exports) {
  5737. ;(function (root, factory, undef) {
  5738. if (typeof exports === 'object') {
  5739. // CommonJS
  5740. module.exports = exports = factory(require('./core'), require('./enc-base64'), require('./md5'), require('./evpkdf'), require('./cipher-core'));
  5741. } else if (typeof define === 'function' && define.amd) {
  5742. // AMD
  5743. define(['./core', './enc-base64', './md5', './evpkdf', './cipher-core'], factory);
  5744. } else {
  5745. // Global (browser)
  5746. factory(root.CryptoJS);
  5747. }
  5748. }(this, (CryptoJS) => {
  5749. (function () {
  5750. // Shortcuts
  5751. const C = CryptoJS;
  5752. const C_lib = C.lib;
  5753. const { StreamCipher } = C_lib;
  5754. const C_algo = C.algo;
  5755. // Reusable objects
  5756. const S = [];
  5757. const C_ = [];
  5758. const G = [];
  5759. /**
  5760. * Rabbit stream cipher algorithm.
  5761. *
  5762. * This is a legacy version that neglected to convert the key to little-endian.
  5763. * This error doesn't affect the cipher's security,
  5764. * but it does affect its compatibility with other implementations.
  5765. */
  5766. const RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
  5767. _doReset() {
  5768. // Shortcuts
  5769. const K = this._key.words;
  5770. const { iv } = this.cfg;
  5771. // Generate initial state values
  5772. const X = this._X = [
  5773. K[0], (K[3] << 16) | (K[2] >>> 16),
  5774. K[1], (K[0] << 16) | (K[3] >>> 16),
  5775. K[2], (K[1] << 16) | (K[0] >>> 16),
  5776. K[3], (K[2] << 16) | (K[1] >>> 16),
  5777. ];
  5778. // Generate initial counter values
  5779. const C = this._C = [
  5780. (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
  5781. (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
  5782. (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
  5783. (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff),
  5784. ];
  5785. // Carry bit
  5786. this._b = 0;
  5787. // Iterate the system four times
  5788. for (var i = 0; i < 4; i++) {
  5789. nextState.call(this);
  5790. }
  5791. // Modify the counters
  5792. for (var i = 0; i < 8; i++) {
  5793. C[i] ^= X[(i + 4) & 7];
  5794. }
  5795. // IV setup
  5796. if (iv) {
  5797. // Shortcuts
  5798. const IV = iv.words;
  5799. const IV_0 = IV[0];
  5800. const IV_1 = IV[1];
  5801. // Generate four subvectors
  5802. const i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
  5803. const i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
  5804. const i1 = (i0 >>> 16) | (i2 & 0xffff0000);
  5805. const i3 = (i2 << 16) | (i0 & 0x0000ffff);
  5806. // Modify counter values
  5807. C[0] ^= i0;
  5808. C[1] ^= i1;
  5809. C[2] ^= i2;
  5810. C[3] ^= i3;
  5811. C[4] ^= i0;
  5812. C[5] ^= i1;
  5813. C[6] ^= i2;
  5814. C[7] ^= i3;
  5815. // Iterate the system four times
  5816. for (var i = 0; i < 4; i++) {
  5817. nextState.call(this);
  5818. }
  5819. }
  5820. },
  5821. _doProcessBlock(M, offset) {
  5822. // Shortcut
  5823. const X = this._X;
  5824. // Iterate the system
  5825. nextState.call(this);
  5826. // Generate four keystream words
  5827. S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
  5828. S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
  5829. S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
  5830. S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
  5831. for (let i = 0; i < 4; i++) {
  5832. // Swap endian
  5833. S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff)
  5834. | (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
  5835. // Encrypt
  5836. M[offset + i] ^= S[i];
  5837. }
  5838. },
  5839. blockSize: 128 / 32,
  5840. ivSize: 64 / 32,
  5841. });
  5842. function nextState() {
  5843. // Shortcuts
  5844. const X = this._X;
  5845. const C = this._C;
  5846. // Save old counter values
  5847. for (var i = 0; i < 8; i++) {
  5848. C_[i] = C[i];
  5849. }
  5850. // Calculate new counter values
  5851. C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
  5852. C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
  5853. C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
  5854. C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
  5855. C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
  5856. C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
  5857. C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
  5858. C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
  5859. this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
  5860. // Calculate the g-values
  5861. for (var i = 0; i < 8; i++) {
  5862. const gx = X[i] + C[i];
  5863. // Construct high and low argument for squaring
  5864. const ga = gx & 0xffff;
  5865. const gb = gx >>> 16;
  5866. // Calculate high and low result of squaring
  5867. const gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
  5868. const gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
  5869. // High XOR low
  5870. G[i] = gh ^ gl;
  5871. }
  5872. // Calculate new state values
  5873. X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
  5874. X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
  5875. X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
  5876. X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
  5877. X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
  5878. X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
  5879. X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
  5880. X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
  5881. }
  5882. /**
  5883. * Shortcut functions to the cipher's object interface.
  5884. *
  5885. * @example
  5886. *
  5887. * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
  5888. * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
  5889. */
  5890. C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
  5891. }());
  5892. return CryptoJS.RabbitLegacy;
  5893. }));
  5894. }, (modId) => {
  5895. const map = { './core': 1602206132881, './enc-base64': 1602206132885, './md5': 1602206132886, './evpkdf': 1602206132896, './cipher-core': 1602206132897 }; return __REQUIRE__(map[modId], modId);
  5896. });
  5897. return __REQUIRE__(1602206132880);
  5898. }());
  5899. // # sourceMappingURL=index.js.map