]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blob - bip39-standalone.html
bip32-standalone.html updated
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / bip39-standalone.html
1 <!DOCTYPE html>
2 <html>
3 <head lang="en">
4 <meta charset="utf-8" />
5 <title>BIP39 - Mnemonic Code</title>
6 <!--<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">-->
7 <style>
8 /*!
9 * Bootstrap v3.2.0 (http://getbootstrap.com)
10 * Copyright 2011-2014 Twitter, Inc.
11 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
12 *//*! normalize.css v3.0.1 | MIT License | git.io/normalize */html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background:0 0}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{margin:.67em 0;font-size:2em}mark{color:#000;background:#ff0}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{height:0;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}button,input,optgroup,select,textarea{margin:0;font:inherit;color:inherit}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}input{line-height:normal}input[type=checkbox],input[type=radio]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{padding:.35em .625em .75em;margin:0 2px;border:1px solid silver}legend{padding:0;border:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-spacing:0;border-collapse:collapse}td,th{padding:0}@media print{*{color:#000!important;text-shadow:none!important;background:transparent!important;-webkit-box-shadow:none!important;box-shadow:none!important}a,a:visited{text-decoration:underline}a[href]:after{content:" (" attr(href) ")"}abbr[title]:after{content:" (" attr(title) ")"}a[href^="javascript:"]:after,a[href^="#"]:after{content:""}pre,blockquote{border:1px solid #999;page-break-inside:avoid}thead{display:table-header-group}tr,img{page-break-inside:avoid}img{max-width:100%!important}p,h2,h3{orphans:3;widows:3}h2,h3{page-break-after:avoid}select{background:#fff!important}.navbar{display:none}.table td,.table th{background-color:#fff!important}.btn>.caret,.dropup>.btn>.caret{border-top-color:#000!important}.label{border:1px solid #000}.table{border-collapse:collapse!important}.table-bordered th,.table-bordered td{border:1px solid #ddd!important}}@font-face{font-family:'Glyphicons Halflings';src:url(../fonts/glyphicons-halflings-regular.eot);src:url(../fonts/glyphicons-halflings-regular.eot?#iefix) format('embedded-opentype'),url(../fonts/glyphicons-halflings-regular.woff) format('woff'),url(../fonts/glyphicons-halflings-regular.ttf) format('truetype'),url(../fonts/glyphicons-halflings-regular.svg#glyphicons_halflingsregular) format('svg')}.glyphicon{position:relative;top:1px;display:inline-block;font-family:'Glyphicons Halflings';font-style:normal;font-weight:400;line-height:1;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.glyphicon-asterisk:before{content:"\2a"}.glyphicon-plus:before{content:"\2b"}.glyphicon-euro:before{content:"\20ac"}.glyphicon-minus:before{content:"\2212"}.glyphicon-cloud:before{content:"\2601"}.glyphicon-envelope:before{content:"\2709"}.glyphicon-pencil:before{content:"\270f"}.glyphicon-glass:before{content:"\e001"}.glyphicon-music:before{content:"\e002"}.glyphicon-search:before{content:"\e003"}.glyphicon-heart:before{content:"\e005"}.glyphicon-star:before{content:"\e006"}.glyphicon-star-empty:before{content:"\e007"}.glyphicon-user:before{content:"\e008"}.glyphicon-film:before{content:"\e009"}.glyphicon-th-large:before{content:"\e010"}.glyphicon-th:before{content:"\e011"}.glyphicon-th-list:before{content:"\e012"}.glyphicon-ok:before{content:"\e013"}.glyphicon-remove:before{content:"\e014"}.glyphicon-zoom-in:before{content:"\e015"}.glyphicon-zoom-out:before{content:"\e016"}.glyphicon-off:before{content:"\e017"}.glyphicon-signal:before{content:"\e018"}.glyphicon-cog:before{content:"\e019"}.glyphicon-trash:before{content:"\e020"}.glyphicon-home:before{content:"\e021"}.glyphicon-file:before{content:"\e022"}.glyphicon-time:before{content:"\e023"}.glyphicon-road:before{content:"\e024"}.glyphicon-download-alt:before{content:"\e025"}.glyphicon-download:before{content:"\e026"}.glyphicon-upload:before{content:"\e027"}.glyphicon-inbox:before{content:"\e028"}.glyphicon-play-circle:before{content:"\e029"}.glyphicon-repeat:before{content:"\e030"}.glyphicon-refresh:before{content:"\e031"}.glyphicon-list-alt:before{content:"\e032"}.glyphicon-lock:before{content:"\e033"}.glyphicon-flag:before{content:"\e034"}.glyphicon-headphones:before{content:"\e035"}.glyphicon-volume-off:before{content:"\e036"}.glyphicon-volume-down:before{content:"\e037"}.glyphicon-volume-up:before{content:"\e038"}.glyphicon-qrcode:before{content:"\e039"}.glyphicon-barcode:before{content:"\e040"}.glyphicon-tag:before{content:"\e041"}.glyphicon-tags:before{content:"\e042"}.glyphicon-book:before{content:"\e043"}.glyphicon-bookmark:before{content:"\e044"}.glyphicon-print:before{content:"\e045"}.glyphicon-camera:before{content:"\e046"}.glyphicon-font:before{content:"\e047"}.glyphicon-bold:before{content:"\e048"}.glyphicon-italic:before{content:"\e049"}.glyphicon-text-height:before{content:"\e050"}.glyphicon-text-width:before{content:"\e051"}.glyphicon-align-left:before{content:"\e052"}.glyphicon-align-center:before{content:"\e053"}.glyphicon-align-right:before{content:"\e054"}.glyphicon-align-justify:before{content:"\e055"}.glyphicon-list:before{content:"\e056"}.glyphicon-indent-left:before{content:"\e057"}.glyphicon-indent-right:before{content:"\e058"}.glyphicon-facetime-video:before{content:"\e059"}.glyphicon-picture:before{content:"\e060"}.glyphicon-map-marker:before{content:"\e062"}.glyphicon-adjust:before{content:"\e063"}.glyphicon-tint:before{content:"\e064"}.glyphicon-edit:before{content:"\e065"}.glyphicon-share:before{content:"\e066"}.glyphicon-check:before{content:"\e067"}.glyphicon-move:before{content:"\e068"}.glyphicon-step-backward:before{content:"\e069"}.glyphicon-fast-backward:before{content:"\e070"}.glyphicon-backward:before{content:"\e071"}.glyphicon-play:before{content:"\e072"}.glyphicon-pause:before{content:"\e073"}.glyphicon-stop:before{content:"\e074"}.glyphicon-forward:before{content:"\e075"}.glyphicon-fast-forward:before{content:"\e076"}.glyphicon-step-forward:before{content:"\e077"}.glyphicon-eject:before{content:"\e078"}.glyphicon-chevron-left:before{content:"\e079"}.glyphicon-chevron-right:before{content:"\e080"}.glyphicon-plus-sign:before{content:"\e081"}.glyphicon-minus-sign:before{content:"\e082"}.glyphicon-remove-sign:before{content:"\e083"}.glyphicon-ok-sign:before{content:"\e084"}.glyphicon-question-sign:before{content:"\e085"}.glyphicon-info-sign:before{content:"\e086"}.glyphicon-screenshot:before{content:"\e087"}.glyphicon-remove-circle:before{content:"\e088"}.glyphicon-ok-circle:before{content:"\e089"}.glyphicon-ban-circle:before{content:"\e090"}.glyphicon-arrow-left:before{content:"\e091"}.glyphicon-arrow-right:before{content:"\e092"}.glyphicon-arrow-up:before{content:"\e093"}.glyphicon-arrow-down:before{content:"\e094"}.glyphicon-share-alt:before{content:"\e095"}.glyphicon-resize-full:before{content:"\e096"}.glyphicon-resize-small:before{content:"\e097"}.glyphicon-exclamation-sign:before{content:"\e101"}.glyphicon-gift:before{content:"\e102"}.glyphicon-leaf:before{content:"\e103"}.glyphicon-fire:before{content:"\e104"}.glyphicon-eye-open:before{content:"\e105"}.glyphicon-eye-close:before{content:"\e106"}.glyphicon-warning-sign:before{content:"\e107"}.glyphicon-plane:before{content:"\e108"}.glyphicon-calendar:before{content:"\e109"}.glyphicon-random:before{content:"\e110"}.glyphicon-comment:before{content:"\e111"}.glyphicon-magnet:before{content:"\e112"}.glyphicon-chevron-up:before{content:"\e113"}.glyphicon-chevron-down:before{content:"\e114"}.glyphicon-retweet:before{content:"\e115"}.glyphicon-shopping-cart:before{content:"\e116"}.glyphicon-folder-close:before{content:"\e117"}.glyphicon-folder-open:before{content:"\e118"}.glyphicon-resize-vertical:before{content:"\e119"}.glyphicon-resize-horizontal:before{content:"\e120"}.glyphicon-hdd:before{content:"\e121"}.glyphicon-bullhorn:before{content:"\e122"}.glyphicon-bell:before{content:"\e123"}.glyphicon-certificate:before{content:"\e124"}.glyphicon-thumbs-up:before{content:"\e125"}.glyphicon-thumbs-down:before{content:"\e126"}.glyphicon-hand-right:before{content:"\e127"}.glyphicon-hand-left:before{content:"\e128"}.glyphicon-hand-up:before{content:"\e129"}.glyphicon-hand-down:before{content:"\e130"}.glyphicon-circle-arrow-right:before{content:"\e131"}.glyphicon-circle-arrow-left:before{content:"\e132"}.glyphicon-circle-arrow-up:before{content:"\e133"}.glyphicon-circle-arrow-down:before{content:"\e134"}.glyphicon-globe:before{content:"\e135"}.glyphicon-wrench:before{content:"\e136"}.glyphicon-tasks:before{content:"\e137"}.glyphicon-filter:before{content:"\e138"}.glyphicon-briefcase:before{content:"\e139"}.glyphicon-fullscreen:before{content:"\e140"}.glyphicon-dashboard:before{content:"\e141"}.glyphicon-paperclip:before{content:"\e142"}.glyphicon-heart-empty:before{content:"\e143"}.glyphicon-link:before{content:"\e144"}.glyphicon-phone:before{content:"\e145"}.glyphicon-pushpin:before{content:"\e146"}.glyphicon-usd:before{content:"\e148"}.glyphicon-gbp:before{content:"\e149"}.glyphicon-sort:before{content:"\e150"}.glyphicon-sort-by-alphabet:before{content:"\e151"}.glyphicon-sort-by-alphabet-alt:before{content:"\e152"}.glyphicon-sort-by-order:before{content:"\e153"}.glyphicon-sort-by-order-alt:before{content:"\e154"}.glyphicon-sort-by-attributes:before{content:"\e155"}.glyphicon-sort-by-attributes-alt:before{content:"\e156"}.glyphicon-unchecked:before{content:"\e157"}.glyphicon-expand:before{content:"\e158"}.glyphicon-collapse-down:before{content:"\e159"}.glyphicon-collapse-up:before{content:"\e160"}.glyphicon-log-in:before{content:"\e161"}.glyphicon-flash:before{content:"\e162"}.glyphicon-log-out:before{content:"\e163"}.glyphicon-new-window:before{content:"\e164"}.glyphicon-record:before{content:"\e165"}.glyphicon-save:before{content:"\e166"}.glyphicon-open:before{content:"\e167"}.glyphicon-saved:before{content:"\e168"}.glyphicon-import:before{content:"\e169"}.glyphicon-export:before{content:"\e170"}.glyphicon-send:before{content:"\e171"}.glyphicon-floppy-disk:before{content:"\e172"}.glyphicon-floppy-saved:before{content:"\e173"}.glyphicon-floppy-remove:before{content:"\e174"}.glyphicon-floppy-save:before{content:"\e175"}.glyphicon-floppy-open:before{content:"\e176"}.glyphicon-credit-card:before{content:"\e177"}.glyphicon-transfer:before{content:"\e178"}.glyphicon-cutlery:before{content:"\e179"}.glyphicon-header:before{content:"\e180"}.glyphicon-compressed:before{content:"\e181"}.glyphicon-earphone:before{content:"\e182"}.glyphicon-phone-alt:before{content:"\e183"}.glyphicon-tower:before{content:"\e184"}.glyphicon-stats:before{content:"\e185"}.glyphicon-sd-video:before{content:"\e186"}.glyphicon-hd-video:before{content:"\e187"}.glyphicon-subtitles:before{content:"\e188"}.glyphicon-sound-stereo:before{content:"\e189"}.glyphicon-sound-dolby:before{content:"\e190"}.glyphicon-sound-5-1:before{content:"\e191"}.glyphicon-sound-6-1:before{content:"\e192"}.glyphicon-sound-7-1:before{content:"\e193"}.glyphicon-copyright-mark:before{content:"\e194"}.glyphicon-registration-mark:before{content:"\e195"}.glyphicon-cloud-download:before{content:"\e197"}.glyphicon-cloud-upload:before{content:"\e198"}.glyphicon-tree-conifer:before{content:"\e199"}.glyphicon-tree-deciduous:before{content:"\e200"}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}:before,:after{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}html{font-size:10px;-webkit-tap-highlight-color:rgba(0,0,0,0)}body{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:1.42857143;color:#333;background-color:#fff}input,button,select,textarea{font-family:inherit;font-size:inherit;line-height:inherit}a{color:#428bca;text-decoration:none}a:hover,a:focus{color:#2a6496;text-decoration:underline}a:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}figure{margin:0}img{vertical-align:middle}.img-responsive,.thumbnail>img,.thumbnail a>img,.carousel-inner>.item>img,.carousel-inner>.item>a>img{display:block;width:100% \9;max-width:100%;height:auto}.img-rounded{border-radius:6px}.img-thumbnail{display:inline-block;width:100% \9;max-width:100%;height:auto;padding:4px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.img-circle{border-radius:50%}hr{margin-top:20px;margin-bottom:20px;border:0;border-top:1px solid #eee}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);border:0}.sr-only-focusable:active,.sr-only-focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}h1,h2,h3,h4,h5,h6,.h1,.h2,.h3,.h4,.h5,.h6{font-family:inherit;font-weight:500;line-height:1.1;color:inherit}h1 small,h2 small,h3 small,h4 small,h5 small,h6 small,.h1 small,.h2 small,.h3 small,.h4 small,.h5 small,.h6 small,h1 .small,h2 .small,h3 .small,h4 .small,h5 .small,h6 .small,.h1 .small,.h2 .small,.h3 .small,.h4 .small,.h5 .small,.h6 .small{font-weight:400;line-height:1;color:#777}h1,.h1,h2,.h2,h3,.h3{margin-top:20px;margin-bottom:10px}h1 small,.h1 small,h2 small,.h2 small,h3 small,.h3 small,h1 .small,.h1 .small,h2 .small,.h2 .small,h3 .small,.h3 .small{font-size:65%}h4,.h4,h5,.h5,h6,.h6{margin-top:10px;margin-bottom:10px}h4 small,.h4 small,h5 small,.h5 small,h6 small,.h6 small,h4 .small,.h4 .small,h5 .small,.h5 .small,h6 .small,.h6 .small{font-size:75%}h1,.h1{font-size:36px}h2,.h2{font-size:30px}h3,.h3{font-size:24px}h4,.h4{font-size:18px}h5,.h5{font-size:14px}h6,.h6{font-size:12px}p{margin:0 0 10px}.lead{margin-bottom:20px;font-size:16px;font-weight:300;line-height:1.4}@media (min-width:768px){.lead{font-size:21px}}small,.small{font-size:85%}cite{font-style:normal}mark,.mark{padding:.2em;background-color:#fcf8e3}.text-left{text-align:left}.text-right{text-align:right}.text-center{text-align:center}.text-justify{text-align:justify}.text-nowrap{white-space:nowrap}.text-lowercase{text-transform:lowercase}.text-uppercase{text-transform:uppercase}.text-capitalize{text-transform:capitalize}.text-muted{color:#777}.text-primary{color:#428bca}a.text-primary:hover{color:#3071a9}.text-success{color:#3c763d}a.text-success:hover{color:#2b542c}.text-info{color:#31708f}a.text-info:hover{color:#245269}.text-warning{color:#8a6d3b}a.text-warning:hover{color:#66512c}.text-danger{color:#a94442}a.text-danger:hover{color:#843534}.bg-primary{color:#fff;background-color:#428bca}a.bg-primary:hover{background-color:#3071a9}.bg-success{background-color:#dff0d8}a.bg-success:hover{background-color:#c1e2b3}.bg-info{background-color:#d9edf7}a.bg-info:hover{background-color:#afd9ee}.bg-warning{background-color:#fcf8e3}a.bg-warning:hover{background-color:#f7ecb5}.bg-danger{background-color:#f2dede}a.bg-danger:hover{background-color:#e4b9b9}.page-header{padding-bottom:9px;margin:40px 0 20px;border-bottom:1px solid #eee}ul,ol{margin-top:0;margin-bottom:10px}ul ul,ol ul,ul ol,ol ol{margin-bottom:0}.list-unstyled{padding-left:0;list-style:none}.list-inline{padding-left:0;margin-left:-5px;list-style:none}.list-inline>li{display:inline-block;padding-right:5px;padding-left:5px}dl{margin-top:0;margin-bottom:20px}dt,dd{line-height:1.42857143}dt{font-weight:700}dd{margin-left:0}@media (min-width:768px){.dl-horizontal dt{float:left;width:160px;overflow:hidden;clear:left;text-align:right;text-overflow:ellipsis;white-space:nowrap}.dl-horizontal dd{margin-left:180px}}abbr[title],abbr[data-original-title]{cursor:help;border-bottom:1px dotted #777}.initialism{font-size:90%;text-transform:uppercase}blockquote{padding:10px 20px;margin:0 0 20px;font-size:17.5px;border-left:5px solid #eee}blockquote p:last-child,blockquote ul:last-child,blockquote ol:last-child{margin-bottom:0}blockquote footer,blockquote small,blockquote .small{display:block;font-size:80%;line-height:1.42857143;color:#777}blockquote footer:before,blockquote small:before,blockquote .small:before{content:'\2014 \00A0'}.blockquote-reverse,blockquote.pull-right{padding-right:15px;padding-left:0;text-align:right;border-right:5px solid #eee;border-left:0}.blockquote-reverse footer:before,blockquote.pull-right footer:before,.blockquote-reverse small:before,blockquote.pull-right small:before,.blockquote-reverse .small:before,blockquote.pull-right .small:before{content:''}.blockquote-reverse footer:after,blockquote.pull-right footer:after,.blockquote-reverse small:after,blockquote.pull-right small:after,.blockquote-reverse .small:after,blockquote.pull-right .small:after{content:'\00A0 \2014'}blockquote:before,blockquote:after{content:""}address{margin-bottom:20px;font-style:normal;line-height:1.42857143}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,"Courier New",monospace}code{padding:2px 4px;font-size:90%;color:#c7254e;background-color:#f9f2f4;border-radius:4px}kbd{padding:2px 4px;font-size:90%;color:#fff;background-color:#333;border-radius:3px;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.25);box-shadow:inset 0 -1px 0 rgba(0,0,0,.25)}kbd kbd{padding:0;font-size:100%;-webkit-box-shadow:none;box-shadow:none}pre{display:block;padding:9.5px;margin:0 0 10px;font-size:13px;line-height:1.42857143;color:#333;word-break:break-all;word-wrap:break-word;background-color:#f5f5f5;border:1px solid #ccc;border-radius:4px}pre code{padding:0;font-size:inherit;color:inherit;white-space:pre-wrap;background-color:transparent;border-radius:0}.pre-scrollable{max-height:340px;overflow-y:scroll}.container{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}@media (min-width:768px){.container{width:750px}}@media (min-width:992px){.container{width:970px}}@media (min-width:1200px){.container{width:1170px}}.container-fluid{padding-right:15px;padding-left:15px;margin-right:auto;margin-left:auto}.row{margin-right:-15px;margin-left:-15px}.col-xs-1,.col-sm-1,.col-md-1,.col-lg-1,.col-xs-2,.col-sm-2,.col-md-2,.col-lg-2,.col-xs-3,.col-sm-3,.col-md-3,.col-lg-3,.col-xs-4,.col-sm-4,.col-md-4,.col-lg-4,.col-xs-5,.col-sm-5,.col-md-5,.col-lg-5,.col-xs-6,.col-sm-6,.col-md-6,.col-lg-6,.col-xs-7,.col-sm-7,.col-md-7,.col-lg-7,.col-xs-8,.col-sm-8,.col-md-8,.col-lg-8,.col-xs-9,.col-sm-9,.col-md-9,.col-lg-9,.col-xs-10,.col-sm-10,.col-md-10,.col-lg-10,.col-xs-11,.col-sm-11,.col-md-11,.col-lg-11,.col-xs-12,.col-sm-12,.col-md-12,.col-lg-12{position:relative;min-height:1px;padding-right:15px;padding-left:15px}.col-xs-1,.col-xs-2,.col-xs-3,.col-xs-4,.col-xs-5,.col-xs-6,.col-xs-7,.col-xs-8,.col-xs-9,.col-xs-10,.col-xs-11,.col-xs-12{float:left}.col-xs-12{width:100%}.col-xs-11{width:91.66666667%}.col-xs-10{width:83.33333333%}.col-xs-9{width:75%}.col-xs-8{width:66.66666667%}.col-xs-7{width:58.33333333%}.col-xs-6{width:50%}.col-xs-5{width:41.66666667%}.col-xs-4{width:33.33333333%}.col-xs-3{width:25%}.col-xs-2{width:16.66666667%}.col-xs-1{width:8.33333333%}.col-xs-pull-12{right:100%}.col-xs-pull-11{right:91.66666667%}.col-xs-pull-10{right:83.33333333%}.col-xs-pull-9{right:75%}.col-xs-pull-8{right:66.66666667%}.col-xs-pull-7{right:58.33333333%}.col-xs-pull-6{right:50%}.col-xs-pull-5{right:41.66666667%}.col-xs-pull-4{right:33.33333333%}.col-xs-pull-3{right:25%}.col-xs-pull-2{right:16.66666667%}.col-xs-pull-1{right:8.33333333%}.col-xs-pull-0{right:auto}.col-xs-push-12{left:100%}.col-xs-push-11{left:91.66666667%}.col-xs-push-10{left:83.33333333%}.col-xs-push-9{left:75%}.col-xs-push-8{left:66.66666667%}.col-xs-push-7{left:58.33333333%}.col-xs-push-6{left:50%}.col-xs-push-5{left:41.66666667%}.col-xs-push-4{left:33.33333333%}.col-xs-push-3{left:25%}.col-xs-push-2{left:16.66666667%}.col-xs-push-1{left:8.33333333%}.col-xs-push-0{left:auto}.col-xs-offset-12{margin-left:100%}.col-xs-offset-11{margin-left:91.66666667%}.col-xs-offset-10{margin-left:83.33333333%}.col-xs-offset-9{margin-left:75%}.col-xs-offset-8{margin-left:66.66666667%}.col-xs-offset-7{margin-left:58.33333333%}.col-xs-offset-6{margin-left:50%}.col-xs-offset-5{margin-left:41.66666667%}.col-xs-offset-4{margin-left:33.33333333%}.col-xs-offset-3{margin-left:25%}.col-xs-offset-2{margin-left:16.66666667%}.col-xs-offset-1{margin-left:8.33333333%}.col-xs-offset-0{margin-left:0}@media (min-width:768px){.col-sm-1,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9,.col-sm-10,.col-sm-11,.col-sm-12{float:left}.col-sm-12{width:100%}.col-sm-11{width:91.66666667%}.col-sm-10{width:83.33333333%}.col-sm-9{width:75%}.col-sm-8{width:66.66666667%}.col-sm-7{width:58.33333333%}.col-sm-6{width:50%}.col-sm-5{width:41.66666667%}.col-sm-4{width:33.33333333%}.col-sm-3{width:25%}.col-sm-2{width:16.66666667%}.col-sm-1{width:8.33333333%}.col-sm-pull-12{right:100%}.col-sm-pull-11{right:91.66666667%}.col-sm-pull-10{right:83.33333333%}.col-sm-pull-9{right:75%}.col-sm-pull-8{right:66.66666667%}.col-sm-pull-7{right:58.33333333%}.col-sm-pull-6{right:50%}.col-sm-pull-5{right:41.66666667%}.col-sm-pull-4{right:33.33333333%}.col-sm-pull-3{right:25%}.col-sm-pull-2{right:16.66666667%}.col-sm-pull-1{right:8.33333333%}.col-sm-pull-0{right:auto}.col-sm-push-12{left:100%}.col-sm-push-11{left:91.66666667%}.col-sm-push-10{left:83.33333333%}.col-sm-push-9{left:75%}.col-sm-push-8{left:66.66666667%}.col-sm-push-7{left:58.33333333%}.col-sm-push-6{left:50%}.col-sm-push-5{left:41.66666667%}.col-sm-push-4{left:33.33333333%}.col-sm-push-3{left:25%}.col-sm-push-2{left:16.66666667%}.col-sm-push-1{left:8.33333333%}.col-sm-push-0{left:auto}.col-sm-offset-12{margin-left:100%}.col-sm-offset-11{margin-left:91.66666667%}.col-sm-offset-10{margin-left:83.33333333%}.col-sm-offset-9{margin-left:75%}.col-sm-offset-8{margin-left:66.66666667%}.col-sm-offset-7{margin-left:58.33333333%}.col-sm-offset-6{margin-left:50%}.col-sm-offset-5{margin-left:41.66666667%}.col-sm-offset-4{margin-left:33.33333333%}.col-sm-offset-3{margin-left:25%}.col-sm-offset-2{margin-left:16.66666667%}.col-sm-offset-1{margin-left:8.33333333%}.col-sm-offset-0{margin-left:0}}@media (min-width:992px){.col-md-1,.col-md-2,.col-md-3,.col-md-4,.col-md-5,.col-md-6,.col-md-7,.col-md-8,.col-md-9,.col-md-10,.col-md-11,.col-md-12{float:left}.col-md-12{width:100%}.col-md-11{width:91.66666667%}.col-md-10{width:83.33333333%}.col-md-9{width:75%}.col-md-8{width:66.66666667%}.col-md-7{width:58.33333333%}.col-md-6{width:50%}.col-md-5{width:41.66666667%}.col-md-4{width:33.33333333%}.col-md-3{width:25%}.col-md-2{width:16.66666667%}.col-md-1{width:8.33333333%}.col-md-pull-12{right:100%}.col-md-pull-11{right:91.66666667%}.col-md-pull-10{right:83.33333333%}.col-md-pull-9{right:75%}.col-md-pull-8{right:66.66666667%}.col-md-pull-7{right:58.33333333%}.col-md-pull-6{right:50%}.col-md-pull-5{right:41.66666667%}.col-md-pull-4{right:33.33333333%}.col-md-pull-3{right:25%}.col-md-pull-2{right:16.66666667%}.col-md-pull-1{right:8.33333333%}.col-md-pull-0{right:auto}.col-md-push-12{left:100%}.col-md-push-11{left:91.66666667%}.col-md-push-10{left:83.33333333%}.col-md-push-9{left:75%}.col-md-push-8{left:66.66666667%}.col-md-push-7{left:58.33333333%}.col-md-push-6{left:50%}.col-md-push-5{left:41.66666667%}.col-md-push-4{left:33.33333333%}.col-md-push-3{left:25%}.col-md-push-2{left:16.66666667%}.col-md-push-1{left:8.33333333%}.col-md-push-0{left:auto}.col-md-offset-12{margin-left:100%}.col-md-offset-11{margin-left:91.66666667%}.col-md-offset-10{margin-left:83.33333333%}.col-md-offset-9{margin-left:75%}.col-md-offset-8{margin-left:66.66666667%}.col-md-offset-7{margin-left:58.33333333%}.col-md-offset-6{margin-left:50%}.col-md-offset-5{margin-left:41.66666667%}.col-md-offset-4{margin-left:33.33333333%}.col-md-offset-3{margin-left:25%}.col-md-offset-2{margin-left:16.66666667%}.col-md-offset-1{margin-left:8.33333333%}.col-md-offset-0{margin-left:0}}@media (min-width:1200px){.col-lg-1,.col-lg-2,.col-lg-3,.col-lg-4,.col-lg-5,.col-lg-6,.col-lg-7,.col-lg-8,.col-lg-9,.col-lg-10,.col-lg-11,.col-lg-12{float:left}.col-lg-12{width:100%}.col-lg-11{width:91.66666667%}.col-lg-10{width:83.33333333%}.col-lg-9{width:75%}.col-lg-8{width:66.66666667%}.col-lg-7{width:58.33333333%}.col-lg-6{width:50%}.col-lg-5{width:41.66666667%}.col-lg-4{width:33.33333333%}.col-lg-3{width:25%}.col-lg-2{width:16.66666667%}.col-lg-1{width:8.33333333%}.col-lg-pull-12{right:100%}.col-lg-pull-11{right:91.66666667%}.col-lg-pull-10{right:83.33333333%}.col-lg-pull-9{right:75%}.col-lg-pull-8{right:66.66666667%}.col-lg-pull-7{right:58.33333333%}.col-lg-pull-6{right:50%}.col-lg-pull-5{right:41.66666667%}.col-lg-pull-4{right:33.33333333%}.col-lg-pull-3{right:25%}.col-lg-pull-2{right:16.66666667%}.col-lg-pull-1{right:8.33333333%}.col-lg-pull-0{right:auto}.col-lg-push-12{left:100%}.col-lg-push-11{left:91.66666667%}.col-lg-push-10{left:83.33333333%}.col-lg-push-9{left:75%}.col-lg-push-8{left:66.66666667%}.col-lg-push-7{left:58.33333333%}.col-lg-push-6{left:50%}.col-lg-push-5{left:41.66666667%}.col-lg-push-4{left:33.33333333%}.col-lg-push-3{left:25%}.col-lg-push-2{left:16.66666667%}.col-lg-push-1{left:8.33333333%}.col-lg-push-0{left:auto}.col-lg-offset-12{margin-left:100%}.col-lg-offset-11{margin-left:91.66666667%}.col-lg-offset-10{margin-left:83.33333333%}.col-lg-offset-9{margin-left:75%}.col-lg-offset-8{margin-left:66.66666667%}.col-lg-offset-7{margin-left:58.33333333%}.col-lg-offset-6{margin-left:50%}.col-lg-offset-5{margin-left:41.66666667%}.col-lg-offset-4{margin-left:33.33333333%}.col-lg-offset-3{margin-left:25%}.col-lg-offset-2{margin-left:16.66666667%}.col-lg-offset-1{margin-left:8.33333333%}.col-lg-offset-0{margin-left:0}}table{background-color:transparent}th{text-align:left}.table{width:100%;max-width:100%;margin-bottom:20px}.table>thead>tr>th,.table>tbody>tr>th,.table>tfoot>tr>th,.table>thead>tr>td,.table>tbody>tr>td,.table>tfoot>tr>td{padding:8px;line-height:1.42857143;vertical-align:top;border-top:1px solid #ddd}.table>thead>tr>th{vertical-align:bottom;border-bottom:2px solid #ddd}.table>caption+thead>tr:first-child>th,.table>colgroup+thead>tr:first-child>th,.table>thead:first-child>tr:first-child>th,.table>caption+thead>tr:first-child>td,.table>colgroup+thead>tr:first-child>td,.table>thead:first-child>tr:first-child>td{border-top:0}.table>tbody+tbody{border-top:2px solid #ddd}.table .table{background-color:#fff}.table-condensed>thead>tr>th,.table-condensed>tbody>tr>th,.table-condensed>tfoot>tr>th,.table-condensed>thead>tr>td,.table-condensed>tbody>tr>td,.table-condensed>tfoot>tr>td{padding:5px}.table-bordered{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>tbody>tr>th,.table-bordered>tfoot>tr>th,.table-bordered>thead>tr>td,.table-bordered>tbody>tr>td,.table-bordered>tfoot>tr>td{border:1px solid #ddd}.table-bordered>thead>tr>th,.table-bordered>thead>tr>td{border-bottom-width:2px}.table-striped>tbody>tr:nth-child(odd)>td,.table-striped>tbody>tr:nth-child(odd)>th{background-color:#f9f9f9}.table-hover>tbody>tr:hover>td,.table-hover>tbody>tr:hover>th{background-color:#f5f5f5}table col[class*=col-]{position:static;display:table-column;float:none}table td[class*=col-],table th[class*=col-]{position:static;display:table-cell;float:none}.table>thead>tr>td.active,.table>tbody>tr>td.active,.table>tfoot>tr>td.active,.table>thead>tr>th.active,.table>tbody>tr>th.active,.table>tfoot>tr>th.active,.table>thead>tr.active>td,.table>tbody>tr.active>td,.table>tfoot>tr.active>td,.table>thead>tr.active>th,.table>tbody>tr.active>th,.table>tfoot>tr.active>th{background-color:#f5f5f5}.table-hover>tbody>tr>td.active:hover,.table-hover>tbody>tr>th.active:hover,.table-hover>tbody>tr.active:hover>td,.table-hover>tbody>tr:hover>.active,.table-hover>tbody>tr.active:hover>th{background-color:#e8e8e8}.table>thead>tr>td.success,.table>tbody>tr>td.success,.table>tfoot>tr>td.success,.table>thead>tr>th.success,.table>tbody>tr>th.success,.table>tfoot>tr>th.success,.table>thead>tr.success>td,.table>tbody>tr.success>td,.table>tfoot>tr.success>td,.table>thead>tr.success>th,.table>tbody>tr.success>th,.table>tfoot>tr.success>th{background-color:#dff0d8}.table-hover>tbody>tr>td.success:hover,.table-hover>tbody>tr>th.success:hover,.table-hover>tbody>tr.success:hover>td,.table-hover>tbody>tr:hover>.success,.table-hover>tbody>tr.success:hover>th{background-color:#d0e9c6}.table>thead>tr>td.info,.table>tbody>tr>td.info,.table>tfoot>tr>td.info,.table>thead>tr>th.info,.table>tbody>tr>th.info,.table>tfoot>tr>th.info,.table>thead>tr.info>td,.table>tbody>tr.info>td,.table>tfoot>tr.info>td,.table>thead>tr.info>th,.table>tbody>tr.info>th,.table>tfoot>tr.info>th{background-color:#d9edf7}.table-hover>tbody>tr>td.info:hover,.table-hover>tbody>tr>th.info:hover,.table-hover>tbody>tr.info:hover>td,.table-hover>tbody>tr:hover>.info,.table-hover>tbody>tr.info:hover>th{background-color:#c4e3f3}.table>thead>tr>td.warning,.table>tbody>tr>td.warning,.table>tfoot>tr>td.warning,.table>thead>tr>th.warning,.table>tbody>tr>th.warning,.table>tfoot>tr>th.warning,.table>thead>tr.warning>td,.table>tbody>tr.warning>td,.table>tfoot>tr.warning>td,.table>thead>tr.warning>th,.table>tbody>tr.warning>th,.table>tfoot>tr.warning>th{background-color:#fcf8e3}.table-hover>tbody>tr>td.warning:hover,.table-hover>tbody>tr>th.warning:hover,.table-hover>tbody>tr.warning:hover>td,.table-hover>tbody>tr:hover>.warning,.table-hover>tbody>tr.warning:hover>th{background-color:#faf2cc}.table>thead>tr>td.danger,.table>tbody>tr>td.danger,.table>tfoot>tr>td.danger,.table>thead>tr>th.danger,.table>tbody>tr>th.danger,.table>tfoot>tr>th.danger,.table>thead>tr.danger>td,.table>tbody>tr.danger>td,.table>tfoot>tr.danger>td,.table>thead>tr.danger>th,.table>tbody>tr.danger>th,.table>tfoot>tr.danger>th{background-color:#f2dede}.table-hover>tbody>tr>td.danger:hover,.table-hover>tbody>tr>th.danger:hover,.table-hover>tbody>tr.danger:hover>td,.table-hover>tbody>tr:hover>.danger,.table-hover>tbody>tr.danger:hover>th{background-color:#ebcccc}@media screen and (max-width:767px){.table-responsive{width:100%;margin-bottom:15px;overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;-ms-overflow-style:-ms-autohiding-scrollbar;border:1px solid #ddd}.table-responsive>.table{margin-bottom:0}.table-responsive>.table>thead>tr>th,.table-responsive>.table>tbody>tr>th,.table-responsive>.table>tfoot>tr>th,.table-responsive>.table>thead>tr>td,.table-responsive>.table>tbody>tr>td,.table-responsive>.table>tfoot>tr>td{white-space:nowrap}.table-responsive>.table-bordered{border:0}.table-responsive>.table-bordered>thead>tr>th:first-child,.table-responsive>.table-bordered>tbody>tr>th:first-child,.table-responsive>.table-bordered>tfoot>tr>th:first-child,.table-responsive>.table-bordered>thead>tr>td:first-child,.table-responsive>.table-bordered>tbody>tr>td:first-child,.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.table-responsive>.table-bordered>thead>tr>th:last-child,.table-responsive>.table-bordered>tbody>tr>th:last-child,.table-responsive>.table-bordered>tfoot>tr>th:last-child,.table-responsive>.table-bordered>thead>tr>td:last-child,.table-responsive>.table-bordered>tbody>tr>td:last-child,.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.table-responsive>.table-bordered>tbody>tr:last-child>th,.table-responsive>.table-bordered>tfoot>tr:last-child>th,.table-responsive>.table-bordered>tbody>tr:last-child>td,.table-responsive>.table-bordered>tfoot>tr:last-child>td{border-bottom:0}}fieldset{min-width:0;padding:0;margin:0;border:0}legend{display:block;width:100%;padding:0;margin-bottom:20px;font-size:21px;line-height:inherit;color:#333;border:0;border-bottom:1px solid #e5e5e5}label{display:inline-block;max-width:100%;margin-bottom:5px;font-weight:700}input[type=search]{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}input[type=radio],input[type=checkbox]{margin:4px 0 0;margin-top:1px \9;line-height:normal}input[type=file]{display:block}input[type=range]{display:block;width:100%}select[multiple],select[size]{height:auto}input[type=file]:focus,input[type=radio]:focus,input[type=checkbox]:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}output{display:block;padding-top:7px;font-size:14px;line-height:1.42857143;color:#555}.form-control{display:block;width:100%;height:34px;padding:6px 12px;font-size:14px;line-height:1.42857143;color:#555;background-color:#fff;background-image:none;border:1px solid #ccc;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075);-webkit-transition:border-color ease-in-out .15s,-webkit-box-shadow ease-in-out .15s;-o-transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s;transition:border-color ease-in-out .15s,box-shadow ease-in-out .15s}.form-control:focus{border-color:#66afe9;outline:0;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6);box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 8px rgba(102,175,233,.6)}.form-control::-moz-placeholder{color:#777;opacity:1}.form-control:-ms-input-placeholder{color:#777}.form-control::-webkit-input-placeholder{color:#777}.form-control[disabled],.form-control[readonly],fieldset[disabled] .form-control{cursor:not-allowed;background-color:#eee;opacity:1}textarea.form-control{height:auto}input[type=search]{-webkit-appearance:none}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{line-height:34px;line-height:1.42857143 \0}input[type=date].input-sm,input[type=time].input-sm,input[type=datetime-local].input-sm,input[type=month].input-sm{line-height:30px}input[type=date].input-lg,input[type=time].input-lg,input[type=datetime-local].input-lg,input[type=month].input-lg{line-height:46px}.form-group{margin-bottom:15px}.radio,.checkbox{position:relative;display:block;min-height:20px;margin-top:10px;margin-bottom:10px}.radio label,.checkbox label{padding-left:20px;margin-bottom:0;font-weight:400;cursor:pointer}.radio input[type=radio],.radio-inline input[type=radio],.checkbox input[type=checkbox],.checkbox-inline input[type=checkbox]{position:absolute;margin-top:4px \9;margin-left:-20px}.radio+.radio,.checkbox+.checkbox{margin-top:-5px}.radio-inline,.checkbox-inline{display:inline-block;padding-left:20px;margin-bottom:0;font-weight:400;vertical-align:middle;cursor:pointer}.radio-inline+.radio-inline,.checkbox-inline+.checkbox-inline{margin-top:0;margin-left:10px}input[type=radio][disabled],input[type=checkbox][disabled],input[type=radio].disabled,input[type=checkbox].disabled,fieldset[disabled] input[type=radio],fieldset[disabled] input[type=checkbox]{cursor:not-allowed}.radio-inline.disabled,.checkbox-inline.disabled,fieldset[disabled] .radio-inline,fieldset[disabled] .checkbox-inline{cursor:not-allowed}.radio.disabled label,.checkbox.disabled label,fieldset[disabled] .radio label,fieldset[disabled] .checkbox label{cursor:not-allowed}.form-control-static{padding-top:7px;padding-bottom:7px;margin-bottom:0}.form-control-static.input-lg,.form-control-static.input-sm{padding-right:0;padding-left:0}.input-sm,.form-horizontal .form-group-sm .form-control{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-sm{height:30px;line-height:30px}textarea.input-sm,select[multiple].input-sm{height:auto}.input-lg,.form-horizontal .form-group-lg .form-control{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-lg{height:46px;line-height:46px}textarea.input-lg,select[multiple].input-lg{height:auto}.has-feedback{position:relative}.has-feedback .form-control{padding-right:42.5px}.form-control-feedback{position:absolute;top:25px;right:0;z-index:2;display:block;width:34px;height:34px;line-height:34px;text-align:center}.input-lg+.form-control-feedback{width:46px;height:46px;line-height:46px}.input-sm+.form-control-feedback{width:30px;height:30px;line-height:30px}.has-success .help-block,.has-success .control-label,.has-success .radio,.has-success .checkbox,.has-success .radio-inline,.has-success .checkbox-inline{color:#3c763d}.has-success .form-control{border-color:#3c763d;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-success .form-control:focus{border-color:#2b542c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #67b168}.has-success .input-group-addon{color:#3c763d;background-color:#dff0d8;border-color:#3c763d}.has-success .form-control-feedback{color:#3c763d}.has-warning .help-block,.has-warning .control-label,.has-warning .radio,.has-warning .checkbox,.has-warning .radio-inline,.has-warning .checkbox-inline{color:#8a6d3b}.has-warning .form-control{border-color:#8a6d3b;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-warning .form-control:focus{border-color:#66512c;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #c0a16b}.has-warning .input-group-addon{color:#8a6d3b;background-color:#fcf8e3;border-color:#8a6d3b}.has-warning .form-control-feedback{color:#8a6d3b}.has-error .help-block,.has-error .control-label,.has-error .radio,.has-error .checkbox,.has-error .radio-inline,.has-error .checkbox-inline{color:#a94442}.has-error .form-control{border-color:#a94442;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075);box-shadow:inset 0 1px 1px rgba(0,0,0,.075)}.has-error .form-control:focus{border-color:#843534;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483;box-shadow:inset 0 1px 1px rgba(0,0,0,.075),0 0 6px #ce8483}.has-error .input-group-addon{color:#a94442;background-color:#f2dede;border-color:#a94442}.has-error .form-control-feedback{color:#a94442}.has-feedback label.sr-only~.form-control-feedback{top:0}.help-block{display:block;margin-top:5px;margin-bottom:10px;color:#737373}@media (min-width:768px){.form-inline .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.form-inline .form-control{display:inline-block;width:auto;vertical-align:middle}.form-inline .input-group{display:inline-table;vertical-align:middle}.form-inline .input-group .input-group-addon,.form-inline .input-group .input-group-btn,.form-inline .input-group .form-control{width:auto}.form-inline .input-group>.form-control{width:100%}.form-inline .control-label{margin-bottom:0;vertical-align:middle}.form-inline .radio,.form-inline .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.form-inline .radio label,.form-inline .checkbox label{padding-left:0}.form-inline .radio input[type=radio],.form-inline .checkbox input[type=checkbox]{position:relative;margin-left:0}.form-inline .has-feedback .form-control-feedback{top:0}}.form-horizontal .radio,.form-horizontal .checkbox,.form-horizontal .radio-inline,.form-horizontal .checkbox-inline{padding-top:7px;margin-top:0;margin-bottom:0}.form-horizontal .radio,.form-horizontal .checkbox{min-height:27px}.form-horizontal .form-group{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.form-horizontal .control-label{padding-top:7px;margin-bottom:0;text-align:right}}.form-horizontal .has-feedback .form-control-feedback{top:0;right:15px}@media (min-width:768px){.form-horizontal .form-group-lg .control-label{padding-top:14.3px}}@media (min-width:768px){.form-horizontal .form-group-sm .control-label{padding-top:6px}}.btn{display:inline-block;padding:6px 12px;margin-bottom:0;font-size:14px;font-weight:400;line-height:1.42857143;text-align:center;white-space:nowrap;vertical-align:middle;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;background-image:none;border:1px solid transparent;border-radius:4px}.btn:focus,.btn:active:focus,.btn.active:focus{outline:thin dotted;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}.btn:hover,.btn:focus{color:#333;text-decoration:none}.btn:active,.btn.active{background-image:none;outline:0;-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn.disabled,.btn[disabled],fieldset[disabled] .btn{pointer-events:none;cursor:not-allowed;filter:alpha(opacity=65);-webkit-box-shadow:none;box-shadow:none;opacity:.65}.btn-default{color:#333;background-color:#fff;border-color:#ccc}.btn-default:hover,.btn-default:focus,.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{color:#333;background-color:#e6e6e6;border-color:#adadad}.btn-default:active,.btn-default.active,.open>.dropdown-toggle.btn-default{background-image:none}.btn-default.disabled,.btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-default .badge{color:#fff;background-color:#333}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}.btn-primary:hover,.btn-primary:focus,.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{color:#fff;background-color:#3071a9;border-color:#285e8e}.btn-primary:active,.btn-primary.active,.open>.dropdown-toggle.btn-primary{background-image:none}.btn-primary.disabled,.btn-primary[disabled],fieldset[disabled] .btn-primary,.btn-primary.disabled:hover,.btn-primary[disabled]:hover,fieldset[disabled] .btn-primary:hover,.btn-primary.disabled:focus,.btn-primary[disabled]:focus,fieldset[disabled] .btn-primary:focus,.btn-primary.disabled:active,.btn-primary[disabled]:active,fieldset[disabled] .btn-primary:active,.btn-primary.disabled.active,.btn-primary[disabled].active,fieldset[disabled] .btn-primary.active{background-color:#428bca;border-color:#357ebd}.btn-primary .badge{color:#428bca;background-color:#fff}.btn-success{color:#fff;background-color:#5cb85c;border-color:#4cae4c}.btn-success:hover,.btn-success:focus,.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{color:#fff;background-color:#449d44;border-color:#398439}.btn-success:active,.btn-success.active,.open>.dropdown-toggle.btn-success{background-image:none}.btn-success.disabled,.btn-success[disabled],fieldset[disabled] .btn-success,.btn-success.disabled:hover,.btn-success[disabled]:hover,fieldset[disabled] .btn-success:hover,.btn-success.disabled:focus,.btn-success[disabled]:focus,fieldset[disabled] .btn-success:focus,.btn-success.disabled:active,.btn-success[disabled]:active,fieldset[disabled] .btn-success:active,.btn-success.disabled.active,.btn-success[disabled].active,fieldset[disabled] .btn-success.active{background-color:#5cb85c;border-color:#4cae4c}.btn-success .badge{color:#5cb85c;background-color:#fff}.btn-info{color:#fff;background-color:#5bc0de;border-color:#46b8da}.btn-info:hover,.btn-info:focus,.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{color:#fff;background-color:#31b0d5;border-color:#269abc}.btn-info:active,.btn-info.active,.open>.dropdown-toggle.btn-info{background-image:none}.btn-info.disabled,.btn-info[disabled],fieldset[disabled] .btn-info,.btn-info.disabled:hover,.btn-info[disabled]:hover,fieldset[disabled] .btn-info:hover,.btn-info.disabled:focus,.btn-info[disabled]:focus,fieldset[disabled] .btn-info:focus,.btn-info.disabled:active,.btn-info[disabled]:active,fieldset[disabled] .btn-info:active,.btn-info.disabled.active,.btn-info[disabled].active,fieldset[disabled] .btn-info.active{background-color:#5bc0de;border-color:#46b8da}.btn-info .badge{color:#5bc0de;background-color:#fff}.btn-warning{color:#fff;background-color:#f0ad4e;border-color:#eea236}.btn-warning:hover,.btn-warning:focus,.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{color:#fff;background-color:#ec971f;border-color:#d58512}.btn-warning:active,.btn-warning.active,.open>.dropdown-toggle.btn-warning{background-image:none}.btn-warning.disabled,.btn-warning[disabled],fieldset[disabled] .btn-warning,.btn-warning.disabled:hover,.btn-warning[disabled]:hover,fieldset[disabled] .btn-warning:hover,.btn-warning.disabled:focus,.btn-warning[disabled]:focus,fieldset[disabled] .btn-warning:focus,.btn-warning.disabled:active,.btn-warning[disabled]:active,fieldset[disabled] .btn-warning:active,.btn-warning.disabled.active,.btn-warning[disabled].active,fieldset[disabled] .btn-warning.active{background-color:#f0ad4e;border-color:#eea236}.btn-warning .badge{color:#f0ad4e;background-color:#fff}.btn-danger{color:#fff;background-color:#d9534f;border-color:#d43f3a}.btn-danger:hover,.btn-danger:focus,.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{color:#fff;background-color:#c9302c;border-color:#ac2925}.btn-danger:active,.btn-danger.active,.open>.dropdown-toggle.btn-danger{background-image:none}.btn-danger.disabled,.btn-danger[disabled],fieldset[disabled] .btn-danger,.btn-danger.disabled:hover,.btn-danger[disabled]:hover,fieldset[disabled] .btn-danger:hover,.btn-danger.disabled:focus,.btn-danger[disabled]:focus,fieldset[disabled] .btn-danger:focus,.btn-danger.disabled:active,.btn-danger[disabled]:active,fieldset[disabled] .btn-danger:active,.btn-danger.disabled.active,.btn-danger[disabled].active,fieldset[disabled] .btn-danger.active{background-color:#d9534f;border-color:#d43f3a}.btn-danger .badge{color:#d9534f;background-color:#fff}.btn-link{font-weight:400;color:#428bca;cursor:pointer;border-radius:0}.btn-link,.btn-link:active,.btn-link[disabled],fieldset[disabled] .btn-link{background-color:transparent;-webkit-box-shadow:none;box-shadow:none}.btn-link,.btn-link:hover,.btn-link:focus,.btn-link:active{border-color:transparent}.btn-link:hover,.btn-link:focus{color:#2a6496;text-decoration:underline;background-color:transparent}.btn-link[disabled]:hover,fieldset[disabled] .btn-link:hover,.btn-link[disabled]:focus,fieldset[disabled] .btn-link:focus{color:#777;text-decoration:none}.btn-lg,.btn-group-lg>.btn{padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}.btn-sm,.btn-group-sm>.btn{padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}.btn-xs,.btn-group-xs>.btn{padding:1px 5px;font-size:12px;line-height:1.5;border-radius:3px}.btn-block{display:block;width:100%}.btn-block+.btn-block{margin-top:5px}input[type=submit].btn-block,input[type=reset].btn-block,input[type=button].btn-block{width:100%}.fade{opacity:0;-webkit-transition:opacity .15s linear;-o-transition:opacity .15s linear;transition:opacity .15s linear}.fade.in{opacity:1}.collapse{display:none}.collapse.in{display:block}tr.collapse.in{display:table-row}tbody.collapse.in{display:table-row-group}.collapsing{position:relative;height:0;overflow:hidden;-webkit-transition:height .35s ease;-o-transition:height .35s ease;transition:height .35s ease}.caret{display:inline-block;width:0;height:0;margin-left:2px;vertical-align:middle;border-top:4px solid;border-right:4px solid transparent;border-left:4px solid transparent}.dropdown{position:relative}.dropdown-toggle:focus{outline:0}.dropdown-menu{position:absolute;top:100%;left:0;z-index:1000;display:none;float:left;min-width:160px;padding:5px 0;margin:2px 0 0;font-size:14px;text-align:left;list-style:none;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.15);border-radius:4px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175)}.dropdown-menu.pull-right{right:0;left:auto}.dropdown-menu .divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.dropdown-menu>li>a{display:block;padding:3px 20px;clear:both;font-weight:400;line-height:1.42857143;color:#333;white-space:nowrap}.dropdown-menu>li>a:hover,.dropdown-menu>li>a:focus{color:#262626;text-decoration:none;background-color:#f5f5f5}.dropdown-menu>.active>a,.dropdown-menu>.active>a:hover,.dropdown-menu>.active>a:focus{color:#fff;text-decoration:none;background-color:#428bca;outline:0}.dropdown-menu>.disabled>a,.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{color:#777}.dropdown-menu>.disabled>a:hover,.dropdown-menu>.disabled>a:focus{text-decoration:none;cursor:not-allowed;background-color:transparent;background-image:none;filter:progid:DXImageTransform.Microsoft.gradient(enabled=false)}.open>.dropdown-menu{display:block}.open>a{outline:0}.dropdown-menu-right{right:0;left:auto}.dropdown-menu-left{right:auto;left:0}.dropdown-header{display:block;padding:3px 20px;font-size:12px;line-height:1.42857143;color:#777;white-space:nowrap}.dropdown-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:990}.pull-right>.dropdown-menu{right:0;left:auto}.dropup .caret,.navbar-fixed-bottom .dropdown .caret{content:"";border-top:0;border-bottom:4px solid}.dropup .dropdown-menu,.navbar-fixed-bottom .dropdown .dropdown-menu{top:auto;bottom:100%;margin-bottom:1px}@media (min-width:768px){.navbar-right .dropdown-menu{right:0;left:auto}.navbar-right .dropdown-menu-left{right:auto;left:0}}.btn-group,.btn-group-vertical{position:relative;display:inline-block;vertical-align:middle}.btn-group>.btn,.btn-group-vertical>.btn{position:relative;float:left}.btn-group>.btn:hover,.btn-group-vertical>.btn:hover,.btn-group>.btn:focus,.btn-group-vertical>.btn:focus,.btn-group>.btn:active,.btn-group-vertical>.btn:active,.btn-group>.btn.active,.btn-group-vertical>.btn.active{z-index:2}.btn-group>.btn:focus,.btn-group-vertical>.btn:focus{outline:0}.btn-group .btn+.btn,.btn-group .btn+.btn-group,.btn-group .btn-group+.btn,.btn-group .btn-group+.btn-group{margin-left:-1px}.btn-toolbar{margin-left:-5px}.btn-toolbar .btn-group,.btn-toolbar .input-group{float:left}.btn-toolbar>.btn,.btn-toolbar>.btn-group,.btn-toolbar>.input-group{margin-left:5px}.btn-group>.btn:not(:first-child):not(:last-child):not(.dropdown-toggle){border-radius:0}.btn-group>.btn:first-child{margin-left:0}.btn-group>.btn:first-child:not(:last-child):not(.dropdown-toggle){border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn:last-child:not(:first-child),.btn-group>.dropdown-toggle:not(:first-child){border-top-left-radius:0;border-bottom-left-radius:0}.btn-group>.btn-group{float:left}.btn-group>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group>.btn-group:first-child>.btn:last-child,.btn-group>.btn-group:first-child>.dropdown-toggle{border-top-right-radius:0;border-bottom-right-radius:0}.btn-group>.btn-group:last-child>.btn:first-child{border-top-left-radius:0;border-bottom-left-radius:0}.btn-group .dropdown-toggle:active,.btn-group.open .dropdown-toggle{outline:0}.btn-group>.btn+.dropdown-toggle{padding-right:8px;padding-left:8px}.btn-group>.btn-lg+.dropdown-toggle{padding-right:12px;padding-left:12px}.btn-group.open .dropdown-toggle{-webkit-box-shadow:inset 0 3px 5px rgba(0,0,0,.125);box-shadow:inset 0 3px 5px rgba(0,0,0,.125)}.btn-group.open .dropdown-toggle.btn-link{-webkit-box-shadow:none;box-shadow:none}.btn .caret{margin-left:0}.btn-lg .caret{border-width:5px 5px 0;border-bottom-width:0}.dropup .btn-lg .caret{border-width:0 5px 5px}.btn-group-vertical>.btn,.btn-group-vertical>.btn-group,.btn-group-vertical>.btn-group>.btn{display:block;float:none;width:100%;max-width:100%}.btn-group-vertical>.btn-group>.btn{float:none}.btn-group-vertical>.btn+.btn,.btn-group-vertical>.btn+.btn-group,.btn-group-vertical>.btn-group+.btn,.btn-group-vertical>.btn-group+.btn-group{margin-top:-1px;margin-left:0}.btn-group-vertical>.btn:not(:first-child):not(:last-child){border-radius:0}.btn-group-vertical>.btn:first-child:not(:last-child){border-top-right-radius:4px;border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn:last-child:not(:first-child){border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:4px}.btn-group-vertical>.btn-group:not(:first-child):not(:last-child)>.btn{border-radius:0}.btn-group-vertical>.btn-group:first-child:not(:last-child)>.btn:last-child,.btn-group-vertical>.btn-group:first-child:not(:last-child)>.dropdown-toggle{border-bottom-right-radius:0;border-bottom-left-radius:0}.btn-group-vertical>.btn-group:last-child:not(:first-child)>.btn:first-child{border-top-left-radius:0;border-top-right-radius:0}.btn-group-justified{display:table;width:100%;table-layout:fixed;border-collapse:separate}.btn-group-justified>.btn,.btn-group-justified>.btn-group{display:table-cell;float:none;width:1%}.btn-group-justified>.btn-group .btn{width:100%}.btn-group-justified>.btn-group .dropdown-menu{left:auto}[data-toggle=buttons]>.btn>input[type=radio],[data-toggle=buttons]>.btn>input[type=checkbox]{position:absolute;z-index:-1;filter:alpha(opacity=0);opacity:0}.input-group{position:relative;display:table;border-collapse:separate}.input-group[class*=col-]{float:none;padding-right:0;padding-left:0}.input-group .form-control{position:relative;z-index:2;float:left;width:100%;margin-bottom:0}.input-group-lg>.form-control,.input-group-lg>.input-group-addon,.input-group-lg>.input-group-btn>.btn{height:46px;padding:10px 16px;font-size:18px;line-height:1.33;border-radius:6px}select.input-group-lg>.form-control,select.input-group-lg>.input-group-addon,select.input-group-lg>.input-group-btn>.btn{height:46px;line-height:46px}textarea.input-group-lg>.form-control,textarea.input-group-lg>.input-group-addon,textarea.input-group-lg>.input-group-btn>.btn,select[multiple].input-group-lg>.form-control,select[multiple].input-group-lg>.input-group-addon,select[multiple].input-group-lg>.input-group-btn>.btn{height:auto}.input-group-sm>.form-control,.input-group-sm>.input-group-addon,.input-group-sm>.input-group-btn>.btn{height:30px;padding:5px 10px;font-size:12px;line-height:1.5;border-radius:3px}select.input-group-sm>.form-control,select.input-group-sm>.input-group-addon,select.input-group-sm>.input-group-btn>.btn{height:30px;line-height:30px}textarea.input-group-sm>.form-control,textarea.input-group-sm>.input-group-addon,textarea.input-group-sm>.input-group-btn>.btn,select[multiple].input-group-sm>.form-control,select[multiple].input-group-sm>.input-group-addon,select[multiple].input-group-sm>.input-group-btn>.btn{height:auto}.input-group-addon,.input-group-btn,.input-group .form-control{display:table-cell}.input-group-addon:not(:first-child):not(:last-child),.input-group-btn:not(:first-child):not(:last-child),.input-group .form-control:not(:first-child):not(:last-child){border-radius:0}.input-group-addon,.input-group-btn{width:1%;white-space:nowrap;vertical-align:middle}.input-group-addon{padding:6px 12px;font-size:14px;font-weight:400;line-height:1;color:#555;text-align:center;background-color:#eee;border:1px solid #ccc;border-radius:4px}.input-group-addon.input-sm{padding:5px 10px;font-size:12px;border-radius:3px}.input-group-addon.input-lg{padding:10px 16px;font-size:18px;border-radius:6px}.input-group-addon input[type=radio],.input-group-addon input[type=checkbox]{margin-top:0}.input-group .form-control:first-child,.input-group-addon:first-child,.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group>.btn,.input-group-btn:first-child>.dropdown-toggle,.input-group-btn:last-child>.btn:not(:last-child):not(.dropdown-toggle),.input-group-btn:last-child>.btn-group:not(:last-child)>.btn{border-top-right-radius:0;border-bottom-right-radius:0}.input-group-addon:first-child{border-right:0}.input-group .form-control:last-child,.input-group-addon:last-child,.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group>.btn,.input-group-btn:last-child>.dropdown-toggle,.input-group-btn:first-child>.btn:not(:first-child),.input-group-btn:first-child>.btn-group:not(:first-child)>.btn{border-top-left-radius:0;border-bottom-left-radius:0}.input-group-addon:last-child{border-left:0}.input-group-btn{position:relative;font-size:0;white-space:nowrap}.input-group-btn>.btn{position:relative}.input-group-btn>.btn+.btn{margin-left:-1px}.input-group-btn>.btn:hover,.input-group-btn>.btn:focus,.input-group-btn>.btn:active{z-index:2}.input-group-btn:first-child>.btn,.input-group-btn:first-child>.btn-group{margin-right:-1px}.input-group-btn:last-child>.btn,.input-group-btn:last-child>.btn-group{margin-left:-1px}.nav{padding-left:0;margin-bottom:0;list-style:none}.nav>li{position:relative;display:block}.nav>li>a{position:relative;display:block;padding:10px 15px}.nav>li>a:hover,.nav>li>a:focus{text-decoration:none;background-color:#eee}.nav>li.disabled>a{color:#777}.nav>li.disabled>a:hover,.nav>li.disabled>a:focus{color:#777;text-decoration:none;cursor:not-allowed;background-color:transparent}.nav .open>a,.nav .open>a:hover,.nav .open>a:focus{background-color:#eee;border-color:#428bca}.nav .nav-divider{height:1px;margin:9px 0;overflow:hidden;background-color:#e5e5e5}.nav>li>a>img{max-width:none}.nav-tabs{border-bottom:1px solid #ddd}.nav-tabs>li{float:left;margin-bottom:-1px}.nav-tabs>li>a{margin-right:2px;line-height:1.42857143;border:1px solid transparent;border-radius:4px 4px 0 0}.nav-tabs>li>a:hover{border-color:#eee #eee #ddd}.nav-tabs>li.active>a,.nav-tabs>li.active>a:hover,.nav-tabs>li.active>a:focus{color:#555;cursor:default;background-color:#fff;border:1px solid #ddd;border-bottom-color:transparent}.nav-tabs.nav-justified{width:100%;border-bottom:0}.nav-tabs.nav-justified>li{float:none}.nav-tabs.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-tabs.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-tabs.nav-justified>li{display:table-cell;width:1%}.nav-tabs.nav-justified>li>a{margin-bottom:0}}.nav-tabs.nav-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs.nav-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs.nav-justified>.active>a,.nav-tabs.nav-justified>.active>a:hover,.nav-tabs.nav-justified>.active>a:focus{border-bottom-color:#fff}}.nav-pills>li{float:left}.nav-pills>li>a{border-radius:4px}.nav-pills>li+li{margin-left:2px}.nav-pills>li.active>a,.nav-pills>li.active>a:hover,.nav-pills>li.active>a:focus{color:#fff;background-color:#428bca}.nav-stacked>li{float:none}.nav-stacked>li+li{margin-top:2px;margin-left:0}.nav-justified{width:100%}.nav-justified>li{float:none}.nav-justified>li>a{margin-bottom:5px;text-align:center}.nav-justified>.dropdown .dropdown-menu{top:auto;left:auto}@media (min-width:768px){.nav-justified>li{display:table-cell;width:1%}.nav-justified>li>a{margin-bottom:0}}.nav-tabs-justified{border-bottom:0}.nav-tabs-justified>li>a{margin-right:0;border-radius:4px}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border:1px solid #ddd}@media (min-width:768px){.nav-tabs-justified>li>a{border-bottom:1px solid #ddd;border-radius:4px 4px 0 0}.nav-tabs-justified>.active>a,.nav-tabs-justified>.active>a:hover,.nav-tabs-justified>.active>a:focus{border-bottom-color:#fff}}.tab-content>.tab-pane{display:none}.tab-content>.active{display:block}.nav-tabs .dropdown-menu{margin-top:-1px;border-top-left-radius:0;border-top-right-radius:0}.navbar{position:relative;min-height:50px;margin-bottom:20px;border:1px solid transparent}@media (min-width:768px){.navbar{border-radius:4px}}@media (min-width:768px){.navbar-header{float:left}}.navbar-collapse{padding-right:15px;padding-left:15px;overflow-x:visible;-webkit-overflow-scrolling:touch;border-top:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1)}.navbar-collapse.in{overflow-y:auto}@media (min-width:768px){.navbar-collapse{width:auto;border-top:0;-webkit-box-shadow:none;box-shadow:none}.navbar-collapse.collapse{display:block!important;height:auto!important;padding-bottom:0;overflow:visible!important}.navbar-collapse.in{overflow-y:visible}.navbar-fixed-top .navbar-collapse,.navbar-static-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{padding-right:0;padding-left:0}}.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:340px}@media (max-width:480px) and (orientation:landscape){.navbar-fixed-top .navbar-collapse,.navbar-fixed-bottom .navbar-collapse{max-height:200px}}.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:-15px;margin-left:-15px}@media (min-width:768px){.container>.navbar-header,.container-fluid>.navbar-header,.container>.navbar-collapse,.container-fluid>.navbar-collapse{margin-right:0;margin-left:0}}.navbar-static-top{z-index:1000;border-width:0 0 1px}@media (min-width:768px){.navbar-static-top{border-radius:0}}.navbar-fixed-top,.navbar-fixed-bottom{position:fixed;right:0;left:0;z-index:1030;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@media (min-width:768px){.navbar-fixed-top,.navbar-fixed-bottom{border-radius:0}}.navbar-fixed-top{top:0;border-width:0 0 1px}.navbar-fixed-bottom{bottom:0;margin-bottom:0;border-width:1px 0 0}.navbar-brand{float:left;height:50px;padding:15px 15px;font-size:18px;line-height:20px}.navbar-brand:hover,.navbar-brand:focus{text-decoration:none}@media (min-width:768px){.navbar>.container .navbar-brand,.navbar>.container-fluid .navbar-brand{margin-left:-15px}}.navbar-toggle{position:relative;float:right;padding:9px 10px;margin-top:8px;margin-right:15px;margin-bottom:8px;background-color:transparent;background-image:none;border:1px solid transparent;border-radius:4px}.navbar-toggle:focus{outline:0}.navbar-toggle .icon-bar{display:block;width:22px;height:2px;border-radius:1px}.navbar-toggle .icon-bar+.icon-bar{margin-top:4px}@media (min-width:768px){.navbar-toggle{display:none}}.navbar-nav{margin:7.5px -15px}.navbar-nav>li>a{padding-top:10px;padding-bottom:10px;line-height:20px}@media (max-width:767px){.navbar-nav .open .dropdown-menu{position:static;float:none;width:auto;margin-top:0;background-color:transparent;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-nav .open .dropdown-menu>li>a,.navbar-nav .open .dropdown-menu .dropdown-header{padding:5px 15px 5px 25px}.navbar-nav .open .dropdown-menu>li>a{line-height:20px}.navbar-nav .open .dropdown-menu>li>a:hover,.navbar-nav .open .dropdown-menu>li>a:focus{background-image:none}}@media (min-width:768px){.navbar-nav{float:left;margin:0}.navbar-nav>li{float:left}.navbar-nav>li>a{padding-top:15px;padding-bottom:15px}.navbar-nav.navbar-right:last-child{margin-right:-15px}}@media (min-width:768px){.navbar-left{float:left!important}.navbar-right{float:right!important}}.navbar-form{padding:10px 15px;margin-top:8px;margin-right:-15px;margin-bottom:8px;margin-left:-15px;border-top:1px solid transparent;border-bottom:1px solid transparent;-webkit-box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1);box-shadow:inset 0 1px 0 rgba(255,255,255,.1),0 1px 0 rgba(255,255,255,.1)}@media (min-width:768px){.navbar-form .form-group{display:inline-block;margin-bottom:0;vertical-align:middle}.navbar-form .form-control{display:inline-block;width:auto;vertical-align:middle}.navbar-form .input-group{display:inline-table;vertical-align:middle}.navbar-form .input-group .input-group-addon,.navbar-form .input-group .input-group-btn,.navbar-form .input-group .form-control{width:auto}.navbar-form .input-group>.form-control{width:100%}.navbar-form .control-label{margin-bottom:0;vertical-align:middle}.navbar-form .radio,.navbar-form .checkbox{display:inline-block;margin-top:0;margin-bottom:0;vertical-align:middle}.navbar-form .radio label,.navbar-form .checkbox label{padding-left:0}.navbar-form .radio input[type=radio],.navbar-form .checkbox input[type=checkbox]{position:relative;margin-left:0}.navbar-form .has-feedback .form-control-feedback{top:0}}@media (max-width:767px){.navbar-form .form-group{margin-bottom:5px}}@media (min-width:768px){.navbar-form{width:auto;padding-top:0;padding-bottom:0;margin-right:0;margin-left:0;border:0;-webkit-box-shadow:none;box-shadow:none}.navbar-form.navbar-right:last-child{margin-right:-15px}}.navbar-nav>li>.dropdown-menu{margin-top:0;border-top-left-radius:0;border-top-right-radius:0}.navbar-fixed-bottom .navbar-nav>li>.dropdown-menu{border-bottom-right-radius:0;border-bottom-left-radius:0}.navbar-btn{margin-top:8px;margin-bottom:8px}.navbar-btn.btn-sm{margin-top:10px;margin-bottom:10px}.navbar-btn.btn-xs{margin-top:14px;margin-bottom:14px}.navbar-text{margin-top:15px;margin-bottom:15px}@media (min-width:768px){.navbar-text{float:left;margin-right:15px;margin-left:15px}.navbar-text.navbar-right:last-child{margin-right:0}}.navbar-default{background-color:#f8f8f8;border-color:#e7e7e7}.navbar-default .navbar-brand{color:#777}.navbar-default .navbar-brand:hover,.navbar-default .navbar-brand:focus{color:#5e5e5e;background-color:transparent}.navbar-default .navbar-text{color:#777}.navbar-default .navbar-nav>li>a{color:#777}.navbar-default .navbar-nav>li>a:hover,.navbar-default .navbar-nav>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav>.active>a,.navbar-default .navbar-nav>.active>a:hover,.navbar-default .navbar-nav>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav>.disabled>a,.navbar-default .navbar-nav>.disabled>a:hover,.navbar-default .navbar-nav>.disabled>a:focus{color:#ccc;background-color:transparent}.navbar-default .navbar-toggle{border-color:#ddd}.navbar-default .navbar-toggle:hover,.navbar-default .navbar-toggle:focus{background-color:#ddd}.navbar-default .navbar-toggle .icon-bar{background-color:#888}.navbar-default .navbar-collapse,.navbar-default .navbar-form{border-color:#e7e7e7}.navbar-default .navbar-nav>.open>a,.navbar-default .navbar-nav>.open>a:hover,.navbar-default .navbar-nav>.open>a:focus{color:#555;background-color:#e7e7e7}@media (max-width:767px){.navbar-default .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-default .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>li>a:focus{color:#333;background-color:transparent}.navbar-default .navbar-nav .open .dropdown-menu>.active>a,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.active>a:focus{color:#555;background-color:#e7e7e7}.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-default .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#ccc;background-color:transparent}}.navbar-default .navbar-link{color:#777}.navbar-default .navbar-link:hover{color:#333}.navbar-default .btn-link{color:#777}.navbar-default .btn-link:hover,.navbar-default .btn-link:focus{color:#333}.navbar-default .btn-link[disabled]:hover,fieldset[disabled] .navbar-default .btn-link:hover,.navbar-default .btn-link[disabled]:focus,fieldset[disabled] .navbar-default .btn-link:focus{color:#ccc}.navbar-inverse{background-color:#222;border-color:#080808}.navbar-inverse .navbar-brand{color:#777}.navbar-inverse .navbar-brand:hover,.navbar-inverse .navbar-brand:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-text{color:#777}.navbar-inverse .navbar-nav>li>a{color:#777}.navbar-inverse .navbar-nav>li>a:hover,.navbar-inverse .navbar-nav>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav>.active>a,.navbar-inverse .navbar-nav>.active>a:hover,.navbar-inverse .navbar-nav>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav>.disabled>a,.navbar-inverse .navbar-nav>.disabled>a:hover,.navbar-inverse .navbar-nav>.disabled>a:focus{color:#444;background-color:transparent}.navbar-inverse .navbar-toggle{border-color:#333}.navbar-inverse .navbar-toggle:hover,.navbar-inverse .navbar-toggle:focus{background-color:#333}.navbar-inverse .navbar-toggle .icon-bar{background-color:#fff}.navbar-inverse .navbar-collapse,.navbar-inverse .navbar-form{border-color:#101010}.navbar-inverse .navbar-nav>.open>a,.navbar-inverse .navbar-nav>.open>a:hover,.navbar-inverse .navbar-nav>.open>a:focus{color:#fff;background-color:#080808}@media (max-width:767px){.navbar-inverse .navbar-nav .open .dropdown-menu>.dropdown-header{border-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu .divider{background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a{color:#777}.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>li>a:focus{color:#fff;background-color:transparent}.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.active>a:focus{color:#fff;background-color:#080808}.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:hover,.navbar-inverse .navbar-nav .open .dropdown-menu>.disabled>a:focus{color:#444;background-color:transparent}}.navbar-inverse .navbar-link{color:#777}.navbar-inverse .navbar-link:hover{color:#fff}.navbar-inverse .btn-link{color:#777}.navbar-inverse .btn-link:hover,.navbar-inverse .btn-link:focus{color:#fff}.navbar-inverse .btn-link[disabled]:hover,fieldset[disabled] .navbar-inverse .btn-link:hover,.navbar-inverse .btn-link[disabled]:focus,fieldset[disabled] .navbar-inverse .btn-link:focus{color:#444}.breadcrumb{padding:8px 15px;margin-bottom:20px;list-style:none;background-color:#f5f5f5;border-radius:4px}.breadcrumb>li{display:inline-block}.breadcrumb>li+li:before{padding:0 5px;color:#ccc;content:"/\00a0"}.breadcrumb>.active{color:#777}.pagination{display:inline-block;padding-left:0;margin:20px 0;border-radius:4px}.pagination>li{display:inline}.pagination>li>a,.pagination>li>span{position:relative;float:left;padding:6px 12px;margin-left:-1px;line-height:1.42857143;color:#428bca;text-decoration:none;background-color:#fff;border:1px solid #ddd}.pagination>li:first-child>a,.pagination>li:first-child>span{margin-left:0;border-top-left-radius:4px;border-bottom-left-radius:4px}.pagination>li:last-child>a,.pagination>li:last-child>span{border-top-right-radius:4px;border-bottom-right-radius:4px}.pagination>li>a:hover,.pagination>li>span:hover,.pagination>li>a:focus,.pagination>li>span:focus{color:#2a6496;background-color:#eee;border-color:#ddd}.pagination>.active>a,.pagination>.active>span,.pagination>.active>a:hover,.pagination>.active>span:hover,.pagination>.active>a:focus,.pagination>.active>span:focus{z-index:2;color:#fff;cursor:default;background-color:#428bca;border-color:#428bca}.pagination>.disabled>span,.pagination>.disabled>span:hover,.pagination>.disabled>span:focus,.pagination>.disabled>a,.pagination>.disabled>a:hover,.pagination>.disabled>a:focus{color:#777;cursor:not-allowed;background-color:#fff;border-color:#ddd}.pagination-lg>li>a,.pagination-lg>li>span{padding:10px 16px;font-size:18px}.pagination-lg>li:first-child>a,.pagination-lg>li:first-child>span{border-top-left-radius:6px;border-bottom-left-radius:6px}.pagination-lg>li:last-child>a,.pagination-lg>li:last-child>span{border-top-right-radius:6px;border-bottom-right-radius:6px}.pagination-sm>li>a,.pagination-sm>li>span{padding:5px 10px;font-size:12px}.pagination-sm>li:first-child>a,.pagination-sm>li:first-child>span{border-top-left-radius:3px;border-bottom-left-radius:3px}.pagination-sm>li:last-child>a,.pagination-sm>li:last-child>span{border-top-right-radius:3px;border-bottom-right-radius:3px}.pager{padding-left:0;margin:20px 0;text-align:center;list-style:none}.pager li{display:inline}.pager li>a,.pager li>span{display:inline-block;padding:5px 14px;background-color:#fff;border:1px solid #ddd;border-radius:15px}.pager li>a:hover,.pager li>a:focus{text-decoration:none;background-color:#eee}.pager .next>a,.pager .next>span{float:right}.pager .previous>a,.pager .previous>span{float:left}.pager .disabled>a,.pager .disabled>a:hover,.pager .disabled>a:focus,.pager .disabled>span{color:#777;cursor:not-allowed;background-color:#fff}.label{display:inline;padding:.2em .6em .3em;font-size:75%;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;border-radius:.25em}a.label:hover,a.label:focus{color:#fff;text-decoration:none;cursor:pointer}.label:empty{display:none}.btn .label{position:relative;top:-1px}.label-default{background-color:#777}.label-default[href]:hover,.label-default[href]:focus{background-color:#5e5e5e}.label-primary{background-color:#428bca}.label-primary[href]:hover,.label-primary[href]:focus{background-color:#3071a9}.label-success{background-color:#5cb85c}.label-success[href]:hover,.label-success[href]:focus{background-color:#449d44}.label-info{background-color:#5bc0de}.label-info[href]:hover,.label-info[href]:focus{background-color:#31b0d5}.label-warning{background-color:#f0ad4e}.label-warning[href]:hover,.label-warning[href]:focus{background-color:#ec971f}.label-danger{background-color:#d9534f}.label-danger[href]:hover,.label-danger[href]:focus{background-color:#c9302c}.badge{display:inline-block;min-width:10px;padding:3px 7px;font-size:12px;font-weight:700;line-height:1;color:#fff;text-align:center;white-space:nowrap;vertical-align:baseline;background-color:#777;border-radius:10px}.badge:empty{display:none}.btn .badge{position:relative;top:-1px}.btn-xs .badge{top:0;padding:1px 5px}a.badge:hover,a.badge:focus{color:#fff;text-decoration:none;cursor:pointer}a.list-group-item.active>.badge,.nav-pills>.active>a>.badge{color:#428bca;background-color:#fff}.nav-pills>li>a>.badge{margin-left:3px}.jumbotron{padding:30px;margin-bottom:30px;color:inherit;background-color:#eee}.jumbotron h1,.jumbotron .h1{color:inherit}.jumbotron p{margin-bottom:15px;font-size:21px;font-weight:200}.jumbotron>hr{border-top-color:#d5d5d5}.container .jumbotron{border-radius:6px}.jumbotron .container{max-width:100%}@media screen and (min-width:768px){.jumbotron{padding-top:48px;padding-bottom:48px}.container .jumbotron{padding-right:60px;padding-left:60px}.jumbotron h1,.jumbotron .h1{font-size:63px}}.thumbnail{display:block;padding:4px;margin-bottom:20px;line-height:1.42857143;background-color:#fff;border:1px solid #ddd;border-radius:4px;-webkit-transition:all .2s ease-in-out;-o-transition:all .2s ease-in-out;transition:all .2s ease-in-out}.thumbnail>img,.thumbnail a>img{margin-right:auto;margin-left:auto}a.thumbnail:hover,a.thumbnail:focus,a.thumbnail.active{border-color:#428bca}.thumbnail .caption{padding:9px;color:#333}.alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534}@-webkit-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@-o-keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}@keyframes progress-bar-stripes{from{background-position:40px 0}to{background-position:0 0}}.progress{height:20px;margin-bottom:20px;overflow:hidden;background-color:#f5f5f5;border-radius:4px;-webkit-box-shadow:inset 0 1px 2px rgba(0,0,0,.1);box-shadow:inset 0 1px 2px rgba(0,0,0,.1)}.progress-bar{float:left;width:0;height:100%;font-size:12px;line-height:20px;color:#fff;text-align:center;background-color:#428bca;-webkit-box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);box-shadow:inset 0 -1px 0 rgba(0,0,0,.15);-webkit-transition:width .6s ease;-o-transition:width .6s ease;transition:width .6s ease}.progress-striped .progress-bar,.progress-bar-striped{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);-webkit-background-size:40px 40px;background-size:40px 40px}.progress.active .progress-bar,.progress-bar.active{-webkit-animation:progress-bar-stripes 2s linear infinite;-o-animation:progress-bar-stripes 2s linear infinite;animation:progress-bar-stripes 2s linear infinite}.progress-bar[aria-valuenow="1"],.progress-bar[aria-valuenow="2"]{min-width:30px}.progress-bar[aria-valuenow="0"]{min-width:30px;color:#777;background-color:transparent;background-image:none;-webkit-box-shadow:none;box-shadow:none}.progress-bar-success{background-color:#5cb85c}.progress-striped .progress-bar-success{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-info{background-color:#5bc0de}.progress-striped .progress-bar-info{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-warning{background-color:#f0ad4e}.progress-striped .progress-bar-warning{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.progress-bar-danger{background-color:#d9534f}.progress-striped .progress-bar-danger{background-image:-webkit-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:-o-linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent);background-image:linear-gradient(45deg,rgba(255,255,255,.15) 25%,transparent 25%,transparent 50%,rgba(255,255,255,.15) 50%,rgba(255,255,255,.15) 75%,transparent 75%,transparent)}.media,.media-body{overflow:hidden;zoom:1}.media,.media .media{margin-top:15px}.media:first-child{margin-top:0}.media-object{display:block}.media-heading{margin:0 0 5px}.media>.pull-left{margin-right:10px}.media>.pull-right{margin-left:10px}.media-list{padding-left:0;list-style:none}.list-group{padding-left:0;margin-bottom:20px}.list-group-item{position:relative;display:block;padding:10px 15px;margin-bottom:-1px;background-color:#fff;border:1px solid #ddd}.list-group-item:first-child{border-top-left-radius:4px;border-top-right-radius:4px}.list-group-item:last-child{margin-bottom:0;border-bottom-right-radius:4px;border-bottom-left-radius:4px}.list-group-item>.badge{float:right}.list-group-item>.badge+.badge{margin-right:5px}a.list-group-item{color:#555}a.list-group-item .list-group-item-heading{color:#333}a.list-group-item:hover,a.list-group-item:focus{color:#555;text-decoration:none;background-color:#f5f5f5}.list-group-item.disabled,.list-group-item.disabled:hover,.list-group-item.disabled:focus{color:#777;background-color:#eee}.list-group-item.disabled .list-group-item-heading,.list-group-item.disabled:hover .list-group-item-heading,.list-group-item.disabled:focus .list-group-item-heading{color:inherit}.list-group-item.disabled .list-group-item-text,.list-group-item.disabled:hover .list-group-item-text,.list-group-item.disabled:focus .list-group-item-text{color:#777}.list-group-item.active,.list-group-item.active:hover,.list-group-item.active:focus{z-index:2;color:#fff;background-color:#428bca;border-color:#428bca}.list-group-item.active .list-group-item-heading,.list-group-item.active:hover .list-group-item-heading,.list-group-item.active:focus .list-group-item-heading,.list-group-item.active .list-group-item-heading>small,.list-group-item.active:hover .list-group-item-heading>small,.list-group-item.active:focus .list-group-item-heading>small,.list-group-item.active .list-group-item-heading>.small,.list-group-item.active:hover .list-group-item-heading>.small,.list-group-item.active:focus .list-group-item-heading>.small{color:inherit}.list-group-item.active .list-group-item-text,.list-group-item.active:hover .list-group-item-text,.list-group-item.active:focus .list-group-item-text{color:#e1edf7}.list-group-item-success{color:#3c763d;background-color:#dff0d8}a.list-group-item-success{color:#3c763d}a.list-group-item-success .list-group-item-heading{color:inherit}a.list-group-item-success:hover,a.list-group-item-success:focus{color:#3c763d;background-color:#d0e9c6}a.list-group-item-success.active,a.list-group-item-success.active:hover,a.list-group-item-success.active:focus{color:#fff;background-color:#3c763d;border-color:#3c763d}.list-group-item-info{color:#31708f;background-color:#d9edf7}a.list-group-item-info{color:#31708f}a.list-group-item-info .list-group-item-heading{color:inherit}a.list-group-item-info:hover,a.list-group-item-info:focus{color:#31708f;background-color:#c4e3f3}a.list-group-item-info.active,a.list-group-item-info.active:hover,a.list-group-item-info.active:focus{color:#fff;background-color:#31708f;border-color:#31708f}.list-group-item-warning{color:#8a6d3b;background-color:#fcf8e3}a.list-group-item-warning{color:#8a6d3b}a.list-group-item-warning .list-group-item-heading{color:inherit}a.list-group-item-warning:hover,a.list-group-item-warning:focus{color:#8a6d3b;background-color:#faf2cc}a.list-group-item-warning.active,a.list-group-item-warning.active:hover,a.list-group-item-warning.active:focus{color:#fff;background-color:#8a6d3b;border-color:#8a6d3b}.list-group-item-danger{color:#a94442;background-color:#f2dede}a.list-group-item-danger{color:#a94442}a.list-group-item-danger .list-group-item-heading{color:inherit}a.list-group-item-danger:hover,a.list-group-item-danger:focus{color:#a94442;background-color:#ebcccc}a.list-group-item-danger.active,a.list-group-item-danger.active:hover,a.list-group-item-danger.active:focus{color:#fff;background-color:#a94442;border-color:#a94442}.list-group-item-heading{margin-top:0;margin-bottom:5px}.list-group-item-text{margin-bottom:0;line-height:1.3}.panel{margin-bottom:20px;background-color:#fff;border:1px solid transparent;border-radius:4px;-webkit-box-shadow:0 1px 1px rgba(0,0,0,.05);box-shadow:0 1px 1px rgba(0,0,0,.05)}.panel-body{padding:15px}.panel-heading{padding:10px 15px;border-bottom:1px solid transparent;border-top-left-radius:3px;border-top-right-radius:3px}.panel-heading>.dropdown .dropdown-toggle{color:inherit}.panel-title{margin-top:0;margin-bottom:0;font-size:16px;color:inherit}.panel-title>a{color:inherit}.panel-footer{padding:10px 15px;background-color:#f5f5f5;border-top:1px solid #ddd;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.list-group{margin-bottom:0}.panel>.list-group .list-group-item{border-width:1px 0;border-radius:0}.panel>.list-group:first-child .list-group-item:first-child{border-top:0;border-top-left-radius:3px;border-top-right-radius:3px}.panel>.list-group:last-child .list-group-item:last-child{border-bottom:0;border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel-heading+.list-group .list-group-item:first-child{border-top-width:0}.list-group+.panel-footer{border-top-width:0}.panel>.table,.panel>.table-responsive>.table,.panel>.panel-collapse>.table{margin-bottom:0}.panel>.table:first-child,.panel>.table-responsive:first-child>.table:first-child{border-top-left-radius:3px;border-top-right-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:first-child,.panel>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:first-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:first-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:first-child{border-top-left-radius:3px}.panel>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child td:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child td:last-child,.panel>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>thead:first-child>tr:first-child th:last-child,.panel>.table:first-child>tbody:first-child>tr:first-child th:last-child,.panel>.table-responsive:first-child>.table:first-child>tbody:first-child>tr:first-child th:last-child{border-top-right-radius:3px}.panel>.table:last-child,.panel>.table-responsive:last-child>.table:last-child{border-bottom-right-radius:3px;border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child{border-bottom-left-radius:3px}.panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,.panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,.panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,.panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child{border-bottom-right-radius:3px}.panel>.panel-body+.table,.panel>.panel-body+.table-responsive{border-top:1px solid #ddd}.panel>.table>tbody:first-child>tr:first-child th,.panel>.table>tbody:first-child>tr:first-child td{border-top:0}.panel>.table-bordered,.panel>.table-responsive>.table-bordered{border:0}.panel>.table-bordered>thead>tr>th:first-child,.panel>.table-responsive>.table-bordered>thead>tr>th:first-child,.panel>.table-bordered>tbody>tr>th:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:first-child,.panel>.table-bordered>tfoot>tr>th:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:first-child,.panel>.table-bordered>thead>tr>td:first-child,.panel>.table-responsive>.table-bordered>thead>tr>td:first-child,.panel>.table-bordered>tbody>tr>td:first-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:first-child,.panel>.table-bordered>tfoot>tr>td:first-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:first-child{border-left:0}.panel>.table-bordered>thead>tr>th:last-child,.panel>.table-responsive>.table-bordered>thead>tr>th:last-child,.panel>.table-bordered>tbody>tr>th:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>th:last-child,.panel>.table-bordered>tfoot>tr>th:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>th:last-child,.panel>.table-bordered>thead>tr>td:last-child,.panel>.table-responsive>.table-bordered>thead>tr>td:last-child,.panel>.table-bordered>tbody>tr>td:last-child,.panel>.table-responsive>.table-bordered>tbody>tr>td:last-child,.panel>.table-bordered>tfoot>tr>td:last-child,.panel>.table-responsive>.table-bordered>tfoot>tr>td:last-child{border-right:0}.panel>.table-bordered>thead>tr:first-child>td,.panel>.table-responsive>.table-bordered>thead>tr:first-child>td,.panel>.table-bordered>tbody>tr:first-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>td,.panel>.table-bordered>thead>tr:first-child>th,.panel>.table-responsive>.table-bordered>thead>tr:first-child>th,.panel>.table-bordered>tbody>tr:first-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:first-child>th{border-bottom:0}.panel>.table-bordered>tbody>tr:last-child>td,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>td,.panel>.table-bordered>tfoot>tr:last-child>td,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>td,.panel>.table-bordered>tbody>tr:last-child>th,.panel>.table-responsive>.table-bordered>tbody>tr:last-child>th,.panel>.table-bordered>tfoot>tr:last-child>th,.panel>.table-responsive>.table-bordered>tfoot>tr:last-child>th{border-bottom:0}.panel>.table-responsive{margin-bottom:0;border:0}.panel-group{margin-bottom:20px}.panel-group .panel{margin-bottom:0;border-radius:4px}.panel-group .panel+.panel{margin-top:5px}.panel-group .panel-heading{border-bottom:0}.panel-group .panel-heading+.panel-collapse>.panel-body{border-top:1px solid #ddd}.panel-group .panel-footer{border-top:0}.panel-group .panel-footer+.panel-collapse .panel-body{border-bottom:1px solid #ddd}.panel-default{border-color:#ddd}.panel-default>.panel-heading{color:#333;background-color:#f5f5f5;border-color:#ddd}.panel-default>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ddd}.panel-default>.panel-heading .badge{color:#f5f5f5;background-color:#333}.panel-default>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ddd}.panel-primary{border-color:#428bca}.panel-primary>.panel-heading{color:#fff;background-color:#428bca;border-color:#428bca}.panel-primary>.panel-heading+.panel-collapse>.panel-body{border-top-color:#428bca}.panel-primary>.panel-heading .badge{color:#428bca;background-color:#fff}.panel-primary>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#428bca}.panel-success{border-color:#d6e9c6}.panel-success>.panel-heading{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.panel-success>.panel-heading+.panel-collapse>.panel-body{border-top-color:#d6e9c6}.panel-success>.panel-heading .badge{color:#dff0d8;background-color:#3c763d}.panel-success>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#d6e9c6}.panel-info{border-color:#bce8f1}.panel-info>.panel-heading{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.panel-info>.panel-heading+.panel-collapse>.panel-body{border-top-color:#bce8f1}.panel-info>.panel-heading .badge{color:#d9edf7;background-color:#31708f}.panel-info>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#bce8f1}.panel-warning{border-color:#faebcc}.panel-warning>.panel-heading{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.panel-warning>.panel-heading+.panel-collapse>.panel-body{border-top-color:#faebcc}.panel-warning>.panel-heading .badge{color:#fcf8e3;background-color:#8a6d3b}.panel-warning>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#faebcc}.panel-danger{border-color:#ebccd1}.panel-danger>.panel-heading{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.panel-danger>.panel-heading+.panel-collapse>.panel-body{border-top-color:#ebccd1}.panel-danger>.panel-heading .badge{color:#f2dede;background-color:#a94442}.panel-danger>.panel-footer+.panel-collapse>.panel-body{border-bottom-color:#ebccd1}.embed-responsive{position:relative;display:block;height:0;padding:0;overflow:hidden}.embed-responsive .embed-responsive-item,.embed-responsive iframe,.embed-responsive embed,.embed-responsive object{position:absolute;top:0;bottom:0;left:0;width:100%;height:100%;border:0}.embed-responsive.embed-responsive-16by9{padding-bottom:56.25%}.embed-responsive.embed-responsive-4by3{padding-bottom:75%}.well{min-height:20px;padding:19px;margin-bottom:20px;background-color:#f5f5f5;border:1px solid #e3e3e3;border-radius:4px;-webkit-box-shadow:inset 0 1px 1px rgba(0,0,0,.05);box-shadow:inset 0 1px 1px rgba(0,0,0,.05)}.well blockquote{border-color:#ddd;border-color:rgba(0,0,0,.15)}.well-lg{padding:24px;border-radius:6px}.well-sm{padding:9px;border-radius:3px}.close{float:right;font-size:21px;font-weight:700;line-height:1;color:#000;text-shadow:0 1px 0 #fff;filter:alpha(opacity=20);opacity:.2}.close:hover,.close:focus{color:#000;text-decoration:none;cursor:pointer;filter:alpha(opacity=50);opacity:.5}button.close{-webkit-appearance:none;padding:0;cursor:pointer;background:0 0;border:0}.modal-open{overflow:hidden}.modal{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1050;display:none;overflow:hidden;-webkit-overflow-scrolling:touch;outline:0}.modal.fade .modal-dialog{-webkit-transition:-webkit-transform .3s ease-out;-o-transition:-o-transform .3s ease-out;transition:transform .3s ease-out;-webkit-transform:translate3d(0,-25%,0);-o-transform:translate3d(0,-25%,0);transform:translate3d(0,-25%,0)}.modal.in .modal-dialog{-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}.modal-open .modal{overflow-x:hidden;overflow-y:auto}.modal-dialog{position:relative;width:auto;margin:10px}.modal-content{position:relative;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #999;border:1px solid rgba(0,0,0,.2);border-radius:6px;outline:0;-webkit-box-shadow:0 3px 9px rgba(0,0,0,.5);box-shadow:0 3px 9px rgba(0,0,0,.5)}.modal-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:1040;background-color:#000}.modal-backdrop.fade{filter:alpha(opacity=0);opacity:0}.modal-backdrop.in{filter:alpha(opacity=50);opacity:.5}.modal-header{min-height:16.43px;padding:15px;border-bottom:1px solid #e5e5e5}.modal-header .close{margin-top:-2px}.modal-title{margin:0;line-height:1.42857143}.modal-body{position:relative;padding:15px}.modal-footer{padding:15px;text-align:right;border-top:1px solid #e5e5e5}.modal-footer .btn+.btn{margin-bottom:0;margin-left:5px}.modal-footer .btn-group .btn+.btn{margin-left:-1px}.modal-footer .btn-block+.btn-block{margin-left:0}.modal-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}@media (min-width:768px){.modal-dialog{width:600px;margin:30px auto}.modal-content{-webkit-box-shadow:0 5px 15px rgba(0,0,0,.5);box-shadow:0 5px 15px rgba(0,0,0,.5)}.modal-sm{width:300px}}@media (min-width:992px){.modal-lg{width:900px}}.tooltip{position:absolute;z-index:1070;display:block;font-size:12px;line-height:1.4;visibility:visible;filter:alpha(opacity=0);opacity:0}.tooltip.in{filter:alpha(opacity=90);opacity:.9}.tooltip.top{padding:5px 0;margin-top:-3px}.tooltip.right{padding:0 5px;margin-left:3px}.tooltip.bottom{padding:5px 0;margin-top:3px}.tooltip.left{padding:0 5px;margin-left:-3px}.tooltip-inner{max-width:200px;padding:3px 8px;color:#fff;text-align:center;text-decoration:none;background-color:#000;border-radius:4px}.tooltip-arrow{position:absolute;width:0;height:0;border-color:transparent;border-style:solid}.tooltip.top .tooltip-arrow{bottom:0;left:50%;margin-left:-5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-left .tooltip-arrow{bottom:0;left:5px;border-width:5px 5px 0;border-top-color:#000}.tooltip.top-right .tooltip-arrow{right:5px;bottom:0;border-width:5px 5px 0;border-top-color:#000}.tooltip.right .tooltip-arrow{top:50%;left:0;margin-top:-5px;border-width:5px 5px 5px 0;border-right-color:#000}.tooltip.left .tooltip-arrow{top:50%;right:0;margin-top:-5px;border-width:5px 0 5px 5px;border-left-color:#000}.tooltip.bottom .tooltip-arrow{top:0;left:50%;margin-left:-5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-left .tooltip-arrow{top:0;left:5px;border-width:0 5px 5px;border-bottom-color:#000}.tooltip.bottom-right .tooltip-arrow{top:0;right:5px;border-width:0 5px 5px;border-bottom-color:#000}.popover{position:absolute;top:0;left:0;z-index:1060;display:none;max-width:276px;padding:1px;text-align:left;white-space:normal;background-color:#fff;-webkit-background-clip:padding-box;background-clip:padding-box;border:1px solid #ccc;border:1px solid rgba(0,0,0,.2);border-radius:6px;-webkit-box-shadow:0 5px 10px rgba(0,0,0,.2);box-shadow:0 5px 10px rgba(0,0,0,.2)}.popover.top{margin-top:-10px}.popover.right{margin-left:10px}.popover.bottom{margin-top:10px}.popover.left{margin-left:-10px}.popover-title{padding:8px 14px;margin:0;font-size:14px;font-weight:400;line-height:18px;background-color:#f7f7f7;border-bottom:1px solid #ebebeb;border-radius:5px 5px 0 0}.popover-content{padding:9px 14px}.popover>.arrow,.popover>.arrow:after{position:absolute;display:block;width:0;height:0;border-color:transparent;border-style:solid}.popover>.arrow{border-width:11px}.popover>.arrow:after{content:"";border-width:10px}.popover.top>.arrow{bottom:-11px;left:50%;margin-left:-11px;border-top-color:#999;border-top-color:rgba(0,0,0,.25);border-bottom-width:0}.popover.top>.arrow:after{bottom:1px;margin-left:-10px;content:" ";border-top-color:#fff;border-bottom-width:0}.popover.right>.arrow{top:50%;left:-11px;margin-top:-11px;border-right-color:#999;border-right-color:rgba(0,0,0,.25);border-left-width:0}.popover.right>.arrow:after{bottom:-10px;left:1px;content:" ";border-right-color:#fff;border-left-width:0}.popover.bottom>.arrow{top:-11px;left:50%;margin-left:-11px;border-top-width:0;border-bottom-color:#999;border-bottom-color:rgba(0,0,0,.25)}.popover.bottom>.arrow:after{top:1px;margin-left:-10px;content:" ";border-top-width:0;border-bottom-color:#fff}.popover.left>.arrow{top:50%;right:-11px;margin-top:-11px;border-right-width:0;border-left-color:#999;border-left-color:rgba(0,0,0,.25)}.popover.left>.arrow:after{right:1px;bottom:-10px;content:" ";border-right-width:0;border-left-color:#fff}.carousel{position:relative}.carousel-inner{position:relative;width:100%;overflow:hidden}.carousel-inner>.item{position:relative;display:none;-webkit-transition:.6s ease-in-out left;-o-transition:.6s ease-in-out left;transition:.6s ease-in-out left}.carousel-inner>.item>img,.carousel-inner>.item>a>img{line-height:1}.carousel-inner>.active,.carousel-inner>.next,.carousel-inner>.prev{display:block}.carousel-inner>.active{left:0}.carousel-inner>.next,.carousel-inner>.prev{position:absolute;top:0;width:100%}.carousel-inner>.next{left:100%}.carousel-inner>.prev{left:-100%}.carousel-inner>.next.left,.carousel-inner>.prev.right{left:0}.carousel-inner>.active.left{left:-100%}.carousel-inner>.active.right{left:100%}.carousel-control{position:absolute;top:0;bottom:0;left:0;width:15%;font-size:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6);filter:alpha(opacity=50);opacity:.5}.carousel-control.left{background-image:-webkit-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.5)),to(rgba(0,0,0,.0001)));background-image:linear-gradient(to right,rgba(0,0,0,.5) 0,rgba(0,0,0,.0001) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#80000000', endColorstr='#00000000', GradientType=1);background-repeat:repeat-x}.carousel-control.right{right:0;left:auto;background-image:-webkit-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-o-linear-gradient(left,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);background-image:-webkit-gradient(linear,left top,right top,from(rgba(0,0,0,.0001)),to(rgba(0,0,0,.5)));background-image:linear-gradient(to right,rgba(0,0,0,.0001) 0,rgba(0,0,0,.5) 100%);filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00000000', endColorstr='#80000000', GradientType=1);background-repeat:repeat-x}.carousel-control:hover,.carousel-control:focus{color:#fff;text-decoration:none;filter:alpha(opacity=90);outline:0;opacity:.9}.carousel-control .icon-prev,.carousel-control .icon-next,.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right{position:absolute;top:50%;z-index:5;display:inline-block}.carousel-control .icon-prev,.carousel-control .glyphicon-chevron-left{left:50%;margin-left:-10px}.carousel-control .icon-next,.carousel-control .glyphicon-chevron-right{right:50%;margin-right:-10px}.carousel-control .icon-prev,.carousel-control .icon-next{width:20px;height:20px;margin-top:-10px;font-family:serif}.carousel-control .icon-prev:before{content:'\2039'}.carousel-control .icon-next:before{content:'\203a'}.carousel-indicators{position:absolute;bottom:10px;left:50%;z-index:15;width:60%;padding-left:0;margin-left:-30%;text-align:center;list-style:none}.carousel-indicators li{display:inline-block;width:10px;height:10px;margin:1px;text-indent:-999px;cursor:pointer;background-color:#000 \9;background-color:rgba(0,0,0,0);border:1px solid #fff;border-radius:10px}.carousel-indicators .active{width:12px;height:12px;margin:0;background-color:#fff}.carousel-caption{position:absolute;right:15%;bottom:20px;left:15%;z-index:10;padding-top:20px;padding-bottom:20px;color:#fff;text-align:center;text-shadow:0 1px 2px rgba(0,0,0,.6)}.carousel-caption .btn{text-shadow:none}@media screen and (min-width:768px){.carousel-control .glyphicon-chevron-left,.carousel-control .glyphicon-chevron-right,.carousel-control .icon-prev,.carousel-control .icon-next{width:30px;height:30px;margin-top:-15px;font-size:30px}.carousel-control .glyphicon-chevron-left,.carousel-control .icon-prev{margin-left:-15px}.carousel-control .glyphicon-chevron-right,.carousel-control .icon-next{margin-right:-15px}.carousel-caption{right:20%;left:20%;padding-bottom:30px}.carousel-indicators{bottom:20px}}.clearfix:before,.clearfix:after,.dl-horizontal dd:before,.dl-horizontal dd:after,.container:before,.container:after,.container-fluid:before,.container-fluid:after,.row:before,.row:after,.form-horizontal .form-group:before,.form-horizontal .form-group:after,.btn-toolbar:before,.btn-toolbar:after,.btn-group-vertical>.btn-group:before,.btn-group-vertical>.btn-group:after,.nav:before,.nav:after,.navbar:before,.navbar:after,.navbar-header:before,.navbar-header:after,.navbar-collapse:before,.navbar-collapse:after,.pager:before,.pager:after,.panel-body:before,.panel-body:after,.modal-footer:before,.modal-footer:after{display:table;content:" "}.clearfix:after,.dl-horizontal dd:after,.container:after,.container-fluid:after,.row:after,.form-horizontal .form-group:after,.btn-toolbar:after,.btn-group-vertical>.btn-group:after,.nav:after,.navbar:after,.navbar-header:after,.navbar-collapse:after,.pager:after,.panel-body:after,.modal-footer:after{clear:both}.center-block{display:block;margin-right:auto;margin-left:auto}.pull-right{float:right!important}.pull-left{float:left!important}.hide{display:none!important}.show{display:block!important}.invisible{visibility:hidden}.text-hide{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.hidden{display:none!important;visibility:hidden!important}.affix{position:fixed;-webkit-transform:translate3d(0,0,0);-o-transform:translate3d(0,0,0);transform:translate3d(0,0,0)}@-ms-viewport{width:device-width}.visible-xs,.visible-sm,.visible-md,.visible-lg{display:none!important}.visible-xs-block,.visible-xs-inline,.visible-xs-inline-block,.visible-sm-block,.visible-sm-inline,.visible-sm-inline-block,.visible-md-block,.visible-md-inline,.visible-md-inline-block,.visible-lg-block,.visible-lg-inline,.visible-lg-inline-block{display:none!important}@media (max-width:767px){.visible-xs{display:block!important}table.visible-xs{display:table}tr.visible-xs{display:table-row!important}th.visible-xs,td.visible-xs{display:table-cell!important}}@media (max-width:767px){.visible-xs-block{display:block!important}}@media (max-width:767px){.visible-xs-inline{display:inline!important}}@media (max-width:767px){.visible-xs-inline-block{display:inline-block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm{display:block!important}table.visible-sm{display:table}tr.visible-sm{display:table-row!important}th.visible-sm,td.visible-sm{display:table-cell!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-block{display:block!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline{display:inline!important}}@media (min-width:768px) and (max-width:991px){.visible-sm-inline-block{display:inline-block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md{display:block!important}table.visible-md{display:table}tr.visible-md{display:table-row!important}th.visible-md,td.visible-md{display:table-cell!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-block{display:block!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline{display:inline!important}}@media (min-width:992px) and (max-width:1199px){.visible-md-inline-block{display:inline-block!important}}@media (min-width:1200px){.visible-lg{display:block!important}table.visible-lg{display:table}tr.visible-lg{display:table-row!important}th.visible-lg,td.visible-lg{display:table-cell!important}}@media (min-width:1200px){.visible-lg-block{display:block!important}}@media (min-width:1200px){.visible-lg-inline{display:inline!important}}@media (min-width:1200px){.visible-lg-inline-block{display:inline-block!important}}@media (max-width:767px){.hidden-xs{display:none!important}}@media (min-width:768px) and (max-width:991px){.hidden-sm{display:none!important}}@media (min-width:992px) and (max-width:1199px){.hidden-md{display:none!important}}@media (min-width:1200px){.hidden-lg{display:none!important}}.visible-print{display:none!important}@media print{.visible-print{display:block!important}table.visible-print{display:table}tr.visible-print{display:table-row!important}th.visible-print,td.visible-print{display:table-cell!important}}.visible-print-block{display:none!important}@media print{.visible-print-block{display:block!important}}.visible-print-inline{display:none!important}@media print{.visible-print-inline{display:inline!important}}.visible-print-inline-block{display:none!important}@media print{.visible-print-inline-block{display:inline-block!important}}@media print{.hidden-print{display:none!important}}
13 </style>
14
15 <meta content="Mnemonic code for generating deterministic keys" name="description"/>
16 <meta content="width=device-width, initial-scale=1.0" name="viewport" />
17 <meta content="bitcoin mnemonic converter" name="description" />
18 <meta content="DC POS" name="author" />
19
20 <style>
21 body {
22 padding-bottom: 32px;
23 }
24 .feedback-container {
25 position: fixed;
26 top: 0;
27 width: 100%;
28 text-align: center;
29 z-index: 4;
30 }
31 .feedback {
32 display: table;
33 padding: 0.5em 1em;
34 background-color: orange;
35 margin: 0 auto;
36 font-size: 2em;
37 color: #444;
38 border: 2px solid #555;
39 border-top: 0;
40 border-bottom-left-radius: 20px 20px;
41 border-bottom-right-radius: 20px 20px;
42 }
43 </style>
44 </head>
45 <body>
46 <div class="container">
47
48 <h1 class="text-center">Mnemonic Code Converter</h1>
49 <hr>
50 <div class="row">
51 <div class="col-md-12">
52 <h2>Phrase</h2>
53 <form class="form-horizontal" role="form">
54 <div class="col-sm-2"></div>
55 <div class="col-sm-10">
56 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
57 </div>
58 <div class="form-group">
59 <label for="phrase" class="col-sm-2 control-label">BIP39 Phrase</label>
60 <div class="col-sm-10">
61 <textarea id="phrase" class="phrase form-control"></textarea>
62 </div>
63 </div>
64 <div class="form-group">
65 <label for="strength" class="col-sm-2 control-label">Number of words</label>
66 <div class="col-sm-10">
67 <div class="input-group">
68 <input type="number" class="strength form-control" id="strength" value="12">
69 <span class="input-group-btn">
70 <button class="btn generate">Generate Random Phrase</button>
71 </span>
72 </div>
73 </div>
74 </div>
75 <div class="form-group">
76 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
77 <div class="col-sm-10">
78 <textarea id="root-key" class="root-key form-control" disabled="disabled"></textarea>
79 </div>
80 </div>
81 </form>
82 </div>
83 </div>
84
85 <hr>
86
87 <div class="row">
88 <div class="col-md-12">
89 <h2>Derivation Path</h2>
90 <ul class="derivation-type nav nav-tabs" role="tablist">
91 <li class="active">
92 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a></li>
93 <li><a href="#bip32" role="tab" data-toggle="tab">BIP32</a></li>
94 </ul>
95 <div class="derivation-type tab-content">
96 <div id="bip44" class="tab-pane active">
97 <form class="form-horizontal" role="form">
98 <br>
99 <div class="col-sm-2"></div>
100 <div class="col-sm-10">
101 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
102 </div>
103 <div class="form-group">
104 <label for="purpose" class="col-sm-2 control-label">
105 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
106 </label>
107 <div class="col-sm-10">
108 <input id="purpose" type="text" class="purpose form-control" value="44">
109 </div>
110 </div>
111 <div class="form-group">
112 <label for="coin" class="col-sm-2 control-label">
113 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
114 </label>
115 <div class="col-sm-10">
116 <input id="coin" type="text" class="coin form-control" value="0">
117 </div>
118 </div>
119 <div class="form-group">
120 <label for="account" class="col-sm-2 control-label">
121 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
122 </label>
123 <div class="col-sm-10">
124 <input id="account" type="text" class="account form-control" value="0">
125 </div>
126 </div>
127 <div class="form-group">
128 <label for="change" class="col-sm-2 control-label">
129 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
130 </label>
131 <div class="col-sm-10">
132 <input id="change" type="text" class="change form-control" value="0">
133 </div>
134 </div>
135 <div class="form-group">
136 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
137 <div class="col-sm-10">
138 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" disabled="disabled">
139 </div>
140 </div>
141 </form>
142 </div>
143 <div id="bip32" class="tab-pane">
144 <form class="form-horizontal" role="form">
145 <br>
146 <div class="col-sm-2"></div>
147 <div class="col-sm-10">
148 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
149 </div>
150 <div class="form-group">
151 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
152 <div class="col-sm-10">
153 <input id="bip32-path" type="text" class="path form-control" value="m/0">
154 </div>
155 </div>
156 </form>
157 </div>
158 </div>
159 <form class="form-horizontal" role="form">
160 <div class="form-group">
161 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
162 <div class="col-sm-10">
163 <textarea id="extended-priv-key" class="extended-priv-key form-control" disabled="disabled"></textarea>
164 </div>
165 </div>
166 <div class="form-group">
167 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
168 <div class="col-sm-10">
169 <textarea id="extended-pub-key" class="extended-pub-key form-control" disabled="disabled"></textarea>
170 </div>
171 </div>
172 </form>
173 </div>
174 </div>
175
176 <hr>
177
178 <div class="row">
179 <div class="col-md-12">
180 <h2>Derived Addresses</h2>
181 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
182 <table class="table table-striped">
183 <thead>
184 <th>
185 <div class="input-group">
186 Index&nbsp;&nbsp;
187 <button class="index-toggle">Toggle</button>
188 </div>
189 </th>
190 <th>
191 <div class="input-group">
192 Address&nbsp;&nbsp;
193 <button class="address-toggle">Toggle</button>
194 </div>
195 </th>
196 <th>
197 <div class="input-group">
198 Private Key&nbsp;&nbsp;
199 <button class="private-key-toggle">Toggle</button>
200 </div>
201 </th>
202 </thead>
203 <tbody class="addresses">
204 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
205 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
206 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
207 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
208 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
209 </tbody>
210 </table>
211 </div>
212 </div>
213 <span>Show next </button>
214 <input type="number" class="rows-to-add" value="20">
215 <button class="more">Show</button>
216
217 <hr>
218
219 <div class="row">
220 <div class="col-md-12">
221 <h2>More info</h2>
222 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
223 <p>
224 Read more at the
225 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
226 </p>
227 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
228 <p>
229 Read more at the
230 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
231 and see the demo at
232 <a href="http://bip32.org/" target="_blank">bip32.org</a>
233 </p>
234 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
235 <p>
236 Read more at the
237 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
238 </p>
239 <h3>Private Keys</h3>
240 <p>
241 Use private keys at
242 <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
243 but be careful - it can be easy to make mistakes if you
244 don't know what you're doing
245 </p>
246 </div>
247 </div>
248
249 <hr>
250
251 <div class="row">
252 <div class="col-md-12">
253 <h2>Derived Addresses</h2>
254 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
255 <table class="table table-striped">
256 <thead>
257 <th>
258 <div class="input-group">
259 Index&nbsp;&nbsp;
260 <button class="index-toggle">Toggle</button>
261 </div>
262 </th>
263 <th>
264 <div class="input-group">
265 Address&nbsp;&nbsp;
266 <button class="address-toggle">Toggle</button>
267 </div>
268 </th>
269 <th>
270 <div class="input-group">
271 Private Key&nbsp;&nbsp;
272 <button class="private-key-toggle">Toggle</button>
273 </div>
274 </th>
275 </thead>
276 <tbody class="addresses">
277 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
278 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
279 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
280 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
281 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
282 </tbody>
283 </table>
284 </div>
285 </div>
286 <span>Show next </button>
287 <input type="number" class="rows-to-add" value="20">
288 <button class="more">Show</button>
289
290 <hr>
291
292 <div class="row">
293 <div class="col-md-12">
294 <h2>More info</h2>
295 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
296 <p>
297 Read more at the
298 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
299 </p>
300 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
301 <p>
302 Read more at the
303 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
304 and see the demo at
305 <a href="http://bip32.org/" target="_blank">bip32.org</a>
306 </p>
307 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
308 <p>
309 Read more at the
310 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
311 </p>
312 <h3>Private Keys</h3>
313 <p>
314 Use private keys at
315 <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
316 but be careful - it can be easy to make mistakes if you
317 don't know what you're doing
318 </p>
319 </div>
320 </div>
321
322 <hr>
323
324 <div class="row">
325 <div class="col-md-12">
326
327 <h2>Offline Usage</h2>
328
329 <p>
330 You can use this tool without having to be online.
331 </p>
332 <p>
333 In your browser, select file save-as, and save this page
334 as a file.
335 </p>
336 <p>
337 Double-click that file to open it in a browser
338 on any offline computer.
339 </p>
340 <p>
341 Alternatively, download it from
342 <a href="https://github.com/dcpos/bip39">
343 https://github.com/dcpos/bip39
344 </a>
345
346 </div>
347 </div>
348
349 <hr>
350
351 <div class="row">
352 <div class="col-md-12">
353
354 <h2>This project is 100% open-source code</h2>
355
356 <p>
357 <span>Get the source code at - </span>
358 <a href="https://github.com/dcpos/bip39" target="_blank">
359 https://github.com/dcpos/bip39
360 </a>
361 </p>
362
363 <h3>Libraries</h3>
364
365 <p>
366 <span>BitcoinJS - </span>
367 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
368 https://github.com/bitcoinjs/bitcoinjs-lib
369 </a>
370 </p>
371
372 <p>
373 <span>jsBIP39 - </span>
374 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
375 https://github.com/iancoleman/jsbip39
376 </a>
377 </p>
378
379 <p>
380 <span>asmCrypto - </span>
381 <a href="https://github.com/vibornoff/asmcrypto.js" target="_blank">
382 https://github.com/vibornoff/asmcrypto.js
383 </a>
384 </p>
385
386 <p>
387 <span>jQuery - </span>
388 <a href="https://jquery.com/" target="_blank">
389 https://jquery.com/
390 </a>
391 </p>
392
393 <p>
394 <span>Twitter Bootstrap - </span>
395 <a href="http://getbootstrap.com/" target="_blank">
396 http://getbootstrap.com/
397 </a>
398 </p>
399
400 </div>
401 </div>
402
403 </div>
404
405 <div class="feedback-container">
406 <div class="feedback"></div>
407 </div>
408
409 <script type="text/template" id="address-row-template">
410 <tr>
411 <td class="index"><span></span></td>
412 <td class="address"><span></span></td>
413 <td class="privkey"><span></span></td>
414 </tr>
415 </script>
416
417 <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>-->
418 <script>
419 /*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
420 !function(a,b){"object"==typeof module&&"object"==typeof module.exports?module.exports=a.document?b(a,!0):function(a){if(!a.document)throw new Error("jQuery requires a window with a document");return b(a)}:b(a)}("undefined"!=typeof window?window:this,function(a,b){var c=[],d=c.slice,e=c.concat,f=c.push,g=c.indexOf,h={},i=h.toString,j=h.hasOwnProperty,k={},l=a.document,m="2.1.1",n=function(a,b){return new n.fn.init(a,b)},o=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,p=/^-ms-/,q=/-([\da-z])/gi,r=function(a,b){return b.toUpperCase()};n.fn=n.prototype={jquery:m,constructor:n,selector:"",length:0,toArray:function(){return d.call(this)},get:function(a){return null!=a?0>a?this[a+this.length]:this[a]:d.call(this)},pushStack:function(a){var b=n.merge(this.constructor(),a);return b.prevObject=this,b.context=this.context,b},each:function(a,b){return n.each(this,a,b)},map:function(a){return this.pushStack(n.map(this,function(b,c){return a.call(b,c,b)}))},slice:function(){return this.pushStack(d.apply(this,arguments))},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},eq:function(a){var b=this.length,c=+a+(0>a?b:0);return this.pushStack(c>=0&&b>c?[this[c]]:[])},end:function(){return this.prevObject||this.constructor(null)},push:f,sort:c.sort,splice:c.splice},n.extend=n.fn.extend=function(){var a,b,c,d,e,f,g=arguments[0]||{},h=1,i=arguments.length,j=!1;for("boolean"==typeof g&&(j=g,g=arguments[h]||{},h++),"object"==typeof g||n.isFunction(g)||(g={}),h===i&&(g=this,h--);i>h;h++)if(null!=(a=arguments[h]))for(b in a)c=g[b],d=a[b],g!==d&&(j&&d&&(n.isPlainObject(d)||(e=n.isArray(d)))?(e?(e=!1,f=c&&n.isArray(c)?c:[]):f=c&&n.isPlainObject(c)?c:{},g[b]=n.extend(j,f,d)):void 0!==d&&(g[b]=d));return g},n.extend({expando:"jQuery"+(m+Math.random()).replace(/\D/g,""),isReady:!0,error:function(a){throw new Error(a)},noop:function(){},isFunction:function(a){return"function"===n.type(a)},isArray:Array.isArray,isWindow:function(a){return null!=a&&a===a.window},isNumeric:function(a){return!n.isArray(a)&&a-parseFloat(a)>=0},isPlainObject:function(a){return"object"!==n.type(a)||a.nodeType||n.isWindow(a)?!1:a.constructor&&!j.call(a.constructor.prototype,"isPrototypeOf")?!1:!0},isEmptyObject:function(a){var b;for(b in a)return!1;return!0},type:function(a){return null==a?a+"":"object"==typeof a||"function"==typeof a?h[i.call(a)]||"object":typeof a},globalEval:function(a){var b,c=eval;a=n.trim(a),a&&(1===a.indexOf("use strict")?(b=l.createElement("script"),b.text=a,l.head.appendChild(b).parentNode.removeChild(b)):c(a))},camelCase:function(a){return a.replace(p,"ms-").replace(q,r)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toLowerCase()===b.toLowerCase()},each:function(a,b,c){var d,e=0,f=a.length,g=s(a);if(c){if(g){for(;f>e;e++)if(d=b.apply(a[e],c),d===!1)break}else for(e in a)if(d=b.apply(a[e],c),d===!1)break}else if(g){for(;f>e;e++)if(d=b.call(a[e],e,a[e]),d===!1)break}else for(e in a)if(d=b.call(a[e],e,a[e]),d===!1)break;return a},trim:function(a){return null==a?"":(a+"").replace(o,"")},makeArray:function(a,b){var c=b||[];return null!=a&&(s(Object(a))?n.merge(c,"string"==typeof a?[a]:a):f.call(c,a)),c},inArray:function(a,b,c){return null==b?-1:g.call(b,a,c)},merge:function(a,b){for(var c=+b.length,d=0,e=a.length;c>d;d++)a[e++]=b[d];return a.length=e,a},grep:function(a,b,c){for(var d,e=[],f=0,g=a.length,h=!c;g>f;f++)d=!b(a[f],f),d!==h&&e.push(a[f]);return e},map:function(a,b,c){var d,f=0,g=a.length,h=s(a),i=[];if(h)for(;g>f;f++)d=b(a[f],f,c),null!=d&&i.push(d);else for(f in a)d=b(a[f],f,c),null!=d&&i.push(d);return e.apply([],i)},guid:1,proxy:function(a,b){var c,e,f;return"string"==typeof b&&(c=a[b],b=a,a=c),n.isFunction(a)?(e=d.call(arguments,2),f=function(){return a.apply(b||this,e.concat(d.call(arguments)))},f.guid=a.guid=a.guid||n.guid++,f):void 0},now:Date.now,support:k}),n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(a,b){h["[object "+b+"]"]=b.toLowerCase()});function s(a){var b=a.length,c=n.type(a);return"function"===c||n.isWindow(a)?!1:1===a.nodeType&&b?!0:"array"===c||0===b||"number"==typeof b&&b>0&&b-1 in a}var t=function(a){var b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u="sizzle"+-new Date,v=a.document,w=0,x=0,y=gb(),z=gb(),A=gb(),B=function(a,b){return a===b&&(l=!0),0},C="undefined",D=1<<31,E={}.hasOwnProperty,F=[],G=F.pop,H=F.push,I=F.push,J=F.slice,K=F.indexOf||function(a){for(var b=0,c=this.length;c>b;b++)if(this[b]===a)return b;return-1},L="checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",M="[\\x20\\t\\r\\n\\f]",N="(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",O=N.replace("w","w#"),P="\\["+M+"*("+N+")(?:"+M+"*([*^$|!~]?=)"+M+"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|("+O+"))|)"+M+"*\\]",Q=":("+N+")(?:\\((('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|((?:\\\\.|[^\\\\()[\\]]|"+P+")*)|.*)\\)|)",R=new RegExp("^"+M+"+|((?:^|[^\\\\])(?:\\\\.)*)"+M+"+$","g"),S=new RegExp("^"+M+"*,"+M+"*"),T=new RegExp("^"+M+"*([>+~]|"+M+")"+M+"*"),U=new RegExp("="+M+"*([^\\]'\"]*?)"+M+"*\\]","g"),V=new RegExp(Q),W=new RegExp("^"+O+"$"),X={ID:new RegExp("^#("+N+")"),CLASS:new RegExp("^\\.("+N+")"),TAG:new RegExp("^("+N.replace("w","w*")+")"),ATTR:new RegExp("^"+P),PSEUDO:new RegExp("^"+Q),CHILD:new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\("+M+"*(even|odd|(([+-]|)(\\d*)n|)"+M+"*(?:([+-]|)"+M+"*(\\d+)|))"+M+"*\\)|)","i"),bool:new RegExp("^(?:"+L+")$","i"),needsContext:new RegExp("^"+M+"*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\("+M+"*((?:-\\d)?\\d*)"+M+"*\\)|)(?=[^-]|$)","i")},Y=/^(?:input|select|textarea|button)$/i,Z=/^h\d$/i,$=/^[^{]+\{\s*\[native \w/,_=/^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,ab=/[+~]/,bb=/'|\\/g,cb=new RegExp("\\\\([\\da-f]{1,6}"+M+"?|("+M+")|.)","ig"),db=function(a,b,c){var d="0x"+b-65536;return d!==d||c?b:0>d?String.fromCharCode(d+65536):String.fromCharCode(d>>10|55296,1023&d|56320)};try{I.apply(F=J.call(v.childNodes),v.childNodes),F[v.childNodes.length].nodeType}catch(eb){I={apply:F.length?function(a,b){H.apply(a,J.call(b))}:function(a,b){var c=a.length,d=0;while(a[c++]=b[d++]);a.length=c-1}}}function fb(a,b,d,e){var f,h,j,k,l,o,r,s,w,x;if((b?b.ownerDocument||b:v)!==n&&m(b),b=b||n,d=d||[],!a||"string"!=typeof a)return d;if(1!==(k=b.nodeType)&&9!==k)return[];if(p&&!e){if(f=_.exec(a))if(j=f[1]){if(9===k){if(h=b.getElementById(j),!h||!h.parentNode)return d;if(h.id===j)return d.push(h),d}else if(b.ownerDocument&&(h=b.ownerDocument.getElementById(j))&&t(b,h)&&h.id===j)return d.push(h),d}else{if(f[2])return I.apply(d,b.getElementsByTagName(a)),d;if((j=f[3])&&c.getElementsByClassName&&b.getElementsByClassName)return I.apply(d,b.getElementsByClassName(j)),d}if(c.qsa&&(!q||!q.test(a))){if(s=r=u,w=b,x=9===k&&a,1===k&&"object"!==b.nodeName.toLowerCase()){o=g(a),(r=b.getAttribute("id"))?s=r.replace(bb,"\\$&"):b.setAttribute("id",s),s="[id='"+s+"'] ",l=o.length;while(l--)o[l]=s+qb(o[l]);w=ab.test(a)&&ob(b.parentNode)||b,x=o.join(",")}if(x)try{return I.apply(d,w.querySelectorAll(x)),d}catch(y){}finally{r||b.removeAttribute("id")}}}return i(a.replace(R,"$1"),b,d,e)}function gb(){var a=[];function b(c,e){return a.push(c+" ")>d.cacheLength&&delete b[a.shift()],b[c+" "]=e}return b}function hb(a){return a[u]=!0,a}function ib(a){var b=n.createElement("div");try{return!!a(b)}catch(c){return!1}finally{b.parentNode&&b.parentNode.removeChild(b),b=null}}function jb(a,b){var c=a.split("|"),e=a.length;while(e--)d.attrHandle[c[e]]=b}function kb(a,b){var c=b&&a,d=c&&1===a.nodeType&&1===b.nodeType&&(~b.sourceIndex||D)-(~a.sourceIndex||D);if(d)return d;if(c)while(c=c.nextSibling)if(c===b)return-1;return a?1:-1}function lb(a){return function(b){var c=b.nodeName.toLowerCase();return"input"===c&&b.type===a}}function mb(a){return function(b){var c=b.nodeName.toLowerCase();return("input"===c||"button"===c)&&b.type===a}}function nb(a){return hb(function(b){return b=+b,hb(function(c,d){var e,f=a([],c.length,b),g=f.length;while(g--)c[e=f[g]]&&(c[e]=!(d[e]=c[e]))})})}function ob(a){return a&&typeof a.getElementsByTagName!==C&&a}c=fb.support={},f=fb.isXML=function(a){var b=a&&(a.ownerDocument||a).documentElement;return b?"HTML"!==b.nodeName:!1},m=fb.setDocument=function(a){var b,e=a?a.ownerDocument||a:v,g=e.defaultView;return e!==n&&9===e.nodeType&&e.documentElement?(n=e,o=e.documentElement,p=!f(e),g&&g!==g.top&&(g.addEventListener?g.addEventListener("unload",function(){m()},!1):g.attachEvent&&g.attachEvent("onunload",function(){m()})),c.attributes=ib(function(a){return a.className="i",!a.getAttribute("className")}),c.getElementsByTagName=ib(function(a){return a.appendChild(e.createComment("")),!a.getElementsByTagName("*").length}),c.getElementsByClassName=$.test(e.getElementsByClassName)&&ib(function(a){return a.innerHTML="<div class='a'></div><div class='a i'></div>",a.firstChild.className="i",2===a.getElementsByClassName("i").length}),c.getById=ib(function(a){return o.appendChild(a).id=u,!e.getElementsByName||!e.getElementsByName(u).length}),c.getById?(d.find.ID=function(a,b){if(typeof b.getElementById!==C&&p){var c=b.getElementById(a);return c&&c.parentNode?[c]:[]}},d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){return a.getAttribute("id")===b}}):(delete d.find.ID,d.filter.ID=function(a){var b=a.replace(cb,db);return function(a){var c=typeof a.getAttributeNode!==C&&a.getAttributeNode("id");return c&&c.value===b}}),d.find.TAG=c.getElementsByTagName?function(a,b){return typeof b.getElementsByTagName!==C?b.getElementsByTagName(a):void 0}:function(a,b){var c,d=[],e=0,f=b.getElementsByTagName(a);if("*"===a){while(c=f[e++])1===c.nodeType&&d.push(c);return d}return f},d.find.CLASS=c.getElementsByClassName&&function(a,b){return typeof b.getElementsByClassName!==C&&p?b.getElementsByClassName(a):void 0},r=[],q=[],(c.qsa=$.test(e.querySelectorAll))&&(ib(function(a){a.innerHTML="<select msallowclip=''><option selected=''></option></select>",a.querySelectorAll("[msallowclip^='']").length&&q.push("[*^$]="+M+"*(?:''|\"\")"),a.querySelectorAll("[selected]").length||q.push("\\["+M+"*(?:value|"+L+")"),a.querySelectorAll(":checked").length||q.push(":checked")}),ib(function(a){var b=e.createElement("input");b.setAttribute("type","hidden"),a.appendChild(b).setAttribute("name","D"),a.querySelectorAll("[name=d]").length&&q.push("name"+M+"*[*^$|!~]?="),a.querySelectorAll(":enabled").length||q.push(":enabled",":disabled"),a.querySelectorAll("*,:x"),q.push(",.*:")})),(c.matchesSelector=$.test(s=o.matches||o.webkitMatchesSelector||o.mozMatchesSelector||o.oMatchesSelector||o.msMatchesSelector))&&ib(function(a){c.disconnectedMatch=s.call(a,"div"),s.call(a,"[s!='']:x"),r.push("!=",Q)}),q=q.length&&new RegExp(q.join("|")),r=r.length&&new RegExp(r.join("|")),b=$.test(o.compareDocumentPosition),t=b||$.test(o.contains)?function(a,b){var c=9===a.nodeType?a.documentElement:a,d=b&&b.parentNode;return a===d||!(!d||1!==d.nodeType||!(c.contains?c.contains(d):a.compareDocumentPosition&&16&a.compareDocumentPosition(d)))}:function(a,b){if(b)while(b=b.parentNode)if(b===a)return!0;return!1},B=b?function(a,b){if(a===b)return l=!0,0;var d=!a.compareDocumentPosition-!b.compareDocumentPosition;return d?d:(d=(a.ownerDocument||a)===(b.ownerDocument||b)?a.compareDocumentPosition(b):1,1&d||!c.sortDetached&&b.compareDocumentPosition(a)===d?a===e||a.ownerDocument===v&&t(v,a)?-1:b===e||b.ownerDocument===v&&t(v,b)?1:k?K.call(k,a)-K.call(k,b):0:4&d?-1:1)}:function(a,b){if(a===b)return l=!0,0;var c,d=0,f=a.parentNode,g=b.parentNode,h=[a],i=[b];if(!f||!g)return a===e?-1:b===e?1:f?-1:g?1:k?K.call(k,a)-K.call(k,b):0;if(f===g)return kb(a,b);c=a;while(c=c.parentNode)h.unshift(c);c=b;while(c=c.parentNode)i.unshift(c);while(h[d]===i[d])d++;return d?kb(h[d],i[d]):h[d]===v?-1:i[d]===v?1:0},e):n},fb.matches=function(a,b){return fb(a,null,null,b)},fb.matchesSelector=function(a,b){if((a.ownerDocument||a)!==n&&m(a),b=b.replace(U,"='$1']"),!(!c.matchesSelector||!p||r&&r.test(b)||q&&q.test(b)))try{var d=s.call(a,b);if(d||c.disconnectedMatch||a.document&&11!==a.document.nodeType)return d}catch(e){}return fb(b,n,null,[a]).length>0},fb.contains=function(a,b){return(a.ownerDocument||a)!==n&&m(a),t(a,b)},fb.attr=function(a,b){(a.ownerDocument||a)!==n&&m(a);var e=d.attrHandle[b.toLowerCase()],f=e&&E.call(d.attrHandle,b.toLowerCase())?e(a,b,!p):void 0;return void 0!==f?f:c.attributes||!p?a.getAttribute(b):(f=a.getAttributeNode(b))&&f.specified?f.value:null},fb.error=function(a){throw new Error("Syntax error, unrecognized expression: "+a)},fb.uniqueSort=function(a){var b,d=[],e=0,f=0;if(l=!c.detectDuplicates,k=!c.sortStable&&a.slice(0),a.sort(B),l){while(b=a[f++])b===a[f]&&(e=d.push(f));while(e--)a.splice(d[e],1)}return k=null,a},e=fb.getText=function(a){var b,c="",d=0,f=a.nodeType;if(f){if(1===f||9===f||11===f){if("string"==typeof a.textContent)return a.textContent;for(a=a.firstChild;a;a=a.nextSibling)c+=e(a)}else if(3===f||4===f)return a.nodeValue}else while(b=a[d++])c+=e(b);return c},d=fb.selectors={cacheLength:50,createPseudo:hb,match:X,attrHandle:{},find:{},relative:{">":{dir:"parentNode",first:!0}," ":{dir:"parentNode"},"+":{dir:"previousSibling",first:!0},"~":{dir:"previousSibling"}},preFilter:{ATTR:function(a){return a[1]=a[1].replace(cb,db),a[3]=(a[3]||a[4]||a[5]||"").replace(cb,db),"~="===a[2]&&(a[3]=" "+a[3]+" "),a.slice(0,4)},CHILD:function(a){return a[1]=a[1].toLowerCase(),"nth"===a[1].slice(0,3)?(a[3]||fb.error(a[0]),a[4]=+(a[4]?a[5]+(a[6]||1):2*("even"===a[3]||"odd"===a[3])),a[5]=+(a[7]+a[8]||"odd"===a[3])):a[3]&&fb.error(a[0]),a},PSEUDO:function(a){var b,c=!a[6]&&a[2];return X.CHILD.test(a[0])?null:(a[3]?a[2]=a[4]||a[5]||"":c&&V.test(c)&&(b=g(c,!0))&&(b=c.indexOf(")",c.length-b)-c.length)&&(a[0]=a[0].slice(0,b),a[2]=c.slice(0,b)),a.slice(0,3))}},filter:{TAG:function(a){var b=a.replace(cb,db).toLowerCase();return"*"===a?function(){return!0}:function(a){return a.nodeName&&a.nodeName.toLowerCase()===b}},CLASS:function(a){var b=y[a+" "];return b||(b=new RegExp("(^|"+M+")"+a+"("+M+"|$)"))&&y(a,function(a){return b.test("string"==typeof a.className&&a.className||typeof a.getAttribute!==C&&a.getAttribute("class")||"")})},ATTR:function(a,b,c){return function(d){var e=fb.attr(d,a);return null==e?"!="===b:b?(e+="","="===b?e===c:"!="===b?e!==c:"^="===b?c&&0===e.indexOf(c):"*="===b?c&&e.indexOf(c)>-1:"$="===b?c&&e.slice(-c.length)===c:"~="===b?(" "+e+" ").indexOf(c)>-1:"|="===b?e===c||e.slice(0,c.length+1)===c+"-":!1):!0}},CHILD:function(a,b,c,d,e){var f="nth"!==a.slice(0,3),g="last"!==a.slice(-4),h="of-type"===b;return 1===d&&0===e?function(a){return!!a.parentNode}:function(b,c,i){var j,k,l,m,n,o,p=f!==g?"nextSibling":"previousSibling",q=b.parentNode,r=h&&b.nodeName.toLowerCase(),s=!i&&!h;if(q){if(f){while(p){l=b;while(l=l[p])if(h?l.nodeName.toLowerCase()===r:1===l.nodeType)return!1;o=p="only"===a&&!o&&"nextSibling"}return!0}if(o=[g?q.firstChild:q.lastChild],g&&s){k=q[u]||(q[u]={}),j=k[a]||[],n=j[0]===w&&j[1],m=j[0]===w&&j[2],l=n&&q.childNodes[n];while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if(1===l.nodeType&&++m&&l===b){k[a]=[w,n,m];break}}else if(s&&(j=(b[u]||(b[u]={}))[a])&&j[0]===w)m=j[1];else while(l=++n&&l&&l[p]||(m=n=0)||o.pop())if((h?l.nodeName.toLowerCase()===r:1===l.nodeType)&&++m&&(s&&((l[u]||(l[u]={}))[a]=[w,m]),l===b))break;return m-=e,m===d||m%d===0&&m/d>=0}}},PSEUDO:function(a,b){var c,e=d.pseudos[a]||d.setFilters[a.toLowerCase()]||fb.error("unsupported pseudo: "+a);return e[u]?e(b):e.length>1?(c=[a,a,"",b],d.setFilters.hasOwnProperty(a.toLowerCase())?hb(function(a,c){var d,f=e(a,b),g=f.length;while(g--)d=K.call(a,f[g]),a[d]=!(c[d]=f[g])}):function(a){return e(a,0,c)}):e}},pseudos:{not:hb(function(a){var b=[],c=[],d=h(a.replace(R,"$1"));return d[u]?hb(function(a,b,c,e){var f,g=d(a,null,e,[]),h=a.length;while(h--)(f=g[h])&&(a[h]=!(b[h]=f))}):function(a,e,f){return b[0]=a,d(b,null,f,c),!c.pop()}}),has:hb(function(a){return function(b){return fb(a,b).length>0}}),contains:hb(function(a){return function(b){return(b.textContent||b.innerText||e(b)).indexOf(a)>-1}}),lang:hb(function(a){return W.test(a||"")||fb.error("unsupported lang: "+a),a=a.replace(cb,db).toLowerCase(),function(b){var c;do if(c=p?b.lang:b.getAttribute("xml:lang")||b.getAttribute("lang"))return c=c.toLowerCase(),c===a||0===c.indexOf(a+"-");while((b=b.parentNode)&&1===b.nodeType);return!1}}),target:function(b){var c=a.location&&a.location.hash;return c&&c.slice(1)===b.id},root:function(a){return a===o},focus:function(a){return a===n.activeElement&&(!n.hasFocus||n.hasFocus())&&!!(a.type||a.href||~a.tabIndex)},enabled:function(a){return a.disabled===!1},disabled:function(a){return a.disabled===!0},checked:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&!!a.checked||"option"===b&&!!a.selected},selected:function(a){return a.parentNode&&a.parentNode.selectedIndex,a.selected===!0},empty:function(a){for(a=a.firstChild;a;a=a.nextSibling)if(a.nodeType<6)return!1;return!0},parent:function(a){return!d.pseudos.empty(a)},header:function(a){return Z.test(a.nodeName)},input:function(a){return Y.test(a.nodeName)},button:function(a){var b=a.nodeName.toLowerCase();return"input"===b&&"button"===a.type||"button"===b},text:function(a){var b;return"input"===a.nodeName.toLowerCase()&&"text"===a.type&&(null==(b=a.getAttribute("type"))||"text"===b.toLowerCase())},first:nb(function(){return[0]}),last:nb(function(a,b){return[b-1]}),eq:nb(function(a,b,c){return[0>c?c+b:c]}),even:nb(function(a,b){for(var c=0;b>c;c+=2)a.push(c);return a}),odd:nb(function(a,b){for(var c=1;b>c;c+=2)a.push(c);return a}),lt:nb(function(a,b,c){for(var d=0>c?c+b:c;--d>=0;)a.push(d);return a}),gt:nb(function(a,b,c){for(var d=0>c?c+b:c;++d<b;)a.push(d);return a})}},d.pseudos.nth=d.pseudos.eq;for(b in{radio:!0,checkbox:!0,file:!0,password:!0,image:!0})d.pseudos[b]=lb(b);for(b in{submit:!0,reset:!0})d.pseudos[b]=mb(b);function pb(){}pb.prototype=d.filters=d.pseudos,d.setFilters=new pb,g=fb.tokenize=function(a,b){var c,e,f,g,h,i,j,k=z[a+" "];if(k)return b?0:k.slice(0);h=a,i=[],j=d.preFilter;while(h){(!c||(e=S.exec(h)))&&(e&&(h=h.slice(e[0].length)||h),i.push(f=[])),c=!1,(e=T.exec(h))&&(c=e.shift(),f.push({value:c,type:e[0].replace(R," ")}),h=h.slice(c.length));for(g in d.filter)!(e=X[g].exec(h))||j[g]&&!(e=j[g](e))||(c=e.shift(),f.push({value:c,type:g,matches:e}),h=h.slice(c.length));if(!c)break}return b?h.length:h?fb.error(a):z(a,i).slice(0)};function qb(a){for(var b=0,c=a.length,d="";c>b;b++)d+=a[b].value;return d}function rb(a,b,c){var d=b.dir,e=c&&"parentNode"===d,f=x++;return b.first?function(b,c,f){while(b=b[d])if(1===b.nodeType||e)return a(b,c,f)}:function(b,c,g){var h,i,j=[w,f];if(g){while(b=b[d])if((1===b.nodeType||e)&&a(b,c,g))return!0}else while(b=b[d])if(1===b.nodeType||e){if(i=b[u]||(b[u]={}),(h=i[d])&&h[0]===w&&h[1]===f)return j[2]=h[2];if(i[d]=j,j[2]=a(b,c,g))return!0}}}function sb(a){return a.length>1?function(b,c,d){var e=a.length;while(e--)if(!a[e](b,c,d))return!1;return!0}:a[0]}function tb(a,b,c){for(var d=0,e=b.length;e>d;d++)fb(a,b[d],c);return c}function ub(a,b,c,d,e){for(var f,g=[],h=0,i=a.length,j=null!=b;i>h;h++)(f=a[h])&&(!c||c(f,d,e))&&(g.push(f),j&&b.push(h));return g}function vb(a,b,c,d,e,f){return d&&!d[u]&&(d=vb(d)),e&&!e[u]&&(e=vb(e,f)),hb(function(f,g,h,i){var j,k,l,m=[],n=[],o=g.length,p=f||tb(b||"*",h.nodeType?[h]:h,[]),q=!a||!f&&b?p:ub(p,m,a,h,i),r=c?e||(f?a:o||d)?[]:g:q;if(c&&c(q,r,h,i),d){j=ub(r,n),d(j,[],h,i),k=j.length;while(k--)(l=j[k])&&(r[n[k]]=!(q[n[k]]=l))}if(f){if(e||a){if(e){j=[],k=r.length;while(k--)(l=r[k])&&j.push(q[k]=l);e(null,r=[],j,i)}k=r.length;while(k--)(l=r[k])&&(j=e?K.call(f,l):m[k])>-1&&(f[j]=!(g[j]=l))}}else r=ub(r===g?r.splice(o,r.length):r),e?e(null,g,r,i):I.apply(g,r)})}function wb(a){for(var b,c,e,f=a.length,g=d.relative[a[0].type],h=g||d.relative[" "],i=g?1:0,k=rb(function(a){return a===b},h,!0),l=rb(function(a){return K.call(b,a)>-1},h,!0),m=[function(a,c,d){return!g&&(d||c!==j)||((b=c).nodeType?k(a,c,d):l(a,c,d))}];f>i;i++)if(c=d.relative[a[i].type])m=[rb(sb(m),c)];else{if(c=d.filter[a[i].type].apply(null,a[i].matches),c[u]){for(e=++i;f>e;e++)if(d.relative[a[e].type])break;return vb(i>1&&sb(m),i>1&&qb(a.slice(0,i-1).concat({value:" "===a[i-2].type?"*":""})).replace(R,"$1"),c,e>i&&wb(a.slice(i,e)),f>e&&wb(a=a.slice(e)),f>e&&qb(a))}m.push(c)}return sb(m)}function xb(a,b){var c=b.length>0,e=a.length>0,f=function(f,g,h,i,k){var l,m,o,p=0,q="0",r=f&&[],s=[],t=j,u=f||e&&d.find.TAG("*",k),v=w+=null==t?1:Math.random()||.1,x=u.length;for(k&&(j=g!==n&&g);q!==x&&null!=(l=u[q]);q++){if(e&&l){m=0;while(o=a[m++])if(o(l,g,h)){i.push(l);break}k&&(w=v)}c&&((l=!o&&l)&&p--,f&&r.push(l))}if(p+=q,c&&q!==p){m=0;while(o=b[m++])o(r,s,g,h);if(f){if(p>0)while(q--)r[q]||s[q]||(s[q]=G.call(i));s=ub(s)}I.apply(i,s),k&&!f&&s.length>0&&p+b.length>1&&fb.uniqueSort(i)}return k&&(w=v,j=t),r};return c?hb(f):f}return h=fb.compile=function(a,b){var c,d=[],e=[],f=A[a+" "];if(!f){b||(b=g(a)),c=b.length;while(c--)f=wb(b[c]),f[u]?d.push(f):e.push(f);f=A(a,xb(e,d)),f.selector=a}return f},i=fb.select=function(a,b,e,f){var i,j,k,l,m,n="function"==typeof a&&a,o=!f&&g(a=n.selector||a);if(e=e||[],1===o.length){if(j=o[0]=o[0].slice(0),j.length>2&&"ID"===(k=j[0]).type&&c.getById&&9===b.nodeType&&p&&d.relative[j[1].type]){if(b=(d.find.ID(k.matches[0].replace(cb,db),b)||[])[0],!b)return e;n&&(b=b.parentNode),a=a.slice(j.shift().value.length)}i=X.needsContext.test(a)?0:j.length;while(i--){if(k=j[i],d.relative[l=k.type])break;if((m=d.find[l])&&(f=m(k.matches[0].replace(cb,db),ab.test(j[0].type)&&ob(b.parentNode)||b))){if(j.splice(i,1),a=f.length&&qb(j),!a)return I.apply(e,f),e;break}}}return(n||h(a,o))(f,b,!p,e,ab.test(a)&&ob(b.parentNode)||b),e},c.sortStable=u.split("").sort(B).join("")===u,c.detectDuplicates=!!l,m(),c.sortDetached=ib(function(a){return 1&a.compareDocumentPosition(n.createElement("div"))}),ib(function(a){return a.innerHTML="<a href='#'></a>","#"===a.firstChild.getAttribute("href")})||jb("type|href|height|width",function(a,b,c){return c?void 0:a.getAttribute(b,"type"===b.toLowerCase()?1:2)}),c.attributes&&ib(function(a){return a.innerHTML="<input/>",a.firstChild.setAttribute("value",""),""===a.firstChild.getAttribute("value")})||jb("value",function(a,b,c){return c||"input"!==a.nodeName.toLowerCase()?void 0:a.defaultValue}),ib(function(a){return null==a.getAttribute("disabled")})||jb(L,function(a,b,c){var d;return c?void 0:a[b]===!0?b.toLowerCase():(d=a.getAttributeNode(b))&&d.specified?d.value:null}),fb}(a);n.find=t,n.expr=t.selectors,n.expr[":"]=n.expr.pseudos,n.unique=t.uniqueSort,n.text=t.getText,n.isXMLDoc=t.isXML,n.contains=t.contains;var u=n.expr.match.needsContext,v=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,w=/^.[^:#\[\.,]*$/;function x(a,b,c){if(n.isFunction(b))return n.grep(a,function(a,d){return!!b.call(a,d,a)!==c});if(b.nodeType)return n.grep(a,function(a){return a===b!==c});if("string"==typeof b){if(w.test(b))return n.filter(b,a,c);b=n.filter(b,a)}return n.grep(a,function(a){return g.call(b,a)>=0!==c})}n.filter=function(a,b,c){var d=b[0];return c&&(a=":not("+a+")"),1===b.length&&1===d.nodeType?n.find.matchesSelector(d,a)?[d]:[]:n.find.matches(a,n.grep(b,function(a){return 1===a.nodeType}))},n.fn.extend({find:function(a){var b,c=this.length,d=[],e=this;if("string"!=typeof a)return this.pushStack(n(a).filter(function(){for(b=0;c>b;b++)if(n.contains(e[b],this))return!0}));for(b=0;c>b;b++)n.find(a,e[b],d);return d=this.pushStack(c>1?n.unique(d):d),d.selector=this.selector?this.selector+" "+a:a,d},filter:function(a){return this.pushStack(x(this,a||[],!1))},not:function(a){return this.pushStack(x(this,a||[],!0))},is:function(a){return!!x(this,"string"==typeof a&&u.test(a)?n(a):a||[],!1).length}});var y,z=/^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/,A=n.fn.init=function(a,b){var c,d;if(!a)return this;if("string"==typeof a){if(c="<"===a[0]&&">"===a[a.length-1]&&a.length>=3?[null,a,null]:z.exec(a),!c||!c[1]&&b)return!b||b.jquery?(b||y).find(a):this.constructor(b).find(a);if(c[1]){if(b=b instanceof n?b[0]:b,n.merge(this,n.parseHTML(c[1],b&&b.nodeType?b.ownerDocument||b:l,!0)),v.test(c[1])&&n.isPlainObject(b))for(c in b)n.isFunction(this[c])?this[c](b[c]):this.attr(c,b[c]);return this}return d=l.getElementById(c[2]),d&&d.parentNode&&(this.length=1,this[0]=d),this.context=l,this.selector=a,this}return a.nodeType?(this.context=this[0]=a,this.length=1,this):n.isFunction(a)?"undefined"!=typeof y.ready?y.ready(a):a(n):(void 0!==a.selector&&(this.selector=a.selector,this.context=a.context),n.makeArray(a,this))};A.prototype=n.fn,y=n(l);var B=/^(?:parents|prev(?:Until|All))/,C={children:!0,contents:!0,next:!0,prev:!0};n.extend({dir:function(a,b,c){var d=[],e=void 0!==c;while((a=a[b])&&9!==a.nodeType)if(1===a.nodeType){if(e&&n(a).is(c))break;d.push(a)}return d},sibling:function(a,b){for(var c=[];a;a=a.nextSibling)1===a.nodeType&&a!==b&&c.push(a);return c}}),n.fn.extend({has:function(a){var b=n(a,this),c=b.length;return this.filter(function(){for(var a=0;c>a;a++)if(n.contains(this,b[a]))return!0})},closest:function(a,b){for(var c,d=0,e=this.length,f=[],g=u.test(a)||"string"!=typeof a?n(a,b||this.context):0;e>d;d++)for(c=this[d];c&&c!==b;c=c.parentNode)if(c.nodeType<11&&(g?g.index(c)>-1:1===c.nodeType&&n.find.matchesSelector(c,a))){f.push(c);break}return this.pushStack(f.length>1?n.unique(f):f)},index:function(a){return a?"string"==typeof a?g.call(n(a),this[0]):g.call(this,a.jquery?a[0]:a):this[0]&&this[0].parentNode?this.first().prevAll().length:-1},add:function(a,b){return this.pushStack(n.unique(n.merge(this.get(),n(a,b))))},addBack:function(a){return this.add(null==a?this.prevObject:this.prevObject.filter(a))}});function D(a,b){while((a=a[b])&&1!==a.nodeType);return a}n.each({parent:function(a){var b=a.parentNode;return b&&11!==b.nodeType?b:null},parents:function(a){return n.dir(a,"parentNode")},parentsUntil:function(a,b,c){return n.dir(a,"parentNode",c)},next:function(a){return D(a,"nextSibling")},prev:function(a){return D(a,"previousSibling")},nextAll:function(a){return n.dir(a,"nextSibling")},prevAll:function(a){return n.dir(a,"previousSibling")},nextUntil:function(a,b,c){return n.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return n.dir(a,"previousSibling",c)},siblings:function(a){return n.sibling((a.parentNode||{}).firstChild,a)},children:function(a){return n.sibling(a.firstChild)},contents:function(a){return a.contentDocument||n.merge([],a.childNodes)}},function(a,b){n.fn[a]=function(c,d){var e=n.map(this,b,c);return"Until"!==a.slice(-5)&&(d=c),d&&"string"==typeof d&&(e=n.filter(d,e)),this.length>1&&(C[a]||n.unique(e),B.test(a)&&e.reverse()),this.pushStack(e)}});var E=/\S+/g,F={};function G(a){var b=F[a]={};return n.each(a.match(E)||[],function(a,c){b[c]=!0}),b}n.Callbacks=function(a){a="string"==typeof a?F[a]||G(a):n.extend({},a);var b,c,d,e,f,g,h=[],i=!a.once&&[],j=function(l){for(b=a.memory&&l,c=!0,g=e||0,e=0,f=h.length,d=!0;h&&f>g;g++)if(h[g].apply(l[0],l[1])===!1&&a.stopOnFalse){b=!1;break}d=!1,h&&(i?i.length&&j(i.shift()):b?h=[]:k.disable())},k={add:function(){if(h){var c=h.length;!function g(b){n.each(b,function(b,c){var d=n.type(c);"function"===d?a.unique&&k.has(c)||h.push(c):c&&c.length&&"string"!==d&&g(c)})}(arguments),d?f=h.length:b&&(e=c,j(b))}return this},remove:function(){return h&&n.each(arguments,function(a,b){var c;while((c=n.inArray(b,h,c))>-1)h.splice(c,1),d&&(f>=c&&f--,g>=c&&g--)}),this},has:function(a){return a?n.inArray(a,h)>-1:!(!h||!h.length)},empty:function(){return h=[],f=0,this},disable:function(){return h=i=b=void 0,this},disabled:function(){return!h},lock:function(){return i=void 0,b||k.disable(),this},locked:function(){return!i},fireWith:function(a,b){return!h||c&&!i||(b=b||[],b=[a,b.slice?b.slice():b],d?i.push(b):j(b)),this},fire:function(){return k.fireWith(this,arguments),this},fired:function(){return!!c}};return k},n.extend({Deferred:function(a){var b=[["resolve","done",n.Callbacks("once memory"),"resolved"],["reject","fail",n.Callbacks("once memory"),"rejected"],["notify","progress",n.Callbacks("memory")]],c="pending",d={state:function(){return c},always:function(){return e.done(arguments).fail(arguments),this},then:function(){var a=arguments;return n.Deferred(function(c){n.each(b,function(b,f){var g=n.isFunction(a[b])&&a[b];e[f[1]](function(){var a=g&&g.apply(this,arguments);a&&n.isFunction(a.promise)?a.promise().done(c.resolve).fail(c.reject).progress(c.notify):c[f[0]+"With"](this===d?c.promise():this,g?[a]:arguments)})}),a=null}).promise()},promise:function(a){return null!=a?n.extend(a,d):d}},e={};return d.pipe=d.then,n.each(b,function(a,f){var g=f[2],h=f[3];d[f[1]]=g.add,h&&g.add(function(){c=h},b[1^a][2].disable,b[2][2].lock),e[f[0]]=function(){return e[f[0]+"With"](this===e?d:this,arguments),this},e[f[0]+"With"]=g.fireWith}),d.promise(e),a&&a.call(e,e),e},when:function(a){var b=0,c=d.call(arguments),e=c.length,f=1!==e||a&&n.isFunction(a.promise)?e:0,g=1===f?a:n.Deferred(),h=function(a,b,c){return function(e){b[a]=this,c[a]=arguments.length>1?d.call(arguments):e,c===i?g.notifyWith(b,c):--f||g.resolveWith(b,c)}},i,j,k;if(e>1)for(i=new Array(e),j=new Array(e),k=new Array(e);e>b;b++)c[b]&&n.isFunction(c[b].promise)?c[b].promise().done(h(b,k,c)).fail(g.reject).progress(h(b,j,i)):--f;return f||g.resolveWith(k,c),g.promise()}});var H;n.fn.ready=function(a){return n.ready.promise().done(a),this},n.extend({isReady:!1,readyWait:1,holdReady:function(a){a?n.readyWait++:n.ready(!0)},ready:function(a){(a===!0?--n.readyWait:n.isReady)||(n.isReady=!0,a!==!0&&--n.readyWait>0||(H.resolveWith(l,[n]),n.fn.triggerHandler&&(n(l).triggerHandler("ready"),n(l).off("ready"))))}});function I(){l.removeEventListener("DOMContentLoaded",I,!1),a.removeEventListener("load",I,!1),n.ready()}n.ready.promise=function(b){return H||(H=n.Deferred(),"complete"===l.readyState?setTimeout(n.ready):(l.addEventListener("DOMContentLoaded",I,!1),a.addEventListener("load",I,!1))),H.promise(b)},n.ready.promise();var J=n.access=function(a,b,c,d,e,f,g){var h=0,i=a.length,j=null==c;if("object"===n.type(c)){e=!0;for(h in c)n.access(a,b,h,c[h],!0,f,g)}else if(void 0!==d&&(e=!0,n.isFunction(d)||(g=!0),j&&(g?(b.call(a,d),b=null):(j=b,b=function(a,b,c){return j.call(n(a),c)})),b))for(;i>h;h++)b(a[h],c,g?d:d.call(a[h],h,b(a[h],c)));return e?a:j?b.call(a):i?b(a[0],c):f};n.acceptData=function(a){return 1===a.nodeType||9===a.nodeType||!+a.nodeType};function K(){Object.defineProperty(this.cache={},0,{get:function(){return{}}}),this.expando=n.expando+Math.random()}K.uid=1,K.accepts=n.acceptData,K.prototype={key:function(a){if(!K.accepts(a))return 0;var b={},c=a[this.expando];if(!c){c=K.uid++;try{b[this.expando]={value:c},Object.defineProperties(a,b)}catch(d){b[this.expando]=c,n.extend(a,b)}}return this.cache[c]||(this.cache[c]={}),c},set:function(a,b,c){var d,e=this.key(a),f=this.cache[e];if("string"==typeof b)f[b]=c;else if(n.isEmptyObject(f))n.extend(this.cache[e],b);else for(d in b)f[d]=b[d];return f},get:function(a,b){var c=this.cache[this.key(a)];return void 0===b?c:c[b]},access:function(a,b,c){var d;return void 0===b||b&&"string"==typeof b&&void 0===c?(d=this.get(a,b),void 0!==d?d:this.get(a,n.camelCase(b))):(this.set(a,b,c),void 0!==c?c:b)},remove:function(a,b){var c,d,e,f=this.key(a),g=this.cache[f];if(void 0===b)this.cache[f]={};else{n.isArray(b)?d=b.concat(b.map(n.camelCase)):(e=n.camelCase(b),b in g?d=[b,e]:(d=e,d=d in g?[d]:d.match(E)||[])),c=d.length;while(c--)delete g[d[c]]}},hasData:function(a){return!n.isEmptyObject(this.cache[a[this.expando]]||{})},discard:function(a){a[this.expando]&&delete this.cache[a[this.expando]]}};var L=new K,M=new K,N=/^(?:\{[\w\W]*\}|\[[\w\W]*\])$/,O=/([A-Z])/g;function P(a,b,c){var d;if(void 0===c&&1===a.nodeType)if(d="data-"+b.replace(O,"-$1").toLowerCase(),c=a.getAttribute(d),"string"==typeof c){try{c="true"===c?!0:"false"===c?!1:"null"===c?null:+c+""===c?+c:N.test(c)?n.parseJSON(c):c}catch(e){}M.set(a,b,c)}else c=void 0;return c}n.extend({hasData:function(a){return M.hasData(a)||L.hasData(a)},data:function(a,b,c){return M.access(a,b,c)},removeData:function(a,b){M.remove(a,b)
421 },_data:function(a,b,c){return L.access(a,b,c)},_removeData:function(a,b){L.remove(a,b)}}),n.fn.extend({data:function(a,b){var c,d,e,f=this[0],g=f&&f.attributes;if(void 0===a){if(this.length&&(e=M.get(f),1===f.nodeType&&!L.get(f,"hasDataAttrs"))){c=g.length;while(c--)g[c]&&(d=g[c].name,0===d.indexOf("data-")&&(d=n.camelCase(d.slice(5)),P(f,d,e[d])));L.set(f,"hasDataAttrs",!0)}return e}return"object"==typeof a?this.each(function(){M.set(this,a)}):J(this,function(b){var c,d=n.camelCase(a);if(f&&void 0===b){if(c=M.get(f,a),void 0!==c)return c;if(c=M.get(f,d),void 0!==c)return c;if(c=P(f,d,void 0),void 0!==c)return c}else this.each(function(){var c=M.get(this,d);M.set(this,d,b),-1!==a.indexOf("-")&&void 0!==c&&M.set(this,a,b)})},null,b,arguments.length>1,null,!0)},removeData:function(a){return this.each(function(){M.remove(this,a)})}}),n.extend({queue:function(a,b,c){var d;return a?(b=(b||"fx")+"queue",d=L.get(a,b),c&&(!d||n.isArray(c)?d=L.access(a,b,n.makeArray(c)):d.push(c)),d||[]):void 0},dequeue:function(a,b){b=b||"fx";var c=n.queue(a,b),d=c.length,e=c.shift(),f=n._queueHooks(a,b),g=function(){n.dequeue(a,b)};"inprogress"===e&&(e=c.shift(),d--),e&&("fx"===b&&c.unshift("inprogress"),delete f.stop,e.call(a,g,f)),!d&&f&&f.empty.fire()},_queueHooks:function(a,b){var c=b+"queueHooks";return L.get(a,c)||L.access(a,c,{empty:n.Callbacks("once memory").add(function(){L.remove(a,[b+"queue",c])})})}}),n.fn.extend({queue:function(a,b){var c=2;return"string"!=typeof a&&(b=a,a="fx",c--),arguments.length<c?n.queue(this[0],a):void 0===b?this:this.each(function(){var c=n.queue(this,a,b);n._queueHooks(this,a),"fx"===a&&"inprogress"!==c[0]&&n.dequeue(this,a)})},dequeue:function(a){return this.each(function(){n.dequeue(this,a)})},clearQueue:function(a){return this.queue(a||"fx",[])},promise:function(a,b){var c,d=1,e=n.Deferred(),f=this,g=this.length,h=function(){--d||e.resolveWith(f,[f])};"string"!=typeof a&&(b=a,a=void 0),a=a||"fx";while(g--)c=L.get(f[g],a+"queueHooks"),c&&c.empty&&(d++,c.empty.add(h));return h(),e.promise(b)}});var Q=/[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source,R=["Top","Right","Bottom","Left"],S=function(a,b){return a=b||a,"none"===n.css(a,"display")||!n.contains(a.ownerDocument,a)},T=/^(?:checkbox|radio)$/i;!function(){var a=l.createDocumentFragment(),b=a.appendChild(l.createElement("div")),c=l.createElement("input");c.setAttribute("type","radio"),c.setAttribute("checked","checked"),c.setAttribute("name","t"),b.appendChild(c),k.checkClone=b.cloneNode(!0).cloneNode(!0).lastChild.checked,b.innerHTML="<textarea>x</textarea>",k.noCloneChecked=!!b.cloneNode(!0).lastChild.defaultValue}();var U="undefined";k.focusinBubbles="onfocusin"in a;var V=/^key/,W=/^(?:mouse|pointer|contextmenu)|click/,X=/^(?:focusinfocus|focusoutblur)$/,Y=/^([^.]*)(?:\.(.+)|)$/;function Z(){return!0}function $(){return!1}function _(){try{return l.activeElement}catch(a){}}n.event={global:{},add:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.get(a);if(r){c.handler&&(f=c,c=f.handler,e=f.selector),c.guid||(c.guid=n.guid++),(i=r.events)||(i=r.events={}),(g=r.handle)||(g=r.handle=function(b){return typeof n!==U&&n.event.triggered!==b.type?n.event.dispatch.apply(a,arguments):void 0}),b=(b||"").match(E)||[""],j=b.length;while(j--)h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o&&(l=n.event.special[o]||{},o=(e?l.delegateType:l.bindType)||o,l=n.event.special[o]||{},k=n.extend({type:o,origType:q,data:d,handler:c,guid:c.guid,selector:e,needsContext:e&&n.expr.match.needsContext.test(e),namespace:p.join(".")},f),(m=i[o])||(m=i[o]=[],m.delegateCount=0,l.setup&&l.setup.call(a,d,p,g)!==!1||a.addEventListener&&a.addEventListener(o,g,!1)),l.add&&(l.add.call(a,k),k.handler.guid||(k.handler.guid=c.guid)),e?m.splice(m.delegateCount++,0,k):m.push(k),n.event.global[o]=!0)}},remove:function(a,b,c,d,e){var f,g,h,i,j,k,l,m,o,p,q,r=L.hasData(a)&&L.get(a);if(r&&(i=r.events)){b=(b||"").match(E)||[""],j=b.length;while(j--)if(h=Y.exec(b[j])||[],o=q=h[1],p=(h[2]||"").split(".").sort(),o){l=n.event.special[o]||{},o=(d?l.delegateType:l.bindType)||o,m=i[o]||[],h=h[2]&&new RegExp("(^|\\.)"+p.join("\\.(?:.*\\.|)")+"(\\.|$)"),g=f=m.length;while(f--)k=m[f],!e&&q!==k.origType||c&&c.guid!==k.guid||h&&!h.test(k.namespace)||d&&d!==k.selector&&("**"!==d||!k.selector)||(m.splice(f,1),k.selector&&m.delegateCount--,l.remove&&l.remove.call(a,k));g&&!m.length&&(l.teardown&&l.teardown.call(a,p,r.handle)!==!1||n.removeEvent(a,o,r.handle),delete i[o])}else for(o in i)n.event.remove(a,o+b[j],c,d,!0);n.isEmptyObject(i)&&(delete r.handle,L.remove(a,"events"))}},trigger:function(b,c,d,e){var f,g,h,i,k,m,o,p=[d||l],q=j.call(b,"type")?b.type:b,r=j.call(b,"namespace")?b.namespace.split("."):[];if(g=h=d=d||l,3!==d.nodeType&&8!==d.nodeType&&!X.test(q+n.event.triggered)&&(q.indexOf(".")>=0&&(r=q.split("."),q=r.shift(),r.sort()),k=q.indexOf(":")<0&&"on"+q,b=b[n.expando]?b:new n.Event(q,"object"==typeof b&&b),b.isTrigger=e?2:3,b.namespace=r.join("."),b.namespace_re=b.namespace?new RegExp("(^|\\.)"+r.join("\\.(?:.*\\.|)")+"(\\.|$)"):null,b.result=void 0,b.target||(b.target=d),c=null==c?[b]:n.makeArray(c,[b]),o=n.event.special[q]||{},e||!o.trigger||o.trigger.apply(d,c)!==!1)){if(!e&&!o.noBubble&&!n.isWindow(d)){for(i=o.delegateType||q,X.test(i+q)||(g=g.parentNode);g;g=g.parentNode)p.push(g),h=g;h===(d.ownerDocument||l)&&p.push(h.defaultView||h.parentWindow||a)}f=0;while((g=p[f++])&&!b.isPropagationStopped())b.type=f>1?i:o.bindType||q,m=(L.get(g,"events")||{})[b.type]&&L.get(g,"handle"),m&&m.apply(g,c),m=k&&g[k],m&&m.apply&&n.acceptData(g)&&(b.result=m.apply(g,c),b.result===!1&&b.preventDefault());return b.type=q,e||b.isDefaultPrevented()||o._default&&o._default.apply(p.pop(),c)!==!1||!n.acceptData(d)||k&&n.isFunction(d[q])&&!n.isWindow(d)&&(h=d[k],h&&(d[k]=null),n.event.triggered=q,d[q](),n.event.triggered=void 0,h&&(d[k]=h)),b.result}},dispatch:function(a){a=n.event.fix(a);var b,c,e,f,g,h=[],i=d.call(arguments),j=(L.get(this,"events")||{})[a.type]||[],k=n.event.special[a.type]||{};if(i[0]=a,a.delegateTarget=this,!k.preDispatch||k.preDispatch.call(this,a)!==!1){h=n.event.handlers.call(this,a,j),b=0;while((f=h[b++])&&!a.isPropagationStopped()){a.currentTarget=f.elem,c=0;while((g=f.handlers[c++])&&!a.isImmediatePropagationStopped())(!a.namespace_re||a.namespace_re.test(g.namespace))&&(a.handleObj=g,a.data=g.data,e=((n.event.special[g.origType]||{}).handle||g.handler).apply(f.elem,i),void 0!==e&&(a.result=e)===!1&&(a.preventDefault(),a.stopPropagation()))}return k.postDispatch&&k.postDispatch.call(this,a),a.result}},handlers:function(a,b){var c,d,e,f,g=[],h=b.delegateCount,i=a.target;if(h&&i.nodeType&&(!a.button||"click"!==a.type))for(;i!==this;i=i.parentNode||this)if(i.disabled!==!0||"click"!==a.type){for(d=[],c=0;h>c;c++)f=b[c],e=f.selector+" ",void 0===d[e]&&(d[e]=f.needsContext?n(e,this).index(i)>=0:n.find(e,this,null,[i]).length),d[e]&&d.push(f);d.length&&g.push({elem:i,handlers:d})}return h<b.length&&g.push({elem:this,handlers:b.slice(h)}),g},props:"altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks:{},keyHooks:{props:"char charCode key keyCode".split(" "),filter:function(a,b){return null==a.which&&(a.which=null!=b.charCode?b.charCode:b.keyCode),a}},mouseHooks:{props:"button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter:function(a,b){var c,d,e,f=b.button;return null==a.pageX&&null!=b.clientX&&(c=a.target.ownerDocument||l,d=c.documentElement,e=c.body,a.pageX=b.clientX+(d&&d.scrollLeft||e&&e.scrollLeft||0)-(d&&d.clientLeft||e&&e.clientLeft||0),a.pageY=b.clientY+(d&&d.scrollTop||e&&e.scrollTop||0)-(d&&d.clientTop||e&&e.clientTop||0)),a.which||void 0===f||(a.which=1&f?1:2&f?3:4&f?2:0),a}},fix:function(a){if(a[n.expando])return a;var b,c,d,e=a.type,f=a,g=this.fixHooks[e];g||(this.fixHooks[e]=g=W.test(e)?this.mouseHooks:V.test(e)?this.keyHooks:{}),d=g.props?this.props.concat(g.props):this.props,a=new n.Event(f),b=d.length;while(b--)c=d[b],a[c]=f[c];return a.target||(a.target=l),3===a.target.nodeType&&(a.target=a.target.parentNode),g.filter?g.filter(a,f):a},special:{load:{noBubble:!0},focus:{trigger:function(){return this!==_()&&this.focus?(this.focus(),!1):void 0},delegateType:"focusin"},blur:{trigger:function(){return this===_()&&this.blur?(this.blur(),!1):void 0},delegateType:"focusout"},click:{trigger:function(){return"checkbox"===this.type&&this.click&&n.nodeName(this,"input")?(this.click(),!1):void 0},_default:function(a){return n.nodeName(a.target,"a")}},beforeunload:{postDispatch:function(a){void 0!==a.result&&a.originalEvent&&(a.originalEvent.returnValue=a.result)}}},simulate:function(a,b,c,d){var e=n.extend(new n.Event,c,{type:a,isSimulated:!0,originalEvent:{}});d?n.event.trigger(e,null,b):n.event.dispatch.call(b,e),e.isDefaultPrevented()&&c.preventDefault()}},n.removeEvent=function(a,b,c){a.removeEventListener&&a.removeEventListener(b,c,!1)},n.Event=function(a,b){return this instanceof n.Event?(a&&a.type?(this.originalEvent=a,this.type=a.type,this.isDefaultPrevented=a.defaultPrevented||void 0===a.defaultPrevented&&a.returnValue===!1?Z:$):this.type=a,b&&n.extend(this,b),this.timeStamp=a&&a.timeStamp||n.now(),void(this[n.expando]=!0)):new n.Event(a,b)},n.Event.prototype={isDefaultPrevented:$,isPropagationStopped:$,isImmediatePropagationStopped:$,preventDefault:function(){var a=this.originalEvent;this.isDefaultPrevented=Z,a&&a.preventDefault&&a.preventDefault()},stopPropagation:function(){var a=this.originalEvent;this.isPropagationStopped=Z,a&&a.stopPropagation&&a.stopPropagation()},stopImmediatePropagation:function(){var a=this.originalEvent;this.isImmediatePropagationStopped=Z,a&&a.stopImmediatePropagation&&a.stopImmediatePropagation(),this.stopPropagation()}},n.each({mouseenter:"mouseover",mouseleave:"mouseout",pointerenter:"pointerover",pointerleave:"pointerout"},function(a,b){n.event.special[a]={delegateType:b,bindType:b,handle:function(a){var c,d=this,e=a.relatedTarget,f=a.handleObj;return(!e||e!==d&&!n.contains(d,e))&&(a.type=f.origType,c=f.handler.apply(this,arguments),a.type=b),c}}}),k.focusinBubbles||n.each({focus:"focusin",blur:"focusout"},function(a,b){var c=function(a){n.event.simulate(b,a.target,n.event.fix(a),!0)};n.event.special[b]={setup:function(){var d=this.ownerDocument||this,e=L.access(d,b);e||d.addEventListener(a,c,!0),L.access(d,b,(e||0)+1)},teardown:function(){var d=this.ownerDocument||this,e=L.access(d,b)-1;e?L.access(d,b,e):(d.removeEventListener(a,c,!0),L.remove(d,b))}}}),n.fn.extend({on:function(a,b,c,d,e){var f,g;if("object"==typeof a){"string"!=typeof b&&(c=c||b,b=void 0);for(g in a)this.on(g,b,c,a[g],e);return this}if(null==c&&null==d?(d=b,c=b=void 0):null==d&&("string"==typeof b?(d=c,c=void 0):(d=c,c=b,b=void 0)),d===!1)d=$;else if(!d)return this;return 1===e&&(f=d,d=function(a){return n().off(a),f.apply(this,arguments)},d.guid=f.guid||(f.guid=n.guid++)),this.each(function(){n.event.add(this,a,d,c,b)})},one:function(a,b,c,d){return this.on(a,b,c,d,1)},off:function(a,b,c){var d,e;if(a&&a.preventDefault&&a.handleObj)return d=a.handleObj,n(a.delegateTarget).off(d.namespace?d.origType+"."+d.namespace:d.origType,d.selector,d.handler),this;if("object"==typeof a){for(e in a)this.off(e,b,a[e]);return this}return(b===!1||"function"==typeof b)&&(c=b,b=void 0),c===!1&&(c=$),this.each(function(){n.event.remove(this,a,c,b)})},trigger:function(a,b){return this.each(function(){n.event.trigger(a,b,this)})},triggerHandler:function(a,b){var c=this[0];return c?n.event.trigger(a,b,c,!0):void 0}});var ab=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,bb=/<([\w:]+)/,cb=/<|&#?\w+;/,db=/<(?:script|style|link)/i,eb=/checked\s*(?:[^=]|=\s*.checked.)/i,fb=/^$|\/(?:java|ecma)script/i,gb=/^true\/(.*)/,hb=/^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g,ib={option:[1,"<select multiple='multiple'>","</select>"],thead:[1,"<table>","</table>"],col:[2,"<table><colgroup>","</colgroup></table>"],tr:[2,"<table><tbody>","</tbody></table>"],td:[3,"<table><tbody><tr>","</tr></tbody></table>"],_default:[0,"",""]};ib.optgroup=ib.option,ib.tbody=ib.tfoot=ib.colgroup=ib.caption=ib.thead,ib.th=ib.td;function jb(a,b){return n.nodeName(a,"table")&&n.nodeName(11!==b.nodeType?b:b.firstChild,"tr")?a.getElementsByTagName("tbody")[0]||a.appendChild(a.ownerDocument.createElement("tbody")):a}function kb(a){return a.type=(null!==a.getAttribute("type"))+"/"+a.type,a}function lb(a){var b=gb.exec(a.type);return b?a.type=b[1]:a.removeAttribute("type"),a}function mb(a,b){for(var c=0,d=a.length;d>c;c++)L.set(a[c],"globalEval",!b||L.get(b[c],"globalEval"))}function nb(a,b){var c,d,e,f,g,h,i,j;if(1===b.nodeType){if(L.hasData(a)&&(f=L.access(a),g=L.set(b,f),j=f.events)){delete g.handle,g.events={};for(e in j)for(c=0,d=j[e].length;d>c;c++)n.event.add(b,e,j[e][c])}M.hasData(a)&&(h=M.access(a),i=n.extend({},h),M.set(b,i))}}function ob(a,b){var c=a.getElementsByTagName?a.getElementsByTagName(b||"*"):a.querySelectorAll?a.querySelectorAll(b||"*"):[];return void 0===b||b&&n.nodeName(a,b)?n.merge([a],c):c}function pb(a,b){var c=b.nodeName.toLowerCase();"input"===c&&T.test(a.type)?b.checked=a.checked:("input"===c||"textarea"===c)&&(b.defaultValue=a.defaultValue)}n.extend({clone:function(a,b,c){var d,e,f,g,h=a.cloneNode(!0),i=n.contains(a.ownerDocument,a);if(!(k.noCloneChecked||1!==a.nodeType&&11!==a.nodeType||n.isXMLDoc(a)))for(g=ob(h),f=ob(a),d=0,e=f.length;e>d;d++)pb(f[d],g[d]);if(b)if(c)for(f=f||ob(a),g=g||ob(h),d=0,e=f.length;e>d;d++)nb(f[d],g[d]);else nb(a,h);return g=ob(h,"script"),g.length>0&&mb(g,!i&&ob(a,"script")),h},buildFragment:function(a,b,c,d){for(var e,f,g,h,i,j,k=b.createDocumentFragment(),l=[],m=0,o=a.length;o>m;m++)if(e=a[m],e||0===e)if("object"===n.type(e))n.merge(l,e.nodeType?[e]:e);else if(cb.test(e)){f=f||k.appendChild(b.createElement("div")),g=(bb.exec(e)||["",""])[1].toLowerCase(),h=ib[g]||ib._default,f.innerHTML=h[1]+e.replace(ab,"<$1></$2>")+h[2],j=h[0];while(j--)f=f.lastChild;n.merge(l,f.childNodes),f=k.firstChild,f.textContent=""}else l.push(b.createTextNode(e));k.textContent="",m=0;while(e=l[m++])if((!d||-1===n.inArray(e,d))&&(i=n.contains(e.ownerDocument,e),f=ob(k.appendChild(e),"script"),i&&mb(f),c)){j=0;while(e=f[j++])fb.test(e.type||"")&&c.push(e)}return k},cleanData:function(a){for(var b,c,d,e,f=n.event.special,g=0;void 0!==(c=a[g]);g++){if(n.acceptData(c)&&(e=c[L.expando],e&&(b=L.cache[e]))){if(b.events)for(d in b.events)f[d]?n.event.remove(c,d):n.removeEvent(c,d,b.handle);L.cache[e]&&delete L.cache[e]}delete M.cache[c[M.expando]]}}}),n.fn.extend({text:function(a){return J(this,function(a){return void 0===a?n.text(this):this.empty().each(function(){(1===this.nodeType||11===this.nodeType||9===this.nodeType)&&(this.textContent=a)})},null,a,arguments.length)},append:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.appendChild(a)}})},prepend:function(){return this.domManip(arguments,function(a){if(1===this.nodeType||11===this.nodeType||9===this.nodeType){var b=jb(this,a);b.insertBefore(a,b.firstChild)}})},before:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this)})},after:function(){return this.domManip(arguments,function(a){this.parentNode&&this.parentNode.insertBefore(a,this.nextSibling)})},remove:function(a,b){for(var c,d=a?n.filter(a,this):this,e=0;null!=(c=d[e]);e++)b||1!==c.nodeType||n.cleanData(ob(c)),c.parentNode&&(b&&n.contains(c.ownerDocument,c)&&mb(ob(c,"script")),c.parentNode.removeChild(c));return this},empty:function(){for(var a,b=0;null!=(a=this[b]);b++)1===a.nodeType&&(n.cleanData(ob(a,!1)),a.textContent="");return this},clone:function(a,b){return a=null==a?!1:a,b=null==b?a:b,this.map(function(){return n.clone(this,a,b)})},html:function(a){return J(this,function(a){var b=this[0]||{},c=0,d=this.length;if(void 0===a&&1===b.nodeType)return b.innerHTML;if("string"==typeof a&&!db.test(a)&&!ib[(bb.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(ab,"<$1></$2>");try{for(;d>c;c++)b=this[c]||{},1===b.nodeType&&(n.cleanData(ob(b,!1)),b.innerHTML=a);b=0}catch(e){}}b&&this.empty().append(a)},null,a,arguments.length)},replaceWith:function(){var a=arguments[0];return this.domManip(arguments,function(b){a=this.parentNode,n.cleanData(ob(this)),a&&a.replaceChild(b,this)}),a&&(a.length||a.nodeType)?this:this.remove()},detach:function(a){return this.remove(a,!0)},domManip:function(a,b){a=e.apply([],a);var c,d,f,g,h,i,j=0,l=this.length,m=this,o=l-1,p=a[0],q=n.isFunction(p);if(q||l>1&&"string"==typeof p&&!k.checkClone&&eb.test(p))return this.each(function(c){var d=m.eq(c);q&&(a[0]=p.call(this,c,d.html())),d.domManip(a,b)});if(l&&(c=n.buildFragment(a,this[0].ownerDocument,!1,this),d=c.firstChild,1===c.childNodes.length&&(c=d),d)){for(f=n.map(ob(c,"script"),kb),g=f.length;l>j;j++)h=c,j!==o&&(h=n.clone(h,!0,!0),g&&n.merge(f,ob(h,"script"))),b.call(this[j],h,j);if(g)for(i=f[f.length-1].ownerDocument,n.map(f,lb),j=0;g>j;j++)h=f[j],fb.test(h.type||"")&&!L.access(h,"globalEval")&&n.contains(i,h)&&(h.src?n._evalUrl&&n._evalUrl(h.src):n.globalEval(h.textContent.replace(hb,"")))}return this}}),n.each({appendTo:"append",prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){n.fn[a]=function(a){for(var c,d=[],e=n(a),g=e.length-1,h=0;g>=h;h++)c=h===g?this:this.clone(!0),n(e[h])[b](c),f.apply(d,c.get());return this.pushStack(d)}});var qb,rb={};function sb(b,c){var d,e=n(c.createElement(b)).appendTo(c.body),f=a.getDefaultComputedStyle&&(d=a.getDefaultComputedStyle(e[0]))?d.display:n.css(e[0],"display");return e.detach(),f}function tb(a){var b=l,c=rb[a];return c||(c=sb(a,b),"none"!==c&&c||(qb=(qb||n("<iframe frameborder='0' width='0' height='0'/>")).appendTo(b.documentElement),b=qb[0].contentDocument,b.write(),b.close(),c=sb(a,b),qb.detach()),rb[a]=c),c}var ub=/^margin/,vb=new RegExp("^("+Q+")(?!px)[a-z%]+$","i"),wb=function(a){return a.ownerDocument.defaultView.getComputedStyle(a,null)};function xb(a,b,c){var d,e,f,g,h=a.style;return c=c||wb(a),c&&(g=c.getPropertyValue(b)||c[b]),c&&(""!==g||n.contains(a.ownerDocument,a)||(g=n.style(a,b)),vb.test(g)&&ub.test(b)&&(d=h.width,e=h.minWidth,f=h.maxWidth,h.minWidth=h.maxWidth=h.width=g,g=c.width,h.width=d,h.minWidth=e,h.maxWidth=f)),void 0!==g?g+"":g}function yb(a,b){return{get:function(){return a()?void delete this.get:(this.get=b).apply(this,arguments)}}}!function(){var b,c,d=l.documentElement,e=l.createElement("div"),f=l.createElement("div");if(f.style){f.style.backgroundClip="content-box",f.cloneNode(!0).style.backgroundClip="",k.clearCloneStyle="content-box"===f.style.backgroundClip,e.style.cssText="border:0;width:0;height:0;top:0;left:-9999px;margin-top:1px;position:absolute",e.appendChild(f);function g(){f.style.cssText="-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;display:block;margin-top:1%;top:1%;border:1px;padding:1px;width:4px;position:absolute",f.innerHTML="",d.appendChild(e);var g=a.getComputedStyle(f,null);b="1%"!==g.top,c="4px"===g.width,d.removeChild(e)}a.getComputedStyle&&n.extend(k,{pixelPosition:function(){return g(),b},boxSizingReliable:function(){return null==c&&g(),c},reliableMarginRight:function(){var b,c=f.appendChild(l.createElement("div"));return c.style.cssText=f.style.cssText="-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;display:block;margin:0;border:0;padding:0",c.style.marginRight=c.style.width="0",f.style.width="1px",d.appendChild(e),b=!parseFloat(a.getComputedStyle(c,null).marginRight),d.removeChild(e),b}})}}(),n.swap=function(a,b,c,d){var e,f,g={};for(f in b)g[f]=a.style[f],a.style[f]=b[f];e=c.apply(a,d||[]);for(f in b)a.style[f]=g[f];return e};var zb=/^(none|table(?!-c[ea]).+)/,Ab=new RegExp("^("+Q+")(.*)$","i"),Bb=new RegExp("^([+-])=("+Q+")","i"),Cb={position:"absolute",visibility:"hidden",display:"block"},Db={letterSpacing:"0",fontWeight:"400"},Eb=["Webkit","O","Moz","ms"];function Fb(a,b){if(b in a)return b;var c=b[0].toUpperCase()+b.slice(1),d=b,e=Eb.length;while(e--)if(b=Eb[e]+c,b in a)return b;return d}function Gb(a,b,c){var d=Ab.exec(b);return d?Math.max(0,d[1]-(c||0))+(d[2]||"px"):b}function Hb(a,b,c,d,e){for(var f=c===(d?"border":"content")?4:"width"===b?1:0,g=0;4>f;f+=2)"margin"===c&&(g+=n.css(a,c+R[f],!0,e)),d?("content"===c&&(g-=n.css(a,"padding"+R[f],!0,e)),"margin"!==c&&(g-=n.css(a,"border"+R[f]+"Width",!0,e))):(g+=n.css(a,"padding"+R[f],!0,e),"padding"!==c&&(g+=n.css(a,"border"+R[f]+"Width",!0,e)));return g}function Ib(a,b,c){var d=!0,e="width"===b?a.offsetWidth:a.offsetHeight,f=wb(a),g="border-box"===n.css(a,"boxSizing",!1,f);if(0>=e||null==e){if(e=xb(a,b,f),(0>e||null==e)&&(e=a.style[b]),vb.test(e))return e;d=g&&(k.boxSizingReliable()||e===a.style[b]),e=parseFloat(e)||0}return e+Hb(a,b,c||(g?"border":"content"),d,f)+"px"}function Jb(a,b){for(var c,d,e,f=[],g=0,h=a.length;h>g;g++)d=a[g],d.style&&(f[g]=L.get(d,"olddisplay"),c=d.style.display,b?(f[g]||"none"!==c||(d.style.display=""),""===d.style.display&&S(d)&&(f[g]=L.access(d,"olddisplay",tb(d.nodeName)))):(e=S(d),"none"===c&&e||L.set(d,"olddisplay",e?c:n.css(d,"display"))));for(g=0;h>g;g++)d=a[g],d.style&&(b&&"none"!==d.style.display&&""!==d.style.display||(d.style.display=b?f[g]||"":"none"));return a}n.extend({cssHooks:{opacity:{get:function(a,b){if(b){var c=xb(a,"opacity");return""===c?"1":c}}}},cssNumber:{columnCount:!0,fillOpacity:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,widows:!0,zIndex:!0,zoom:!0},cssProps:{"float":"cssFloat"},style:function(a,b,c,d){if(a&&3!==a.nodeType&&8!==a.nodeType&&a.style){var e,f,g,h=n.camelCase(b),i=a.style;return b=n.cssProps[h]||(n.cssProps[h]=Fb(i,h)),g=n.cssHooks[b]||n.cssHooks[h],void 0===c?g&&"get"in g&&void 0!==(e=g.get(a,!1,d))?e:i[b]:(f=typeof c,"string"===f&&(e=Bb.exec(c))&&(c=(e[1]+1)*e[2]+parseFloat(n.css(a,b)),f="number"),null!=c&&c===c&&("number"!==f||n.cssNumber[h]||(c+="px"),k.clearCloneStyle||""!==c||0!==b.indexOf("background")||(i[b]="inherit"),g&&"set"in g&&void 0===(c=g.set(a,c,d))||(i[b]=c)),void 0)}},css:function(a,b,c,d){var e,f,g,h=n.camelCase(b);return b=n.cssProps[h]||(n.cssProps[h]=Fb(a.style,h)),g=n.cssHooks[b]||n.cssHooks[h],g&&"get"in g&&(e=g.get(a,!0,c)),void 0===e&&(e=xb(a,b,d)),"normal"===e&&b in Db&&(e=Db[b]),""===c||c?(f=parseFloat(e),c===!0||n.isNumeric(f)?f||0:e):e}}),n.each(["height","width"],function(a,b){n.cssHooks[b]={get:function(a,c,d){return c?zb.test(n.css(a,"display"))&&0===a.offsetWidth?n.swap(a,Cb,function(){return Ib(a,b,d)}):Ib(a,b,d):void 0},set:function(a,c,d){var e=d&&wb(a);return Gb(a,c,d?Hb(a,b,d,"border-box"===n.css(a,"boxSizing",!1,e),e):0)}}}),n.cssHooks.marginRight=yb(k.reliableMarginRight,function(a,b){return b?n.swap(a,{display:"inline-block"},xb,[a,"marginRight"]):void 0}),n.each({margin:"",padding:"",border:"Width"},function(a,b){n.cssHooks[a+b]={expand:function(c){for(var d=0,e={},f="string"==typeof c?c.split(" "):[c];4>d;d++)e[a+R[d]+b]=f[d]||f[d-2]||f[0];return e}},ub.test(a)||(n.cssHooks[a+b].set=Gb)}),n.fn.extend({css:function(a,b){return J(this,function(a,b,c){var d,e,f={},g=0;if(n.isArray(b)){for(d=wb(a),e=b.length;e>g;g++)f[b[g]]=n.css(a,b[g],!1,d);return f}return void 0!==c?n.style(a,b,c):n.css(a,b)},a,b,arguments.length>1)},show:function(){return Jb(this,!0)},hide:function(){return Jb(this)},toggle:function(a){return"boolean"==typeof a?a?this.show():this.hide():this.each(function(){S(this)?n(this).show():n(this).hide()})}});function Kb(a,b,c,d,e){return new Kb.prototype.init(a,b,c,d,e)}n.Tween=Kb,Kb.prototype={constructor:Kb,init:function(a,b,c,d,e,f){this.elem=a,this.prop=c,this.easing=e||"swing",this.options=b,this.start=this.now=this.cur(),this.end=d,this.unit=f||(n.cssNumber[c]?"":"px")},cur:function(){var a=Kb.propHooks[this.prop];return a&&a.get?a.get(this):Kb.propHooks._default.get(this)},run:function(a){var b,c=Kb.propHooks[this.prop];return this.pos=b=this.options.duration?n.easing[this.easing](a,this.options.duration*a,0,1,this.options.duration):a,this.now=(this.end-this.start)*b+this.start,this.options.step&&this.options.step.call(this.elem,this.now,this),c&&c.set?c.set(this):Kb.propHooks._default.set(this),this}},Kb.prototype.init.prototype=Kb.prototype,Kb.propHooks={_default:{get:function(a){var b;return null==a.elem[a.prop]||a.elem.style&&null!=a.elem.style[a.prop]?(b=n.css(a.elem,a.prop,""),b&&"auto"!==b?b:0):a.elem[a.prop]},set:function(a){n.fx.step[a.prop]?n.fx.step[a.prop](a):a.elem.style&&(null!=a.elem.style[n.cssProps[a.prop]]||n.cssHooks[a.prop])?n.style(a.elem,a.prop,a.now+a.unit):a.elem[a.prop]=a.now}}},Kb.propHooks.scrollTop=Kb.propHooks.scrollLeft={set:function(a){a.elem.nodeType&&a.elem.parentNode&&(a.elem[a.prop]=a.now)}},n.easing={linear:function(a){return a},swing:function(a){return.5-Math.cos(a*Math.PI)/2}},n.fx=Kb.prototype.init,n.fx.step={};var Lb,Mb,Nb=/^(?:toggle|show|hide)$/,Ob=new RegExp("^(?:([+-])=|)("+Q+")([a-z%]*)$","i"),Pb=/queueHooks$/,Qb=[Vb],Rb={"*":[function(a,b){var c=this.createTween(a,b),d=c.cur(),e=Ob.exec(b),f=e&&e[3]||(n.cssNumber[a]?"":"px"),g=(n.cssNumber[a]||"px"!==f&&+d)&&Ob.exec(n.css(c.elem,a)),h=1,i=20;if(g&&g[3]!==f){f=f||g[3],e=e||[],g=+d||1;do h=h||".5",g/=h,n.style(c.elem,a,g+f);while(h!==(h=c.cur()/d)&&1!==h&&--i)}return e&&(g=c.start=+g||+d||0,c.unit=f,c.end=e[1]?g+(e[1]+1)*e[2]:+e[2]),c}]};function Sb(){return setTimeout(function(){Lb=void 0}),Lb=n.now()}function Tb(a,b){var c,d=0,e={height:a};for(b=b?1:0;4>d;d+=2-b)c=R[d],e["margin"+c]=e["padding"+c]=a;return b&&(e.opacity=e.width=a),e}function Ub(a,b,c){for(var d,e=(Rb[b]||[]).concat(Rb["*"]),f=0,g=e.length;g>f;f++)if(d=e[f].call(c,b,a))return d}function Vb(a,b,c){var d,e,f,g,h,i,j,k,l=this,m={},o=a.style,p=a.nodeType&&S(a),q=L.get(a,"fxshow");c.queue||(h=n._queueHooks(a,"fx"),null==h.unqueued&&(h.unqueued=0,i=h.empty.fire,h.empty.fire=function(){h.unqueued||i()}),h.unqueued++,l.always(function(){l.always(function(){h.unqueued--,n.queue(a,"fx").length||h.empty.fire()})})),1===a.nodeType&&("height"in b||"width"in b)&&(c.overflow=[o.overflow,o.overflowX,o.overflowY],j=n.css(a,"display"),k="none"===j?L.get(a,"olddisplay")||tb(a.nodeName):j,"inline"===k&&"none"===n.css(a,"float")&&(o.display="inline-block")),c.overflow&&(o.overflow="hidden",l.always(function(){o.overflow=c.overflow[0],o.overflowX=c.overflow[1],o.overflowY=c.overflow[2]}));for(d in b)if(e=b[d],Nb.exec(e)){if(delete b[d],f=f||"toggle"===e,e===(p?"hide":"show")){if("show"!==e||!q||void 0===q[d])continue;p=!0}m[d]=q&&q[d]||n.style(a,d)}else j=void 0;if(n.isEmptyObject(m))"inline"===("none"===j?tb(a.nodeName):j)&&(o.display=j);else{q?"hidden"in q&&(p=q.hidden):q=L.access(a,"fxshow",{}),f&&(q.hidden=!p),p?n(a).show():l.done(function(){n(a).hide()}),l.done(function(){var b;L.remove(a,"fxshow");for(b in m)n.style(a,b,m[b])});for(d in m)g=Ub(p?q[d]:0,d,l),d in q||(q[d]=g.start,p&&(g.end=g.start,g.start="width"===d||"height"===d?1:0))}}function Wb(a,b){var c,d,e,f,g;for(c in a)if(d=n.camelCase(c),e=b[d],f=a[c],n.isArray(f)&&(e=f[1],f=a[c]=f[0]),c!==d&&(a[d]=f,delete a[c]),g=n.cssHooks[d],g&&"expand"in g){f=g.expand(f),delete a[d];for(c in f)c in a||(a[c]=f[c],b[c]=e)}else b[d]=e}function Xb(a,b,c){var d,e,f=0,g=Qb.length,h=n.Deferred().always(function(){delete i.elem}),i=function(){if(e)return!1;for(var b=Lb||Sb(),c=Math.max(0,j.startTime+j.duration-b),d=c/j.duration||0,f=1-d,g=0,i=j.tweens.length;i>g;g++)j.tweens[g].run(f);return h.notifyWith(a,[j,f,c]),1>f&&i?c:(h.resolveWith(a,[j]),!1)},j=h.promise({elem:a,props:n.extend({},b),opts:n.extend(!0,{specialEasing:{}},c),originalProperties:b,originalOptions:c,startTime:Lb||Sb(),duration:c.duration,tweens:[],createTween:function(b,c){var d=n.Tween(a,j.opts,b,c,j.opts.specialEasing[b]||j.opts.easing);return j.tweens.push(d),d},stop:function(b){var c=0,d=b?j.tweens.length:0;if(e)return this;for(e=!0;d>c;c++)j.tweens[c].run(1);return b?h.resolveWith(a,[j,b]):h.rejectWith(a,[j,b]),this}}),k=j.props;for(Wb(k,j.opts.specialEasing);g>f;f++)if(d=Qb[f].call(j,a,k,j.opts))return d;return n.map(k,Ub,j),n.isFunction(j.opts.start)&&j.opts.start.call(a,j),n.fx.timer(n.extend(i,{elem:a,anim:j,queue:j.opts.queue})),j.progress(j.opts.progress).done(j.opts.done,j.opts.complete).fail(j.opts.fail).always(j.opts.always)}n.Animation=n.extend(Xb,{tweener:function(a,b){n.isFunction(a)?(b=a,a=["*"]):a=a.split(" ");for(var c,d=0,e=a.length;e>d;d++)c=a[d],Rb[c]=Rb[c]||[],Rb[c].unshift(b)},prefilter:function(a,b){b?Qb.unshift(a):Qb.push(a)}}),n.speed=function(a,b,c){var d=a&&"object"==typeof a?n.extend({},a):{complete:c||!c&&b||n.isFunction(a)&&a,duration:a,easing:c&&b||b&&!n.isFunction(b)&&b};return d.duration=n.fx.off?0:"number"==typeof d.duration?d.duration:d.duration in n.fx.speeds?n.fx.speeds[d.duration]:n.fx.speeds._default,(null==d.queue||d.queue===!0)&&(d.queue="fx"),d.old=d.complete,d.complete=function(){n.isFunction(d.old)&&d.old.call(this),d.queue&&n.dequeue(this,d.queue)},d},n.fn.extend({fadeTo:function(a,b,c,d){return this.filter(S).css("opacity",0).show().end().animate({opacity:b},a,c,d)},animate:function(a,b,c,d){var e=n.isEmptyObject(a),f=n.speed(b,c,d),g=function(){var b=Xb(this,n.extend({},a),f);(e||L.get(this,"finish"))&&b.stop(!0)};return g.finish=g,e||f.queue===!1?this.each(g):this.queue(f.queue,g)},stop:function(a,b,c){var d=function(a){var b=a.stop;delete a.stop,b(c)};return"string"!=typeof a&&(c=b,b=a,a=void 0),b&&a!==!1&&this.queue(a||"fx",[]),this.each(function(){var b=!0,e=null!=a&&a+"queueHooks",f=n.timers,g=L.get(this);if(e)g[e]&&g[e].stop&&d(g[e]);else for(e in g)g[e]&&g[e].stop&&Pb.test(e)&&d(g[e]);for(e=f.length;e--;)f[e].elem!==this||null!=a&&f[e].queue!==a||(f[e].anim.stop(c),b=!1,f.splice(e,1));(b||!c)&&n.dequeue(this,a)})},finish:function(a){return a!==!1&&(a=a||"fx"),this.each(function(){var b,c=L.get(this),d=c[a+"queue"],e=c[a+"queueHooks"],f=n.timers,g=d?d.length:0;for(c.finish=!0,n.queue(this,a,[]),e&&e.stop&&e.stop.call(this,!0),b=f.length;b--;)f[b].elem===this&&f[b].queue===a&&(f[b].anim.stop(!0),f.splice(b,1));for(b=0;g>b;b++)d[b]&&d[b].finish&&d[b].finish.call(this);delete c.finish})}}),n.each(["toggle","show","hide"],function(a,b){var c=n.fn[b];n.fn[b]=function(a,d,e){return null==a||"boolean"==typeof a?c.apply(this,arguments):this.animate(Tb(b,!0),a,d,e)}}),n.each({slideDown:Tb("show"),slideUp:Tb("hide"),slideToggle:Tb("toggle"),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){n.fn[a]=function(a,c,d){return this.animate(b,a,c,d)}}),n.timers=[],n.fx.tick=function(){var a,b=0,c=n.timers;for(Lb=n.now();b<c.length;b++)a=c[b],a()||c[b]!==a||c.splice(b--,1);c.length||n.fx.stop(),Lb=void 0},n.fx.timer=function(a){n.timers.push(a),a()?n.fx.start():n.timers.pop()},n.fx.interval=13,n.fx.start=function(){Mb||(Mb=setInterval(n.fx.tick,n.fx.interval))},n.fx.stop=function(){clearInterval(Mb),Mb=null},n.fx.speeds={slow:600,fast:200,_default:400},n.fn.delay=function(a,b){return a=n.fx?n.fx.speeds[a]||a:a,b=b||"fx",this.queue(b,function(b,c){var d=setTimeout(b,a);c.stop=function(){clearTimeout(d)}})},function(){var a=l.createElement("input"),b=l.createElement("select"),c=b.appendChild(l.createElement("option"));a.type="checkbox",k.checkOn=""!==a.value,k.optSelected=c.selected,b.disabled=!0,k.optDisabled=!c.disabled,a=l.createElement("input"),a.value="t",a.type="radio",k.radioValue="t"===a.value}();var Yb,Zb,$b=n.expr.attrHandle;n.fn.extend({attr:function(a,b){return J(this,n.attr,a,b,arguments.length>1)},removeAttr:function(a){return this.each(function(){n.removeAttr(this,a)})}}),n.extend({attr:function(a,b,c){var d,e,f=a.nodeType;if(a&&3!==f&&8!==f&&2!==f)return typeof a.getAttribute===U?n.prop(a,b,c):(1===f&&n.isXMLDoc(a)||(b=b.toLowerCase(),d=n.attrHooks[b]||(n.expr.match.bool.test(b)?Zb:Yb)),void 0===c?d&&"get"in d&&null!==(e=d.get(a,b))?e:(e=n.find.attr(a,b),null==e?void 0:e):null!==c?d&&"set"in d&&void 0!==(e=d.set(a,c,b))?e:(a.setAttribute(b,c+""),c):void n.removeAttr(a,b))
422 },removeAttr:function(a,b){var c,d,e=0,f=b&&b.match(E);if(f&&1===a.nodeType)while(c=f[e++])d=n.propFix[c]||c,n.expr.match.bool.test(c)&&(a[d]=!1),a.removeAttribute(c)},attrHooks:{type:{set:function(a,b){if(!k.radioValue&&"radio"===b&&n.nodeName(a,"input")){var c=a.value;return a.setAttribute("type",b),c&&(a.value=c),b}}}}}),Zb={set:function(a,b,c){return b===!1?n.removeAttr(a,c):a.setAttribute(c,c),c}},n.each(n.expr.match.bool.source.match(/\w+/g),function(a,b){var c=$b[b]||n.find.attr;$b[b]=function(a,b,d){var e,f;return d||(f=$b[b],$b[b]=e,e=null!=c(a,b,d)?b.toLowerCase():null,$b[b]=f),e}});var _b=/^(?:input|select|textarea|button)$/i;n.fn.extend({prop:function(a,b){return J(this,n.prop,a,b,arguments.length>1)},removeProp:function(a){return this.each(function(){delete this[n.propFix[a]||a]})}}),n.extend({propFix:{"for":"htmlFor","class":"className"},prop:function(a,b,c){var d,e,f,g=a.nodeType;if(a&&3!==g&&8!==g&&2!==g)return f=1!==g||!n.isXMLDoc(a),f&&(b=n.propFix[b]||b,e=n.propHooks[b]),void 0!==c?e&&"set"in e&&void 0!==(d=e.set(a,c,b))?d:a[b]=c:e&&"get"in e&&null!==(d=e.get(a,b))?d:a[b]},propHooks:{tabIndex:{get:function(a){return a.hasAttribute("tabindex")||_b.test(a.nodeName)||a.href?a.tabIndex:-1}}}}),k.optSelected||(n.propHooks.selected={get:function(a){var b=a.parentNode;return b&&b.parentNode&&b.parentNode.selectedIndex,null}}),n.each(["tabIndex","readOnly","maxLength","cellSpacing","cellPadding","rowSpan","colSpan","useMap","frameBorder","contentEditable"],function(){n.propFix[this.toLowerCase()]=this});var ac=/[\t\r\n\f]/g;n.fn.extend({addClass:function(a){var b,c,d,e,f,g,h="string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).addClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):" ")){f=0;while(e=b[f++])d.indexOf(" "+e+" ")<0&&(d+=e+" ");g=n.trim(d),c.className!==g&&(c.className=g)}return this},removeClass:function(a){var b,c,d,e,f,g,h=0===arguments.length||"string"==typeof a&&a,i=0,j=this.length;if(n.isFunction(a))return this.each(function(b){n(this).removeClass(a.call(this,b,this.className))});if(h)for(b=(a||"").match(E)||[];j>i;i++)if(c=this[i],d=1===c.nodeType&&(c.className?(" "+c.className+" ").replace(ac," "):"")){f=0;while(e=b[f++])while(d.indexOf(" "+e+" ")>=0)d=d.replace(" "+e+" "," ");g=a?n.trim(d):"",c.className!==g&&(c.className=g)}return this},toggleClass:function(a,b){var c=typeof a;return"boolean"==typeof b&&"string"===c?b?this.addClass(a):this.removeClass(a):this.each(n.isFunction(a)?function(c){n(this).toggleClass(a.call(this,c,this.className,b),b)}:function(){if("string"===c){var b,d=0,e=n(this),f=a.match(E)||[];while(b=f[d++])e.hasClass(b)?e.removeClass(b):e.addClass(b)}else(c===U||"boolean"===c)&&(this.className&&L.set(this,"__className__",this.className),this.className=this.className||a===!1?"":L.get(this,"__className__")||"")})},hasClass:function(a){for(var b=" "+a+" ",c=0,d=this.length;d>c;c++)if(1===this[c].nodeType&&(" "+this[c].className+" ").replace(ac," ").indexOf(b)>=0)return!0;return!1}});var bc=/\r/g;n.fn.extend({val:function(a){var b,c,d,e=this[0];{if(arguments.length)return d=n.isFunction(a),this.each(function(c){var e;1===this.nodeType&&(e=d?a.call(this,c,n(this).val()):a,null==e?e="":"number"==typeof e?e+="":n.isArray(e)&&(e=n.map(e,function(a){return null==a?"":a+""})),b=n.valHooks[this.type]||n.valHooks[this.nodeName.toLowerCase()],b&&"set"in b&&void 0!==b.set(this,e,"value")||(this.value=e))});if(e)return b=n.valHooks[e.type]||n.valHooks[e.nodeName.toLowerCase()],b&&"get"in b&&void 0!==(c=b.get(e,"value"))?c:(c=e.value,"string"==typeof c?c.replace(bc,""):null==c?"":c)}}}),n.extend({valHooks:{option:{get:function(a){var b=n.find.attr(a,"value");return null!=b?b:n.trim(n.text(a))}},select:{get:function(a){for(var b,c,d=a.options,e=a.selectedIndex,f="select-one"===a.type||0>e,g=f?null:[],h=f?e+1:d.length,i=0>e?h:f?e:0;h>i;i++)if(c=d[i],!(!c.selected&&i!==e||(k.optDisabled?c.disabled:null!==c.getAttribute("disabled"))||c.parentNode.disabled&&n.nodeName(c.parentNode,"optgroup"))){if(b=n(c).val(),f)return b;g.push(b)}return g},set:function(a,b){var c,d,e=a.options,f=n.makeArray(b),g=e.length;while(g--)d=e[g],(d.selected=n.inArray(d.value,f)>=0)&&(c=!0);return c||(a.selectedIndex=-1),f}}}}),n.each(["radio","checkbox"],function(){n.valHooks[this]={set:function(a,b){return n.isArray(b)?a.checked=n.inArray(n(a).val(),b)>=0:void 0}},k.checkOn||(n.valHooks[this].get=function(a){return null===a.getAttribute("value")?"on":a.value})}),n.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "),function(a,b){n.fn[b]=function(a,c){return arguments.length>0?this.on(b,null,a,c):this.trigger(b)}}),n.fn.extend({hover:function(a,b){return this.mouseenter(a).mouseleave(b||a)},bind:function(a,b,c){return this.on(a,null,b,c)},unbind:function(a,b){return this.off(a,null,b)},delegate:function(a,b,c,d){return this.on(b,a,c,d)},undelegate:function(a,b,c){return 1===arguments.length?this.off(a,"**"):this.off(b,a||"**",c)}});var cc=n.now(),dc=/\?/;n.parseJSON=function(a){return JSON.parse(a+"")},n.parseXML=function(a){var b,c;if(!a||"string"!=typeof a)return null;try{c=new DOMParser,b=c.parseFromString(a,"text/xml")}catch(d){b=void 0}return(!b||b.getElementsByTagName("parsererror").length)&&n.error("Invalid XML: "+a),b};var ec,fc,gc=/#.*$/,hc=/([?&])_=[^&]*/,ic=/^(.*?):[ \t]*([^\r\n]*)$/gm,jc=/^(?:about|app|app-storage|.+-extension|file|res|widget):$/,kc=/^(?:GET|HEAD)$/,lc=/^\/\//,mc=/^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/,nc={},oc={},pc="*/".concat("*");try{fc=location.href}catch(qc){fc=l.createElement("a"),fc.href="",fc=fc.href}ec=mc.exec(fc.toLowerCase())||[];function rc(a){return function(b,c){"string"!=typeof b&&(c=b,b="*");var d,e=0,f=b.toLowerCase().match(E)||[];if(n.isFunction(c))while(d=f[e++])"+"===d[0]?(d=d.slice(1)||"*",(a[d]=a[d]||[]).unshift(c)):(a[d]=a[d]||[]).push(c)}}function sc(a,b,c,d){var e={},f=a===oc;function g(h){var i;return e[h]=!0,n.each(a[h]||[],function(a,h){var j=h(b,c,d);return"string"!=typeof j||f||e[j]?f?!(i=j):void 0:(b.dataTypes.unshift(j),g(j),!1)}),i}return g(b.dataTypes[0])||!e["*"]&&g("*")}function tc(a,b){var c,d,e=n.ajaxSettings.flatOptions||{};for(c in b)void 0!==b[c]&&((e[c]?a:d||(d={}))[c]=b[c]);return d&&n.extend(!0,a,d),a}function uc(a,b,c){var d,e,f,g,h=a.contents,i=a.dataTypes;while("*"===i[0])i.shift(),void 0===d&&(d=a.mimeType||b.getResponseHeader("Content-Type"));if(d)for(e in h)if(h[e]&&h[e].test(d)){i.unshift(e);break}if(i[0]in c)f=i[0];else{for(e in c){if(!i[0]||a.converters[e+" "+i[0]]){f=e;break}g||(g=e)}f=f||g}return f?(f!==i[0]&&i.unshift(f),c[f]):void 0}function vc(a,b,c,d){var e,f,g,h,i,j={},k=a.dataTypes.slice();if(k[1])for(g in a.converters)j[g.toLowerCase()]=a.converters[g];f=k.shift();while(f)if(a.responseFields[f]&&(c[a.responseFields[f]]=b),!i&&d&&a.dataFilter&&(b=a.dataFilter(b,a.dataType)),i=f,f=k.shift())if("*"===f)f=i;else if("*"!==i&&i!==f){if(g=j[i+" "+f]||j["* "+f],!g)for(e in j)if(h=e.split(" "),h[1]===f&&(g=j[i+" "+h[0]]||j["* "+h[0]])){g===!0?g=j[e]:j[e]!==!0&&(f=h[0],k.unshift(h[1]));break}if(g!==!0)if(g&&a["throws"])b=g(b);else try{b=g(b)}catch(l){return{state:"parsererror",error:g?l:"No conversion from "+i+" to "+f}}}return{state:"success",data:b}}n.extend({active:0,lastModified:{},etag:{},ajaxSettings:{url:fc,type:"GET",isLocal:jc.test(ec[1]),global:!0,processData:!0,async:!0,contentType:"application/x-www-form-urlencoded; charset=UTF-8",accepts:{"*":pc,text:"text/plain",html:"text/html",xml:"application/xml, text/xml",json:"application/json, text/javascript"},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText",json:"responseJSON"},converters:{"* text":String,"text html":!0,"text json":n.parseJSON,"text xml":n.parseXML},flatOptions:{url:!0,context:!0}},ajaxSetup:function(a,b){return b?tc(tc(a,n.ajaxSettings),b):tc(n.ajaxSettings,a)},ajaxPrefilter:rc(nc),ajaxTransport:rc(oc),ajax:function(a,b){"object"==typeof a&&(b=a,a=void 0),b=b||{};var c,d,e,f,g,h,i,j,k=n.ajaxSetup({},b),l=k.context||k,m=k.context&&(l.nodeType||l.jquery)?n(l):n.event,o=n.Deferred(),p=n.Callbacks("once memory"),q=k.statusCode||{},r={},s={},t=0,u="canceled",v={readyState:0,getResponseHeader:function(a){var b;if(2===t){if(!f){f={};while(b=ic.exec(e))f[b[1].toLowerCase()]=b[2]}b=f[a.toLowerCase()]}return null==b?null:b},getAllResponseHeaders:function(){return 2===t?e:null},setRequestHeader:function(a,b){var c=a.toLowerCase();return t||(a=s[c]=s[c]||a,r[a]=b),this},overrideMimeType:function(a){return t||(k.mimeType=a),this},statusCode:function(a){var b;if(a)if(2>t)for(b in a)q[b]=[q[b],a[b]];else v.always(a[v.status]);return this},abort:function(a){var b=a||u;return c&&c.abort(b),x(0,b),this}};if(o.promise(v).complete=p.add,v.success=v.done,v.error=v.fail,k.url=((a||k.url||fc)+"").replace(gc,"").replace(lc,ec[1]+"//"),k.type=b.method||b.type||k.method||k.type,k.dataTypes=n.trim(k.dataType||"*").toLowerCase().match(E)||[""],null==k.crossDomain&&(h=mc.exec(k.url.toLowerCase()),k.crossDomain=!(!h||h[1]===ec[1]&&h[2]===ec[2]&&(h[3]||("http:"===h[1]?"80":"443"))===(ec[3]||("http:"===ec[1]?"80":"443")))),k.data&&k.processData&&"string"!=typeof k.data&&(k.data=n.param(k.data,k.traditional)),sc(nc,k,b,v),2===t)return v;i=k.global,i&&0===n.active++&&n.event.trigger("ajaxStart"),k.type=k.type.toUpperCase(),k.hasContent=!kc.test(k.type),d=k.url,k.hasContent||(k.data&&(d=k.url+=(dc.test(d)?"&":"?")+k.data,delete k.data),k.cache===!1&&(k.url=hc.test(d)?d.replace(hc,"$1_="+cc++):d+(dc.test(d)?"&":"?")+"_="+cc++)),k.ifModified&&(n.lastModified[d]&&v.setRequestHeader("If-Modified-Since",n.lastModified[d]),n.etag[d]&&v.setRequestHeader("If-None-Match",n.etag[d])),(k.data&&k.hasContent&&k.contentType!==!1||b.contentType)&&v.setRequestHeader("Content-Type",k.contentType),v.setRequestHeader("Accept",k.dataTypes[0]&&k.accepts[k.dataTypes[0]]?k.accepts[k.dataTypes[0]]+("*"!==k.dataTypes[0]?", "+pc+"; q=0.01":""):k.accepts["*"]);for(j in k.headers)v.setRequestHeader(j,k.headers[j]);if(k.beforeSend&&(k.beforeSend.call(l,v,k)===!1||2===t))return v.abort();u="abort";for(j in{success:1,error:1,complete:1})v[j](k[j]);if(c=sc(oc,k,b,v)){v.readyState=1,i&&m.trigger("ajaxSend",[v,k]),k.async&&k.timeout>0&&(g=setTimeout(function(){v.abort("timeout")},k.timeout));try{t=1,c.send(r,x)}catch(w){if(!(2>t))throw w;x(-1,w)}}else x(-1,"No Transport");function x(a,b,f,h){var j,r,s,u,w,x=b;2!==t&&(t=2,g&&clearTimeout(g),c=void 0,e=h||"",v.readyState=a>0?4:0,j=a>=200&&300>a||304===a,f&&(u=uc(k,v,f)),u=vc(k,u,v,j),j?(k.ifModified&&(w=v.getResponseHeader("Last-Modified"),w&&(n.lastModified[d]=w),w=v.getResponseHeader("etag"),w&&(n.etag[d]=w)),204===a||"HEAD"===k.type?x="nocontent":304===a?x="notmodified":(x=u.state,r=u.data,s=u.error,j=!s)):(s=x,(a||!x)&&(x="error",0>a&&(a=0))),v.status=a,v.statusText=(b||x)+"",j?o.resolveWith(l,[r,x,v]):o.rejectWith(l,[v,x,s]),v.statusCode(q),q=void 0,i&&m.trigger(j?"ajaxSuccess":"ajaxError",[v,k,j?r:s]),p.fireWith(l,[v,x]),i&&(m.trigger("ajaxComplete",[v,k]),--n.active||n.event.trigger("ajaxStop")))}return v},getJSON:function(a,b,c){return n.get(a,b,c,"json")},getScript:function(a,b){return n.get(a,void 0,b,"script")}}),n.each(["get","post"],function(a,b){n[b]=function(a,c,d,e){return n.isFunction(c)&&(e=e||d,d=c,c=void 0),n.ajax({url:a,type:b,dataType:e,data:c,success:d})}}),n.each(["ajaxStart","ajaxStop","ajaxComplete","ajaxError","ajaxSuccess","ajaxSend"],function(a,b){n.fn[b]=function(a){return this.on(b,a)}}),n._evalUrl=function(a){return n.ajax({url:a,type:"GET",dataType:"script",async:!1,global:!1,"throws":!0})},n.fn.extend({wrapAll:function(a){var b;return n.isFunction(a)?this.each(function(b){n(this).wrapAll(a.call(this,b))}):(this[0]&&(b=n(a,this[0].ownerDocument).eq(0).clone(!0),this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstElementChild)a=a.firstElementChild;return a}).append(this)),this)},wrapInner:function(a){return this.each(n.isFunction(a)?function(b){n(this).wrapInner(a.call(this,b))}:function(){var b=n(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=n.isFunction(a);return this.each(function(c){n(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){n.nodeName(this,"body")||n(this).replaceWith(this.childNodes)}).end()}}),n.expr.filters.hidden=function(a){return a.offsetWidth<=0&&a.offsetHeight<=0},n.expr.filters.visible=function(a){return!n.expr.filters.hidden(a)};var wc=/%20/g,xc=/\[\]$/,yc=/\r?\n/g,zc=/^(?:submit|button|image|reset|file)$/i,Ac=/^(?:input|select|textarea|keygen)/i;function Bc(a,b,c,d){var e;if(n.isArray(b))n.each(b,function(b,e){c||xc.test(a)?d(a,e):Bc(a+"["+("object"==typeof e?b:"")+"]",e,c,d)});else if(c||"object"!==n.type(b))d(a,b);else for(e in b)Bc(a+"["+e+"]",b[e],c,d)}n.param=function(a,b){var c,d=[],e=function(a,b){b=n.isFunction(b)?b():null==b?"":b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};if(void 0===b&&(b=n.ajaxSettings&&n.ajaxSettings.traditional),n.isArray(a)||a.jquery&&!n.isPlainObject(a))n.each(a,function(){e(this.name,this.value)});else for(c in a)Bc(c,a[c],b,e);return d.join("&").replace(wc,"+")},n.fn.extend({serialize:function(){return n.param(this.serializeArray())},serializeArray:function(){return this.map(function(){var a=n.prop(this,"elements");return a?n.makeArray(a):this}).filter(function(){var a=this.type;return this.name&&!n(this).is(":disabled")&&Ac.test(this.nodeName)&&!zc.test(a)&&(this.checked||!T.test(a))}).map(function(a,b){var c=n(this).val();return null==c?null:n.isArray(c)?n.map(c,function(a){return{name:b.name,value:a.replace(yc,"\r\n")}}):{name:b.name,value:c.replace(yc,"\r\n")}}).get()}}),n.ajaxSettings.xhr=function(){try{return new XMLHttpRequest}catch(a){}};var Cc=0,Dc={},Ec={0:200,1223:204},Fc=n.ajaxSettings.xhr();a.ActiveXObject&&n(a).on("unload",function(){for(var a in Dc)Dc[a]()}),k.cors=!!Fc&&"withCredentials"in Fc,k.ajax=Fc=!!Fc,n.ajaxTransport(function(a){var b;return k.cors||Fc&&!a.crossDomain?{send:function(c,d){var e,f=a.xhr(),g=++Cc;if(f.open(a.type,a.url,a.async,a.username,a.password),a.xhrFields)for(e in a.xhrFields)f[e]=a.xhrFields[e];a.mimeType&&f.overrideMimeType&&f.overrideMimeType(a.mimeType),a.crossDomain||c["X-Requested-With"]||(c["X-Requested-With"]="XMLHttpRequest");for(e in c)f.setRequestHeader(e,c[e]);b=function(a){return function(){b&&(delete Dc[g],b=f.onload=f.onerror=null,"abort"===a?f.abort():"error"===a?d(f.status,f.statusText):d(Ec[f.status]||f.status,f.statusText,"string"==typeof f.responseText?{text:f.responseText}:void 0,f.getAllResponseHeaders()))}},f.onload=b(),f.onerror=b("error"),b=Dc[g]=b("abort");try{f.send(a.hasContent&&a.data||null)}catch(h){if(b)throw h}},abort:function(){b&&b()}}:void 0}),n.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/(?:java|ecma)script/},converters:{"text script":function(a){return n.globalEval(a),a}}}),n.ajaxPrefilter("script",function(a){void 0===a.cache&&(a.cache=!1),a.crossDomain&&(a.type="GET")}),n.ajaxTransport("script",function(a){if(a.crossDomain){var b,c;return{send:function(d,e){b=n("<script>").prop({async:!0,charset:a.scriptCharset,src:a.url}).on("load error",c=function(a){b.remove(),c=null,a&&e("error"===a.type?404:200,a.type)}),l.head.appendChild(b[0])},abort:function(){c&&c()}}}});var Gc=[],Hc=/(=)\?(?=&|$)|\?\?/;n.ajaxSetup({jsonp:"callback",jsonpCallback:function(){var a=Gc.pop()||n.expando+"_"+cc++;return this[a]=!0,a}}),n.ajaxPrefilter("json jsonp",function(b,c,d){var e,f,g,h=b.jsonp!==!1&&(Hc.test(b.url)?"url":"string"==typeof b.data&&!(b.contentType||"").indexOf("application/x-www-form-urlencoded")&&Hc.test(b.data)&&"data");return h||"jsonp"===b.dataTypes[0]?(e=b.jsonpCallback=n.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,h?b[h]=b[h].replace(Hc,"$1"+e):b.jsonp!==!1&&(b.url+=(dc.test(b.url)?"&":"?")+b.jsonp+"="+e),b.converters["script json"]=function(){return g||n.error(e+" was not called"),g[0]},b.dataTypes[0]="json",f=a[e],a[e]=function(){g=arguments},d.always(function(){a[e]=f,b[e]&&(b.jsonpCallback=c.jsonpCallback,Gc.push(e)),g&&n.isFunction(f)&&f(g[0]),g=f=void 0}),"script"):void 0}),n.parseHTML=function(a,b,c){if(!a||"string"!=typeof a)return null;"boolean"==typeof b&&(c=b,b=!1),b=b||l;var d=v.exec(a),e=!c&&[];return d?[b.createElement(d[1])]:(d=n.buildFragment([a],b,e),e&&e.length&&n(e).remove(),n.merge([],d.childNodes))};var Ic=n.fn.load;n.fn.load=function(a,b,c){if("string"!=typeof a&&Ic)return Ic.apply(this,arguments);var d,e,f,g=this,h=a.indexOf(" ");return h>=0&&(d=n.trim(a.slice(h)),a=a.slice(0,h)),n.isFunction(b)?(c=b,b=void 0):b&&"object"==typeof b&&(e="POST"),g.length>0&&n.ajax({url:a,type:e,dataType:"html",data:b}).done(function(a){f=arguments,g.html(d?n("<div>").append(n.parseHTML(a)).find(d):a)}).complete(c&&function(a,b){g.each(c,f||[a.responseText,b,a])}),this},n.expr.filters.animated=function(a){return n.grep(n.timers,function(b){return a===b.elem}).length};var Jc=a.document.documentElement;function Kc(a){return n.isWindow(a)?a:9===a.nodeType&&a.defaultView}n.offset={setOffset:function(a,b,c){var d,e,f,g,h,i,j,k=n.css(a,"position"),l=n(a),m={};"static"===k&&(a.style.position="relative"),h=l.offset(),f=n.css(a,"top"),i=n.css(a,"left"),j=("absolute"===k||"fixed"===k)&&(f+i).indexOf("auto")>-1,j?(d=l.position(),g=d.top,e=d.left):(g=parseFloat(f)||0,e=parseFloat(i)||0),n.isFunction(b)&&(b=b.call(a,c,h)),null!=b.top&&(m.top=b.top-h.top+g),null!=b.left&&(m.left=b.left-h.left+e),"using"in b?b.using.call(a,m):l.css(m)}},n.fn.extend({offset:function(a){if(arguments.length)return void 0===a?this:this.each(function(b){n.offset.setOffset(this,a,b)});var b,c,d=this[0],e={top:0,left:0},f=d&&d.ownerDocument;if(f)return b=f.documentElement,n.contains(b,d)?(typeof d.getBoundingClientRect!==U&&(e=d.getBoundingClientRect()),c=Kc(f),{top:e.top+c.pageYOffset-b.clientTop,left:e.left+c.pageXOffset-b.clientLeft}):e},position:function(){if(this[0]){var a,b,c=this[0],d={top:0,left:0};return"fixed"===n.css(c,"position")?b=c.getBoundingClientRect():(a=this.offsetParent(),b=this.offset(),n.nodeName(a[0],"html")||(d=a.offset()),d.top+=n.css(a[0],"borderTopWidth",!0),d.left+=n.css(a[0],"borderLeftWidth",!0)),{top:b.top-d.top-n.css(c,"marginTop",!0),left:b.left-d.left-n.css(c,"marginLeft",!0)}}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||Jc;while(a&&!n.nodeName(a,"html")&&"static"===n.css(a,"position"))a=a.offsetParent;return a||Jc})}}),n.each({scrollLeft:"pageXOffset",scrollTop:"pageYOffset"},function(b,c){var d="pageYOffset"===c;n.fn[b]=function(e){return J(this,function(b,e,f){var g=Kc(b);return void 0===f?g?g[c]:b[e]:void(g?g.scrollTo(d?a.pageXOffset:f,d?f:a.pageYOffset):b[e]=f)},b,e,arguments.length,null)}}),n.each(["top","left"],function(a,b){n.cssHooks[b]=yb(k.pixelPosition,function(a,c){return c?(c=xb(a,b),vb.test(c)?n(a).position()[b]+"px":c):void 0})}),n.each({Height:"height",Width:"width"},function(a,b){n.each({padding:"inner"+a,content:b,"":"outer"+a},function(c,d){n.fn[d]=function(d,e){var f=arguments.length&&(c||"boolean"!=typeof d),g=c||(d===!0||e===!0?"margin":"border");return J(this,function(b,c,d){var e;return n.isWindow(b)?b.document.documentElement["client"+a]:9===b.nodeType?(e=b.documentElement,Math.max(b.body["scroll"+a],e["scroll"+a],b.body["offset"+a],e["offset"+a],e["client"+a])):void 0===d?n.css(b,c,g):n.style(b,c,d,g)},b,f?d:void 0,f,null)}})}),n.fn.size=function(){return this.length},n.fn.andSelf=n.fn.addBack,"function"==typeof define&&define.amd&&define("jquery",[],function(){return n});var Lc=a.jQuery,Mc=a.$;return n.noConflict=function(b){return a.$===n&&(a.$=Mc),b&&a.jQuery===n&&(a.jQuery=Lc),n},typeof b===U&&(a.jQuery=a.$=n),n});
423 </script>
424
425 <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>-->
426 <script>
427 /*!
428 * Bootstrap v3.2.0 (http://getbootstrap.com)
429 * Copyright 2011-2014 Twitter, Inc.
430 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
431 */
432 if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.2.0",d.prototype.close=function(b){function c(){f.detach().trigger("closed.bs.alert").remove()}var d=a(this),e=d.attr("data-target");e||(e=d.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,""));var f=a(e);b&&b.preventDefault(),f.length||(f=d.hasClass("alert")?d:d.parent()),f.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(f.removeClass("in"),a.support.transition&&f.hasClass("fade")?f.one("bsTransitionEnd",c).emulateTransitionEnd(150):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.2.0",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),d[e](null==f[b]?this.options[b]:f[b]),setTimeout(a.proxy(function(){"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")&&(c.prop("checked")&&this.$element.hasClass("active")?a=!1:b.find(".active").removeClass("active")),a&&c.prop("checked",!this.$element.hasClass("active")).trigger("change")}a&&this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),c.preventDefault()})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b).on("keydown.bs.carousel",a.proxy(this.keydown,this)),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=this.sliding=this.interval=this.$active=this.$items=null,"hover"==this.options.pause&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.2.0",c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0},c.prototype.keydown=function(a){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.to=function(b){var c=this,d=this.getItemIndex(this.$active=this.$element.find(".item.active"));return b>this.$items.length-1||0>b?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){c.to(b)}):d==b?this.pause().cycle():this.slide(b>d?"next":"prev",a(this.$items[b]))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,c){var d=this.$element.find(".item.active"),e=c||d[b](),f=this.interval,g="next"==b?"left":"right",h="next"==b?"first":"last",i=this;if(!e.length){if(!this.options.wrap)return;e=this.$element.find(".item")[h]()}if(e.hasClass("active"))return this.sliding=!1;var j=e[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:g});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,f&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(e)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:g});return a.support.transition&&this.$element.hasClass("slide")?(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),d.one("bsTransitionEnd",function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(1e3*d.css("transition-duration").slice(0,-1))):(d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger(m)),f&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this},a(document).on("click.bs.carousel.data-api","[data-slide], [data-slide-to]",function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}}),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.collapse"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b);!e&&f.toggle&&"show"==b&&(b=!b),e||d.data("bs.collapse",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.transitioning=null,this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};c.VERSION="3.2.0",c.DEFAULTS={toggle:!0},c.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},c.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var c=a.Event("show.bs.collapse");if(this.$element.trigger(c),!c.isDefaultPrevented()){var d=this.$parent&&this.$parent.find("> .panel > .in");if(d&&d.length){var e=d.data("bs.collapse");if(e&&e.transitioning)return;b.call(d,"hide"),e||d.data("bs.collapse",null)}var f=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[f](0),this.transitioning=1;var g=function(){this.$element.removeClass("collapsing").addClass("collapse in")[f](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return g.call(this);var h=a.camelCase(["scroll",f].join("-"));this.$element.one("bsTransitionEnd",a.proxy(g,this)).emulateTransitionEnd(350)[f](this.$element[0][h])}}},c.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse").removeClass("in"),this.transitioning=1;var d=function(){this.transitioning=0,this.$element.trigger("hidden.bs.collapse").removeClass("collapsing").addClass("collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(d,this)).emulateTransitionEnd(350):d.call(this)}}},c.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()};var d=a.fn.collapse;a.fn.collapse=b,a.fn.collapse.Constructor=c,a.fn.collapse.noConflict=function(){return a.fn.collapse=d,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(c){var d,e=a(this),f=e.attr("data-target")||c.preventDefault()||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),g=a(f),h=g.data("bs.collapse"),i=h?"toggle":e.data(),j=e.attr("data-parent"),k=j&&a(j);h&&h.transitioning||(k&&k.find('[data-toggle="collapse"][data-parent="'+j+'"]').not(e).addClass("collapsed"),e[g.hasClass("in")?"addClass":"removeClass"]("collapsed")),b.call(g,i)})}(jQuery),+function(a){"use strict";function b(b){b&&3===b.which||(a(e).remove(),a(f).each(function(){var d=c(a(this)),e={relatedTarget:this};d.hasClass("open")&&(d.trigger(b=a.Event("hide.bs.dropdown",e)),b.isDefaultPrevented()||d.removeClass("open").trigger("hidden.bs.dropdown",e))}))}function c(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.2.0",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=c(e),g=f.hasClass("open");if(b(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click",b);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(b){if(/(38|40|27)/.test(b.keyCode)){var d=a(this);if(b.preventDefault(),b.stopPropagation(),!d.is(".disabled, :disabled")){var e=c(d),g=e.hasClass("open");if(!g||g&&27==b.keyCode)return 27==b.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.divider):visible a",i=e.find('[role="menu"]'+h+', [role="listbox"]'+h);if(i.length){var j=i.index(i.filter(":focus"));38==b.keyCode&&j>0&&j--,40==b.keyCode&&j<i.length-1&&j++,~j||(j=0),i.eq(j).trigger("focus")}}}};var h=a.fn.dropdown;a.fn.dropdown=d,a.fn.dropdown.Constructor=g,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=h,this},a(document).on("click.bs.dropdown.data-api",b).on("click.bs.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.bs.dropdown.data-api",f,g.prototype.toggle).on("keydown.bs.dropdown.data-api",f+', [role="menu"], [role="listbox"]',g.prototype.keydown)}(jQuery),+function(a){"use strict";function b(b,d){return this.each(function(){var e=a(this),f=e.data("bs.modal"),g=a.extend({},c.DEFAULTS,e.data(),"object"==typeof b&&b);f||e.data("bs.modal",f=new c(this,g)),"string"==typeof b?f[b](d):g.show&&f.show(d)})}var c=function(b,c){this.options=c,this.$body=a(document.body),this.$element=a(b),this.$backdrop=this.isShown=null,this.scrollbarWidth=0,this.options.remote&&this.$element.find(".modal-content").load(this.options.remote,a.proxy(function(){this.$element.trigger("loaded.bs.modal")},this))};c.VERSION="3.2.0",c.DEFAULTS={backdrop:!0,keyboard:!0,show:!0},c.prototype.toggle=function(a){return this.isShown?this.hide():this.show(a)},c.prototype.show=function(b){var c=this,d=a.Event("show.bs.modal",{relatedTarget:b});this.$element.trigger(d),this.isShown||d.isDefaultPrevented()||(this.isShown=!0,this.checkScrollbar(),this.$body.addClass("modal-open"),this.setScrollbar(),this.escape(),this.$element.on("click.dismiss.bs.modal",'[data-dismiss="modal"]',a.proxy(this.hide,this)),this.backdrop(function(){var d=a.support.transition&&c.$element.hasClass("fade");c.$element.parent().length||c.$element.appendTo(c.$body),c.$element.show().scrollTop(0),d&&c.$element[0].offsetWidth,c.$element.addClass("in").attr("aria-hidden",!1),c.enforceFocus();var e=a.Event("shown.bs.modal",{relatedTarget:b});d?c.$element.find(".modal-dialog").one("bsTransitionEnd",function(){c.$element.trigger("focus").trigger(e)}).emulateTransitionEnd(300):c.$element.trigger("focus").trigger(e)}))},c.prototype.hide=function(b){b&&b.preventDefault(),b=a.Event("hide.bs.modal"),this.$element.trigger(b),this.isShown&&!b.isDefaultPrevented()&&(this.isShown=!1,this.$body.removeClass("modal-open"),this.resetScrollbar(),this.escape(),a(document).off("focusin.bs.modal"),this.$element.removeClass("in").attr("aria-hidden",!0).off("click.dismiss.bs.modal"),a.support.transition&&this.$element.hasClass("fade")?this.$element.one("bsTransitionEnd",a.proxy(this.hideModal,this)).emulateTransitionEnd(300):this.hideModal())},c.prototype.enforceFocus=function(){a(document).off("focusin.bs.modal").on("focusin.bs.modal",a.proxy(function(a){this.$element[0]===a.target||this.$element.has(a.target).length||this.$element.trigger("focus")},this))},c.prototype.escape=function(){this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.bs.modal",a.proxy(function(a){27==a.which&&this.hide()},this)):this.isShown||this.$element.off("keyup.dismiss.bs.modal")},c.prototype.hideModal=function(){var a=this;this.$element.hide(),this.backdrop(function(){a.$element.trigger("hidden.bs.modal")})},c.prototype.removeBackdrop=function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},c.prototype.backdrop=function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;if(this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(this.$body),this.$element.on("click.dismiss.bs.modal",a.proxy(function(a){a.target===a.currentTarget&&("static"==this.options.backdrop?this.$element[0].focus.call(this.$element[0]):this.hide.call(this))},this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),!b)return;e?this.$backdrop.one("bsTransitionEnd",b).emulateTransitionEnd(150):b()}else if(!this.isShown&&this.$backdrop){this.$backdrop.removeClass("in");var f=function(){c.removeBackdrop(),b&&b()};a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one("bsTransitionEnd",f).emulateTransitionEnd(150):f()}else b&&b()},c.prototype.checkScrollbar=function(){document.body.clientWidth>=window.innerWidth||(this.scrollbarWidth=this.scrollbarWidth||this.measureScrollbar())},c.prototype.setScrollbar=function(){var a=parseInt(this.$body.css("padding-right")||0,10);this.scrollbarWidth&&this.$body.css("padding-right",a+this.scrollbarWidth)},c.prototype.resetScrollbar=function(){this.$body.css("padding-right","")},c.prototype.measureScrollbar=function(){var a=document.createElement("div");a.className="modal-scrollbar-measure",this.$body.append(a);var b=a.offsetWidth-a.clientWidth;return this.$body[0].removeChild(a),b};var d=a.fn.modal;a.fn.modal=b,a.fn.modal.Constructor=c,a.fn.modal.noConflict=function(){return a.fn.modal=d,this},a(document).on("click.bs.modal.data-api",'[data-toggle="modal"]',function(c){var d=a(this),e=d.attr("href"),f=a(d.attr("data-target")||e&&e.replace(/.*(?=#[^\s]+$)/,"")),g=f.data("bs.modal")?"toggle":a.extend({remote:!/#/.test(e)&&e},f.data(),d.data());d.is("a")&&c.preventDefault(),f.one("show.bs.modal",function(a){a.isDefaultPrevented()||f.one("hidden.bs.modal",function(){d.is(":visible")&&d.trigger("focus")})}),b.call(f,g,this)})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tooltip"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.tooltip",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.type=this.options=this.enabled=this.timeout=this.hoverState=this.$element=null,this.init("tooltip",a,b)};c.VERSION="3.2.0",c.DEFAULTS={animation:!0,placement:"top",selector:!1,template:'<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(this.options.viewport.selector||this.options.viewport);for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show()},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide()},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var c=a.contains(document.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!c)return;var d=this,e=this.tip(),f=this.getUID(this.type);this.setContent(),e.attr("id",f),this.$element.attr("aria-describedby",f),this.options.animation&&e.addClass("fade");var g="function"==typeof this.options.placement?this.options.placement.call(this,e[0],this.$element[0]):this.options.placement,h=/\s?auto?\s?/i,i=h.test(g);i&&(g=g.replace(h,"")||"top"),e.detach().css({top:0,left:0,display:"block"}).addClass(g).data("bs."+this.type,this),this.options.container?e.appendTo(this.options.container):e.insertAfter(this.$element);var j=this.getPosition(),k=e[0].offsetWidth,l=e[0].offsetHeight;if(i){var m=g,n=this.$element.parent(),o=this.getPosition(n);g="bottom"==g&&j.top+j.height+l-o.scroll>o.height?"top":"top"==g&&j.top-o.scroll-l<0?"bottom":"right"==g&&j.right+k>o.width?"left":"left"==g&&j.left-k<o.left?"right":g,e.removeClass(m).addClass(g)}var p=this.getCalculatedOffset(g,j,k,l);this.applyPlacement(p,g);var q=function(){d.$element.trigger("shown.bs."+d.type),d.hoverState=null};a.support.transition&&this.$tip.hasClass("fade")?e.one("bsTransitionEnd",q).emulateTransitionEnd(150):q()}},c.prototype.applyPlacement=function(b,c){var d=this.tip(),e=d[0].offsetWidth,f=d[0].offsetHeight,g=parseInt(d.css("margin-top"),10),h=parseInt(d.css("margin-left"),10);isNaN(g)&&(g=0),isNaN(h)&&(h=0),b.top=b.top+g,b.left=b.left+h,a.offset.setOffset(d[0],a.extend({using:function(a){d.css({top:Math.round(a.top),left:Math.round(a.left)})}},b),0),d.addClass("in");var i=d[0].offsetWidth,j=d[0].offsetHeight;"top"==c&&j!=f&&(b.top=b.top+f-j);var k=this.getViewportAdjustedDelta(c,b,i,j);k.left?b.left+=k.left:b.top+=k.top;var l=k.left?2*k.left-e+i:2*k.top-f+j,m=k.left?"left":"top",n=k.left?"offsetWidth":"offsetHeight";d.offset(b),this.replaceArrow(l,d[0][n],m)},c.prototype.replaceArrow=function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle();a.find(".tooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},c.prototype.hide=function(){function b(){"in"!=c.hoverState&&d.detach(),c.$element.trigger("hidden.bs."+c.type)}var c=this,d=this.tip(),e=a.Event("hide.bs."+this.type);return this.$element.removeAttr("aria-describedby"),this.$element.trigger(e),e.isDefaultPrevented()?void 0:(d.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d.one("bsTransitionEnd",b).emulateTransitionEnd(150):b(),this.hoverState=null,this)},c.prototype.fixTitle=function(){var a=this.$element;(a.attr("title")||"string"!=typeof a.attr("data-original-title"))&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},c.prototype.hasContent=function(){return this.getTitle()},c.prototype.getPosition=function(b){b=b||this.$element;var c=b[0],d="BODY"==c.tagName;return a.extend({},"function"==typeof c.getBoundingClientRect?c.getBoundingClientRect():null,{scroll:d?document.documentElement.scrollTop||document.body.scrollTop:b.scrollTop(),width:d?a(window).width():b.outerWidth(),height:d?a(window).height():b.outerHeight()},d?{top:0,left:0}:b.offset())},c.prototype.getCalculatedOffset=function(a,b,c,d){return"bottom"==a?{top:b.top+b.height,left:b.left+b.width/2-c/2}:"top"==a?{top:b.top-d,left:b.left+b.width/2-c/2}:"left"==a?{top:b.top+b.height/2-d/2,left:b.left-c}:{top:b.top+b.height/2-d/2,left:b.left+b.width}},c.prototype.getViewportAdjustedDelta=function(a,b,c,d){var e={top:0,left:0};if(!this.$viewport)return e;var f=this.options.viewport&&this.options.viewport.padding||0,g=this.getPosition(this.$viewport);if(/right|left/.test(a)){var h=b.top-f-g.scroll,i=b.top+f-g.scroll+d;h<g.top?e.top=g.top-h:i>g.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;j<g.left?e.left=g.left-j:k>g.width&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){return this.$tip=this.$tip||a(this.options.template)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.validate=function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){clearTimeout(this.timeout),this.hide().$element.off("."+this.type).removeData("bs."+this.type)};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||"destroy"!=b)&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.2.0",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:'<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").empty()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")},c.prototype.tip=function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){var e=a.proxy(this.process,this);this.$body=a("body"),this.$scrollElement=a(a(c).is("body")?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",e),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.2.0",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b="offset",c=0;a.isWindow(this.$scrollElement[0])||(b="position",c=this.$scrollElement.scrollTop()),this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight();var d=this;this.$body.find(this.selector).map(function(){var d=a(this),e=d.data("target")||d.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[b]().top+c,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){d.offsets.push(this[0]),d.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b<=e[0])return g!=(a=f[0])&&this.activate(a);for(a=e.length;a--;)g!=f[a]&&b>=e[a]&&(!e[a+1]||b<=e[a+1])&&this.activate(f[a])},b.prototype.activate=function(b){this.activeTarget=b,a(this.selector).parentsUntil(this.options.target,".active").removeClass("active");var c=this.selector+'[data-target="'+b+'"],'+this.selector+'[href="'+b+'"]',d=a(c).parents("li").addClass("active");d.parent(".dropdown-menu").length&&(d=d.closest("li.dropdown").addClass("active")),d.trigger("activate.bs.scrollspy")};var d=a.fn.scrollspy;a.fn.scrollspy=c,a.fn.scrollspy.Constructor=b,a.fn.scrollspy.noConflict=function(){return a.fn.scrollspy=d,this},a(window).on("load.bs.scrollspy.data-api",function(){a('[data-spy="scroll"]').each(function(){var b=a(this);c.call(b,b.data())})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.tab");e||d.data("bs.tab",e=new c(this)),"string"==typeof b&&e[b]()})}var c=function(b){this.element=a(b)};c.VERSION="3.2.0",c.prototype.show=function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.data("target");if(d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),!b.parent("li").hasClass("active")){var e=c.find(".active:last a")[0],f=a.Event("show.bs.tab",{relatedTarget:e});if(b.trigger(f),!f.isDefaultPrevented()){var g=a(d);this.activate(b.closest("li"),c),this.activate(g,g.parent(),function(){b.trigger({type:"shown.bs.tab",relatedTarget:e})})}}},c.prototype.activate=function(b,c,d){function e(){f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),g?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var f=c.find("> .active"),g=d&&a.support.transition&&f.hasClass("fade");g?f.one("bsTransitionEnd",e).emulateTransitionEnd(150):e(),f.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this},a(document).on("click.bs.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(c){c.preventDefault(),b.call(a(this),"show")})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=this.unpin=this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.2.0",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=a(document).height(),d=this.$target.scrollTop(),e=this.$element.offset(),f=this.options.offset,g=f.top,h=f.bottom;"object"!=typeof f&&(h=g=f),"function"==typeof g&&(g=f.top(this.$element)),"function"==typeof h&&(h=f.bottom(this.$element));var i=null!=this.unpin&&d+this.unpin<=e.top?!1:null!=h&&e.top+this.$element.height()>=b-h?"bottom":null!=g&&g>=d?"top":!1;if(this.affixed!==i){null!=this.unpin&&this.$element.css("top","");var j="affix"+(i?"-"+i:""),k=a.Event(j+".bs.affix");this.$element.trigger(k),k.isDefaultPrevented()||(this.affixed=i,this.unpin="bottom"==i?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(j).trigger(a.Event(j.replace("affix","affixed"))),"bottom"==i&&this.$element.offset({top:b-this.$element.height()-h}))}}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},d.offsetBottom&&(d.offset.bottom=d.offsetBottom),d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery);
433 </script>
434
435 <!--<script src="/js/bitcoinjs-1-0-0.js"></script>-->
436 <script>
437 (function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var f;"undefined"!=typeof window?f=window:"undefined"!=typeof global?f=global:"undefined"!=typeof self&&(f=self),f.Bitcoin=e()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(_dereq_,module,exports){
438 var assert = _dereq_('assert')
439
440 module.exports = BigInteger
441
442 // JavaScript engine analysis
443 var canary = 0xdeadbeefcafe;
444 var j_lm = ((canary&0xffffff)==0xefcafe);
445
446 // (public) Constructor
447 function BigInteger(a,b,c) {
448 if (!(this instanceof BigInteger)) {
449 return new BigInteger(a, b, c);
450 }
451
452 if(a != null) {
453 if("number" == typeof a) this.fromNumber(a,b,c);
454 else if(b == null && "string" != typeof a) this.fromString(a,256);
455 else this.fromString(a,b);
456 }
457 }
458
459 var proto = BigInteger.prototype;
460
461 // return new, unset BigInteger
462 function nbi() { return new BigInteger(null); }
463
464 // Bits per digit
465 var dbits;
466
467 // am: Compute w_j += (x*this_i), propagate carries,
468 // c is initial carry, returns final carry.
469 // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
470 // We need to select the fastest one that works in this environment.
471
472 // am1: use a single mult and divide to get the high bits,
473 // max digit bits should be 26 because
474 // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
475 function am1(i,x,w,j,c,n) {
476 while(--n >= 0) {
477 var v = x*this[i++]+w[j]+c;
478 c = Math.floor(v/0x4000000);
479 w[j++] = v&0x3ffffff;
480 }
481 return c;
482 }
483 // am2 avoids a big mult-and-extract completely.
484 // Max digit bits should be <= 30 because we do bitwise ops
485 // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
486 function am2(i,x,w,j,c,n) {
487 var xl = x&0x7fff, xh = x>>15;
488 while(--n >= 0) {
489 var l = this[i]&0x7fff;
490 var h = this[i++]>>15;
491 var m = xh*l+h*xl;
492 l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
493 c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
494 w[j++] = l&0x3fffffff;
495 }
496 return c;
497 }
498 // Alternately, set max digit bits to 28 since some
499 // browsers slow down when dealing with 32-bit numbers.
500 function am3(i,x,w,j,c,n) {
501 var xl = x&0x3fff, xh = x>>14;
502 while(--n >= 0) {
503 var l = this[i]&0x3fff;
504 var h = this[i++]>>14;
505 var m = xh*l+h*xl;
506 l = xl*l+((m&0x3fff)<<14)+w[j]+c;
507 c = (l>>28)+(m>>14)+xh*h;
508 w[j++] = l&0xfffffff;
509 }
510 return c;
511 }
512
513 // wtf?
514 BigInteger.prototype.am = am1;
515 dbits = 26;
516
517 /*
518 if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
519 BigInteger.prototype.am = am2;
520 dbits = 30;
521 }
522 else if(j_lm && (navigator.appName != "Netscape")) {
523 BigInteger.prototype.am = am1;
524 dbits = 26;
525 }
526 else { // Mozilla/Netscape seems to prefer am3
527 BigInteger.prototype.am = am3;
528 dbits = 28;
529 }
530 */
531
532 BigInteger.prototype.DB = dbits;
533 BigInteger.prototype.DM = ((1<<dbits)-1);
534 var DV = BigInteger.prototype.DV = (1<<dbits);
535
536 var BI_FP = 52;
537 BigInteger.prototype.FV = Math.pow(2,BI_FP);
538 BigInteger.prototype.F1 = BI_FP-dbits;
539 BigInteger.prototype.F2 = 2*dbits-BI_FP;
540
541 // Digit conversions
542 var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
543 var BI_RC = new Array();
544 var rr,vv;
545 rr = "0".charCodeAt(0);
546 for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
547 rr = "a".charCodeAt(0);
548 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
549 rr = "A".charCodeAt(0);
550 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
551
552 function int2char(n) { return BI_RM.charAt(n); }
553 function intAt(s,i) {
554 var c = BI_RC[s.charCodeAt(i)];
555 return (c==null)?-1:c;
556 }
557
558 // (protected) copy this to r
559 function bnpCopyTo(r) {
560 for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
561 r.t = this.t;
562 r.s = this.s;
563 }
564
565 // (protected) set from integer value x, -DV <= x < DV
566 function bnpFromInt(x) {
567 this.t = 1;
568 this.s = (x<0)?-1:0;
569 if(x > 0) this[0] = x;
570 else if(x < -1) this[0] = x+DV;
571 else this.t = 0;
572 }
573
574 // return bigint initialized to value
575 function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
576
577 // (protected) set from string and radix
578 function bnpFromString(s,b) {
579 var self = this;
580
581 var k;
582 if(b == 16) k = 4;
583 else if(b == 8) k = 3;
584 else if(b == 256) k = 8; // byte array
585 else if(b == 2) k = 1;
586 else if(b == 32) k = 5;
587 else if(b == 4) k = 2;
588 else { self.fromRadix(s,b); return; }
589 self.t = 0;
590 self.s = 0;
591 var i = s.length, mi = false, sh = 0;
592 while(--i >= 0) {
593 var x = (k==8)?s[i]&0xff:intAt(s,i);
594 if(x < 0) {
595 if(s.charAt(i) == "-") mi = true;
596 continue;
597 }
598 mi = false;
599 if(sh == 0)
600 self[self.t++] = x;
601 else if(sh+k > self.DB) {
602 self[self.t-1] |= (x&((1<<(self.DB-sh))-1))<<sh;
603 self[self.t++] = (x>>(self.DB-sh));
604 }
605 else
606 self[self.t-1] |= x<<sh;
607 sh += k;
608 if(sh >= self.DB) sh -= self.DB;
609 }
610 if(k == 8 && (s[0]&0x80) != 0) {
611 self.s = -1;
612 if(sh > 0) self[self.t-1] |= ((1<<(self.DB-sh))-1)<<sh;
613 }
614 self.clamp();
615 if(mi) BigInteger.ZERO.subTo(self,self);
616 }
617
618 // (protected) clamp off excess high words
619 function bnpClamp() {
620 var c = this.s&this.DM;
621 while(this.t > 0 && this[this.t-1] == c) --this.t;
622 }
623
624 // (public) return string representation in given radix
625 function bnToString(b) {
626 var self = this;
627 if(self.s < 0) return "-"+self.negate().toString(b);
628 var k;
629 if(b == 16) k = 4;
630 else if(b == 8) k = 3;
631 else if(b == 2) k = 1;
632 else if(b == 32) k = 5;
633 else if(b == 4) k = 2;
634 else return self.toRadix(b);
635 var km = (1<<k)-1, d, m = false, r = "", i = self.t;
636 var p = self.DB-(i*self.DB)%k;
637 if(i-- > 0) {
638 if(p < self.DB && (d = self[i]>>p) > 0) { m = true; r = int2char(d); }
639 while(i >= 0) {
640 if(p < k) {
641 d = (self[i]&((1<<p)-1))<<(k-p);
642 d |= self[--i]>>(p+=self.DB-k);
643 }
644 else {
645 d = (self[i]>>(p-=k))&km;
646 if(p <= 0) { p += self.DB; --i; }
647 }
648 if(d > 0) m = true;
649 if(m) r += int2char(d);
650 }
651 }
652 return m?r:"0";
653 }
654
655 // (public) -this
656 function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
657
658 // (public) |this|
659 function bnAbs() { return (this.s<0)?this.negate():this; }
660
661 // (public) return + if this > a, - if this < a, 0 if equal
662 function bnCompareTo(a) {
663 var r = this.s-a.s;
664 if(r != 0) return r;
665 var i = this.t;
666 r = i-a.t;
667 if(r != 0) return (this.s<0)?-r:r;
668 while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
669 return 0;
670 }
671
672 // returns bit length of the integer x
673 function nbits(x) {
674 var r = 1, t;
675 if((t=x>>>16) != 0) { x = t; r += 16; }
676 if((t=x>>8) != 0) { x = t; r += 8; }
677 if((t=x>>4) != 0) { x = t; r += 4; }
678 if((t=x>>2) != 0) { x = t; r += 2; }
679 if((t=x>>1) != 0) { x = t; r += 1; }
680 return r;
681 }
682
683 // (public) return the number of bits in "this"
684 function bnBitLength() {
685 if(this.t <= 0) return 0;
686 return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
687 }
688
689 // (protected) r = this << n*DB
690 function bnpDLShiftTo(n,r) {
691 var i;
692 for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
693 for(i = n-1; i >= 0; --i) r[i] = 0;
694 r.t = this.t+n;
695 r.s = this.s;
696 }
697
698 // (protected) r = this >> n*DB
699 function bnpDRShiftTo(n,r) {
700 for(var i = n; i < this.t; ++i) r[i-n] = this[i];
701 r.t = Math.max(this.t-n,0);
702 r.s = this.s;
703 }
704
705 // (protected) r = this << n
706 function bnpLShiftTo(n,r) {
707 var self = this;
708 var bs = n%self.DB;
709 var cbs = self.DB-bs;
710 var bm = (1<<cbs)-1;
711 var ds = Math.floor(n/self.DB), c = (self.s<<bs)&self.DM, i;
712 for(i = self.t-1; i >= 0; --i) {
713 r[i+ds+1] = (self[i]>>cbs)|c;
714 c = (self[i]&bm)<<bs;
715 }
716 for(i = ds-1; i >= 0; --i) r[i] = 0;
717 r[ds] = c;
718 r.t = self.t+ds+1;
719 r.s = self.s;
720 r.clamp();
721 }
722
723 // (protected) r = this >> n
724 function bnpRShiftTo(n,r) {
725 var self = this;
726 r.s = self.s;
727 var ds = Math.floor(n/self.DB);
728 if(ds >= self.t) { r.t = 0; return; }
729 var bs = n%self.DB;
730 var cbs = self.DB-bs;
731 var bm = (1<<bs)-1;
732 r[0] = self[ds]>>bs;
733 for(var i = ds+1; i < self.t; ++i) {
734 r[i-ds-1] |= (self[i]&bm)<<cbs;
735 r[i-ds] = self[i]>>bs;
736 }
737 if(bs > 0) r[self.t-ds-1] |= (self.s&bm)<<cbs;
738 r.t = self.t-ds;
739 r.clamp();
740 }
741
742 // (protected) r = this - a
743 function bnpSubTo(a,r) {
744 var self = this;
745 var i = 0, c = 0, m = Math.min(a.t,self.t);
746 while(i < m) {
747 c += self[i]-a[i];
748 r[i++] = c&self.DM;
749 c >>= self.DB;
750 }
751 if(a.t < self.t) {
752 c -= a.s;
753 while(i < self.t) {
754 c += self[i];
755 r[i++] = c&self.DM;
756 c >>= self.DB;
757 }
758 c += self.s;
759 }
760 else {
761 c += self.s;
762 while(i < a.t) {
763 c -= a[i];
764 r[i++] = c&self.DM;
765 c >>= self.DB;
766 }
767 c -= a.s;
768 }
769 r.s = (c<0)?-1:0;
770 if(c < -1) r[i++] = self.DV+c;
771 else if(c > 0) r[i++] = c;
772 r.t = i;
773 r.clamp();
774 }
775
776 // (protected) r = this * a, r != this,a (HAC 14.12)
777 // "this" should be the larger one if appropriate.
778 function bnpMultiplyTo(a,r) {
779 var x = this.abs(), y = a.abs();
780 var i = x.t;
781 r.t = i+y.t;
782 while(--i >= 0) r[i] = 0;
783 for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
784 r.s = 0;
785 r.clamp();
786 if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
787 }
788
789 // (protected) r = this^2, r != this (HAC 14.16)
790 function bnpSquareTo(r) {
791 var x = this.abs();
792 var i = r.t = 2*x.t;
793 while(--i >= 0) r[i] = 0;
794 for(i = 0; i < x.t-1; ++i) {
795 var c = x.am(i,x[i],r,2*i,0,1);
796 if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
797 r[i+x.t] -= x.DV;
798 r[i+x.t+1] = 1;
799 }
800 }
801 if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
802 r.s = 0;
803 r.clamp();
804 }
805
806 // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
807 // r != q, this != m. q or r may be null.
808 function bnpDivRemTo(m,q,r) {
809 var self = this;
810 var pm = m.abs();
811 if(pm.t <= 0) return;
812 var pt = self.abs();
813 if(pt.t < pm.t) {
814 if(q != null) q.fromInt(0);
815 if(r != null) self.copyTo(r);
816 return;
817 }
818 if(r == null) r = nbi();
819 var y = nbi(), ts = self.s, ms = m.s;
820 var nsh = self.DB-nbits(pm[pm.t-1]); // normalize modulus
821 if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
822 else { pm.copyTo(y); pt.copyTo(r); }
823 var ys = y.t;
824 var y0 = y[ys-1];
825 if(y0 == 0) return;
826 var yt = y0*(1<<self.F1)+((ys>1)?y[ys-2]>>self.F2:0);
827 var d1 = self.FV/yt, d2 = (1<<self.F1)/yt, e = 1<<self.F2;
828 var i = r.t, j = i-ys, t = (q==null)?nbi():q;
829 y.dlShiftTo(j,t);
830 if(r.compareTo(t) >= 0) {
831 r[r.t++] = 1;
832 r.subTo(t,r);
833 }
834 BigInteger.ONE.dlShiftTo(ys,t);
835 t.subTo(y,y); // "negative" y so we can replace sub with am later
836 while(y.t < ys) y[y.t++] = 0;
837 while(--j >= 0) {
838 // Estimate quotient digit
839 var qd = (r[--i]==y0)?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
840 if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
841 y.dlShiftTo(j,t);
842 r.subTo(t,r);
843 while(r[i] < --qd) r.subTo(t,r);
844 }
845 }
846 if(q != null) {
847 r.drShiftTo(ys,q);
848 if(ts != ms) BigInteger.ZERO.subTo(q,q);
849 }
850 r.t = ys;
851 r.clamp();
852 if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
853 if(ts < 0) BigInteger.ZERO.subTo(r,r);
854 }
855
856 // (public) this mod a
857 function bnMod(a) {
858 var r = nbi();
859 this.abs().divRemTo(a,null,r);
860 if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
861 return r;
862 }
863
864 // Modular reduction using "classic" algorithm
865 function Classic(m) { this.m = m; }
866 function cConvert(x) {
867 if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
868 else return x;
869 }
870 function cRevert(x) { return x; }
871 function cReduce(x) { x.divRemTo(this.m,null,x); }
872 function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
873 function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
874
875 Classic.prototype.convert = cConvert;
876 Classic.prototype.revert = cRevert;
877 Classic.prototype.reduce = cReduce;
878 Classic.prototype.mulTo = cMulTo;
879 Classic.prototype.sqrTo = cSqrTo;
880
881 // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
882 // justification:
883 // xy == 1 (mod m)
884 // xy = 1+km
885 // xy(2-xy) = (1+km)(1-km)
886 // x[y(2-xy)] = 1-k^2m^2
887 // x[y(2-xy)] == 1 (mod m^2)
888 // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
889 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
890 // JS multiply "overflows" differently from C/C++, so care is needed here.
891 function bnpInvDigit() {
892 if(this.t < 1) return 0;
893 var x = this[0];
894 if((x&1) == 0) return 0;
895 var y = x&3; // y == 1/x mod 2^2
896 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
897 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
898 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
899 // last step - calculate inverse mod DV directly;
900 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
901 y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
902 // we really want the negative inverse, and -DV < y < DV
903 return (y>0)?this.DV-y:-y;
904 }
905
906 // Montgomery reduction
907 function Montgomery(m) {
908 this.m = m;
909 this.mp = m.invDigit();
910 this.mpl = this.mp&0x7fff;
911 this.mph = this.mp>>15;
912 this.um = (1<<(m.DB-15))-1;
913 this.mt2 = 2*m.t;
914 }
915
916 // xR mod m
917 function montConvert(x) {
918 var r = nbi();
919 x.abs().dlShiftTo(this.m.t,r);
920 r.divRemTo(this.m,null,r);
921 if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
922 return r;
923 }
924
925 // x/R mod m
926 function montRevert(x) {
927 var r = nbi();
928 x.copyTo(r);
929 this.reduce(r);
930 return r;
931 }
932
933 // x = x/R mod m (HAC 14.32)
934 function montReduce(x) {
935 while(x.t <= this.mt2) // pad x so am has enough room later
936 x[x.t++] = 0;
937 for(var i = 0; i < this.m.t; ++i) {
938 // faster way of calculating u0 = x[i]*mp mod DV
939 var j = x[i]&0x7fff;
940 var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
941 // use am to combine the multiply-shift-add into one call
942 j = i+this.m.t;
943 x[j] += this.m.am(0,u0,x,i,0,this.m.t);
944 // propagate carry
945 while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
946 }
947 x.clamp();
948 x.drShiftTo(this.m.t,x);
949 if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
950 }
951
952 // r = "x^2/R mod m"; x != r
953 function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
954
955 // r = "xy/R mod m"; x,y != r
956 function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
957
958 Montgomery.prototype.convert = montConvert;
959 Montgomery.prototype.revert = montRevert;
960 Montgomery.prototype.reduce = montReduce;
961 Montgomery.prototype.mulTo = montMulTo;
962 Montgomery.prototype.sqrTo = montSqrTo;
963
964 // (protected) true iff this is even
965 function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
966
967 // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
968 function bnpExp(e,z) {
969 if(e > 0xffffffff || e < 1) return BigInteger.ONE;
970 var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
971 g.copyTo(r);
972 while(--i >= 0) {
973 z.sqrTo(r,r2);
974 if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
975 else { var t = r; r = r2; r2 = t; }
976 }
977 return z.revert(r);
978 }
979
980 // (public) this^e % m, 0 <= e < 2^32
981 function bnModPowInt(e,m) {
982 var z;
983 if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
984 return this.exp(e,z);
985 }
986
987 // protected
988 proto.copyTo = bnpCopyTo;
989 proto.fromInt = bnpFromInt;
990 proto.fromString = bnpFromString;
991 proto.clamp = bnpClamp;
992 proto.dlShiftTo = bnpDLShiftTo;
993 proto.drShiftTo = bnpDRShiftTo;
994 proto.lShiftTo = bnpLShiftTo;
995 proto.rShiftTo = bnpRShiftTo;
996 proto.subTo = bnpSubTo;
997 proto.multiplyTo = bnpMultiplyTo;
998 proto.squareTo = bnpSquareTo;
999 proto.divRemTo = bnpDivRemTo;
1000 proto.invDigit = bnpInvDigit;
1001 proto.isEven = bnpIsEven;
1002 proto.exp = bnpExp;
1003
1004 // public
1005 proto.toString = bnToString;
1006 proto.negate = bnNegate;
1007 proto.abs = bnAbs;
1008 proto.compareTo = bnCompareTo;
1009 proto.bitLength = bnBitLength;
1010 proto.mod = bnMod;
1011 proto.modPowInt = bnModPowInt;
1012
1013 //// jsbn2
1014
1015 function nbi() { return new BigInteger(null); }
1016
1017 // (public)
1018 function bnClone() { var r = nbi(); this.copyTo(r); return r; }
1019
1020 // (public) return value as integer
1021 function bnIntValue() {
1022 if(this.s < 0) {
1023 if(this.t == 1) return this[0]-this.DV;
1024 else if(this.t == 0) return -1;
1025 }
1026 else if(this.t == 1) return this[0];
1027 else if(this.t == 0) return 0;
1028 // assumes 16 < DB < 32
1029 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
1030 }
1031
1032 // (public) return value as byte
1033 function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
1034
1035 // (public) return value as short (assumes DB>=16)
1036 function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
1037
1038 // (protected) return x s.t. r^x < DV
1039 function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
1040
1041 // (public) 0 if this == 0, 1 if this > 0
1042 function bnSigNum() {
1043 if(this.s < 0) return -1;
1044 else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
1045 else return 1;
1046 }
1047
1048 // (protected) convert to radix string
1049 function bnpToRadix(b) {
1050 if(b == null) b = 10;
1051 if(this.signum() == 0 || b < 2 || b > 36) return "0";
1052 var cs = this.chunkSize(b);
1053 var a = Math.pow(b,cs);
1054 var d = nbv(a), y = nbi(), z = nbi(), r = "";
1055 this.divRemTo(d,y,z);
1056 while(y.signum() > 0) {
1057 r = (a+z.intValue()).toString(b).substr(1) + r;
1058 y.divRemTo(d,y,z);
1059 }
1060 return z.intValue().toString(b) + r;
1061 }
1062
1063 // (protected) convert from radix string
1064 function bnpFromRadix(s,b) {
1065 var self = this;
1066 self.fromInt(0);
1067 if(b == null) b = 10;
1068 var cs = self.chunkSize(b);
1069 var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
1070 for(var i = 0; i < s.length; ++i) {
1071 var x = intAt(s,i);
1072 if(x < 0) {
1073 if(s.charAt(i) == "-" && self.signum() == 0) mi = true;
1074 continue;
1075 }
1076 w = b*w+x;
1077 if(++j >= cs) {
1078 self.dMultiply(d);
1079 self.dAddOffset(w,0);
1080 j = 0;
1081 w = 0;
1082 }
1083 }
1084 if(j > 0) {
1085 self.dMultiply(Math.pow(b,j));
1086 self.dAddOffset(w,0);
1087 }
1088 if(mi) BigInteger.ZERO.subTo(self,self);
1089 }
1090
1091 // (protected) alternate constructor
1092 function bnpFromNumber(a,b,c) {
1093 var self = this;
1094 if("number" == typeof b) {
1095 // new BigInteger(int,int,RNG)
1096 if(a < 2) self.fromInt(1);
1097 else {
1098 self.fromNumber(a,c);
1099 if(!self.testBit(a-1)) // force MSB set
1100 self.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,self);
1101 if(self.isEven()) self.dAddOffset(1,0); // force odd
1102 while(!self.isProbablePrime(b)) {
1103 self.dAddOffset(2,0);
1104 if(self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a-1),self);
1105 }
1106 }
1107 }
1108 else {
1109 // new BigInteger(int,RNG)
1110 var x = new Array(), t = a&7;
1111 x.length = (a>>3)+1;
1112 b.nextBytes(x);
1113 if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
1114 self.fromString(x,256);
1115 }
1116 }
1117
1118 // (public) convert to bigendian byte array
1119 function bnToByteArray() {
1120 var self = this;
1121 var i = self.t, r = new Array();
1122 r[0] = self.s;
1123 var p = self.DB-(i*self.DB)%8, d, k = 0;
1124 if(i-- > 0) {
1125 if(p < self.DB && (d = self[i]>>p) != (self.s&self.DM)>>p)
1126 r[k++] = d|(self.s<<(self.DB-p));
1127 while(i >= 0) {
1128 if(p < 8) {
1129 d = (self[i]&((1<<p)-1))<<(8-p);
1130 d |= self[--i]>>(p+=self.DB-8);
1131 }
1132 else {
1133 d = (self[i]>>(p-=8))&0xff;
1134 if(p <= 0) { p += self.DB; --i; }
1135 }
1136 if((d&0x80) != 0) d |= -256;
1137 if(k === 0 && (self.s&0x80) != (d&0x80)) ++k;
1138 if(k > 0 || d != self.s) r[k++] = d;
1139 }
1140 }
1141 return r;
1142 }
1143
1144 function bnEquals(a) { return(this.compareTo(a)==0); }
1145 function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
1146 function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
1147
1148 // (protected) r = this op a (bitwise)
1149 function bnpBitwiseTo(a,op,r) {
1150 var self = this;
1151 var i, f, m = Math.min(a.t,self.t);
1152 for(i = 0; i < m; ++i) r[i] = op(self[i],a[i]);
1153 if(a.t < self.t) {
1154 f = a.s&self.DM;
1155 for(i = m; i < self.t; ++i) r[i] = op(self[i],f);
1156 r.t = self.t;
1157 }
1158 else {
1159 f = self.s&self.DM;
1160 for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
1161 r.t = a.t;
1162 }
1163 r.s = op(self.s,a.s);
1164 r.clamp();
1165 }
1166
1167 // (public) this & a
1168 function op_and(x,y) { return x&y; }
1169 function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
1170
1171 // (public) this | a
1172 function op_or(x,y) { return x|y; }
1173 function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
1174
1175 // (public) this ^ a
1176 function op_xor(x,y) { return x^y; }
1177 function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
1178
1179 // (public) this & ~a
1180 function op_andnot(x,y) { return x&~y; }
1181 function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
1182
1183 // (public) ~this
1184 function bnNot() {
1185 var r = nbi();
1186 for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
1187 r.t = this.t;
1188 r.s = ~this.s;
1189 return r;
1190 }
1191
1192 // (public) this << n
1193 function bnShiftLeft(n) {
1194 var r = nbi();
1195 if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
1196 return r;
1197 }
1198
1199 // (public) this >> n
1200 function bnShiftRight(n) {
1201 var r = nbi();
1202 if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
1203 return r;
1204 }
1205
1206 // return index of lowest 1-bit in x, x < 2^31
1207 function lbit(x) {
1208 if(x == 0) return -1;
1209 var r = 0;
1210 if((x&0xffff) == 0) { x >>= 16; r += 16; }
1211 if((x&0xff) == 0) { x >>= 8; r += 8; }
1212 if((x&0xf) == 0) { x >>= 4; r += 4; }
1213 if((x&3) == 0) { x >>= 2; r += 2; }
1214 if((x&1) == 0) ++r;
1215 return r;
1216 }
1217
1218 // (public) returns index of lowest 1-bit (or -1 if none)
1219 function bnGetLowestSetBit() {
1220 for(var i = 0; i < this.t; ++i)
1221 if(this[i] != 0) return i*this.DB+lbit(this[i]);
1222 if(this.s < 0) return this.t*this.DB;
1223 return -1;
1224 }
1225
1226 // return number of 1 bits in x
1227 function cbit(x) {
1228 var r = 0;
1229 while(x != 0) { x &= x-1; ++r; }
1230 return r;
1231 }
1232
1233 // (public) return number of set bits
1234 function bnBitCount() {
1235 var r = 0, x = this.s&this.DM;
1236 for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
1237 return r;
1238 }
1239
1240 // (public) true iff nth bit is set
1241 function bnTestBit(n) {
1242 var j = Math.floor(n/this.DB);
1243 if(j >= this.t) return(this.s!=0);
1244 return((this[j]&(1<<(n%this.DB)))!=0);
1245 }
1246
1247 // (protected) this op (1<<n)
1248 function bnpChangeBit(n,op) {
1249 var r = BigInteger.ONE.shiftLeft(n);
1250 this.bitwiseTo(r,op,r);
1251 return r;
1252 }
1253
1254 // (public) this | (1<<n)
1255 function bnSetBit(n) { return this.changeBit(n,op_or); }
1256
1257 // (public) this & ~(1<<n)
1258 function bnClearBit(n) { return this.changeBit(n,op_andnot); }
1259
1260 // (public) this ^ (1<<n)
1261 function bnFlipBit(n) { return this.changeBit(n,op_xor); }
1262
1263 // (protected) r = this + a
1264 function bnpAddTo(a,r) {
1265 var self = this;
1266
1267 var i = 0, c = 0, m = Math.min(a.t,self.t);
1268 while(i < m) {
1269 c += self[i]+a[i];
1270 r[i++] = c&self.DM;
1271 c >>= self.DB;
1272 }
1273 if(a.t < self.t) {
1274 c += a.s;
1275 while(i < self.t) {
1276 c += self[i];
1277 r[i++] = c&self.DM;
1278 c >>= self.DB;
1279 }
1280 c += self.s;
1281 }
1282 else {
1283 c += self.s;
1284 while(i < a.t) {
1285 c += a[i];
1286 r[i++] = c&self.DM;
1287 c >>= self.DB;
1288 }
1289 c += a.s;
1290 }
1291 r.s = (c<0)?-1:0;
1292 if(c > 0) r[i++] = c;
1293 else if(c < -1) r[i++] = self.DV+c;
1294 r.t = i;
1295 r.clamp();
1296 }
1297
1298 // (public) this + a
1299 function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
1300
1301 // (public) this - a
1302 function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
1303
1304 // (public) this * a
1305 function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
1306
1307 // (public) this^2
1308 function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
1309
1310 // (public) this / a
1311 function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
1312
1313 // (public) this % a
1314 function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
1315
1316 // (public) [this/a,this%a]
1317 function bnDivideAndRemainder(a) {
1318 var q = nbi(), r = nbi();
1319 this.divRemTo(a,q,r);
1320 return new Array(q,r);
1321 }
1322
1323 // (protected) this *= n, this >= 0, 1 < n < DV
1324 function bnpDMultiply(n) {
1325 this[this.t] = this.am(0,n-1,this,0,0,this.t);
1326 ++this.t;
1327 this.clamp();
1328 }
1329
1330 // (protected) this += n << w words, this >= 0
1331 function bnpDAddOffset(n,w) {
1332 if(n == 0) return;
1333 while(this.t <= w) this[this.t++] = 0;
1334 this[w] += n;
1335 while(this[w] >= this.DV) {
1336 this[w] -= this.DV;
1337 if(++w >= this.t) this[this.t++] = 0;
1338 ++this[w];
1339 }
1340 }
1341
1342 // A "null" reducer
1343 function NullExp() {}
1344 function nNop(x) { return x; }
1345 function nMulTo(x,y,r) { x.multiplyTo(y,r); }
1346 function nSqrTo(x,r) { x.squareTo(r); }
1347
1348 NullExp.prototype.convert = nNop;
1349 NullExp.prototype.revert = nNop;
1350 NullExp.prototype.mulTo = nMulTo;
1351 NullExp.prototype.sqrTo = nSqrTo;
1352
1353 // (public) this^e
1354 function bnPow(e) { return this.exp(e,new NullExp()); }
1355
1356 // (protected) r = lower n words of "this * a", a.t <= n
1357 // "this" should be the larger one if appropriate.
1358 function bnpMultiplyLowerTo(a,n,r) {
1359 var i = Math.min(this.t+a.t,n);
1360 r.s = 0; // assumes a,this >= 0
1361 r.t = i;
1362 while(i > 0) r[--i] = 0;
1363 var j;
1364 for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
1365 for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
1366 r.clamp();
1367 }
1368
1369 // (protected) r = "this * a" without lower n words, n > 0
1370 // "this" should be the larger one if appropriate.
1371 function bnpMultiplyUpperTo(a,n,r) {
1372 --n;
1373 var i = r.t = this.t+a.t-n;
1374 r.s = 0; // assumes a,this >= 0
1375 while(--i >= 0) r[i] = 0;
1376 for(i = Math.max(n-this.t,0); i < a.t; ++i)
1377 r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
1378 r.clamp();
1379 r.drShiftTo(1,r);
1380 }
1381
1382 // Barrett modular reduction
1383 function Barrett(m) {
1384 // setup Barrett
1385 this.r2 = nbi();
1386 this.q3 = nbi();
1387 BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
1388 this.mu = this.r2.divide(m);
1389 this.m = m;
1390 }
1391
1392 function barrettConvert(x) {
1393 if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
1394 else if(x.compareTo(this.m) < 0) return x;
1395 else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
1396 }
1397
1398 function barrettRevert(x) { return x; }
1399
1400 // x = x mod m (HAC 14.42)
1401 function barrettReduce(x) {
1402 var self = this;
1403 x.drShiftTo(self.m.t-1,self.r2);
1404 if(x.t > self.m.t+1) { x.t = self.m.t+1; x.clamp(); }
1405 self.mu.multiplyUpperTo(self.r2,self.m.t+1,self.q3);
1406 self.m.multiplyLowerTo(self.q3,self.m.t+1,self.r2);
1407 while(x.compareTo(self.r2) < 0) x.dAddOffset(1,self.m.t+1);
1408 x.subTo(self.r2,x);
1409 while(x.compareTo(self.m) >= 0) x.subTo(self.m,x);
1410 }
1411
1412 // r = x^2 mod m; x != r
1413 function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
1414
1415 // r = x*y mod m; x,y != r
1416 function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
1417
1418 Barrett.prototype.convert = barrettConvert;
1419 Barrett.prototype.revert = barrettRevert;
1420 Barrett.prototype.reduce = barrettReduce;
1421 Barrett.prototype.mulTo = barrettMulTo;
1422 Barrett.prototype.sqrTo = barrettSqrTo;
1423
1424 // (public) this^e % m (HAC 14.85)
1425 function bnModPow(e,m) {
1426 var i = e.bitLength(), k, r = nbv(1), z;
1427 if(i <= 0) return r;
1428 else if(i < 18) k = 1;
1429 else if(i < 48) k = 3;
1430 else if(i < 144) k = 4;
1431 else if(i < 768) k = 5;
1432 else k = 6;
1433 if(i < 8)
1434 z = new Classic(m);
1435 else if(m.isEven())
1436 z = new Barrett(m);
1437 else
1438 z = new Montgomery(m);
1439
1440 // precomputation
1441 var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
1442 g[1] = z.convert(this);
1443 if(k > 1) {
1444 var g2 = nbi();
1445 z.sqrTo(g[1],g2);
1446 while(n <= km) {
1447 g[n] = nbi();
1448 z.mulTo(g2,g[n-2],g[n]);
1449 n += 2;
1450 }
1451 }
1452
1453 var j = e.t-1, w, is1 = true, r2 = nbi(), t;
1454 i = nbits(e[j])-1;
1455 while(j >= 0) {
1456 if(i >= k1) w = (e[j]>>(i-k1))&km;
1457 else {
1458 w = (e[j]&((1<<(i+1))-1))<<(k1-i);
1459 if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
1460 }
1461
1462 n = k;
1463 while((w&1) == 0) { w >>= 1; --n; }
1464 if((i -= n) < 0) { i += this.DB; --j; }
1465 if(is1) { // ret == 1, don't bother squaring or multiplying it
1466 g[w].copyTo(r);
1467 is1 = false;
1468 }
1469 else {
1470 while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
1471 if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
1472 z.mulTo(r2,g[w],r);
1473 }
1474
1475 while(j >= 0 && (e[j]&(1<<i)) == 0) {
1476 z.sqrTo(r,r2); t = r; r = r2; r2 = t;
1477 if(--i < 0) { i = this.DB-1; --j; }
1478 }
1479 }
1480 return z.revert(r);
1481 }
1482
1483 // (public) gcd(this,a) (HAC 14.54)
1484 function bnGCD(a) {
1485 var x = (this.s<0)?this.negate():this.clone();
1486 var y = (a.s<0)?a.negate():a.clone();
1487 if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
1488 var i = x.getLowestSetBit(), g = y.getLowestSetBit();
1489 if(g < 0) return x;
1490 if(i < g) g = i;
1491 if(g > 0) {
1492 x.rShiftTo(g,x);
1493 y.rShiftTo(g,y);
1494 }
1495 while(x.signum() > 0) {
1496 if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
1497 if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
1498 if(x.compareTo(y) >= 0) {
1499 x.subTo(y,x);
1500 x.rShiftTo(1,x);
1501 }
1502 else {
1503 y.subTo(x,y);
1504 y.rShiftTo(1,y);
1505 }
1506 }
1507 if(g > 0) y.lShiftTo(g,y);
1508 return y;
1509 }
1510
1511 // (protected) this % n, n < 2^26
1512 function bnpModInt(n) {
1513 if(n <= 0) return 0;
1514 var d = this.DV%n, r = (this.s<0)?n-1:0;
1515 if(this.t > 0)
1516 if(d == 0) r = this[0]%n;
1517 else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
1518 return r;
1519 }
1520
1521 // (public) 1/this % m (HAC 14.61)
1522 function bnModInverse(m) {
1523 var ac = m.isEven();
1524 if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
1525 var u = m.clone(), v = this.clone();
1526 var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
1527 while(u.signum() != 0) {
1528 while(u.isEven()) {
1529 u.rShiftTo(1,u);
1530 if(ac) {
1531 if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
1532 a.rShiftTo(1,a);
1533 }
1534 else if(!b.isEven()) b.subTo(m,b);
1535 b.rShiftTo(1,b);
1536 }
1537 while(v.isEven()) {
1538 v.rShiftTo(1,v);
1539 if(ac) {
1540 if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
1541 c.rShiftTo(1,c);
1542 }
1543 else if(!d.isEven()) d.subTo(m,d);
1544 d.rShiftTo(1,d);
1545 }
1546 if(u.compareTo(v) >= 0) {
1547 u.subTo(v,u);
1548 if(ac) a.subTo(c,a);
1549 b.subTo(d,b);
1550 }
1551 else {
1552 v.subTo(u,v);
1553 if(ac) c.subTo(a,c);
1554 d.subTo(b,d);
1555 }
1556 }
1557 if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
1558 if(d.compareTo(m) >= 0) return d.subtract(m);
1559 if(d.signum() < 0) d.addTo(m,d); else return d;
1560 if(d.signum() < 0) return d.add(m); else return d;
1561 }
1562
1563 // protected
1564 proto.chunkSize = bnpChunkSize;
1565 proto.toRadix = bnpToRadix;
1566 proto.fromRadix = bnpFromRadix;
1567 proto.fromNumber = bnpFromNumber;
1568 proto.bitwiseTo = bnpBitwiseTo;
1569 proto.changeBit = bnpChangeBit;
1570 proto.addTo = bnpAddTo;
1571 proto.dMultiply = bnpDMultiply;
1572 proto.dAddOffset = bnpDAddOffset;
1573 proto.multiplyLowerTo = bnpMultiplyLowerTo;
1574 proto.multiplyUpperTo = bnpMultiplyUpperTo;
1575 proto.modInt = bnpModInt;
1576
1577 // public
1578 proto.clone = bnClone;
1579 proto.intValue = bnIntValue;
1580 proto.byteValue = bnByteValue;
1581 proto.shortValue = bnShortValue;
1582 proto.signum = bnSigNum;
1583 proto.toByteArray = bnToByteArray;
1584 proto.equals = bnEquals;
1585 proto.min = bnMin;
1586 proto.max = bnMax;
1587 proto.and = bnAnd;
1588 proto.or = bnOr;
1589 proto.xor = bnXor;
1590 proto.andNot = bnAndNot;
1591 proto.not = bnNot;
1592 proto.shiftLeft = bnShiftLeft;
1593 proto.shiftRight = bnShiftRight;
1594 proto.getLowestSetBit = bnGetLowestSetBit;
1595 proto.bitCount = bnBitCount;
1596 proto.testBit = bnTestBit;
1597 proto.setBit = bnSetBit;
1598 proto.clearBit = bnClearBit;
1599 proto.flipBit = bnFlipBit;
1600 proto.add = bnAdd;
1601 proto.subtract = bnSubtract;
1602 proto.multiply = bnMultiply;
1603 proto.divide = bnDivide;
1604 proto.remainder = bnRemainder;
1605 proto.divideAndRemainder = bnDivideAndRemainder;
1606 proto.modPow = bnModPow;
1607 proto.modInverse = bnModInverse;
1608 proto.pow = bnPow;
1609 proto.gcd = bnGCD;
1610
1611 // JSBN-specific extension
1612 proto.square = bnSquare;
1613
1614 // BigInteger interfaces not implemented in jsbn:
1615
1616 // BigInteger(int signum, byte[] magnitude)
1617 // double doubleValue()
1618 // float floatValue()
1619 // int hashCode()
1620 // long longValue()
1621 // static BigInteger valueOf(long val)
1622
1623 // "constants"
1624 BigInteger.ZERO = nbv(0);
1625 BigInteger.ONE = nbv(1);
1626 BigInteger.valueOf = nbv;
1627
1628 },{"assert":4}],2:[function(_dereq_,module,exports){
1629 (function (Buffer){
1630 // FIXME: Kind of a weird way to throw exceptions, consider removing
1631 var assert = _dereq_('assert')
1632 var BigInteger = _dereq_('./bigi')
1633
1634 /**
1635 * Turns a byte array into a big integer.
1636 *
1637 * This function will interpret a byte array as a big integer in big
1638 * endian notation.
1639 */
1640 BigInteger.fromByteArrayUnsigned = function(byteArray) {
1641 // BigInteger expects a DER integer conformant byte array
1642 if (byteArray[0] & 0x80) {
1643 return new BigInteger([0].concat(byteArray))
1644 }
1645
1646 return new BigInteger(byteArray)
1647 }
1648
1649 /**
1650 * Returns a byte array representation of the big integer.
1651 *
1652 * This returns the absolute of the contained value in big endian
1653 * form. A value of zero results in an empty array.
1654 */
1655 BigInteger.prototype.toByteArrayUnsigned = function() {
1656 var byteArray = this.toByteArray()
1657 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
1658 }
1659
1660 BigInteger.fromDERInteger = function(byteArray) {
1661 return new BigInteger(byteArray)
1662 }
1663
1664 /*
1665 * Converts BigInteger to a DER integer representation.
1666 *
1667 * The format for this value uses the most significant bit as a sign
1668 * bit. If the most significant bit is already set and the integer is
1669 * positive, a 0x00 is prepended.
1670 *
1671 * Examples:
1672 *
1673 * 0 => 0x00
1674 * 1 => 0x01
1675 * -1 => 0x81
1676 * 127 => 0x7f
1677 * -127 => 0xff
1678 * 128 => 0x0080
1679 * -128 => 0x80
1680 * 255 => 0x00ff
1681 * -255 => 0xff
1682 * 16300 => 0x3fac
1683 * -16300 => 0xbfac
1684 * 62300 => 0x00f35c
1685 * -62300 => 0xf35c
1686 */
1687 BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
1688
1689 BigInteger.fromBuffer = function(buffer) {
1690 // BigInteger expects a DER integer conformant byte array
1691 if (buffer[0] & 0x80) {
1692 var byteArray = Array.prototype.slice.call(buffer)
1693
1694 return new BigInteger([0].concat(byteArray))
1695 }
1696
1697 return new BigInteger(buffer)
1698 }
1699
1700 BigInteger.fromHex = function(hex) {
1701 if (hex === '') return BigInteger.ZERO
1702
1703 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
1704 assert.equal(hex.length % 2, 0, 'Incomplete hex')
1705 return new BigInteger(hex, 16)
1706 }
1707
1708 BigInteger.prototype.toBuffer = function(size) {
1709 var byteArray = this.toByteArrayUnsigned()
1710 var zeros = []
1711
1712 var padding = size - byteArray.length
1713 while (zeros.length < padding) zeros.push(0)
1714
1715 return new Buffer(zeros.concat(byteArray))
1716 }
1717
1718 BigInteger.prototype.toHex = function(size) {
1719 return this.toBuffer(size).toString('hex')
1720 }
1721
1722 }).call(this,_dereq_("buffer").Buffer)
1723 },{"./bigi":1,"assert":4,"buffer":8}],3:[function(_dereq_,module,exports){
1724 var BigInteger = _dereq_('./bigi')
1725
1726 //addons
1727 _dereq_('./convert')
1728
1729 module.exports = BigInteger
1730 },{"./bigi":1,"./convert":2}],4:[function(_dereq_,module,exports){
1731 // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
1732 //
1733 // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
1734 //
1735 // Originally from narwhal.js (http://narwhaljs.org)
1736 // Copyright (c) 2009 Thomas Robinson <280north.com>
1737 //
1738 // Permission is hereby granted, free of charge, to any person obtaining a copy
1739 // of this software and associated documentation files (the 'Software'), to
1740 // deal in the Software without restriction, including without limitation the
1741 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1742 // sell copies of the Software, and to permit persons to whom the Software is
1743 // furnished to do so, subject to the following conditions:
1744 //
1745 // The above copyright notice and this permission notice shall be included in
1746 // all copies or substantial portions of the Software.
1747 //
1748 // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1749 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1750 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1751 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1752 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1753 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1754
1755 // when used in node, this will actually load the util module we depend on
1756 // versus loading the builtin util module as happens otherwise
1757 // this is a bug in node module loading as far as I am concerned
1758 var util = _dereq_('util/');
1759
1760 var pSlice = Array.prototype.slice;
1761 var hasOwn = Object.prototype.hasOwnProperty;
1762
1763 // 1. The assert module provides functions that throw
1764 // AssertionError's when particular conditions are not met. The
1765 // assert module must conform to the following interface.
1766
1767 var assert = module.exports = ok;
1768
1769 // 2. The AssertionError is defined in assert.
1770 // new assert.AssertionError({ message: message,
1771 // actual: actual,
1772 // expected: expected })
1773
1774 assert.AssertionError = function AssertionError(options) {
1775 this.name = 'AssertionError';
1776 this.actual = options.actual;
1777 this.expected = options.expected;
1778 this.operator = options.operator;
1779 if (options.message) {
1780 this.message = options.message;
1781 this.generatedMessage = false;
1782 } else {
1783 this.message = getMessage(this);
1784 this.generatedMessage = true;
1785 }
1786 var stackStartFunction = options.stackStartFunction || fail;
1787
1788 if (Error.captureStackTrace) {
1789 Error.captureStackTrace(this, stackStartFunction);
1790 }
1791 else {
1792 // non v8 browsers so we can have a stacktrace
1793 var err = new Error();
1794 if (err.stack) {
1795 var out = err.stack;
1796
1797 // try to strip useless frames
1798 var fn_name = stackStartFunction.name;
1799 var idx = out.indexOf('\n' + fn_name);
1800 if (idx >= 0) {
1801 // once we have located the function frame
1802 // we need to strip out everything before it (and its line)
1803 var next_line = out.indexOf('\n', idx + 1);
1804 out = out.substring(next_line + 1);
1805 }
1806
1807 this.stack = out;
1808 }
1809 }
1810 };
1811
1812 // assert.AssertionError instanceof Error
1813 util.inherits(assert.AssertionError, Error);
1814
1815 function replacer(key, value) {
1816 if (util.isUndefined(value)) {
1817 return '' + value;
1818 }
1819 if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) {
1820 return value.toString();
1821 }
1822 if (util.isFunction(value) || util.isRegExp(value)) {
1823 return value.toString();
1824 }
1825 return value;
1826 }
1827
1828 function truncate(s, n) {
1829 if (util.isString(s)) {
1830 return s.length < n ? s : s.slice(0, n);
1831 } else {
1832 return s;
1833 }
1834 }
1835
1836 function getMessage(self) {
1837 return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
1838 self.operator + ' ' +
1839 truncate(JSON.stringify(self.expected, replacer), 128);
1840 }
1841
1842 // At present only the three keys mentioned above are used and
1843 // understood by the spec. Implementations or sub modules can pass
1844 // other keys to the AssertionError's constructor - they will be
1845 // ignored.
1846
1847 // 3. All of the following functions must throw an AssertionError
1848 // when a corresponding condition is not met, with a message that
1849 // may be undefined if not provided. All assertion methods provide
1850 // both the actual and expected values to the assertion error for
1851 // display purposes.
1852
1853 function fail(actual, expected, message, operator, stackStartFunction) {
1854 throw new assert.AssertionError({
1855 message: message,
1856 actual: actual,
1857 expected: expected,
1858 operator: operator,
1859 stackStartFunction: stackStartFunction
1860 });
1861 }
1862
1863 // EXTENSION! allows for well behaved errors defined elsewhere.
1864 assert.fail = fail;
1865
1866 // 4. Pure assertion tests whether a value is truthy, as determined
1867 // by !!guard.
1868 // assert.ok(guard, message_opt);
1869 // This statement is equivalent to assert.equal(true, !!guard,
1870 // message_opt);. To test strictly for the value true, use
1871 // assert.strictEqual(true, guard, message_opt);.
1872
1873 function ok(value, message) {
1874 if (!value) fail(value, true, message, '==', assert.ok);
1875 }
1876 assert.ok = ok;
1877
1878 // 5. The equality assertion tests shallow, coercive equality with
1879 // ==.
1880 // assert.equal(actual, expected, message_opt);
1881
1882 assert.equal = function equal(actual, expected, message) {
1883 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
1884 };
1885
1886 // 6. The non-equality assertion tests for whether two objects are not equal
1887 // with != assert.notEqual(actual, expected, message_opt);
1888
1889 assert.notEqual = function notEqual(actual, expected, message) {
1890 if (actual == expected) {
1891 fail(actual, expected, message, '!=', assert.notEqual);
1892 }
1893 };
1894
1895 // 7. The equivalence assertion tests a deep equality relation.
1896 // assert.deepEqual(actual, expected, message_opt);
1897
1898 assert.deepEqual = function deepEqual(actual, expected, message) {
1899 if (!_deepEqual(actual, expected)) {
1900 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
1901 }
1902 };
1903
1904 function _deepEqual(actual, expected) {
1905 // 7.1. All identical values are equivalent, as determined by ===.
1906 if (actual === expected) {
1907 return true;
1908
1909 } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
1910 if (actual.length != expected.length) return false;
1911
1912 for (var i = 0; i < actual.length; i++) {
1913 if (actual[i] !== expected[i]) return false;
1914 }
1915
1916 return true;
1917
1918 // 7.2. If the expected value is a Date object, the actual value is
1919 // equivalent if it is also a Date object that refers to the same time.
1920 } else if (util.isDate(actual) && util.isDate(expected)) {
1921 return actual.getTime() === expected.getTime();
1922
1923 // 7.3 If the expected value is a RegExp object, the actual value is
1924 // equivalent if it is also a RegExp object with the same source and
1925 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
1926 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
1927 return actual.source === expected.source &&
1928 actual.global === expected.global &&
1929 actual.multiline === expected.multiline &&
1930 actual.lastIndex === expected.lastIndex &&
1931 actual.ignoreCase === expected.ignoreCase;
1932
1933 // 7.4. Other pairs that do not both pass typeof value == 'object',
1934 // equivalence is determined by ==.
1935 } else if (!util.isObject(actual) && !util.isObject(expected)) {
1936 return actual == expected;
1937
1938 // 7.5 For all other Object pairs, including Array objects, equivalence is
1939 // determined by having the same number of owned properties (as verified
1940 // with Object.prototype.hasOwnProperty.call), the same set of keys
1941 // (although not necessarily the same order), equivalent values for every
1942 // corresponding key, and an identical 'prototype' property. Note: this
1943 // accounts for both named and indexed properties on Arrays.
1944 } else {
1945 return objEquiv(actual, expected);
1946 }
1947 }
1948
1949 function isArguments(object) {
1950 return Object.prototype.toString.call(object) == '[object Arguments]';
1951 }
1952
1953 function objEquiv(a, b) {
1954 if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
1955 return false;
1956 // an identical 'prototype' property.
1957 if (a.prototype !== b.prototype) return false;
1958 //~~~I've managed to break Object.keys through screwy arguments passing.
1959 // Converting to array solves the problem.
1960 if (isArguments(a)) {
1961 if (!isArguments(b)) {
1962 return false;
1963 }
1964 a = pSlice.call(a);
1965 b = pSlice.call(b);
1966 return _deepEqual(a, b);
1967 }
1968 try {
1969 var ka = objectKeys(a),
1970 kb = objectKeys(b),
1971 key, i;
1972 } catch (e) {//happens when one is a string literal and the other isn't
1973 return false;
1974 }
1975 // having the same number of owned properties (keys incorporates
1976 // hasOwnProperty)
1977 if (ka.length != kb.length)
1978 return false;
1979 //the same set of keys (although not necessarily the same order),
1980 ka.sort();
1981 kb.sort();
1982 //~~~cheap key test
1983 for (i = ka.length - 1; i >= 0; i--) {
1984 if (ka[i] != kb[i])
1985 return false;
1986 }
1987 //equivalent values for every corresponding key, and
1988 //~~~possibly expensive deep test
1989 for (i = ka.length - 1; i >= 0; i--) {
1990 key = ka[i];
1991 if (!_deepEqual(a[key], b[key])) return false;
1992 }
1993 return true;
1994 }
1995
1996 // 8. The non-equivalence assertion tests for any deep inequality.
1997 // assert.notDeepEqual(actual, expected, message_opt);
1998
1999 assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
2000 if (_deepEqual(actual, expected)) {
2001 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
2002 }
2003 };
2004
2005 // 9. The strict equality assertion tests strict equality, as determined by ===.
2006 // assert.strictEqual(actual, expected, message_opt);
2007
2008 assert.strictEqual = function strictEqual(actual, expected, message) {
2009 if (actual !== expected) {
2010 fail(actual, expected, message, '===', assert.strictEqual);
2011 }
2012 };
2013
2014 // 10. The strict non-equality assertion tests for strict inequality, as
2015 // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
2016
2017 assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
2018 if (actual === expected) {
2019 fail(actual, expected, message, '!==', assert.notStrictEqual);
2020 }
2021 };
2022
2023 function expectedException(actual, expected) {
2024 if (!actual || !expected) {
2025 return false;
2026 }
2027
2028 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
2029 return expected.test(actual);
2030 } else if (actual instanceof expected) {
2031 return true;
2032 } else if (expected.call({}, actual) === true) {
2033 return true;
2034 }
2035
2036 return false;
2037 }
2038
2039 function _throws(shouldThrow, block, expected, message) {
2040 var actual;
2041
2042 if (util.isString(expected)) {
2043 message = expected;
2044 expected = null;
2045 }
2046
2047 try {
2048 block();
2049 } catch (e) {
2050 actual = e;
2051 }
2052
2053 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
2054 (message ? ' ' + message : '.');
2055
2056 if (shouldThrow && !actual) {
2057 fail(actual, expected, 'Missing expected exception' + message);
2058 }
2059
2060 if (!shouldThrow && expectedException(actual, expected)) {
2061 fail(actual, expected, 'Got unwanted exception' + message);
2062 }
2063
2064 if ((shouldThrow && actual && expected &&
2065 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
2066 throw actual;
2067 }
2068 }
2069
2070 // 11. Expected to throw an error:
2071 // assert.throws(block, Error_opt, message_opt);
2072
2073 assert.throws = function(block, /*optional*/error, /*optional*/message) {
2074 _throws.apply(this, [true].concat(pSlice.call(arguments)));
2075 };
2076
2077 // EXTENSION! This is annoying to write outside this module.
2078 assert.doesNotThrow = function(block, /*optional*/message) {
2079 _throws.apply(this, [false].concat(pSlice.call(arguments)));
2080 };
2081
2082 assert.ifError = function(err) { if (err) {throw err;}};
2083
2084 var objectKeys = Object.keys || function (obj) {
2085 var keys = [];
2086 for (var key in obj) {
2087 if (hasOwn.call(obj, key)) keys.push(key);
2088 }
2089 return keys;
2090 };
2091
2092 },{"util/":6}],5:[function(_dereq_,module,exports){
2093 module.exports = function isBuffer(arg) {
2094 return arg && typeof arg === 'object'
2095 && typeof arg.copy === 'function'
2096 && typeof arg.fill === 'function'
2097 && typeof arg.readUInt8 === 'function';
2098 }
2099 },{}],6:[function(_dereq_,module,exports){
2100 (function (process,global){
2101 // Copyright Joyent, Inc. and other Node contributors.
2102 //
2103 // Permission is hereby granted, free of charge, to any person obtaining a
2104 // copy of this software and associated documentation files (the
2105 // "Software"), to deal in the Software without restriction, including
2106 // without limitation the rights to use, copy, modify, merge, publish,
2107 // distribute, sublicense, and/or sell copies of the Software, and to permit
2108 // persons to whom the Software is furnished to do so, subject to the
2109 // following conditions:
2110 //
2111 // The above copyright notice and this permission notice shall be included
2112 // in all copies or substantial portions of the Software.
2113 //
2114 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2115 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2116 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2117 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2118 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2119 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2120 // USE OR OTHER DEALINGS IN THE SOFTWARE.
2121
2122 var formatRegExp = /%[sdj%]/g;
2123 exports.format = function(f) {
2124 if (!isString(f)) {
2125 var objects = [];
2126 for (var i = 0; i < arguments.length; i++) {
2127 objects.push(inspect(arguments[i]));
2128 }
2129 return objects.join(' ');
2130 }
2131
2132 var i = 1;
2133 var args = arguments;
2134 var len = args.length;
2135 var str = String(f).replace(formatRegExp, function(x) {
2136 if (x === '%%') return '%';
2137 if (i >= len) return x;
2138 switch (x) {
2139 case '%s': return String(args[i++]);
2140 case '%d': return Number(args[i++]);
2141 case '%j':
2142 try {
2143 return JSON.stringify(args[i++]);
2144 } catch (_) {
2145 return '[Circular]';
2146 }
2147 default:
2148 return x;
2149 }
2150 });
2151 for (var x = args[i]; i < len; x = args[++i]) {
2152 if (isNull(x) || !isObject(x)) {
2153 str += ' ' + x;
2154 } else {
2155 str += ' ' + inspect(x);
2156 }
2157 }
2158 return str;
2159 };
2160
2161
2162 // Mark that a method should not be used.
2163 // Returns a modified function which warns once by default.
2164 // If --no-deprecation is set, then it is a no-op.
2165 exports.deprecate = function(fn, msg) {
2166 // Allow for deprecating things in the process of starting up.
2167 if (isUndefined(global.process)) {
2168 return function() {
2169 return exports.deprecate(fn, msg).apply(this, arguments);
2170 };
2171 }
2172
2173 if (process.noDeprecation === true) {
2174 return fn;
2175 }
2176
2177 var warned = false;
2178 function deprecated() {
2179 if (!warned) {
2180 if (process.throwDeprecation) {
2181 throw new Error(msg);
2182 } else if (process.traceDeprecation) {
2183 console.trace(msg);
2184 } else {
2185 console.error(msg);
2186 }
2187 warned = true;
2188 }
2189 return fn.apply(this, arguments);
2190 }
2191
2192 return deprecated;
2193 };
2194
2195
2196 var debugs = {};
2197 var debugEnviron;
2198 exports.debuglog = function(set) {
2199 if (isUndefined(debugEnviron))
2200 debugEnviron = process.env.NODE_DEBUG || '';
2201 set = set.toUpperCase();
2202 if (!debugs[set]) {
2203 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
2204 var pid = process.pid;
2205 debugs[set] = function() {
2206 var msg = exports.format.apply(exports, arguments);
2207 console.error('%s %d: %s', set, pid, msg);
2208 };
2209 } else {
2210 debugs[set] = function() {};
2211 }
2212 }
2213 return debugs[set];
2214 };
2215
2216
2217 /**
2218 * Echos the value of a value. Trys to print the value out
2219 * in the best way possible given the different types.
2220 *
2221 * @param {Object} obj The object to print out.
2222 * @param {Object} opts Optional options object that alters the output.
2223 */
2224 /* legacy: obj, showHidden, depth, colors*/
2225 function inspect(obj, opts) {
2226 // default options
2227 var ctx = {
2228 seen: [],
2229 stylize: stylizeNoColor
2230 };
2231 // legacy...
2232 if (arguments.length >= 3) ctx.depth = arguments[2];
2233 if (arguments.length >= 4) ctx.colors = arguments[3];
2234 if (isBoolean(opts)) {
2235 // legacy...
2236 ctx.showHidden = opts;
2237 } else if (opts) {
2238 // got an "options" object
2239 exports._extend(ctx, opts);
2240 }
2241 // set default options
2242 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
2243 if (isUndefined(ctx.depth)) ctx.depth = 2;
2244 if (isUndefined(ctx.colors)) ctx.colors = false;
2245 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
2246 if (ctx.colors) ctx.stylize = stylizeWithColor;
2247 return formatValue(ctx, obj, ctx.depth);
2248 }
2249 exports.inspect = inspect;
2250
2251
2252 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
2253 inspect.colors = {
2254 'bold' : [1, 22],
2255 'italic' : [3, 23],
2256 'underline' : [4, 24],
2257 'inverse' : [7, 27],
2258 'white' : [37, 39],
2259 'grey' : [90, 39],
2260 'black' : [30, 39],
2261 'blue' : [34, 39],
2262 'cyan' : [36, 39],
2263 'green' : [32, 39],
2264 'magenta' : [35, 39],
2265 'red' : [31, 39],
2266 'yellow' : [33, 39]
2267 };
2268
2269 // Don't use 'blue' not visible on cmd.exe
2270 inspect.styles = {
2271 'special': 'cyan',
2272 'number': 'yellow',
2273 'boolean': 'yellow',
2274 'undefined': 'grey',
2275 'null': 'bold',
2276 'string': 'green',
2277 'date': 'magenta',
2278 // "name": intentionally not styling
2279 'regexp': 'red'
2280 };
2281
2282
2283 function stylizeWithColor(str, styleType) {
2284 var style = inspect.styles[styleType];
2285
2286 if (style) {
2287 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
2288 '\u001b[' + inspect.colors[style][1] + 'm';
2289 } else {
2290 return str;
2291 }
2292 }
2293
2294
2295 function stylizeNoColor(str, styleType) {
2296 return str;
2297 }
2298
2299
2300 function arrayToHash(array) {
2301 var hash = {};
2302
2303 array.forEach(function(val, idx) {
2304 hash[val] = true;
2305 });
2306
2307 return hash;
2308 }
2309
2310
2311 function formatValue(ctx, value, recurseTimes) {
2312 // Provide a hook for user-specified inspect functions.
2313 // Check that value is an object with an inspect function on it
2314 if (ctx.customInspect &&
2315 value &&
2316 isFunction(value.inspect) &&
2317 // Filter out the util module, it's inspect function is special
2318 value.inspect !== exports.inspect &&
2319 // Also filter out any prototype objects using the circular check.
2320 !(value.constructor && value.constructor.prototype === value)) {
2321 var ret = value.inspect(recurseTimes, ctx);
2322 if (!isString(ret)) {
2323 ret = formatValue(ctx, ret, recurseTimes);
2324 }
2325 return ret;
2326 }
2327
2328 // Primitive types cannot have properties
2329 var primitive = formatPrimitive(ctx, value);
2330 if (primitive) {
2331 return primitive;
2332 }
2333
2334 // Look up the keys of the object.
2335 var keys = Object.keys(value);
2336 var visibleKeys = arrayToHash(keys);
2337
2338 if (ctx.showHidden) {
2339 keys = Object.getOwnPropertyNames(value);
2340 }
2341
2342 // IE doesn't make error fields non-enumerable
2343 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
2344 if (isError(value)
2345 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
2346 return formatError(value);
2347 }
2348
2349 // Some type of object without properties can be shortcutted.
2350 if (keys.length === 0) {
2351 if (isFunction(value)) {
2352 var name = value.name ? ': ' + value.name : '';
2353 return ctx.stylize('[Function' + name + ']', 'special');
2354 }
2355 if (isRegExp(value)) {
2356 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2357 }
2358 if (isDate(value)) {
2359 return ctx.stylize(Date.prototype.toString.call(value), 'date');
2360 }
2361 if (isError(value)) {
2362 return formatError(value);
2363 }
2364 }
2365
2366 var base = '', array = false, braces = ['{', '}'];
2367
2368 // Make Array say that they are Array
2369 if (isArray(value)) {
2370 array = true;
2371 braces = ['[', ']'];
2372 }
2373
2374 // Make functions say that they are functions
2375 if (isFunction(value)) {
2376 var n = value.name ? ': ' + value.name : '';
2377 base = ' [Function' + n + ']';
2378 }
2379
2380 // Make RegExps say that they are RegExps
2381 if (isRegExp(value)) {
2382 base = ' ' + RegExp.prototype.toString.call(value);
2383 }
2384
2385 // Make dates with properties first say the date
2386 if (isDate(value)) {
2387 base = ' ' + Date.prototype.toUTCString.call(value);
2388 }
2389
2390 // Make error with message first say the error
2391 if (isError(value)) {
2392 base = ' ' + formatError(value);
2393 }
2394
2395 if (keys.length === 0 && (!array || value.length == 0)) {
2396 return braces[0] + base + braces[1];
2397 }
2398
2399 if (recurseTimes < 0) {
2400 if (isRegExp(value)) {
2401 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2402 } else {
2403 return ctx.stylize('[Object]', 'special');
2404 }
2405 }
2406
2407 ctx.seen.push(value);
2408
2409 var output;
2410 if (array) {
2411 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
2412 } else {
2413 output = keys.map(function(key) {
2414 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
2415 });
2416 }
2417
2418 ctx.seen.pop();
2419
2420 return reduceToSingleString(output, base, braces);
2421 }
2422
2423
2424 function formatPrimitive(ctx, value) {
2425 if (isUndefined(value))
2426 return ctx.stylize('undefined', 'undefined');
2427 if (isString(value)) {
2428 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
2429 .replace(/'/g, "\\'")
2430 .replace(/\\"/g, '"') + '\'';
2431 return ctx.stylize(simple, 'string');
2432 }
2433 if (isNumber(value))
2434 return ctx.stylize('' + value, 'number');
2435 if (isBoolean(value))
2436 return ctx.stylize('' + value, 'boolean');
2437 // For some reason typeof null is "object", so special case here.
2438 if (isNull(value))
2439 return ctx.stylize('null', 'null');
2440 }
2441
2442
2443 function formatError(value) {
2444 return '[' + Error.prototype.toString.call(value) + ']';
2445 }
2446
2447
2448 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
2449 var output = [];
2450 for (var i = 0, l = value.length; i < l; ++i) {
2451 if (hasOwnProperty(value, String(i))) {
2452 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2453 String(i), true));
2454 } else {
2455 output.push('');
2456 }
2457 }
2458 keys.forEach(function(key) {
2459 if (!key.match(/^\d+$/)) {
2460 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2461 key, true));
2462 }
2463 });
2464 return output;
2465 }
2466
2467
2468 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
2469 var name, str, desc;
2470 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
2471 if (desc.get) {
2472 if (desc.set) {
2473 str = ctx.stylize('[Getter/Setter]', 'special');
2474 } else {
2475 str = ctx.stylize('[Getter]', 'special');
2476 }
2477 } else {
2478 if (desc.set) {
2479 str = ctx.stylize('[Setter]', 'special');
2480 }
2481 }
2482 if (!hasOwnProperty(visibleKeys, key)) {
2483 name = '[' + key + ']';
2484 }
2485 if (!str) {
2486 if (ctx.seen.indexOf(desc.value) < 0) {
2487 if (isNull(recurseTimes)) {
2488 str = formatValue(ctx, desc.value, null);
2489 } else {
2490 str = formatValue(ctx, desc.value, recurseTimes - 1);
2491 }
2492 if (str.indexOf('\n') > -1) {
2493 if (array) {
2494 str = str.split('\n').map(function(line) {
2495 return ' ' + line;
2496 }).join('\n').substr(2);
2497 } else {
2498 str = '\n' + str.split('\n').map(function(line) {
2499 return ' ' + line;
2500 }).join('\n');
2501 }
2502 }
2503 } else {
2504 str = ctx.stylize('[Circular]', 'special');
2505 }
2506 }
2507 if (isUndefined(name)) {
2508 if (array && key.match(/^\d+$/)) {
2509 return str;
2510 }
2511 name = JSON.stringify('' + key);
2512 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
2513 name = name.substr(1, name.length - 2);
2514 name = ctx.stylize(name, 'name');
2515 } else {
2516 name = name.replace(/'/g, "\\'")
2517 .replace(/\\"/g, '"')
2518 .replace(/(^"|"$)/g, "'");
2519 name = ctx.stylize(name, 'string');
2520 }
2521 }
2522
2523 return name + ': ' + str;
2524 }
2525
2526
2527 function reduceToSingleString(output, base, braces) {
2528 var numLinesEst = 0;
2529 var length = output.reduce(function(prev, cur) {
2530 numLinesEst++;
2531 if (cur.indexOf('\n') >= 0) numLinesEst++;
2532 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
2533 }, 0);
2534
2535 if (length > 60) {
2536 return braces[0] +
2537 (base === '' ? '' : base + '\n ') +
2538 ' ' +
2539 output.join(',\n ') +
2540 ' ' +
2541 braces[1];
2542 }
2543
2544 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
2545 }
2546
2547
2548 // NOTE: These type checking functions intentionally don't use `instanceof`
2549 // because it is fragile and can be easily faked with `Object.create()`.
2550 function isArray(ar) {
2551 return Array.isArray(ar);
2552 }
2553 exports.isArray = isArray;
2554
2555 function isBoolean(arg) {
2556 return typeof arg === 'boolean';
2557 }
2558 exports.isBoolean = isBoolean;
2559
2560 function isNull(arg) {
2561 return arg === null;
2562 }
2563 exports.isNull = isNull;
2564
2565 function isNullOrUndefined(arg) {
2566 return arg == null;
2567 }
2568 exports.isNullOrUndefined = isNullOrUndefined;
2569
2570 function isNumber(arg) {
2571 return typeof arg === 'number';
2572 }
2573 exports.isNumber = isNumber;
2574
2575 function isString(arg) {
2576 return typeof arg === 'string';
2577 }
2578 exports.isString = isString;
2579
2580 function isSymbol(arg) {
2581 return typeof arg === 'symbol';
2582 }
2583 exports.isSymbol = isSymbol;
2584
2585 function isUndefined(arg) {
2586 return arg === void 0;
2587 }
2588 exports.isUndefined = isUndefined;
2589
2590 function isRegExp(re) {
2591 return isObject(re) && objectToString(re) === '[object RegExp]';
2592 }
2593 exports.isRegExp = isRegExp;
2594
2595 function isObject(arg) {
2596 return typeof arg === 'object' && arg !== null;
2597 }
2598 exports.isObject = isObject;
2599
2600 function isDate(d) {
2601 return isObject(d) && objectToString(d) === '[object Date]';
2602 }
2603 exports.isDate = isDate;
2604
2605 function isError(e) {
2606 return isObject(e) &&
2607 (objectToString(e) === '[object Error]' || e instanceof Error);
2608 }
2609 exports.isError = isError;
2610
2611 function isFunction(arg) {
2612 return typeof arg === 'function';
2613 }
2614 exports.isFunction = isFunction;
2615
2616 function isPrimitive(arg) {
2617 return arg === null ||
2618 typeof arg === 'boolean' ||
2619 typeof arg === 'number' ||
2620 typeof arg === 'string' ||
2621 typeof arg === 'symbol' || // ES6 symbol
2622 typeof arg === 'undefined';
2623 }
2624 exports.isPrimitive = isPrimitive;
2625
2626 exports.isBuffer = _dereq_('./support/isBuffer');
2627
2628 function objectToString(o) {
2629 return Object.prototype.toString.call(o);
2630 }
2631
2632
2633 function pad(n) {
2634 return n < 10 ? '0' + n.toString(10) : n.toString(10);
2635 }
2636
2637
2638 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
2639 'Oct', 'Nov', 'Dec'];
2640
2641 // 26 Feb 16:19:34
2642 function timestamp() {
2643 var d = new Date();
2644 var time = [pad(d.getHours()),
2645 pad(d.getMinutes()),
2646 pad(d.getSeconds())].join(':');
2647 return [d.getDate(), months[d.getMonth()], time].join(' ');
2648 }
2649
2650
2651 // log is just a thin wrapper to console.log that prepends a timestamp
2652 exports.log = function() {
2653 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
2654 };
2655
2656
2657 /**
2658 * Inherit the prototype methods from one constructor into another.
2659 *
2660 * The Function.prototype.inherits from lang.js rewritten as a standalone
2661 * function (not on Function.prototype). NOTE: If this file is to be loaded
2662 * during bootstrapping this function needs to be rewritten using some native
2663 * functions as prototype setup using normal JavaScript does not work as
2664 * expected during bootstrapping (see mirror.js in r114903).
2665 *
2666 * @param {function} ctor Constructor function which needs to inherit the
2667 * prototype.
2668 * @param {function} superCtor Constructor function to inherit prototype from.
2669 */
2670 exports.inherits = _dereq_('inherits');
2671
2672 exports._extend = function(origin, add) {
2673 // Don't do anything if add isn't an object
2674 if (!add || !isObject(add)) return origin;
2675
2676 var keys = Object.keys(add);
2677 var i = keys.length;
2678 while (i--) {
2679 origin[keys[i]] = add[keys[i]];
2680 }
2681 return origin;
2682 };
2683
2684 function hasOwnProperty(obj, prop) {
2685 return Object.prototype.hasOwnProperty.call(obj, prop);
2686 }
2687
2688 }).call(this,_dereq_("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2689 },{"./support/isBuffer":5,"FWaASH":12,"inherits":11}],7:[function(_dereq_,module,exports){
2690
2691 },{}],8:[function(_dereq_,module,exports){
2692 /*!
2693 * The buffer module from node.js, for the browser.
2694 *
2695 * at author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2696 * at license MIT
2697 */
2698
2699 var base64 = _dereq_('base64-js')
2700 var ieee754 = _dereq_('ieee754')
2701
2702 exports.Buffer = Buffer
2703 exports.SlowBuffer = Buffer
2704 exports.INSPECT_MAX_BYTES = 50
2705 Buffer.poolSize = 8192
2706
2707 /**
2708 * If `Buffer._useTypedArrays`:
2709 * === true Use Uint8Array implementation (fastest)
2710 * === false Use Object implementation (compatible down to IE6)
2711 */
2712 Buffer._useTypedArrays = (function () {
2713 // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
2714 // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
2715 // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
2716 // because we need to be able to add all the node Buffer API methods. This is an issue
2717 // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
2718 try {
2719 var buf = new ArrayBuffer(0)
2720 var arr = new Uint8Array(buf)
2721 arr.foo = function () { return 42 }
2722 return 42 === arr.foo() &&
2723 typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray`
2724 } catch (e) {
2725 return false
2726 }
2727 })()
2728
2729 /**
2730 * Class: Buffer
2731 * =============
2732 *
2733 * The Buffer constructor returns instances of `Uint8Array` that are augmented
2734 * with function properties for all the node `Buffer` API functions. We use
2735 * `Uint8Array` so that square bracket notation works as expected -- it returns
2736 * a single octet.
2737 *
2738 * By augmenting the instances, we can avoid modifying the `Uint8Array`
2739 * prototype.
2740 */
2741 function Buffer (subject, encoding, noZero) {
2742 if (!(this instanceof Buffer))
2743 return new Buffer(subject, encoding, noZero)
2744
2745 var type = typeof subject
2746
2747 if (encoding === 'base64' && type === 'string') {
2748 subject = base64clean(subject)
2749 }
2750
2751 // Find the length
2752 var length
2753 if (type === 'number')
2754 length = coerce(subject)
2755 else if (type === 'string')
2756 length = Buffer.byteLength(subject, encoding)
2757 else if (type === 'object')
2758 length = coerce(subject.length) // assume that object is array-like
2759 else
2760 throw new Error('First argument needs to be a number, array or string.')
2761
2762 var buf
2763 if (Buffer._useTypedArrays) {
2764 // Preferred: Return an augmented `Uint8Array` instance for best performance
2765 buf = Buffer._augment(new Uint8Array(length))
2766 } else {
2767 // Fallback: Return THIS instance of Buffer (created by `new`)
2768 buf = this
2769 buf.length = length
2770 buf._isBuffer = true
2771 }
2772
2773 var i
2774 if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') {
2775 // Speed optimization -- use set if we're copying from a typed array
2776 buf._set(subject)
2777 } else if (isArrayish(subject)) {
2778 // Treat array-ish objects as a byte array
2779 if (Buffer.isBuffer(subject)) {
2780 for (i = 0; i < length; i++)
2781 buf[i] = subject.readUInt8(i)
2782 } else {
2783 for (i = 0; i < length; i++)
2784 buf[i] = ((subject[i] % 256) + 256) % 256
2785 }
2786 } else if (type === 'string') {
2787 buf.write(subject, 0, encoding)
2788 } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) {
2789 for (i = 0; i < length; i++) {
2790 buf[i] = 0
2791 }
2792 }
2793
2794 return buf
2795 }
2796
2797 // STATIC METHODS
2798 // ==============
2799
2800 Buffer.isEncoding = function (encoding) {
2801 switch (String(encoding).toLowerCase()) {
2802 case 'hex':
2803 case 'utf8':
2804 case 'utf-8':
2805 case 'ascii':
2806 case 'binary':
2807 case 'base64':
2808 case 'raw':
2809 case 'ucs2':
2810 case 'ucs-2':
2811 case 'utf16le':
2812 case 'utf-16le':
2813 return true
2814 default:
2815 return false
2816 }
2817 }
2818
2819 Buffer.isBuffer = function (b) {
2820 return !!(b !== null && b !== undefined && b._isBuffer)
2821 }
2822
2823 Buffer.byteLength = function (str, encoding) {
2824 var ret
2825 str = str.toString()
2826 switch (encoding || 'utf8') {
2827 case 'hex':
2828 ret = str.length / 2
2829 break
2830 case 'utf8':
2831 case 'utf-8':
2832 ret = utf8ToBytes(str).length
2833 break
2834 case 'ascii':
2835 case 'binary':
2836 case 'raw':
2837 ret = str.length
2838 break
2839 case 'base64':
2840 ret = base64ToBytes(str).length
2841 break
2842 case 'ucs2':
2843 case 'ucs-2':
2844 case 'utf16le':
2845 case 'utf-16le':
2846 ret = str.length * 2
2847 break
2848 default:
2849 throw new Error('Unknown encoding')
2850 }
2851 return ret
2852 }
2853
2854 Buffer.concat = function (list, totalLength) {
2855 assert(isArray(list), 'Usage: Buffer.concat(list[, length])')
2856
2857 if (list.length === 0) {
2858 return new Buffer(0)
2859 } else if (list.length === 1) {
2860 return list[0]
2861 }
2862
2863 var i
2864 if (totalLength === undefined) {
2865 totalLength = 0
2866 for (i = 0; i < list.length; i++) {
2867 totalLength += list[i].length
2868 }
2869 }
2870
2871 var buf = new Buffer(totalLength)
2872 var pos = 0
2873 for (i = 0; i < list.length; i++) {
2874 var item = list[i]
2875 item.copy(buf, pos)
2876 pos += item.length
2877 }
2878 return buf
2879 }
2880
2881 Buffer.compare = function (a, b) {
2882 assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers')
2883 var x = a.length
2884 var y = b.length
2885 for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {}
2886 if (i !== len) {
2887 x = a[i]
2888 y = b[i]
2889 }
2890 if (x < y) {
2891 return -1
2892 }
2893 if (y < x) {
2894 return 1
2895 }
2896 return 0
2897 }
2898
2899 // BUFFER INSTANCE METHODS
2900 // =======================
2901
2902 function hexWrite (buf, string, offset, length) {
2903 offset = Number(offset) || 0
2904 var remaining = buf.length - offset
2905 if (!length) {
2906 length = remaining
2907 } else {
2908 length = Number(length)
2909 if (length > remaining) {
2910 length = remaining
2911 }
2912 }
2913
2914 // must be an even number of digits
2915 var strLen = string.length
2916 assert(strLen % 2 === 0, 'Invalid hex string')
2917
2918 if (length > strLen / 2) {
2919 length = strLen / 2
2920 }
2921 for (var i = 0; i < length; i++) {
2922 var byte = parseInt(string.substr(i * 2, 2), 16)
2923 assert(!isNaN(byte), 'Invalid hex string')
2924 buf[offset + i] = byte
2925 }
2926 return i
2927 }
2928
2929 function utf8Write (buf, string, offset, length) {
2930 var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
2931 return charsWritten
2932 }
2933
2934 function asciiWrite (buf, string, offset, length) {
2935 var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
2936 return charsWritten
2937 }
2938
2939 function binaryWrite (buf, string, offset, length) {
2940 return asciiWrite(buf, string, offset, length)
2941 }
2942
2943 function base64Write (buf, string, offset, length) {
2944 var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
2945 return charsWritten
2946 }
2947
2948 function utf16leWrite (buf, string, offset, length) {
2949 var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
2950 return charsWritten
2951 }
2952
2953 Buffer.prototype.write = function (string, offset, length, encoding) {
2954 // Support both (string, offset, length, encoding)
2955 // and the legacy (string, encoding, offset, length)
2956 if (isFinite(offset)) {
2957 if (!isFinite(length)) {
2958 encoding = length
2959 length = undefined
2960 }
2961 } else { // legacy
2962 var swap = encoding
2963 encoding = offset
2964 offset = length
2965 length = swap
2966 }
2967
2968 offset = Number(offset) || 0
2969 var remaining = this.length - offset
2970 if (!length) {
2971 length = remaining
2972 } else {
2973 length = Number(length)
2974 if (length > remaining) {
2975 length = remaining
2976 }
2977 }
2978 encoding = String(encoding || 'utf8').toLowerCase()
2979
2980 var ret
2981 switch (encoding) {
2982 case 'hex':
2983 ret = hexWrite(this, string, offset, length)
2984 break
2985 case 'utf8':
2986 case 'utf-8':
2987 ret = utf8Write(this, string, offset, length)
2988 break
2989 case 'ascii':
2990 ret = asciiWrite(this, string, offset, length)
2991 break
2992 case 'binary':
2993 ret = binaryWrite(this, string, offset, length)
2994 break
2995 case 'base64':
2996 ret = base64Write(this, string, offset, length)
2997 break
2998 case 'ucs2':
2999 case 'ucs-2':
3000 case 'utf16le':
3001 case 'utf-16le':
3002 ret = utf16leWrite(this, string, offset, length)
3003 break
3004 default:
3005 throw new Error('Unknown encoding')
3006 }
3007 return ret
3008 }
3009
3010 Buffer.prototype.toString = function (encoding, start, end) {
3011 var self = this
3012
3013 encoding = String(encoding || 'utf8').toLowerCase()
3014 start = Number(start) || 0
3015 end = (end === undefined) ? self.length : Number(end)
3016
3017 // Fastpath empty strings
3018 if (end === start)
3019 return ''
3020
3021 var ret
3022 switch (encoding) {
3023 case 'hex':
3024 ret = hexSlice(self, start, end)
3025 break
3026 case 'utf8':
3027 case 'utf-8':
3028 ret = utf8Slice(self, start, end)
3029 break
3030 case 'ascii':
3031 ret = asciiSlice(self, start, end)
3032 break
3033 case 'binary':
3034 ret = binarySlice(self, start, end)
3035 break
3036 case 'base64':
3037 ret = base64Slice(self, start, end)
3038 break
3039 case 'ucs2':
3040 case 'ucs-2':
3041 case 'utf16le':
3042 case 'utf-16le':
3043 ret = utf16leSlice(self, start, end)
3044 break
3045 default:
3046 throw new Error('Unknown encoding')
3047 }
3048 return ret
3049 }
3050
3051 Buffer.prototype.toJSON = function () {
3052 return {
3053 type: 'Buffer',
3054 data: Array.prototype.slice.call(this._arr || this, 0)
3055 }
3056 }
3057
3058 Buffer.prototype.equals = function (b) {
3059 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
3060 return Buffer.compare(this, b) === 0
3061 }
3062
3063 Buffer.prototype.compare = function (b) {
3064 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
3065 return Buffer.compare(this, b)
3066 }
3067
3068 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
3069 Buffer.prototype.copy = function (target, target_start, start, end) {
3070 var source = this
3071
3072 if (!start) start = 0
3073 if (!end && end !== 0) end = this.length
3074 if (!target_start) target_start = 0
3075
3076 // Copy 0 bytes; we're done
3077 if (end === start) return
3078 if (target.length === 0 || source.length === 0) return
3079
3080 // Fatal error conditions
3081 assert(end >= start, 'sourceEnd < sourceStart')
3082 assert(target_start >= 0 && target_start < target.length,
3083 'targetStart out of bounds')
3084 assert(start >= 0 && start < source.length, 'sourceStart out of bounds')
3085 assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds')
3086
3087 // Are we oob?
3088 if (end > this.length)
3089 end = this.length
3090 if (target.length - target_start < end - start)
3091 end = target.length - target_start + start
3092
3093 var len = end - start
3094
3095 if (len < 100 || !Buffer._useTypedArrays) {
3096 for (var i = 0; i < len; i++) {
3097 target[i + target_start] = this[i + start]
3098 }
3099 } else {
3100 target._set(this.subarray(start, start + len), target_start)
3101 }
3102 }
3103
3104 function base64Slice (buf, start, end) {
3105 if (start === 0 && end === buf.length) {
3106 return base64.fromByteArray(buf)
3107 } else {
3108 return base64.fromByteArray(buf.slice(start, end))
3109 }
3110 }
3111
3112 function utf8Slice (buf, start, end) {
3113 var res = ''
3114 var tmp = ''
3115 end = Math.min(buf.length, end)
3116
3117 for (var i = start; i < end; i++) {
3118 if (buf[i] <= 0x7F) {
3119 res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
3120 tmp = ''
3121 } else {
3122 tmp += '%' + buf[i].toString(16)
3123 }
3124 }
3125
3126 return res + decodeUtf8Char(tmp)
3127 }
3128
3129 function asciiSlice (buf, start, end) {
3130 var ret = ''
3131 end = Math.min(buf.length, end)
3132
3133 for (var i = start; i < end; i++) {
3134 ret += String.fromCharCode(buf[i])
3135 }
3136 return ret
3137 }
3138
3139 function binarySlice (buf, start, end) {
3140 return asciiSlice(buf, start, end)
3141 }
3142
3143 function hexSlice (buf, start, end) {
3144 var len = buf.length
3145
3146 if (!start || start < 0) start = 0
3147 if (!end || end < 0 || end > len) end = len
3148
3149 var out = ''
3150 for (var i = start; i < end; i++) {
3151 out += toHex(buf[i])
3152 }
3153 return out
3154 }
3155
3156 function utf16leSlice (buf, start, end) {
3157 var bytes = buf.slice(start, end)
3158 var res = ''
3159 for (var i = 0; i < bytes.length; i += 2) {
3160 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
3161 }
3162 return res
3163 }
3164
3165 Buffer.prototype.slice = function (start, end) {
3166 var len = this.length
3167 start = clamp(start, len, 0)
3168 end = clamp(end, len, len)
3169
3170 if (Buffer._useTypedArrays) {
3171 return Buffer._augment(this.subarray(start, end))
3172 } else {
3173 var sliceLen = end - start
3174 var newBuf = new Buffer(sliceLen, undefined, true)
3175 for (var i = 0; i < sliceLen; i++) {
3176 newBuf[i] = this[i + start]
3177 }
3178 return newBuf
3179 }
3180 }
3181
3182 // `get` will be removed in Node 0.13+
3183 Buffer.prototype.get = function (offset) {
3184 console.log('.get() is deprecated. Access using array indexes instead.')
3185 return this.readUInt8(offset)
3186 }
3187
3188 // `set` will be removed in Node 0.13+
3189 Buffer.prototype.set = function (v, offset) {
3190 console.log('.set() is deprecated. Access using array indexes instead.')
3191 return this.writeUInt8(v, offset)
3192 }
3193
3194 Buffer.prototype.readUInt8 = function (offset, noAssert) {
3195 if (!noAssert) {
3196 assert(offset !== undefined && offset !== null, 'missing offset')
3197 assert(offset < this.length, 'Trying to read beyond buffer length')
3198 }
3199
3200 if (offset >= this.length)
3201 return
3202
3203 return this[offset]
3204 }
3205
3206 function readUInt16 (buf, offset, littleEndian, noAssert) {
3207 if (!noAssert) {
3208 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3209 assert(offset !== undefined && offset !== null, 'missing offset')
3210 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3211 }
3212
3213 var len = buf.length
3214 if (offset >= len)
3215 return
3216
3217 var val
3218 if (littleEndian) {
3219 val = buf[offset]
3220 if (offset + 1 < len)
3221 val |= buf[offset + 1] << 8
3222 } else {
3223 val = buf[offset] << 8
3224 if (offset + 1 < len)
3225 val |= buf[offset + 1]
3226 }
3227 return val
3228 }
3229
3230 Buffer.prototype.readUInt16LE = function (offset, noAssert) {
3231 return readUInt16(this, offset, true, noAssert)
3232 }
3233
3234 Buffer.prototype.readUInt16BE = function (offset, noAssert) {
3235 return readUInt16(this, offset, false, noAssert)
3236 }
3237
3238 function readUInt32 (buf, offset, littleEndian, noAssert) {
3239 if (!noAssert) {
3240 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3241 assert(offset !== undefined && offset !== null, 'missing offset')
3242 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3243 }
3244
3245 var len = buf.length
3246 if (offset >= len)
3247 return
3248
3249 var val
3250 if (littleEndian) {
3251 if (offset + 2 < len)
3252 val = buf[offset + 2] << 16
3253 if (offset + 1 < len)
3254 val |= buf[offset + 1] << 8
3255 val |= buf[offset]
3256 if (offset + 3 < len)
3257 val = val + (buf[offset + 3] << 24 >>> 0)
3258 } else {
3259 if (offset + 1 < len)
3260 val = buf[offset + 1] << 16
3261 if (offset + 2 < len)
3262 val |= buf[offset + 2] << 8
3263 if (offset + 3 < len)
3264 val |= buf[offset + 3]
3265 val = val + (buf[offset] << 24 >>> 0)
3266 }
3267 return val
3268 }
3269
3270 Buffer.prototype.readUInt32LE = function (offset, noAssert) {
3271 return readUInt32(this, offset, true, noAssert)
3272 }
3273
3274 Buffer.prototype.readUInt32BE = function (offset, noAssert) {
3275 return readUInt32(this, offset, false, noAssert)
3276 }
3277
3278 Buffer.prototype.readInt8 = function (offset, noAssert) {
3279 if (!noAssert) {
3280 assert(offset !== undefined && offset !== null,
3281 'missing offset')
3282 assert(offset < this.length, 'Trying to read beyond buffer length')
3283 }
3284
3285 if (offset >= this.length)
3286 return
3287
3288 var neg = this[offset] & 0x80
3289 if (neg)
3290 return (0xff - this[offset] + 1) * -1
3291 else
3292 return this[offset]
3293 }
3294
3295 function readInt16 (buf, offset, littleEndian, noAssert) {
3296 if (!noAssert) {
3297 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3298 assert(offset !== undefined && offset !== null, 'missing offset')
3299 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3300 }
3301
3302 var len = buf.length
3303 if (offset >= len)
3304 return
3305
3306 var val = readUInt16(buf, offset, littleEndian, true)
3307 var neg = val & 0x8000
3308 if (neg)
3309 return (0xffff - val + 1) * -1
3310 else
3311 return val
3312 }
3313
3314 Buffer.prototype.readInt16LE = function (offset, noAssert) {
3315 return readInt16(this, offset, true, noAssert)
3316 }
3317
3318 Buffer.prototype.readInt16BE = function (offset, noAssert) {
3319 return readInt16(this, offset, false, noAssert)
3320 }
3321
3322 function readInt32 (buf, offset, littleEndian, noAssert) {
3323 if (!noAssert) {
3324 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3325 assert(offset !== undefined && offset !== null, 'missing offset')
3326 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3327 }
3328
3329 var len = buf.length
3330 if (offset >= len)
3331 return
3332
3333 var val = readUInt32(buf, offset, littleEndian, true)
3334 var neg = val & 0x80000000
3335 if (neg)
3336 return (0xffffffff - val + 1) * -1
3337 else
3338 return val
3339 }
3340
3341 Buffer.prototype.readInt32LE = function (offset, noAssert) {
3342 return readInt32(this, offset, true, noAssert)
3343 }
3344
3345 Buffer.prototype.readInt32BE = function (offset, noAssert) {
3346 return readInt32(this, offset, false, noAssert)
3347 }
3348
3349 function readFloat (buf, offset, littleEndian, noAssert) {
3350 if (!noAssert) {
3351 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3352 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3353 }
3354
3355 return ieee754.read(buf, offset, littleEndian, 23, 4)
3356 }
3357
3358 Buffer.prototype.readFloatLE = function (offset, noAssert) {
3359 return readFloat(this, offset, true, noAssert)
3360 }
3361
3362 Buffer.prototype.readFloatBE = function (offset, noAssert) {
3363 return readFloat(this, offset, false, noAssert)
3364 }
3365
3366 function readDouble (buf, offset, littleEndian, noAssert) {
3367 if (!noAssert) {
3368 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3369 assert(offset + 7 < buf.length, 'Trying to read beyond buffer length')
3370 }
3371
3372 return ieee754.read(buf, offset, littleEndian, 52, 8)
3373 }
3374
3375 Buffer.prototype.readDoubleLE = function (offset, noAssert) {
3376 return readDouble(this, offset, true, noAssert)
3377 }
3378
3379 Buffer.prototype.readDoubleBE = function (offset, noAssert) {
3380 return readDouble(this, offset, false, noAssert)
3381 }
3382
3383 Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
3384 if (!noAssert) {
3385 assert(value !== undefined && value !== null, 'missing value')
3386 assert(offset !== undefined && offset !== null, 'missing offset')
3387 assert(offset < this.length, 'trying to write beyond buffer length')
3388 verifuint(value, 0xff)
3389 }
3390
3391 if (offset >= this.length) return
3392
3393 this[offset] = value
3394 return offset + 1
3395 }
3396
3397 function writeUInt16 (buf, value, offset, littleEndian, noAssert) {
3398 if (!noAssert) {
3399 assert(value !== undefined && value !== null, 'missing value')
3400 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3401 assert(offset !== undefined && offset !== null, 'missing offset')
3402 assert(offset + 1 < buf.length, 'trying to write beyond buffer length')
3403 verifuint(value, 0xffff)
3404 }
3405
3406 var len = buf.length
3407 if (offset >= len)
3408 return
3409
3410 for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) {
3411 buf[offset + i] =
3412 (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
3413 (littleEndian ? i : 1 - i) * 8
3414 }
3415 return offset + 2
3416 }
3417
3418 Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) {
3419 return writeUInt16(this, value, offset, true, noAssert)
3420 }
3421
3422 Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) {
3423 return writeUInt16(this, value, offset, false, noAssert)
3424 }
3425
3426 function writeUInt32 (buf, value, offset, littleEndian, noAssert) {
3427 if (!noAssert) {
3428 assert(value !== undefined && value !== null, 'missing value')
3429 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3430 assert(offset !== undefined && offset !== null, 'missing offset')
3431 assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
3432 verifuint(value, 0xffffffff)
3433 }
3434
3435 var len = buf.length
3436 if (offset >= len)
3437 return
3438
3439 for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) {
3440 buf[offset + i] =
3441 (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
3442 }
3443 return offset + 4
3444 }
3445
3446 Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
3447 return writeUInt32(this, value, offset, true, noAssert)
3448 }
3449
3450 Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
3451 return writeUInt32(this, value, offset, false, noAssert)
3452 }
3453
3454 Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
3455 if (!noAssert) {
3456 assert(value !== undefined && value !== null, 'missing value')
3457 assert(offset !== undefined && offset !== null, 'missing offset')
3458 assert(offset < this.length, 'Trying to write beyond buffer length')
3459 verifsint(value, 0x7f, -0x80)
3460 }
3461
3462 if (offset >= this.length)
3463 return
3464
3465 if (value >= 0)
3466 this.writeUInt8(value, offset, noAssert)
3467 else
3468 this.writeUInt8(0xff + value + 1, offset, noAssert)
3469 return offset + 1
3470 }
3471
3472 function writeInt16 (buf, value, offset, littleEndian, noAssert) {
3473 if (!noAssert) {
3474 assert(value !== undefined && value !== null, 'missing value')
3475 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3476 assert(offset !== undefined && offset !== null, 'missing offset')
3477 assert(offset + 1 < buf.length, 'Trying to write beyond buffer length')
3478 verifsint(value, 0x7fff, -0x8000)
3479 }
3480
3481 var len = buf.length
3482 if (offset >= len)
3483 return
3484
3485 if (value >= 0)
3486 writeUInt16(buf, value, offset, littleEndian, noAssert)
3487 else
3488 writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert)
3489 return offset + 2
3490 }
3491
3492 Buffer.prototype.writeInt16LE = function (value, offset, noAssert) {
3493 return writeInt16(this, value, offset, true, noAssert)
3494 }
3495
3496 Buffer.prototype.writeInt16BE = function (value, offset, noAssert) {
3497 return writeInt16(this, value, offset, false, noAssert)
3498 }
3499
3500 function writeInt32 (buf, value, offset, littleEndian, noAssert) {
3501 if (!noAssert) {
3502 assert(value !== undefined && value !== null, 'missing value')
3503 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3504 assert(offset !== undefined && offset !== null, 'missing offset')
3505 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3506 verifsint(value, 0x7fffffff, -0x80000000)
3507 }
3508
3509 var len = buf.length
3510 if (offset >= len)
3511 return
3512
3513 if (value >= 0)
3514 writeUInt32(buf, value, offset, littleEndian, noAssert)
3515 else
3516 writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert)
3517 return offset + 4
3518 }
3519
3520 Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
3521 return writeInt32(this, value, offset, true, noAssert)
3522 }
3523
3524 Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
3525 return writeInt32(this, value, offset, false, noAssert)
3526 }
3527
3528 function writeFloat (buf, value, offset, littleEndian, noAssert) {
3529 if (!noAssert) {
3530 assert(value !== undefined && value !== null, 'missing value')
3531 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3532 assert(offset !== undefined && offset !== null, 'missing offset')
3533 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3534 verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38)
3535 }
3536
3537 var len = buf.length
3538 if (offset >= len)
3539 return
3540
3541 ieee754.write(buf, value, offset, littleEndian, 23, 4)
3542 return offset + 4
3543 }
3544
3545 Buffer.prototype.writeFloatLE = function (value, offset, noAssert) {
3546 return writeFloat(this, value, offset, true, noAssert)
3547 }
3548
3549 Buffer.prototype.writeFloatBE = function (value, offset, noAssert) {
3550 return writeFloat(this, value, offset, false, noAssert)
3551 }
3552
3553 function writeDouble (buf, value, offset, littleEndian, noAssert) {
3554 if (!noAssert) {
3555 assert(value !== undefined && value !== null, 'missing value')
3556 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3557 assert(offset !== undefined && offset !== null, 'missing offset')
3558 assert(offset + 7 < buf.length,
3559 'Trying to write beyond buffer length')
3560 verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308)
3561 }
3562
3563 var len = buf.length
3564 if (offset >= len)
3565 return
3566
3567 ieee754.write(buf, value, offset, littleEndian, 52, 8)
3568 return offset + 8
3569 }
3570
3571 Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) {
3572 return writeDouble(this, value, offset, true, noAssert)
3573 }
3574
3575 Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) {
3576 return writeDouble(this, value, offset, false, noAssert)
3577 }
3578
3579 // fill(value, start=0, end=buffer.length)
3580 Buffer.prototype.fill = function (value, start, end) {
3581 if (!value) value = 0
3582 if (!start) start = 0
3583 if (!end) end = this.length
3584
3585 assert(end >= start, 'end < start')
3586
3587 // Fill 0 bytes; we're done
3588 if (end === start) return
3589 if (this.length === 0) return
3590
3591 assert(start >= 0 && start < this.length, 'start out of bounds')
3592 assert(end >= 0 && end <= this.length, 'end out of bounds')
3593
3594 var i
3595 if (typeof value === 'number') {
3596 for (i = start; i < end; i++) {
3597 this[i] = value
3598 }
3599 } else {
3600 var bytes = utf8ToBytes(value.toString())
3601 var len = bytes.length
3602 for (i = start; i < end; i++) {
3603 this[i] = bytes[i % len]
3604 }
3605 }
3606
3607 return this
3608 }
3609
3610 Buffer.prototype.inspect = function () {
3611 var out = []
3612 var len = this.length
3613 for (var i = 0; i < len; i++) {
3614 out[i] = toHex(this[i])
3615 if (i === exports.INSPECT_MAX_BYTES) {
3616 out[i + 1] = '...'
3617 break
3618 }
3619 }
3620 return '<Buffer ' + out.join(' ') + '>'
3621 }
3622
3623 /**
3624 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
3625 * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
3626 */
3627 Buffer.prototype.toArrayBuffer = function () {
3628 if (typeof Uint8Array !== 'undefined') {
3629 if (Buffer._useTypedArrays) {
3630 return (new Buffer(this)).buffer
3631 } else {
3632 var buf = new Uint8Array(this.length)
3633 for (var i = 0, len = buf.length; i < len; i += 1) {
3634 buf[i] = this[i]
3635 }
3636 return buf.buffer
3637 }
3638 } else {
3639 throw new Error('Buffer.toArrayBuffer not supported in this browser')
3640 }
3641 }
3642
3643 // HELPER FUNCTIONS
3644 // ================
3645
3646 var BP = Buffer.prototype
3647
3648 /**
3649 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
3650 */
3651 Buffer._augment = function (arr) {
3652 arr._isBuffer = true
3653
3654 // save reference to original Uint8Array get/set methods before overwriting
3655 arr._get = arr.get
3656 arr._set = arr.set
3657
3658 // deprecated, will be removed in node 0.13+
3659 arr.get = BP.get
3660 arr.set = BP.set
3661
3662 arr.write = BP.write
3663 arr.toString = BP.toString
3664 arr.toLocaleString = BP.toString
3665 arr.toJSON = BP.toJSON
3666 arr.equals = BP.equals
3667 arr.compare = BP.compare
3668 arr.copy = BP.copy
3669 arr.slice = BP.slice
3670 arr.readUInt8 = BP.readUInt8
3671 arr.readUInt16LE = BP.readUInt16LE
3672 arr.readUInt16BE = BP.readUInt16BE
3673 arr.readUInt32LE = BP.readUInt32LE
3674 arr.readUInt32BE = BP.readUInt32BE
3675 arr.readInt8 = BP.readInt8
3676 arr.readInt16LE = BP.readInt16LE
3677 arr.readInt16BE = BP.readInt16BE
3678 arr.readInt32LE = BP.readInt32LE
3679 arr.readInt32BE = BP.readInt32BE
3680 arr.readFloatLE = BP.readFloatLE
3681 arr.readFloatBE = BP.readFloatBE
3682 arr.readDoubleLE = BP.readDoubleLE
3683 arr.readDoubleBE = BP.readDoubleBE
3684 arr.writeUInt8 = BP.writeUInt8
3685 arr.writeUInt16LE = BP.writeUInt16LE
3686 arr.writeUInt16BE = BP.writeUInt16BE
3687 arr.writeUInt32LE = BP.writeUInt32LE
3688 arr.writeUInt32BE = BP.writeUInt32BE
3689 arr.writeInt8 = BP.writeInt8
3690 arr.writeInt16LE = BP.writeInt16LE
3691 arr.writeInt16BE = BP.writeInt16BE
3692 arr.writeInt32LE = BP.writeInt32LE
3693 arr.writeInt32BE = BP.writeInt32BE
3694 arr.writeFloatLE = BP.writeFloatLE
3695 arr.writeFloatBE = BP.writeFloatBE
3696 arr.writeDoubleLE = BP.writeDoubleLE
3697 arr.writeDoubleBE = BP.writeDoubleBE
3698 arr.fill = BP.fill
3699 arr.inspect = BP.inspect
3700 arr.toArrayBuffer = BP.toArrayBuffer
3701
3702 return arr
3703 }
3704
3705 var INVALID_BASE64_RE = /[^+\/0-9A-z]/g
3706
3707 function base64clean (str) {
3708 // Node strips out invalid characters like \n and \t from the string, base64-js does not
3709 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
3710 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
3711 while (str.length % 4 !== 0) {
3712 str = str + '='
3713 }
3714 return str
3715 }
3716
3717 function stringtrim (str) {
3718 if (str.trim) return str.trim()
3719 return str.replace(/^\s+|\s+$/g, '')
3720 }
3721
3722 // slice(start, end)
3723 function clamp (index, len, defaultValue) {
3724 if (typeof index !== 'number') return defaultValue
3725 index = ~~index; // Coerce to integer.
3726 if (index >= len) return len
3727 if (index >= 0) return index
3728 index += len
3729 if (index >= 0) return index
3730 return 0
3731 }
3732
3733 function coerce (length) {
3734 // Coerce length to a number (possibly NaN), round up
3735 // in case it's fractional (e.g. 123.456) then do a
3736 // double negate to coerce a NaN to 0. Easy, right?
3737 length = ~~Math.ceil(+length)
3738 return length < 0 ? 0 : length
3739 }
3740
3741 function isArray (subject) {
3742 return (Array.isArray || function (subject) {
3743 return Object.prototype.toString.call(subject) === '[object Array]'
3744 })(subject)
3745 }
3746
3747 function isArrayish (subject) {
3748 return isArray(subject) || Buffer.isBuffer(subject) ||
3749 subject && typeof subject === 'object' &&
3750 typeof subject.length === 'number'
3751 }
3752
3753 function toHex (n) {
3754 if (n < 16) return '0' + n.toString(16)
3755 return n.toString(16)
3756 }
3757
3758 function utf8ToBytes (str) {
3759 var byteArray = []
3760 for (var i = 0; i < str.length; i++) {
3761 var b = str.charCodeAt(i)
3762 if (b <= 0x7F) {
3763 byteArray.push(b)
3764 } else {
3765 var start = i
3766 if (b >= 0xD800 && b <= 0xDFFF) i++
3767 var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%')
3768 for (var j = 0; j < h.length; j++) {
3769 byteArray.push(parseInt(h[j], 16))
3770 }
3771 }
3772 }
3773 return byteArray
3774 }
3775
3776 function asciiToBytes (str) {
3777 var byteArray = []
3778 for (var i = 0; i < str.length; i++) {
3779 // Node's code seems to be doing this and not & 0x7F..
3780 byteArray.push(str.charCodeAt(i) & 0xFF)
3781 }
3782 return byteArray
3783 }
3784
3785 function utf16leToBytes (str) {
3786 var c, hi, lo
3787 var byteArray = []
3788 for (var i = 0; i < str.length; i++) {
3789 c = str.charCodeAt(i)
3790 hi = c >> 8
3791 lo = c % 256
3792 byteArray.push(lo)
3793 byteArray.push(hi)
3794 }
3795
3796 return byteArray
3797 }
3798
3799 function base64ToBytes (str) {
3800 return base64.toByteArray(str)
3801 }
3802
3803 function blitBuffer (src, dst, offset, length) {
3804 for (var i = 0; i < length; i++) {
3805 if ((i + offset >= dst.length) || (i >= src.length))
3806 break
3807 dst[i + offset] = src[i]
3808 }
3809 return i
3810 }
3811
3812 function decodeUtf8Char (str) {
3813 try {
3814 return decodeURIComponent(str)
3815 } catch (err) {
3816 return String.fromCharCode(0xFFFD) // UTF 8 invalid char
3817 }
3818 }
3819
3820 /*
3821 * We have to make sure that the value is a valid integer. This means that it
3822 * is non-negative. It has no fractional component and that it does not
3823 * exceed the maximum allowed value.
3824 */
3825 function verifuint (value, max) {
3826 assert(typeof value === 'number', 'cannot write a non-number as a number')
3827 assert(value >= 0, 'specified a negative value for writing an unsigned value')
3828 assert(value <= max, 'value is larger than maximum value for type')
3829 assert(Math.floor(value) === value, 'value has a fractional component')
3830 }
3831
3832 function verifsint (value, max, min) {
3833 assert(typeof value === 'number', 'cannot write a non-number as a number')
3834 assert(value <= max, 'value larger than maximum allowed value')
3835 assert(value >= min, 'value smaller than minimum allowed value')
3836 assert(Math.floor(value) === value, 'value has a fractional component')
3837 }
3838
3839 function verifIEEE754 (value, max, min) {
3840 assert(typeof value === 'number', 'cannot write a non-number as a number')
3841 assert(value <= max, 'value larger than maximum allowed value')
3842 assert(value >= min, 'value smaller than minimum allowed value')
3843 }
3844
3845 function assert (test, message) {
3846 if (!test) throw new Error(message || 'Failed assertion')
3847 }
3848
3849 },{"base64-js":9,"ieee754":10}],9:[function(_dereq_,module,exports){
3850 var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
3851
3852 ;(function (exports) {
3853 'use strict';
3854
3855 var Arr = (typeof Uint8Array !== 'undefined')
3856 ? Uint8Array
3857 : Array
3858
3859 var PLUS = '+'.charCodeAt(0)
3860 var SLASH = '/'.charCodeAt(0)
3861 var NUMBER = '0'.charCodeAt(0)
3862 var LOWER = 'a'.charCodeAt(0)
3863 var UPPER = 'A'.charCodeAt(0)
3864
3865 function decode (elt) {
3866 var code = elt.charCodeAt(0)
3867 if (code === PLUS)
3868 return 62 // '+'
3869 if (code === SLASH)
3870 return 63 // '/'
3871 if (code < NUMBER)
3872 return -1 //no match
3873 if (code < NUMBER + 10)
3874 return code - NUMBER + 26 + 26
3875 if (code < UPPER + 26)
3876 return code - UPPER
3877 if (code < LOWER + 26)
3878 return code - LOWER + 26
3879 }
3880
3881 function b64ToByteArray (b64) {
3882 var i, j, l, tmp, placeHolders, arr
3883
3884 if (b64.length % 4 > 0) {
3885 throw new Error('Invalid string. Length must be a multiple of 4')
3886 }
3887
3888 // the number of equal signs (place holders)
3889 // if there are two placeholders, than the two characters before it
3890 // represent one byte
3891 // if there is only one, then the three characters before it represent 2 bytes
3892 // this is just a cheap hack to not do indexOf twice
3893 var len = b64.length
3894 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
3895
3896 // base64 is 4/3 + up to two characters of the original data
3897 arr = new Arr(b64.length * 3 / 4 - placeHolders)
3898
3899 // if there are placeholders, only get up to the last complete 4 chars
3900 l = placeHolders > 0 ? b64.length - 4 : b64.length
3901
3902 var L = 0
3903
3904 function push (v) {
3905 arr[L++] = v
3906 }
3907
3908 for (i = 0, j = 0; i < l; i += 4, j += 3) {
3909 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
3910 push((tmp & 0xFF0000) >> 16)
3911 push((tmp & 0xFF00) >> 8)
3912 push(tmp & 0xFF)
3913 }
3914
3915 if (placeHolders === 2) {
3916 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
3917 push(tmp & 0xFF)
3918 } else if (placeHolders === 1) {
3919 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
3920 push((tmp >> 8) & 0xFF)
3921 push(tmp & 0xFF)
3922 }
3923
3924 return arr
3925 }
3926
3927 function uint8ToBase64 (uint8) {
3928 var i,
3929 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
3930 output = "",
3931 temp, length
3932
3933 function encode (num) {
3934 return lookup.charAt(num)
3935 }
3936
3937 function tripletToBase64 (num) {
3938 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
3939 }
3940
3941 // go through the array every three bytes, we'll deal with trailing stuff later
3942 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
3943 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
3944 output += tripletToBase64(temp)
3945 }
3946
3947 // pad the end with zeros, but make sure to not forget the extra bytes
3948 switch (extraBytes) {
3949 case 1:
3950 temp = uint8[uint8.length - 1]
3951 output += encode(temp >> 2)
3952 output += encode((temp << 4) & 0x3F)
3953 output += '=='
3954 break
3955 case 2:
3956 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
3957 output += encode(temp >> 10)
3958 output += encode((temp >> 4) & 0x3F)
3959 output += encode((temp << 2) & 0x3F)
3960 output += '='
3961 break
3962 }
3963
3964 return output
3965 }
3966
3967 exports.toByteArray = b64ToByteArray
3968 exports.fromByteArray = uint8ToBase64
3969 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
3970
3971 },{}],10:[function(_dereq_,module,exports){
3972 exports.read = function(buffer, offset, isLE, mLen, nBytes) {
3973 var e, m,
3974 eLen = nBytes * 8 - mLen - 1,
3975 eMax = (1 << eLen) - 1,
3976 eBias = eMax >> 1,
3977 nBits = -7,
3978 i = isLE ? (nBytes - 1) : 0,
3979 d = isLE ? -1 : 1,
3980 s = buffer[offset + i];
3981
3982 i += d;
3983
3984 e = s & ((1 << (-nBits)) - 1);
3985 s >>= (-nBits);
3986 nBits += eLen;
3987 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8){};
3988
3989 m = e & ((1 << (-nBits)) - 1);
3990 e >>= (-nBits);
3991 nBits += mLen;
3992 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8){};
3993
3994 if (e === 0) {
3995 e = 1 - eBias;
3996 } else if (e === eMax) {
3997 return m ? NaN : ((s ? -1 : 1) * Infinity);
3998 } else {
3999 m = m + Math.pow(2, mLen);
4000 e = e - eBias;
4001 }
4002 return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
4003 };
4004
4005 exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
4006 var e, m, c,
4007 eLen = nBytes * 8 - mLen - 1,
4008 eMax = (1 << eLen) - 1,
4009 eBias = eMax >> 1,
4010 rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
4011 i = isLE ? 0 : (nBytes - 1),
4012 d = isLE ? 1 : -1,
4013 s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
4014
4015 value = Math.abs(value);
4016
4017 if (isNaN(value) || value === Infinity) {
4018 m = isNaN(value) ? 1 : 0;
4019 e = eMax;
4020 } else {
4021 e = Math.floor(Math.log(value) / Math.LN2);
4022 if (value * (c = Math.pow(2, -e)) < 1) {
4023 e--;
4024 c *= 2;
4025 }
4026 if (e + eBias >= 1) {
4027 value += rt / c;
4028 } else {
4029 value += rt * Math.pow(2, 1 - eBias);
4030 }
4031 if (value * c >= 2) {
4032 e++;
4033 c /= 2;
4034 }
4035
4036 if (e + eBias >= eMax) {
4037 m = 0;
4038 e = eMax;
4039 } else if (e + eBias >= 1) {
4040 m = (value * c - 1) * Math.pow(2, mLen);
4041 e = e + eBias;
4042 } else {
4043 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
4044 e = 0;
4045 }
4046 }
4047
4048 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8){};
4049
4050 e = (e << mLen) | m;
4051 eLen += mLen;
4052 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8){};
4053
4054 buffer[offset + i - d] |= s * 128;
4055 };
4056
4057 },{}],11:[function(_dereq_,module,exports){
4058 if (typeof Object.create === 'function') {
4059 // implementation from standard node.js 'util' module
4060 module.exports = function inherits(ctor, superCtor) {
4061 ctor.super_ = superCtor
4062 ctor.prototype = Object.create(superCtor.prototype, {
4063 constructor: {
4064 value: ctor,
4065 enumerable: false,
4066 writable: true,
4067 configurable: true
4068 }
4069 });
4070 };
4071 } else {
4072 // old school shim for old browsers
4073 module.exports = function inherits(ctor, superCtor) {
4074 ctor.super_ = superCtor
4075 var TempCtor = function () {}
4076 TempCtor.prototype = superCtor.prototype
4077 ctor.prototype = new TempCtor()
4078 ctor.prototype.constructor = ctor
4079 }
4080 }
4081
4082 },{}],12:[function(_dereq_,module,exports){
4083 // shim for using process in browser
4084
4085 var process = module.exports = {};
4086
4087 process.nextTick = (function () {
4088 var canSetImmediate = typeof window !== 'undefined'
4089 && window.setImmediate;
4090 var canPost = typeof window !== 'undefined'
4091 && window.postMessage && window.addEventListener
4092 ;
4093
4094 if (canSetImmediate) {
4095 return function (f) { return window.setImmediate(f) };
4096 }
4097
4098 if (canPost) {
4099 var queue = [];
4100 window.addEventListener('message', function (ev) {
4101 var source = ev.source;
4102 if ((source === window || source === null) && ev.data === 'process-tick') {
4103 ev.stopPropagation();
4104 if (queue.length > 0) {
4105 var fn = queue.shift();
4106 fn();
4107 }
4108 }
4109 }, true);
4110
4111 return function nextTick(fn) {
4112 queue.push(fn);
4113 window.postMessage('process-tick', '*');
4114 };
4115 }
4116
4117 return function nextTick(fn) {
4118 setTimeout(fn, 0);
4119 };
4120 })();
4121
4122 process.title = 'browser';
4123 process.browser = true;
4124 process.env = {};
4125 process.argv = [];
4126
4127 function noop() {}
4128
4129 process.on = noop;
4130 process.addListener = noop;
4131 process.once = noop;
4132 process.off = noop;
4133 process.removeListener = noop;
4134 process.removeAllListeners = noop;
4135 process.emit = noop;
4136
4137 process.binding = function (name) {
4138 throw new Error('process.binding is not supported');
4139 }
4140
4141 // TODO(shtylman)
4142 process.cwd = function () { return '/' };
4143 process.chdir = function (dir) {
4144 throw new Error('process.chdir is not supported');
4145 };
4146
4147 },{}],13:[function(_dereq_,module,exports){
4148 module.exports=_dereq_(5)
4149 },{}],14:[function(_dereq_,module,exports){
4150 module.exports=_dereq_(6)
4151 },{"./support/isBuffer":13,"FWaASH":12,"inherits":11}],15:[function(_dereq_,module,exports){
4152 (function (Buffer){
4153 // Base58 encoding/decoding
4154 // Originally written by Mike Hearn for BitcoinJ
4155 // Copyright (c) 2011 Google Inc
4156 // Ported to JavaScript by Stefan Thomas
4157 // Merged Buffer refactorings from base58-native by Stephen Pair
4158 // Copyright (c) 2013 BitPay Inc
4159
4160 var assert = _dereq_('assert')
4161 var BigInteger = _dereq_('bigi')
4162
4163 var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
4164 var ALPHABET_BUF = new Buffer(ALPHABET, 'ascii')
4165 var ALPHABET_MAP = {}
4166 for(var i = 0; i < ALPHABET.length; i++) {
4167 ALPHABET_MAP[ALPHABET.charAt(i)] = BigInteger.valueOf(i)
4168 }
4169 var BASE = new BigInteger('58')
4170
4171 function encode(buffer) {
4172 var bi = BigInteger.fromBuffer(buffer)
4173 var result = new Buffer(buffer.length << 1)
4174
4175 var i = result.length - 1
4176 while (bi.signum() > 0) {
4177 var remainder = bi.mod(BASE)
4178 bi = bi.divide(BASE)
4179
4180 result[i] = ALPHABET_BUF[remainder.intValue()]
4181 i--
4182 }
4183
4184 // deal with leading zeros
4185 var j = 0
4186 while (buffer[j] === 0) {
4187 result[i] = ALPHABET_BUF[0]
4188 j++
4189 i--
4190 }
4191
4192 return result.slice(i + 1, result.length).toString('ascii')
4193 }
4194
4195 function decode(string) {
4196 if (string.length === 0) return new Buffer(0)
4197
4198 var num = BigInteger.ZERO
4199
4200 for (var i = 0; i < string.length; i++) {
4201 num = num.multiply(BASE)
4202
4203 var figure = ALPHABET_MAP[string.charAt(i)]
4204 assert.notEqual(figure, undefined, 'Non-base58 character')
4205
4206 num = num.add(figure)
4207 }
4208
4209 // deal with leading zeros
4210 var j = 0
4211 while ((j < string.length) && (string[j] === ALPHABET[0])) {
4212 j++
4213 }
4214
4215 var buffer = num.toBuffer()
4216 var leadingZeros = new Buffer(j)
4217 leadingZeros.fill(0)
4218
4219 return Buffer.concat([leadingZeros, buffer])
4220 }
4221
4222 module.exports = {
4223 encode: encode,
4224 decode: decode
4225 }
4226
4227 }).call(this,_dereq_("buffer").Buffer)
4228 },{"assert":4,"bigi":3,"buffer":8}],16:[function(_dereq_,module,exports){
4229 (function (Buffer){
4230 var createHash = _dereq_('sha.js')
4231
4232 var md5 = toConstructor(_dereq_('./md5'))
4233 var rmd160 = toConstructor(_dereq_('ripemd160'))
4234
4235 function toConstructor (fn) {
4236 return function () {
4237 var buffers = []
4238 var m= {
4239 update: function (data, enc) {
4240 if(!Buffer.isBuffer(data)) data = new Buffer(data, enc)
4241 buffers.push(data)
4242 return this
4243 },
4244 digest: function (enc) {
4245 var buf = Buffer.concat(buffers)
4246 var r = fn(buf)
4247 buffers = null
4248 return enc ? r.toString(enc) : r
4249 }
4250 }
4251 return m
4252 }
4253 }
4254
4255 module.exports = function (alg) {
4256 if('md5' === alg) return new md5()
4257 if('rmd160' === alg) return new rmd160()
4258 return createHash(alg)
4259 }
4260
4261 }).call(this,_dereq_("buffer").Buffer)
4262 },{"./md5":20,"buffer":8,"ripemd160":21,"sha.js":23}],17:[function(_dereq_,module,exports){
4263 (function (Buffer){
4264 var createHash = _dereq_('./create-hash')
4265
4266 var blocksize = 64
4267 var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
4268
4269 module.exports = Hmac
4270
4271 function Hmac (alg, key) {
4272 if(!(this instanceof Hmac)) return new Hmac(alg, key)
4273 this._opad = opad
4274 this._alg = alg
4275
4276 key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key
4277
4278 if(key.length > blocksize) {
4279 key = createHash(alg).update(key).digest()
4280 } else if(key.length < blocksize) {
4281 key = Buffer.concat([key, zeroBuffer], blocksize)
4282 }
4283
4284 var ipad = this._ipad = new Buffer(blocksize)
4285 var opad = this._opad = new Buffer(blocksize)
4286
4287 for(var i = 0; i < blocksize; i++) {
4288 ipad[i] = key[i] ^ 0x36
4289 opad[i] = key[i] ^ 0x5C
4290 }
4291
4292 this._hash = createHash(alg).update(ipad)
4293 }
4294
4295 Hmac.prototype.update = function (data, enc) {
4296 this._hash.update(data, enc)
4297 return this
4298 }
4299
4300 Hmac.prototype.digest = function (enc) {
4301 var h = this._hash.digest()
4302 return createHash(this._alg).update(this._opad).update(h).digest(enc)
4303 }
4304
4305
4306 }).call(this,_dereq_("buffer").Buffer)
4307 },{"./create-hash":16,"buffer":8}],18:[function(_dereq_,module,exports){
4308 (function (Buffer){
4309 var intSize = 4;
4310 var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
4311 var chrsz = 8;
4312
4313 function toArray(buf, bigEndian) {
4314 if ((buf.length % intSize) !== 0) {
4315 var len = buf.length + (intSize - (buf.length % intSize));
4316 buf = Buffer.concat([buf, zeroBuffer], len);
4317 }
4318
4319 var arr = [];
4320 var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
4321 for (var i = 0; i < buf.length; i += intSize) {
4322 arr.push(fn.call(buf, i));
4323 }
4324 return arr;
4325 }
4326
4327 function toBuffer(arr, size, bigEndian) {
4328 var buf = new Buffer(size);
4329 var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
4330 for (var i = 0; i < arr.length; i++) {
4331 fn.call(buf, arr[i], i * 4, true);
4332 }
4333 return buf;
4334 }
4335
4336 function hash(buf, fn, hashSize, bigEndian) {
4337 if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
4338 var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
4339 return toBuffer(arr, hashSize, bigEndian);
4340 }
4341
4342 module.exports = { hash: hash };
4343
4344 }).call(this,_dereq_("buffer").Buffer)
4345 },{"buffer":8}],19:[function(_dereq_,module,exports){
4346 (function (Buffer){
4347 var rng = _dereq_('./rng')
4348
4349 function error () {
4350 var m = [].slice.call(arguments).join(' ')
4351 throw new Error([
4352 m,
4353 'we accept pull requests',
4354 'http://github.com/dominictarr/crypto-browserify'
4355 ].join('\n'))
4356 }
4357
4358 exports.createHash = _dereq_('./create-hash')
4359
4360 exports.createHmac = _dereq_('./create-hmac')
4361
4362 exports.randomBytes = function(size, callback) {
4363 if (callback && callback.call) {
4364 try {
4365 callback.call(this, undefined, new Buffer(rng(size)))
4366 } catch (err) { callback(err) }
4367 } else {
4368 return new Buffer(rng(size))
4369 }
4370 }
4371
4372 function each(a, f) {
4373 for(var i in a)
4374 f(a[i], i)
4375 }
4376
4377 exports.getHashes = function () {
4378 return ['sha1', 'sha256', 'md5', 'rmd160']
4379
4380 }
4381
4382 var p = _dereq_('./pbkdf2')(exports.createHmac)
4383 exports.pbkdf2 = p.pbkdf2
4384 exports.pbkdf2Sync = p.pbkdf2Sync
4385
4386
4387 // the least I can do is make error messages for the rest of the node.js/crypto api.
4388 each(['createCredentials'
4389 , 'createCipher'
4390 , 'createCipheriv'
4391 , 'createDecipher'
4392 , 'createDecipheriv'
4393 , 'createSign'
4394 , 'createVerify'
4395 , 'createDiffieHellman'
4396 ], function (name) {
4397 exports[name] = function () {
4398 error('sorry,', name, 'is not implemented yet')
4399 }
4400 })
4401
4402 }).call(this,_dereq_("buffer").Buffer)
4403 },{"./create-hash":16,"./create-hmac":17,"./pbkdf2":27,"./rng":28,"buffer":8}],20:[function(_dereq_,module,exports){
4404 /*
4405 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
4406 * Digest Algorithm, as defined in RFC 1321.
4407 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
4408 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4409 * Distributed under the BSD License
4410 * See http://pajhome.org.uk/crypt/md5 for more info.
4411 */
4412
4413 var helpers = _dereq_('./helpers');
4414
4415 /*
4416 * Calculate the MD5 of an array of little-endian words, and a bit length
4417 */
4418 function core_md5(x, len)
4419 {
4420 /* append padding */
4421 x[len >> 5] |= 0x80 << ((len) % 32);
4422 x[(((len + 64) >>> 9) << 4) + 14] = len;
4423
4424 var a = 1732584193;
4425 var b = -271733879;
4426 var c = -1732584194;
4427 var d = 271733878;
4428
4429 for(var i = 0; i < x.length; i += 16)
4430 {
4431 var olda = a;
4432 var oldb = b;
4433 var oldc = c;
4434 var oldd = d;
4435
4436 a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
4437 d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
4438 c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
4439 b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
4440 a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
4441 d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
4442 c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
4443 b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
4444 a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
4445 d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
4446 c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
4447 b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
4448 a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
4449 d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
4450 c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
4451 b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
4452
4453 a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
4454 d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
4455 c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
4456 b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
4457 a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
4458 d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
4459 c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
4460 b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
4461 a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
4462 d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
4463 c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
4464 b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
4465 a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
4466 d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
4467 c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
4468 b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
4469
4470 a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
4471 d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
4472 c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
4473 b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
4474 a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
4475 d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
4476 c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
4477 b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
4478 a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
4479 d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
4480 c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
4481 b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
4482 a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
4483 d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
4484 c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
4485 b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
4486
4487 a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
4488 d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
4489 c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
4490 b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
4491 a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
4492 d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
4493 c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
4494 b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
4495 a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
4496 d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
4497 c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
4498 b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
4499 a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
4500 d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
4501 c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
4502 b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
4503
4504 a = safe_add(a, olda);
4505 b = safe_add(b, oldb);
4506 c = safe_add(c, oldc);
4507 d = safe_add(d, oldd);
4508 }
4509 return Array(a, b, c, d);
4510
4511 }
4512
4513 /*
4514 * These functions implement the four basic operations the algorithm uses.
4515 */
4516 function md5_cmn(q, a, b, x, s, t)
4517 {
4518 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
4519 }
4520 function md5_ff(a, b, c, d, x, s, t)
4521 {
4522 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
4523 }
4524 function md5_gg(a, b, c, d, x, s, t)
4525 {
4526 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
4527 }
4528 function md5_hh(a, b, c, d, x, s, t)
4529 {
4530 return md5_cmn(b ^ c ^ d, a, b, x, s, t);
4531 }
4532 function md5_ii(a, b, c, d, x, s, t)
4533 {
4534 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
4535 }
4536
4537 /*
4538 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
4539 * to work around bugs in some JS interpreters.
4540 */
4541 function safe_add(x, y)
4542 {
4543 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
4544 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
4545 return (msw << 16) | (lsw & 0xFFFF);
4546 }
4547
4548 /*
4549 * Bitwise rotate a 32-bit number to the left.
4550 */
4551 function bit_rol(num, cnt)
4552 {
4553 return (num << cnt) | (num >>> (32 - cnt));
4554 }
4555
4556 module.exports = function md5(buf) {
4557 return helpers.hash(buf, core_md5, 16);
4558 };
4559
4560 },{"./helpers":18}],21:[function(_dereq_,module,exports){
4561 (function (Buffer){
4562
4563 module.exports = ripemd160
4564
4565
4566
4567 /*
4568 CryptoJS v3.1.2
4569 code.google.com/p/crypto-js
4570 (c) 2009-2013 by Jeff Mott. All rights reserved.
4571 code.google.com/p/crypto-js/wiki/License
4572 */
4573 /** @preserve
4574 (c) 2012 by Cédric Mesnil. All rights reserved.
4575
4576 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4577
4578 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
4579 - 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.
4580
4581 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.
4582 */
4583
4584 // Constants table
4585 var zl = [
4586 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
4587 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
4588 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
4589 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4590 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13];
4591 var zr = [
4592 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
4593 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
4594 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
4595 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
4596 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11];
4597 var sl = [
4598 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
4599 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
4600 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
4601 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
4602 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];
4603 var sr = [
4604 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
4605 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
4606 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
4607 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
4608 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];
4609
4610 var hl = [ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E];
4611 var hr = [ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000];
4612
4613 var bytesToWords = function (bytes) {
4614 var words = [];
4615 for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
4616 words[b >>> 5] |= bytes[i] << (24 - b % 32);
4617 }
4618 return words;
4619 };
4620
4621 var wordsToBytes = function (words) {
4622 var bytes = [];
4623 for (var b = 0; b < words.length * 32; b += 8) {
4624 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
4625 }
4626 return bytes;
4627 };
4628
4629 var processBlock = function (H, M, offset) {
4630
4631 // Swap endian
4632 for (var i = 0; i < 16; i++) {
4633 var offset_i = offset + i;
4634 var M_offset_i = M[offset_i];
4635
4636 // Swap
4637 M[offset_i] = (
4638 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
4639 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
4640 );
4641 }
4642
4643 // Working variables
4644 var al, bl, cl, dl, el;
4645 var ar, br, cr, dr, er;
4646
4647 ar = al = H[0];
4648 br = bl = H[1];
4649 cr = cl = H[2];
4650 dr = dl = H[3];
4651 er = el = H[4];
4652 // Computation
4653 var t;
4654 for (var i = 0; i < 80; i += 1) {
4655 t = (al + M[offset+zl[i]])|0;
4656 if (i<16){
4657 t += f1(bl,cl,dl) + hl[0];
4658 } else if (i<32) {
4659 t += f2(bl,cl,dl) + hl[1];
4660 } else if (i<48) {
4661 t += f3(bl,cl,dl) + hl[2];
4662 } else if (i<64) {
4663 t += f4(bl,cl,dl) + hl[3];
4664 } else {// if (i<80) {
4665 t += f5(bl,cl,dl) + hl[4];
4666 }
4667 t = t|0;
4668 t = rotl(t,sl[i]);
4669 t = (t+el)|0;
4670 al = el;
4671 el = dl;
4672 dl = rotl(cl, 10);
4673 cl = bl;
4674 bl = t;
4675
4676 t = (ar + M[offset+zr[i]])|0;
4677 if (i<16){
4678 t += f5(br,cr,dr) + hr[0];
4679 } else if (i<32) {
4680 t += f4(br,cr,dr) + hr[1];
4681 } else if (i<48) {
4682 t += f3(br,cr,dr) + hr[2];
4683 } else if (i<64) {
4684 t += f2(br,cr,dr) + hr[3];
4685 } else {// if (i<80) {
4686 t += f1(br,cr,dr) + hr[4];
4687 }
4688 t = t|0;
4689 t = rotl(t,sr[i]) ;
4690 t = (t+er)|0;
4691 ar = er;
4692 er = dr;
4693 dr = rotl(cr, 10);
4694 cr = br;
4695 br = t;
4696 }
4697 // Intermediate hash value
4698 t = (H[1] + cl + dr)|0;
4699 H[1] = (H[2] + dl + er)|0;
4700 H[2] = (H[3] + el + ar)|0;
4701 H[3] = (H[4] + al + br)|0;
4702 H[4] = (H[0] + bl + cr)|0;
4703 H[0] = t;
4704 };
4705
4706 function f1(x, y, z) {
4707 return ((x) ^ (y) ^ (z));
4708 }
4709
4710 function f2(x, y, z) {
4711 return (((x)&(y)) | ((~x)&(z)));
4712 }
4713
4714 function f3(x, y, z) {
4715 return (((x) | (~(y))) ^ (z));
4716 }
4717
4718 function f4(x, y, z) {
4719 return (((x) & (z)) | ((y)&(~(z))));
4720 }
4721
4722 function f5(x, y, z) {
4723 return ((x) ^ ((y) |(~(z))));
4724 }
4725
4726 function rotl(x,n) {
4727 return (x<<n) | (x>>>(32-n));
4728 }
4729
4730 function ripemd160(message) {
4731 var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];
4732
4733 if (typeof message == 'string')
4734 message = new Buffer(message, 'utf8');
4735
4736 var m = bytesToWords(message);
4737
4738 var nBitsLeft = message.length * 8;
4739 var nBitsTotal = message.length * 8;
4740
4741 // Add padding
4742 m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
4743 m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
4744 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
4745 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
4746 );
4747
4748 for (var i=0 ; i<m.length; i += 16) {
4749 processBlock(H, m, i);
4750 }
4751
4752 // Swap endian
4753 for (var i = 0; i < 5; i++) {
4754 // Shortcut
4755 var H_i = H[i];
4756
4757 // Swap
4758 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
4759 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
4760 }
4761
4762 var digestbytes = wordsToBytes(H);
4763 return new Buffer(digestbytes);
4764 }
4765
4766
4767
4768 }).call(this,_dereq_("buffer").Buffer)
4769 },{"buffer":8}],22:[function(_dereq_,module,exports){
4770 var u = _dereq_('./util')
4771 var write = u.write
4772 var fill = u.zeroFill
4773
4774 module.exports = function (Buffer) {
4775
4776 //prototype class for hash functions
4777 function Hash (blockSize, finalSize) {
4778 this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4)
4779 this._finalSize = finalSize
4780 this._blockSize = blockSize
4781 this._len = 0
4782 this._s = 0
4783 }
4784
4785 Hash.prototype.init = function () {
4786 this._s = 0
4787 this._len = 0
4788 }
4789
4790 function lengthOf(data, enc) {
4791 if(enc == null) return data.byteLength || data.length
4792 if(enc == 'ascii' || enc == 'binary') return data.length
4793 if(enc == 'hex') return data.length/2
4794 if(enc == 'base64') return data.length/3
4795 }
4796
4797 Hash.prototype.update = function (data, enc) {
4798 var bl = this._blockSize
4799
4800 //I'd rather do this with a streaming encoder, like the opposite of
4801 //http://nodejs.org/api/string_decoder.html
4802 var length
4803 if(!enc && 'string' === typeof data)
4804 enc = 'utf8'
4805
4806 if(enc) {
4807 if(enc === 'utf-8')
4808 enc = 'utf8'
4809
4810 if(enc === 'base64' || enc === 'utf8')
4811 data = new Buffer(data, enc), enc = null
4812
4813 length = lengthOf(data, enc)
4814 } else
4815 length = data.byteLength || data.length
4816
4817 var l = this._len += length
4818 var s = this._s = (this._s || 0)
4819 var f = 0
4820 var buffer = this._block
4821 while(s < l) {
4822 var t = Math.min(length, f + bl)
4823 write(buffer, data, enc, s%bl, f, t)
4824 var ch = (t - f);
4825 s += ch; f += ch
4826
4827 if(!(s%bl))
4828 this._update(buffer)
4829 }
4830 this._s = s
4831
4832 return this
4833
4834 }
4835
4836 Hash.prototype.digest = function (enc) {
4837 var bl = this._blockSize
4838 var fl = this._finalSize
4839 var len = this._len*8
4840
4841 var x = this._block
4842
4843 var bits = len % (bl*8)
4844
4845 //add end marker, so that appending 0's creats a different hash.
4846 x[this._len % bl] = 0x80
4847 fill(this._block, this._len % bl + 1)
4848
4849 if(bits >= fl*8) {
4850 this._update(this._block)
4851 u.zeroFill(this._block, 0)
4852 }
4853
4854 //TODO: handle case where the bit length is > Math.pow(2, 29)
4855 x.writeInt32BE(len, fl + 4) //big endian
4856
4857 var hash = this._update(this._block) || this._hash()
4858 if(enc == null) return hash
4859 return hash.toString(enc)
4860 }
4861
4862 Hash.prototype._update = function () {
4863 throw new Error('_update must be implemented by subclass')
4864 }
4865
4866 return Hash
4867 }
4868
4869 },{"./util":26}],23:[function(_dereq_,module,exports){
4870 var exports = module.exports = function (alg) {
4871 var Alg = exports[alg]
4872 if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')
4873 return new Alg()
4874 }
4875
4876 var Buffer = _dereq_('buffer').Buffer
4877 var Hash = _dereq_('./hash')(Buffer)
4878
4879 exports.sha =
4880 exports.sha1 = _dereq_('./sha1')(Buffer, Hash)
4881 exports.sha256 = _dereq_('./sha256')(Buffer, Hash)
4882
4883 },{"./hash":22,"./sha1":24,"./sha256":25,"buffer":8}],24:[function(_dereq_,module,exports){
4884 /*
4885 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
4886 * in FIPS PUB 180-1
4887 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
4888 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4889 * Distributed under the BSD License
4890 * See http://pajhome.org.uk/crypt/md5 for details.
4891 */
4892 module.exports = function (Buffer, Hash) {
4893
4894 var inherits = _dereq_('util').inherits
4895
4896 inherits(Sha1, Hash)
4897
4898 var A = 0|0
4899 var B = 4|0
4900 var C = 8|0
4901 var D = 12|0
4902 var E = 16|0
4903
4904 var BE = false
4905 var LE = true
4906
4907 var W = new Int32Array(80)
4908
4909 var POOL = []
4910
4911 function Sha1 () {
4912 if(POOL.length)
4913 return POOL.pop().init()
4914
4915 if(!(this instanceof Sha1)) return new Sha1()
4916 this._w = W
4917 Hash.call(this, 16*4, 14*4)
4918
4919 this._h = null
4920 this.init()
4921 }
4922
4923 Sha1.prototype.init = function () {
4924 this._a = 0x67452301
4925 this._b = 0xefcdab89
4926 this._c = 0x98badcfe
4927 this._d = 0x10325476
4928 this._e = 0xc3d2e1f0
4929
4930 Hash.prototype.init.call(this)
4931 return this
4932 }
4933
4934 Sha1.prototype._POOL = POOL
4935
4936 // assume that array is a Uint32Array with length=16,
4937 // and that if it is the last block, it already has the length and the 1 bit appended.
4938
4939
4940 var isDV = new Buffer(1) instanceof DataView
4941 function readInt32BE (X, i) {
4942 return isDV
4943 ? X.getInt32(i, false)
4944 : X.readInt32BE(i)
4945 }
4946
4947 Sha1.prototype._update = function (array) {
4948
4949 var X = this._block
4950 var h = this._h
4951 var a, b, c, d, e, _a, _b, _c, _d, _e
4952
4953 a = _a = this._a
4954 b = _b = this._b
4955 c = _c = this._c
4956 d = _d = this._d
4957 e = _e = this._e
4958
4959 var w = this._w
4960
4961 for(var j = 0; j < 80; j++) {
4962 var W = w[j]
4963 = j < 16
4964 //? X.getInt32(j*4, false)
4965 //? readInt32BE(X, j*4) //*/ X.readInt32BE(j*4) //*/
4966 ? X.readInt32BE(j*4)
4967 : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1)
4968
4969 var t =
4970 add(
4971 add(rol(a, 5), sha1_ft(j, b, c, d)),
4972 add(add(e, W), sha1_kt(j))
4973 );
4974
4975 e = d
4976 d = c
4977 c = rol(b, 30)
4978 b = a
4979 a = t
4980 }
4981
4982 this._a = add(a, _a)
4983 this._b = add(b, _b)
4984 this._c = add(c, _c)
4985 this._d = add(d, _d)
4986 this._e = add(e, _e)
4987 }
4988
4989 Sha1.prototype._hash = function () {
4990 if(POOL.length < 100) POOL.push(this)
4991 var H = new Buffer(20)
4992 //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0)
4993 H.writeInt32BE(this._a|0, A)
4994 H.writeInt32BE(this._b|0, B)
4995 H.writeInt32BE(this._c|0, C)
4996 H.writeInt32BE(this._d|0, D)
4997 H.writeInt32BE(this._e|0, E)
4998 return H
4999 }
5000
5001 /*
5002 * Perform the appropriate triplet combination function for the current
5003 * iteration
5004 */
5005 function sha1_ft(t, b, c, d) {
5006 if(t < 20) return (b & c) | ((~b) & d);
5007 if(t < 40) return b ^ c ^ d;
5008 if(t < 60) return (b & c) | (b & d) | (c & d);
5009 return b ^ c ^ d;
5010 }
5011
5012 /*
5013 * Determine the appropriate additive constant for the current iteration
5014 */
5015 function sha1_kt(t) {
5016 return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
5017 (t < 60) ? -1894007588 : -899497514;
5018 }
5019
5020 /*
5021 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
5022 * to work around bugs in some JS interpreters.
5023 * //dominictarr: this is 10 years old, so maybe this can be dropped?)
5024 *
5025 */
5026 function add(x, y) {
5027 return (x + y ) | 0
5028 //lets see how this goes on testling.
5029 // var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5030 // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5031 // return (msw << 16) | (lsw & 0xFFFF);
5032 }
5033
5034 /*
5035 * Bitwise rotate a 32-bit number to the left.
5036 */
5037 function rol(num, cnt) {
5038 return (num << cnt) | (num >>> (32 - cnt));
5039 }
5040
5041 return Sha1
5042 }
5043
5044 },{"util":14}],25:[function(_dereq_,module,exports){
5045
5046 /**
5047 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
5048 * in FIPS 180-2
5049 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
5050 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
5051 *
5052 */
5053
5054 var inherits = _dereq_('util').inherits
5055 var BE = false
5056 var LE = true
5057 var u = _dereq_('./util')
5058
5059 module.exports = function (Buffer, Hash) {
5060
5061 var K = [
5062 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
5063 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
5064 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
5065 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
5066 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
5067 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
5068 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
5069 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
5070 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
5071 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
5072 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
5073 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
5074 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
5075 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
5076 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
5077 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
5078 ]
5079
5080 inherits(Sha256, Hash)
5081 var W = new Array(64)
5082 var POOL = []
5083 function Sha256() {
5084 // Closure compiler warning - this code lacks side effects - thus commented out
5085 // if(POOL.length) {
5086 // return POOL.shift().init()
5087 // }
5088 //this._data = new Buffer(32)
5089
5090 this.init()
5091
5092 this._w = W //new Array(64)
5093
5094 Hash.call(this, 16*4, 14*4)
5095 };
5096
5097 Sha256.prototype.init = function () {
5098
5099 this._a = 0x6a09e667|0
5100 this._b = 0xbb67ae85|0
5101 this._c = 0x3c6ef372|0
5102 this._d = 0xa54ff53a|0
5103 this._e = 0x510e527f|0
5104 this._f = 0x9b05688c|0
5105 this._g = 0x1f83d9ab|0
5106 this._h = 0x5be0cd19|0
5107
5108 this._len = this._s = 0
5109
5110 return this
5111 }
5112
5113 var safe_add = function(x, y) {
5114 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5115 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5116 return (msw << 16) | (lsw & 0xFFFF);
5117 }
5118
5119 function S (X, n) {
5120 return (X >>> n) | (X << (32 - n));
5121 }
5122
5123 function R (X, n) {
5124 return (X >>> n);
5125 }
5126
5127 function Ch (x, y, z) {
5128 return ((x & y) ^ ((~x) & z));
5129 }
5130
5131 function Maj (x, y, z) {
5132 return ((x & y) ^ (x & z) ^ (y & z));
5133 }
5134
5135 function Sigma0256 (x) {
5136 return (S(x, 2) ^ S(x, 13) ^ S(x, 22));
5137 }
5138
5139 function Sigma1256 (x) {
5140 return (S(x, 6) ^ S(x, 11) ^ S(x, 25));
5141 }
5142
5143 function Gamma0256 (x) {
5144 return (S(x, 7) ^ S(x, 18) ^ R(x, 3));
5145 }
5146
5147 function Gamma1256 (x) {
5148 return (S(x, 17) ^ S(x, 19) ^ R(x, 10));
5149 }
5150
5151 Sha256.prototype._update = function(m) {
5152 var M = this._block
5153 var W = this._w
5154 var a, b, c, d, e, f, g, h
5155 var T1, T2
5156
5157 a = this._a | 0
5158 b = this._b | 0
5159 c = this._c | 0
5160 d = this._d | 0
5161 e = this._e | 0
5162 f = this._f | 0
5163 g = this._g | 0
5164 h = this._h | 0
5165
5166 for (var j = 0; j < 64; j++) {
5167 var w = W[j] = j < 16
5168 ? M.readInt32BE(j * 4)
5169 : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16]
5170
5171 T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w
5172
5173 T2 = Sigma0256(a) + Maj(a, b, c);
5174 h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2;
5175 }
5176
5177 this._a = (a + this._a) | 0
5178 this._b = (b + this._b) | 0
5179 this._c = (c + this._c) | 0
5180 this._d = (d + this._d) | 0
5181 this._e = (e + this._e) | 0
5182 this._f = (f + this._f) | 0
5183 this._g = (g + this._g) | 0
5184 this._h = (h + this._h) | 0
5185
5186 };
5187
5188 Sha256.prototype._hash = function () {
5189 if(POOL.length < 10)
5190 POOL.push(this)
5191
5192 var H = new Buffer(32)
5193
5194 H.writeInt32BE(this._a, 0)
5195 H.writeInt32BE(this._b, 4)
5196 H.writeInt32BE(this._c, 8)
5197 H.writeInt32BE(this._d, 12)
5198 H.writeInt32BE(this._e, 16)
5199 H.writeInt32BE(this._f, 20)
5200 H.writeInt32BE(this._g, 24)
5201 H.writeInt32BE(this._h, 28)
5202
5203 return H
5204 }
5205
5206 return Sha256
5207
5208 }
5209
5210 },{"./util":26,"util":14}],26:[function(_dereq_,module,exports){
5211 exports.write = write
5212 exports.zeroFill = zeroFill
5213
5214 exports.toString = toString
5215
5216 function write (buffer, string, enc, start, from, to, LE) {
5217 var l = (to - from)
5218 if(enc === 'ascii' || enc === 'binary') {
5219 for( var i = 0; i < l; i++) {
5220 buffer[start + i] = string.charCodeAt(i + from)
5221 }
5222 }
5223 else if(enc == null) {
5224 for( var i = 0; i < l; i++) {
5225 buffer[start + i] = string[i + from]
5226 }
5227 }
5228 else if(enc === 'hex') {
5229 for(var i = 0; i < l; i++) {
5230 var j = from + i
5231 buffer[start + i] = parseInt(string[j*2] + string[(j*2)+1], 16)
5232 }
5233 }
5234 else if(enc === 'base64') {
5235 throw new Error('base64 encoding not yet supported')
5236 }
5237 else
5238 throw new Error(enc +' encoding not yet supported')
5239 }
5240
5241 //always fill to the end!
5242 function zeroFill(buf, from) {
5243 for(var i = from; i < buf.length; i++)
5244 buf[i] = 0
5245 }
5246
5247
5248 },{}],27:[function(_dereq_,module,exports){
5249 (function (Buffer){
5250 // JavaScript PBKDF2 Implementation
5251 // Based on http://git.io/qsv2zw
5252 // Licensed under LGPL v3
5253 // Copyright (c) 2013 jduncanator
5254
5255 var blocksize = 64
5256 var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
5257
5258 module.exports = function (createHmac, exports) {
5259 exports = exports || {}
5260
5261 exports.pbkdf2 = function(password, salt, iterations, keylen, cb) {
5262 if('function' !== typeof cb)
5263 throw new Error('No callback provided to pbkdf2');
5264 setTimeout(function () {
5265 cb(null, exports.pbkdf2Sync(password, salt, iterations, keylen))
5266 })
5267 }
5268
5269 exports.pbkdf2Sync = function(key, salt, iterations, keylen) {
5270 if('number' !== typeof iterations)
5271 throw new TypeError('Iterations not a number')
5272 if(iterations < 0)
5273 throw new TypeError('Bad iterations')
5274 if('number' !== typeof keylen)
5275 throw new TypeError('Key length not a number')
5276 if(keylen < 0)
5277 throw new TypeError('Bad key length')
5278
5279 //stretch key to the correct length that hmac wants it,
5280 //otherwise this will happen every time hmac is called
5281 //twice per iteration.
5282 var key = !Buffer.isBuffer(key) ? new Buffer(key) : key
5283
5284 if(key.length > blocksize) {
5285 key = createHash(alg).update(key).digest()
5286 } else if(key.length < blocksize) {
5287 key = Buffer.concat([key, zeroBuffer], blocksize)
5288 }
5289
5290 var HMAC;
5291 var cplen, p = 0, i = 1, itmp = new Buffer(4), digtmp;
5292 var out = new Buffer(keylen);
5293 out.fill(0);
5294 while(keylen) {
5295 if(keylen > 20)
5296 cplen = 20;
5297 else
5298 cplen = keylen;
5299
5300 /* We are unlikely to ever use more than 256 blocks (5120 bits!)
5301 * but just in case...
5302 */
5303 itmp[0] = (i >> 24) & 0xff;
5304 itmp[1] = (i >> 16) & 0xff;
5305 itmp[2] = (i >> 8) & 0xff;
5306 itmp[3] = i & 0xff;
5307
5308 HMAC = createHmac('sha1', key);
5309 HMAC.update(salt)
5310 HMAC.update(itmp);
5311 digtmp = HMAC.digest();
5312 digtmp.copy(out, p, 0, cplen);
5313
5314 for(var j = 1; j < iterations; j++) {
5315 HMAC = createHmac('sha1', key);
5316 HMAC.update(digtmp);
5317 digtmp = HMAC.digest();
5318 for(var k = 0; k < cplen; k++) {
5319 out[k] ^= digtmp[k];
5320 }
5321 }
5322 keylen -= cplen;
5323 i++;
5324 p += cplen;
5325 }
5326
5327 return out;
5328 }
5329
5330 return exports
5331 }
5332
5333 }).call(this,_dereq_("buffer").Buffer)
5334 },{"buffer":8}],28:[function(_dereq_,module,exports){
5335 (function (Buffer){
5336 // Original code adapted from Robert Kieffer.
5337 // details at https://github.com/broofa/node-uuid
5338
5339
5340 (function() {
5341 var _global = this;
5342
5343 var mathRNG, whatwgRNG;
5344
5345 // NOTE: Math.random() does not guarantee "cryptographic quality"
5346 mathRNG = function(size) {
5347 var bytes = new Buffer(size);
5348 var r;
5349
5350 for (var i = 0, r; i < size; i++) {
5351 if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
5352 bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
5353 }
5354
5355 return bytes;
5356 }
5357
5358 if (_global.crypto && crypto.getRandomValues) {
5359 whatwgRNG = function(size) {
5360 var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array
5361 crypto.getRandomValues(bytes);
5362 return bytes;
5363 }
5364 }
5365
5366 module.exports = whatwgRNG || mathRNG;
5367
5368 }())
5369
5370 }).call(this,_dereq_("buffer").Buffer)
5371 },{"buffer":8}],29:[function(_dereq_,module,exports){
5372 ;(function (root, factory, undef) {
5373 if (typeof exports === "object") {
5374 // CommonJS
5375 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
5376 }
5377 else if (typeof define === "function" && define.amd) {
5378 // AMD
5379 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
5380 }
5381 else {
5382 // Global (browser)
5383 factory(root.CryptoJS);
5384 }
5385 }(this, function (CryptoJS) {
5386
5387 (function () {
5388 // Shortcuts
5389 var C = CryptoJS;
5390 var C_lib = C.lib;
5391 var BlockCipher = C_lib.BlockCipher;
5392 var C_algo = C.algo;
5393
5394 // Lookup tables
5395 var SBOX = [];
5396 var INV_SBOX = [];
5397 var SUB_MIX_0 = [];
5398 var SUB_MIX_1 = [];
5399 var SUB_MIX_2 = [];
5400 var SUB_MIX_3 = [];
5401 var INV_SUB_MIX_0 = [];
5402 var INV_SUB_MIX_1 = [];
5403 var INV_SUB_MIX_2 = [];
5404 var INV_SUB_MIX_3 = [];
5405
5406 // Compute lookup tables
5407 (function () {
5408 // Compute double table
5409 var d = [];
5410 for (var i = 0; i < 256; i++) {
5411 if (i < 128) {
5412 d[i] = i << 1;
5413 } else {
5414 d[i] = (i << 1) ^ 0x11b;
5415 }
5416 }
5417
5418 // Walk GF(2^8)
5419 var x = 0;
5420 var xi = 0;
5421 for (var i = 0; i < 256; i++) {
5422 // Compute sbox
5423 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
5424 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
5425 SBOX[x] = sx;
5426 INV_SBOX[sx] = x;
5427
5428 // Compute multiplication
5429 var x2 = d[x];
5430 var x4 = d[x2];
5431 var x8 = d[x4];
5432
5433 // Compute sub bytes, mix columns tables
5434 var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
5435 SUB_MIX_0[x] = (t << 24) | (t >>> 8);
5436 SUB_MIX_1[x] = (t << 16) | (t >>> 16);
5437 SUB_MIX_2[x] = (t << 8) | (t >>> 24);
5438 SUB_MIX_3[x] = t;
5439
5440 // Compute inv sub bytes, inv mix columns tables
5441 var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
5442 INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
5443 INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
5444 INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
5445 INV_SUB_MIX_3[sx] = t;
5446
5447 // Compute next counter
5448 if (!x) {
5449 x = xi = 1;
5450 } else {
5451 x = x2 ^ d[d[d[x8 ^ x2]]];
5452 xi ^= d[d[xi]];
5453 }
5454 }
5455 }());
5456
5457 // Precomputed Rcon lookup
5458 var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
5459
5460 /**
5461 * AES block cipher algorithm.
5462 */
5463 var AES = C_algo.AES = BlockCipher.extend({
5464 _doReset: function () {
5465 // Shortcuts
5466 var key = this._key;
5467 var keyWords = key.words;
5468 var keySize = key.sigBytes / 4;
5469
5470 // Compute number of rounds
5471 var nRounds = this._nRounds = keySize + 6
5472
5473 // Compute number of key schedule rows
5474 var ksRows = (nRounds + 1) * 4;
5475
5476 // Compute key schedule
5477 var keySchedule = this._keySchedule = [];
5478 for (var ksRow = 0; ksRow < ksRows; ksRow++) {
5479 if (ksRow < keySize) {
5480 keySchedule[ksRow] = keyWords[ksRow];
5481 } else {
5482 var t = keySchedule[ksRow - 1];
5483
5484 if (!(ksRow % keySize)) {
5485 // Rot word
5486 t = (t << 8) | (t >>> 24);
5487
5488 // Sub word
5489 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5490
5491 // Mix Rcon
5492 t ^= RCON[(ksRow / keySize) | 0] << 24;
5493 } else if (keySize > 6 && ksRow % keySize == 4) {
5494 // Sub word
5495 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5496 }
5497
5498 keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
5499 }
5500 }
5501
5502 // Compute inv key schedule
5503 var invKeySchedule = this._invKeySchedule = [];
5504 for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
5505 var ksRow = ksRows - invKsRow;
5506
5507 if (invKsRow % 4) {
5508 var t = keySchedule[ksRow];
5509 } else {
5510 var t = keySchedule[ksRow - 4];
5511 }
5512
5513 if (invKsRow < 4 || ksRow <= 4) {
5514 invKeySchedule[invKsRow] = t;
5515 } else {
5516 invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
5517 INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
5518 }
5519 }
5520 },
5521
5522 encryptBlock: function (M, offset) {
5523 this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
5524 },
5525
5526 decryptBlock: function (M, offset) {
5527 // Swap 2nd and 4th rows
5528 var t = M[offset + 1];
5529 M[offset + 1] = M[offset + 3];
5530 M[offset + 3] = t;
5531
5532 this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
5533
5534 // Inv swap 2nd and 4th rows
5535 var t = M[offset + 1];
5536 M[offset + 1] = M[offset + 3];
5537 M[offset + 3] = t;
5538 },
5539
5540 _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
5541 // Shortcut
5542 var nRounds = this._nRounds;
5543
5544 // Get input, add round key
5545 var s0 = M[offset] ^ keySchedule[0];
5546 var s1 = M[offset + 1] ^ keySchedule[1];
5547 var s2 = M[offset + 2] ^ keySchedule[2];
5548 var s3 = M[offset + 3] ^ keySchedule[3];
5549
5550 // Key schedule row counter
5551 var ksRow = 4;
5552
5553 // Rounds
5554 for (var round = 1; round < nRounds; round++) {
5555 // Shift rows, sub bytes, mix columns, add round key
5556 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++];
5557 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++];
5558 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++];
5559 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++];
5560
5561 // Update state
5562 s0 = t0;
5563 s1 = t1;
5564 s2 = t2;
5565 s3 = t3;
5566 }
5567
5568 // Shift rows, sub bytes, add round key
5569 var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
5570 var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
5571 var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
5572 var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
5573
5574 // Set output
5575 M[offset] = t0;
5576 M[offset + 1] = t1;
5577 M[offset + 2] = t2;
5578 M[offset + 3] = t3;
5579 },
5580
5581 keySize: 256/32
5582 });
5583
5584 /**
5585 * Shortcut functions to the cipher's object interface.
5586 *
5587 * @example
5588 *
5589 * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
5590 * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
5591 */
5592 C.AES = BlockCipher._createHelper(AES);
5593 }());
5594
5595
5596 return CryptoJS.AES;
5597
5598 }));
5599 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],30:[function(_dereq_,module,exports){
5600 ;(function (root, factory) {
5601 if (typeof exports === "object") {
5602 // CommonJS
5603 module.exports = exports = factory(_dereq_("./core"));
5604 }
5605 else if (typeof define === "function" && define.amd) {
5606 // AMD
5607 define(["./core"], factory);
5608 }
5609 else {
5610 // Global (browser)
5611 factory(root.CryptoJS);
5612 }
5613 }(this, function (CryptoJS) {
5614
5615 /**
5616 * Cipher core components.
5617 */
5618 CryptoJS.lib.Cipher || (function (undefined) {
5619 // Shortcuts
5620 var C = CryptoJS;
5621 var C_lib = C.lib;
5622 var Base = C_lib.Base;
5623 var WordArray = C_lib.WordArray;
5624 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
5625 var C_enc = C.enc;
5626 var Utf8 = C_enc.Utf8;
5627 var Base64 = C_enc.Base64;
5628 var C_algo = C.algo;
5629 var EvpKDF = C_algo.EvpKDF;
5630
5631 /**
5632 * Abstract base cipher template.
5633 *
5634 * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
5635 * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
5636 * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
5637 * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
5638 */
5639 var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
5640 /**
5641 * Configuration options.
5642 *
5643 * @property {WordArray} iv The IV to use for this operation.
5644 */
5645 cfg: Base.extend(),
5646
5647 /**
5648 * Creates this cipher in encryption mode.
5649 *
5650 * @param {WordArray} key The key.
5651 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5652 *
5653 * @return {Cipher} A cipher instance.
5654 *
5655 * @static
5656 *
5657 * @example
5658 *
5659 * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
5660 */
5661 createEncryptor: function (key, cfg) {
5662 return this.create(this._ENC_XFORM_MODE, key, cfg);
5663 },
5664
5665 /**
5666 * Creates this cipher in decryption mode.
5667 *
5668 * @param {WordArray} key The key.
5669 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5670 *
5671 * @return {Cipher} A cipher instance.
5672 *
5673 * @static
5674 *
5675 * @example
5676 *
5677 * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
5678 */
5679 createDecryptor: function (key, cfg) {
5680 return this.create(this._DEC_XFORM_MODE, key, cfg);
5681 },
5682
5683 /**
5684 * Initializes a newly created cipher.
5685 *
5686 * @param {number} xformMode Either the encryption or decryption transormation mode constant.
5687 * @param {WordArray} key The key.
5688 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5689 *
5690 * @example
5691 *
5692 * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
5693 */
5694 init: function (xformMode, key, cfg) {
5695 // Apply config defaults
5696 this.cfg = this.cfg.extend(cfg);
5697
5698 // Store transform mode and key
5699 this._xformMode = xformMode;
5700 this._key = key;
5701
5702 // Set initial values
5703 this.reset();
5704 },
5705
5706 /**
5707 * Resets this cipher to its initial state.
5708 *
5709 * @example
5710 *
5711 * cipher.reset();
5712 */
5713 reset: function () {
5714 // Reset data buffer
5715 BufferedBlockAlgorithm.reset.call(this);
5716
5717 // Perform concrete-cipher logic
5718 this._doReset();
5719 },
5720
5721 /**
5722 * Adds data to be encrypted or decrypted.
5723 *
5724 * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
5725 *
5726 * @return {WordArray} The data after processing.
5727 *
5728 * @example
5729 *
5730 * var encrypted = cipher.process('data');
5731 * var encrypted = cipher.process(wordArray);
5732 */
5733 process: function (dataUpdate) {
5734 // Append
5735 this._append(dataUpdate);
5736
5737 // Process available blocks
5738 return this._process();
5739 },
5740
5741 /**
5742 * Finalizes the encryption or decryption process.
5743 * Note that the finalize operation is effectively a destructive, read-once operation.
5744 *
5745 * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
5746 *
5747 * @return {WordArray} The data after final processing.
5748 *
5749 * @example
5750 *
5751 * var encrypted = cipher.finalize();
5752 * var encrypted = cipher.finalize('data');
5753 * var encrypted = cipher.finalize(wordArray);
5754 */
5755 finalize: function (dataUpdate) {
5756 // Final data update
5757 if (dataUpdate) {
5758 this._append(dataUpdate);
5759 }
5760
5761 // Perform concrete-cipher logic
5762 var finalProcessedData = this._doFinalize();
5763
5764 return finalProcessedData;
5765 },
5766
5767 keySize: 128/32,
5768
5769 ivSize: 128/32,
5770
5771 _ENC_XFORM_MODE: 1,
5772
5773 _DEC_XFORM_MODE: 2,
5774
5775 /**
5776 * Creates shortcut functions to a cipher's object interface.
5777 *
5778 * @param {Cipher} cipher The cipher to create a helper for.
5779 *
5780 * @return {Object} An object with encrypt and decrypt shortcut functions.
5781 *
5782 * @static
5783 *
5784 * @example
5785 *
5786 * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
5787 */
5788 _createHelper: (function () {
5789 function selectCipherStrategy(key) {
5790 if (typeof key == 'string') {
5791 return PasswordBasedCipher;
5792 } else {
5793 return SerializableCipher;
5794 }
5795 }
5796
5797 return function (cipher) {
5798 return {
5799 encrypt: function (message, key, cfg) {
5800 return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
5801 },
5802
5803 decrypt: function (ciphertext, key, cfg) {
5804 return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
5805 }
5806 };
5807 };
5808 }())
5809 });
5810
5811 /**
5812 * Abstract base stream cipher template.
5813 *
5814 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
5815 */
5816 var StreamCipher = C_lib.StreamCipher = Cipher.extend({
5817 _doFinalize: function () {
5818 // Process partial blocks
5819 var finalProcessedBlocks = this._process(!!'flush');
5820
5821 return finalProcessedBlocks;
5822 },
5823
5824 blockSize: 1
5825 });
5826
5827 /**
5828 * Mode namespace.
5829 */
5830 var C_mode = C.mode = {};
5831
5832 /**
5833 * Abstract base block cipher mode template.
5834 */
5835 var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
5836 /**
5837 * Creates this mode for encryption.
5838 *
5839 * @param {Cipher} cipher A block cipher instance.
5840 * @param {Array} iv The IV words.
5841 *
5842 * @static
5843 *
5844 * @example
5845 *
5846 * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
5847 */
5848 createEncryptor: function (cipher, iv) {
5849 return this.Encryptor.create(cipher, iv);
5850 },
5851
5852 /**
5853 * Creates this mode for decryption.
5854 *
5855 * @param {Cipher} cipher A block cipher instance.
5856 * @param {Array} iv The IV words.
5857 *
5858 * @static
5859 *
5860 * @example
5861 *
5862 * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
5863 */
5864 createDecryptor: function (cipher, iv) {
5865 return this.Decryptor.create(cipher, iv);
5866 },
5867
5868 /**
5869 * Initializes a newly created mode.
5870 *
5871 * @param {Cipher} cipher A block cipher instance.
5872 * @param {Array} iv The IV words.
5873 *
5874 * @example
5875 *
5876 * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
5877 */
5878 init: function (cipher, iv) {
5879 this._cipher = cipher;
5880 this._iv = iv;
5881 }
5882 });
5883
5884 /**
5885 * Cipher Block Chaining mode.
5886 */
5887 var CBC = C_mode.CBC = (function () {
5888 /**
5889 * Abstract base CBC mode.
5890 */
5891 var CBC = BlockCipherMode.extend();
5892
5893 /**
5894 * CBC encryptor.
5895 */
5896 CBC.Encryptor = CBC.extend({
5897 /**
5898 * Processes the data block at offset.
5899 *
5900 * @param {Array} words The data words to operate on.
5901 * @param {number} offset The offset where the block starts.
5902 *
5903 * @example
5904 *
5905 * mode.processBlock(data.words, offset);
5906 */
5907 processBlock: function (words, offset) {
5908 // Shortcuts
5909 var cipher = this._cipher;
5910 var blockSize = cipher.blockSize;
5911
5912 // XOR and encrypt
5913 xorBlock.call(this, words, offset, blockSize);
5914 cipher.encryptBlock(words, offset);
5915
5916 // Remember this block to use with next block
5917 this._prevBlock = words.slice(offset, offset + blockSize);
5918 }
5919 });
5920
5921 /**
5922 * CBC decryptor.
5923 */
5924 CBC.Decryptor = CBC.extend({
5925 /**
5926 * Processes the data block at offset.
5927 *
5928 * @param {Array} words The data words to operate on.
5929 * @param {number} offset The offset where the block starts.
5930 *
5931 * @example
5932 *
5933 * mode.processBlock(data.words, offset);
5934 */
5935 processBlock: function (words, offset) {
5936 // Shortcuts
5937 var cipher = this._cipher;
5938 var blockSize = cipher.blockSize;
5939
5940 // Remember this block to use with next block
5941 var thisBlock = words.slice(offset, offset + blockSize);
5942
5943 // Decrypt and XOR
5944 cipher.decryptBlock(words, offset);
5945 xorBlock.call(this, words, offset, blockSize);
5946
5947 // This block becomes the previous block
5948 this._prevBlock = thisBlock;
5949 }
5950 });
5951
5952 function xorBlock(words, offset, blockSize) {
5953 // Shortcut
5954 var iv = this._iv;
5955
5956 // Choose mixing block
5957 if (iv) {
5958 var block = iv;
5959
5960 // Remove IV for subsequent blocks
5961 this._iv = undefined;
5962 } else {
5963 var block = this._prevBlock;
5964 }
5965
5966 // XOR blocks
5967 for (var i = 0; i < blockSize; i++) {
5968 words[offset + i] ^= block[i];
5969 }
5970 }
5971
5972 return CBC;
5973 }());
5974
5975 /**
5976 * Padding namespace.
5977 */
5978 var C_pad = C.pad = {};
5979
5980 /**
5981 * PKCS #5/7 padding strategy.
5982 */
5983 var Pkcs7 = C_pad.Pkcs7 = {
5984 /**
5985 * Pads data using the algorithm defined in PKCS #5/7.
5986 *
5987 * @param {WordArray} data The data to pad.
5988 * @param {number} blockSize The multiple that the data should be padded to.
5989 *
5990 * @static
5991 *
5992 * @example
5993 *
5994 * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
5995 */
5996 pad: function (data, blockSize) {
5997 // Shortcut
5998 var blockSizeBytes = blockSize * 4;
5999
6000 // Count padding bytes
6001 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
6002
6003 // Create padding word
6004 var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
6005
6006 // Create padding
6007 var paddingWords = [];
6008 for (var i = 0; i < nPaddingBytes; i += 4) {
6009 paddingWords.push(paddingWord);
6010 }
6011 var padding = WordArray.create(paddingWords, nPaddingBytes);
6012
6013 // Add padding
6014 data.concat(padding);
6015 },
6016
6017 /**
6018 * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
6019 *
6020 * @param {WordArray} data The data to unpad.
6021 *
6022 * @static
6023 *
6024 * @example
6025 *
6026 * CryptoJS.pad.Pkcs7.unpad(wordArray);
6027 */
6028 unpad: function (data) {
6029 // Get number of padding bytes from last byte
6030 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
6031
6032 // Remove padding
6033 data.sigBytes -= nPaddingBytes;
6034 }
6035 };
6036
6037 /**
6038 * Abstract base block cipher template.
6039 *
6040 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
6041 */
6042 var BlockCipher = C_lib.BlockCipher = Cipher.extend({
6043 /**
6044 * Configuration options.
6045 *
6046 * @property {Mode} mode The block mode to use. Default: CBC
6047 * @property {Padding} padding The padding strategy to use. Default: Pkcs7
6048 */
6049 cfg: Cipher.cfg.extend({
6050 mode: CBC,
6051 padding: Pkcs7
6052 }),
6053
6054 reset: function () {
6055 // Reset cipher
6056 Cipher.reset.call(this);
6057
6058 // Shortcuts
6059 var cfg = this.cfg;
6060 var iv = cfg.iv;
6061 var mode = cfg.mode;
6062
6063 // Reset block mode
6064 if (this._xformMode == this._ENC_XFORM_MODE) {
6065 var modeCreator = mode.createEncryptor;
6066 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6067 var modeCreator = mode.createDecryptor;
6068
6069 // Keep at least one block in the buffer for unpadding
6070 this._minBufferSize = 1;
6071 }
6072 this._mode = modeCreator.call(mode, this, iv && iv.words);
6073 },
6074
6075 _doProcessBlock: function (words, offset) {
6076 this._mode.processBlock(words, offset);
6077 },
6078
6079 _doFinalize: function () {
6080 // Shortcut
6081 var padding = this.cfg.padding;
6082
6083 // Finalize
6084 if (this._xformMode == this._ENC_XFORM_MODE) {
6085 // Pad data
6086 padding.pad(this._data, this.blockSize);
6087
6088 // Process final blocks
6089 var finalProcessedBlocks = this._process(!!'flush');
6090 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6091 // Process final blocks
6092 var finalProcessedBlocks = this._process(!!'flush');
6093
6094 // Unpad data
6095 padding.unpad(finalProcessedBlocks);
6096 }
6097
6098 return finalProcessedBlocks;
6099 },
6100
6101 blockSize: 128/32
6102 });
6103
6104 /**
6105 * A collection of cipher parameters.
6106 *
6107 * @property {WordArray} ciphertext The raw ciphertext.
6108 * @property {WordArray} key The key to this ciphertext.
6109 * @property {WordArray} iv The IV used in the ciphering operation.
6110 * @property {WordArray} salt The salt used with a key derivation function.
6111 * @property {Cipher} algorithm The cipher algorithm.
6112 * @property {Mode} mode The block mode used in the ciphering operation.
6113 * @property {Padding} padding The padding scheme used in the ciphering operation.
6114 * @property {number} blockSize The block size of the cipher.
6115 * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
6116 */
6117 var CipherParams = C_lib.CipherParams = Base.extend({
6118 /**
6119 * Initializes a newly created cipher params object.
6120 *
6121 * @param {Object} cipherParams An object with any of the possible cipher parameters.
6122 *
6123 * @example
6124 *
6125 * var cipherParams = CryptoJS.lib.CipherParams.create({
6126 * ciphertext: ciphertextWordArray,
6127 * key: keyWordArray,
6128 * iv: ivWordArray,
6129 * salt: saltWordArray,
6130 * algorithm: CryptoJS.algo.AES,
6131 * mode: CryptoJS.mode.CBC,
6132 * padding: CryptoJS.pad.PKCS7,
6133 * blockSize: 4,
6134 * formatter: CryptoJS.format.OpenSSL
6135 * });
6136 */
6137 init: function (cipherParams) {
6138 this.mixIn(cipherParams);
6139 },
6140
6141 /**
6142 * Converts this cipher params object to a string.
6143 *
6144 * @param {Format} formatter (Optional) The formatting strategy to use.
6145 *
6146 * @return {string} The stringified cipher params.
6147 *
6148 * @throws Error If neither the formatter nor the default formatter is set.
6149 *
6150 * @example
6151 *
6152 * var string = cipherParams + '';
6153 * var string = cipherParams.toString();
6154 * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
6155 */
6156 toString: function (formatter) {
6157 return (formatter || this.formatter).stringify(this);
6158 }
6159 });
6160
6161 /**
6162 * Format namespace.
6163 */
6164 var C_format = C.format = {};
6165
6166 /**
6167 * OpenSSL formatting strategy.
6168 */
6169 var OpenSSLFormatter = C_format.OpenSSL = {
6170 /**
6171 * Converts a cipher params object to an OpenSSL-compatible string.
6172 *
6173 * @param {CipherParams} cipherParams The cipher params object.
6174 *
6175 * @return {string} The OpenSSL-compatible string.
6176 *
6177 * @static
6178 *
6179 * @example
6180 *
6181 * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
6182 */
6183 stringify: function (cipherParams) {
6184 // Shortcuts
6185 var ciphertext = cipherParams.ciphertext;
6186 var salt = cipherParams.salt;
6187
6188 // Format
6189 if (salt) {
6190 var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
6191 } else {
6192 var wordArray = ciphertext;
6193 }
6194
6195 return wordArray.toString(Base64);
6196 },
6197
6198 /**
6199 * Converts an OpenSSL-compatible string to a cipher params object.
6200 *
6201 * @param {string} openSSLStr The OpenSSL-compatible string.
6202 *
6203 * @return {CipherParams} The cipher params object.
6204 *
6205 * @static
6206 *
6207 * @example
6208 *
6209 * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
6210 */
6211 parse: function (openSSLStr) {
6212 // Parse base64
6213 var ciphertext = Base64.parse(openSSLStr);
6214
6215 // Shortcut
6216 var ciphertextWords = ciphertext.words;
6217
6218 // Test for salt
6219 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
6220 // Extract salt
6221 var salt = WordArray.create(ciphertextWords.slice(2, 4));
6222
6223 // Remove salt from ciphertext
6224 ciphertextWords.splice(0, 4);
6225 ciphertext.sigBytes -= 16;
6226 }
6227
6228 return CipherParams.create({ ciphertext: ciphertext, salt: salt });
6229 }
6230 };
6231
6232 /**
6233 * A cipher wrapper that returns ciphertext as a serializable cipher params object.
6234 */
6235 var SerializableCipher = C_lib.SerializableCipher = Base.extend({
6236 /**
6237 * Configuration options.
6238 *
6239 * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
6240 */
6241 cfg: Base.extend({
6242 format: OpenSSLFormatter
6243 }),
6244
6245 /**
6246 * Encrypts a message.
6247 *
6248 * @param {Cipher} cipher The cipher algorithm to use.
6249 * @param {WordArray|string} message The message to encrypt.
6250 * @param {WordArray} key The key.
6251 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6252 *
6253 * @return {CipherParams} A cipher params object.
6254 *
6255 * @static
6256 *
6257 * @example
6258 *
6259 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
6260 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
6261 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6262 */
6263 encrypt: function (cipher, message, key, cfg) {
6264 // Apply config defaults
6265 cfg = this.cfg.extend(cfg);
6266
6267 // Encrypt
6268 var encryptor = cipher.createEncryptor(key, cfg);
6269 var ciphertext = encryptor.finalize(message);
6270
6271 // Shortcut
6272 var cipherCfg = encryptor.cfg;
6273
6274 // Create and return serializable cipher params
6275 return CipherParams.create({
6276 ciphertext: ciphertext,
6277 key: key,
6278 iv: cipherCfg.iv,
6279 algorithm: cipher,
6280 mode: cipherCfg.mode,
6281 padding: cipherCfg.padding,
6282 blockSize: cipher.blockSize,
6283 formatter: cfg.format
6284 });
6285 },
6286
6287 /**
6288 * Decrypts serialized ciphertext.
6289 *
6290 * @param {Cipher} cipher The cipher algorithm to use.
6291 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6292 * @param {WordArray} key The key.
6293 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6294 *
6295 * @return {WordArray} The plaintext.
6296 *
6297 * @static
6298 *
6299 * @example
6300 *
6301 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6302 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6303 */
6304 decrypt: function (cipher, ciphertext, key, cfg) {
6305 // Apply config defaults
6306 cfg = this.cfg.extend(cfg);
6307
6308 // Convert string to CipherParams
6309 ciphertext = this._parse(ciphertext, cfg.format);
6310
6311 // Decrypt
6312 var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
6313
6314 return plaintext;
6315 },
6316
6317 /**
6318 * Converts serialized ciphertext to CipherParams,
6319 * else assumed CipherParams already and returns ciphertext unchanged.
6320 *
6321 * @param {CipherParams|string} ciphertext The ciphertext.
6322 * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
6323 *
6324 * @return {CipherParams} The unserialized ciphertext.
6325 *
6326 * @static
6327 *
6328 * @example
6329 *
6330 * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
6331 */
6332 _parse: function (ciphertext, format) {
6333 if (typeof ciphertext == 'string') {
6334 return format.parse(ciphertext, this);
6335 } else {
6336 return ciphertext;
6337 }
6338 }
6339 });
6340
6341 /**
6342 * Key derivation function namespace.
6343 */
6344 var C_kdf = C.kdf = {};
6345
6346 /**
6347 * OpenSSL key derivation function.
6348 */
6349 var OpenSSLKdf = C_kdf.OpenSSL = {
6350 /**
6351 * Derives a key and IV from a password.
6352 *
6353 * @param {string} password The password to derive from.
6354 * @param {number} keySize The size in words of the key to generate.
6355 * @param {number} ivSize The size in words of the IV to generate.
6356 * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
6357 *
6358 * @return {CipherParams} A cipher params object with the key, IV, and salt.
6359 *
6360 * @static
6361 *
6362 * @example
6363 *
6364 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
6365 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
6366 */
6367 execute: function (password, keySize, ivSize, salt) {
6368 // Generate random salt
6369 if (!salt) {
6370 salt = WordArray.random(64/8);
6371 }
6372
6373 // Derive key and IV
6374 var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
6375
6376 // Separate key and IV
6377 var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
6378 key.sigBytes = keySize * 4;
6379
6380 // Return params
6381 return CipherParams.create({ key: key, iv: iv, salt: salt });
6382 }
6383 };
6384
6385 /**
6386 * A serializable cipher wrapper that derives the key from a password,
6387 * and returns ciphertext as a serializable cipher params object.
6388 */
6389 var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
6390 /**
6391 * Configuration options.
6392 *
6393 * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
6394 */
6395 cfg: SerializableCipher.cfg.extend({
6396 kdf: OpenSSLKdf
6397 }),
6398
6399 /**
6400 * Encrypts a message using a password.
6401 *
6402 * @param {Cipher} cipher The cipher algorithm to use.
6403 * @param {WordArray|string} message The message to encrypt.
6404 * @param {string} password The password.
6405 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6406 *
6407 * @return {CipherParams} A cipher params object.
6408 *
6409 * @static
6410 *
6411 * @example
6412 *
6413 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
6414 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
6415 */
6416 encrypt: function (cipher, message, password, cfg) {
6417 // Apply config defaults
6418 cfg = this.cfg.extend(cfg);
6419
6420 // Derive key and other params
6421 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
6422
6423 // Add IV to config
6424 cfg.iv = derivedParams.iv;
6425
6426 // Encrypt
6427 var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
6428
6429 // Mix in derived params
6430 ciphertext.mixIn(derivedParams);
6431
6432 return ciphertext;
6433 },
6434
6435 /**
6436 * Decrypts serialized ciphertext using a password.
6437 *
6438 * @param {Cipher} cipher The cipher algorithm to use.
6439 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6440 * @param {string} password The password.
6441 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6442 *
6443 * @return {WordArray} The plaintext.
6444 *
6445 * @static
6446 *
6447 * @example
6448 *
6449 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
6450 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
6451 */
6452 decrypt: function (cipher, ciphertext, password, cfg) {
6453 // Apply config defaults
6454 cfg = this.cfg.extend(cfg);
6455
6456 // Convert string to CipherParams
6457 ciphertext = this._parse(ciphertext, cfg.format);
6458
6459 // Derive key and other params
6460 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
6461
6462 // Add IV to config
6463 cfg.iv = derivedParams.iv;
6464
6465 // Decrypt
6466 var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
6467
6468 return plaintext;
6469 }
6470 });
6471 }());
6472
6473
6474 }));
6475 },{"./core":31}],31:[function(_dereq_,module,exports){
6476 ;(function (root, factory) {
6477 if (typeof exports === "object") {
6478 // CommonJS
6479 module.exports = exports = factory();
6480 }
6481 else if (typeof define === "function" && define.amd) {
6482 // AMD
6483 define([], factory);
6484 }
6485 else {
6486 // Global (browser)
6487 root.CryptoJS = factory();
6488 }
6489 }(this, function () {
6490
6491 /**
6492 * CryptoJS core components.
6493 */
6494 var CryptoJS = CryptoJS || (function (Math, undefined) {
6495 /**
6496 * CryptoJS namespace.
6497 */
6498 var C = {};
6499
6500 /**
6501 * Library namespace.
6502 */
6503 var C_lib = C.lib = {};
6504
6505 /**
6506 * Base object for prototypal inheritance.
6507 */
6508 var Base = C_lib.Base = (function () {
6509 function F() {}
6510
6511 return {
6512 /**
6513 * Creates a new object that inherits from this object.
6514 *
6515 * @param {Object} overrides Properties to copy into the new object.
6516 *
6517 * @return {Object} The new object.
6518 *
6519 * @static
6520 *
6521 * @example
6522 *
6523 * var MyType = CryptoJS.lib.Base.extend({
6524 * field: 'value',
6525 *
6526 * method: function () {
6527 * }
6528 * });
6529 */
6530 extend: function (overrides) {
6531 // Spawn
6532 F.prototype = this;
6533 var subtype = new F();
6534
6535 // Augment
6536 if (overrides) {
6537 subtype.mixIn(overrides);
6538 }
6539
6540 // Create default initializer
6541 if (!subtype.hasOwnProperty('init')) {
6542 subtype.init = function () {
6543 subtype.$super.init.apply(this, arguments);
6544 };
6545 }
6546
6547 // Initializer's prototype is the subtype object
6548 subtype.init.prototype = subtype;
6549
6550 // Reference supertype
6551 subtype.$super = this;
6552
6553 return subtype;
6554 },
6555
6556 /**
6557 * Extends this object and runs the init method.
6558 * Arguments to create() will be passed to init().
6559 *
6560 * @return {Object} The new object.
6561 *
6562 * @static
6563 *
6564 * @example
6565 *
6566 * var instance = MyType.create();
6567 */
6568 create: function () {
6569 var instance = this.extend();
6570 instance.init.apply(instance, arguments);
6571
6572 return instance;
6573 },
6574
6575 /**
6576 * Initializes a newly created object.
6577 * Override this method to add some logic when your objects are created.
6578 *
6579 * @example
6580 *
6581 * var MyType = CryptoJS.lib.Base.extend({
6582 * init: function () {
6583 * // ...
6584 * }
6585 * });
6586 */
6587 init: function () {
6588 },
6589
6590 /**
6591 * Copies properties into this object.
6592 *
6593 * @param {Object} properties The properties to mix in.
6594 *
6595 * @example
6596 *
6597 * MyType.mixIn({
6598 * field: 'value'
6599 * });
6600 */
6601 mixIn: function (properties) {
6602 for (var propertyName in properties) {
6603 if (properties.hasOwnProperty(propertyName)) {
6604 this[propertyName] = properties[propertyName];
6605 }
6606 }
6607
6608 // IE won't copy toString using the loop above
6609 if (properties.hasOwnProperty('toString')) {
6610 this.toString = properties.toString;
6611 }
6612 },
6613
6614 /**
6615 * Creates a copy of this object.
6616 *
6617 * @return {Object} The clone.
6618 *
6619 * @example
6620 *
6621 * var clone = instance.clone();
6622 */
6623 clone: function () {
6624 return this.init.prototype.extend(this);
6625 }
6626 };
6627 }());
6628
6629 /**
6630 * An array of 32-bit words.
6631 *
6632 * @property {Array} words The array of 32-bit words.
6633 * @property {number} sigBytes The number of significant bytes in this word array.
6634 */
6635 var WordArray = C_lib.WordArray = Base.extend({
6636 /**
6637 * Initializes a newly created word array.
6638 *
6639 * @param {Array} words (Optional) An array of 32-bit words.
6640 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
6641 *
6642 * @example
6643 *
6644 * var wordArray = CryptoJS.lib.WordArray.create();
6645 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
6646 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
6647 */
6648 init: function (words, sigBytes) {
6649 words = this.words = words || [];
6650
6651 if (sigBytes != undefined) {
6652 this.sigBytes = sigBytes;
6653 } else {
6654 this.sigBytes = words.length * 4;
6655 }
6656 },
6657
6658 /**
6659 * Converts this word array to a string.
6660 *
6661 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
6662 *
6663 * @return {string} The stringified word array.
6664 *
6665 * @example
6666 *
6667 * var string = wordArray + '';
6668 * var string = wordArray.toString();
6669 * var string = wordArray.toString(CryptoJS.enc.Utf8);
6670 */
6671 toString: function (encoder) {
6672 return (encoder || Hex).stringify(this);
6673 },
6674
6675 /**
6676 * Concatenates a word array to this word array.
6677 *
6678 * @param {WordArray} wordArray The word array to append.
6679 *
6680 * @return {WordArray} This word array.
6681 *
6682 * @example
6683 *
6684 * wordArray1.concat(wordArray2);
6685 */
6686 concat: function (wordArray) {
6687 // Shortcuts
6688 var thisWords = this.words;
6689 var thatWords = wordArray.words;
6690 var thisSigBytes = this.sigBytes;
6691 var thatSigBytes = wordArray.sigBytes;
6692
6693 // Clamp excess bits
6694 this.clamp();
6695
6696 // Concat
6697 if (thisSigBytes % 4) {
6698 // Copy one byte at a time
6699 for (var i = 0; i < thatSigBytes; i++) {
6700 var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6701 thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
6702 }
6703 } else if (thatWords.length > 0xffff) {
6704 // Copy one word at a time
6705 for (var i = 0; i < thatSigBytes; i += 4) {
6706 thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
6707 }
6708 } else {
6709 // Copy all words at once
6710 thisWords.push.apply(thisWords, thatWords);
6711 }
6712 this.sigBytes += thatSigBytes;
6713
6714 // Chainable
6715 return this;
6716 },
6717
6718 /**
6719 * Removes insignificant bits.
6720 *
6721 * @example
6722 *
6723 * wordArray.clamp();
6724 */
6725 clamp: function () {
6726 // Shortcuts
6727 var words = this.words;
6728 var sigBytes = this.sigBytes;
6729
6730 // Clamp
6731 words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
6732 words.length = Math.ceil(sigBytes / 4);
6733 },
6734
6735 /**
6736 * Creates a copy of this word array.
6737 *
6738 * @return {WordArray} The clone.
6739 *
6740 * @example
6741 *
6742 * var clone = wordArray.clone();
6743 */
6744 clone: function () {
6745 var clone = Base.clone.call(this);
6746 clone.words = this.words.slice(0);
6747
6748 return clone;
6749 },
6750
6751 /**
6752 * Creates a word array filled with random bytes.
6753 *
6754 * @param {number} nBytes The number of random bytes to generate.
6755 *
6756 * @return {WordArray} The random word array.
6757 *
6758 * @static
6759 *
6760 * @example
6761 *
6762 * var wordArray = CryptoJS.lib.WordArray.random(16);
6763 */
6764 random: function (nBytes) {
6765 var words = [];
6766 for (var i = 0; i < nBytes; i += 4) {
6767 words.push((Math.random() * 0x100000000) | 0);
6768 }
6769
6770 return new WordArray.init(words, nBytes);
6771 }
6772 });
6773
6774 /**
6775 * Encoder namespace.
6776 */
6777 var C_enc = C.enc = {};
6778
6779 /**
6780 * Hex encoding strategy.
6781 */
6782 var Hex = C_enc.Hex = {
6783 /**
6784 * Converts a word array to a hex string.
6785 *
6786 * @param {WordArray} wordArray The word array.
6787 *
6788 * @return {string} The hex string.
6789 *
6790 * @static
6791 *
6792 * @example
6793 *
6794 * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
6795 */
6796 stringify: function (wordArray) {
6797 // Shortcuts
6798 var words = wordArray.words;
6799 var sigBytes = wordArray.sigBytes;
6800
6801 // Convert
6802 var hexChars = [];
6803 for (var i = 0; i < sigBytes; i++) {
6804 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6805 hexChars.push((bite >>> 4).toString(16));
6806 hexChars.push((bite & 0x0f).toString(16));
6807 }
6808
6809 return hexChars.join('');
6810 },
6811
6812 /**
6813 * Converts a hex string to a word array.
6814 *
6815 * @param {string} hexStr The hex string.
6816 *
6817 * @return {WordArray} The word array.
6818 *
6819 * @static
6820 *
6821 * @example
6822 *
6823 * var wordArray = CryptoJS.enc.Hex.parse(hexString);
6824 */
6825 parse: function (hexStr) {
6826 // Shortcut
6827 var hexStrLength = hexStr.length;
6828
6829 // Convert
6830 var words = [];
6831 for (var i = 0; i < hexStrLength; i += 2) {
6832 words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
6833 }
6834
6835 return new WordArray.init(words, hexStrLength / 2);
6836 }
6837 };
6838
6839 /**
6840 * Latin1 encoding strategy.
6841 */
6842 var Latin1 = C_enc.Latin1 = {
6843 /**
6844 * Converts a word array to a Latin1 string.
6845 *
6846 * @param {WordArray} wordArray The word array.
6847 *
6848 * @return {string} The Latin1 string.
6849 *
6850 * @static
6851 *
6852 * @example
6853 *
6854 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
6855 */
6856 stringify: function (wordArray) {
6857 // Shortcuts
6858 var words = wordArray.words;
6859 var sigBytes = wordArray.sigBytes;
6860
6861 // Convert
6862 var latin1Chars = [];
6863 for (var i = 0; i < sigBytes; i++) {
6864 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6865 latin1Chars.push(String.fromCharCode(bite));
6866 }
6867
6868 return latin1Chars.join('');
6869 },
6870
6871 /**
6872 * Converts a Latin1 string to a word array.
6873 *
6874 * @param {string} latin1Str The Latin1 string.
6875 *
6876 * @return {WordArray} The word array.
6877 *
6878 * @static
6879 *
6880 * @example
6881 *
6882 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
6883 */
6884 parse: function (latin1Str) {
6885 // Shortcut
6886 var latin1StrLength = latin1Str.length;
6887
6888 // Convert
6889 var words = [];
6890 for (var i = 0; i < latin1StrLength; i++) {
6891 words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
6892 }
6893
6894 return new WordArray.init(words, latin1StrLength);
6895 }
6896 };
6897
6898 /**
6899 * UTF-8 encoding strategy.
6900 */
6901 var Utf8 = C_enc.Utf8 = {
6902 /**
6903 * Converts a word array to a UTF-8 string.
6904 *
6905 * @param {WordArray} wordArray The word array.
6906 *
6907 * @return {string} The UTF-8 string.
6908 *
6909 * @static
6910 *
6911 * @example
6912 *
6913 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
6914 */
6915 stringify: function (wordArray) {
6916 try {
6917 return decodeURIComponent(escape(Latin1.stringify(wordArray)));
6918 } catch (e) {
6919 throw new Error('Malformed UTF-8 data');
6920 }
6921 },
6922
6923 /**
6924 * Converts a UTF-8 string to a word array.
6925 *
6926 * @param {string} utf8Str The UTF-8 string.
6927 *
6928 * @return {WordArray} The word array.
6929 *
6930 * @static
6931 *
6932 * @example
6933 *
6934 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
6935 */
6936 parse: function (utf8Str) {
6937 return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
6938 }
6939 };
6940
6941 /**
6942 * Abstract buffered block algorithm template.
6943 *
6944 * The property blockSize must be implemented in a concrete subtype.
6945 *
6946 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
6947 */
6948 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
6949 /**
6950 * Resets this block algorithm's data buffer to its initial state.
6951 *
6952 * @example
6953 *
6954 * bufferedBlockAlgorithm.reset();
6955 */
6956 reset: function () {
6957 // Initial values
6958 this._data = new WordArray.init();
6959 this._nDataBytes = 0;
6960 },
6961
6962 /**
6963 * Adds new data to this block algorithm's buffer.
6964 *
6965 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
6966 *
6967 * @example
6968 *
6969 * bufferedBlockAlgorithm._append('data');
6970 * bufferedBlockAlgorithm._append(wordArray);
6971 */
6972 _append: function (data) {
6973 // Convert string to WordArray, else assume WordArray already
6974 if (typeof data == 'string') {
6975 data = Utf8.parse(data);
6976 }
6977
6978 // Append
6979 this._data.concat(data);
6980 this._nDataBytes += data.sigBytes;
6981 },
6982
6983 /**
6984 * Processes available data blocks.
6985 *
6986 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
6987 *
6988 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
6989 *
6990 * @return {WordArray} The processed data.
6991 *
6992 * @example
6993 *
6994 * var processedData = bufferedBlockAlgorithm._process();
6995 * var processedData = bufferedBlockAlgorithm._process(!!'flush');
6996 */
6997 _process: function (doFlush) {
6998 // Shortcuts
6999 var data = this._data;
7000 var dataWords = data.words;
7001 var dataSigBytes = data.sigBytes;
7002 var blockSize = this.blockSize;
7003 var blockSizeBytes = blockSize * 4;
7004
7005 // Count blocks ready
7006 var nBlocksReady = dataSigBytes / blockSizeBytes;
7007 if (doFlush) {
7008 // Round up to include partial blocks
7009 nBlocksReady = Math.ceil(nBlocksReady);
7010 } else {
7011 // Round down to include only full blocks,
7012 // less the number of blocks that must remain in the buffer
7013 nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
7014 }
7015
7016 // Count words ready
7017 var nWordsReady = nBlocksReady * blockSize;
7018
7019 // Count bytes ready
7020 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
7021
7022 // Process blocks
7023 if (nWordsReady) {
7024 for (var offset = 0; offset < nWordsReady; offset += blockSize) {
7025 // Perform concrete-algorithm logic
7026 this._doProcessBlock(dataWords, offset);
7027 }
7028
7029 // Remove processed words
7030 var processedWords = dataWords.splice(0, nWordsReady);
7031 data.sigBytes -= nBytesReady;
7032 }
7033
7034 // Return processed words
7035 return new WordArray.init(processedWords, nBytesReady);
7036 },
7037
7038 /**
7039 * Creates a copy of this object.
7040 *
7041 * @return {Object} The clone.
7042 *
7043 * @example
7044 *
7045 * var clone = bufferedBlockAlgorithm.clone();
7046 */
7047 clone: function () {
7048 var clone = Base.clone.call(this);
7049 clone._data = this._data.clone();
7050
7051 return clone;
7052 },
7053
7054 _minBufferSize: 0
7055 });
7056
7057 /**
7058 * Abstract hasher template.
7059 *
7060 * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
7061 */
7062 var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
7063 /**
7064 * Configuration options.
7065 */
7066 cfg: Base.extend(),
7067
7068 /**
7069 * Initializes a newly created hasher.
7070 *
7071 * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
7072 *
7073 * @example
7074 *
7075 * var hasher = CryptoJS.algo.SHA256.create();
7076 */
7077 init: function (cfg) {
7078 // Apply config defaults
7079 this.cfg = this.cfg.extend(cfg);
7080
7081 // Set initial values
7082 this.reset();
7083 },
7084
7085 /**
7086 * Resets this hasher to its initial state.
7087 *
7088 * @example
7089 *
7090 * hasher.reset();
7091 */
7092 reset: function () {
7093 // Reset data buffer
7094 BufferedBlockAlgorithm.reset.call(this);
7095
7096 // Perform concrete-hasher logic
7097 this._doReset();
7098 },
7099
7100 /**
7101 * Updates this hasher with a message.
7102 *
7103 * @param {WordArray|string} messageUpdate The message to append.
7104 *
7105 * @return {Hasher} This hasher.
7106 *
7107 * @example
7108 *
7109 * hasher.update('message');
7110 * hasher.update(wordArray);
7111 */
7112 update: function (messageUpdate) {
7113 // Append
7114 this._append(messageUpdate);
7115
7116 // Update the hash
7117 this._process();
7118
7119 // Chainable
7120 return this;
7121 },
7122
7123 /**
7124 * Finalizes the hash computation.
7125 * Note that the finalize operation is effectively a destructive, read-once operation.
7126 *
7127 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7128 *
7129 * @return {WordArray} The hash.
7130 *
7131 * @example
7132 *
7133 * var hash = hasher.finalize();
7134 * var hash = hasher.finalize('message');
7135 * var hash = hasher.finalize(wordArray);
7136 */
7137 finalize: function (messageUpdate) {
7138 // Final message update
7139 if (messageUpdate) {
7140 this._append(messageUpdate);
7141 }
7142
7143 // Perform concrete-hasher logic
7144 var hash = this._doFinalize();
7145
7146 return hash;
7147 },
7148
7149 blockSize: 512/32,
7150
7151 /**
7152 * Creates a shortcut function to a hasher's object interface.
7153 *
7154 * @param {Hasher} hasher The hasher to create a helper for.
7155 *
7156 * @return {Function} The shortcut function.
7157 *
7158 * @static
7159 *
7160 * @example
7161 *
7162 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
7163 */
7164 _createHelper: function (hasher) {
7165 return function (message, cfg) {
7166 return new hasher.init(cfg).finalize(message);
7167 };
7168 },
7169
7170 /**
7171 * Creates a shortcut function to the HMAC's object interface.
7172 *
7173 * @param {Hasher} hasher The hasher to use in this HMAC helper.
7174 *
7175 * @return {Function} The shortcut function.
7176 *
7177 * @static
7178 *
7179 * @example
7180 *
7181 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
7182 */
7183 _createHmacHelper: function (hasher) {
7184 return function (message, key) {
7185 return new C_algo.HMAC.init(hasher, key).finalize(message);
7186 };
7187 }
7188 });
7189
7190 /**
7191 * Algorithm namespace.
7192 */
7193 var C_algo = C.algo = {};
7194
7195 return C;
7196 }(Math));
7197
7198
7199 return CryptoJS;
7200
7201 }));
7202 },{}],32:[function(_dereq_,module,exports){
7203 ;(function (root, factory) {
7204 if (typeof exports === "object") {
7205 // CommonJS
7206 module.exports = exports = factory(_dereq_("./core"));
7207 }
7208 else if (typeof define === "function" && define.amd) {
7209 // AMD
7210 define(["./core"], factory);
7211 }
7212 else {
7213 // Global (browser)
7214 factory(root.CryptoJS);
7215 }
7216 }(this, function (CryptoJS) {
7217
7218 (function () {
7219 // Shortcuts
7220 var C = CryptoJS;
7221 var C_lib = C.lib;
7222 var WordArray = C_lib.WordArray;
7223 var C_enc = C.enc;
7224
7225 /**
7226 * Base64 encoding strategy.
7227 */
7228 var Base64 = C_enc.Base64 = {
7229 /**
7230 * Converts a word array to a Base64 string.
7231 *
7232 * @param {WordArray} wordArray The word array.
7233 *
7234 * @return {string} The Base64 string.
7235 *
7236 * @static
7237 *
7238 * @example
7239 *
7240 * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
7241 */
7242 stringify: function (wordArray) {
7243 // Shortcuts
7244 var words = wordArray.words;
7245 var sigBytes = wordArray.sigBytes;
7246 var map = this._map;
7247
7248 // Clamp excess bits
7249 wordArray.clamp();
7250
7251 // Convert
7252 var base64Chars = [];
7253 for (var i = 0; i < sigBytes; i += 3) {
7254 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
7255 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
7256 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
7257
7258 var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
7259
7260 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
7261 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
7262 }
7263 }
7264
7265 // Add padding
7266 var paddingChar = map.charAt(64);
7267 if (paddingChar) {
7268 while (base64Chars.length % 4) {
7269 base64Chars.push(paddingChar);
7270 }
7271 }
7272
7273 return base64Chars.join('');
7274 },
7275
7276 /**
7277 * Converts a Base64 string to a word array.
7278 *
7279 * @param {string} base64Str The Base64 string.
7280 *
7281 * @return {WordArray} The word array.
7282 *
7283 * @static
7284 *
7285 * @example
7286 *
7287 * var wordArray = CryptoJS.enc.Base64.parse(base64String);
7288 */
7289 parse: function (base64Str) {
7290 // Shortcuts
7291 var base64StrLength = base64Str.length;
7292 var map = this._map;
7293
7294 // Ignore padding
7295 var paddingChar = map.charAt(64);
7296 if (paddingChar) {
7297 var paddingIndex = base64Str.indexOf(paddingChar);
7298 if (paddingIndex != -1) {
7299 base64StrLength = paddingIndex;
7300 }
7301 }
7302
7303 // Convert
7304 var words = [];
7305 var nBytes = 0;
7306 for (var i = 0; i < base64StrLength; i++) {
7307 if (i % 4) {
7308 var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
7309 var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
7310 words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
7311 nBytes++;
7312 }
7313 }
7314
7315 return WordArray.create(words, nBytes);
7316 },
7317
7318 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
7319 };
7320 }());
7321
7322
7323 return CryptoJS.enc.Base64;
7324
7325 }));
7326 },{"./core":31}],33:[function(_dereq_,module,exports){
7327 ;(function (root, factory) {
7328 if (typeof exports === "object") {
7329 // CommonJS
7330 module.exports = exports = factory(_dereq_("./core"));
7331 }
7332 else if (typeof define === "function" && define.amd) {
7333 // AMD
7334 define(["./core"], factory);
7335 }
7336 else {
7337 // Global (browser)
7338 factory(root.CryptoJS);
7339 }
7340 }(this, function (CryptoJS) {
7341
7342 (function () {
7343 // Shortcuts
7344 var C = CryptoJS;
7345 var C_lib = C.lib;
7346 var WordArray = C_lib.WordArray;
7347 var C_enc = C.enc;
7348
7349 /**
7350 * UTF-16 BE encoding strategy.
7351 */
7352 var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
7353 /**
7354 * Converts a word array to a UTF-16 BE string.
7355 *
7356 * @param {WordArray} wordArray The word array.
7357 *
7358 * @return {string} The UTF-16 BE string.
7359 *
7360 * @static
7361 *
7362 * @example
7363 *
7364 * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
7365 */
7366 stringify: function (wordArray) {
7367 // Shortcuts
7368 var words = wordArray.words;
7369 var sigBytes = wordArray.sigBytes;
7370
7371 // Convert
7372 var utf16Chars = [];
7373 for (var i = 0; i < sigBytes; i += 2) {
7374 var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
7375 utf16Chars.push(String.fromCharCode(codePoint));
7376 }
7377
7378 return utf16Chars.join('');
7379 },
7380
7381 /**
7382 * Converts a UTF-16 BE string to a word array.
7383 *
7384 * @param {string} utf16Str The UTF-16 BE string.
7385 *
7386 * @return {WordArray} The word array.
7387 *
7388 * @static
7389 *
7390 * @example
7391 *
7392 * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
7393 */
7394 parse: function (utf16Str) {
7395 // Shortcut
7396 var utf16StrLength = utf16Str.length;
7397
7398 // Convert
7399 var words = [];
7400 for (var i = 0; i < utf16StrLength; i++) {
7401 words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
7402 }
7403
7404 return WordArray.create(words, utf16StrLength * 2);
7405 }
7406 };
7407
7408 /**
7409 * UTF-16 LE encoding strategy.
7410 */
7411 C_enc.Utf16LE = {
7412 /**
7413 * Converts a word array to a UTF-16 LE string.
7414 *
7415 * @param {WordArray} wordArray The word array.
7416 *
7417 * @return {string} The UTF-16 LE string.
7418 *
7419 * @static
7420 *
7421 * @example
7422 *
7423 * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
7424 */
7425 stringify: function (wordArray) {
7426 // Shortcuts
7427 var words = wordArray.words;
7428 var sigBytes = wordArray.sigBytes;
7429
7430 // Convert
7431 var utf16Chars = [];
7432 for (var i = 0; i < sigBytes; i += 2) {
7433 var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
7434 utf16Chars.push(String.fromCharCode(codePoint));
7435 }
7436
7437 return utf16Chars.join('');
7438 },
7439
7440 /**
7441 * Converts a UTF-16 LE string to a word array.
7442 *
7443 * @param {string} utf16Str The UTF-16 LE string.
7444 *
7445 * @return {WordArray} The word array.
7446 *
7447 * @static
7448 *
7449 * @example
7450 *
7451 * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
7452 */
7453 parse: function (utf16Str) {
7454 // Shortcut
7455 var utf16StrLength = utf16Str.length;
7456
7457 // Convert
7458 var words = [];
7459 for (var i = 0; i < utf16StrLength; i++) {
7460 words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
7461 }
7462
7463 return WordArray.create(words, utf16StrLength * 2);
7464 }
7465 };
7466
7467 function swapEndian(word) {
7468 return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
7469 }
7470 }());
7471
7472
7473 return CryptoJS.enc.Utf16;
7474
7475 }));
7476 },{"./core":31}],34:[function(_dereq_,module,exports){
7477 ;(function (root, factory, undef) {
7478 if (typeof exports === "object") {
7479 // CommonJS
7480 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
7481 }
7482 else if (typeof define === "function" && define.amd) {
7483 // AMD
7484 define(["./core", "./sha1", "./hmac"], factory);
7485 }
7486 else {
7487 // Global (browser)
7488 factory(root.CryptoJS);
7489 }
7490 }(this, function (CryptoJS) {
7491
7492 (function () {
7493 // Shortcuts
7494 var C = CryptoJS;
7495 var C_lib = C.lib;
7496 var Base = C_lib.Base;
7497 var WordArray = C_lib.WordArray;
7498 var C_algo = C.algo;
7499 var MD5 = C_algo.MD5;
7500
7501 /**
7502 * This key derivation function is meant to conform with EVP_BytesToKey.
7503 * www.openssl.org/docs/crypto/EVP_BytesToKey.html
7504 */
7505 var EvpKDF = C_algo.EvpKDF = Base.extend({
7506 /**
7507 * Configuration options.
7508 *
7509 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
7510 * @property {Hasher} hasher The hash algorithm to use. Default: MD5
7511 * @property {number} iterations The number of iterations to perform. Default: 1
7512 */
7513 cfg: Base.extend({
7514 keySize: 128/32,
7515 hasher: MD5,
7516 iterations: 1
7517 }),
7518
7519 /**
7520 * Initializes a newly created key derivation function.
7521 *
7522 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
7523 *
7524 * @example
7525 *
7526 * var kdf = CryptoJS.algo.EvpKDF.create();
7527 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
7528 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
7529 */
7530 init: function (cfg) {
7531 this.cfg = this.cfg.extend(cfg);
7532 },
7533
7534 /**
7535 * Derives a key from a password.
7536 *
7537 * @param {WordArray|string} password The password.
7538 * @param {WordArray|string} salt A salt.
7539 *
7540 * @return {WordArray} The derived key.
7541 *
7542 * @example
7543 *
7544 * var key = kdf.compute(password, salt);
7545 */
7546 compute: function (password, salt) {
7547 // Shortcut
7548 var cfg = this.cfg;
7549
7550 // Init hasher
7551 var hasher = cfg.hasher.create();
7552
7553 // Initial values
7554 var derivedKey = WordArray.create();
7555
7556 // Shortcuts
7557 var derivedKeyWords = derivedKey.words;
7558 var keySize = cfg.keySize;
7559 var iterations = cfg.iterations;
7560
7561 // Generate key
7562 while (derivedKeyWords.length < keySize) {
7563 if (block) {
7564 hasher.update(block);
7565 }
7566 var block = hasher.update(password).finalize(salt);
7567 hasher.reset();
7568
7569 // Iterations
7570 for (var i = 1; i < iterations; i++) {
7571 block = hasher.finalize(block);
7572 hasher.reset();
7573 }
7574
7575 derivedKey.concat(block);
7576 }
7577 derivedKey.sigBytes = keySize * 4;
7578
7579 return derivedKey;
7580 }
7581 });
7582
7583 /**
7584 * Derives a key from a password.
7585 *
7586 * @param {WordArray|string} password The password.
7587 * @param {WordArray|string} salt A salt.
7588 * @param {Object} cfg (Optional) The configuration options to use for this computation.
7589 *
7590 * @return {WordArray} The derived key.
7591 *
7592 * @static
7593 *
7594 * @example
7595 *
7596 * var key = CryptoJS.EvpKDF(password, salt);
7597 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
7598 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
7599 */
7600 C.EvpKDF = function (password, salt, cfg) {
7601 return EvpKDF.create(cfg).compute(password, salt);
7602 };
7603 }());
7604
7605
7606 return CryptoJS.EvpKDF;
7607
7608 }));
7609 },{"./core":31,"./hmac":36,"./sha1":55}],35:[function(_dereq_,module,exports){
7610 ;(function (root, factory, undef) {
7611 if (typeof exports === "object") {
7612 // CommonJS
7613 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
7614 }
7615 else if (typeof define === "function" && define.amd) {
7616 // AMD
7617 define(["./core", "./cipher-core"], factory);
7618 }
7619 else {
7620 // Global (browser)
7621 factory(root.CryptoJS);
7622 }
7623 }(this, function (CryptoJS) {
7624
7625 (function (undefined) {
7626 // Shortcuts
7627 var C = CryptoJS;
7628 var C_lib = C.lib;
7629 var CipherParams = C_lib.CipherParams;
7630 var C_enc = C.enc;
7631 var Hex = C_enc.Hex;
7632 var C_format = C.format;
7633
7634 var HexFormatter = C_format.Hex = {
7635 /**
7636 * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
7637 *
7638 * @param {CipherParams} cipherParams The cipher params object.
7639 *
7640 * @return {string} The hexadecimally encoded string.
7641 *
7642 * @static
7643 *
7644 * @example
7645 *
7646 * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
7647 */
7648 stringify: function (cipherParams) {
7649 return cipherParams.ciphertext.toString(Hex);
7650 },
7651
7652 /**
7653 * Converts a hexadecimally encoded ciphertext string to a cipher params object.
7654 *
7655 * @param {string} input The hexadecimally encoded string.
7656 *
7657 * @return {CipherParams} The cipher params object.
7658 *
7659 * @static
7660 *
7661 * @example
7662 *
7663 * var cipherParams = CryptoJS.format.Hex.parse(hexString);
7664 */
7665 parse: function (input) {
7666 var ciphertext = Hex.parse(input);
7667 return CipherParams.create({ ciphertext: ciphertext });
7668 }
7669 };
7670 }());
7671
7672
7673 return CryptoJS.format.Hex;
7674
7675 }));
7676 },{"./cipher-core":30,"./core":31}],36:[function(_dereq_,module,exports){
7677 ;(function (root, factory) {
7678 if (typeof exports === "object") {
7679 // CommonJS
7680 module.exports = exports = factory(_dereq_("./core"));
7681 }
7682 else if (typeof define === "function" && define.amd) {
7683 // AMD
7684 define(["./core"], factory);
7685 }
7686 else {
7687 // Global (browser)
7688 factory(root.CryptoJS);
7689 }
7690 }(this, function (CryptoJS) {
7691
7692 (function () {
7693 // Shortcuts
7694 var C = CryptoJS;
7695 var C_lib = C.lib;
7696 var Base = C_lib.Base;
7697 var C_enc = C.enc;
7698 var Utf8 = C_enc.Utf8;
7699 var C_algo = C.algo;
7700
7701 /**
7702 * HMAC algorithm.
7703 */
7704 var HMAC = C_algo.HMAC = Base.extend({
7705 /**
7706 * Initializes a newly created HMAC.
7707 *
7708 * @param {Hasher} hasher The hash algorithm to use.
7709 * @param {WordArray|string} key The secret key.
7710 *
7711 * @example
7712 *
7713 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
7714 */
7715 init: function (hasher, key) {
7716 // Init hasher
7717 hasher = this._hasher = new hasher.init();
7718
7719 // Convert string to WordArray, else assume WordArray already
7720 if (typeof key == 'string') {
7721 key = Utf8.parse(key);
7722 }
7723
7724 // Shortcuts
7725 var hasherBlockSize = hasher.blockSize;
7726 var hasherBlockSizeBytes = hasherBlockSize * 4;
7727
7728 // Allow arbitrary length keys
7729 if (key.sigBytes > hasherBlockSizeBytes) {
7730 key = hasher.finalize(key);
7731 }
7732
7733 // Clamp excess bits
7734 key.clamp();
7735
7736 // Clone key for inner and outer pads
7737 var oKey = this._oKey = key.clone();
7738 var iKey = this._iKey = key.clone();
7739
7740 // Shortcuts
7741 var oKeyWords = oKey.words;
7742 var iKeyWords = iKey.words;
7743
7744 // XOR keys with pad constants
7745 for (var i = 0; i < hasherBlockSize; i++) {
7746 oKeyWords[i] ^= 0x5c5c5c5c;
7747 iKeyWords[i] ^= 0x36363636;
7748 }
7749 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
7750
7751 // Set initial values
7752 this.reset();
7753 },
7754
7755 /**
7756 * Resets this HMAC to its initial state.
7757 *
7758 * @example
7759 *
7760 * hmacHasher.reset();
7761 */
7762 reset: function () {
7763 // Shortcut
7764 var hasher = this._hasher;
7765
7766 // Reset
7767 hasher.reset();
7768 hasher.update(this._iKey);
7769 },
7770
7771 /**
7772 * Updates this HMAC with a message.
7773 *
7774 * @param {WordArray|string} messageUpdate The message to append.
7775 *
7776 * @return {HMAC} This HMAC instance.
7777 *
7778 * @example
7779 *
7780 * hmacHasher.update('message');
7781 * hmacHasher.update(wordArray);
7782 */
7783 update: function (messageUpdate) {
7784 this._hasher.update(messageUpdate);
7785
7786 // Chainable
7787 return this;
7788 },
7789
7790 /**
7791 * Finalizes the HMAC computation.
7792 * Note that the finalize operation is effectively a destructive, read-once operation.
7793 *
7794 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7795 *
7796 * @return {WordArray} The HMAC.
7797 *
7798 * @example
7799 *
7800 * var hmac = hmacHasher.finalize();
7801 * var hmac = hmacHasher.finalize('message');
7802 * var hmac = hmacHasher.finalize(wordArray);
7803 */
7804 finalize: function (messageUpdate) {
7805 // Shortcut
7806 var hasher = this._hasher;
7807
7808 // Compute HMAC
7809 var innerHash = hasher.finalize(messageUpdate);
7810 hasher.reset();
7811 var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
7812
7813 return hmac;
7814 }
7815 });
7816 }());
7817
7818
7819 }));
7820 },{"./core":31}],37:[function(_dereq_,module,exports){
7821 ;(function (root, factory, undef) {
7822 if (typeof exports === "object") {
7823 // CommonJS
7824 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./lib-typedarrays"), _dereq_("./enc-utf16"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./sha1"), _dereq_("./sha256"), _dereq_("./sha224"), _dereq_("./sha512"), _dereq_("./sha384"), _dereq_("./sha3"), _dereq_("./ripemd160"), _dereq_("./hmac"), _dereq_("./pbkdf2"), _dereq_("./evpkdf"), _dereq_("./cipher-core"), _dereq_("./mode-cfb"), _dereq_("./mode-ctr"), _dereq_("./mode-ctr-gladman"), _dereq_("./mode-ofb"), _dereq_("./mode-ecb"), _dereq_("./pad-ansix923"), _dereq_("./pad-iso10126"), _dereq_("./pad-iso97971"), _dereq_("./pad-zeropadding"), _dereq_("./pad-nopadding"), _dereq_("./format-hex"), _dereq_("./aes"), _dereq_("./tripledes"), _dereq_("./rc4"), _dereq_("./rabbit"), _dereq_("./rabbit-legacy"));
7825 }
7826 else if (typeof define === "function" && define.amd) {
7827 // AMD
7828 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);
7829 }
7830 else {
7831 // Global (browser)
7832 factory(root.CryptoJS);
7833 }
7834 }(this, function (CryptoJS) {
7835
7836 return CryptoJS;
7837
7838 }));
7839 },{"./aes":29,"./cipher-core":30,"./core":31,"./enc-base64":32,"./enc-utf16":33,"./evpkdf":34,"./format-hex":35,"./hmac":36,"./lib-typedarrays":38,"./md5":39,"./mode-cfb":40,"./mode-ctr":42,"./mode-ctr-gladman":41,"./mode-ecb":43,"./mode-ofb":44,"./pad-ansix923":45,"./pad-iso10126":46,"./pad-iso97971":47,"./pad-nopadding":48,"./pad-zeropadding":49,"./pbkdf2":50,"./rabbit":52,"./rabbit-legacy":51,"./rc4":53,"./ripemd160":54,"./sha1":55,"./sha224":56,"./sha256":57,"./sha3":58,"./sha384":59,"./sha512":60,"./tripledes":61,"./x64-core":62}],38:[function(_dereq_,module,exports){
7840 ;(function (root, factory) {
7841 if (typeof exports === "object") {
7842 // CommonJS
7843 module.exports = exports = factory(_dereq_("./core"));
7844 }
7845 else if (typeof define === "function" && define.amd) {
7846 // AMD
7847 define(["./core"], factory);
7848 }
7849 else {
7850 // Global (browser)
7851 factory(root.CryptoJS);
7852 }
7853 }(this, function (CryptoJS) {
7854
7855 (function () {
7856 // Check if typed arrays are supported
7857 if (typeof ArrayBuffer != 'function') {
7858 return;
7859 }
7860
7861 // Shortcuts
7862 var C = CryptoJS;
7863 var C_lib = C.lib;
7864 var WordArray = C_lib.WordArray;
7865
7866 // Reference original init
7867 var superInit = WordArray.init;
7868
7869 // Augment WordArray.init to handle typed arrays
7870 var subInit = WordArray.init = function (typedArray) {
7871 // Convert buffers to uint8
7872 if (typedArray instanceof ArrayBuffer) {
7873 typedArray = new Uint8Array(typedArray);
7874 }
7875
7876 // Convert other array views to uint8
7877 if (
7878 typedArray instanceof Int8Array ||
7879 typedArray instanceof Uint8ClampedArray ||
7880 typedArray instanceof Int16Array ||
7881 typedArray instanceof Uint16Array ||
7882 typedArray instanceof Int32Array ||
7883 typedArray instanceof Uint32Array ||
7884 typedArray instanceof Float32Array ||
7885 typedArray instanceof Float64Array
7886 ) {
7887 typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
7888 }
7889
7890 // Handle Uint8Array
7891 if (typedArray instanceof Uint8Array) {
7892 // Shortcut
7893 var typedArrayByteLength = typedArray.byteLength;
7894
7895 // Extract bytes
7896 var words = [];
7897 for (var i = 0; i < typedArrayByteLength; i++) {
7898 words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
7899 }
7900
7901 // Initialize this word array
7902 superInit.call(this, words, typedArrayByteLength);
7903 } else {
7904 // Else call normal init
7905 superInit.apply(this, arguments);
7906 }
7907 };
7908
7909 subInit.prototype = WordArray;
7910 }());
7911
7912
7913 return CryptoJS.lib.WordArray;
7914
7915 }));
7916 },{"./core":31}],39:[function(_dereq_,module,exports){
7917 ;(function (root, factory) {
7918 if (typeof exports === "object") {
7919 // CommonJS
7920 module.exports = exports = factory(_dereq_("./core"));
7921 }
7922 else if (typeof define === "function" && define.amd) {
7923 // AMD
7924 define(["./core"], factory);
7925 }
7926 else {
7927 // Global (browser)
7928 factory(root.CryptoJS);
7929 }
7930 }(this, function (CryptoJS) {
7931
7932 (function (Math) {
7933 // Shortcuts
7934 var C = CryptoJS;
7935 var C_lib = C.lib;
7936 var WordArray = C_lib.WordArray;
7937 var Hasher = C_lib.Hasher;
7938 var C_algo = C.algo;
7939
7940 // Constants table
7941 var T = [];
7942
7943 // Compute constants
7944 (function () {
7945 for (var i = 0; i < 64; i++) {
7946 T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
7947 }
7948 }());
7949
7950 /**
7951 * MD5 hash algorithm.
7952 */
7953 var MD5 = C_algo.MD5 = Hasher.extend({
7954 _doReset: function () {
7955 this._hash = new WordArray.init([
7956 0x67452301, 0xefcdab89,
7957 0x98badcfe, 0x10325476
7958 ]);
7959 },
7960
7961 _doProcessBlock: function (M, offset) {
7962 // Swap endian
7963 for (var i = 0; i < 16; i++) {
7964 // Shortcuts
7965 var offset_i = offset + i;
7966 var M_offset_i = M[offset_i];
7967
7968 M[offset_i] = (
7969 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
7970 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
7971 );
7972 }
7973
7974 // Shortcuts
7975 var H = this._hash.words;
7976
7977 var M_offset_0 = M[offset + 0];
7978 var M_offset_1 = M[offset + 1];
7979 var M_offset_2 = M[offset + 2];
7980 var M_offset_3 = M[offset + 3];
7981 var M_offset_4 = M[offset + 4];
7982 var M_offset_5 = M[offset + 5];
7983 var M_offset_6 = M[offset + 6];
7984 var M_offset_7 = M[offset + 7];
7985 var M_offset_8 = M[offset + 8];
7986 var M_offset_9 = M[offset + 9];
7987 var M_offset_10 = M[offset + 10];
7988 var M_offset_11 = M[offset + 11];
7989 var M_offset_12 = M[offset + 12];
7990 var M_offset_13 = M[offset + 13];
7991 var M_offset_14 = M[offset + 14];
7992 var M_offset_15 = M[offset + 15];
7993
7994 // Working varialbes
7995 var a = H[0];
7996 var b = H[1];
7997 var c = H[2];
7998 var d = H[3];
7999
8000 // Computation
8001 a = FF(a, b, c, d, M_offset_0, 7, T[0]);
8002 d = FF(d, a, b, c, M_offset_1, 12, T[1]);
8003 c = FF(c, d, a, b, M_offset_2, 17, T[2]);
8004 b = FF(b, c, d, a, M_offset_3, 22, T[3]);
8005 a = FF(a, b, c, d, M_offset_4, 7, T[4]);
8006 d = FF(d, a, b, c, M_offset_5, 12, T[5]);
8007 c = FF(c, d, a, b, M_offset_6, 17, T[6]);
8008 b = FF(b, c, d, a, M_offset_7, 22, T[7]);
8009 a = FF(a, b, c, d, M_offset_8, 7, T[8]);
8010 d = FF(d, a, b, c, M_offset_9, 12, T[9]);
8011 c = FF(c, d, a, b, M_offset_10, 17, T[10]);
8012 b = FF(b, c, d, a, M_offset_11, 22, T[11]);
8013 a = FF(a, b, c, d, M_offset_12, 7, T[12]);
8014 d = FF(d, a, b, c, M_offset_13, 12, T[13]);
8015 c = FF(c, d, a, b, M_offset_14, 17, T[14]);
8016 b = FF(b, c, d, a, M_offset_15, 22, T[15]);
8017
8018 a = GG(a, b, c, d, M_offset_1, 5, T[16]);
8019 d = GG(d, a, b, c, M_offset_6, 9, T[17]);
8020 c = GG(c, d, a, b, M_offset_11, 14, T[18]);
8021 b = GG(b, c, d, a, M_offset_0, 20, T[19]);
8022 a = GG(a, b, c, d, M_offset_5, 5, T[20]);
8023 d = GG(d, a, b, c, M_offset_10, 9, T[21]);
8024 c = GG(c, d, a, b, M_offset_15, 14, T[22]);
8025 b = GG(b, c, d, a, M_offset_4, 20, T[23]);
8026 a = GG(a, b, c, d, M_offset_9, 5, T[24]);
8027 d = GG(d, a, b, c, M_offset_14, 9, T[25]);
8028 c = GG(c, d, a, b, M_offset_3, 14, T[26]);
8029 b = GG(b, c, d, a, M_offset_8, 20, T[27]);
8030 a = GG(a, b, c, d, M_offset_13, 5, T[28]);
8031 d = GG(d, a, b, c, M_offset_2, 9, T[29]);
8032 c = GG(c, d, a, b, M_offset_7, 14, T[30]);
8033 b = GG(b, c, d, a, M_offset_12, 20, T[31]);
8034
8035 a = HH(a, b, c, d, M_offset_5, 4, T[32]);
8036 d = HH(d, a, b, c, M_offset_8, 11, T[33]);
8037 c = HH(c, d, a, b, M_offset_11, 16, T[34]);
8038 b = HH(b, c, d, a, M_offset_14, 23, T[35]);
8039 a = HH(a, b, c, d, M_offset_1, 4, T[36]);
8040 d = HH(d, a, b, c, M_offset_4, 11, T[37]);
8041 c = HH(c, d, a, b, M_offset_7, 16, T[38]);
8042 b = HH(b, c, d, a, M_offset_10, 23, T[39]);
8043 a = HH(a, b, c, d, M_offset_13, 4, T[40]);
8044 d = HH(d, a, b, c, M_offset_0, 11, T[41]);
8045 c = HH(c, d, a, b, M_offset_3, 16, T[42]);
8046 b = HH(b, c, d, a, M_offset_6, 23, T[43]);
8047 a = HH(a, b, c, d, M_offset_9, 4, T[44]);
8048 d = HH(d, a, b, c, M_offset_12, 11, T[45]);
8049 c = HH(c, d, a, b, M_offset_15, 16, T[46]);
8050 b = HH(b, c, d, a, M_offset_2, 23, T[47]);
8051
8052 a = II(a, b, c, d, M_offset_0, 6, T[48]);
8053 d = II(d, a, b, c, M_offset_7, 10, T[49]);
8054 c = II(c, d, a, b, M_offset_14, 15, T[50]);
8055 b = II(b, c, d, a, M_offset_5, 21, T[51]);
8056 a = II(a, b, c, d, M_offset_12, 6, T[52]);
8057 d = II(d, a, b, c, M_offset_3, 10, T[53]);
8058 c = II(c, d, a, b, M_offset_10, 15, T[54]);
8059 b = II(b, c, d, a, M_offset_1, 21, T[55]);
8060 a = II(a, b, c, d, M_offset_8, 6, T[56]);
8061 d = II(d, a, b, c, M_offset_15, 10, T[57]);
8062 c = II(c, d, a, b, M_offset_6, 15, T[58]);
8063 b = II(b, c, d, a, M_offset_13, 21, T[59]);
8064 a = II(a, b, c, d, M_offset_4, 6, T[60]);
8065 d = II(d, a, b, c, M_offset_11, 10, T[61]);
8066 c = II(c, d, a, b, M_offset_2, 15, T[62]);
8067 b = II(b, c, d, a, M_offset_9, 21, T[63]);
8068
8069 // Intermediate hash value
8070 H[0] = (H[0] + a) | 0;
8071 H[1] = (H[1] + b) | 0;
8072 H[2] = (H[2] + c) | 0;
8073 H[3] = (H[3] + d) | 0;
8074 },
8075
8076 _doFinalize: function () {
8077 // Shortcuts
8078 var data = this._data;
8079 var dataWords = data.words;
8080
8081 var nBitsTotal = this._nDataBytes * 8;
8082 var nBitsLeft = data.sigBytes * 8;
8083
8084 // Add padding
8085 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
8086
8087 var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
8088 var nBitsTotalL = nBitsTotal;
8089 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
8090 (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
8091 (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
8092 );
8093 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
8094 (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
8095 (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
8096 );
8097
8098 data.sigBytes = (dataWords.length + 1) * 4;
8099
8100 // Hash final blocks
8101 this._process();
8102
8103 // Shortcuts
8104 var hash = this._hash;
8105 var H = hash.words;
8106
8107 // Swap endian
8108 for (var i = 0; i < 4; i++) {
8109 // Shortcut
8110 var H_i = H[i];
8111
8112 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
8113 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
8114 }
8115
8116 // Return final computed hash
8117 return hash;
8118 },
8119
8120 clone: function () {
8121 var clone = Hasher.clone.call(this);
8122 clone._hash = this._hash.clone();
8123
8124 return clone;
8125 }
8126 });
8127
8128 function FF(a, b, c, d, x, s, t) {
8129 var n = a + ((b & c) | (~b & d)) + x + t;
8130 return ((n << s) | (n >>> (32 - s))) + b;
8131 }
8132
8133 function GG(a, b, c, d, x, s, t) {
8134 var n = a + ((b & d) | (c & ~d)) + x + t;
8135 return ((n << s) | (n >>> (32 - s))) + b;
8136 }
8137
8138 function HH(a, b, c, d, x, s, t) {
8139 var n = a + (b ^ c ^ d) + x + t;
8140 return ((n << s) | (n >>> (32 - s))) + b;
8141 }
8142
8143 function II(a, b, c, d, x, s, t) {
8144 var n = a + (c ^ (b | ~d)) + x + t;
8145 return ((n << s) | (n >>> (32 - s))) + b;
8146 }
8147
8148 /**
8149 * Shortcut function to the hasher's object interface.
8150 *
8151 * @param {WordArray|string} message The message to hash.
8152 *
8153 * @return {WordArray} The hash.
8154 *
8155 * @static
8156 *
8157 * @example
8158 *
8159 * var hash = CryptoJS.MD5('message');
8160 * var hash = CryptoJS.MD5(wordArray);
8161 */
8162 C.MD5 = Hasher._createHelper(MD5);
8163
8164 /**
8165 * Shortcut function to the HMAC's object interface.
8166 *
8167 * @param {WordArray|string} message The message to hash.
8168 * @param {WordArray|string} key The secret key.
8169 *
8170 * @return {WordArray} The HMAC.
8171 *
8172 * @static
8173 *
8174 * @example
8175 *
8176 * var hmac = CryptoJS.HmacMD5(message, key);
8177 */
8178 C.HmacMD5 = Hasher._createHmacHelper(MD5);
8179 }(Math));
8180
8181
8182 return CryptoJS.MD5;
8183
8184 }));
8185 },{"./core":31}],40:[function(_dereq_,module,exports){
8186 ;(function (root, factory, undef) {
8187 if (typeof exports === "object") {
8188 // CommonJS
8189 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8190 }
8191 else if (typeof define === "function" && define.amd) {
8192 // AMD
8193 define(["./core", "./cipher-core"], factory);
8194 }
8195 else {
8196 // Global (browser)
8197 factory(root.CryptoJS);
8198 }
8199 }(this, function (CryptoJS) {
8200
8201 /**
8202 * Cipher Feedback block mode.
8203 */
8204 CryptoJS.mode.CFB = (function () {
8205 var CFB = CryptoJS.lib.BlockCipherMode.extend();
8206
8207 CFB.Encryptor = CFB.extend({
8208 processBlock: function (words, offset) {
8209 // Shortcuts
8210 var cipher = this._cipher;
8211 var blockSize = cipher.blockSize;
8212
8213 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8214
8215 // Remember this block to use with next block
8216 this._prevBlock = words.slice(offset, offset + blockSize);
8217 }
8218 });
8219
8220 CFB.Decryptor = CFB.extend({
8221 processBlock: function (words, offset) {
8222 // Shortcuts
8223 var cipher = this._cipher;
8224 var blockSize = cipher.blockSize;
8225
8226 // Remember this block to use with next block
8227 var thisBlock = words.slice(offset, offset + blockSize);
8228
8229 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8230
8231 // This block becomes the previous block
8232 this._prevBlock = thisBlock;
8233 }
8234 });
8235
8236 function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
8237 // Shortcut
8238 var iv = this._iv;
8239
8240 // Generate keystream
8241 if (iv) {
8242 var keystream = iv.slice(0);
8243
8244 // Remove IV for subsequent blocks
8245 this._iv = undefined;
8246 } else {
8247 var keystream = this._prevBlock;
8248 }
8249 cipher.encryptBlock(keystream, 0);
8250
8251 // Encrypt
8252 for (var i = 0; i < blockSize; i++) {
8253 words[offset + i] ^= keystream[i];
8254 }
8255 }
8256
8257 return CFB;
8258 }());
8259
8260
8261 return CryptoJS.mode.CFB;
8262
8263 }));
8264 },{"./cipher-core":30,"./core":31}],41:[function(_dereq_,module,exports){
8265 ;(function (root, factory, undef) {
8266 if (typeof exports === "object") {
8267 // CommonJS
8268 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8269 }
8270 else if (typeof define === "function" && define.amd) {
8271 // AMD
8272 define(["./core", "./cipher-core"], factory);
8273 }
8274 else {
8275 // Global (browser)
8276 factory(root.CryptoJS);
8277 }
8278 }(this, function (CryptoJS) {
8279
8280 /** @preserve
8281 * Counter block mode compatible with Dr Brian Gladman fileenc.c
8282 * derived from CryptoJS.mode.CTR
8283 * Jan Hruby jhruby.web@gmail.com
8284 */
8285 CryptoJS.mode.CTRGladman = (function () {
8286 var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
8287
8288 function incWord(word)
8289 {
8290 if (((word >> 24) & 0xff) === 0xff) { //overflow
8291 var b1 = (word >> 16)&0xff;
8292 var b2 = (word >> 8)&0xff;
8293 var b3 = word & 0xff;
8294
8295 if (b1 === 0xff) // overflow b1
8296 {
8297 b1 = 0;
8298 if (b2 === 0xff)
8299 {
8300 b2 = 0;
8301 if (b3 === 0xff)
8302 {
8303 b3 = 0;
8304 }
8305 else
8306 {
8307 ++b3;
8308 }
8309 }
8310 else
8311 {
8312 ++b2;
8313 }
8314 }
8315 else
8316 {
8317 ++b1;
8318 }
8319
8320 word = 0;
8321 word += (b1 << 16);
8322 word += (b2 << 8);
8323 word += b3;
8324 }
8325 else
8326 {
8327 word += (0x01 << 24);
8328 }
8329 return word;
8330 }
8331
8332 function incCounter(counter)
8333 {
8334 if ((counter[0] = incWord(counter[0])) === 0)
8335 {
8336 // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
8337 counter[1] = incWord(counter[1]);
8338 }
8339 return counter;
8340 }
8341
8342 var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
8343 processBlock: function (words, offset) {
8344 // Shortcuts
8345 var cipher = this._cipher
8346 var blockSize = cipher.blockSize;
8347 var iv = this._iv;
8348 var counter = this._counter;
8349
8350 // Generate keystream
8351 if (iv) {
8352 counter = this._counter = iv.slice(0);
8353
8354 // Remove IV for subsequent blocks
8355 this._iv = undefined;
8356 }
8357
8358 incCounter(counter);
8359
8360 var keystream = counter.slice(0);
8361 cipher.encryptBlock(keystream, 0);
8362
8363 // Encrypt
8364 for (var i = 0; i < blockSize; i++) {
8365 words[offset + i] ^= keystream[i];
8366 }
8367 }
8368 });
8369
8370 CTRGladman.Decryptor = Encryptor;
8371
8372 return CTRGladman;
8373 }());
8374
8375
8376
8377
8378 return CryptoJS.mode.CTRGladman;
8379
8380 }));
8381 },{"./cipher-core":30,"./core":31}],42:[function(_dereq_,module,exports){
8382 ;(function (root, factory, undef) {
8383 if (typeof exports === "object") {
8384 // CommonJS
8385 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8386 }
8387 else if (typeof define === "function" && define.amd) {
8388 // AMD
8389 define(["./core", "./cipher-core"], factory);
8390 }
8391 else {
8392 // Global (browser)
8393 factory(root.CryptoJS);
8394 }
8395 }(this, function (CryptoJS) {
8396
8397 /**
8398 * Counter block mode.
8399 */
8400 CryptoJS.mode.CTR = (function () {
8401 var CTR = CryptoJS.lib.BlockCipherMode.extend();
8402
8403 var Encryptor = CTR.Encryptor = CTR.extend({
8404 processBlock: function (words, offset) {
8405 // Shortcuts
8406 var cipher = this._cipher
8407 var blockSize = cipher.blockSize;
8408 var iv = this._iv;
8409 var counter = this._counter;
8410
8411 // Generate keystream
8412 if (iv) {
8413 counter = this._counter = iv.slice(0);
8414
8415 // Remove IV for subsequent blocks
8416 this._iv = undefined;
8417 }
8418 var keystream = counter.slice(0);
8419 cipher.encryptBlock(keystream, 0);
8420
8421 // Increment counter
8422 counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
8423
8424 // Encrypt
8425 for (var i = 0; i < blockSize; i++) {
8426 words[offset + i] ^= keystream[i];
8427 }
8428 }
8429 });
8430
8431 CTR.Decryptor = Encryptor;
8432
8433 return CTR;
8434 }());
8435
8436
8437 return CryptoJS.mode.CTR;
8438
8439 }));
8440 },{"./cipher-core":30,"./core":31}],43:[function(_dereq_,module,exports){
8441 ;(function (root, factory, undef) {
8442 if (typeof exports === "object") {
8443 // CommonJS
8444 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8445 }
8446 else if (typeof define === "function" && define.amd) {
8447 // AMD
8448 define(["./core", "./cipher-core"], factory);
8449 }
8450 else {
8451 // Global (browser)
8452 factory(root.CryptoJS);
8453 }
8454 }(this, function (CryptoJS) {
8455
8456 /**
8457 * Electronic Codebook block mode.
8458 */
8459 CryptoJS.mode.ECB = (function () {
8460 var ECB = CryptoJS.lib.BlockCipherMode.extend();
8461
8462 ECB.Encryptor = ECB.extend({
8463 processBlock: function (words, offset) {
8464 this._cipher.encryptBlock(words, offset);
8465 }
8466 });
8467
8468 ECB.Decryptor = ECB.extend({
8469 processBlock: function (words, offset) {
8470 this._cipher.decryptBlock(words, offset);
8471 }
8472 });
8473
8474 return ECB;
8475 }());
8476
8477
8478 return CryptoJS.mode.ECB;
8479
8480 }));
8481 },{"./cipher-core":30,"./core":31}],44:[function(_dereq_,module,exports){
8482 ;(function (root, factory, undef) {
8483 if (typeof exports === "object") {
8484 // CommonJS
8485 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8486 }
8487 else if (typeof define === "function" && define.amd) {
8488 // AMD
8489 define(["./core", "./cipher-core"], factory);
8490 }
8491 else {
8492 // Global (browser)
8493 factory(root.CryptoJS);
8494 }
8495 }(this, function (CryptoJS) {
8496
8497 /**
8498 * Output Feedback block mode.
8499 */
8500 CryptoJS.mode.OFB = (function () {
8501 var OFB = CryptoJS.lib.BlockCipherMode.extend();
8502
8503 var Encryptor = OFB.Encryptor = OFB.extend({
8504 processBlock: function (words, offset) {
8505 // Shortcuts
8506 var cipher = this._cipher
8507 var blockSize = cipher.blockSize;
8508 var iv = this._iv;
8509 var keystream = this._keystream;
8510
8511 // Generate keystream
8512 if (iv) {
8513 keystream = this._keystream = iv.slice(0);
8514
8515 // Remove IV for subsequent blocks
8516 this._iv = undefined;
8517 }
8518 cipher.encryptBlock(keystream, 0);
8519
8520 // Encrypt
8521 for (var i = 0; i < blockSize; i++) {
8522 words[offset + i] ^= keystream[i];
8523 }
8524 }
8525 });
8526
8527 OFB.Decryptor = Encryptor;
8528
8529 return OFB;
8530 }());
8531
8532
8533 return CryptoJS.mode.OFB;
8534
8535 }));
8536 },{"./cipher-core":30,"./core":31}],45:[function(_dereq_,module,exports){
8537 ;(function (root, factory, undef) {
8538 if (typeof exports === "object") {
8539 // CommonJS
8540 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8541 }
8542 else if (typeof define === "function" && define.amd) {
8543 // AMD
8544 define(["./core", "./cipher-core"], factory);
8545 }
8546 else {
8547 // Global (browser)
8548 factory(root.CryptoJS);
8549 }
8550 }(this, function (CryptoJS) {
8551
8552 /**
8553 * ANSI X.923 padding strategy.
8554 */
8555 CryptoJS.pad.AnsiX923 = {
8556 pad: function (data, blockSize) {
8557 // Shortcuts
8558 var dataSigBytes = data.sigBytes;
8559 var blockSizeBytes = blockSize * 4;
8560
8561 // Count padding bytes
8562 var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
8563
8564 // Compute last byte position
8565 var lastBytePos = dataSigBytes + nPaddingBytes - 1;
8566
8567 // Pad
8568 data.clamp();
8569 data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
8570 data.sigBytes += nPaddingBytes;
8571 },
8572
8573 unpad: function (data) {
8574 // Get number of padding bytes from last byte
8575 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8576
8577 // Remove padding
8578 data.sigBytes -= nPaddingBytes;
8579 }
8580 };
8581
8582
8583 return CryptoJS.pad.Ansix923;
8584
8585 }));
8586 },{"./cipher-core":30,"./core":31}],46:[function(_dereq_,module,exports){
8587 ;(function (root, factory, undef) {
8588 if (typeof exports === "object") {
8589 // CommonJS
8590 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8591 }
8592 else if (typeof define === "function" && define.amd) {
8593 // AMD
8594 define(["./core", "./cipher-core"], factory);
8595 }
8596 else {
8597 // Global (browser)
8598 factory(root.CryptoJS);
8599 }
8600 }(this, function (CryptoJS) {
8601
8602 /**
8603 * ISO 10126 padding strategy.
8604 */
8605 CryptoJS.pad.Iso10126 = {
8606 pad: function (data, blockSize) {
8607 // Shortcut
8608 var blockSizeBytes = blockSize * 4;
8609
8610 // Count padding bytes
8611 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
8612
8613 // Pad
8614 data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
8615 concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
8616 },
8617
8618 unpad: function (data) {
8619 // Get number of padding bytes from last byte
8620 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8621
8622 // Remove padding
8623 data.sigBytes -= nPaddingBytes;
8624 }
8625 };
8626
8627
8628 return CryptoJS.pad.Iso10126;
8629
8630 }));
8631 },{"./cipher-core":30,"./core":31}],47:[function(_dereq_,module,exports){
8632 ;(function (root, factory, undef) {
8633 if (typeof exports === "object") {
8634 // CommonJS
8635 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8636 }
8637 else if (typeof define === "function" && define.amd) {
8638 // AMD
8639 define(["./core", "./cipher-core"], factory);
8640 }
8641 else {
8642 // Global (browser)
8643 factory(root.CryptoJS);
8644 }
8645 }(this, function (CryptoJS) {
8646
8647 /**
8648 * ISO/IEC 9797-1 Padding Method 2.
8649 */
8650 CryptoJS.pad.Iso97971 = {
8651 pad: function (data, blockSize) {
8652 // Add 0x80 byte
8653 data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
8654
8655 // Zero pad the rest
8656 CryptoJS.pad.ZeroPadding.pad(data, blockSize);
8657 },
8658
8659 unpad: function (data) {
8660 // Remove zero padding
8661 CryptoJS.pad.ZeroPadding.unpad(data);
8662
8663 // Remove one more byte -- the 0x80 byte
8664 data.sigBytes--;
8665 }
8666 };
8667
8668
8669 return CryptoJS.pad.Iso97971;
8670
8671 }));
8672 },{"./cipher-core":30,"./core":31}],48:[function(_dereq_,module,exports){
8673 ;(function (root, factory, undef) {
8674 if (typeof exports === "object") {
8675 // CommonJS
8676 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8677 }
8678 else if (typeof define === "function" && define.amd) {
8679 // AMD
8680 define(["./core", "./cipher-core"], factory);
8681 }
8682 else {
8683 // Global (browser)
8684 factory(root.CryptoJS);
8685 }
8686 }(this, function (CryptoJS) {
8687
8688 /**
8689 * A noop padding strategy.
8690 */
8691 CryptoJS.pad.NoPadding = {
8692 pad: function () {
8693 },
8694
8695 unpad: function () {
8696 }
8697 };
8698
8699
8700 return CryptoJS.pad.NoPadding;
8701
8702 }));
8703 },{"./cipher-core":30,"./core":31}],49:[function(_dereq_,module,exports){
8704 ;(function (root, factory, undef) {
8705 if (typeof exports === "object") {
8706 // CommonJS
8707 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8708 }
8709 else if (typeof define === "function" && define.amd) {
8710 // AMD
8711 define(["./core", "./cipher-core"], factory);
8712 }
8713 else {
8714 // Global (browser)
8715 factory(root.CryptoJS);
8716 }
8717 }(this, function (CryptoJS) {
8718
8719 /**
8720 * Zero padding strategy.
8721 */
8722 CryptoJS.pad.ZeroPadding = {
8723 pad: function (data, blockSize) {
8724 // Shortcut
8725 var blockSizeBytes = blockSize * 4;
8726
8727 // Pad
8728 data.clamp();
8729 data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
8730 },
8731
8732 unpad: function (data) {
8733 // Shortcut
8734 var dataWords = data.words;
8735
8736 // Unpad
8737 var i = data.sigBytes - 1;
8738 while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
8739 i--;
8740 }
8741 data.sigBytes = i + 1;
8742 }
8743 };
8744
8745
8746 return CryptoJS.pad.ZeroPadding;
8747
8748 }));
8749 },{"./cipher-core":30,"./core":31}],50:[function(_dereq_,module,exports){
8750 ;(function (root, factory, undef) {
8751 if (typeof exports === "object") {
8752 // CommonJS
8753 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
8754 }
8755 else if (typeof define === "function" && define.amd) {
8756 // AMD
8757 define(["./core", "./sha1", "./hmac"], factory);
8758 }
8759 else {
8760 // Global (browser)
8761 factory(root.CryptoJS);
8762 }
8763 }(this, function (CryptoJS) {
8764
8765 (function () {
8766 // Shortcuts
8767 var C = CryptoJS;
8768 var C_lib = C.lib;
8769 var Base = C_lib.Base;
8770 var WordArray = C_lib.WordArray;
8771 var C_algo = C.algo;
8772 var SHA1 = C_algo.SHA1;
8773 var HMAC = C_algo.HMAC;
8774
8775 /**
8776 * Password-Based Key Derivation Function 2 algorithm.
8777 */
8778 var PBKDF2 = C_algo.PBKDF2 = Base.extend({
8779 /**
8780 * Configuration options.
8781 *
8782 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
8783 * @property {Hasher} hasher The hasher to use. Default: SHA1
8784 * @property {number} iterations The number of iterations to perform. Default: 1
8785 */
8786 cfg: Base.extend({
8787 keySize: 128/32,
8788 hasher: SHA1,
8789 iterations: 1
8790 }),
8791
8792 /**
8793 * Initializes a newly created key derivation function.
8794 *
8795 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
8796 *
8797 * @example
8798 *
8799 * var kdf = CryptoJS.algo.PBKDF2.create();
8800 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
8801 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
8802 */
8803 init: function (cfg) {
8804 this.cfg = this.cfg.extend(cfg);
8805 },
8806
8807 /**
8808 * Computes the Password-Based Key Derivation Function 2.
8809 *
8810 * @param {WordArray|string} password The password.
8811 * @param {WordArray|string} salt A salt.
8812 *
8813 * @return {WordArray} The derived key.
8814 *
8815 * @example
8816 *
8817 * var key = kdf.compute(password, salt);
8818 */
8819 compute: function (password, salt) {
8820 // Shortcut
8821 var cfg = this.cfg;
8822
8823 // Init HMAC
8824 var hmac = HMAC.create(cfg.hasher, password);
8825
8826 // Initial values
8827 var derivedKey = WordArray.create();
8828 var blockIndex = WordArray.create([0x00000001]);
8829
8830 // Shortcuts
8831 var derivedKeyWords = derivedKey.words;
8832 var blockIndexWords = blockIndex.words;
8833 var keySize = cfg.keySize;
8834 var iterations = cfg.iterations;
8835
8836 // Generate key
8837 while (derivedKeyWords.length < keySize) {
8838 var block = hmac.update(salt).finalize(blockIndex);
8839 hmac.reset();
8840
8841 // Shortcuts
8842 var blockWords = block.words;
8843 var blockWordsLength = blockWords.length;
8844
8845 // Iterations
8846 var intermediate = block;
8847 for (var i = 1; i < iterations; i++) {
8848 intermediate = hmac.finalize(intermediate);
8849 hmac.reset();
8850
8851 // Shortcut
8852 var intermediateWords = intermediate.words;
8853
8854 // XOR intermediate with block
8855 for (var j = 0; j < blockWordsLength; j++) {
8856 blockWords[j] ^= intermediateWords[j];
8857 }
8858 }
8859
8860 derivedKey.concat(block);
8861 blockIndexWords[0]++;
8862 }
8863 derivedKey.sigBytes = keySize * 4;
8864
8865 return derivedKey;
8866 }
8867 });
8868
8869 /**
8870 * Computes the Password-Based Key Derivation Function 2.
8871 *
8872 * @param {WordArray|string} password The password.
8873 * @param {WordArray|string} salt A salt.
8874 * @param {Object} cfg (Optional) The configuration options to use for this computation.
8875 *
8876 * @return {WordArray} The derived key.
8877 *
8878 * @static
8879 *
8880 * @example
8881 *
8882 * var key = CryptoJS.PBKDF2(password, salt);
8883 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
8884 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
8885 */
8886 C.PBKDF2 = function (password, salt, cfg) {
8887 return PBKDF2.create(cfg).compute(password, salt);
8888 };
8889 }());
8890
8891
8892 return CryptoJS.PBKDF2;
8893
8894 }));
8895 },{"./core":31,"./hmac":36,"./sha1":55}],51:[function(_dereq_,module,exports){
8896 ;(function (root, factory, undef) {
8897 if (typeof exports === "object") {
8898 // CommonJS
8899 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
8900 }
8901 else if (typeof define === "function" && define.amd) {
8902 // AMD
8903 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
8904 }
8905 else {
8906 // Global (browser)
8907 factory(root.CryptoJS);
8908 }
8909 }(this, function (CryptoJS) {
8910
8911 (function () {
8912 // Shortcuts
8913 var C = CryptoJS;
8914 var C_lib = C.lib;
8915 var StreamCipher = C_lib.StreamCipher;
8916 var C_algo = C.algo;
8917
8918 // Reusable objects
8919 var S = [];
8920 var C_ = [];
8921 var G = [];
8922
8923 /**
8924 * Rabbit stream cipher algorithm.
8925 *
8926 * This is a legacy version that neglected to convert the key to little-endian.
8927 * This error doesn't affect the cipher's security,
8928 * but it does affect its compatibility with other implementations.
8929 */
8930 var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
8931 _doReset: function () {
8932 // Shortcuts
8933 var K = this._key.words;
8934 var iv = this.cfg.iv;
8935
8936 // Generate initial state values
8937 var X = this._X = [
8938 K[0], (K[3] << 16) | (K[2] >>> 16),
8939 K[1], (K[0] << 16) | (K[3] >>> 16),
8940 K[2], (K[1] << 16) | (K[0] >>> 16),
8941 K[3], (K[2] << 16) | (K[1] >>> 16)
8942 ];
8943
8944 // Generate initial counter values
8945 var C = this._C = [
8946 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
8947 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
8948 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
8949 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
8950 ];
8951
8952 // Carry bit
8953 this._b = 0;
8954
8955 // Iterate the system four times
8956 for (var i = 0; i < 4; i++) {
8957 nextState.call(this);
8958 }
8959
8960 // Modify the counters
8961 for (var i = 0; i < 8; i++) {
8962 C[i] ^= X[(i + 4) & 7];
8963 }
8964
8965 // IV setup
8966 if (iv) {
8967 // Shortcuts
8968 var IV = iv.words;
8969 var IV_0 = IV[0];
8970 var IV_1 = IV[1];
8971
8972 // Generate four subvectors
8973 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
8974 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
8975 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
8976 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
8977
8978 // Modify counter values
8979 C[0] ^= i0;
8980 C[1] ^= i1;
8981 C[2] ^= i2;
8982 C[3] ^= i3;
8983 C[4] ^= i0;
8984 C[5] ^= i1;
8985 C[6] ^= i2;
8986 C[7] ^= i3;
8987
8988 // Iterate the system four times
8989 for (var i = 0; i < 4; i++) {
8990 nextState.call(this);
8991 }
8992 }
8993 },
8994
8995 _doProcessBlock: function (M, offset) {
8996 // Shortcut
8997 var X = this._X;
8998
8999 // Iterate the system
9000 nextState.call(this);
9001
9002 // Generate four keystream words
9003 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
9004 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
9005 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
9006 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
9007
9008 for (var i = 0; i < 4; i++) {
9009 // Swap endian
9010 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
9011 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
9012
9013 // Encrypt
9014 M[offset + i] ^= S[i];
9015 }
9016 },
9017
9018 blockSize: 128/32,
9019
9020 ivSize: 64/32
9021 });
9022
9023 function nextState() {
9024 // Shortcuts
9025 var X = this._X;
9026 var C = this._C;
9027
9028 // Save old counter values
9029 for (var i = 0; i < 8; i++) {
9030 C_[i] = C[i];
9031 }
9032
9033 // Calculate new counter values
9034 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
9035 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
9036 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
9037 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
9038 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
9039 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
9040 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
9041 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
9042 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
9043
9044 // Calculate the g-values
9045 for (var i = 0; i < 8; i++) {
9046 var gx = X[i] + C[i];
9047
9048 // Construct high and low argument for squaring
9049 var ga = gx & 0xffff;
9050 var gb = gx >>> 16;
9051
9052 // Calculate high and low result of squaring
9053 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
9054 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
9055
9056 // High XOR low
9057 G[i] = gh ^ gl;
9058 }
9059
9060 // Calculate new state values
9061 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
9062 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
9063 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
9064 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
9065 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9066 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9067 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9068 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9069 }
9070
9071 /**
9072 * Shortcut functions to the cipher's object interface.
9073 *
9074 * @example
9075 *
9076 * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
9077 * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
9078 */
9079 C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
9080 }());
9081
9082
9083 return CryptoJS.RabbitLegacy;
9084
9085 }));
9086 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],52:[function(_dereq_,module,exports){
9087 ;(function (root, factory, undef) {
9088 if (typeof exports === "object") {
9089 // CommonJS
9090 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9091 }
9092 else if (typeof define === "function" && define.amd) {
9093 // AMD
9094 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9095 }
9096 else {
9097 // Global (browser)
9098 factory(root.CryptoJS);
9099 }
9100 }(this, function (CryptoJS) {
9101
9102 (function () {
9103 // Shortcuts
9104 var C = CryptoJS;
9105 var C_lib = C.lib;
9106 var StreamCipher = C_lib.StreamCipher;
9107 var C_algo = C.algo;
9108
9109 // Reusable objects
9110 var S = [];
9111 var C_ = [];
9112 var G = [];
9113
9114 /**
9115 * Rabbit stream cipher algorithm
9116 */
9117 var Rabbit = C_algo.Rabbit = StreamCipher.extend({
9118 _doReset: function () {
9119 // Shortcuts
9120 var K = this._key.words;
9121 var iv = this.cfg.iv;
9122
9123 // Swap endian
9124 for (var i = 0; i < 4; i++) {
9125 K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
9126 (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
9127 }
9128
9129 // Generate initial state values
9130 var X = this._X = [
9131 K[0], (K[3] << 16) | (K[2] >>> 16),
9132 K[1], (K[0] << 16) | (K[3] >>> 16),
9133 K[2], (K[1] << 16) | (K[0] >>> 16),
9134 K[3], (K[2] << 16) | (K[1] >>> 16)
9135 ];
9136
9137 // Generate initial counter values
9138 var C = this._C = [
9139 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
9140 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
9141 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
9142 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
9143 ];
9144
9145 // Carry bit
9146 this._b = 0;
9147
9148 // Iterate the system four times
9149 for (var i = 0; i < 4; i++) {
9150 nextState.call(this);
9151 }
9152
9153 // Modify the counters
9154 for (var i = 0; i < 8; i++) {
9155 C[i] ^= X[(i + 4) & 7];
9156 }
9157
9158 // IV setup
9159 if (iv) {
9160 // Shortcuts
9161 var IV = iv.words;
9162 var IV_0 = IV[0];
9163 var IV_1 = IV[1];
9164
9165 // Generate four subvectors
9166 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
9167 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
9168 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
9169 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
9170
9171 // Modify counter values
9172 C[0] ^= i0;
9173 C[1] ^= i1;
9174 C[2] ^= i2;
9175 C[3] ^= i3;
9176 C[4] ^= i0;
9177 C[5] ^= i1;
9178 C[6] ^= i2;
9179 C[7] ^= i3;
9180
9181 // Iterate the system four times
9182 for (var i = 0; i < 4; i++) {
9183 nextState.call(this);
9184 }
9185 }
9186 },
9187
9188 _doProcessBlock: function (M, offset) {
9189 // Shortcut
9190 var X = this._X;
9191
9192 // Iterate the system
9193 nextState.call(this);
9194
9195 // Generate four keystream words
9196 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
9197 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
9198 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
9199 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
9200
9201 for (var i = 0; i < 4; i++) {
9202 // Swap endian
9203 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
9204 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
9205
9206 // Encrypt
9207 M[offset + i] ^= S[i];
9208 }
9209 },
9210
9211 blockSize: 128/32,
9212
9213 ivSize: 64/32
9214 });
9215
9216 function nextState() {
9217 // Shortcuts
9218 var X = this._X;
9219 var C = this._C;
9220
9221 // Save old counter values
9222 for (var i = 0; i < 8; i++) {
9223 C_[i] = C[i];
9224 }
9225
9226 // Calculate new counter values
9227 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
9228 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
9229 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
9230 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
9231 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
9232 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
9233 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
9234 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
9235 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
9236
9237 // Calculate the g-values
9238 for (var i = 0; i < 8; i++) {
9239 var gx = X[i] + C[i];
9240
9241 // Construct high and low argument for squaring
9242 var ga = gx & 0xffff;
9243 var gb = gx >>> 16;
9244
9245 // Calculate high and low result of squaring
9246 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
9247 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
9248
9249 // High XOR low
9250 G[i] = gh ^ gl;
9251 }
9252
9253 // Calculate new state values
9254 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
9255 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
9256 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
9257 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
9258 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9259 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9260 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9261 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9262 }
9263
9264 /**
9265 * Shortcut functions to the cipher's object interface.
9266 *
9267 * @example
9268 *
9269 * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
9270 * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
9271 */
9272 C.Rabbit = StreamCipher._createHelper(Rabbit);
9273 }());
9274
9275
9276 return CryptoJS.Rabbit;
9277
9278 }));
9279 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],53:[function(_dereq_,module,exports){
9280 ;(function (root, factory, undef) {
9281 if (typeof exports === "object") {
9282 // CommonJS
9283 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9284 }
9285 else if (typeof define === "function" && define.amd) {
9286 // AMD
9287 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9288 }
9289 else {
9290 // Global (browser)
9291 factory(root.CryptoJS);
9292 }
9293 }(this, function (CryptoJS) {
9294
9295 (function () {
9296 // Shortcuts
9297 var C = CryptoJS;
9298 var C_lib = C.lib;
9299 var StreamCipher = C_lib.StreamCipher;
9300 var C_algo = C.algo;
9301
9302 /**
9303 * RC4 stream cipher algorithm.
9304 */
9305 var RC4 = C_algo.RC4 = StreamCipher.extend({
9306 _doReset: function () {
9307 // Shortcuts
9308 var key = this._key;
9309 var keyWords = key.words;
9310 var keySigBytes = key.sigBytes;
9311
9312 // Init sbox
9313 var S = this._S = [];
9314 for (var i = 0; i < 256; i++) {
9315 S[i] = i;
9316 }
9317
9318 // Key setup
9319 for (var i = 0, j = 0; i < 256; i++) {
9320 var keyByteIndex = i % keySigBytes;
9321 var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
9322
9323 j = (j + S[i] + keyByte) % 256;
9324
9325 // Swap
9326 var t = S[i];
9327 S[i] = S[j];
9328 S[j] = t;
9329 }
9330
9331 // Counters
9332 this._i = this._j = 0;
9333 },
9334
9335 _doProcessBlock: function (M, offset) {
9336 M[offset] ^= generateKeystreamWord.call(this);
9337 },
9338
9339 keySize: 256/32,
9340
9341 ivSize: 0
9342 });
9343
9344 function generateKeystreamWord() {
9345 // Shortcuts
9346 var S = this._S;
9347 var i = this._i;
9348 var j = this._j;
9349
9350 // Generate keystream word
9351 var keystreamWord = 0;
9352 for (var n = 0; n < 4; n++) {
9353 i = (i + 1) % 256;
9354 j = (j + S[i]) % 256;
9355
9356 // Swap
9357 var t = S[i];
9358 S[i] = S[j];
9359 S[j] = t;
9360
9361 keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
9362 }
9363
9364 // Update counters
9365 this._i = i;
9366 this._j = j;
9367
9368 return keystreamWord;
9369 }
9370
9371 /**
9372 * Shortcut functions to the cipher's object interface.
9373 *
9374 * @example
9375 *
9376 * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
9377 * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
9378 */
9379 C.RC4 = StreamCipher._createHelper(RC4);
9380
9381 /**
9382 * Modified RC4 stream cipher algorithm.
9383 */
9384 var RC4Drop = C_algo.RC4Drop = RC4.extend({
9385 /**
9386 * Configuration options.
9387 *
9388 * @property {number} drop The number of keystream words to drop. Default 192
9389 */
9390 cfg: RC4.cfg.extend({
9391 drop: 192
9392 }),
9393
9394 _doReset: function () {
9395 RC4._doReset.call(this);
9396
9397 // Drop
9398 for (var i = this.cfg.drop; i > 0; i--) {
9399 generateKeystreamWord.call(this);
9400 }
9401 }
9402 });
9403
9404 /**
9405 * Shortcut functions to the cipher's object interface.
9406 *
9407 * @example
9408 *
9409 * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
9410 * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
9411 */
9412 C.RC4Drop = StreamCipher._createHelper(RC4Drop);
9413 }());
9414
9415
9416 return CryptoJS.RC4;
9417
9418 }));
9419 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],54:[function(_dereq_,module,exports){
9420 ;(function (root, factory) {
9421 if (typeof exports === "object") {
9422 // CommonJS
9423 module.exports = exports = factory(_dereq_("./core"));
9424 }
9425 else if (typeof define === "function" && define.amd) {
9426 // AMD
9427 define(["./core"], factory);
9428 }
9429 else {
9430 // Global (browser)
9431 factory(root.CryptoJS);
9432 }
9433 }(this, function (CryptoJS) {
9434
9435 /** @preserve
9436 (c) 2012 by Cédric Mesnil. All rights reserved.
9437
9438 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9439
9440 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9441 - 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.
9442
9443 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.
9444 */
9445
9446 (function (Math) {
9447 // Shortcuts
9448 var C = CryptoJS;
9449 var C_lib = C.lib;
9450 var WordArray = C_lib.WordArray;
9451 var Hasher = C_lib.Hasher;
9452 var C_algo = C.algo;
9453
9454 // Constants table
9455 var _zl = WordArray.create([
9456 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
9457 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
9458 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
9459 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
9460 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
9461 var _zr = WordArray.create([
9462 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
9463 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
9464 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
9465 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
9466 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
9467 var _sl = WordArray.create([
9468 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
9469 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
9470 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
9471 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9472 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
9473 var _sr = WordArray.create([
9474 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9475 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9476 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
9477 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
9478 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
9479
9480 var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
9481 var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
9482
9483 /**
9484 * RIPEMD160 hash algorithm.
9485 */
9486 var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
9487 _doReset: function () {
9488 this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
9489 },
9490
9491 _doProcessBlock: function (M, offset) {
9492
9493 // Swap endian
9494 for (var i = 0; i < 16; i++) {
9495 // Shortcuts
9496 var offset_i = offset + i;
9497 var M_offset_i = M[offset_i];
9498
9499 // Swap
9500 M[offset_i] = (
9501 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
9502 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
9503 );
9504 }
9505 // Shortcut
9506 var H = this._hash.words;
9507 var hl = _hl.words;
9508 var hr = _hr.words;
9509 var zl = _zl.words;
9510 var zr = _zr.words;
9511 var sl = _sl.words;
9512 var sr = _sr.words;
9513
9514 // Working variables
9515 var al, bl, cl, dl, el;
9516 var ar, br, cr, dr, er;
9517
9518 ar = al = H[0];
9519 br = bl = H[1];
9520 cr = cl = H[2];
9521 dr = dl = H[3];
9522 er = el = H[4];
9523 // Computation
9524 var t;
9525 for (var i = 0; i < 80; i += 1) {
9526 t = (al + M[offset+zl[i]])|0;
9527 if (i<16){
9528 t += f1(bl,cl,dl) + hl[0];
9529 } else if (i<32) {
9530 t += f2(bl,cl,dl) + hl[1];
9531 } else if (i<48) {
9532 t += f3(bl,cl,dl) + hl[2];
9533 } else if (i<64) {
9534 t += f4(bl,cl,dl) + hl[3];
9535 } else {// if (i<80) {
9536 t += f5(bl,cl,dl) + hl[4];
9537 }
9538 t = t|0;
9539 t = rotl(t,sl[i]);
9540 t = (t+el)|0;
9541 al = el;
9542 el = dl;
9543 dl = rotl(cl, 10);
9544 cl = bl;
9545 bl = t;
9546
9547 t = (ar + M[offset+zr[i]])|0;
9548 if (i<16){
9549 t += f5(br,cr,dr) + hr[0];
9550 } else if (i<32) {
9551 t += f4(br,cr,dr) + hr[1];
9552 } else if (i<48) {
9553 t += f3(br,cr,dr) + hr[2];
9554 } else if (i<64) {
9555 t += f2(br,cr,dr) + hr[3];
9556 } else {// if (i<80) {
9557 t += f1(br,cr,dr) + hr[4];
9558 }
9559 t = t|0;
9560 t = rotl(t,sr[i]) ;
9561 t = (t+er)|0;
9562 ar = er;
9563 er = dr;
9564 dr = rotl(cr, 10);
9565 cr = br;
9566 br = t;
9567 }
9568 // Intermediate hash value
9569 t = (H[1] + cl + dr)|0;
9570 H[1] = (H[2] + dl + er)|0;
9571 H[2] = (H[3] + el + ar)|0;
9572 H[3] = (H[4] + al + br)|0;
9573 H[4] = (H[0] + bl + cr)|0;
9574 H[0] = t;
9575 },
9576
9577 _doFinalize: function () {
9578 // Shortcuts
9579 var data = this._data;
9580 var dataWords = data.words;
9581
9582 var nBitsTotal = this._nDataBytes * 8;
9583 var nBitsLeft = data.sigBytes * 8;
9584
9585 // Add padding
9586 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9587 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
9588 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
9589 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
9590 );
9591 data.sigBytes = (dataWords.length + 1) * 4;
9592
9593 // Hash final blocks
9594 this._process();
9595
9596 // Shortcuts
9597 var hash = this._hash;
9598 var H = hash.words;
9599
9600 // Swap endian
9601 for (var i = 0; i < 5; i++) {
9602 // Shortcut
9603 var H_i = H[i];
9604
9605 // Swap
9606 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
9607 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
9608 }
9609
9610 // Return final computed hash
9611 return hash;
9612 },
9613
9614 clone: function () {
9615 var clone = Hasher.clone.call(this);
9616 clone._hash = this._hash.clone();
9617
9618 return clone;
9619 }
9620 });
9621
9622
9623 function f1(x, y, z) {
9624 return ((x) ^ (y) ^ (z));
9625
9626 }
9627
9628 function f2(x, y, z) {
9629 return (((x)&(y)) | ((~x)&(z)));
9630 }
9631
9632 function f3(x, y, z) {
9633 return (((x) | (~(y))) ^ (z));
9634 }
9635
9636 function f4(x, y, z) {
9637 return (((x) & (z)) | ((y)&(~(z))));
9638 }
9639
9640 function f5(x, y, z) {
9641 return ((x) ^ ((y) |(~(z))));
9642
9643 }
9644
9645 function rotl(x,n) {
9646 return (x<<n) | (x>>>(32-n));
9647 }
9648
9649
9650 /**
9651 * Shortcut function to the hasher's object interface.
9652 *
9653 * @param {WordArray|string} message The message to hash.
9654 *
9655 * @return {WordArray} The hash.
9656 *
9657 * @static
9658 *
9659 * @example
9660 *
9661 * var hash = CryptoJS.RIPEMD160('message');
9662 * var hash = CryptoJS.RIPEMD160(wordArray);
9663 */
9664 C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
9665
9666 /**
9667 * Shortcut function to the HMAC's object interface.
9668 *
9669 * @param {WordArray|string} message The message to hash.
9670 * @param {WordArray|string} key The secret key.
9671 *
9672 * @return {WordArray} The HMAC.
9673 *
9674 * @static
9675 *
9676 * @example
9677 *
9678 * var hmac = CryptoJS.HmacRIPEMD160(message, key);
9679 */
9680 C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
9681 }(Math));
9682
9683
9684 return CryptoJS.RIPEMD160;
9685
9686 }));
9687 },{"./core":31}],55:[function(_dereq_,module,exports){
9688 ;(function (root, factory) {
9689 if (typeof exports === "object") {
9690 // CommonJS
9691 module.exports = exports = factory(_dereq_("./core"));
9692 }
9693 else if (typeof define === "function" && define.amd) {
9694 // AMD
9695 define(["./core"], factory);
9696 }
9697 else {
9698 // Global (browser)
9699 factory(root.CryptoJS);
9700 }
9701 }(this, function (CryptoJS) {
9702
9703 (function () {
9704 // Shortcuts
9705 var C = CryptoJS;
9706 var C_lib = C.lib;
9707 var WordArray = C_lib.WordArray;
9708 var Hasher = C_lib.Hasher;
9709 var C_algo = C.algo;
9710
9711 // Reusable object
9712 var W = [];
9713
9714 /**
9715 * SHA-1 hash algorithm.
9716 */
9717 var SHA1 = C_algo.SHA1 = Hasher.extend({
9718 _doReset: function () {
9719 this._hash = new WordArray.init([
9720 0x67452301, 0xefcdab89,
9721 0x98badcfe, 0x10325476,
9722 0xc3d2e1f0
9723 ]);
9724 },
9725
9726 _doProcessBlock: function (M, offset) {
9727 // Shortcut
9728 var H = this._hash.words;
9729
9730 // Working variables
9731 var a = H[0];
9732 var b = H[1];
9733 var c = H[2];
9734 var d = H[3];
9735 var e = H[4];
9736
9737 // Computation
9738 for (var i = 0; i < 80; i++) {
9739 if (i < 16) {
9740 W[i] = M[offset + i] | 0;
9741 } else {
9742 var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
9743 W[i] = (n << 1) | (n >>> 31);
9744 }
9745
9746 var t = ((a << 5) | (a >>> 27)) + e + W[i];
9747 if (i < 20) {
9748 t += ((b & c) | (~b & d)) + 0x5a827999;
9749 } else if (i < 40) {
9750 t += (b ^ c ^ d) + 0x6ed9eba1;
9751 } else if (i < 60) {
9752 t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
9753 } else /* if (i < 80) */ {
9754 t += (b ^ c ^ d) - 0x359d3e2a;
9755 }
9756
9757 e = d;
9758 d = c;
9759 c = (b << 30) | (b >>> 2);
9760 b = a;
9761 a = t;
9762 }
9763
9764 // Intermediate hash value
9765 H[0] = (H[0] + a) | 0;
9766 H[1] = (H[1] + b) | 0;
9767 H[2] = (H[2] + c) | 0;
9768 H[3] = (H[3] + d) | 0;
9769 H[4] = (H[4] + e) | 0;
9770 },
9771
9772 _doFinalize: function () {
9773 // Shortcuts
9774 var data = this._data;
9775 var dataWords = data.words;
9776
9777 var nBitsTotal = this._nDataBytes * 8;
9778 var nBitsLeft = data.sigBytes * 8;
9779
9780 // Add padding
9781 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9782 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
9783 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
9784 data.sigBytes = dataWords.length * 4;
9785
9786 // Hash final blocks
9787 this._process();
9788
9789 // Return final computed hash
9790 return this._hash;
9791 },
9792
9793 clone: function () {
9794 var clone = Hasher.clone.call(this);
9795 clone._hash = this._hash.clone();
9796
9797 return clone;
9798 }
9799 });
9800
9801 /**
9802 * Shortcut function to the hasher's object interface.
9803 *
9804 * @param {WordArray|string} message The message to hash.
9805 *
9806 * @return {WordArray} The hash.
9807 *
9808 * @static
9809 *
9810 * @example
9811 *
9812 * var hash = CryptoJS.SHA1('message');
9813 * var hash = CryptoJS.SHA1(wordArray);
9814 */
9815 C.SHA1 = Hasher._createHelper(SHA1);
9816
9817 /**
9818 * Shortcut function to the HMAC's object interface.
9819 *
9820 * @param {WordArray|string} message The message to hash.
9821 * @param {WordArray|string} key The secret key.
9822 *
9823 * @return {WordArray} The HMAC.
9824 *
9825 * @static
9826 *
9827 * @example
9828 *
9829 * var hmac = CryptoJS.HmacSHA1(message, key);
9830 */
9831 C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
9832 }());
9833
9834
9835 return CryptoJS.SHA1;
9836
9837 }));
9838 },{"./core":31}],56:[function(_dereq_,module,exports){
9839 ;(function (root, factory, undef) {
9840 if (typeof exports === "object") {
9841 // CommonJS
9842 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha256"));
9843 }
9844 else if (typeof define === "function" && define.amd) {
9845 // AMD
9846 define(["./core", "./sha256"], factory);
9847 }
9848 else {
9849 // Global (browser)
9850 factory(root.CryptoJS);
9851 }
9852 }(this, function (CryptoJS) {
9853
9854 (function () {
9855 // Shortcuts
9856 var C = CryptoJS;
9857 var C_lib = C.lib;
9858 var WordArray = C_lib.WordArray;
9859 var C_algo = C.algo;
9860 var SHA256 = C_algo.SHA256;
9861
9862 /**
9863 * SHA-224 hash algorithm.
9864 */
9865 var SHA224 = C_algo.SHA224 = SHA256.extend({
9866 _doReset: function () {
9867 this._hash = new WordArray.init([
9868 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
9869 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
9870 ]);
9871 },
9872
9873 _doFinalize: function () {
9874 var hash = SHA256._doFinalize.call(this);
9875
9876 hash.sigBytes -= 4;
9877
9878 return hash;
9879 }
9880 });
9881
9882 /**
9883 * Shortcut function to the hasher's object interface.
9884 *
9885 * @param {WordArray|string} message The message to hash.
9886 *
9887 * @return {WordArray} The hash.
9888 *
9889 * @static
9890 *
9891 * @example
9892 *
9893 * var hash = CryptoJS.SHA224('message');
9894 * var hash = CryptoJS.SHA224(wordArray);
9895 */
9896 C.SHA224 = SHA256._createHelper(SHA224);
9897
9898 /**
9899 * Shortcut function to the HMAC's object interface.
9900 *
9901 * @param {WordArray|string} message The message to hash.
9902 * @param {WordArray|string} key The secret key.
9903 *
9904 * @return {WordArray} The HMAC.
9905 *
9906 * @static
9907 *
9908 * @example
9909 *
9910 * var hmac = CryptoJS.HmacSHA224(message, key);
9911 */
9912 C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
9913 }());
9914
9915
9916 return CryptoJS.SHA224;
9917
9918 }));
9919 },{"./core":31,"./sha256":57}],57:[function(_dereq_,module,exports){
9920 ;(function (root, factory) {
9921 if (typeof exports === "object") {
9922 // CommonJS
9923 module.exports = exports = factory(_dereq_("./core"));
9924 }
9925 else if (typeof define === "function" && define.amd) {
9926 // AMD
9927 define(["./core"], factory);
9928 }
9929 else {
9930 // Global (browser)
9931 factory(root.CryptoJS);
9932 }
9933 }(this, function (CryptoJS) {
9934
9935 (function (Math) {
9936 // Shortcuts
9937 var C = CryptoJS;
9938 var C_lib = C.lib;
9939 var WordArray = C_lib.WordArray;
9940 var Hasher = C_lib.Hasher;
9941 var C_algo = C.algo;
9942
9943 // Initialization and round constants tables
9944 var H = [];
9945 var K = [];
9946
9947 // Compute constants
9948 (function () {
9949 function isPrime(n) {
9950 var sqrtN = Math.sqrt(n);
9951 for (var factor = 2; factor <= sqrtN; factor++) {
9952 if (!(n % factor)) {
9953 return false;
9954 }
9955 }
9956
9957 return true;
9958 }
9959
9960 function getFractionalBits(n) {
9961 return ((n - (n | 0)) * 0x100000000) | 0;
9962 }
9963
9964 var n = 2;
9965 var nPrime = 0;
9966 while (nPrime < 64) {
9967 if (isPrime(n)) {
9968 if (nPrime < 8) {
9969 H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
9970 }
9971 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
9972
9973 nPrime++;
9974 }
9975
9976 n++;
9977 }
9978 }());
9979
9980 // Reusable object
9981 var W = [];
9982
9983 /**
9984 * SHA-256 hash algorithm.
9985 */
9986 var SHA256 = C_algo.SHA256 = Hasher.extend({
9987 _doReset: function () {
9988 this._hash = new WordArray.init(H.slice(0));
9989 },
9990
9991 _doProcessBlock: function (M, offset) {
9992 // Shortcut
9993 var H = this._hash.words;
9994
9995 // Working variables
9996 var a = H[0];
9997 var b = H[1];
9998 var c = H[2];
9999 var d = H[3];
10000 var e = H[4];
10001 var f = H[5];
10002 var g = H[6];
10003 var h = H[7];
10004
10005 // Computation
10006 for (var i = 0; i < 64; i++) {
10007 if (i < 16) {
10008 W[i] = M[offset + i] | 0;
10009 } else {
10010 var gamma0x = W[i - 15];
10011 var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
10012 ((gamma0x << 14) | (gamma0x >>> 18)) ^
10013 (gamma0x >>> 3);
10014
10015 var gamma1x = W[i - 2];
10016 var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
10017 ((gamma1x << 13) | (gamma1x >>> 19)) ^
10018 (gamma1x >>> 10);
10019
10020 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
10021 }
10022
10023 var ch = (e & f) ^ (~e & g);
10024 var maj = (a & b) ^ (a & c) ^ (b & c);
10025
10026 var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
10027 var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
10028
10029 var t1 = h + sigma1 + ch + K[i] + W[i];
10030 var t2 = sigma0 + maj;
10031
10032 h = g;
10033 g = f;
10034 f = e;
10035 e = (d + t1) | 0;
10036 d = c;
10037 c = b;
10038 b = a;
10039 a = (t1 + t2) | 0;
10040 }
10041
10042 // Intermediate hash value
10043 H[0] = (H[0] + a) | 0;
10044 H[1] = (H[1] + b) | 0;
10045 H[2] = (H[2] + c) | 0;
10046 H[3] = (H[3] + d) | 0;
10047 H[4] = (H[4] + e) | 0;
10048 H[5] = (H[5] + f) | 0;
10049 H[6] = (H[6] + g) | 0;
10050 H[7] = (H[7] + h) | 0;
10051 },
10052
10053 _doFinalize: function () {
10054 // Shortcuts
10055 var data = this._data;
10056 var dataWords = data.words;
10057
10058 var nBitsTotal = this._nDataBytes * 8;
10059 var nBitsLeft = data.sigBytes * 8;
10060
10061 // Add padding
10062 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
10063 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
10064 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
10065 data.sigBytes = dataWords.length * 4;
10066
10067 // Hash final blocks
10068 this._process();
10069
10070 // Return final computed hash
10071 return this._hash;
10072 },
10073
10074 clone: function () {
10075 var clone = Hasher.clone.call(this);
10076 clone._hash = this._hash.clone();
10077
10078 return clone;
10079 }
10080 });
10081
10082 /**
10083 * Shortcut function to the hasher's object interface.
10084 *
10085 * @param {WordArray|string} message The message to hash.
10086 *
10087 * @return {WordArray} The hash.
10088 *
10089 * @static
10090 *
10091 * @example
10092 *
10093 * var hash = CryptoJS.SHA256('message');
10094 * var hash = CryptoJS.SHA256(wordArray);
10095 */
10096 C.SHA256 = Hasher._createHelper(SHA256);
10097
10098 /**
10099 * Shortcut function to the HMAC's object interface.
10100 *
10101 * @param {WordArray|string} message The message to hash.
10102 * @param {WordArray|string} key The secret key.
10103 *
10104 * @return {WordArray} The HMAC.
10105 *
10106 * @static
10107 *
10108 * @example
10109 *
10110 * var hmac = CryptoJS.HmacSHA256(message, key);
10111 */
10112 C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
10113 }(Math));
10114
10115
10116 return CryptoJS.SHA256;
10117
10118 }));
10119 },{"./core":31}],58:[function(_dereq_,module,exports){
10120 ;(function (root, factory, undef) {
10121 if (typeof exports === "object") {
10122 // CommonJS
10123 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10124 }
10125 else if (typeof define === "function" && define.amd) {
10126 // AMD
10127 define(["./core", "./x64-core"], factory);
10128 }
10129 else {
10130 // Global (browser)
10131 factory(root.CryptoJS);
10132 }
10133 }(this, function (CryptoJS) {
10134
10135 (function (Math) {
10136 // Shortcuts
10137 var C = CryptoJS;
10138 var C_lib = C.lib;
10139 var WordArray = C_lib.WordArray;
10140 var Hasher = C_lib.Hasher;
10141 var C_x64 = C.x64;
10142 var X64Word = C_x64.Word;
10143 var C_algo = C.algo;
10144
10145 // Constants tables
10146 var RHO_OFFSETS = [];
10147 var PI_INDEXES = [];
10148 var ROUND_CONSTANTS = [];
10149
10150 // Compute Constants
10151 (function () {
10152 // Compute rho offset constants
10153 var x = 1, y = 0;
10154 for (var t = 0; t < 24; t++) {
10155 RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
10156
10157 var newX = y % 5;
10158 var newY = (2 * x + 3 * y) % 5;
10159 x = newX;
10160 y = newY;
10161 }
10162
10163 // Compute pi index constants
10164 for (var x = 0; x < 5; x++) {
10165 for (var y = 0; y < 5; y++) {
10166 PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
10167 }
10168 }
10169
10170 // Compute round constants
10171 var LFSR = 0x01;
10172 for (var i = 0; i < 24; i++) {
10173 var roundConstantMsw = 0;
10174 var roundConstantLsw = 0;
10175
10176 for (var j = 0; j < 7; j++) {
10177 if (LFSR & 0x01) {
10178 var bitPosition = (1 << j) - 1;
10179 if (bitPosition < 32) {
10180 roundConstantLsw ^= 1 << bitPosition;
10181 } else /* if (bitPosition >= 32) */ {
10182 roundConstantMsw ^= 1 << (bitPosition - 32);
10183 }
10184 }
10185
10186 // Compute next LFSR
10187 if (LFSR & 0x80) {
10188 // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
10189 LFSR = (LFSR << 1) ^ 0x71;
10190 } else {
10191 LFSR <<= 1;
10192 }
10193 }
10194
10195 ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
10196 }
10197 }());
10198
10199 // Reusable objects for temporary values
10200 var T = [];
10201 (function () {
10202 for (var i = 0; i < 25; i++) {
10203 T[i] = X64Word.create();
10204 }
10205 }());
10206
10207 /**
10208 * SHA-3 hash algorithm.
10209 */
10210 var SHA3 = C_algo.SHA3 = Hasher.extend({
10211 /**
10212 * Configuration options.
10213 *
10214 * @property {number} outputLength
10215 * The desired number of bits in the output hash.
10216 * Only values permitted are: 224, 256, 384, 512.
10217 * Default: 512
10218 */
10219 cfg: Hasher.cfg.extend({
10220 outputLength: 512
10221 }),
10222
10223 _doReset: function () {
10224 var state = this._state = []
10225 for (var i = 0; i < 25; i++) {
10226 state[i] = new X64Word.init();
10227 }
10228
10229 this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
10230 },
10231
10232 _doProcessBlock: function (M, offset) {
10233 // Shortcuts
10234 var state = this._state;
10235 var nBlockSizeLanes = this.blockSize / 2;
10236
10237 // Absorb
10238 for (var i = 0; i < nBlockSizeLanes; i++) {
10239 // Shortcuts
10240 var M2i = M[offset + 2 * i];
10241 var M2i1 = M[offset + 2 * i + 1];
10242
10243 // Swap endian
10244 M2i = (
10245 (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
10246 (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
10247 );
10248 M2i1 = (
10249 (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
10250 (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
10251 );
10252
10253 // Absorb message into state
10254 var lane = state[i];
10255 lane.high ^= M2i1;
10256 lane.low ^= M2i;
10257 }
10258
10259 // Rounds
10260 for (var round = 0; round < 24; round++) {
10261 // Theta
10262 for (var x = 0; x < 5; x++) {
10263 // Mix column lanes
10264 var tMsw = 0, tLsw = 0;
10265 for (var y = 0; y < 5; y++) {
10266 var lane = state[x + 5 * y];
10267 tMsw ^= lane.high;
10268 tLsw ^= lane.low;
10269 }
10270
10271 // Temporary values
10272 var Tx = T[x];
10273 Tx.high = tMsw;
10274 Tx.low = tLsw;
10275 }
10276 for (var x = 0; x < 5; x++) {
10277 // Shortcuts
10278 var Tx4 = T[(x + 4) % 5];
10279 var Tx1 = T[(x + 1) % 5];
10280 var Tx1Msw = Tx1.high;
10281 var Tx1Lsw = Tx1.low;
10282
10283 // Mix surrounding columns
10284 var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
10285 var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
10286 for (var y = 0; y < 5; y++) {
10287 var lane = state[x + 5 * y];
10288 lane.high ^= tMsw;
10289 lane.low ^= tLsw;
10290 }
10291 }
10292
10293 // Rho Pi
10294 for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
10295 // Shortcuts
10296 var lane = state[laneIndex];
10297 var laneMsw = lane.high;
10298 var laneLsw = lane.low;
10299 var rhoOffset = RHO_OFFSETS[laneIndex];
10300
10301 // Rotate lanes
10302 if (rhoOffset < 32) {
10303 var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
10304 var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
10305 } else /* if (rhoOffset >= 32) */ {
10306 var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
10307 var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
10308 }
10309
10310 // Transpose lanes
10311 var TPiLane = T[PI_INDEXES[laneIndex]];
10312 TPiLane.high = tMsw;
10313 TPiLane.low = tLsw;
10314 }
10315
10316 // Rho pi at x = y = 0
10317 var T0 = T[0];
10318 var state0 = state[0];
10319 T0.high = state0.high;
10320 T0.low = state0.low;
10321
10322 // Chi
10323 for (var x = 0; x < 5; x++) {
10324 for (var y = 0; y < 5; y++) {
10325 // Shortcuts
10326 var laneIndex = x + 5 * y;
10327 var lane = state[laneIndex];
10328 var TLane = T[laneIndex];
10329 var Tx1Lane = T[((x + 1) % 5) + 5 * y];
10330 var Tx2Lane = T[((x + 2) % 5) + 5 * y];
10331
10332 // Mix rows
10333 lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
10334 lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
10335 }
10336 }
10337
10338 // Iota
10339 var lane = state[0];
10340 var roundConstant = ROUND_CONSTANTS[round];
10341 lane.high ^= roundConstant.high;
10342 lane.low ^= roundConstant.low;;
10343 }
10344 },
10345
10346 _doFinalize: function () {
10347 // Shortcuts
10348 var data = this._data;
10349 var dataWords = data.words;
10350 var nBitsTotal = this._nDataBytes * 8;
10351 var nBitsLeft = data.sigBytes * 8;
10352 var blockSizeBits = this.blockSize * 32;
10353
10354 // Add padding
10355 dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
10356 dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
10357 data.sigBytes = dataWords.length * 4;
10358
10359 // Hash final blocks
10360 this._process();
10361
10362 // Shortcuts
10363 var state = this._state;
10364 var outputLengthBytes = this.cfg.outputLength / 8;
10365 var outputLengthLanes = outputLengthBytes / 8;
10366
10367 // Squeeze
10368 var hashWords = [];
10369 for (var i = 0; i < outputLengthLanes; i++) {
10370 // Shortcuts
10371 var lane = state[i];
10372 var laneMsw = lane.high;
10373 var laneLsw = lane.low;
10374
10375 // Swap endian
10376 laneMsw = (
10377 (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
10378 (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
10379 );
10380 laneLsw = (
10381 (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
10382 (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
10383 );
10384
10385 // Squeeze state to retrieve hash
10386 hashWords.push(laneLsw);
10387 hashWords.push(laneMsw);
10388 }
10389
10390 // Return final computed hash
10391 return new WordArray.init(hashWords, outputLengthBytes);
10392 },
10393
10394 clone: function () {
10395 var clone = Hasher.clone.call(this);
10396
10397 var state = clone._state = this._state.slice(0);
10398 for (var i = 0; i < 25; i++) {
10399 state[i] = state[i].clone();
10400 }
10401
10402 return clone;
10403 }
10404 });
10405
10406 /**
10407 * Shortcut function to the hasher's object interface.
10408 *
10409 * @param {WordArray|string} message The message to hash.
10410 *
10411 * @return {WordArray} The hash.
10412 *
10413 * @static
10414 *
10415 * @example
10416 *
10417 * var hash = CryptoJS.SHA3('message');
10418 * var hash = CryptoJS.SHA3(wordArray);
10419 */
10420 C.SHA3 = Hasher._createHelper(SHA3);
10421
10422 /**
10423 * Shortcut function to the HMAC's object interface.
10424 *
10425 * @param {WordArray|string} message The message to hash.
10426 * @param {WordArray|string} key The secret key.
10427 *
10428 * @return {WordArray} The HMAC.
10429 *
10430 * @static
10431 *
10432 * @example
10433 *
10434 * var hmac = CryptoJS.HmacSHA3(message, key);
10435 */
10436 C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
10437 }(Math));
10438
10439
10440 return CryptoJS.SHA3;
10441
10442 }));
10443 },{"./core":31,"./x64-core":62}],59:[function(_dereq_,module,exports){
10444 ;(function (root, factory, undef) {
10445 if (typeof exports === "object") {
10446 // CommonJS
10447 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./sha512"));
10448 }
10449 else if (typeof define === "function" && define.amd) {
10450 // AMD
10451 define(["./core", "./x64-core", "./sha512"], factory);
10452 }
10453 else {
10454 // Global (browser)
10455 factory(root.CryptoJS);
10456 }
10457 }(this, function (CryptoJS) {
10458
10459 (function () {
10460 // Shortcuts
10461 var C = CryptoJS;
10462 var C_x64 = C.x64;
10463 var X64Word = C_x64.Word;
10464 var X64WordArray = C_x64.WordArray;
10465 var C_algo = C.algo;
10466 var SHA512 = C_algo.SHA512;
10467
10468 /**
10469 * SHA-384 hash algorithm.
10470 */
10471 var SHA384 = C_algo.SHA384 = SHA512.extend({
10472 _doReset: function () {
10473 this._hash = new X64WordArray.init([
10474 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
10475 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
10476 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
10477 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
10478 ]);
10479 },
10480
10481 _doFinalize: function () {
10482 var hash = SHA512._doFinalize.call(this);
10483
10484 hash.sigBytes -= 16;
10485
10486 return hash;
10487 }
10488 });
10489
10490 /**
10491 * Shortcut function to the hasher's object interface.
10492 *
10493 * @param {WordArray|string} message The message to hash.
10494 *
10495 * @return {WordArray} The hash.
10496 *
10497 * @static
10498 *
10499 * @example
10500 *
10501 * var hash = CryptoJS.SHA384('message');
10502 * var hash = CryptoJS.SHA384(wordArray);
10503 */
10504 C.SHA384 = SHA512._createHelper(SHA384);
10505
10506 /**
10507 * Shortcut function to the HMAC's object interface.
10508 *
10509 * @param {WordArray|string} message The message to hash.
10510 * @param {WordArray|string} key The secret key.
10511 *
10512 * @return {WordArray} The HMAC.
10513 *
10514 * @static
10515 *
10516 * @example
10517 *
10518 * var hmac = CryptoJS.HmacSHA384(message, key);
10519 */
10520 C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
10521 }());
10522
10523
10524 return CryptoJS.SHA384;
10525
10526 }));
10527 },{"./core":31,"./sha512":60,"./x64-core":62}],60:[function(_dereq_,module,exports){
10528 ;(function (root, factory, undef) {
10529 if (typeof exports === "object") {
10530 // CommonJS
10531 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10532 }
10533 else if (typeof define === "function" && define.amd) {
10534 // AMD
10535 define(["./core", "./x64-core"], factory);
10536 }
10537 else {
10538 // Global (browser)
10539 factory(root.CryptoJS);
10540 }
10541 }(this, function (CryptoJS) {
10542
10543 (function () {
10544 // Shortcuts
10545 var C = CryptoJS;
10546 var C_lib = C.lib;
10547 var Hasher = C_lib.Hasher;
10548 var C_x64 = C.x64;
10549 var X64Word = C_x64.Word;
10550 var X64WordArray = C_x64.WordArray;
10551 var C_algo = C.algo;
10552
10553 function X64Word_create() {
10554 return X64Word.create.apply(X64Word, arguments);
10555 }
10556
10557 // Constants
10558 var K = [
10559 X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
10560 X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
10561 X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
10562 X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
10563 X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
10564 X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
10565 X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
10566 X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
10567 X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
10568 X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
10569 X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
10570 X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
10571 X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
10572 X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
10573 X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
10574 X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
10575 X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
10576 X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
10577 X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
10578 X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
10579 X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
10580 X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
10581 X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
10582 X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
10583 X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
10584 X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
10585 X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
10586 X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
10587 X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
10588 X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
10589 X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
10590 X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
10591 X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
10592 X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
10593 X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
10594 X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
10595 X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
10596 X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
10597 X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
10598 X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
10599 ];
10600
10601 // Reusable objects
10602 var W = [];
10603 (function () {
10604 for (var i = 0; i < 80; i++) {
10605 W[i] = X64Word_create();
10606 }
10607 }());
10608
10609 /**
10610 * SHA-512 hash algorithm.
10611 */
10612 var SHA512 = C_algo.SHA512 = Hasher.extend({
10613 _doReset: function () {
10614 this._hash = new X64WordArray.init([
10615 new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
10616 new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
10617 new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
10618 new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
10619 ]);
10620 },
10621
10622 _doProcessBlock: function (M, offset) {
10623 // Shortcuts
10624 var H = this._hash.words;
10625
10626 var H0 = H[0];
10627 var H1 = H[1];
10628 var H2 = H[2];
10629 var H3 = H[3];
10630 var H4 = H[4];
10631 var H5 = H[5];
10632 var H6 = H[6];
10633 var H7 = H[7];
10634
10635 var H0h = H0.high;
10636 var H0l = H0.low;
10637 var H1h = H1.high;
10638 var H1l = H1.low;
10639 var H2h = H2.high;
10640 var H2l = H2.low;
10641 var H3h = H3.high;
10642 var H3l = H3.low;
10643 var H4h = H4.high;
10644 var H4l = H4.low;
10645 var H5h = H5.high;
10646 var H5l = H5.low;
10647 var H6h = H6.high;
10648 var H6l = H6.low;
10649 var H7h = H7.high;
10650 var H7l = H7.low;
10651
10652 // Working variables
10653 var ah = H0h;
10654 var al = H0l;
10655 var bh = H1h;
10656 var bl = H1l;
10657 var ch = H2h;
10658 var cl = H2l;
10659 var dh = H3h;
10660 var dl = H3l;
10661 var eh = H4h;
10662 var el = H4l;
10663 var fh = H5h;
10664 var fl = H5l;
10665 var gh = H6h;
10666 var gl = H6l;
10667 var hh = H7h;
10668 var hl = H7l;
10669
10670 // Rounds
10671 for (var i = 0; i < 80; i++) {
10672 // Shortcut
10673 var Wi = W[i];
10674
10675 // Extend message
10676 if (i < 16) {
10677 var Wih = Wi.high = M[offset + i * 2] | 0;
10678 var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
10679 } else {
10680 // Gamma0
10681 var gamma0x = W[i - 15];
10682 var gamma0xh = gamma0x.high;
10683 var gamma0xl = gamma0x.low;
10684 var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
10685 var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
10686
10687 // Gamma1
10688 var gamma1x = W[i - 2];
10689 var gamma1xh = gamma1x.high;
10690 var gamma1xl = gamma1x.low;
10691 var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
10692 var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
10693
10694 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
10695 var Wi7 = W[i - 7];
10696 var Wi7h = Wi7.high;
10697 var Wi7l = Wi7.low;
10698
10699 var Wi16 = W[i - 16];
10700 var Wi16h = Wi16.high;
10701 var Wi16l = Wi16.low;
10702
10703 var Wil = gamma0l + Wi7l;
10704 var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
10705 var Wil = Wil + gamma1l;
10706 var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
10707 var Wil = Wil + Wi16l;
10708 var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
10709
10710 Wi.high = Wih;
10711 Wi.low = Wil;
10712 }
10713
10714 var chh = (eh & fh) ^ (~eh & gh);
10715 var chl = (el & fl) ^ (~el & gl);
10716 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
10717 var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
10718
10719 var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
10720 var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
10721 var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
10722 var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
10723
10724 // t1 = h + sigma1 + ch + K[i] + W[i]
10725 var Ki = K[i];
10726 var Kih = Ki.high;
10727 var Kil = Ki.low;
10728
10729 var t1l = hl + sigma1l;
10730 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
10731 var t1l = t1l + chl;
10732 var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
10733 var t1l = t1l + Kil;
10734 var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
10735 var t1l = t1l + Wil;
10736 var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
10737
10738 // t2 = sigma0 + maj
10739 var t2l = sigma0l + majl;
10740 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
10741
10742 // Update working variables
10743 hh = gh;
10744 hl = gl;
10745 gh = fh;
10746 gl = fl;
10747 fh = eh;
10748 fl = el;
10749 el = (dl + t1l) | 0;
10750 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
10751 dh = ch;
10752 dl = cl;
10753 ch = bh;
10754 cl = bl;
10755 bh = ah;
10756 bl = al;
10757 al = (t1l + t2l) | 0;
10758 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
10759 }
10760
10761 // Intermediate hash value
10762 H0l = H0.low = (H0l + al);
10763 H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
10764 H1l = H1.low = (H1l + bl);
10765 H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
10766 H2l = H2.low = (H2l + cl);
10767 H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
10768 H3l = H3.low = (H3l + dl);
10769 H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
10770 H4l = H4.low = (H4l + el);
10771 H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
10772 H5l = H5.low = (H5l + fl);
10773 H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
10774 H6l = H6.low = (H6l + gl);
10775 H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
10776 H7l = H7.low = (H7l + hl);
10777 H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
10778 },
10779
10780 _doFinalize: function () {
10781 // Shortcuts
10782 var data = this._data;
10783 var dataWords = data.words;
10784
10785 var nBitsTotal = this._nDataBytes * 8;
10786 var nBitsLeft = data.sigBytes * 8;
10787
10788 // Add padding
10789 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
10790 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
10791 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
10792 data.sigBytes = dataWords.length * 4;
10793
10794 // Hash final blocks
10795 this._process();
10796
10797 // Convert hash to 32-bit word array before returning
10798 var hash = this._hash.toX32();
10799
10800 // Return final computed hash
10801 return hash;
10802 },
10803
10804 clone: function () {
10805 var clone = Hasher.clone.call(this);
10806 clone._hash = this._hash.clone();
10807
10808 return clone;
10809 },
10810
10811 blockSize: 1024/32
10812 });
10813
10814 /**
10815 * Shortcut function to the hasher's object interface.
10816 *
10817 * @param {WordArray|string} message The message to hash.
10818 *
10819 * @return {WordArray} The hash.
10820 *
10821 * @static
10822 *
10823 * @example
10824 *
10825 * var hash = CryptoJS.SHA512('message');
10826 * var hash = CryptoJS.SHA512(wordArray);
10827 */
10828 C.SHA512 = Hasher._createHelper(SHA512);
10829
10830 /**
10831 * Shortcut function to the HMAC's object interface.
10832 *
10833 * @param {WordArray|string} message The message to hash.
10834 * @param {WordArray|string} key The secret key.
10835 *
10836 * @return {WordArray} The HMAC.
10837 *
10838 * @static
10839 *
10840 * @example
10841 *
10842 * var hmac = CryptoJS.HmacSHA512(message, key);
10843 */
10844 C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
10845 }());
10846
10847
10848 return CryptoJS.SHA512;
10849
10850 }));
10851 },{"./core":31,"./x64-core":62}],61:[function(_dereq_,module,exports){
10852 ;(function (root, factory, undef) {
10853 if (typeof exports === "object") {
10854 // CommonJS
10855 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
10856 }
10857 else if (typeof define === "function" && define.amd) {
10858 // AMD
10859 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
10860 }
10861 else {
10862 // Global (browser)
10863 factory(root.CryptoJS);
10864 }
10865 }(this, function (CryptoJS) {
10866
10867 (function () {
10868 // Shortcuts
10869 var C = CryptoJS;
10870 var C_lib = C.lib;
10871 var WordArray = C_lib.WordArray;
10872 var BlockCipher = C_lib.BlockCipher;
10873 var C_algo = C.algo;
10874
10875 // Permuted Choice 1 constants
10876 var PC1 = [
10877 57, 49, 41, 33, 25, 17, 9, 1,
10878 58, 50, 42, 34, 26, 18, 10, 2,
10879 59, 51, 43, 35, 27, 19, 11, 3,
10880 60, 52, 44, 36, 63, 55, 47, 39,
10881 31, 23, 15, 7, 62, 54, 46, 38,
10882 30, 22, 14, 6, 61, 53, 45, 37,
10883 29, 21, 13, 5, 28, 20, 12, 4
10884 ];
10885
10886 // Permuted Choice 2 constants
10887 var PC2 = [
10888 14, 17, 11, 24, 1, 5,
10889 3, 28, 15, 6, 21, 10,
10890 23, 19, 12, 4, 26, 8,
10891 16, 7, 27, 20, 13, 2,
10892 41, 52, 31, 37, 47, 55,
10893 30, 40, 51, 45, 33, 48,
10894 44, 49, 39, 56, 34, 53,
10895 46, 42, 50, 36, 29, 32
10896 ];
10897
10898 // Cumulative bit shift constants
10899 var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
10900
10901 // SBOXes and round permutation constants
10902 var SBOX_P = [
10903 {
10904 0x0: 0x808200,
10905 0x10000000: 0x8000,
10906 0x20000000: 0x808002,
10907 0x30000000: 0x2,
10908 0x40000000: 0x200,
10909 0x50000000: 0x808202,
10910 0x60000000: 0x800202,
10911 0x70000000: 0x800000,
10912 0x80000000: 0x202,
10913 0x90000000: 0x800200,
10914 0xa0000000: 0x8200,
10915 0xb0000000: 0x808000,
10916 0xc0000000: 0x8002,
10917 0xd0000000: 0x800002,
10918 0xe0000000: 0x0,
10919 0xf0000000: 0x8202,
10920 0x8000000: 0x0,
10921 0x18000000: 0x808202,
10922 0x28000000: 0x8202,
10923 0x38000000: 0x8000,
10924 0x48000000: 0x808200,
10925 0x58000000: 0x200,
10926 0x68000000: 0x808002,
10927 0x78000000: 0x2,
10928 0x88000000: 0x800200,
10929 0x98000000: 0x8200,
10930 0xa8000000: 0x808000,
10931 0xb8000000: 0x800202,
10932 0xc8000000: 0x800002,
10933 0xd8000000: 0x8002,
10934 0xe8000000: 0x202,
10935 0xf8000000: 0x800000,
10936 0x1: 0x8000,
10937 0x10000001: 0x2,
10938 0x20000001: 0x808200,
10939 0x30000001: 0x800000,
10940 0x40000001: 0x808002,
10941 0x50000001: 0x8200,
10942 0x60000001: 0x200,
10943 0x70000001: 0x800202,
10944 0x80000001: 0x808202,
10945 0x90000001: 0x808000,
10946 0xa0000001: 0x800002,
10947 0xb0000001: 0x8202,
10948 0xc0000001: 0x202,
10949 0xd0000001: 0x800200,
10950 0xe0000001: 0x8002,
10951 0xf0000001: 0x0,
10952 0x8000001: 0x808202,
10953 0x18000001: 0x808000,
10954 0x28000001: 0x800000,
10955 0x38000001: 0x200,
10956 0x48000001: 0x8000,
10957 0x58000001: 0x800002,
10958 0x68000001: 0x2,
10959 0x78000001: 0x8202,
10960 0x88000001: 0x8002,
10961 0x98000001: 0x800202,
10962 0xa8000001: 0x202,
10963 0xb8000001: 0x808200,
10964 0xc8000001: 0x800200,
10965 0xd8000001: 0x0,
10966 0xe8000001: 0x8200,
10967 0xf8000001: 0x808002
10968 },
10969 {
10970 0x0: 0x40084010,
10971 0x1000000: 0x4000,
10972 0x2000000: 0x80000,
10973 0x3000000: 0x40080010,
10974 0x4000000: 0x40000010,
10975 0x5000000: 0x40084000,
10976 0x6000000: 0x40004000,
10977 0x7000000: 0x10,
10978 0x8000000: 0x84000,
10979 0x9000000: 0x40004010,
10980 0xa000000: 0x40000000,
10981 0xb000000: 0x84010,
10982 0xc000000: 0x80010,
10983 0xd000000: 0x0,
10984 0xe000000: 0x4010,
10985 0xf000000: 0x40080000,
10986 0x800000: 0x40004000,
10987 0x1800000: 0x84010,
10988 0x2800000: 0x10,
10989 0x3800000: 0x40004010,
10990 0x4800000: 0x40084010,
10991 0x5800000: 0x40000000,
10992 0x6800000: 0x80000,
10993 0x7800000: 0x40080010,
10994 0x8800000: 0x80010,
10995 0x9800000: 0x0,
10996 0xa800000: 0x4000,
10997 0xb800000: 0x40080000,
10998 0xc800000: 0x40000010,
10999 0xd800000: 0x84000,
11000 0xe800000: 0x40084000,
11001 0xf800000: 0x4010,
11002 0x10000000: 0x0,
11003 0x11000000: 0x40080010,
11004 0x12000000: 0x40004010,
11005 0x13000000: 0x40084000,
11006 0x14000000: 0x40080000,
11007 0x15000000: 0x10,
11008 0x16000000: 0x84010,
11009 0x17000000: 0x4000,
11010 0x18000000: 0x4010,
11011 0x19000000: 0x80000,
11012 0x1a000000: 0x80010,
11013 0x1b000000: 0x40000010,
11014 0x1c000000: 0x84000,
11015 0x1d000000: 0x40004000,
11016 0x1e000000: 0x40000000,
11017 0x1f000000: 0x40084010,
11018 0x10800000: 0x84010,
11019 0x11800000: 0x80000,
11020 0x12800000: 0x40080000,
11021 0x13800000: 0x4000,
11022 0x14800000: 0x40004000,
11023 0x15800000: 0x40084010,
11024 0x16800000: 0x10,
11025 0x17800000: 0x40000000,
11026 0x18800000: 0x40084000,
11027 0x19800000: 0x40000010,
11028 0x1a800000: 0x40004010,
11029 0x1b800000: 0x80010,
11030 0x1c800000: 0x0,
11031 0x1d800000: 0x4010,
11032 0x1e800000: 0x40080010,
11033 0x1f800000: 0x84000
11034 },
11035 {
11036 0x0: 0x104,
11037 0x100000: 0x0,
11038 0x200000: 0x4000100,
11039 0x300000: 0x10104,
11040 0x400000: 0x10004,
11041 0x500000: 0x4000004,
11042 0x600000: 0x4010104,
11043 0x700000: 0x4010000,
11044 0x800000: 0x4000000,
11045 0x900000: 0x4010100,
11046 0xa00000: 0x10100,
11047 0xb00000: 0x4010004,
11048 0xc00000: 0x4000104,
11049 0xd00000: 0x10000,
11050 0xe00000: 0x4,
11051 0xf00000: 0x100,
11052 0x80000: 0x4010100,
11053 0x180000: 0x4010004,
11054 0x280000: 0x0,
11055 0x380000: 0x4000100,
11056 0x480000: 0x4000004,
11057 0x580000: 0x10000,
11058 0x680000: 0x10004,
11059 0x780000: 0x104,
11060 0x880000: 0x4,
11061 0x980000: 0x100,
11062 0xa80000: 0x4010000,
11063 0xb80000: 0x10104,
11064 0xc80000: 0x10100,
11065 0xd80000: 0x4000104,
11066 0xe80000: 0x4010104,
11067 0xf80000: 0x4000000,
11068 0x1000000: 0x4010100,
11069 0x1100000: 0x10004,
11070 0x1200000: 0x10000,
11071 0x1300000: 0x4000100,
11072 0x1400000: 0x100,
11073 0x1500000: 0x4010104,
11074 0x1600000: 0x4000004,
11075 0x1700000: 0x0,
11076 0x1800000: 0x4000104,
11077 0x1900000: 0x4000000,
11078 0x1a00000: 0x4,
11079 0x1b00000: 0x10100,
11080 0x1c00000: 0x4010000,
11081 0x1d00000: 0x104,
11082 0x1e00000: 0x10104,
11083 0x1f00000: 0x4010004,
11084 0x1080000: 0x4000000,
11085 0x1180000: 0x104,
11086 0x1280000: 0x4010100,
11087 0x1380000: 0x0,
11088 0x1480000: 0x10004,
11089 0x1580000: 0x4000100,
11090 0x1680000: 0x100,
11091 0x1780000: 0x4010004,
11092 0x1880000: 0x10000,
11093 0x1980000: 0x4010104,
11094 0x1a80000: 0x10104,
11095 0x1b80000: 0x4000004,
11096 0x1c80000: 0x4000104,
11097 0x1d80000: 0x4010000,
11098 0x1e80000: 0x4,
11099 0x1f80000: 0x10100
11100 },
11101 {
11102 0x0: 0x80401000,
11103 0x10000: 0x80001040,
11104 0x20000: 0x401040,
11105 0x30000: 0x80400000,
11106 0x40000: 0x0,
11107 0x50000: 0x401000,
11108 0x60000: 0x80000040,
11109 0x70000: 0x400040,
11110 0x80000: 0x80000000,
11111 0x90000: 0x400000,
11112 0xa0000: 0x40,
11113 0xb0000: 0x80001000,
11114 0xc0000: 0x80400040,
11115 0xd0000: 0x1040,
11116 0xe0000: 0x1000,
11117 0xf0000: 0x80401040,
11118 0x8000: 0x80001040,
11119 0x18000: 0x40,
11120 0x28000: 0x80400040,
11121 0x38000: 0x80001000,
11122 0x48000: 0x401000,
11123 0x58000: 0x80401040,
11124 0x68000: 0x0,
11125 0x78000: 0x80400000,
11126 0x88000: 0x1000,
11127 0x98000: 0x80401000,
11128 0xa8000: 0x400000,
11129 0xb8000: 0x1040,
11130 0xc8000: 0x80000000,
11131 0xd8000: 0x400040,
11132 0xe8000: 0x401040,
11133 0xf8000: 0x80000040,
11134 0x100000: 0x400040,
11135 0x110000: 0x401000,
11136 0x120000: 0x80000040,
11137 0x130000: 0x0,
11138 0x140000: 0x1040,
11139 0x150000: 0x80400040,
11140 0x160000: 0x80401000,
11141 0x170000: 0x80001040,
11142 0x180000: 0x80401040,
11143 0x190000: 0x80000000,
11144 0x1a0000: 0x80400000,
11145 0x1b0000: 0x401040,
11146 0x1c0000: 0x80001000,
11147 0x1d0000: 0x400000,
11148 0x1e0000: 0x40,
11149 0x1f0000: 0x1000,
11150 0x108000: 0x80400000,
11151 0x118000: 0x80401040,
11152 0x128000: 0x0,
11153 0x138000: 0x401000,
11154 0x148000: 0x400040,
11155 0x158000: 0x80000000,
11156 0x168000: 0x80001040,
11157 0x178000: 0x40,
11158 0x188000: 0x80000040,
11159 0x198000: 0x1000,
11160 0x1a8000: 0x80001000,
11161 0x1b8000: 0x80400040,
11162 0x1c8000: 0x1040,
11163 0x1d8000: 0x80401000,
11164 0x1e8000: 0x400000,
11165 0x1f8000: 0x401040
11166 },
11167 {
11168 0x0: 0x80,
11169 0x1000: 0x1040000,
11170 0x2000: 0x40000,
11171 0x3000: 0x20000000,
11172 0x4000: 0x20040080,
11173 0x5000: 0x1000080,
11174 0x6000: 0x21000080,
11175 0x7000: 0x40080,
11176 0x8000: 0x1000000,
11177 0x9000: 0x20040000,
11178 0xa000: 0x20000080,
11179 0xb000: 0x21040080,
11180 0xc000: 0x21040000,
11181 0xd000: 0x0,
11182 0xe000: 0x1040080,
11183 0xf000: 0x21000000,
11184 0x800: 0x1040080,
11185 0x1800: 0x21000080,
11186 0x2800: 0x80,
11187 0x3800: 0x1040000,
11188 0x4800: 0x40000,
11189 0x5800: 0x20040080,
11190 0x6800: 0x21040000,
11191 0x7800: 0x20000000,
11192 0x8800: 0x20040000,
11193 0x9800: 0x0,
11194 0xa800: 0x21040080,
11195 0xb800: 0x1000080,
11196 0xc800: 0x20000080,
11197 0xd800: 0x21000000,
11198 0xe800: 0x1000000,
11199 0xf800: 0x40080,
11200 0x10000: 0x40000,
11201 0x11000: 0x80,
11202 0x12000: 0x20000000,
11203 0x13000: 0x21000080,
11204 0x14000: 0x1000080,
11205 0x15000: 0x21040000,
11206 0x16000: 0x20040080,
11207 0x17000: 0x1000000,
11208 0x18000: 0x21040080,
11209 0x19000: 0x21000000,
11210 0x1a000: 0x1040000,
11211 0x1b000: 0x20040000,
11212 0x1c000: 0x40080,
11213 0x1d000: 0x20000080,
11214 0x1e000: 0x0,
11215 0x1f000: 0x1040080,
11216 0x10800: 0x21000080,
11217 0x11800: 0x1000000,
11218 0x12800: 0x1040000,
11219 0x13800: 0x20040080,
11220 0x14800: 0x20000000,
11221 0x15800: 0x1040080,
11222 0x16800: 0x80,
11223 0x17800: 0x21040000,
11224 0x18800: 0x40080,
11225 0x19800: 0x21040080,
11226 0x1a800: 0x0,
11227 0x1b800: 0x21000000,
11228 0x1c800: 0x1000080,
11229 0x1d800: 0x40000,
11230 0x1e800: 0x20040000,
11231 0x1f800: 0x20000080
11232 },
11233 {
11234 0x0: 0x10000008,
11235 0x100: 0x2000,
11236 0x200: 0x10200000,
11237 0x300: 0x10202008,
11238 0x400: 0x10002000,
11239 0x500: 0x200000,
11240 0x600: 0x200008,
11241 0x700: 0x10000000,
11242 0x800: 0x0,
11243 0x900: 0x10002008,
11244 0xa00: 0x202000,
11245 0xb00: 0x8,
11246 0xc00: 0x10200008,
11247 0xd00: 0x202008,
11248 0xe00: 0x2008,
11249 0xf00: 0x10202000,
11250 0x80: 0x10200000,
11251 0x180: 0x10202008,
11252 0x280: 0x8,
11253 0x380: 0x200000,
11254 0x480: 0x202008,
11255 0x580: 0x10000008,
11256 0x680: 0x10002000,
11257 0x780: 0x2008,
11258 0x880: 0x200008,
11259 0x980: 0x2000,
11260 0xa80: 0x10002008,
11261 0xb80: 0x10200008,
11262 0xc80: 0x0,
11263 0xd80: 0x10202000,
11264 0xe80: 0x202000,
11265 0xf80: 0x10000000,
11266 0x1000: 0x10002000,
11267 0x1100: 0x10200008,
11268 0x1200: 0x10202008,
11269 0x1300: 0x2008,
11270 0x1400: 0x200000,
11271 0x1500: 0x10000000,
11272 0x1600: 0x10000008,
11273 0x1700: 0x202000,
11274 0x1800: 0x202008,
11275 0x1900: 0x0,
11276 0x1a00: 0x8,
11277 0x1b00: 0x10200000,
11278 0x1c00: 0x2000,
11279 0x1d00: 0x10002008,
11280 0x1e00: 0x10202000,
11281 0x1f00: 0x200008,
11282 0x1080: 0x8,
11283 0x1180: 0x202000,
11284 0x1280: 0x200000,
11285 0x1380: 0x10000008,
11286 0x1480: 0x10002000,
11287 0x1580: 0x2008,
11288 0x1680: 0x10202008,
11289 0x1780: 0x10200000,
11290 0x1880: 0x10202000,
11291 0x1980: 0x10200008,
11292 0x1a80: 0x2000,
11293 0x1b80: 0x202008,
11294 0x1c80: 0x200008,
11295 0x1d80: 0x0,
11296 0x1e80: 0x10000000,
11297 0x1f80: 0x10002008
11298 },
11299 {
11300 0x0: 0x100000,
11301 0x10: 0x2000401,
11302 0x20: 0x400,
11303 0x30: 0x100401,
11304 0x40: 0x2100401,
11305 0x50: 0x0,
11306 0x60: 0x1,
11307 0x70: 0x2100001,
11308 0x80: 0x2000400,
11309 0x90: 0x100001,
11310 0xa0: 0x2000001,
11311 0xb0: 0x2100400,
11312 0xc0: 0x2100000,
11313 0xd0: 0x401,
11314 0xe0: 0x100400,
11315 0xf0: 0x2000000,
11316 0x8: 0x2100001,
11317 0x18: 0x0,
11318 0x28: 0x2000401,
11319 0x38: 0x2100400,
11320 0x48: 0x100000,
11321 0x58: 0x2000001,
11322 0x68: 0x2000000,
11323 0x78: 0x401,
11324 0x88: 0x100401,
11325 0x98: 0x2000400,
11326 0xa8: 0x2100000,
11327 0xb8: 0x100001,
11328 0xc8: 0x400,
11329 0xd8: 0x2100401,
11330 0xe8: 0x1,
11331 0xf8: 0x100400,
11332 0x100: 0x2000000,
11333 0x110: 0x100000,
11334 0x120: 0x2000401,
11335 0x130: 0x2100001,
11336 0x140: 0x100001,
11337 0x150: 0x2000400,
11338 0x160: 0x2100400,
11339 0x170: 0x100401,
11340 0x180: 0x401,
11341 0x190: 0x2100401,
11342 0x1a0: 0x100400,
11343 0x1b0: 0x1,
11344 0x1c0: 0x0,
11345 0x1d0: 0x2100000,
11346 0x1e0: 0x2000001,
11347 0x1f0: 0x400,
11348 0x108: 0x100400,
11349 0x118: 0x2000401,
11350 0x128: 0x2100001,
11351 0x138: 0x1,
11352 0x148: 0x2000000,
11353 0x158: 0x100000,
11354 0x168: 0x401,
11355 0x178: 0x2100400,
11356 0x188: 0x2000001,
11357 0x198: 0x2100000,
11358 0x1a8: 0x0,
11359 0x1b8: 0x2100401,
11360 0x1c8: 0x100401,
11361 0x1d8: 0x400,
11362 0x1e8: 0x2000400,
11363 0x1f8: 0x100001
11364 },
11365 {
11366 0x0: 0x8000820,
11367 0x1: 0x20000,
11368 0x2: 0x8000000,
11369 0x3: 0x20,
11370 0x4: 0x20020,
11371 0x5: 0x8020820,
11372 0x6: 0x8020800,
11373 0x7: 0x800,
11374 0x8: 0x8020000,
11375 0x9: 0x8000800,
11376 0xa: 0x20800,
11377 0xb: 0x8020020,
11378 0xc: 0x820,
11379 0xd: 0x0,
11380 0xe: 0x8000020,
11381 0xf: 0x20820,
11382 0x80000000: 0x800,
11383 0x80000001: 0x8020820,
11384 0x80000002: 0x8000820,
11385 0x80000003: 0x8000000,
11386 0x80000004: 0x8020000,
11387 0x80000005: 0x20800,
11388 0x80000006: 0x20820,
11389 0x80000007: 0x20,
11390 0x80000008: 0x8000020,
11391 0x80000009: 0x820,
11392 0x8000000a: 0x20020,
11393 0x8000000b: 0x8020800,
11394 0x8000000c: 0x0,
11395 0x8000000d: 0x8020020,
11396 0x8000000e: 0x8000800,
11397 0x8000000f: 0x20000,
11398 0x10: 0x20820,
11399 0x11: 0x8020800,
11400 0x12: 0x20,
11401 0x13: 0x800,
11402 0x14: 0x8000800,
11403 0x15: 0x8000020,
11404 0x16: 0x8020020,
11405 0x17: 0x20000,
11406 0x18: 0x0,
11407 0x19: 0x20020,
11408 0x1a: 0x8020000,
11409 0x1b: 0x8000820,
11410 0x1c: 0x8020820,
11411 0x1d: 0x20800,
11412 0x1e: 0x820,
11413 0x1f: 0x8000000,
11414 0x80000010: 0x20000,
11415 0x80000011: 0x800,
11416 0x80000012: 0x8020020,
11417 0x80000013: 0x20820,
11418 0x80000014: 0x20,
11419 0x80000015: 0x8020000,
11420 0x80000016: 0x8000000,
11421 0x80000017: 0x8000820,
11422 0x80000018: 0x8020820,
11423 0x80000019: 0x8000020,
11424 0x8000001a: 0x8000800,
11425 0x8000001b: 0x0,
11426 0x8000001c: 0x20800,
11427 0x8000001d: 0x820,
11428 0x8000001e: 0x20020,
11429 0x8000001f: 0x8020800
11430 }
11431 ];
11432
11433 // Masks that select the SBOX input
11434 var SBOX_MASK = [
11435 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
11436 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
11437 ];
11438
11439 /**
11440 * DES block cipher algorithm.
11441 */
11442 var DES = C_algo.DES = BlockCipher.extend({
11443 _doReset: function () {
11444 // Shortcuts
11445 var key = this._key;
11446 var keyWords = key.words;
11447
11448 // Select 56 bits according to PC1
11449 var keyBits = [];
11450 for (var i = 0; i < 56; i++) {
11451 var keyBitPos = PC1[i] - 1;
11452 keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
11453 }
11454
11455 // Assemble 16 subkeys
11456 var subKeys = this._subKeys = [];
11457 for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
11458 // Create subkey
11459 var subKey = subKeys[nSubKey] = [];
11460
11461 // Shortcut
11462 var bitShift = BIT_SHIFTS[nSubKey];
11463
11464 // Select 48 bits according to PC2
11465 for (var i = 0; i < 24; i++) {
11466 // Select from the left 28 key bits
11467 subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
11468
11469 // Select from the right 28 key bits
11470 subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
11471 }
11472
11473 // Since each subkey is applied to an expanded 32-bit input,
11474 // the subkey can be broken into 8 values scaled to 32-bits,
11475 // which allows the key to be used without expansion
11476 subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
11477 for (var i = 1; i < 7; i++) {
11478 subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
11479 }
11480 subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
11481 }
11482
11483 // Compute inverse subkeys
11484 var invSubKeys = this._invSubKeys = [];
11485 for (var i = 0; i < 16; i++) {
11486 invSubKeys[i] = subKeys[15 - i];
11487 }
11488 },
11489
11490 encryptBlock: function (M, offset) {
11491 this._doCryptBlock(M, offset, this._subKeys);
11492 },
11493
11494 decryptBlock: function (M, offset) {
11495 this._doCryptBlock(M, offset, this._invSubKeys);
11496 },
11497
11498 _doCryptBlock: function (M, offset, subKeys) {
11499 // Get input
11500 this._lBlock = M[offset];
11501 this._rBlock = M[offset + 1];
11502
11503 // Initial permutation
11504 exchangeLR.call(this, 4, 0x0f0f0f0f);
11505 exchangeLR.call(this, 16, 0x0000ffff);
11506 exchangeRL.call(this, 2, 0x33333333);
11507 exchangeRL.call(this, 8, 0x00ff00ff);
11508 exchangeLR.call(this, 1, 0x55555555);
11509
11510 // Rounds
11511 for (var round = 0; round < 16; round++) {
11512 // Shortcuts
11513 var subKey = subKeys[round];
11514 var lBlock = this._lBlock;
11515 var rBlock = this._rBlock;
11516
11517 // Feistel function
11518 var f = 0;
11519 for (var i = 0; i < 8; i++) {
11520 f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
11521 }
11522 this._lBlock = rBlock;
11523 this._rBlock = lBlock ^ f;
11524 }
11525
11526 // Undo swap from last round
11527 var t = this._lBlock;
11528 this._lBlock = this._rBlock;
11529 this._rBlock = t;
11530
11531 // Final permutation
11532 exchangeLR.call(this, 1, 0x55555555);
11533 exchangeRL.call(this, 8, 0x00ff00ff);
11534 exchangeRL.call(this, 2, 0x33333333);
11535 exchangeLR.call(this, 16, 0x0000ffff);
11536 exchangeLR.call(this, 4, 0x0f0f0f0f);
11537
11538 // Set output
11539 M[offset] = this._lBlock;
11540 M[offset + 1] = this._rBlock;
11541 },
11542
11543 keySize: 64/32,
11544
11545 ivSize: 64/32,
11546
11547 blockSize: 64/32
11548 });
11549
11550 // Swap bits across the left and right words
11551 function exchangeLR(offset, mask) {
11552 var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
11553 this._rBlock ^= t;
11554 this._lBlock ^= t << offset;
11555 }
11556
11557 function exchangeRL(offset, mask) {
11558 var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
11559 this._lBlock ^= t;
11560 this._rBlock ^= t << offset;
11561 }
11562
11563 /**
11564 * Shortcut functions to the cipher's object interface.
11565 *
11566 * @example
11567 *
11568 * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
11569 * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
11570 */
11571 C.DES = BlockCipher._createHelper(DES);
11572
11573 /**
11574 * Triple-DES block cipher algorithm.
11575 */
11576 var TripleDES = C_algo.TripleDES = BlockCipher.extend({
11577 _doReset: function () {
11578 // Shortcuts
11579 var key = this._key;
11580 var keyWords = key.words;
11581
11582 // Create DES instances
11583 this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
11584 this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
11585 this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
11586 },
11587
11588 encryptBlock: function (M, offset) {
11589 this._des1.encryptBlock(M, offset);
11590 this._des2.decryptBlock(M, offset);
11591 this._des3.encryptBlock(M, offset);
11592 },
11593
11594 decryptBlock: function (M, offset) {
11595 this._des3.decryptBlock(M, offset);
11596 this._des2.encryptBlock(M, offset);
11597 this._des1.decryptBlock(M, offset);
11598 },
11599
11600 keySize: 192/32,
11601
11602 ivSize: 64/32,
11603
11604 blockSize: 64/32
11605 });
11606
11607 /**
11608 * Shortcut functions to the cipher's object interface.
11609 *
11610 * @example
11611 *
11612 * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
11613 * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
11614 */
11615 C.TripleDES = BlockCipher._createHelper(TripleDES);
11616 }());
11617
11618
11619 return CryptoJS.TripleDES;
11620
11621 }));
11622 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],62:[function(_dereq_,module,exports){
11623 ;(function (root, factory) {
11624 if (typeof exports === "object") {
11625 // CommonJS
11626 module.exports = exports = factory(_dereq_("./core"));
11627 }
11628 else if (typeof define === "function" && define.amd) {
11629 // AMD
11630 define(["./core"], factory);
11631 }
11632 else {
11633 // Global (browser)
11634 factory(root.CryptoJS);
11635 }
11636 }(this, function (CryptoJS) {
11637
11638 (function (undefined) {
11639 // Shortcuts
11640 var C = CryptoJS;
11641 var C_lib = C.lib;
11642 var Base = C_lib.Base;
11643 var X32WordArray = C_lib.WordArray;
11644
11645 /**
11646 * x64 namespace.
11647 */
11648 var C_x64 = C.x64 = {};
11649
11650 /**
11651 * A 64-bit word.
11652 */
11653 var X64Word = C_x64.Word = Base.extend({
11654 /**
11655 * Initializes a newly created 64-bit word.
11656 *
11657 * @param {number} high The high 32 bits.
11658 * @param {number} low The low 32 bits.
11659 *
11660 * @example
11661 *
11662 * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
11663 */
11664 init: function (high, low) {
11665 this.high = high;
11666 this.low = low;
11667 }
11668
11669 /**
11670 * Bitwise NOTs this word.
11671 *
11672 * @return {X64Word} A new x64-Word object after negating.
11673 *
11674 * @example
11675 *
11676 * var negated = x64Word.not();
11677 */
11678 // not: function () {
11679 // var high = ~this.high;
11680 // var low = ~this.low;
11681
11682 // return X64Word.create(high, low);
11683 // },
11684
11685 /**
11686 * Bitwise ANDs this word with the passed word.
11687 *
11688 * @param {X64Word} word The x64-Word to AND with this word.
11689 *
11690 * @return {X64Word} A new x64-Word object after ANDing.
11691 *
11692 * @example
11693 *
11694 * var anded = x64Word.and(anotherX64Word);
11695 */
11696 // and: function (word) {
11697 // var high = this.high & word.high;
11698 // var low = this.low & word.low;
11699
11700 // return X64Word.create(high, low);
11701 // },
11702
11703 /**
11704 * Bitwise ORs this word with the passed word.
11705 *
11706 * @param {X64Word} word The x64-Word to OR with this word.
11707 *
11708 * @return {X64Word} A new x64-Word object after ORing.
11709 *
11710 * @example
11711 *
11712 * var ored = x64Word.or(anotherX64Word);
11713 */
11714 // or: function (word) {
11715 // var high = this.high | word.high;
11716 // var low = this.low | word.low;
11717
11718 // return X64Word.create(high, low);
11719 // },
11720
11721 /**
11722 * Bitwise XORs this word with the passed word.
11723 *
11724 * @param {X64Word} word The x64-Word to XOR with this word.
11725 *
11726 * @return {X64Word} A new x64-Word object after XORing.
11727 *
11728 * @example
11729 *
11730 * var xored = x64Word.xor(anotherX64Word);
11731 */
11732 // xor: function (word) {
11733 // var high = this.high ^ word.high;
11734 // var low = this.low ^ word.low;
11735
11736 // return X64Word.create(high, low);
11737 // },
11738
11739 /**
11740 * Shifts this word n bits to the left.
11741 *
11742 * @param {number} n The number of bits to shift.
11743 *
11744 * @return {X64Word} A new x64-Word object after shifting.
11745 *
11746 * @example
11747 *
11748 * var shifted = x64Word.shiftL(25);
11749 */
11750 // shiftL: function (n) {
11751 // if (n < 32) {
11752 // var high = (this.high << n) | (this.low >>> (32 - n));
11753 // var low = this.low << n;
11754 // } else {
11755 // var high = this.low << (n - 32);
11756 // var low = 0;
11757 // }
11758
11759 // return X64Word.create(high, low);
11760 // },
11761
11762 /**
11763 * Shifts this word n bits to the right.
11764 *
11765 * @param {number} n The number of bits to shift.
11766 *
11767 * @return {X64Word} A new x64-Word object after shifting.
11768 *
11769 * @example
11770 *
11771 * var shifted = x64Word.shiftR(7);
11772 */
11773 // shiftR: function (n) {
11774 // if (n < 32) {
11775 // var low = (this.low >>> n) | (this.high << (32 - n));
11776 // var high = this.high >>> n;
11777 // } else {
11778 // var low = this.high >>> (n - 32);
11779 // var high = 0;
11780 // }
11781
11782 // return X64Word.create(high, low);
11783 // },
11784
11785 /**
11786 * Rotates this word n bits to the left.
11787 *
11788 * @param {number} n The number of bits to rotate.
11789 *
11790 * @return {X64Word} A new x64-Word object after rotating.
11791 *
11792 * @example
11793 *
11794 * var rotated = x64Word.rotL(25);
11795 */
11796 // rotL: function (n) {
11797 // return this.shiftL(n).or(this.shiftR(64 - n));
11798 // },
11799
11800 /**
11801 * Rotates this word n bits to the right.
11802 *
11803 * @param {number} n The number of bits to rotate.
11804 *
11805 * @return {X64Word} A new x64-Word object after rotating.
11806 *
11807 * @example
11808 *
11809 * var rotated = x64Word.rotR(7);
11810 */
11811 // rotR: function (n) {
11812 // return this.shiftR(n).or(this.shiftL(64 - n));
11813 // },
11814
11815 /**
11816 * Adds this word with the passed word.
11817 *
11818 * @param {X64Word} word The x64-Word to add with this word.
11819 *
11820 * @return {X64Word} A new x64-Word object after adding.
11821 *
11822 * @example
11823 *
11824 * var added = x64Word.add(anotherX64Word);
11825 */
11826 // add: function (word) {
11827 // var low = (this.low + word.low) | 0;
11828 // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
11829 // var high = (this.high + word.high + carry) | 0;
11830
11831 // return X64Word.create(high, low);
11832 // }
11833 });
11834
11835 /**
11836 * An array of 64-bit words.
11837 *
11838 * @property {Array} words The array of CryptoJS.x64.Word objects.
11839 * @property {number} sigBytes The number of significant bytes in this word array.
11840 */
11841 var X64WordArray = C_x64.WordArray = Base.extend({
11842 /**
11843 * Initializes a newly created word array.
11844 *
11845 * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
11846 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
11847 *
11848 * @example
11849 *
11850 * var wordArray = CryptoJS.x64.WordArray.create();
11851 *
11852 * var wordArray = CryptoJS.x64.WordArray.create([
11853 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11854 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11855 * ]);
11856 *
11857 * var wordArray = CryptoJS.x64.WordArray.create([
11858 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11859 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11860 * ], 10);
11861 */
11862 init: function (words, sigBytes) {
11863 words = this.words = words || [];
11864
11865 if (sigBytes != undefined) {
11866 this.sigBytes = sigBytes;
11867 } else {
11868 this.sigBytes = words.length * 8;
11869 }
11870 },
11871
11872 /**
11873 * Converts this 64-bit word array to a 32-bit word array.
11874 *
11875 * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
11876 *
11877 * @example
11878 *
11879 * var x32WordArray = x64WordArray.toX32();
11880 */
11881 toX32: function () {
11882 // Shortcuts
11883 var x64Words = this.words;
11884 var x64WordsLength = x64Words.length;
11885
11886 // Convert
11887 var x32Words = [];
11888 for (var i = 0; i < x64WordsLength; i++) {
11889 var x64Word = x64Words[i];
11890 x32Words.push(x64Word.high);
11891 x32Words.push(x64Word.low);
11892 }
11893
11894 return X32WordArray.create(x32Words, this.sigBytes);
11895 },
11896
11897 /**
11898 * Creates a copy of this word array.
11899 *
11900 * @return {X64WordArray} The clone.
11901 *
11902 * @example
11903 *
11904 * var clone = x64WordArray.clone();
11905 */
11906 clone: function () {
11907 var clone = Base.clone.call(this);
11908
11909 // Clone "words" array
11910 var words = clone.words = this.words.slice(0);
11911
11912 // Clone each X64Word object
11913 var wordsLength = words.length;
11914 for (var i = 0; i < wordsLength; i++) {
11915 words[i] = words[i].clone();
11916 }
11917
11918 return clone;
11919 }
11920 });
11921 }());
11922
11923
11924 return CryptoJS;
11925
11926 }));
11927 },{"./core":31}],63:[function(_dereq_,module,exports){
11928 var assert = _dereq_('assert')
11929 var BigInteger = _dereq_('bigi')
11930
11931 var Point = _dereq_('./point')
11932
11933 function Curve(p, a, b, Gx, Gy, n, h) {
11934 this.p = p
11935 this.a = a
11936 this.b = b
11937 this.G = Point.fromAffine(this, Gx, Gy)
11938 this.n = n
11939 this.h = h
11940
11941 this.infinity = new Point(this, null, null, BigInteger.ZERO)
11942
11943 // result caching
11944 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
11945 }
11946
11947 Curve.prototype.pointFromX = function(isOdd, x) {
11948 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
11949 var beta = alpha.modPow(this.pOverFour, this.p)
11950
11951 var y = beta
11952 if (beta.isEven() ^ !isOdd) {
11953 y = this.p.subtract(y) // -y % p
11954 }
11955
11956 return Point.fromAffine(this, x, y)
11957 }
11958
11959 Curve.prototype.isInfinity = function(Q) {
11960 if (Q === this.infinity) return true
11961
11962 return Q.z.signum() === 0 && Q.y.signum() !== 0
11963 }
11964
11965 Curve.prototype.isOnCurve = function(Q) {
11966 if (this.isInfinity(Q)) return true
11967
11968 var x = Q.affineX
11969 var y = Q.affineY
11970 var a = this.a
11971 var b = this.b
11972 var p = this.p
11973
11974 // Check that xQ and yQ are integers in the interval [0, p - 1]
11975 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
11976 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
11977
11978 // and check that y^2 = x^3 + ax + b (mod p)
11979 var lhs = y.square().mod(p)
11980 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
11981 return lhs.equals(rhs)
11982 }
11983
11984 /**
11985 * Validate an elliptic curve point.
11986 *
11987 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
11988 */
11989 Curve.prototype.validate = function(Q) {
11990 // Check Q != O
11991 assert(!this.isInfinity(Q), 'Point is at infinity')
11992 assert(this.isOnCurve(Q), 'Point is not on the curve')
11993
11994 // Check nQ = O (where Q is a scalar multiple of G)
11995 var nQ = Q.multiply(this.n)
11996 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
11997
11998 return true
11999 }
12000
12001 module.exports = Curve
12002
12003 },{"./point":67,"assert":4,"bigi":3}],64:[function(_dereq_,module,exports){
12004 module.exports={
12005 "secp128r1": {
12006 "p": "fffffffdffffffffffffffffffffffff",
12007 "a": "fffffffdfffffffffffffffffffffffc",
12008 "b": "e87579c11079f43dd824993c2cee5ed3",
12009 "n": "fffffffe0000000075a30d1b9038a115",
12010 "h": "01",
12011 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
12012 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
12013 },
12014 "secp160k1": {
12015 "p": "fffffffffffffffffffffffffffffffeffffac73",
12016 "a": "00",
12017 "b": "07",
12018 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
12019 "h": "01",
12020 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
12021 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
12022 },
12023 "secp160r1": {
12024 "p": "ffffffffffffffffffffffffffffffff7fffffff",
12025 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
12026 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
12027 "n": "0100000000000000000001f4c8f927aed3ca752257",
12028 "h": "01",
12029 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
12030 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
12031 },
12032 "secp192k1": {
12033 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
12034 "a": "00",
12035 "b": "03",
12036 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
12037 "h": "01",
12038 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
12039 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
12040 },
12041 "secp192r1": {
12042 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
12043 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
12044 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
12045 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
12046 "h": "01",
12047 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
12048 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
12049 },
12050 "secp224r1": {
12051 "p": "ffffffffffffffffffffffffffffffff000000000000000000000001",
12052 "a": "fffffffffffffffffffffffffffffffefffffffffffffffffffffffe",
12053 "b": "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4",
12054 "n": "ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d",
12055 "h": "01",
12056 "Gx": "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21",
12057 "Gy": "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"
12058 },
12059 "secp256k1": {
12060 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
12061 "a": "00",
12062 "b": "07",
12063 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
12064 "h": "01",
12065 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
12066 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
12067 },
12068 "secp256r1": {
12069 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
12070 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
12071 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
12072 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
12073 "h": "01",
12074 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
12075 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
12076 }
12077 }
12078
12079 },{}],65:[function(_dereq_,module,exports){
12080 var Point = _dereq_('./point')
12081 var Curve = _dereq_('./curve')
12082
12083 var getCurveByName = _dereq_('./names')
12084
12085 module.exports = {
12086 Curve: Curve,
12087 Point: Point,
12088 getCurveByName: getCurveByName
12089 }
12090
12091 },{"./curve":63,"./names":66,"./point":67}],66:[function(_dereq_,module,exports){
12092 var BigInteger = _dereq_('bigi')
12093
12094 var curves = _dereq_('./curves')
12095 var Curve = _dereq_('./curve')
12096
12097 function getCurveByName(name) {
12098 var curve = curves[name]
12099 if (!curve) return null
12100
12101 var p = new BigInteger(curve.p, 16)
12102 var a = new BigInteger(curve.a, 16)
12103 var b = new BigInteger(curve.b, 16)
12104 var n = new BigInteger(curve.n, 16)
12105 var h = new BigInteger(curve.h, 16)
12106 var Gx = new BigInteger(curve.Gx, 16)
12107 var Gy = new BigInteger(curve.Gy, 16)
12108
12109 return new Curve(p, a, b, Gx, Gy, n, h)
12110 }
12111
12112 module.exports = getCurveByName
12113
12114 },{"./curve":63,"./curves":64,"bigi":3}],67:[function(_dereq_,module,exports){
12115 (function (Buffer){
12116 var assert = _dereq_('assert')
12117 var BigInteger = _dereq_('bigi')
12118
12119 var THREE = BigInteger.valueOf(3)
12120
12121 function Point(curve, x, y, z) {
12122 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
12123
12124 this.curve = curve
12125 this.x = x
12126 this.y = y
12127 this.z = z
12128 this._zInv = null
12129
12130 this.compressed = true
12131 }
12132
12133 Object.defineProperty(Point.prototype, 'zInv', {
12134 get: function() {
12135 if (this._zInv === null) {
12136 this._zInv = this.z.modInverse(this.curve.p)
12137 }
12138
12139 return this._zInv
12140 }
12141 })
12142
12143 Object.defineProperty(Point.prototype, 'affineX', {
12144 get: function() {
12145 return this.x.multiply(this.zInv).mod(this.curve.p)
12146 }
12147 })
12148
12149 Object.defineProperty(Point.prototype, 'affineY', {
12150 get: function() {
12151 return this.y.multiply(this.zInv).mod(this.curve.p)
12152 }
12153 })
12154
12155 Point.fromAffine = function(curve, x, y) {
12156 return new Point(curve, x, y, BigInteger.ONE)
12157 }
12158
12159 Point.prototype.equals = function(other) {
12160 if (other === this) return true
12161 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
12162 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
12163
12164 // u = Y2 * Z1 - Y1 * Z2
12165 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
12166
12167 if (u.signum() !== 0) return false
12168
12169 // v = X2 * Z1 - X1 * Z2
12170 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
12171
12172 return v.signum() === 0
12173 }
12174
12175 Point.prototype.negate = function() {
12176 var y = this.curve.p.subtract(this.y)
12177
12178 return new Point(this.curve, this.x, y, this.z)
12179 }
12180
12181 Point.prototype.add = function(b) {
12182 if (this.curve.isInfinity(this)) return b
12183 if (this.curve.isInfinity(b)) return this
12184
12185 var x1 = this.x
12186 var y1 = this.y
12187 var x2 = b.x
12188 var y2 = b.y
12189
12190 // u = Y2 * Z1 - Y1 * Z2
12191 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
12192 // v = X2 * Z1 - X1 * Z2
12193 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
12194
12195 if (v.signum() === 0) {
12196 if (u.signum() === 0) {
12197 return this.twice() // this == b, so double
12198 }
12199
12200 return this.curve.infinity // this = -b, so infinity
12201 }
12202
12203 var v2 = v.square()
12204 var v3 = v2.multiply(v)
12205 var x1v2 = x1.multiply(v2)
12206 var zu2 = u.square().multiply(this.z)
12207
12208 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
12209 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
12210 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
12211 var y3 = x1v2.multiply(THREE).multiply(u).subtract(y1.multiply(v3)).subtract(zu2.multiply(u)).multiply(b.z).add(u.multiply(v3)).mod(this.curve.p)
12212 // z3 = v^3 * z1 * z2
12213 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
12214
12215 return new Point(this.curve, x3, y3, z3)
12216 }
12217
12218 Point.prototype.twice = function() {
12219 if (this.curve.isInfinity(this)) return this
12220 if (this.y.signum() === 0) return this.curve.infinity
12221
12222 var x1 = this.x
12223 var y1 = this.y
12224
12225 var y1z1 = y1.multiply(this.z)
12226 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
12227 var a = this.curve.a
12228
12229 // w = 3 * x1^2 + a * z1^2
12230 var w = x1.square().multiply(THREE)
12231
12232 if (a.signum() !== 0) {
12233 w = w.add(this.z.square().multiply(a))
12234 }
12235
12236 w = w.mod(this.curve.p)
12237 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
12238 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
12239 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
12240 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
12241 // z3 = 8 * (y1 * z1)^3
12242 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
12243
12244 return new Point(this.curve, x3, y3, z3)
12245 }
12246
12247 // Simple NAF (Non-Adjacent Form) multiplication algorithm
12248 // TODO: modularize the multiplication algorithm
12249 Point.prototype.multiply = function(k) {
12250 if (this.curve.isInfinity(this)) return this
12251 if (k.signum() === 0) return this.curve.infinity
12252
12253 var e = k
12254 var h = e.multiply(THREE)
12255
12256 var neg = this.negate()
12257 var R = this
12258
12259 for (var i = h.bitLength() - 2; i > 0; --i) {
12260 R = R.twice()
12261
12262 var hBit = h.testBit(i)
12263 var eBit = e.testBit(i)
12264
12265 if (hBit != eBit) {
12266 R = R.add(hBit ? this : neg)
12267 }
12268 }
12269
12270 return R
12271 }
12272
12273 // Compute this*j + x*k (simultaneous multiplication)
12274 Point.prototype.multiplyTwo = function(j, x, k) {
12275 var i
12276
12277 if (j.bitLength() > k.bitLength())
12278 i = j.bitLength() - 1
12279 else
12280 i = k.bitLength() - 1
12281
12282 var R = this.curve.infinity
12283 var both = this.add(x)
12284
12285 while (i >= 0) {
12286 R = R.twice()
12287
12288 var jBit = j.testBit(i)
12289 var kBit = k.testBit(i)
12290
12291 if (jBit) {
12292 if (kBit) {
12293 R = R.add(both)
12294
12295 } else {
12296 R = R.add(this)
12297 }
12298
12299 } else {
12300 if (kBit) {
12301 R = R.add(x)
12302 }
12303 }
12304 --i
12305 }
12306
12307 return R
12308 }
12309
12310 Point.prototype.getEncoded = function(compressed) {
12311 if (compressed == undefined) compressed = this.compressed
12312 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00'
12313
12314 var x = this.affineX
12315 var y = this.affineY
12316
12317 var buffer
12318
12319 // Determine size of q in bytes
12320 var byteLength = Math.floor((this.curve.p.bitLength() + 7) / 8)
12321
12322 // 0x02/0x03 | X
12323 if (compressed) {
12324 buffer = new Buffer(1 + byteLength)
12325 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
12326
12327 // 0x04 | X | Y
12328 } else {
12329 buffer = new Buffer(1 + byteLength + byteLength)
12330 buffer.writeUInt8(0x04, 0)
12331
12332 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
12333 }
12334
12335 x.toBuffer(byteLength).copy(buffer, 1)
12336
12337 return buffer
12338 }
12339
12340 Point.decodeFrom = function(curve, buffer) {
12341 var type = buffer.readUInt8(0)
12342 var compressed = (type !== 4)
12343
12344 var x = BigInteger.fromBuffer(buffer.slice(1, 33))
12345 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
12346
12347 var Q
12348 if (compressed) {
12349 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
12350 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
12351
12352 var isOdd = (type === 0x03)
12353 Q = curve.pointFromX(isOdd, x)
12354
12355 } else {
12356 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
12357
12358 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
12359 Q = Point.fromAffine(curve, x, y)
12360 }
12361
12362 Q.compressed = compressed
12363 return Q
12364 }
12365
12366 Point.prototype.toString = function () {
12367 if (this.curve.isInfinity(this)) return '(INFINITY)'
12368
12369 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
12370 }
12371
12372 module.exports = Point
12373
12374 }).call(this,_dereq_("buffer").Buffer)
12375 },{"assert":4,"bigi":3,"buffer":8}],68:[function(_dereq_,module,exports){
12376 (function (process,Buffer){
12377 // Closure compiler error - result of 'not' operator not being used
12378 //!function(globals){
12379 (function(globals){
12380 'use strict'
12381
12382 //*** UMD BEGIN
12383 if (typeof define !== 'undefined' && define.amd) { //require.js / AMD
12384 define([], function() {
12385 return secureRandom
12386 })
12387 } else if (typeof module !== 'undefined' && module.exports) { //CommonJS
12388 module.exports = secureRandom
12389 } else { //script / browser
12390 globals.secureRandom = secureRandom
12391 }
12392 //*** UMD END
12393
12394 //options.type is the only valid option
12395 function secureRandom(count, options) {
12396 options = options || {type: 'Array'}
12397 //we check for process.pid to prevent browserify from tricking us
12398 if (typeof process != 'undefined' && typeof process.pid == 'number') {
12399 return nodeRandom(count, options)
12400 } else {
12401 var crypto = window.crypto || window.msCrypto
12402 if (!crypto) throw new Error("Your browser does not support window.crypto.")
12403 return browserRandom(count, options)
12404 }
12405 }
12406
12407 function nodeRandom(count, options) {
12408 var crypto = _dereq_('crypto')
12409 var buf = crypto.randomBytes(count)
12410
12411 switch (options.type) {
12412 case 'Array':
12413 return [].slice.call(buf)
12414 case 'Buffer':
12415 return buf
12416 case 'Uint8Array':
12417 var arr = new Uint8Array(count)
12418 for (var i = 0; i < count; ++i) { arr[i] = buf.readUInt8(i) }
12419 return arr
12420 default:
12421 throw new Error(options.type + " is unsupported.")
12422 }
12423 }
12424
12425 function browserRandom(count, options) {
12426 var nativeArr = new Uint8Array(count)
12427 var crypto = window.crypto || window.msCrypto
12428 crypto.getRandomValues(nativeArr)
12429
12430 switch (options.type) {
12431 case 'Array':
12432 return [].slice.call(nativeArr)
12433 case 'Buffer':
12434 try { var b = new Buffer(1) } catch(e) { throw new Error('Buffer not supported in this environment. Use Node.js or Browserify for browser support.')}
12435 return new Buffer(nativeArr)
12436 case 'Uint8Array':
12437 return nativeArr
12438 default:
12439 throw new Error(options.type + " is unsupported.")
12440 }
12441 }
12442
12443 secureRandom.randomArray = function(byteCount) {
12444 return secureRandom(byteCount, {type: 'Array'})
12445 }
12446
12447 secureRandom.randomUint8Array = function(byteCount) {
12448 return secureRandom(byteCount, {type: 'Uint8Array'})
12449 }
12450
12451 secureRandom.randomBuffer = function(byteCount) {
12452 return secureRandom(byteCount, {type: 'Buffer'})
12453 }
12454
12455
12456 })(this);
12457
12458 }).call(this,_dereq_("FWaASH"),_dereq_("buffer").Buffer)
12459 },{"FWaASH":12,"buffer":8,"crypto":7}],69:[function(_dereq_,module,exports){
12460 (function (Buffer){
12461 var assert = _dereq_('assert')
12462 var base58check = _dereq_('./base58check')
12463 var networks = _dereq_('./networks')
12464 var scripts = _dereq_('./scripts')
12465
12466 function findScriptTypeByVersion(version) {
12467 for (var networkName in networks) {
12468 var network = networks[networkName]
12469
12470 if (version === network.pubKeyHash) return 'pubkeyhash'
12471 if (version === network.scriptHash) return 'scripthash'
12472 }
12473 }
12474
12475 function Address(hash, version) {
12476 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
12477 assert.strictEqual(hash.length, 20, 'Invalid hash length')
12478 assert.strictEqual(version & 0xff, version, 'Invalid version byte')
12479
12480 this.hash = hash
12481 this.version = version
12482 }
12483
12484 // Import functions
12485 Address.fromBase58Check = function(string) {
12486 var payload = base58check.decode(string)
12487 var version = payload.readUInt8(0)
12488 var hash = payload.slice(1)
12489
12490 return new Address(hash, version)
12491 }
12492
12493 Address.fromOutputScript = function(script, network) {
12494 network = network || networks.bitcoin
12495
12496 var type = scripts.classifyOutput(script)
12497
12498 if (type === 'pubkeyhash') return new Address(script.chunks[2], network.pubKeyHash)
12499 if (type === 'scripthash') return new Address(script.chunks[1], network.scriptHash)
12500
12501 assert(false, type + ' has no matching Address')
12502 }
12503
12504 // Export functions
12505 Address.prototype.toBase58Check = function () {
12506 var payload = new Buffer(21)
12507 payload.writeUInt8(this.version, 0)
12508 this.hash.copy(payload, 1)
12509
12510 return base58check.encode(payload)
12511 }
12512
12513 Address.prototype.toOutputScript = function() {
12514 var scriptType = findScriptTypeByVersion(this.version)
12515
12516 if (scriptType === 'pubkeyhash') return scripts.pubKeyHashOutput(this.hash)
12517 if (scriptType === 'scripthash') return scripts.scriptHashOutput(this.hash)
12518
12519 assert(false, this.toString() + ' has no matching Script')
12520 }
12521
12522 Address.prototype.toString = Address.prototype.toBase58Check
12523
12524 module.exports = Address
12525
12526 }).call(this,_dereq_("buffer").Buffer)
12527 },{"./base58check":70,"./networks":81,"./scripts":84,"assert":4,"buffer":8}],70:[function(_dereq_,module,exports){
12528 (function (Buffer){
12529 // https://en.bitcoin.it/wiki/Base58Check_encoding
12530 var assert = _dereq_('assert')
12531 var base58 = _dereq_('bs58')
12532 var crypto = _dereq_('./crypto')
12533
12534 // Encode a buffer as a base58-check-encoded string
12535 function encode(payload) {
12536 var checksum = crypto.hash256(payload).slice(0, 4)
12537
12538 return base58.encode(Buffer.concat([
12539 payload,
12540 checksum
12541 ]))
12542 }
12543
12544 // Decode a base58-check-encoded string to a buffer
12545 function decode(string) {
12546 var buffer = base58.decode(string)
12547
12548 var payload = buffer.slice(0, -4)
12549 var checksum = buffer.slice(-4)
12550 var newChecksum = crypto.hash256(payload).slice(0, 4)
12551
12552 assert.deepEqual(newChecksum, checksum, 'Invalid checksum')
12553
12554 return payload
12555 }
12556
12557 module.exports = {
12558 encode: encode,
12559 decode: decode
12560 }
12561
12562 }).call(this,_dereq_("buffer").Buffer)
12563 },{"./crypto":73,"assert":4,"bs58":15,"buffer":8}],71:[function(_dereq_,module,exports){
12564 var assert = _dereq_('assert')
12565 var opcodes = _dereq_('./opcodes')
12566
12567 // https://github.com/feross/buffer/blob/master/index.js#L1127
12568 function verifuint(value, max) {
12569 assert(typeof value === 'number', 'cannot write a non-number as a number')
12570 assert(value >= 0, 'specified a negative value for writing an unsigned value')
12571 assert(value <= max, 'value is larger than maximum value for type')
12572 assert(Math.floor(value) === value, 'value has a fractional component')
12573 }
12574
12575 function pushDataSize(i) {
12576 return i < opcodes.OP_PUSHDATA1 ? 1
12577 : i < 0xff ? 2
12578 : i < 0xffff ? 3
12579 : 5
12580 }
12581
12582 function readPushDataInt(buffer, offset) {
12583 var opcode = buffer.readUInt8(offset)
12584 var number, size
12585
12586 // ~6 bit
12587 if (opcode < opcodes.OP_PUSHDATA1) {
12588 number = opcode
12589 size = 1
12590
12591 // 8 bit
12592 } else if (opcode === opcodes.OP_PUSHDATA1) {
12593 number = buffer.readUInt8(offset + 1)
12594 size = 2
12595
12596 // 16 bit
12597 } else if (opcode === opcodes.OP_PUSHDATA2) {
12598 number = buffer.readUInt16LE(offset + 1)
12599 size = 3
12600
12601 // 32 bit
12602 } else {
12603 assert.equal(opcode, opcodes.OP_PUSHDATA4, 'Unexpected opcode')
12604
12605 number = buffer.readUInt32LE(offset + 1)
12606 size = 5
12607
12608 }
12609
12610 return {
12611 opcode: opcode,
12612 number: number,
12613 size: size
12614 }
12615 }
12616
12617 function readUInt64LE(buffer, offset) {
12618 var a = buffer.readUInt32LE(offset)
12619 var b = buffer.readUInt32LE(offset + 4)
12620 b *= 0x100000000
12621
12622 verifuint(b + a, 0x001fffffffffffff)
12623
12624 return b + a
12625 }
12626
12627 function readVarInt(buffer, offset) {
12628 var t = buffer.readUInt8(offset)
12629 var number, size
12630
12631 // 8 bit
12632 if (t < 253) {
12633 number = t
12634 size = 1
12635
12636 // 16 bit
12637 } else if (t < 254) {
12638 number = buffer.readUInt16LE(offset + 1)
12639 size = 3
12640
12641 // 32 bit
12642 } else if (t < 255) {
12643 number = buffer.readUInt32LE(offset + 1)
12644 size = 5
12645
12646 // 64 bit
12647 } else {
12648 number = readUInt64LE(buffer, offset + 1)
12649 size = 9
12650 }
12651
12652 return {
12653 number: number,
12654 size: size
12655 }
12656 }
12657
12658 function writePushDataInt(buffer, number, offset) {
12659 var size = pushDataSize(number)
12660
12661 // ~6 bit
12662 if (size === 1) {
12663 buffer.writeUInt8(number, offset)
12664
12665 // 8 bit
12666 } else if (size === 2) {
12667 buffer.writeUInt8(opcodes.OP_PUSHDATA1, offset)
12668 buffer.writeUInt8(number, offset + 1)
12669
12670 // 16 bit
12671 } else if (size === 3) {
12672 buffer.writeUInt8(opcodes.OP_PUSHDATA2, offset)
12673 buffer.writeUInt16LE(number, offset + 1)
12674
12675 // 32 bit
12676 } else {
12677 buffer.writeUInt8(opcodes.OP_PUSHDATA4, offset)
12678 buffer.writeUInt32LE(number, offset + 1)
12679
12680 }
12681
12682 return size
12683 }
12684
12685 function writeUInt64LE(buffer, value, offset) {
12686 verifuint(value, 0x001fffffffffffff)
12687
12688 buffer.writeInt32LE(value & -1, offset)
12689 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
12690 }
12691
12692 function varIntSize(i) {
12693 return i < 253 ? 1
12694 : i < 0x10000 ? 3
12695 : i < 0x100000000 ? 5
12696 : 9
12697 }
12698
12699 function writeVarInt(buffer, number, offset) {
12700 var size = varIntSize(number)
12701
12702 // 8 bit
12703 if (size === 1) {
12704 buffer.writeUInt8(number, offset)
12705
12706 // 16 bit
12707 } else if (size === 3) {
12708 buffer.writeUInt8(253, offset)
12709 buffer.writeUInt16LE(number, offset + 1)
12710
12711 // 32 bit
12712 } else if (size === 5) {
12713 buffer.writeUInt8(254, offset)
12714 buffer.writeUInt32LE(number, offset + 1)
12715
12716 // 64 bit
12717 } else {
12718 buffer.writeUInt8(255, offset)
12719 writeUInt64LE(buffer, number, offset + 1)
12720 }
12721
12722 return size
12723 }
12724
12725 module.exports = {
12726 pushDataSize: pushDataSize,
12727 readPushDataInt: readPushDataInt,
12728 readUInt64LE: readUInt64LE,
12729 readVarInt: readVarInt,
12730 varIntSize: varIntSize,
12731 writePushDataInt: writePushDataInt,
12732 writeUInt64LE: writeUInt64LE,
12733 writeVarInt: writeVarInt
12734 }
12735
12736 },{"./opcodes":82,"assert":4}],72:[function(_dereq_,module,exports){
12737 (function (Buffer){
12738 var assert = _dereq_('assert')
12739 var Crypto = _dereq_('crypto-js')
12740 var WordArray = Crypto.lib.WordArray
12741
12742 function bufferToWordArray(buffer) {
12743 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got', buffer)
12744
12745 var words = []
12746 for (var i = 0, b = 0; i < buffer.length; i++, b += 8) {
12747 words[b >>> 5] |= buffer[i] << (24 - b % 32)
12748 }
12749
12750 return new WordArray.init(words, buffer.length)
12751 }
12752
12753 function wordArrayToBuffer(wordArray) {
12754 assert(Array.isArray(wordArray.words), 'Expected WordArray, got' + wordArray)
12755
12756 var words = wordArray.words
12757 var buffer = new Buffer(words.length * 4)
12758
12759 words.forEach(function(value, i) {
12760 buffer.writeInt32BE(value & -1, i * 4)
12761 })
12762
12763 return buffer
12764 }
12765
12766 module.exports = {
12767 bufferToWordArray: bufferToWordArray,
12768 wordArrayToBuffer: wordArrayToBuffer
12769 }
12770
12771 }).call(this,_dereq_("buffer").Buffer)
12772 },{"assert":4,"buffer":8,"crypto-js":37}],73:[function(_dereq_,module,exports){
12773 (function (Buffer){
12774 // Crypto, crypto, where art thou crypto
12775 var assert = _dereq_('assert')
12776 var CryptoJS = _dereq_('crypto-js')
12777 var crypto = _dereq_('crypto')
12778 var convert = _dereq_('./convert')
12779
12780 function hash160(buffer) {
12781 return ripemd160(sha256(buffer))
12782 }
12783
12784 function hash256(buffer) {
12785 return sha256(sha256(buffer))
12786 }
12787
12788 function ripemd160(buffer) {
12789 return crypto.createHash('rmd160').update(buffer).digest()
12790 }
12791
12792 function sha1(buffer) {
12793 return crypto.createHash('sha1').update(buffer).digest()
12794 }
12795
12796 function sha256(buffer) {
12797 return crypto.createHash('sha256').update(buffer).digest()
12798 }
12799
12800 // FIXME: Name not consistent with others
12801 function HmacSHA256(buffer, secret) {
12802 return crypto.createHmac('sha256', secret).update(buffer).digest()
12803 }
12804
12805 function HmacSHA512(data, secret) {
12806 assert(Buffer.isBuffer(data), 'Expected Buffer for data, got ' + data)
12807 assert(Buffer.isBuffer(secret), 'Expected Buffer for secret, got ' + secret)
12808
12809 var dataWords = convert.bufferToWordArray(data)
12810 var secretWords = convert.bufferToWordArray(secret)
12811
12812 var hash = CryptoJS.HmacSHA512(dataWords, secretWords)
12813
12814 return convert.wordArrayToBuffer(hash)
12815 }
12816
12817 module.exports = {
12818 ripemd160: ripemd160,
12819 sha1: sha1,
12820 sha256: sha256,
12821 hash160: hash160,
12822 hash256: hash256,
12823 HmacSHA256: HmacSHA256,
12824 HmacSHA512: HmacSHA512
12825 }
12826
12827 }).call(this,_dereq_("buffer").Buffer)
12828 },{"./convert":72,"assert":4,"buffer":8,"crypto":19,"crypto-js":37}],74:[function(_dereq_,module,exports){
12829 (function (Buffer){
12830 var assert = _dereq_('assert')
12831 var crypto = _dereq_('./crypto')
12832
12833 var BigInteger = _dereq_('bigi')
12834 var ECSignature = _dereq_('./ecsignature')
12835 var Point = _dereq_('ecurve').Point
12836
12837 // https://tools.ietf.org/html/rfc6979#section-3.2
12838 function deterministicGenerateK(curve, hash, d) {
12839 assert(Buffer.isBuffer(hash), 'Hash must be a Buffer, not ' + hash)
12840 assert.equal(hash.length, 32, 'Hash must be 256 bit')
12841 assert(d instanceof BigInteger, 'Private key must be a BigInteger')
12842
12843 var x = d.toBuffer(32)
12844 var k = new Buffer(32)
12845 var v = new Buffer(32)
12846
12847 // Step B
12848 v.fill(1)
12849
12850 // Step C
12851 k.fill(0)
12852
12853 // Step D
12854 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0]), x, hash]), k)
12855
12856 // Step E
12857 v = crypto.HmacSHA256(v, k)
12858
12859 // Step F
12860 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([1]), x, hash]), k)
12861
12862 // Step G
12863 v = crypto.HmacSHA256(v, k)
12864
12865 // Step H1/H2a, ignored as tlen === qlen (256 bit)
12866 // Step H2b
12867 v = crypto.HmacSHA256(v, k)
12868
12869 var T = BigInteger.fromBuffer(v)
12870
12871 // Step H3, repeat until T is within the interval [1, n - 1]
12872 while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0)) {
12873 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0])]), k)
12874 v = crypto.HmacSHA256(v, k)
12875
12876 T = BigInteger.fromBuffer(v)
12877 }
12878
12879 return T
12880 }
12881
12882 function sign(curve, hash, d) {
12883 var k = deterministicGenerateK(curve, hash, d)
12884
12885 var n = curve.n
12886 var G = curve.G
12887 var Q = G.multiply(k)
12888 var e = BigInteger.fromBuffer(hash)
12889
12890 var r = Q.affineX.mod(n)
12891 assert.notEqual(r.signum(), 0, 'Invalid R value')
12892
12893 var s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
12894 assert.notEqual(s.signum(), 0, 'Invalid S value')
12895
12896 var N_OVER_TWO = n.shiftRight(1)
12897
12898 // enforce low S values, see bip62: 'low s values in signatures'
12899 if (s.compareTo(N_OVER_TWO) > 0) {
12900 s = n.subtract(s)
12901 }
12902
12903 return new ECSignature(r, s)
12904 }
12905
12906 function verify(curve, hash, signature, Q) {
12907 var e = BigInteger.fromBuffer(hash)
12908
12909 return verifyRaw(curve, e, signature, Q)
12910 }
12911
12912 function verifyRaw(curve, e, signature, Q) {
12913 var n = curve.n
12914 var G = curve.G
12915
12916 var r = signature.r
12917 var s = signature.s
12918
12919 if (r.signum() === 0 || r.compareTo(n) >= 0) return false
12920 if (s.signum() === 0 || s.compareTo(n) >= 0) return false
12921
12922 var c = s.modInverse(n)
12923
12924 var u1 = e.multiply(c).mod(n)
12925 var u2 = r.multiply(c).mod(n)
12926
12927 var point = G.multiplyTwo(u1, Q, u2)
12928 var v = point.affineX.mod(n)
12929
12930 return v.equals(r)
12931 }
12932
12933 /**
12934 * Recover a public key from a signature.
12935 *
12936 * See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public
12937 * Key Recovery Operation".
12938 *
12939 * http://www.secg.org/download/aid-780/sec1-v2.pdf
12940 */
12941 function recoverPubKey(curve, e, signature, i) {
12942 assert.strictEqual(i & 3, i, 'Recovery param is more than two bits')
12943
12944 var r = signature.r
12945 var s = signature.s
12946
12947 // A set LSB signifies that the y-coordinate is odd
12948 var isYOdd = i & 1
12949
12950 // The more significant bit specifies whether we should use the
12951 // first or second candidate key.
12952 var isSecondKey = i >> 1
12953
12954 var n = curve.n
12955 var G = curve.G
12956
12957 // 1.1 Let x = r + jn
12958 var x = isSecondKey ? r.add(n) : r
12959 var R = curve.pointFromX(isYOdd, x)
12960
12961 // 1.4 Check that nR is at infinity
12962 var nR = R.multiply(n)
12963 assert(curve.isInfinity(nR), 'nR is not a valid curve point')
12964
12965 // Compute -e from e
12966 var eNeg = e.negate().mod(n)
12967
12968 // 1.6.1 Compute Q = r^-1 (sR - eG)
12969 // Q = r^-1 (sR + -eG)
12970 var rInv = r.modInverse(n)
12971
12972 var Q = R.multiplyTwo(s, G, eNeg).multiply(rInv)
12973 curve.validate(Q)
12974
12975 return Q
12976 }
12977
12978 /**
12979 * Calculate pubkey extraction parameter.
12980 *
12981 * When extracting a pubkey from a signature, we have to
12982 * distinguish four different cases. Rather than putting this
12983 * burden on the verifier, Bitcoin includes a 2-bit value with the
12984 * signature.
12985 *
12986 * This function simply tries all four cases and returns the value
12987 * that resulted in a successful pubkey recovery.
12988 */
12989 function calcPubKeyRecoveryParam(curve, e, signature, Q) {
12990 for (var i = 0; i < 4; i++) {
12991 var Qprime = recoverPubKey(curve, e, signature, i)
12992
12993 // 1.6.2 Verify Q
12994 if (Qprime.equals(Q)) {
12995 return i
12996 }
12997 }
12998
12999 throw new Error('Unable to find valid recovery factor')
13000 }
13001
13002 module.exports = {
13003 calcPubKeyRecoveryParam: calcPubKeyRecoveryParam,
13004 deterministicGenerateK: deterministicGenerateK,
13005 recoverPubKey: recoverPubKey,
13006 sign: sign,
13007 verify: verify,
13008 verifyRaw: verifyRaw
13009 }
13010
13011 }).call(this,_dereq_("buffer").Buffer)
13012 },{"./crypto":73,"./ecsignature":77,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],75:[function(_dereq_,module,exports){
13013 (function (Buffer){
13014 var assert = _dereq_('assert')
13015 var base58check = _dereq_('./base58check')
13016 var ecdsa = _dereq_('./ecdsa')
13017 var networks = _dereq_('./networks')
13018 var secureRandom = _dereq_('secure-random')
13019
13020 var BigInteger = _dereq_('bigi')
13021 var ECPubKey = _dereq_('./ecpubkey')
13022
13023 var ecurve = _dereq_('ecurve')
13024 var curve = ecurve.getCurveByName('secp256k1')
13025
13026 function ECKey(d, compressed) {
13027 assert(d.signum() > 0, 'Private key must be greater than 0')
13028 assert(d.compareTo(curve.n) < 0, 'Private key must be less than the curve order')
13029
13030 var Q = curve.G.multiply(d)
13031
13032 this.d = d
13033 this.pub = new ECPubKey(Q, compressed)
13034 }
13035
13036 // Static constructors
13037 ECKey.fromWIF = function(string) {
13038 var payload = base58check.decode(string)
13039 var compressed = false
13040
13041 // Ignore the version byte
13042 payload = payload.slice(1)
13043
13044 if (payload.length === 33) {
13045 assert.strictEqual(payload[32], 0x01, 'Invalid compression flag')
13046
13047 // Truncate the compression flag
13048 payload = payload.slice(0, -1)
13049 compressed = true
13050 }
13051
13052 assert.equal(payload.length, 32, 'Invalid WIF payload length')
13053
13054 var d = BigInteger.fromBuffer(payload)
13055 return new ECKey(d, compressed)
13056 }
13057
13058 ECKey.makeRandom = function(compressed, rng) {
13059 rng = rng || secureRandom.randomBuffer
13060
13061 var buffer = rng(32)
13062 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
13063
13064 var d = BigInteger.fromBuffer(buffer)
13065 d = d.mod(curve.n)
13066
13067 return new ECKey(d, compressed)
13068 }
13069
13070 // Export functions
13071 ECKey.prototype.toWIF = function(network) {
13072 network = network || networks.bitcoin
13073
13074 var bufferLen = this.pub.compressed ? 34 : 33
13075 var buffer = new Buffer(bufferLen)
13076
13077 buffer.writeUInt8(network.wif, 0)
13078 this.d.toBuffer(32).copy(buffer, 1)
13079
13080 if (this.pub.compressed) {
13081 buffer.writeUInt8(0x01, 33)
13082 }
13083
13084 return base58check.encode(buffer)
13085 }
13086
13087 // Operations
13088 ECKey.prototype.sign = function(hash) {
13089 return ecdsa.sign(curve, hash, this.d)
13090 }
13091
13092 module.exports = ECKey
13093
13094 }).call(this,_dereq_("buffer").Buffer)
13095 },{"./base58check":70,"./ecdsa":74,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65,"secure-random":68}],76:[function(_dereq_,module,exports){
13096 (function (Buffer){
13097 var assert = _dereq_('assert')
13098 var crypto = _dereq_('./crypto')
13099 var ecdsa = _dereq_('./ecdsa')
13100 var networks = _dereq_('./networks')
13101
13102 var Address = _dereq_('./address')
13103
13104 var ecurve = _dereq_('ecurve')
13105 var curve = ecurve.getCurveByName('secp256k1')
13106
13107 function ECPubKey(Q, compressed) {
13108 assert(Q instanceof ecurve.Point, 'Expected Point, got ' + Q)
13109
13110 if (compressed == undefined) compressed = true
13111 assert.strictEqual(typeof compressed, 'boolean', 'Expected boolean, got ' + compressed)
13112
13113 this.compressed = compressed
13114 this.Q = Q
13115 }
13116
13117 // Static constructors
13118 ECPubKey.fromBuffer = function(buffer) {
13119 var Q = ecurve.Point.decodeFrom(curve, buffer)
13120 return new ECPubKey(Q, Q.compressed)
13121 }
13122
13123 ECPubKey.fromHex = function(hex) {
13124 return ECPubKey.fromBuffer(new Buffer(hex, 'hex'))
13125 }
13126
13127 // Operations
13128 ECPubKey.prototype.getAddress = function(network) {
13129 network = network || networks.bitcoin
13130
13131 return new Address(crypto.hash160(this.toBuffer()), network.pubKeyHash)
13132 }
13133
13134 ECPubKey.prototype.verify = function(hash, signature) {
13135 return ecdsa.verify(curve, hash, signature, this.Q)
13136 }
13137
13138 // Export functions
13139 ECPubKey.prototype.toBuffer = function() {
13140 return this.Q.getEncoded(this.compressed)
13141 }
13142
13143 ECPubKey.prototype.toHex = function() {
13144 return this.toBuffer().toString('hex')
13145 }
13146
13147 module.exports = ECPubKey
13148
13149 }).call(this,_dereq_("buffer").Buffer)
13150 },{"./address":69,"./crypto":73,"./ecdsa":74,"./networks":81,"assert":4,"buffer":8,"ecurve":65}],77:[function(_dereq_,module,exports){
13151 (function (Buffer){
13152 var assert = _dereq_('assert')
13153 var BigInteger = _dereq_('bigi')
13154
13155 function ECSignature(r, s) {
13156 assert(r instanceof BigInteger, 'Expected BigInteger, got ' + r)
13157 assert(s instanceof BigInteger, 'Expected BigInteger, got ' + s)
13158 this.r = r
13159 this.s = s
13160 }
13161
13162 // Import operations
13163 ECSignature.parseCompact = function(buffer) {
13164 assert.equal(buffer.length, 65, 'Invalid signature length')
13165 var i = buffer.readUInt8(0) - 27
13166
13167 // At most 3 bits
13168 assert.equal(i, i & 7, 'Invalid signature parameter')
13169 var compressed = !!(i & 4)
13170
13171 // Recovery param only
13172 i = i & 3
13173
13174 var r = BigInteger.fromBuffer(buffer.slice(1, 33))
13175 var s = BigInteger.fromBuffer(buffer.slice(33))
13176
13177 return {
13178 compressed: compressed,
13179 i: i,
13180 signature: new ECSignature(r, s)
13181 }
13182 }
13183
13184 ECSignature.fromDER = function(buffer) {
13185 assert.equal(buffer.readUInt8(0), 0x30, 'Not a DER sequence')
13186 assert.equal(buffer.readUInt8(1), buffer.length - 2, 'Invalid sequence length')
13187 assert.equal(buffer.readUInt8(2), 0x02, 'Expected a DER integer')
13188
13189 var rLen = buffer.readUInt8(3)
13190 assert(rLen > 0, 'R length is zero')
13191
13192 var offset = 4 + rLen
13193 assert.equal(buffer.readUInt8(offset), 0x02, 'Expected a DER integer (2)')
13194
13195 var sLen = buffer.readUInt8(offset + 1)
13196 assert(sLen > 0, 'S length is zero')
13197
13198 var rB = buffer.slice(4, offset)
13199 var sB = buffer.slice(offset + 2)
13200 offset += 2 + sLen
13201
13202 if (rLen > 1 && rB.readUInt8(0) === 0x00) {
13203 assert(rB.readUInt8(1) & 0x80, 'R value excessively padded')
13204 }
13205
13206 if (sLen > 1 && sB.readUInt8(0) === 0x00) {
13207 assert(sB.readUInt8(1) & 0x80, 'S value excessively padded')
13208 }
13209
13210 assert.equal(offset, buffer.length, 'Invalid DER encoding')
13211 var r = BigInteger.fromDERInteger(rB)
13212 var s = BigInteger.fromDERInteger(sB)
13213
13214 assert(r.signum() >= 0, 'R value is negative')
13215 assert(s.signum() >= 0, 'S value is negative')
13216
13217 return new ECSignature(r, s)
13218 }
13219
13220 // FIXME: 0x00, 0x04, 0x80 are SIGHASH_* boundary constants, importing Transaction causes a circular dependency
13221 ECSignature.parseScriptSignature = function(buffer) {
13222 var hashType = buffer.readUInt8(buffer.length - 1)
13223 var hashTypeMod = hashType & ~0x80
13224
13225 assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType')
13226
13227 return {
13228 signature: ECSignature.fromDER(buffer.slice(0, -1)),
13229 hashType: hashType
13230 }
13231 }
13232
13233 // Export operations
13234 ECSignature.prototype.toCompact = function(i, compressed) {
13235 if (compressed) i += 4
13236 i += 27
13237
13238 var buffer = new Buffer(65)
13239 buffer.writeUInt8(i, 0)
13240
13241 this.r.toBuffer(32).copy(buffer, 1)
13242 this.s.toBuffer(32).copy(buffer, 33)
13243
13244 return buffer
13245 }
13246
13247 ECSignature.prototype.toDER = function() {
13248 var rBa = this.r.toDERInteger()
13249 var sBa = this.s.toDERInteger()
13250
13251 var sequence = []
13252 sequence.push(0x02) // INTEGER
13253 sequence.push(rBa.length)
13254 sequence = sequence.concat(rBa)
13255
13256 sequence.push(0x02) // INTEGER
13257 sequence.push(sBa.length)
13258 sequence = sequence.concat(sBa)
13259
13260 sequence.unshift(sequence.length)
13261 sequence.unshift(0x30) // SEQUENCE
13262
13263 return new Buffer(sequence)
13264 }
13265
13266 ECSignature.prototype.toScriptSignature = function(hashType) {
13267 var hashTypeBuffer = new Buffer(1)
13268 hashTypeBuffer.writeUInt8(hashType, 0)
13269
13270 return Buffer.concat([this.toDER(), hashTypeBuffer])
13271 }
13272
13273 module.exports = ECSignature
13274
13275 }).call(this,_dereq_("buffer").Buffer)
13276 },{"assert":4,"bigi":3,"buffer":8}],78:[function(_dereq_,module,exports){
13277 (function (Buffer){
13278 var assert = _dereq_('assert')
13279 var base58check = _dereq_('./base58check')
13280 var crypto = _dereq_('./crypto')
13281 var networks = _dereq_('./networks')
13282
13283 var BigInteger = _dereq_('bigi')
13284 var ECKey = _dereq_('./eckey')
13285 var ECPubKey = _dereq_('./ecpubkey')
13286
13287 var ecurve = _dereq_('ecurve')
13288 var curve = ecurve.getCurveByName('secp256k1')
13289
13290 function findBIP32ParamsByVersion(version) {
13291 for (var name in networks) {
13292 var network = networks[name]
13293
13294 for (var type in network.bip32) {
13295 if (version != network.bip32[type]) continue
13296
13297 return {
13298 isPrivate: (type === 'private'),
13299 network: network
13300 }
13301 }
13302 }
13303
13304 assert(false, 'Could not find version ' + version.toString(16))
13305 }
13306
13307 function HDNode(K, chainCode, network) {
13308 network = network || networks.bitcoin
13309
13310 assert(Buffer.isBuffer(chainCode), 'Expected Buffer, got ' + chainCode)
13311 assert(network.bip32, 'Unknown BIP32 constants for network')
13312
13313 this.chainCode = chainCode
13314 this.depth = 0
13315 this.index = 0
13316 this.network = network
13317
13318 if (K instanceof BigInteger) {
13319 this.privKey = new ECKey(K, true)
13320 this.pubKey = this.privKey.pub
13321 } else {
13322 this.pubKey = new ECPubKey(K, true)
13323 }
13324 }
13325
13326 HDNode.MASTER_SECRET = new Buffer('Bitcoin seed')
13327 HDNode.HIGHEST_BIT = 0x80000000
13328 HDNode.LENGTH = 78
13329
13330 HDNode.fromSeedBuffer = function(seed, network) {
13331 var I = crypto.HmacSHA512(seed, HDNode.MASTER_SECRET)
13332 var IL = I.slice(0, 32)
13333 var IR = I.slice(32)
13334
13335 // In case IL is 0 or >= n, the master key is invalid
13336 // This is handled by `new ECKey` in the HDNode constructor
13337 var pIL = BigInteger.fromBuffer(IL)
13338
13339 return new HDNode(pIL, IR, network)
13340 }
13341
13342 HDNode.fromSeedHex = function(hex, network) {
13343 return HDNode.fromSeedBuffer(new Buffer(hex, 'hex'), network)
13344 }
13345
13346 HDNode.fromBase58 = function(string) {
13347 return HDNode.fromBuffer(base58check.decode(string))
13348 }
13349
13350 HDNode.fromBuffer = function(buffer) {
13351 assert.strictEqual(buffer.length, HDNode.LENGTH, 'Invalid buffer length')
13352
13353 // 4 byte: version bytes
13354 var version = buffer.readUInt32BE(0)
13355 var params = findBIP32ParamsByVersion(version)
13356
13357 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
13358 var depth = buffer.readUInt8(4)
13359
13360 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13361 var parentFingerprint = buffer.readUInt32BE(5)
13362 if (depth === 0) {
13363 assert.strictEqual(parentFingerprint, 0x00000000, 'Invalid parent fingerprint')
13364 }
13365
13366 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13367 // This is encoded in MSB order. (0x00000000 if master key)
13368 var index = buffer.readUInt32BE(9)
13369 assert(depth > 0 || index === 0, 'Invalid index')
13370
13371 // 32 bytes: the chain code
13372 var chainCode = buffer.slice(13, 45)
13373 var hd
13374
13375 // 33 bytes: private key data (0x00 + k)
13376 if (params.isPrivate) {
13377 assert.strictEqual(buffer.readUInt8(45), 0x00, 'Invalid private key')
13378 var data = buffer.slice(46, 78)
13379 var d = BigInteger.fromBuffer(data)
13380 hd = new HDNode(d, chainCode, params.network)
13381
13382 // 33 bytes: public key data (0x02 + X or 0x03 + X)
13383 } else {
13384 var data = buffer.slice(45, 78)
13385 var Q = ecurve.Point.decodeFrom(curve, data)
13386 assert.equal(Q.compressed, true, 'Invalid public key')
13387
13388 // Verify that the X coordinate in the public point corresponds to a point on the curve.
13389 // If not, the extended public key is invalid.
13390 curve.validate(Q)
13391
13392 hd = new HDNode(Q, chainCode, params.network)
13393 }
13394
13395 hd.depth = depth
13396 hd.index = index
13397 hd.parentFingerprint = parentFingerprint
13398
13399 return hd
13400 }
13401
13402 HDNode.fromHex = function(hex) {
13403 return HDNode.fromBuffer(new Buffer(hex, 'hex'))
13404 }
13405
13406 HDNode.prototype.getIdentifier = function() {
13407 return crypto.hash160(this.pubKey.toBuffer())
13408 }
13409
13410 HDNode.prototype.getFingerprint = function() {
13411 return this.getIdentifier().slice(0, 4)
13412 }
13413
13414 HDNode.prototype.getAddress = function() {
13415 return this.pubKey.getAddress(this.network)
13416 }
13417
13418 HDNode.prototype.toBase58 = function(isPrivate) {
13419 return base58check.encode(this.toBuffer(isPrivate))
13420 }
13421
13422 HDNode.prototype.toBuffer = function(isPrivate) {
13423 if (isPrivate == undefined) isPrivate = !!this.privKey
13424
13425 // Version
13426 var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
13427 var buffer = new Buffer(HDNode.LENGTH)
13428
13429 // 4 bytes: version bytes
13430 buffer.writeUInt32BE(version, 0)
13431
13432 // Depth
13433 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
13434 buffer.writeUInt8(this.depth, 4)
13435
13436 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13437 var fingerprint = (this.depth === 0) ? 0x00000000 : this.parentFingerprint
13438 buffer.writeUInt32BE(fingerprint, 5)
13439
13440 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13441 // This is encoded in Big endian. (0x00000000 if master key)
13442 buffer.writeUInt32BE(this.index, 9)
13443
13444 // 32 bytes: the chain code
13445 this.chainCode.copy(buffer, 13)
13446
13447 // 33 bytes: the public key or private key data
13448 if (isPrivate) {
13449 assert(this.privKey, 'Missing private key')
13450
13451 // 0x00 + k for private keys
13452 buffer.writeUInt8(0, 45)
13453 this.privKey.d.toBuffer(32).copy(buffer, 46)
13454 } else {
13455
13456 // X9.62 encoding for public keys
13457 this.pubKey.toBuffer().copy(buffer, 45)
13458 }
13459
13460 return buffer
13461 }
13462
13463 HDNode.prototype.toHex = function(isPrivate) {
13464 return this.toBuffer(isPrivate).toString('hex')
13465 }
13466
13467 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
13468 HDNode.prototype.derive = function(index) {
13469 var isHardened = index >= HDNode.HIGHEST_BIT
13470 var indexBuffer = new Buffer(4)
13471 indexBuffer.writeUInt32BE(index, 0)
13472
13473 var data
13474
13475 // Hardened child
13476 if (isHardened) {
13477 assert(this.privKey, 'Could not derive hardened child key')
13478
13479 // data = 0x00 || ser256(kpar) || ser32(index)
13480 data = Buffer.concat([
13481 this.privKey.d.toBuffer(33),
13482 indexBuffer
13483 ])
13484
13485 // Normal child
13486 } else {
13487 // data = serP(point(kpar)) || ser32(index)
13488 // = serP(Kpar) || ser32(index)
13489 data = Buffer.concat([
13490 this.pubKey.toBuffer(),
13491 indexBuffer
13492 ])
13493 }
13494
13495 var I = crypto.HmacSHA512(data, this.chainCode)
13496 var IL = I.slice(0, 32)
13497 var IR = I.slice(32)
13498
13499 var pIL = BigInteger.fromBuffer(IL)
13500
13501 // In case parse256(IL) >= n, proceed with the next value for i
13502 if (pIL.compareTo(curve.n) >= 0) {
13503 return this.derive(index + 1)
13504 }
13505
13506 // Private parent key -> private child key
13507 var hd
13508 if (this.privKey) {
13509 // ki = parse256(IL) + kpar (mod n)
13510 var ki = pIL.add(this.privKey.d).mod(curve.n)
13511
13512 // In case ki == 0, proceed with the next value for i
13513 if (ki.signum() === 0) {
13514 return this.derive(index + 1)
13515 }
13516
13517 hd = new HDNode(ki, IR, this.network)
13518
13519 // Public parent key -> public child key
13520 } else {
13521 // Ki = point(parse256(IL)) + Kpar
13522 // = G*IL + Kpar
13523 var Ki = curve.G.multiply(pIL).add(this.pubKey.Q)
13524
13525 // In case Ki is the point at infinity, proceed with the next value for i
13526 if (curve.isInfinity(Ki)) {
13527 return this.derive(index + 1)
13528 }
13529
13530 hd = new HDNode(Ki, IR, this.network)
13531 }
13532
13533 hd.depth = this.depth + 1
13534 hd.index = index
13535 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
13536
13537 return hd
13538 }
13539
13540 HDNode.prototype.deriveHardened = function(index) {
13541 // Only derives hardened private keys by default
13542 return this.derive(index + HDNode.HIGHEST_BIT)
13543 }
13544
13545 HDNode.prototype.toString = HDNode.prototype.toBase58
13546
13547 module.exports = HDNode
13548
13549 }).call(this,_dereq_("buffer").Buffer)
13550 },{"./base58check":70,"./crypto":73,"./eckey":75,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],79:[function(_dereq_,module,exports){
13551 module.exports = {
13552 Address: _dereq_('./address'),
13553 base58check: _dereq_('./base58check'),
13554 bufferutils: _dereq_('./bufferutils'),
13555 convert: _dereq_('./convert'),
13556 crypto: _dereq_('./crypto'),
13557 ecdsa: _dereq_('./ecdsa'),
13558 ECKey: _dereq_('./eckey'),
13559 ECPubKey: _dereq_('./ecpubkey'),
13560 ECSignature: _dereq_('./ecsignature'),
13561 Message: _dereq_('./message'),
13562 opcodes: _dereq_('./opcodes'),
13563 HDNode: _dereq_('./hdnode'),
13564 Script: _dereq_('./script'),
13565 scripts: _dereq_('./scripts'),
13566 Transaction: _dereq_('./transaction'),
13567 networks: _dereq_('./networks'),
13568 Wallet: _dereq_('./wallet')
13569 }
13570
13571 },{"./address":69,"./base58check":70,"./bufferutils":71,"./convert":72,"./crypto":73,"./ecdsa":74,"./eckey":75,"./ecpubkey":76,"./ecsignature":77,"./hdnode":78,"./message":80,"./networks":81,"./opcodes":82,"./script":83,"./scripts":84,"./transaction":85,"./wallet":86}],80:[function(_dereq_,module,exports){
13572 (function (Buffer){
13573 /// Implements Bitcoin's feature for signing arbitrary messages.
13574 var Address = _dereq_('./address')
13575 var BigInteger = _dereq_('bigi')
13576 var bufferutils = _dereq_('./bufferutils')
13577 var crypto = _dereq_('./crypto')
13578 var ecdsa = _dereq_('./ecdsa')
13579 var networks = _dereq_('./networks')
13580
13581 var Address = _dereq_('./address')
13582 var ECPubKey = _dereq_('./ecpubkey')
13583 var ECSignature = _dereq_('./ecsignature')
13584
13585 var ecurve = _dereq_('ecurve')
13586 var ecparams = ecurve.getCurveByName('secp256k1')
13587
13588 function magicHash(message, network) {
13589 var magicPrefix = new Buffer(network.magicPrefix)
13590 var messageBuffer = new Buffer(message)
13591 var lengthBuffer = new Buffer(bufferutils.varIntSize(messageBuffer.length))
13592 bufferutils.writeVarInt(lengthBuffer, messageBuffer.length, 0)
13593
13594 var buffer = Buffer.concat([magicPrefix, lengthBuffer, messageBuffer])
13595 return crypto.hash256(buffer)
13596 }
13597
13598 function sign(privKey, message, network) {
13599 network = network || networks.bitcoin
13600
13601 var hash = magicHash(message, network)
13602 var signature = privKey.sign(hash)
13603 var e = BigInteger.fromBuffer(hash)
13604 var i = ecdsa.calcPubKeyRecoveryParam(ecparams, e, signature, privKey.pub.Q)
13605
13606 return signature.toCompact(i, privKey.pub.compressed)
13607 }
13608
13609 // TODO: network could be implied from address
13610 function verify(address, signatureBuffer, message, network) {
13611 if (address instanceof Address) {
13612 address = address.toString()
13613 }
13614 network = network || networks.bitcoin
13615
13616 var hash = magicHash(message, network)
13617 var parsed = ECSignature.parseCompact(signatureBuffer)
13618 var e = BigInteger.fromBuffer(hash)
13619 var Q = ecdsa.recoverPubKey(ecparams, e, parsed.signature, parsed.i)
13620
13621 var pubKey = new ECPubKey(Q, parsed.compressed)
13622 return pubKey.getAddress(network).toString() === address
13623 }
13624
13625 module.exports = {
13626 magicHash: magicHash,
13627 sign: sign,
13628 verify: verify
13629 }
13630
13631 }).call(this,_dereq_("buffer").Buffer)
13632 },{"./address":69,"./bufferutils":71,"./crypto":73,"./ecdsa":74,"./ecpubkey":76,"./ecsignature":77,"./networks":81,"bigi":3,"buffer":8,"ecurve":65}],81:[function(_dereq_,module,exports){
13633 // https://en.bitcoin.it/wiki/List_of_address_prefixes
13634 // Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
13635
13636 var networks = {
13637 bitcoin: {
13638 magicPrefix: '\x18Bitcoin Signed Message:\n',
13639 bip32: {
13640 public: 0x0488b21e,
13641 private: 0x0488ade4
13642 },
13643 pubKeyHash: 0x00,
13644 scriptHash: 0x05,
13645 wif: 0x80,
13646 dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
13647 feePerKb: 10000, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/main.cpp#L53
13648 estimateFee: estimateFee('bitcoin')
13649 },
13650 dogecoin: {
13651 magicPrefix: '\x19Dogecoin Signed Message:\n',
13652 bip32: {
13653 public: 0x02facafd,
13654 private: 0x02fac398
13655 },
13656 pubKeyHash: 0x1e,
13657 scriptHash: 0x16,
13658 wif: 0x9e,
13659 dustThreshold: 0, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/core.h#L155-L160
13660 dustSoftThreshold: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.h#L62
13661 feePerKb: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.cpp#L58
13662 estimateFee: estimateFee('dogecoin')
13663 },
13664 litecoin: {
13665 magicPrefix: '\x19Litecoin Signed Message:\n',
13666 bip32: {
13667 public: 0x019da462,
13668 private: 0x019d9cfe
13669 },
13670 pubKeyHash: 0x30,
13671 scriptHash: 0x05,
13672 wif: 0xb0,
13673 dustThreshold: 0, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L360-L365
13674 dustSoftThreshold: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.h#L53
13675 feePerKb: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L56
13676 estimateFee: estimateFee('litecoin')
13677 },
13678 testnet: {
13679 magicPrefix: '\x18Bitcoin Signed Message:\n',
13680 bip32: {
13681 public: 0x043587cf,
13682 private: 0x04358394
13683 },
13684 pubKeyHash: 0x6f,
13685 scriptHash: 0xc4,
13686 wif: 0xef,
13687 dustThreshold: 546,
13688 feePerKb: 10000,
13689 estimateFee: estimateFee('testnet')
13690 }
13691 }
13692
13693 function estimateFee(type) {
13694 return function(tx) {
13695 var network = networks[type]
13696 var baseFee = network.feePerKb
13697 var byteSize = tx.toBuffer().length
13698
13699 var fee = baseFee * Math.ceil(byteSize / 1000)
13700 if (network.dustSoftThreshold == undefined) return fee
13701
13702 tx.outs.forEach(function(e){
13703 if (e.value < network.dustSoftThreshold) {
13704 fee += baseFee
13705 }
13706 })
13707
13708 return fee
13709 }
13710 }
13711
13712 module.exports = networks
13713
13714 },{}],82:[function(_dereq_,module,exports){
13715 module.exports = {
13716 // push value
13717 OP_FALSE : 0,
13718 OP_0 : 0,
13719 OP_PUSHDATA1 : 76,
13720 OP_PUSHDATA2 : 77,
13721 OP_PUSHDATA4 : 78,
13722 OP_1NEGATE : 79,
13723 OP_RESERVED : 80,
13724 OP_1 : 81,
13725 OP_TRUE : 81,
13726 OP_2 : 82,
13727 OP_3 : 83,
13728 OP_4 : 84,
13729 OP_5 : 85,
13730 OP_6 : 86,
13731 OP_7 : 87,
13732 OP_8 : 88,
13733 OP_9 : 89,
13734 OP_10 : 90,
13735 OP_11 : 91,
13736 OP_12 : 92,
13737 OP_13 : 93,
13738 OP_14 : 94,
13739 OP_15 : 95,
13740 OP_16 : 96,
13741
13742 // control
13743 OP_NOP : 97,
13744 OP_VER : 98,
13745 OP_IF : 99,
13746 OP_NOTIF : 100,
13747 OP_VERIF : 101,
13748 OP_VERNOTIF : 102,
13749 OP_ELSE : 103,
13750 OP_ENDIF : 104,
13751 OP_VERIFY : 105,
13752 OP_RETURN : 106,
13753
13754 // stack ops
13755 OP_TOALTSTACK : 107,
13756 OP_FROMALTSTACK : 108,
13757 OP_2DROP : 109,
13758 OP_2DUP : 110,
13759 OP_3DUP : 111,
13760 OP_2OVER : 112,
13761 OP_2ROT : 113,
13762 OP_2SWAP : 114,
13763 OP_IFDUP : 115,
13764 OP_DEPTH : 116,
13765 OP_DROP : 117,
13766 OP_DUP : 118,
13767 OP_NIP : 119,
13768 OP_OVER : 120,
13769 OP_PICK : 121,
13770 OP_ROLL : 122,
13771 OP_ROT : 123,
13772 OP_SWAP : 124,
13773 OP_TUCK : 125,
13774
13775 // splice ops
13776 OP_CAT : 126,
13777 OP_SUBSTR : 127,
13778 OP_LEFT : 128,
13779 OP_RIGHT : 129,
13780 OP_SIZE : 130,
13781
13782 // bit logic
13783 OP_INVERT : 131,
13784 OP_AND : 132,
13785 OP_OR : 133,
13786 OP_XOR : 134,
13787 OP_EQUAL : 135,
13788 OP_EQUALVERIFY : 136,
13789 OP_RESERVED1 : 137,
13790 OP_RESERVED2 : 138,
13791
13792 // numeric
13793 OP_1ADD : 139,
13794 OP_1SUB : 140,
13795 OP_2MUL : 141,
13796 OP_2DIV : 142,
13797 OP_NEGATE : 143,
13798 OP_ABS : 144,
13799 OP_NOT : 145,
13800 OP_0NOTEQUAL : 146,
13801
13802 OP_ADD : 147,
13803 OP_SUB : 148,
13804 OP_MUL : 149,
13805 OP_DIV : 150,
13806 OP_MOD : 151,
13807 OP_LSHIFT : 152,
13808 OP_RSHIFT : 153,
13809
13810 OP_BOOLAND : 154,
13811 OP_BOOLOR : 155,
13812 OP_NUMEQUAL : 156,
13813 OP_NUMEQUALVERIFY : 157,
13814 OP_NUMNOTEQUAL : 158,
13815 OP_LESSTHAN : 159,
13816 OP_GREATERTHAN : 160,
13817 OP_LESSTHANOREQUAL : 161,
13818 OP_GREATERTHANOREQUAL : 162,
13819 OP_MIN : 163,
13820 OP_MAX : 164,
13821
13822 OP_WITHIN : 165,
13823
13824 // crypto
13825 OP_RIPEMD160 : 166,
13826 OP_SHA1 : 167,
13827 OP_SHA256 : 168,
13828 OP_HASH160 : 169,
13829 OP_HASH256 : 170,
13830 OP_CODESEPARATOR : 171,
13831 OP_CHECKSIG : 172,
13832 OP_CHECKSIGVERIFY : 173,
13833 OP_CHECKMULTISIG : 174,
13834 OP_CHECKMULTISIGVERIFY : 175,
13835
13836 // expansion
13837 OP_NOP1 : 176,
13838 OP_NOP2 : 177,
13839 OP_NOP3 : 178,
13840 OP_NOP4 : 179,
13841 OP_NOP5 : 180,
13842 OP_NOP6 : 181,
13843 OP_NOP7 : 182,
13844 OP_NOP8 : 183,
13845 OP_NOP9 : 184,
13846 OP_NOP10 : 185,
13847
13848 // template matching params
13849 OP_PUBKEYHASH : 253,
13850 OP_PUBKEY : 254,
13851 OP_INVALIDOPCODE : 255
13852 }
13853
13854 },{}],83:[function(_dereq_,module,exports){
13855 (function (Buffer){
13856 var assert = _dereq_('assert')
13857 var bufferutils = _dereq_('./bufferutils')
13858 var crypto = _dereq_('./crypto')
13859 var opcodes = _dereq_('./opcodes')
13860
13861 function Script(buffer, chunks) {
13862 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
13863 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13864
13865 this.buffer = buffer
13866 this.chunks = chunks
13867 }
13868
13869 // Import operations
13870 Script.fromASM = function(asm) {
13871 var strChunks = asm.split(' ')
13872
13873 var chunks = strChunks.map(function(strChunk) {
13874 if (strChunk in opcodes) {
13875 return opcodes[strChunk]
13876
13877 } else {
13878 return new Buffer(strChunk, 'hex')
13879 }
13880 })
13881
13882 return Script.fromChunks(chunks)
13883 }
13884
13885 Script.fromBuffer = function(buffer) {
13886 var chunks = []
13887
13888 var i = 0
13889
13890 while (i < buffer.length) {
13891 var opcode = buffer.readUInt8(i)
13892
13893 if ((opcode > opcodes.OP_0) && (opcode <= opcodes.OP_PUSHDATA4)) {
13894 var d = bufferutils.readPushDataInt(buffer, i)
13895 i += d.size
13896
13897 var data = buffer.slice(i, i + d.number)
13898 i += d.number
13899
13900 chunks.push(data)
13901
13902 } else {
13903 chunks.push(opcode)
13904
13905 i += 1
13906 }
13907 }
13908
13909 return new Script(buffer, chunks)
13910 }
13911
13912 Script.fromChunks = function(chunks) {
13913 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13914
13915 var bufferSize = chunks.reduce(function(accum, chunk) {
13916 if (Buffer.isBuffer(chunk)) {
13917 return accum + bufferutils.pushDataSize(chunk.length) + chunk.length
13918 }
13919
13920 return accum + 1
13921 }, 0.0)
13922
13923 var buffer = new Buffer(bufferSize)
13924 var offset = 0
13925
13926 chunks.forEach(function(chunk) {
13927 if (Buffer.isBuffer(chunk)) {
13928 offset += bufferutils.writePushDataInt(buffer, chunk.length, offset)
13929
13930 chunk.copy(buffer, offset)
13931 offset += chunk.length
13932
13933 } else {
13934 buffer.writeUInt8(chunk, offset)
13935 offset += 1
13936 }
13937 })
13938
13939 assert.equal(offset, buffer.length, 'Could not decode chunks')
13940 return new Script(buffer, chunks)
13941 }
13942
13943 Script.fromHex = function(hex) {
13944 return Script.fromBuffer(new Buffer(hex, 'hex'))
13945 }
13946
13947 // Constants
13948 Script.EMPTY = Script.fromChunks([])
13949
13950 // Operations
13951 Script.prototype.getHash = function() {
13952 return crypto.hash160(this.buffer)
13953 }
13954
13955 // FIXME: doesn't work for data chunks, maybe time to use buffertools.compare...
13956 Script.prototype.without = function(needle) {
13957 return Script.fromChunks(this.chunks.filter(function(op) {
13958 return op !== needle
13959 }))
13960 }
13961
13962 // Export operations
13963 var reverseOps = []
13964 for (var op in opcodes) {
13965 var code = opcodes[op]
13966 reverseOps[code] = op
13967 }
13968
13969 Script.prototype.toASM = function() {
13970 return this.chunks.map(function(chunk) {
13971 if (Buffer.isBuffer(chunk)) {
13972 return chunk.toString('hex')
13973
13974 } else {
13975 return reverseOps[chunk]
13976 }
13977 }).join(' ')
13978 }
13979
13980 Script.prototype.toBuffer = function() {
13981 return this.buffer
13982 }
13983
13984 Script.prototype.toHex = function() {
13985 return this.toBuffer().toString('hex')
13986 }
13987
13988 module.exports = Script
13989
13990 }).call(this,_dereq_("buffer").Buffer)
13991 },{"./bufferutils":71,"./crypto":73,"./opcodes":82,"assert":4,"buffer":8}],84:[function(_dereq_,module,exports){
13992 (function (Buffer){
13993 var assert = _dereq_('assert')
13994 var opcodes = _dereq_('./opcodes')
13995
13996 // FIXME: use ECPubKey, currently the circular dependency breaks everything.
13997 //
13998 // Solutions:
13999 // * Remove ECPubKey.getAddress
14000 // - Minimal change, but likely unpopular
14001 // * Move all script related functionality out of Address
14002 // - Means a lot of changes to Transaction/Wallet
14003 // * Ignore it (existing solution)
14004 // * Some form of hackery with commonjs
14005 //
14006 var ecurve = _dereq_('ecurve')
14007 var curve = ecurve.getCurveByName('secp256k1')
14008
14009 var ECSignature = _dereq_('./ecsignature')
14010 var Script = _dereq_('./script')
14011
14012 function classifyOutput(script) {
14013 assert(script instanceof Script, 'Expected Script, got ', script)
14014
14015 if (isPubKeyHashOutput.call(script)) {
14016 return 'pubkeyhash'
14017 } else if (isScriptHashOutput.call(script)) {
14018 return 'scripthash'
14019 } else if (isMultisigOutput.call(script)) {
14020 return 'multisig'
14021 } else if (isPubKeyOutput.call(script)) {
14022 return 'pubkey'
14023 } else if (isNulldataOutput.call(script)) {
14024 return 'nulldata'
14025 } else {
14026 return 'nonstandard'
14027 }
14028 }
14029
14030 function classifyInput(script) {
14031 assert(script instanceof Script, 'Expected Script, got ', script)
14032
14033 if (isPubKeyHashInput.call(script)) {
14034 return 'pubkeyhash'
14035 } else if (isScriptHashInput.call(script)) {
14036 return 'scripthash'
14037 } else if (isMultisigInput.call(script)) {
14038 return 'multisig'
14039 } else if (isPubKeyInput.call(script)) {
14040 return 'pubkey'
14041 } else {
14042 return 'nonstandard'
14043 }
14044 }
14045
14046 function isCanonicalPubKey(buffer) {
14047 if (!Buffer.isBuffer(buffer)) return false
14048
14049 try {
14050 // FIXME: boo
14051 ecurve.Point.decodeFrom(curve, buffer)
14052 } catch (e) {
14053 if (!(e.message.match(/Invalid sequence (length|tag)/))) throw e
14054
14055 return false
14056 }
14057
14058 return true
14059 }
14060
14061 function isCanonicalSignature(buffer) {
14062 if (!Buffer.isBuffer(buffer)) return false
14063
14064 try {
14065 ECSignature.parseScriptSignature(buffer)
14066 } catch(e) {
14067 if (!(e.message.match(/Not a DER sequence|Invalid sequence length|Expected a DER integer|R length is zero|S length is zero|R value excessively padded|S value excessively padded|R value is negative|S value is negative|Invalid hashType/))) throw e
14068
14069 return false
14070 }
14071
14072 return true
14073 }
14074
14075 function isPubKeyHashInput() {
14076 return this.chunks.length === 2 &&
14077 isCanonicalSignature(this.chunks[0]) &&
14078 isCanonicalPubKey(this.chunks[1])
14079 }
14080
14081 function isPubKeyHashOutput() {
14082 return this.chunks.length === 5 &&
14083 this.chunks[0] === opcodes.OP_DUP &&
14084 this.chunks[1] === opcodes.OP_HASH160 &&
14085 Buffer.isBuffer(this.chunks[2]) &&
14086 this.chunks[2].length === 20 &&
14087 this.chunks[3] === opcodes.OP_EQUALVERIFY &&
14088 this.chunks[4] === opcodes.OP_CHECKSIG
14089 }
14090
14091 function isPubKeyInput() {
14092 return this.chunks.length === 1 &&
14093 isCanonicalSignature(this.chunks[0])
14094 }
14095
14096 function isPubKeyOutput() {
14097 return this.chunks.length === 2 &&
14098 isCanonicalPubKey(this.chunks[0]) &&
14099 this.chunks[1] === opcodes.OP_CHECKSIG
14100 }
14101
14102 function isScriptHashInput() {
14103 if (this.chunks.length < 2) return false
14104 var lastChunk = this.chunks[this.chunks.length - 1]
14105
14106 if (!Buffer.isBuffer(lastChunk)) return false
14107
14108 var scriptSig = Script.fromChunks(this.chunks.slice(0, -1))
14109 var scriptPubKey = Script.fromBuffer(lastChunk)
14110
14111 return classifyInput(scriptSig) === classifyOutput(scriptPubKey)
14112 }
14113
14114 function isScriptHashOutput() {
14115 return this.chunks.length === 3 &&
14116 this.chunks[0] === opcodes.OP_HASH160 &&
14117 Buffer.isBuffer(this.chunks[1]) &&
14118 this.chunks[1].length === 20 &&
14119 this.chunks[2] === opcodes.OP_EQUAL
14120 }
14121
14122 function isMultisigInput() {
14123 return this.chunks[0] === opcodes.OP_0 &&
14124 this.chunks.slice(1).every(isCanonicalSignature)
14125 }
14126
14127 function isMultisigOutput() {
14128 if (this.chunks < 4) return false
14129 if (this.chunks[this.chunks.length - 1] !== opcodes.OP_CHECKMULTISIG) return false
14130
14131 var mOp = this.chunks[0]
14132 if (mOp === opcodes.OP_0) return false
14133 if (mOp < opcodes.OP_1) return false
14134 if (mOp > opcodes.OP_16) return false
14135
14136 var nOp = this.chunks[this.chunks.length - 2]
14137 if (nOp === opcodes.OP_0) return false
14138 if (nOp < opcodes.OP_1) return false
14139 if (nOp > opcodes.OP_16) return false
14140
14141 var m = mOp - (opcodes.OP_1 - 1)
14142 var n = nOp - (opcodes.OP_1 - 1)
14143 if (n < m) return false
14144
14145 var pubKeys = this.chunks.slice(1, -2)
14146 if (n < pubKeys.length) return false
14147
14148 return pubKeys.every(isCanonicalPubKey)
14149 }
14150
14151 function isNulldataOutput() {
14152 return this.chunks[0] === opcodes.OP_RETURN
14153 }
14154
14155 // Standard Script Templates
14156 // {pubKey} OP_CHECKSIG
14157 function pubKeyOutput(pubKey) {
14158 return Script.fromChunks([
14159 pubKey.toBuffer(),
14160 opcodes.OP_CHECKSIG
14161 ])
14162 }
14163
14164 // OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
14165 function pubKeyHashOutput(hash) {
14166 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14167
14168 return Script.fromChunks([
14169 opcodes.OP_DUP,
14170 opcodes.OP_HASH160,
14171 hash,
14172 opcodes.OP_EQUALVERIFY,
14173 opcodes.OP_CHECKSIG
14174 ])
14175 }
14176
14177 // OP_HASH160 {scriptHash} OP_EQUAL
14178 function scriptHashOutput(hash) {
14179 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14180
14181 return Script.fromChunks([
14182 opcodes.OP_HASH160,
14183 hash,
14184 opcodes.OP_EQUAL
14185 ])
14186 }
14187
14188 // m [pubKeys ...] n OP_CHECKMULTISIG
14189 function multisigOutput(m, pubKeys) {
14190 assert(Array.isArray(pubKeys), 'Expected Array, got ' + pubKeys)
14191 assert(pubKeys.length >= m, 'Not enough pubKeys provided')
14192
14193 var pubKeyBuffers = pubKeys.map(function(pubKey) {
14194 return pubKey.toBuffer()
14195 })
14196 var n = pubKeys.length
14197
14198 return Script.fromChunks([].concat(
14199 (opcodes.OP_1 - 1) + m,
14200 pubKeyBuffers,
14201 (opcodes.OP_1 - 1) + n,
14202 opcodes.OP_CHECKMULTISIG
14203 ))
14204 }
14205
14206 // {signature}
14207 function pubKeyInput(signature) {
14208 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14209
14210 return Script.fromChunks([signature])
14211 }
14212
14213 // {signature} {pubKey}
14214 function pubKeyHashInput(signature, pubKey) {
14215 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14216
14217 return Script.fromChunks([signature, pubKey.toBuffer()])
14218 }
14219
14220 // <scriptSig> {serialized scriptPubKey script}
14221 function scriptHashInput(scriptSig, scriptPubKey) {
14222 return Script.fromChunks([].concat(
14223 scriptSig.chunks,
14224 scriptPubKey.toBuffer()
14225 ))
14226 }
14227
14228 // OP_0 [signatures ...]
14229 function multisigInput(signatures, scriptPubKey) {
14230 if (scriptPubKey) {
14231 assert(isMultisigOutput.call(scriptPubKey))
14232
14233 var m = scriptPubKey.chunks[0]
14234 var k = m - (opcodes.OP_1 - 1)
14235 assert(k <= signatures.length, 'Not enough signatures provided')
14236 }
14237
14238 return Script.fromChunks([].concat(opcodes.OP_0, signatures))
14239 }
14240
14241 module.exports = {
14242 classifyInput: classifyInput,
14243 classifyOutput: classifyOutput,
14244 multisigInput: multisigInput,
14245 multisigOutput: multisigOutput,
14246 pubKeyHashInput: pubKeyHashInput,
14247 pubKeyHashOutput: pubKeyHashOutput,
14248 pubKeyInput: pubKeyInput,
14249 pubKeyOutput: pubKeyOutput,
14250 scriptHashInput: scriptHashInput,
14251 scriptHashOutput: scriptHashOutput
14252 }
14253
14254 }).call(this,_dereq_("buffer").Buffer)
14255 },{"./ecsignature":77,"./opcodes":82,"./script":83,"assert":4,"buffer":8,"ecurve":65}],85:[function(_dereq_,module,exports){
14256 (function (Buffer){
14257 var assert = _dereq_('assert')
14258 var bufferutils = _dereq_('./bufferutils')
14259 var crypto = _dereq_('./crypto')
14260 var opcodes = _dereq_('./opcodes')
14261 var scripts = _dereq_('./scripts')
14262
14263 var Address = _dereq_('./address')
14264 var ECKey = _dereq_('./eckey')
14265 var ECSignature = _dereq_('./ecsignature')
14266 var Script = _dereq_('./script')
14267
14268 Transaction.DEFAULT_SEQUENCE = 0xffffffff
14269 Transaction.SIGHASH_ALL = 0x01
14270 Transaction.SIGHASH_NONE = 0x02
14271 Transaction.SIGHASH_SINGLE = 0x03
14272 Transaction.SIGHASH_ANYONECANPAY = 0x80
14273
14274 function Transaction() {
14275 this.version = 1
14276 this.locktime = 0
14277 this.ins = []
14278 this.outs = []
14279 }
14280
14281 /**
14282 * Create a new txin.
14283 *
14284 * Can be called with any of:
14285 *
14286 * - A transaction and an index
14287 * - A transaction hash and an index
14288 *
14289 * Note that this method does not sign the created input.
14290 */
14291 Transaction.prototype.addInput = function(tx, index, sequence) {
14292 if (sequence == undefined) sequence = Transaction.DEFAULT_SEQUENCE
14293
14294 var hash
14295
14296 if (typeof tx === 'string') {
14297 hash = new Buffer(tx, 'hex')
14298
14299 // TxId hex is big-endian, we need little-endian
14300 Array.prototype.reverse.call(hash)
14301
14302 } else if (tx instanceof Transaction) {
14303 hash = tx.getHash()
14304
14305 } else {
14306 hash = tx
14307 }
14308
14309 assert(Buffer.isBuffer(hash), 'Expected Transaction, txId or txHash, got ' + tx)
14310 assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length)
14311 assert.equal(typeof index, 'number', 'Expected number index, got ' + index)
14312
14313 return (this.ins.push({
14314 hash: hash,
14315 index: index,
14316 script: Script.EMPTY,
14317 sequence: sequence
14318 }) - 1)
14319 }
14320
14321 /**
14322 * Create a new txout.
14323 *
14324 * Can be called with:
14325 *
14326 * - A base58 address string and a value
14327 * - An Address object and a value
14328 * - A scriptPubKey Script and a value
14329 */
14330 Transaction.prototype.addOutput = function(scriptPubKey, value) {
14331 // Attempt to get a valid address if it's a base58 address string
14332 if (typeof scriptPubKey === 'string') {
14333 scriptPubKey = Address.fromBase58Check(scriptPubKey)
14334 }
14335
14336 // Attempt to get a valid script if it's an Address object
14337 if (scriptPubKey instanceof Address) {
14338 var address = scriptPubKey
14339
14340 scriptPubKey = address.toOutputScript()
14341 }
14342
14343 return (this.outs.push({
14344 script: scriptPubKey,
14345 value: value,
14346 }) - 1)
14347 }
14348
14349 Transaction.prototype.toBuffer = function () {
14350 var txInSize = this.ins.reduce(function(a, x) {
14351 return a + (40 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14352 }, 0)
14353
14354 var txOutSize = this.outs.reduce(function(a, x) {
14355 return a + (8 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14356 }, 0)
14357
14358 var buffer = new Buffer(
14359 8 +
14360 bufferutils.varIntSize(this.ins.length) +
14361 bufferutils.varIntSize(this.outs.length) +
14362 txInSize +
14363 txOutSize
14364 )
14365
14366 var offset = 0
14367 function writeSlice(slice) {
14368 slice.copy(buffer, offset)
14369 offset += slice.length
14370 }
14371 function writeUInt32(i) {
14372 buffer.writeUInt32LE(i, offset)
14373 offset += 4
14374 }
14375 function writeUInt64(i) {
14376 bufferutils.writeUInt64LE(buffer, i, offset)
14377 offset += 8
14378 }
14379 function writeVarInt(i) {
14380 var n = bufferutils.writeVarInt(buffer, i, offset)
14381 offset += n
14382 }
14383
14384 writeUInt32(this.version)
14385 writeVarInt(this.ins.length)
14386
14387 this.ins.forEach(function(txin) {
14388 writeSlice(txin.hash)
14389 writeUInt32(txin.index)
14390 writeVarInt(txin.script.buffer.length)
14391 writeSlice(txin.script.buffer)
14392 writeUInt32(txin.sequence)
14393 })
14394
14395 writeVarInt(this.outs.length)
14396 this.outs.forEach(function(txout) {
14397 writeUInt64(txout.value)
14398 writeVarInt(txout.script.buffer.length)
14399 writeSlice(txout.script.buffer)
14400 })
14401
14402 writeUInt32(this.locktime)
14403
14404 return buffer
14405 }
14406
14407 Transaction.prototype.toHex = function() {
14408 return this.toBuffer().toString('hex')
14409 }
14410
14411 /**
14412 * Hash transaction for signing a specific input.
14413 *
14414 * Bitcoin uses a different hash for each signed transaction input. This
14415 * method copies the transaction, makes the necessary changes based on the
14416 * hashType, serializes and finally hashes the result. This hash can then be
14417 * used to sign the transaction input in question.
14418 */
14419 Transaction.prototype.hashForSignature = function(prevOutScript, inIndex, hashType) {
14420 assert(inIndex >= 0, 'Invalid vin index')
14421 assert(inIndex < this.ins.length, 'Invalid vin index')
14422 assert(prevOutScript instanceof Script, 'Invalid Script object')
14423
14424 var txTmp = this.clone()
14425 var hashScript = prevOutScript.without(opcodes.OP_CODESEPARATOR)
14426
14427 // Blank out other inputs' signatures
14428 txTmp.ins.forEach(function(txin) {
14429 txin.script = Script.EMPTY
14430 })
14431 txTmp.ins[inIndex].script = hashScript
14432
14433 var hashTypeModifier = hashType & 0x1f
14434 if (hashTypeModifier === Transaction.SIGHASH_NONE) {
14435 assert(false, 'SIGHASH_NONE not yet supported')
14436
14437 } else if (hashTypeModifier === Transaction.SIGHASH_SINGLE) {
14438 assert(false, 'SIGHASH_SINGLE not yet supported')
14439
14440 }
14441
14442 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
14443 assert(false, 'SIGHASH_ANYONECANPAY not yet supported')
14444 }
14445
14446 var hashTypeBuffer = new Buffer(4)
14447 hashTypeBuffer.writeInt32LE(hashType, 0)
14448
14449 var buffer = Buffer.concat([txTmp.toBuffer(), hashTypeBuffer])
14450 return crypto.hash256(buffer)
14451 }
14452
14453 Transaction.prototype.getHash = function () {
14454 return crypto.hash256(this.toBuffer())
14455 }
14456
14457 Transaction.prototype.getId = function () {
14458 var buffer = this.getHash()
14459
14460 // Big-endian is used for TxHash
14461 Array.prototype.reverse.call(buffer)
14462
14463 return buffer.toString('hex')
14464 }
14465
14466 Transaction.prototype.clone = function () {
14467 var newTx = new Transaction()
14468 newTx.version = this.version
14469 newTx.locktime = this.locktime
14470
14471 newTx.ins = this.ins.map(function(txin) {
14472 return {
14473 hash: txin.hash,
14474 index: txin.index,
14475 script: txin.script,
14476 sequence: txin.sequence
14477 }
14478 })
14479
14480 newTx.outs = this.outs.map(function(txout) {
14481 return {
14482 script: txout.script,
14483 value: txout.value
14484 }
14485 })
14486
14487 return newTx
14488 }
14489
14490 Transaction.fromBuffer = function(buffer) {
14491 var offset = 0
14492 function readSlice(n) {
14493 offset += n
14494 return buffer.slice(offset - n, offset)
14495 }
14496 function readUInt32() {
14497 var i = buffer.readUInt32LE(offset)
14498 offset += 4
14499 return i
14500 }
14501 function readUInt64() {
14502 var i = bufferutils.readUInt64LE(buffer, offset)
14503 offset += 8
14504 return i
14505 }
14506 function readVarInt() {
14507 var vi = bufferutils.readVarInt(buffer, offset)
14508 offset += vi.size
14509 return vi.number
14510 }
14511
14512 var tx = new Transaction()
14513 tx.version = readUInt32()
14514
14515 var vinLen = readVarInt()
14516 for (var i = 0; i < vinLen; ++i) {
14517 var hash = readSlice(32)
14518 var vout = readUInt32()
14519 var scriptLen = readVarInt()
14520 var script = readSlice(scriptLen)
14521 var sequence = readUInt32()
14522
14523 tx.ins.push({
14524 hash: hash,
14525 index: vout,
14526 script: Script.fromBuffer(script),
14527 sequence: sequence
14528 })
14529 }
14530
14531 var voutLen = readVarInt()
14532 for (i = 0; i < voutLen; ++i) {
14533 var value = readUInt64()
14534 var scriptLen = readVarInt()
14535 var script = readSlice(scriptLen)
14536
14537 tx.outs.push({
14538 value: value,
14539 script: Script.fromBuffer(script)
14540 })
14541 }
14542
14543 tx.locktime = readUInt32()
14544 assert.equal(offset, buffer.length, 'Transaction has unexpected data')
14545
14546 return tx
14547 }
14548
14549 Transaction.fromHex = function(hex) {
14550 return Transaction.fromBuffer(new Buffer(hex, 'hex'))
14551 }
14552
14553 /**
14554 * Signs a pubKeyHash output at some index with the given key
14555 */
14556 Transaction.prototype.sign = function(index, privKey, hashType) {
14557 var prevOutScript = privKey.pub.getAddress().toOutputScript()
14558 var signature = this.signInput(index, prevOutScript, privKey, hashType)
14559
14560 // FIXME: Assumed prior TX was pay-to-pubkey-hash
14561 var scriptSig = scripts.pubKeyHashInput(signature, privKey.pub)
14562 this.setInputScript(index, scriptSig)
14563 }
14564
14565 Transaction.prototype.signInput = function(index, prevOutScript, privKey, hashType) {
14566 hashType = hashType || Transaction.SIGHASH_ALL
14567
14568 var hash = this.hashForSignature(prevOutScript, index, hashType)
14569 var signature = privKey.sign(hash)
14570
14571 return signature.toScriptSignature(hashType)
14572 }
14573
14574 Transaction.prototype.setInputScript = function(index, script) {
14575 this.ins[index].script = script
14576 }
14577
14578 // FIXME: could be validateInput(index, prevTxOut, pub)
14579 Transaction.prototype.validateInput = function(index, prevOutScript, pubKey, buffer) {
14580 var parsed = ECSignature.parseScriptSignature(buffer)
14581 var hash = this.hashForSignature(prevOutScript, index, parsed.hashType)
14582
14583 return pubKey.verify(hash, parsed.signature)
14584 }
14585
14586 module.exports = Transaction
14587
14588 }).call(this,_dereq_("buffer").Buffer)
14589 },{"./address":69,"./bufferutils":71,"./crypto":73,"./eckey":75,"./ecsignature":77,"./opcodes":82,"./script":83,"./scripts":84,"assert":4,"buffer":8}],86:[function(_dereq_,module,exports){
14590 (function (Buffer){
14591 var assert = _dereq_('assert')
14592 var networks = _dereq_('./networks')
14593 var rng = _dereq_('secure-random')
14594
14595 var Address = _dereq_('./address')
14596 var HDNode = _dereq_('./hdnode')
14597 var Transaction = _dereq_('./transaction')
14598
14599 function Wallet(seed, network) {
14600 network = network || networks.bitcoin
14601
14602 // Stored in a closure to make accidental serialization less likely
14603 var masterkey = null
14604 var me = this
14605 var accountZero = null
14606 var internalAccount = null
14607 var externalAccount = null
14608
14609 // Addresses
14610 this.addresses = []
14611 this.changeAddresses = []
14612
14613 // Transaction output data
14614 this.outputs = {}
14615
14616 // Make a new master key
14617 this.newMasterKey = function(seed) {
14618 seed = seed || new Buffer(rng(32))
14619 masterkey = HDNode.fromSeedBuffer(seed, network)
14620
14621 // HD first-level child derivation method should be hardened
14622 // See https://bitcointalk.org/index.php?topic=405179.msg4415254#msg4415254
14623 accountZero = masterkey.deriveHardened(0)
14624 externalAccount = accountZero.derive(0)
14625 internalAccount = accountZero.derive(1)
14626
14627 me.addresses = []
14628 me.changeAddresses = []
14629
14630 me.outputs = {}
14631 }
14632
14633 this.newMasterKey(seed)
14634
14635 this.generateAddress = function() {
14636 var key = externalAccount.derive(this.addresses.length)
14637 this.addresses.push(key.getAddress().toString())
14638 return this.addresses[this.addresses.length - 1]
14639 }
14640
14641 this.generateChangeAddress = function() {
14642 var key = internalAccount.derive(this.changeAddresses.length)
14643 this.changeAddresses.push(key.getAddress().toString())
14644 return this.changeAddresses[this.changeAddresses.length - 1]
14645 }
14646
14647 this.getBalance = function() {
14648 return this.getUnspentOutputs().reduce(function(memo, output){
14649 return memo + output.value
14650 }, 0)
14651 }
14652
14653 this.getUnspentOutputs = function() {
14654 var utxo = []
14655
14656 for(var key in this.outputs){
14657 var output = this.outputs[key]
14658 if(!output.to) utxo.push(outputToUnspentOutput(output))
14659 }
14660
14661 return utxo
14662 }
14663
14664 this.setUnspentOutputs = function(utxo) {
14665 var outputs = {}
14666
14667 utxo.forEach(function(uo){
14668 validateUnspentOutput(uo)
14669 var o = unspentOutputToOutput(uo)
14670 outputs[o.from] = o
14671 })
14672
14673 this.outputs = outputs
14674 }
14675
14676 function outputToUnspentOutput(output){
14677 var hashAndIndex = output.from.split(":")
14678
14679 return {
14680 hash: hashAndIndex[0],
14681 outputIndex: parseInt(hashAndIndex[1]),
14682 address: output.address,
14683 value: output.value,
14684 pending: output.pending
14685 }
14686 }
14687
14688 function unspentOutputToOutput(o) {
14689 var hash = o.hash
14690 var key = hash + ":" + o.outputIndex
14691 return {
14692 from: key,
14693 address: o.address,
14694 value: o.value,
14695 pending: o.pending
14696 }
14697 }
14698
14699 function validateUnspentOutput(uo) {
14700 var missingField
14701
14702 if (isNullOrUndefined(uo.hash)) {
14703 missingField = "hash"
14704 }
14705
14706 var requiredKeys = ['outputIndex', 'address', 'value']
14707 requiredKeys.forEach(function (key) {
14708 if (isNullOrUndefined(uo[key])){
14709 missingField = key
14710 }
14711 })
14712
14713 if (missingField) {
14714 var message = [
14715 'Invalid unspent output: key', missingField, 'is missing.',
14716 'A valid unspent output must contain'
14717 ]
14718 message.push(requiredKeys.join(', '))
14719 message.push("and hash")
14720 throw new Error(message.join(' '))
14721 }
14722 }
14723
14724 function isNullOrUndefined(value) {
14725 return value == undefined
14726 }
14727
14728 this.processPendingTx = function(tx){
14729 processTx(tx, true)
14730 }
14731
14732 this.processConfirmedTx = function(tx){
14733 processTx(tx, false)
14734 }
14735
14736 function processTx(tx, isPending) {
14737 var txid = tx.getId()
14738
14739 tx.outs.forEach(function(txOut, i) {
14740 var address
14741
14742 try {
14743 address = Address.fromOutputScript(txOut.script, network).toString()
14744 } catch(e) {
14745 if (!(e.message.match(/has no matching Address/))) throw e
14746 }
14747
14748 if (isMyAddress(address)) {
14749 var output = txid + ':' + i
14750
14751 me.outputs[output] = {
14752 from: output,
14753 value: txOut.value,
14754 address: address,
14755 pending: isPending
14756 }
14757 }
14758 })
14759
14760 tx.ins.forEach(function(txIn, i) {
14761 // copy and convert to big-endian hex
14762 var txinId = new Buffer(txIn.hash)
14763 Array.prototype.reverse.call(txinId)
14764 txinId = txinId.toString('hex')
14765
14766 var output = txinId + ':' + txIn.index
14767
14768 if (!(output in me.outputs)) return
14769
14770 if (isPending) {
14771 me.outputs[output].to = txid + ':' + i
14772 me.outputs[output].pending = true
14773 } else {
14774 delete me.outputs[output]
14775 }
14776 })
14777 }
14778
14779 this.createTx = function(to, value, fixedFee, changeAddress) {
14780 assert(value > network.dustThreshold, value + ' must be above dust threshold (' + network.dustThreshold + ' Satoshis)')
14781
14782 var utxos = getCandidateOutputs(value)
14783 var accum = 0
14784 var subTotal = value
14785 var addresses = []
14786
14787 var tx = new Transaction()
14788 tx.addOutput(to, value)
14789
14790 for (var i = 0; i < utxos.length; ++i) {
14791 var utxo = utxos[i]
14792 addresses.push(utxo.address)
14793
14794 var outpoint = utxo.from.split(':')
14795 tx.addInput(outpoint[0], parseInt(outpoint[1]))
14796
14797 var fee = fixedFee == undefined ? estimateFeePadChangeOutput(tx) : fixedFee
14798
14799 accum += utxo.value
14800 subTotal = value + fee
14801 if (accum >= subTotal) {
14802 var change = accum - subTotal
14803
14804 if (change > network.dustThreshold) {
14805 tx.addOutput(changeAddress || getChangeAddress(), change)
14806 }
14807
14808 break
14809 }
14810 }
14811
14812 assert(accum >= subTotal, 'Not enough funds (incl. fee): ' + accum + ' < ' + subTotal)
14813
14814 this.signWith(tx, addresses)
14815 return tx
14816 }
14817
14818 function getCandidateOutputs() {
14819 var unspent = []
14820
14821 for (var key in me.outputs) {
14822 var output = me.outputs[key]
14823 if (!output.pending) unspent.push(output)
14824 }
14825
14826 var sortByValueDesc = unspent.sort(function(o1, o2){
14827 return o2.value - o1.value
14828 })
14829
14830 return sortByValueDesc
14831 }
14832
14833 function estimateFeePadChangeOutput(tx) {
14834 var tmpTx = tx.clone()
14835 tmpTx.addOutput(getChangeAddress(), network.dustSoftThreshold || 0)
14836
14837 return network.estimateFee(tmpTx)
14838 }
14839
14840 function getChangeAddress() {
14841 if(me.changeAddresses.length === 0) me.generateChangeAddress();
14842 return me.changeAddresses[me.changeAddresses.length - 1]
14843 }
14844
14845 this.signWith = function(tx, addresses) {
14846 assert.equal(tx.ins.length, addresses.length, 'Number of addresses must match number of transaction inputs')
14847
14848 addresses.forEach(function(address, i) {
14849 var key = me.getPrivateKeyForAddress(address)
14850
14851 tx.sign(i, key)
14852 })
14853
14854 return tx
14855 }
14856
14857 this.getMasterKey = function() { return masterkey }
14858 this.getAccountZero = function() { return accountZero }
14859 this.getInternalAccount = function() { return internalAccount }
14860 this.getExternalAccount = function() { return externalAccount }
14861
14862 this.getPrivateKey = function(index) {
14863 return externalAccount.derive(index).privKey
14864 }
14865
14866 this.getInternalPrivateKey = function(index) {
14867 return internalAccount.derive(index).privKey
14868 }
14869
14870 this.getPrivateKeyForAddress = function(address) {
14871 var index
14872 if((index = this.addresses.indexOf(address)) > -1) {
14873 return this.getPrivateKey(index)
14874 } else if((index = this.changeAddresses.indexOf(address)) > -1) {
14875 return this.getInternalPrivateKey(index)
14876 } else {
14877 throw new Error('Unknown address. Make sure the address is from the keychain and has been generated.')
14878 }
14879 }
14880
14881 function isReceiveAddress(address){
14882 return me.addresses.indexOf(address) > -1
14883 }
14884
14885 function isChangeAddress(address){
14886 return me.changeAddresses.indexOf(address) > -1
14887 }
14888
14889 function isMyAddress(address) {
14890 return isReceiveAddress(address) || isChangeAddress(address)
14891 }
14892 }
14893
14894 module.exports = Wallet
14895
14896 }).call(this,_dereq_("buffer").Buffer)
14897 },{"./address":69,"./hdnode":78,"./networks":81,"./transaction":85,"assert":4,"buffer":8,"secure-random":68}]},{},[79])
14898 (79)
14899 });
14900 </script>
14901
14902 <!--<script src="/js/asmcrypto.js"></script>-->
14903 <script>
14904 // INCLUDE ASMCRYPTO
14905 // https://rawgit.com/tresorit/asmcrypto.js/598a1098504f1b2d0e615bc51dd8404afd2d338b/asmcrypto.js
14906 // Provides PBKDF2 functionality
14907 // It's faster than CryptoJS
14908 // Couldn't get SJCL working as desired
14909
14910
14911 (function(exports, global) {
14912 "use strict";
14913 global["asmCrypto"] = exports;
14914 function string_to_bytes(str) {
14915 var i, len = str.length, arr = new Uint8Array(len);
14916 for (i = 0; i < len; i += 1) {
14917 arr[i] = str.charCodeAt(i);
14918 }
14919 return arr;
14920 }
14921 function hex_to_bytes(str) {
14922 var arr = [], len = str.length, i;
14923 if (len & 1) {
14924 str = "0" + str;
14925 len++;
14926 }
14927 for (i = 0; i < len; i += 2) {
14928 arr.push(parseInt(str.substr(i, 2), 16));
14929 }
14930 return new Uint8Array(arr);
14931 }
14932 function base64_to_bytes(str) {
14933 return string_to_bytes(atob(str));
14934 }
14935 function bytes_to_string(arr) {
14936 var str = "";
14937 for (var i = 0; i < arr.length; i++) str += String.fromCharCode(arr[i]);
14938 return str;
14939 }
14940 function bytes_to_hex(arr) {
14941 var sz = (arr.byteLength || arr.length) / arr.length, str = "";
14942 for (var i = 0; i < arr.length; i++) {
14943 var h = arr[i].toString(16);
14944 if (h.length < 2 * sz) str += "00000000000000".substr(0, 2 * sz - h.length);
14945 str += h;
14946 }
14947 return str;
14948 }
14949 function bytes_to_base64(arr) {
14950 return btoa(bytes_to_string(arr));
14951 }
14952 function pow2_ceil(a) {
14953 a -= 1;
14954 a |= a >>> 1;
14955 a |= a >>> 2;
14956 a |= a >>> 4;
14957 a |= a >>> 8;
14958 a |= a >>> 16;
14959 a += 1;
14960 return a;
14961 }
14962 function is_number(a) {
14963 return typeof a === "number";
14964 }
14965 function is_string(a) {
14966 return typeof a === "string";
14967 }
14968 function is_buffer(a) {
14969 return a instanceof ArrayBuffer;
14970 }
14971 function is_bytes(a) {
14972 return a instanceof Uint8Array;
14973 }
14974 function is_typed_array(a) {
14975 return a instanceof Int8Array || a instanceof Uint8Array || a instanceof Int16Array || a instanceof Uint16Array || a instanceof Int32Array || a instanceof Uint32Array || a instanceof Float32Array || a instanceof Float64Array;
14976 }
14977 function IllegalStateError() {
14978 Error.apply(this, arguments);
14979 }
14980 IllegalStateError.prototype = new Error();
14981 function IllegalArgumentError() {
14982 Error.apply(this, arguments);
14983 }
14984 IllegalArgumentError.prototype = new Error();
14985 function SecurityError() {
14986 Error.apply(this, arguments);
14987 }
14988 IllegalArgumentError.prototype = new Error();
14989 var _aes_tables = [ 99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22, 82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125, 198, 248, 238, 246, 255, 214, 222, 145, 96, 2, 206, 86, 231, 181, 77, 236, 143, 31, 137, 250, 239, 178, 142, 251, 65, 179, 95, 69, 35, 83, 228, 155, 117, 225, 61, 76, 108, 126, 245, 131, 104, 81, 209, 249, 226, 171, 98, 42, 8, 149, 70, 157, 48, 55, 10, 47, 14, 36, 27, 223, 205, 78, 127, 234, 18, 29, 88, 52, 54, 220, 180, 91, 164, 118, 183, 125, 82, 221, 94, 19, 166, 185, 0, 193, 64, 227, 121, 182, 212, 141, 103, 114, 148, 152, 176, 133, 187, 197, 79, 237, 134, 154, 102, 17, 138, 233, 4, 254, 160, 120, 37, 75, 162, 93, 128, 5, 63, 33, 112, 241, 99, 119, 175, 66, 32, 229, 253, 191, 129, 24, 38, 195, 190, 53, 136, 46, 147, 85, 252, 122, 200, 186, 50, 230, 192, 25, 158, 163, 68, 84, 59, 11, 140, 199, 107, 40, 167, 188, 22, 173, 219, 100, 116, 20, 146, 12, 72, 184, 159, 189, 67, 196, 57, 49, 211, 242, 213, 139, 110, 218, 1, 177, 156, 73, 216, 172, 243, 207, 202, 244, 71, 16, 111, 240, 74, 92, 56, 87, 115, 151, 203, 161, 232, 62, 150, 97, 13, 15, 224, 124, 113, 204, 144, 6, 247, 28, 194, 106, 174, 105, 23, 153, 58, 39, 217, 235, 43, 34, 210, 169, 7, 51, 45, 60, 21, 201, 135, 170, 80, 165, 3, 89, 9, 26, 101, 215, 132, 208, 130, 41, 90, 30, 123, 168, 109, 44, 165, 132, 153, 141, 13, 189, 177, 84, 80, 3, 169, 125, 25, 98, 230, 154, 69, 157, 64, 135, 21, 235, 201, 11, 236, 103, 253, 234, 191, 247, 150, 91, 194, 28, 174, 106, 90, 65, 2, 79, 92, 244, 52, 8, 147, 115, 83, 63, 12, 82, 101, 94, 40, 161, 15, 181, 9, 54, 155, 61, 38, 105, 205, 159, 27, 158, 116, 46, 45, 178, 238, 251, 246, 77, 97, 206, 123, 62, 113, 151, 245, 104, 0, 44, 96, 31, 200, 237, 190, 70, 217, 75, 222, 212, 232, 74, 107, 42, 229, 22, 197, 215, 85, 148, 207, 16, 6, 129, 240, 68, 186, 227, 243, 254, 192, 138, 173, 188, 72, 4, 223, 193, 117, 99, 48, 26, 14, 109, 76, 20, 53, 47, 225, 162, 204, 57, 87, 242, 130, 71, 172, 231, 43, 149, 160, 152, 209, 127, 102, 126, 171, 131, 202, 41, 211, 60, 121, 226, 29, 118, 59, 86, 78, 30, 219, 10, 108, 228, 93, 110, 239, 166, 168, 164, 55, 139, 50, 67, 89, 183, 140, 100, 210, 224, 180, 250, 7, 37, 175, 142, 233, 24, 213, 136, 111, 114, 36, 241, 199, 81, 35, 124, 156, 33, 221, 220, 134, 133, 144, 66, 196, 170, 216, 5, 1, 18, 163, 95, 249, 208, 145, 88, 39, 185, 56, 19, 179, 51, 187, 112, 137, 167, 182, 34, 146, 32, 73, 255, 120, 122, 143, 248, 128, 23, 218, 49, 198, 184, 195, 176, 119, 17, 203, 252, 214, 58, 0, 9, 18, 27, 36, 45, 54, 63, 72, 65, 90, 83, 108, 101, 126, 119, 144, 153, 130, 139, 180, 189, 166, 175, 216, 209, 202, 195, 252, 245, 238, 231, 59, 50, 41, 32, 31, 22, 13, 4, 115, 122, 97, 104, 87, 94, 69, 76, 171, 162, 185, 176, 143, 134, 157, 148, 227, 234, 241, 248, 199, 206, 213, 220, 118, 127, 100, 109, 82, 91, 64, 73, 62, 55, 44, 37, 26, 19, 8, 1, 230, 239, 244, 253, 194, 203, 208, 217, 174, 167, 188, 181, 138, 131, 152, 145, 77, 68, 95, 86, 105, 96, 123, 114, 5, 12, 23, 30, 33, 40, 51, 58, 221, 212, 207, 198, 249, 240, 235, 226, 149, 156, 135, 142, 177, 184, 163, 170, 236, 229, 254, 247, 200, 193, 218, 211, 164, 173, 182, 191, 128, 137, 146, 155, 124, 117, 110, 103, 88, 81, 74, 67, 52, 61, 38, 47, 16, 25, 2, 11, 215, 222, 197, 204, 243, 250, 225, 232, 159, 150, 141, 132, 187, 178, 169, 160, 71, 78, 85, 92, 99, 106, 113, 120, 15, 6, 29, 20, 43, 34, 57, 48, 154, 147, 136, 129, 190, 183, 172, 165, 210, 219, 192, 201, 246, 255, 228, 237, 10, 3, 24, 17, 46, 39, 60, 53, 66, 75, 80, 89, 102, 111, 116, 125, 161, 168, 179, 186, 133, 140, 151, 158, 233, 224, 251, 242, 205, 196, 223, 214, 49, 56, 35, 42, 21, 28, 7, 14, 121, 112, 107, 98, 93, 84, 79, 70, 0, 11, 22, 29, 44, 39, 58, 49, 88, 83, 78, 69, 116, 127, 98, 105, 176, 187, 166, 173, 156, 151, 138, 129, 232, 227, 254, 245, 196, 207, 210, 217, 123, 112, 109, 102, 87, 92, 65, 74, 35, 40, 53, 62, 15, 4, 25, 18, 203, 192, 221, 214, 231, 236, 241, 250, 147, 152, 133, 142, 191, 180, 169, 162, 246, 253, 224, 235, 218, 209, 204, 199, 174, 165, 184, 179, 130, 137, 148, 159, 70, 77, 80, 91, 106, 97, 124, 119, 30, 21, 8, 3, 50, 57, 36, 47, 141, 134, 155, 144, 161, 170, 183, 188, 213, 222, 195, 200, 249, 242, 239, 228, 61, 54, 43, 32, 17, 26, 7, 12, 101, 110, 115, 120, 73, 66, 95, 84, 247, 252, 225, 234, 219, 208, 205, 198, 175, 164, 185, 178, 131, 136, 149, 158, 71, 76, 81, 90, 107, 96, 125, 118, 31, 20, 9, 2, 51, 56, 37, 46, 140, 135, 154, 145, 160, 171, 182, 189, 212, 223, 194, 201, 248, 243, 238, 229, 60, 55, 42, 33, 16, 27, 6, 13, 100, 111, 114, 121, 72, 67, 94, 85, 1, 10, 23, 28, 45, 38, 59, 48, 89, 82, 79, 68, 117, 126, 99, 104, 177, 186, 167, 172, 157, 150, 139, 128, 233, 226, 255, 244, 197, 206, 211, 216, 122, 113, 108, 103, 86, 93, 64, 75, 34, 41, 52, 63, 14, 5, 24, 19, 202, 193, 220, 215, 230, 237, 240, 251, 146, 153, 132, 143, 190, 181, 168, 163, 0, 13, 26, 23, 52, 57, 46, 35, 104, 101, 114, 127, 92, 81, 70, 75, 208, 221, 202, 199, 228, 233, 254, 243, 184, 181, 162, 175, 140, 129, 150, 155, 187, 182, 161, 172, 143, 130, 149, 152, 211, 222, 201, 196, 231, 234, 253, 240, 107, 102, 113, 124, 95, 82, 69, 72, 3, 14, 25, 20, 55, 58, 45, 32, 109, 96, 119, 122, 89, 84, 67, 78, 5, 8, 31, 18, 49, 60, 43, 38, 189, 176, 167, 170, 137, 132, 147, 158, 213, 216, 207, 194, 225, 236, 251, 246, 214, 219, 204, 193, 226, 239, 248, 245, 190, 179, 164, 169, 138, 135, 144, 157, 6, 11, 28, 17, 50, 63, 40, 37, 110, 99, 116, 121, 90, 87, 64, 77, 218, 215, 192, 205, 238, 227, 244, 249, 178, 191, 168, 165, 134, 139, 156, 145, 10, 7, 16, 29, 62, 51, 36, 41, 98, 111, 120, 117, 86, 91, 76, 65, 97, 108, 123, 118, 85, 88, 79, 66, 9, 4, 19, 30, 61, 48, 39, 42, 177, 188, 171, 166, 133, 136, 159, 146, 217, 212, 195, 206, 237, 224, 247, 250, 183, 186, 173, 160, 131, 142, 153, 148, 223, 210, 197, 200, 235, 230, 241, 252, 103, 106, 125, 112, 83, 94, 73, 68, 15, 2, 21, 24, 59, 54, 33, 44, 12, 1, 22, 27, 56, 53, 34, 47, 100, 105, 126, 115, 80, 93, 74, 71, 220, 209, 198, 203, 232, 229, 242, 255, 180, 185, 174, 163, 128, 141, 154, 151, 0, 14, 28, 18, 56, 54, 36, 42, 112, 126, 108, 98, 72, 70, 84, 90, 224, 238, 252, 242, 216, 214, 196, 202, 144, 158, 140, 130, 168, 166, 180, 186, 219, 213, 199, 201, 227, 237, 255, 241, 171, 165, 183, 185, 147, 157, 143, 129, 59, 53, 39, 41, 3, 13, 31, 17, 75, 69, 87, 89, 115, 125, 111, 97, 173, 163, 177, 191, 149, 155, 137, 135, 221, 211, 193, 207, 229, 235, 249, 247, 77, 67, 81, 95, 117, 123, 105, 103, 61, 51, 33, 47, 5, 11, 25, 23, 118, 120, 106, 100, 78, 64, 82, 92, 6, 8, 26, 20, 62, 48, 34, 44, 150, 152, 138, 132, 174, 160, 178, 188, 230, 232, 250, 244, 222, 208, 194, 204, 65, 79, 93, 83, 121, 119, 101, 107, 49, 63, 45, 35, 9, 7, 21, 27, 161, 175, 189, 179, 153, 151, 133, 139, 209, 223, 205, 195, 233, 231, 245, 251, 154, 148, 134, 136, 162, 172, 190, 176, 234, 228, 246, 248, 210, 220, 206, 192, 122, 116, 102, 104, 66, 76, 94, 80, 10, 4, 22, 24, 50, 60, 46, 32, 236, 226, 240, 254, 212, 218, 200, 198, 156, 146, 128, 142, 164, 170, 184, 182, 12, 2, 16, 30, 52, 58, 40, 38, 124, 114, 96, 110, 68, 74, 88, 86, 55, 57, 43, 37, 15, 1, 19, 29, 71, 73, 91, 85, 127, 113, 99, 109, 215, 217, 203, 197, 239, 225, 243, 253, 167, 169, 187, 181, 159, 145, 131, 141 ];
14990 var _aes_heap_start = 2048;
14991 function _aes_asm(stdlib, foreign, buffer) {
14992 // Closure Compiler warning - commented out
14993 //"use asm";
14994 var S0 = 0, S1 = 0, S2 = 0, S3 = 0, S4 = 0, S5 = 0, S6 = 0, S7 = 0, S8 = 0, S9 = 0, SA = 0, SB = 0, SC = 0, SD = 0, SE = 0, SF = 0;
14995 var keySize = 0;
14996 var R00 = 0, R01 = 0, R02 = 0, R03 = 0, R04 = 0, R05 = 0, R06 = 0, R07 = 0, R08 = 0, R09 = 0, R0A = 0, R0B = 0, R0C = 0, R0D = 0, R0E = 0, R0F = 0, R10 = 0, R11 = 0, R12 = 0, R13 = 0, R14 = 0, R15 = 0, R16 = 0, R17 = 0, R18 = 0, R19 = 0, R1A = 0, R1B = 0, R1C = 0, R1D = 0, R1E = 0, R1F = 0, R20 = 0, R21 = 0, R22 = 0, R23 = 0, R24 = 0, R25 = 0, R26 = 0, R27 = 0, R28 = 0, R29 = 0, R2A = 0, R2B = 0, R2C = 0, R2D = 0, R2E = 0, R2F = 0, R30 = 0, R31 = 0, R32 = 0, R33 = 0, R34 = 0, R35 = 0, R36 = 0, R37 = 0, R38 = 0, R39 = 0, R3A = 0, R3B = 0, R3C = 0, R3D = 0, R3E = 0, R3F = 0, R40 = 0, R41 = 0, R42 = 0, R43 = 0, R44 = 0, R45 = 0, R46 = 0, R47 = 0, R48 = 0, R49 = 0, R4A = 0, R4B = 0, R4C = 0, R4D = 0, R4E = 0, R4F = 0, R50 = 0, R51 = 0, R52 = 0, R53 = 0, R54 = 0, R55 = 0, R56 = 0, R57 = 0, R58 = 0, R59 = 0, R5A = 0, R5B = 0, R5C = 0, R5D = 0, R5E = 0, R5F = 0, R60 = 0, R61 = 0, R62 = 0, R63 = 0, R64 = 0, R65 = 0, R66 = 0, R67 = 0, R68 = 0, R69 = 0, R6A = 0, R6B = 0, R6C = 0, R6D = 0, R6E = 0, R6F = 0, R70 = 0, R71 = 0, R72 = 0, R73 = 0, R74 = 0, R75 = 0, R76 = 0, R77 = 0, R78 = 0, R79 = 0, R7A = 0, R7B = 0, R7C = 0, R7D = 0, R7E = 0, R7F = 0, R80 = 0, R81 = 0, R82 = 0, R83 = 0, R84 = 0, R85 = 0, R86 = 0, R87 = 0, R88 = 0, R89 = 0, R8A = 0, R8B = 0, R8C = 0, R8D = 0, R8E = 0, R8F = 0, R90 = 0, R91 = 0, R92 = 0, R93 = 0, R94 = 0, R95 = 0, R96 = 0, R97 = 0, R98 = 0, R99 = 0, R9A = 0, R9B = 0, R9C = 0, R9D = 0, R9E = 0, R9F = 0, RA0 = 0, RA1 = 0, RA2 = 0, RA3 = 0, RA4 = 0, RA5 = 0, RA6 = 0, RA7 = 0, RA8 = 0, RA9 = 0, RAA = 0, RAB = 0, RAC = 0, RAD = 0, RAE = 0, RAF = 0, RB0 = 0, RB1 = 0, RB2 = 0, RB3 = 0, RB4 = 0, RB5 = 0, RB6 = 0, RB7 = 0, RB8 = 0, RB9 = 0, RBA = 0, RBB = 0, RBC = 0, RBD = 0, RBE = 0, RBF = 0, RC0 = 0, RC1 = 0, RC2 = 0, RC3 = 0, RC4 = 0, RC5 = 0, RC6 = 0, RC7 = 0, RC8 = 0, RC9 = 0, RCA = 0, RCB = 0, RCC = 0, RCD = 0, RCE = 0, RCF = 0, RD0 = 0, RD1 = 0, RD2 = 0, RD3 = 0, RD4 = 0, RD5 = 0, RD6 = 0, RD7 = 0, RD8 = 0, RD9 = 0, RDA = 0, RDB = 0, RDC = 0, RDD = 0, RDE = 0, RDF = 0, RE0 = 0, RE1 = 0, RE2 = 0, RE3 = 0, RE4 = 0, RE5 = 0, RE6 = 0, RE7 = 0, RE8 = 0, RE9 = 0, REA = 0, REB = 0, REC = 0, RED = 0, REE = 0, REF = 0;
14997 var HEAP = new stdlib.Uint8Array(buffer);
14998 function _expand_key_128() {
14999 var sbox = 0;
15000 R10 = R00 ^ HEAP[sbox | R0D] ^ 1;
15001 R11 = R01 ^ HEAP[sbox | R0E];
15002 R12 = R02 ^ HEAP[sbox | R0F];
15003 R13 = R03 ^ HEAP[sbox | R0C];
15004 R14 = R04 ^ R10;
15005 R15 = R05 ^ R11;
15006 R16 = R06 ^ R12;
15007 R17 = R07 ^ R13;
15008 R18 = R08 ^ R14;
15009 R19 = R09 ^ R15;
15010 R1A = R0A ^ R16;
15011 R1B = R0B ^ R17;
15012 R1C = R0C ^ R18;
15013 R1D = R0D ^ R19;
15014 R1E = R0E ^ R1A;
15015 R1F = R0F ^ R1B;
15016 R20 = R10 ^ HEAP[sbox | R1D] ^ 2;
15017 R21 = R11 ^ HEAP[sbox | R1E];
15018 R22 = R12 ^ HEAP[sbox | R1F];
15019 R23 = R13 ^ HEAP[sbox | R1C];
15020 R24 = R14 ^ R20;
15021 R25 = R15 ^ R21;
15022 R26 = R16 ^ R22;
15023 R27 = R17 ^ R23;
15024 R28 = R18 ^ R24;
15025 R29 = R19 ^ R25;
15026 R2A = R1A ^ R26;
15027 R2B = R1B ^ R27;
15028 R2C = R1C ^ R28;
15029 R2D = R1D ^ R29;
15030 R2E = R1E ^ R2A;
15031 R2F = R1F ^ R2B;
15032 R30 = R20 ^ HEAP[sbox | R2D] ^ 4;
15033 R31 = R21 ^ HEAP[sbox | R2E];
15034 R32 = R22 ^ HEAP[sbox | R2F];
15035 R33 = R23 ^ HEAP[sbox | R2C];
15036 R34 = R24 ^ R30;
15037 R35 = R25 ^ R31;
15038 R36 = R26 ^ R32;
15039 R37 = R27 ^ R33;
15040 R38 = R28 ^ R34;
15041 R39 = R29 ^ R35;
15042 R3A = R2A ^ R36;
15043 R3B = R2B ^ R37;
15044 R3C = R2C ^ R38;
15045 R3D = R2D ^ R39;
15046 R3E = R2E ^ R3A;
15047 R3F = R2F ^ R3B;
15048 R40 = R30 ^ HEAP[sbox | R3D] ^ 8;
15049 R41 = R31 ^ HEAP[sbox | R3E];
15050 R42 = R32 ^ HEAP[sbox | R3F];
15051 R43 = R33 ^ HEAP[sbox | R3C];
15052 R44 = R34 ^ R40;
15053 R45 = R35 ^ R41;
15054 R46 = R36 ^ R42;
15055 R47 = R37 ^ R43;
15056 R48 = R38 ^ R44;
15057 R49 = R39 ^ R45;
15058 R4A = R3A ^ R46;
15059 R4B = R3B ^ R47;
15060 R4C = R3C ^ R48;
15061 R4D = R3D ^ R49;
15062 R4E = R3E ^ R4A;
15063 R4F = R3F ^ R4B;
15064 R50 = R40 ^ HEAP[sbox | R4D] ^ 16;
15065 R51 = R41 ^ HEAP[sbox | R4E];
15066 R52 = R42 ^ HEAP[sbox | R4F];
15067 R53 = R43 ^ HEAP[sbox | R4C];
15068 R54 = R44 ^ R50;
15069 R55 = R45 ^ R51;
15070 R56 = R46 ^ R52;
15071 R57 = R47 ^ R53;
15072 R58 = R48 ^ R54;
15073 R59 = R49 ^ R55;
15074 R5A = R4A ^ R56;
15075 R5B = R4B ^ R57;
15076 R5C = R4C ^ R58;
15077 R5D = R4D ^ R59;
15078 R5E = R4E ^ R5A;
15079 R5F = R4F ^ R5B;
15080 R60 = R50 ^ HEAP[sbox | R5D] ^ 32;
15081 R61 = R51 ^ HEAP[sbox | R5E];
15082 R62 = R52 ^ HEAP[sbox | R5F];
15083 R63 = R53 ^ HEAP[sbox | R5C];
15084 R64 = R54 ^ R60;
15085 R65 = R55 ^ R61;
15086 R66 = R56 ^ R62;
15087 R67 = R57 ^ R63;
15088 R68 = R58 ^ R64;
15089 R69 = R59 ^ R65;
15090 R6A = R5A ^ R66;
15091 R6B = R5B ^ R67;
15092 R6C = R5C ^ R68;
15093 R6D = R5D ^ R69;
15094 R6E = R5E ^ R6A;
15095 R6F = R5F ^ R6B;
15096 R70 = R60 ^ HEAP[sbox | R6D] ^ 64;
15097 R71 = R61 ^ HEAP[sbox | R6E];
15098 R72 = R62 ^ HEAP[sbox | R6F];
15099 R73 = R63 ^ HEAP[sbox | R6C];
15100 R74 = R64 ^ R70;
15101 R75 = R65 ^ R71;
15102 R76 = R66 ^ R72;
15103 R77 = R67 ^ R73;
15104 R78 = R68 ^ R74;
15105 R79 = R69 ^ R75;
15106 R7A = R6A ^ R76;
15107 R7B = R6B ^ R77;
15108 R7C = R6C ^ R78;
15109 R7D = R6D ^ R79;
15110 R7E = R6E ^ R7A;
15111 R7F = R6F ^ R7B;
15112 R80 = R70 ^ HEAP[sbox | R7D] ^ 128;
15113 R81 = R71 ^ HEAP[sbox | R7E];
15114 R82 = R72 ^ HEAP[sbox | R7F];
15115 R83 = R73 ^ HEAP[sbox | R7C];
15116 R84 = R74 ^ R80;
15117 R85 = R75 ^ R81;
15118 R86 = R76 ^ R82;
15119 R87 = R77 ^ R83;
15120 R88 = R78 ^ R84;
15121 R89 = R79 ^ R85;
15122 R8A = R7A ^ R86;
15123 R8B = R7B ^ R87;
15124 R8C = R7C ^ R88;
15125 R8D = R7D ^ R89;
15126 R8E = R7E ^ R8A;
15127 R8F = R7F ^ R8B;
15128 R90 = R80 ^ HEAP[sbox | R8D] ^ 27;
15129 R91 = R81 ^ HEAP[sbox | R8E];
15130 R92 = R82 ^ HEAP[sbox | R8F];
15131 R93 = R83 ^ HEAP[sbox | R8C];
15132 R94 = R84 ^ R90;
15133 R95 = R85 ^ R91;
15134 R96 = R86 ^ R92;
15135 R97 = R87 ^ R93;
15136 R98 = R88 ^ R94;
15137 R99 = R89 ^ R95;
15138 R9A = R8A ^ R96;
15139 R9B = R8B ^ R97;
15140 R9C = R8C ^ R98;
15141 R9D = R8D ^ R99;
15142 R9E = R8E ^ R9A;
15143 R9F = R8F ^ R9B;
15144 RA0 = R90 ^ HEAP[sbox | R9D] ^ 54;
15145 RA1 = R91 ^ HEAP[sbox | R9E];
15146 RA2 = R92 ^ HEAP[sbox | R9F];
15147 RA3 = R93 ^ HEAP[sbox | R9C];
15148 RA4 = R94 ^ RA0;
15149 RA5 = R95 ^ RA1;
15150 RA6 = R96 ^ RA2;
15151 RA7 = R97 ^ RA3;
15152 RA8 = R98 ^ RA4;
15153 RA9 = R99 ^ RA5;
15154 RAA = R9A ^ RA6;
15155 RAB = R9B ^ RA7;
15156 RAC = R9C ^ RA8;
15157 RAD = R9D ^ RA9;
15158 RAE = R9E ^ RAA;
15159 RAF = R9F ^ RAB;
15160 }
15161 function _expand_key_256() {
15162 var sbox = 0;
15163 R20 = R00 ^ HEAP[sbox | R1D] ^ 1;
15164 R21 = R01 ^ HEAP[sbox | R1E];
15165 R22 = R02 ^ HEAP[sbox | R1F];
15166 R23 = R03 ^ HEAP[sbox | R1C];
15167 R24 = R04 ^ R20;
15168 R25 = R05 ^ R21;
15169 R26 = R06 ^ R22;
15170 R27 = R07 ^ R23;
15171 R28 = R08 ^ R24;
15172 R29 = R09 ^ R25;
15173 R2A = R0A ^ R26;
15174 R2B = R0B ^ R27;
15175 R2C = R0C ^ R28;
15176 R2D = R0D ^ R29;
15177 R2E = R0E ^ R2A;
15178 R2F = R0F ^ R2B;
15179 R30 = R10 ^ HEAP[sbox | R2C];
15180 R31 = R11 ^ HEAP[sbox | R2D];
15181 R32 = R12 ^ HEAP[sbox | R2E];
15182 R33 = R13 ^ HEAP[sbox | R2F];
15183 R34 = R14 ^ R30;
15184 R35 = R15 ^ R31;
15185 R36 = R16 ^ R32;
15186 R37 = R17 ^ R33;
15187 R38 = R18 ^ R34;
15188 R39 = R19 ^ R35;
15189 R3A = R1A ^ R36;
15190 R3B = R1B ^ R37;
15191 R3C = R1C ^ R38;
15192 R3D = R1D ^ R39;
15193 R3E = R1E ^ R3A;
15194 R3F = R1F ^ R3B;
15195 R40 = R20 ^ HEAP[sbox | R3D] ^ 2;
15196 R41 = R21 ^ HEAP[sbox | R3E];
15197 R42 = R22 ^ HEAP[sbox | R3F];
15198 R43 = R23 ^ HEAP[sbox | R3C];
15199 R44 = R24 ^ R40;
15200 R45 = R25 ^ R41;
15201 R46 = R26 ^ R42;
15202 R47 = R27 ^ R43;
15203 R48 = R28 ^ R44;
15204 R49 = R29 ^ R45;
15205 R4A = R2A ^ R46;
15206 R4B = R2B ^ R47;
15207 R4C = R2C ^ R48;
15208 R4D = R2D ^ R49;
15209 R4E = R2E ^ R4A;
15210 R4F = R2F ^ R4B;
15211 R50 = R30 ^ HEAP[sbox | R4C];
15212 R51 = R31 ^ HEAP[sbox | R4D];
15213 R52 = R32 ^ HEAP[sbox | R4E];
15214 R53 = R33 ^ HEAP[sbox | R4F];
15215 R54 = R34 ^ R50;
15216 R55 = R35 ^ R51;
15217 R56 = R36 ^ R52;
15218 R57 = R37 ^ R53;
15219 R58 = R38 ^ R54;
15220 R59 = R39 ^ R55;
15221 R5A = R3A ^ R56;
15222 R5B = R3B ^ R57;
15223 R5C = R3C ^ R58;
15224 R5D = R3D ^ R59;
15225 R5E = R3E ^ R5A;
15226 R5F = R3F ^ R5B;
15227 R60 = R40 ^ HEAP[sbox | R5D] ^ 4;
15228 R61 = R41 ^ HEAP[sbox | R5E];
15229 R62 = R42 ^ HEAP[sbox | R5F];
15230 R63 = R43 ^ HEAP[sbox | R5C];
15231 R64 = R44 ^ R60;
15232 R65 = R45 ^ R61;
15233 R66 = R46 ^ R62;
15234 R67 = R47 ^ R63;
15235 R68 = R48 ^ R64;
15236 R69 = R49 ^ R65;
15237 R6A = R4A ^ R66;
15238 R6B = R4B ^ R67;
15239 R6C = R4C ^ R68;
15240 R6D = R4D ^ R69;
15241 R6E = R4E ^ R6A;
15242 R6F = R4F ^ R6B;
15243 R70 = R50 ^ HEAP[sbox | R6C];
15244 R71 = R51 ^ HEAP[sbox | R6D];
15245 R72 = R52 ^ HEAP[sbox | R6E];
15246 R73 = R53 ^ HEAP[sbox | R6F];
15247 R74 = R54 ^ R70;
15248 R75 = R55 ^ R71;
15249 R76 = R56 ^ R72;
15250 R77 = R57 ^ R73;
15251 R78 = R58 ^ R74;
15252 R79 = R59 ^ R75;
15253 R7A = R5A ^ R76;
15254 R7B = R5B ^ R77;
15255 R7C = R5C ^ R78;
15256 R7D = R5D ^ R79;
15257 R7E = R5E ^ R7A;
15258 R7F = R5F ^ R7B;
15259 R80 = R60 ^ HEAP[sbox | R7D] ^ 8;
15260 R81 = R61 ^ HEAP[sbox | R7E];
15261 R82 = R62 ^ HEAP[sbox | R7F];
15262 R83 = R63 ^ HEAP[sbox | R7C];
15263 R84 = R64 ^ R80;
15264 R85 = R65 ^ R81;
15265 R86 = R66 ^ R82;
15266 R87 = R67 ^ R83;
15267 R88 = R68 ^ R84;
15268 R89 = R69 ^ R85;
15269 R8A = R6A ^ R86;
15270 R8B = R6B ^ R87;
15271 R8C = R6C ^ R88;
15272 R8D = R6D ^ R89;
15273 R8E = R6E ^ R8A;
15274 R8F = R6F ^ R8B;
15275 R90 = R70 ^ HEAP[sbox | R8C];
15276 R91 = R71 ^ HEAP[sbox | R8D];
15277 R92 = R72 ^ HEAP[sbox | R8E];
15278 R93 = R73 ^ HEAP[sbox | R8F];
15279 R94 = R74 ^ R90;
15280 R95 = R75 ^ R91;
15281 R96 = R76 ^ R92;
15282 R97 = R77 ^ R93;
15283 R98 = R78 ^ R94;
15284 R99 = R79 ^ R95;
15285 R9A = R7A ^ R96;
15286 R9B = R7B ^ R97;
15287 R9C = R7C ^ R98;
15288 R9D = R7D ^ R99;
15289 R9E = R7E ^ R9A;
15290 R9F = R7F ^ R9B;
15291 RA0 = R80 ^ HEAP[sbox | R9D] ^ 16;
15292 RA1 = R81 ^ HEAP[sbox | R9E];
15293 RA2 = R82 ^ HEAP[sbox | R9F];
15294 RA3 = R83 ^ HEAP[sbox | R9C];
15295 RA4 = R84 ^ RA0;
15296 RA5 = R85 ^ RA1;
15297 RA6 = R86 ^ RA2;
15298 RA7 = R87 ^ RA3;
15299 RA8 = R88 ^ RA4;
15300 RA9 = R89 ^ RA5;
15301 RAA = R8A ^ RA6;
15302 RAB = R8B ^ RA7;
15303 RAC = R8C ^ RA8;
15304 RAD = R8D ^ RA9;
15305 RAE = R8E ^ RAA;
15306 RAF = R8F ^ RAB;
15307 RB0 = R90 ^ HEAP[sbox | RAC];
15308 RB1 = R91 ^ HEAP[sbox | RAD];
15309 RB2 = R92 ^ HEAP[sbox | RAE];
15310 RB3 = R93 ^ HEAP[sbox | RAF];
15311 RB4 = R94 ^ RB0;
15312 RB5 = R95 ^ RB1;
15313 RB6 = R96 ^ RB2;
15314 RB7 = R97 ^ RB3;
15315 RB8 = R98 ^ RB4;
15316 RB9 = R99 ^ RB5;
15317 RBA = R9A ^ RB6;
15318 RBB = R9B ^ RB7;
15319 RBC = R9C ^ RB8;
15320 RBD = R9D ^ RB9;
15321 RBE = R9E ^ RBA;
15322 RBF = R9F ^ RBB;
15323 RC0 = RA0 ^ HEAP[sbox | RBD] ^ 32;
15324 RC1 = RA1 ^ HEAP[sbox | RBE];
15325 RC2 = RA2 ^ HEAP[sbox | RBF];
15326 RC3 = RA3 ^ HEAP[sbox | RBC];
15327 RC4 = RA4 ^ RC0;
15328 RC5 = RA5 ^ RC1;
15329 RC6 = RA6 ^ RC2;
15330 RC7 = RA7 ^ RC3;
15331 RC8 = RA8 ^ RC4;
15332 RC9 = RA9 ^ RC5;
15333 RCA = RAA ^ RC6;
15334 RCB = RAB ^ RC7;
15335 RCC = RAC ^ RC8;
15336 RCD = RAD ^ RC9;
15337 RCE = RAE ^ RCA;
15338 RCF = RAF ^ RCB;
15339 RD0 = RB0 ^ HEAP[sbox | RCC];
15340 RD1 = RB1 ^ HEAP[sbox | RCD];
15341 RD2 = RB2 ^ HEAP[sbox | RCE];
15342 RD3 = RB3 ^ HEAP[sbox | RCF];
15343 RD4 = RB4 ^ RD0;
15344 RD5 = RB5 ^ RD1;
15345 RD6 = RB6 ^ RD2;
15346 RD7 = RB7 ^ RD3;
15347 RD8 = RB8 ^ RD4;
15348 RD9 = RB9 ^ RD5;
15349 RDA = RBA ^ RD6;
15350 RDB = RBB ^ RD7;
15351 RDC = RBC ^ RD8;
15352 RDD = RBD ^ RD9;
15353 RDE = RBE ^ RDA;
15354 RDF = RBF ^ RDB;
15355 RE0 = RC0 ^ HEAP[sbox | RDD] ^ 64;
15356 RE1 = RC1 ^ HEAP[sbox | RDE];
15357 RE2 = RC2 ^ HEAP[sbox | RDF];
15358 RE3 = RC3 ^ HEAP[sbox | RDC];
15359 RE4 = RC4 ^ RE0;
15360 RE5 = RC5 ^ RE1;
15361 RE6 = RC6 ^ RE2;
15362 RE7 = RC7 ^ RE3;
15363 RE8 = RC8 ^ RE4;
15364 RE9 = RC9 ^ RE5;
15365 REA = RCA ^ RE6;
15366 REB = RCB ^ RE7;
15367 REC = RCC ^ RE8;
15368 RED = RCD ^ RE9;
15369 REE = RCE ^ REA;
15370 REF = RCF ^ REB;
15371 }
15372 function _encrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15373 s0 = s0 | 0;
15374 s1 = s1 | 0;
15375 s2 = s2 | 0;
15376 s3 = s3 | 0;
15377 s4 = s4 | 0;
15378 s5 = s5 | 0;
15379 s6 = s6 | 0;
15380 s7 = s7 | 0;
15381 s8 = s8 | 0;
15382 s9 = s9 | 0;
15383 sA = sA | 0;
15384 sB = sB | 0;
15385 sC = sC | 0;
15386 sD = sD | 0;
15387 sE = sE | 0;
15388 sF = sF | 0;
15389 var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, tA = 0, tB = 0, tC = 0, tD = 0, tE = 0, tF = 0, sbox = 0, x2_sbox = 512, x3_sbox = 768;
15390 s0 = s0 ^ R00;
15391 s1 = s1 ^ R01;
15392 s2 = s2 ^ R02;
15393 s3 = s3 ^ R03;
15394 s4 = s4 ^ R04;
15395 s5 = s5 ^ R05;
15396 s6 = s6 ^ R06;
15397 s7 = s7 ^ R07;
15398 s8 = s8 ^ R08;
15399 s9 = s9 ^ R09;
15400 sA = sA ^ R0A;
15401 sB = sB ^ R0B;
15402 sC = sC ^ R0C;
15403 sD = sD ^ R0D;
15404 sE = sE ^ R0E;
15405 sF = sF ^ R0F;
15406 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R10;
15407 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R11;
15408 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R12;
15409 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R13;
15410 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R14;
15411 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R15;
15412 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R16;
15413 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R17;
15414 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R18;
15415 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R19;
15416 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R1A;
15417 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R1B;
15418 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R1C;
15419 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R1D;
15420 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R1E;
15421 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R1F;
15422 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R20;
15423 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R21;
15424 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R22;
15425 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R23;
15426 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R24;
15427 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R25;
15428 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R26;
15429 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R27;
15430 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R28;
15431 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R29;
15432 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R2A;
15433 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R2B;
15434 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R2C;
15435 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R2D;
15436 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R2E;
15437 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R2F;
15438 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R30;
15439 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R31;
15440 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R32;
15441 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R33;
15442 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R34;
15443 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R35;
15444 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R36;
15445 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R37;
15446 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R38;
15447 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R39;
15448 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R3A;
15449 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R3B;
15450 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R3C;
15451 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R3D;
15452 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R3E;
15453 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R3F;
15454 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R40;
15455 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R41;
15456 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R42;
15457 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R43;
15458 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R44;
15459 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R45;
15460 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R46;
15461 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R47;
15462 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R48;
15463 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R49;
15464 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R4A;
15465 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R4B;
15466 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R4C;
15467 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R4D;
15468 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R4E;
15469 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R4F;
15470 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R50;
15471 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R51;
15472 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R52;
15473 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R53;
15474 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R54;
15475 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R55;
15476 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R56;
15477 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R57;
15478 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R58;
15479 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R59;
15480 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R5A;
15481 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R5B;
15482 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R5C;
15483 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R5D;
15484 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R5E;
15485 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R5F;
15486 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R60;
15487 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R61;
15488 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R62;
15489 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R63;
15490 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R64;
15491 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R65;
15492 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R66;
15493 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R67;
15494 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R68;
15495 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R69;
15496 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R6A;
15497 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R6B;
15498 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R6C;
15499 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R6D;
15500 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R6E;
15501 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R6F;
15502 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R70;
15503 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R71;
15504 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R72;
15505 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R73;
15506 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R74;
15507 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R75;
15508 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R76;
15509 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R77;
15510 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R78;
15511 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R79;
15512 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R7A;
15513 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R7B;
15514 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R7C;
15515 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R7D;
15516 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R7E;
15517 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R7F;
15518 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R80;
15519 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R81;
15520 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R82;
15521 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R83;
15522 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R84;
15523 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R85;
15524 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R86;
15525 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R87;
15526 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R88;
15527 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R89;
15528 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R8A;
15529 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R8B;
15530 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R8C;
15531 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R8D;
15532 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R8E;
15533 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R8F;
15534 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R90;
15535 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R91;
15536 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R92;
15537 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R93;
15538 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R94;
15539 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R95;
15540 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R96;
15541 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R97;
15542 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R98;
15543 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R99;
15544 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R9A;
15545 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R9B;
15546 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R9C;
15547 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R9D;
15548 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R9E;
15549 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R9F;
15550 if ((keySize | 0) == 16) {
15551 S0 = HEAP[sbox | t0] ^ RA0;
15552 S1 = HEAP[sbox | t5] ^ RA1;
15553 S2 = HEAP[sbox | tA] ^ RA2;
15554 S3 = HEAP[sbox | tF] ^ RA3;
15555 S4 = HEAP[sbox | t4] ^ RA4;
15556 S5 = HEAP[sbox | t9] ^ RA5;
15557 S6 = HEAP[sbox | tE] ^ RA6;
15558 S7 = HEAP[sbox | t3] ^ RA7;
15559 S8 = HEAP[sbox | t8] ^ RA8;
15560 S9 = HEAP[sbox | tD] ^ RA9;
15561 SA = HEAP[sbox | t2] ^ RAA;
15562 SB = HEAP[sbox | t7] ^ RAB;
15563 SC = HEAP[sbox | tC] ^ RAC;
15564 SD = HEAP[sbox | t1] ^ RAD;
15565 SE = HEAP[sbox | t6] ^ RAE;
15566 SF = HEAP[sbox | tB] ^ RAF;
15567 return;
15568 }
15569 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RA0;
15570 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RA1;
15571 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RA2;
15572 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RA3;
15573 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RA4;
15574 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RA5;
15575 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RA6;
15576 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RA7;
15577 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RA8;
15578 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RA9;
15579 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RAA;
15580 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RAB;
15581 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RAC;
15582 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RAD;
15583 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RAE;
15584 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RAF;
15585 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RB0;
15586 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RB1;
15587 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RB2;
15588 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RB3;
15589 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RB4;
15590 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RB5;
15591 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RB6;
15592 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RB7;
15593 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RB8;
15594 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RB9;
15595 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RBA;
15596 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RBB;
15597 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RBC;
15598 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RBD;
15599 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RBE;
15600 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RBF;
15601 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RC0;
15602 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RC1;
15603 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RC2;
15604 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RC3;
15605 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RC4;
15606 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RC5;
15607 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RC6;
15608 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RC7;
15609 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RC8;
15610 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RC9;
15611 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RCA;
15612 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RCB;
15613 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RCC;
15614 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RCD;
15615 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RCE;
15616 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RCF;
15617 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RD0;
15618 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RD1;
15619 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RD2;
15620 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RD3;
15621 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RD4;
15622 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RD5;
15623 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RD6;
15624 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RD7;
15625 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RD8;
15626 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RD9;
15627 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RDA;
15628 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RDB;
15629 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RDC;
15630 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RDD;
15631 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RDE;
15632 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RDF;
15633 S0 = HEAP[sbox | t0] ^ RE0;
15634 S1 = HEAP[sbox | t5] ^ RE1;
15635 S2 = HEAP[sbox | tA] ^ RE2;
15636 S3 = HEAP[sbox | tF] ^ RE3;
15637 S4 = HEAP[sbox | t4] ^ RE4;
15638 S5 = HEAP[sbox | t9] ^ RE5;
15639 S6 = HEAP[sbox | tE] ^ RE6;
15640 S7 = HEAP[sbox | t3] ^ RE7;
15641 S8 = HEAP[sbox | t8] ^ RE8;
15642 S9 = HEAP[sbox | tD] ^ RE9;
15643 SA = HEAP[sbox | t2] ^ REA;
15644 SB = HEAP[sbox | t7] ^ REB;
15645 SC = HEAP[sbox | tC] ^ REC;
15646 SD = HEAP[sbox | t1] ^ RED;
15647 SE = HEAP[sbox | t6] ^ REE;
15648 SF = HEAP[sbox | tB] ^ REF;
15649 }
15650 function _decrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15651 s0 = s0 | 0;
15652 s1 = s1 | 0;
15653 s2 = s2 | 0;
15654 s3 = s3 | 0;
15655 s4 = s4 | 0;
15656 s5 = s5 | 0;
15657 s6 = s6 | 0;
15658 s7 = s7 | 0;
15659 s8 = s8 | 0;
15660 s9 = s9 | 0;
15661 sA = sA | 0;
15662 sB = sB | 0;
15663 sC = sC | 0;
15664 sD = sD | 0;
15665 sE = sE | 0;
15666 sF = sF | 0;
15667 var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, t8 = 0, t9 = 0, tA = 0, tB = 0, tC = 0, tD = 0, tE = 0, tF = 0, inv_sbox = 256, x9 = 1024, xB = 1280, xD = 1536, xE = 1792;
15668 if ((keySize | 0) == 32) {
15669 t0 = HEAP[inv_sbox | s0 ^ RE0] ^ RD0;
15670 t1 = HEAP[inv_sbox | sD ^ RED] ^ RD1;
15671 t2 = HEAP[inv_sbox | sA ^ REA] ^ RD2;
15672 t3 = HEAP[inv_sbox | s7 ^ RE7] ^ RD3;
15673 t4 = HEAP[inv_sbox | s4 ^ RE4] ^ RD4;
15674 t5 = HEAP[inv_sbox | s1 ^ RE1] ^ RD5;
15675 t6 = HEAP[inv_sbox | sE ^ REE] ^ RD6;
15676 t7 = HEAP[inv_sbox | sB ^ REB] ^ RD7;
15677 t8 = HEAP[inv_sbox | s8 ^ RE8] ^ RD8;
15678 t9 = HEAP[inv_sbox | s5 ^ RE5] ^ RD9;
15679 tA = HEAP[inv_sbox | s2 ^ RE2] ^ RDA;
15680 tB = HEAP[inv_sbox | sF ^ REF] ^ RDB;
15681 tC = HEAP[inv_sbox | sC ^ REC] ^ RDC;
15682 tD = HEAP[inv_sbox | s9 ^ RE9] ^ RDD;
15683 tE = HEAP[inv_sbox | s6 ^ RE6] ^ RDE;
15684 tF = HEAP[inv_sbox | s3 ^ RE3] ^ RDF;
15685 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15686 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15687 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15688 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15689 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15690 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15691 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15692 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15693 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15694 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15695 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15696 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15697 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15698 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15699 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15700 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15701 t0 = HEAP[inv_sbox | s0] ^ RC0;
15702 t1 = HEAP[inv_sbox | s1] ^ RC1;
15703 t2 = HEAP[inv_sbox | s2] ^ RC2;
15704 t3 = HEAP[inv_sbox | s3] ^ RC3;
15705 t4 = HEAP[inv_sbox | s4] ^ RC4;
15706 t5 = HEAP[inv_sbox | s5] ^ RC5;
15707 t6 = HEAP[inv_sbox | s6] ^ RC6;
15708 t7 = HEAP[inv_sbox | s7] ^ RC7;
15709 t8 = HEAP[inv_sbox | s8] ^ RC8;
15710 t9 = HEAP[inv_sbox | s9] ^ RC9;
15711 tA = HEAP[inv_sbox | sA] ^ RCA;
15712 tB = HEAP[inv_sbox | sB] ^ RCB;
15713 tC = HEAP[inv_sbox | sC] ^ RCC;
15714 tD = HEAP[inv_sbox | sD] ^ RCD;
15715 tE = HEAP[inv_sbox | sE] ^ RCE;
15716 tF = HEAP[inv_sbox | sF] ^ RCF;
15717 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15718 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15719 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15720 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15721 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15722 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15723 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15724 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15725 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15726 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15727 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15728 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15729 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15730 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15731 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15732 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15733 t0 = HEAP[inv_sbox | s0] ^ RB0;
15734 t1 = HEAP[inv_sbox | s1] ^ RB1;
15735 t2 = HEAP[inv_sbox | s2] ^ RB2;
15736 t3 = HEAP[inv_sbox | s3] ^ RB3;
15737 t4 = HEAP[inv_sbox | s4] ^ RB4;
15738 t5 = HEAP[inv_sbox | s5] ^ RB5;
15739 t6 = HEAP[inv_sbox | s6] ^ RB6;
15740 t7 = HEAP[inv_sbox | s7] ^ RB7;
15741 t8 = HEAP[inv_sbox | s8] ^ RB8;
15742 t9 = HEAP[inv_sbox | s9] ^ RB9;
15743 tA = HEAP[inv_sbox | sA] ^ RBA;
15744 tB = HEAP[inv_sbox | sB] ^ RBB;
15745 tC = HEAP[inv_sbox | sC] ^ RBC;
15746 tD = HEAP[inv_sbox | sD] ^ RBD;
15747 tE = HEAP[inv_sbox | sE] ^ RBE;
15748 tF = HEAP[inv_sbox | sF] ^ RBF;
15749 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15750 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15751 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15752 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15753 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15754 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15755 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15756 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15757 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15758 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15759 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15760 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15761 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15762 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15763 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15764 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15765 t0 = HEAP[inv_sbox | s0] ^ RA0;
15766 t1 = HEAP[inv_sbox | s1] ^ RA1;
15767 t2 = HEAP[inv_sbox | s2] ^ RA2;
15768 t3 = HEAP[inv_sbox | s3] ^ RA3;
15769 t4 = HEAP[inv_sbox | s4] ^ RA4;
15770 t5 = HEAP[inv_sbox | s5] ^ RA5;
15771 t6 = HEAP[inv_sbox | s6] ^ RA6;
15772 t7 = HEAP[inv_sbox | s7] ^ RA7;
15773 t8 = HEAP[inv_sbox | s8] ^ RA8;
15774 t9 = HEAP[inv_sbox | s9] ^ RA9;
15775 tA = HEAP[inv_sbox | sA] ^ RAA;
15776 tB = HEAP[inv_sbox | sB] ^ RAB;
15777 tC = HEAP[inv_sbox | sC] ^ RAC;
15778 tD = HEAP[inv_sbox | sD] ^ RAD;
15779 tE = HEAP[inv_sbox | sE] ^ RAE;
15780 tF = HEAP[inv_sbox | sF] ^ RAF;
15781 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15782 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15783 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15784 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15785 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15786 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15787 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15788 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15789 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15790 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15791 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15792 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15793 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15794 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15795 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15796 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15797 t0 = HEAP[inv_sbox | s0] ^ R90;
15798 t1 = HEAP[inv_sbox | s1] ^ R91;
15799 t2 = HEAP[inv_sbox | s2] ^ R92;
15800 t3 = HEAP[inv_sbox | s3] ^ R93;
15801 t4 = HEAP[inv_sbox | s4] ^ R94;
15802 t5 = HEAP[inv_sbox | s5] ^ R95;
15803 t6 = HEAP[inv_sbox | s6] ^ R96;
15804 t7 = HEAP[inv_sbox | s7] ^ R97;
15805 t8 = HEAP[inv_sbox | s8] ^ R98;
15806 t9 = HEAP[inv_sbox | s9] ^ R99;
15807 tA = HEAP[inv_sbox | sA] ^ R9A;
15808 tB = HEAP[inv_sbox | sB] ^ R9B;
15809 tC = HEAP[inv_sbox | sC] ^ R9C;
15810 tD = HEAP[inv_sbox | sD] ^ R9D;
15811 tE = HEAP[inv_sbox | sE] ^ R9E;
15812 tF = HEAP[inv_sbox | sF] ^ R9F;
15813 } else {
15814 t0 = HEAP[inv_sbox | s0 ^ RA0] ^ R90;
15815 t1 = HEAP[inv_sbox | sD ^ RAD] ^ R91;
15816 t2 = HEAP[inv_sbox | sA ^ RAA] ^ R92;
15817 t3 = HEAP[inv_sbox | s7 ^ RA7] ^ R93;
15818 t4 = HEAP[inv_sbox | s4 ^ RA4] ^ R94;
15819 t5 = HEAP[inv_sbox | s1 ^ RA1] ^ R95;
15820 t6 = HEAP[inv_sbox | sE ^ RAE] ^ R96;
15821 t7 = HEAP[inv_sbox | sB ^ RAB] ^ R97;
15822 t8 = HEAP[inv_sbox | s8 ^ RA8] ^ R98;
15823 t9 = HEAP[inv_sbox | s5 ^ RA5] ^ R99;
15824 tA = HEAP[inv_sbox | s2 ^ RA2] ^ R9A;
15825 tB = HEAP[inv_sbox | sF ^ RAF] ^ R9B;
15826 tC = HEAP[inv_sbox | sC ^ RAC] ^ R9C;
15827 tD = HEAP[inv_sbox | s9 ^ RA9] ^ R9D;
15828 tE = HEAP[inv_sbox | s6 ^ RA6] ^ R9E;
15829 tF = HEAP[inv_sbox | s3 ^ RA3] ^ R9F;
15830 }
15831 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15832 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15833 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15834 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15835 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15836 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15837 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15838 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15839 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15840 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15841 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15842 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15843 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15844 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15845 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15846 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15847 t0 = HEAP[inv_sbox | s0] ^ R80;
15848 t1 = HEAP[inv_sbox | s1] ^ R81;
15849 t2 = HEAP[inv_sbox | s2] ^ R82;
15850 t3 = HEAP[inv_sbox | s3] ^ R83;
15851 t4 = HEAP[inv_sbox | s4] ^ R84;
15852 t5 = HEAP[inv_sbox | s5] ^ R85;
15853 t6 = HEAP[inv_sbox | s6] ^ R86;
15854 t7 = HEAP[inv_sbox | s7] ^ R87;
15855 t8 = HEAP[inv_sbox | s8] ^ R88;
15856 t9 = HEAP[inv_sbox | s9] ^ R89;
15857 tA = HEAP[inv_sbox | sA] ^ R8A;
15858 tB = HEAP[inv_sbox | sB] ^ R8B;
15859 tC = HEAP[inv_sbox | sC] ^ R8C;
15860 tD = HEAP[inv_sbox | sD] ^ R8D;
15861 tE = HEAP[inv_sbox | sE] ^ R8E;
15862 tF = HEAP[inv_sbox | sF] ^ R8F;
15863 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15864 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15865 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15866 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15867 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15868 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15869 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15870 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15871 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15872 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15873 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15874 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15875 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15876 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15877 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15878 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15879 t0 = HEAP[inv_sbox | s0] ^ R70;
15880 t1 = HEAP[inv_sbox | s1] ^ R71;
15881 t2 = HEAP[inv_sbox | s2] ^ R72;
15882 t3 = HEAP[inv_sbox | s3] ^ R73;
15883 t4 = HEAP[inv_sbox | s4] ^ R74;
15884 t5 = HEAP[inv_sbox | s5] ^ R75;
15885 t6 = HEAP[inv_sbox | s6] ^ R76;
15886 t7 = HEAP[inv_sbox | s7] ^ R77;
15887 t8 = HEAP[inv_sbox | s8] ^ R78;
15888 t9 = HEAP[inv_sbox | s9] ^ R79;
15889 tA = HEAP[inv_sbox | sA] ^ R7A;
15890 tB = HEAP[inv_sbox | sB] ^ R7B;
15891 tC = HEAP[inv_sbox | sC] ^ R7C;
15892 tD = HEAP[inv_sbox | sD] ^ R7D;
15893 tE = HEAP[inv_sbox | sE] ^ R7E;
15894 tF = HEAP[inv_sbox | sF] ^ R7F;
15895 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15896 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15897 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15898 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15899 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15900 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15901 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15902 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15903 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15904 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15905 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15906 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15907 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15908 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15909 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15910 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15911 t0 = HEAP[inv_sbox | s0] ^ R60;
15912 t1 = HEAP[inv_sbox | s1] ^ R61;
15913 t2 = HEAP[inv_sbox | s2] ^ R62;
15914 t3 = HEAP[inv_sbox | s3] ^ R63;
15915 t4 = HEAP[inv_sbox | s4] ^ R64;
15916 t5 = HEAP[inv_sbox | s5] ^ R65;
15917 t6 = HEAP[inv_sbox | s6] ^ R66;
15918 t7 = HEAP[inv_sbox | s7] ^ R67;
15919 t8 = HEAP[inv_sbox | s8] ^ R68;
15920 t9 = HEAP[inv_sbox | s9] ^ R69;
15921 tA = HEAP[inv_sbox | sA] ^ R6A;
15922 tB = HEAP[inv_sbox | sB] ^ R6B;
15923 tC = HEAP[inv_sbox | sC] ^ R6C;
15924 tD = HEAP[inv_sbox | sD] ^ R6D;
15925 tE = HEAP[inv_sbox | sE] ^ R6E;
15926 tF = HEAP[inv_sbox | sF] ^ R6F;
15927 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15928 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15929 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15930 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15931 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15932 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15933 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15934 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15935 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15936 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15937 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15938 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15939 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15940 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15941 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15942 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15943 t0 = HEAP[inv_sbox | s0] ^ R50;
15944 t1 = HEAP[inv_sbox | s1] ^ R51;
15945 t2 = HEAP[inv_sbox | s2] ^ R52;
15946 t3 = HEAP[inv_sbox | s3] ^ R53;
15947 t4 = HEAP[inv_sbox | s4] ^ R54;
15948 t5 = HEAP[inv_sbox | s5] ^ R55;
15949 t6 = HEAP[inv_sbox | s6] ^ R56;
15950 t7 = HEAP[inv_sbox | s7] ^ R57;
15951 t8 = HEAP[inv_sbox | s8] ^ R58;
15952 t9 = HEAP[inv_sbox | s9] ^ R59;
15953 tA = HEAP[inv_sbox | sA] ^ R5A;
15954 tB = HEAP[inv_sbox | sB] ^ R5B;
15955 tC = HEAP[inv_sbox | sC] ^ R5C;
15956 tD = HEAP[inv_sbox | sD] ^ R5D;
15957 tE = HEAP[inv_sbox | sE] ^ R5E;
15958 tF = HEAP[inv_sbox | sF] ^ R5F;
15959 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15960 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15961 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15962 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15963 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15964 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15965 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15966 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15967 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15968 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15969 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15970 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15971 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15972 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15973 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15974 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15975 t0 = HEAP[inv_sbox | s0] ^ R40;
15976 t1 = HEAP[inv_sbox | s1] ^ R41;
15977 t2 = HEAP[inv_sbox | s2] ^ R42;
15978 t3 = HEAP[inv_sbox | s3] ^ R43;
15979 t4 = HEAP[inv_sbox | s4] ^ R44;
15980 t5 = HEAP[inv_sbox | s5] ^ R45;
15981 t6 = HEAP[inv_sbox | s6] ^ R46;
15982 t7 = HEAP[inv_sbox | s7] ^ R47;
15983 t8 = HEAP[inv_sbox | s8] ^ R48;
15984 t9 = HEAP[inv_sbox | s9] ^ R49;
15985 tA = HEAP[inv_sbox | sA] ^ R4A;
15986 tB = HEAP[inv_sbox | sB] ^ R4B;
15987 tC = HEAP[inv_sbox | sC] ^ R4C;
15988 tD = HEAP[inv_sbox | sD] ^ R4D;
15989 tE = HEAP[inv_sbox | sE] ^ R4E;
15990 tF = HEAP[inv_sbox | sF] ^ R4F;
15991 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15992 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15993 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15994 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15995 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15996 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15997 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15998 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15999 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16000 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16001 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16002 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16003 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16004 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16005 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16006 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16007 t0 = HEAP[inv_sbox | s0] ^ R30;
16008 t1 = HEAP[inv_sbox | s1] ^ R31;
16009 t2 = HEAP[inv_sbox | s2] ^ R32;
16010 t3 = HEAP[inv_sbox | s3] ^ R33;
16011 t4 = HEAP[inv_sbox | s4] ^ R34;
16012 t5 = HEAP[inv_sbox | s5] ^ R35;
16013 t6 = HEAP[inv_sbox | s6] ^ R36;
16014 t7 = HEAP[inv_sbox | s7] ^ R37;
16015 t8 = HEAP[inv_sbox | s8] ^ R38;
16016 t9 = HEAP[inv_sbox | s9] ^ R39;
16017 tA = HEAP[inv_sbox | sA] ^ R3A;
16018 tB = HEAP[inv_sbox | sB] ^ R3B;
16019 tC = HEAP[inv_sbox | sC] ^ R3C;
16020 tD = HEAP[inv_sbox | sD] ^ R3D;
16021 tE = HEAP[inv_sbox | sE] ^ R3E;
16022 tF = HEAP[inv_sbox | sF] ^ R3F;
16023 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16024 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16025 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16026 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16027 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16028 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16029 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16030 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16031 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16032 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16033 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16034 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16035 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16036 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16037 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16038 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16039 t0 = HEAP[inv_sbox | s0] ^ R20;
16040 t1 = HEAP[inv_sbox | s1] ^ R21;
16041 t2 = HEAP[inv_sbox | s2] ^ R22;
16042 t3 = HEAP[inv_sbox | s3] ^ R23;
16043 t4 = HEAP[inv_sbox | s4] ^ R24;
16044 t5 = HEAP[inv_sbox | s5] ^ R25;
16045 t6 = HEAP[inv_sbox | s6] ^ R26;
16046 t7 = HEAP[inv_sbox | s7] ^ R27;
16047 t8 = HEAP[inv_sbox | s8] ^ R28;
16048 t9 = HEAP[inv_sbox | s9] ^ R29;
16049 tA = HEAP[inv_sbox | sA] ^ R2A;
16050 tB = HEAP[inv_sbox | sB] ^ R2B;
16051 tC = HEAP[inv_sbox | sC] ^ R2C;
16052 tD = HEAP[inv_sbox | sD] ^ R2D;
16053 tE = HEAP[inv_sbox | sE] ^ R2E;
16054 tF = HEAP[inv_sbox | sF] ^ R2F;
16055 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16056 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16057 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16058 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16059 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16060 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16061 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16062 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16063 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16064 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16065 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16066 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16067 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16068 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16069 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16070 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16071 t0 = HEAP[inv_sbox | s0] ^ R10;
16072 t1 = HEAP[inv_sbox | s1] ^ R11;
16073 t2 = HEAP[inv_sbox | s2] ^ R12;
16074 t3 = HEAP[inv_sbox | s3] ^ R13;
16075 t4 = HEAP[inv_sbox | s4] ^ R14;
16076 t5 = HEAP[inv_sbox | s5] ^ R15;
16077 t6 = HEAP[inv_sbox | s6] ^ R16;
16078 t7 = HEAP[inv_sbox | s7] ^ R17;
16079 t8 = HEAP[inv_sbox | s8] ^ R18;
16080 t9 = HEAP[inv_sbox | s9] ^ R19;
16081 tA = HEAP[inv_sbox | sA] ^ R1A;
16082 tB = HEAP[inv_sbox | sB] ^ R1B;
16083 tC = HEAP[inv_sbox | sC] ^ R1C;
16084 tD = HEAP[inv_sbox | sD] ^ R1D;
16085 tE = HEAP[inv_sbox | sE] ^ R1E;
16086 tF = HEAP[inv_sbox | sF] ^ R1F;
16087 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16088 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16089 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16090 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16091 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16092 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16093 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16094 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16095 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16096 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16097 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16098 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16099 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16100 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16101 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16102 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16103 S0 = HEAP[inv_sbox | s0] ^ R00;
16104 S1 = HEAP[inv_sbox | s1] ^ R01;
16105 S2 = HEAP[inv_sbox | s2] ^ R02;
16106 S3 = HEAP[inv_sbox | s3] ^ R03;
16107 S4 = HEAP[inv_sbox | s4] ^ R04;
16108 S5 = HEAP[inv_sbox | s5] ^ R05;
16109 S6 = HEAP[inv_sbox | s6] ^ R06;
16110 S7 = HEAP[inv_sbox | s7] ^ R07;
16111 S8 = HEAP[inv_sbox | s8] ^ R08;
16112 S9 = HEAP[inv_sbox | s9] ^ R09;
16113 SA = HEAP[inv_sbox | sA] ^ R0A;
16114 SB = HEAP[inv_sbox | sB] ^ R0B;
16115 SC = HEAP[inv_sbox | sC] ^ R0C;
16116 SD = HEAP[inv_sbox | sD] ^ R0D;
16117 SE = HEAP[inv_sbox | sE] ^ R0E;
16118 SF = HEAP[inv_sbox | sF] ^ R0F;
16119 }
16120 function init_state(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
16121 s0 = s0 | 0;
16122 s1 = s1 | 0;
16123 s2 = s2 | 0;
16124 s3 = s3 | 0;
16125 s4 = s4 | 0;
16126 s5 = s5 | 0;
16127 s6 = s6 | 0;
16128 s7 = s7 | 0;
16129 s8 = s8 | 0;
16130 s9 = s9 | 0;
16131 sA = sA | 0;
16132 sB = sB | 0;
16133 sC = sC | 0;
16134 sD = sD | 0;
16135 sE = sE | 0;
16136 sF = sF | 0;
16137 S0 = s0;
16138 S1 = s1;
16139 S2 = s2;
16140 S3 = s3;
16141 S4 = s4;
16142 S5 = s5;
16143 S6 = s6;
16144 S7 = s7;
16145 S8 = s8;
16146 S9 = s9;
16147 SA = sA;
16148 SB = sB;
16149 SC = sC;
16150 SD = sD;
16151 SE = sE;
16152 SF = sF;
16153 }
16154 function save_state(offset) {
16155 offset = offset | 0;
16156 HEAP[offset] = S0;
16157 HEAP[offset | 1] = S1;
16158 HEAP[offset | 2] = S2;
16159 HEAP[offset | 3] = S3;
16160 HEAP[offset | 4] = S4;
16161 HEAP[offset | 5] = S5;
16162 HEAP[offset | 6] = S6;
16163 HEAP[offset | 7] = S7;
16164 HEAP[offset | 8] = S8;
16165 HEAP[offset | 9] = S9;
16166 HEAP[offset | 10] = SA;
16167 HEAP[offset | 11] = SB;
16168 HEAP[offset | 12] = SC;
16169 HEAP[offset | 13] = SD;
16170 HEAP[offset | 14] = SE;
16171 HEAP[offset | 15] = SF;
16172 }
16173 function init_key_128(k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, kA, kB, kC, kD, kE, kF) {
16174 k0 = k0 | 0;
16175 k1 = k1 | 0;
16176 k2 = k2 | 0;
16177 k3 = k3 | 0;
16178 k4 = k4 | 0;
16179 k5 = k5 | 0;
16180 k6 = k6 | 0;
16181 k7 = k7 | 0;
16182 k8 = k8 | 0;
16183 k9 = k9 | 0;
16184 kA = kA | 0;
16185 kB = kB | 0;
16186 kC = kC | 0;
16187 kD = kD | 0;
16188 kE = kE | 0;
16189 kF = kF | 0;
16190 R00 = k0;
16191 R01 = k1;
16192 R02 = k2;
16193 R03 = k3;
16194 R04 = k4;
16195 R05 = k5;
16196 R06 = k6;
16197 R07 = k7;
16198 R08 = k8;
16199 R09 = k9;
16200 R0A = kA;
16201 R0B = kB;
16202 R0C = kC;
16203 R0D = kD;
16204 R0E = kE;
16205 R0F = kF;
16206 keySize = 16;
16207 _expand_key_128();
16208 }
16209 function init_key_256(k00, k01, k02, k03, k04, k05, k06, k07, k08, k09, k0A, k0B, k0C, k0D, k0E, k0F, k10, k11, k12, k13, k14, k15, k16, k17, k18, k19, k1A, k1B, k1C, k1D, k1E, k1F) {
16210 k00 = k00 | 0;
16211 k01 = k01 | 0;
16212 k02 = k02 | 0;
16213 k03 = k03 | 0;
16214 k04 = k04 | 0;
16215 k05 = k05 | 0;
16216 k06 = k06 | 0;
16217 k07 = k07 | 0;
16218 k08 = k08 | 0;
16219 k09 = k09 | 0;
16220 k0A = k0A | 0;
16221 k0B = k0B | 0;
16222 k0C = k0C | 0;
16223 k0D = k0D | 0;
16224 k0E = k0E | 0;
16225 k0F = k0F | 0;
16226 k10 = k10 | 0;
16227 k11 = k11 | 0;
16228 k12 = k12 | 0;
16229 k13 = k13 | 0;
16230 k14 = k14 | 0;
16231 k15 = k15 | 0;
16232 k16 = k16 | 0;
16233 k17 = k17 | 0;
16234 k18 = k18 | 0;
16235 k19 = k19 | 0;
16236 k1A = k1A | 0;
16237 k1B = k1B | 0;
16238 k1C = k1C | 0;
16239 k1D = k1D | 0;
16240 k1E = k1E | 0;
16241 k1F = k1F | 0;
16242 R00 = k00;
16243 R01 = k01;
16244 R02 = k02;
16245 R03 = k03;
16246 R04 = k04;
16247 R05 = k05;
16248 R06 = k06;
16249 R07 = k07;
16250 R08 = k08;
16251 R09 = k09;
16252 R0A = k0A;
16253 R0B = k0B;
16254 R0C = k0C;
16255 R0D = k0D;
16256 R0E = k0E;
16257 R0F = k0F;
16258 R10 = k10;
16259 R11 = k11;
16260 R12 = k12;
16261 R13 = k13;
16262 R14 = k14;
16263 R15 = k15;
16264 R16 = k16;
16265 R17 = k17;
16266 R18 = k18;
16267 R19 = k19;
16268 R1A = k1A;
16269 R1B = k1B;
16270 R1C = k1C;
16271 R1D = k1D;
16272 R1E = k1E;
16273 R1F = k1F;
16274 keySize = 32;
16275 _expand_key_256();
16276 }
16277 function cbc_encrypt(offset, length) {
16278 offset = offset | 0;
16279 length = length | 0;
16280 var encrypted = 0;
16281 if (offset & 15) return -1;
16282 while ((length | 0) >= 16) {
16283 _encrypt(S0 ^ HEAP[offset], S1 ^ HEAP[offset | 1], S2 ^ HEAP[offset | 2], S3 ^ HEAP[offset | 3], S4 ^ HEAP[offset | 4], S5 ^ HEAP[offset | 5], S6 ^ HEAP[offset | 6], S7 ^ HEAP[offset | 7], S8 ^ HEAP[offset | 8], S9 ^ HEAP[offset | 9], SA ^ HEAP[offset | 10], SB ^ HEAP[offset | 11], SC ^ HEAP[offset | 12], SD ^ HEAP[offset | 13], SE ^ HEAP[offset | 14], SF ^ HEAP[offset | 15]);
16284 HEAP[offset] = S0;
16285 HEAP[offset | 1] = S1;
16286 HEAP[offset | 2] = S2;
16287 HEAP[offset | 3] = S3;
16288 HEAP[offset | 4] = S4;
16289 HEAP[offset | 5] = S5;
16290 HEAP[offset | 6] = S6;
16291 HEAP[offset | 7] = S7;
16292 HEAP[offset | 8] = S8;
16293 HEAP[offset | 9] = S9;
16294 HEAP[offset | 10] = SA;
16295 HEAP[offset | 11] = SB;
16296 HEAP[offset | 12] = SC;
16297 HEAP[offset | 13] = SD;
16298 HEAP[offset | 14] = SE;
16299 HEAP[offset | 15] = SF;
16300 offset = offset + 16 | 0;
16301 length = length - 16 | 0;
16302 encrypted = encrypted + 16 | 0;
16303 }
16304 return encrypted | 0;
16305 }
16306 function cbc_decrypt(offset, length) {
16307 offset = offset | 0;
16308 length = length | 0;
16309 var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, decrypted = 0;
16310 if (offset & 15) return -1;
16311 iv0 = S0;
16312 iv1 = S1;
16313 iv2 = S2;
16314 iv3 = S3;
16315 iv4 = S4;
16316 iv5 = S5;
16317 iv6 = S6;
16318 iv7 = S7;
16319 iv8 = S8;
16320 iv9 = S9;
16321 ivA = SA;
16322 ivB = SB;
16323 ivC = SC;
16324 ivD = SD;
16325 ivE = SE;
16326 ivF = SF;
16327 while ((length | 0) >= 16) {
16328 _decrypt(HEAP[offset] | 0, HEAP[offset | 1] | 0, HEAP[offset | 2] | 0, HEAP[offset | 3] | 0, HEAP[offset | 4] | 0, HEAP[offset | 5] | 0, HEAP[offset | 6] | 0, HEAP[offset | 7] | 0, HEAP[offset | 8] | 0, HEAP[offset | 9] | 0, HEAP[offset | 10] | 0, HEAP[offset | 11] | 0, HEAP[offset | 12] | 0, HEAP[offset | 13] | 0, HEAP[offset | 14] | 0, HEAP[offset | 15] | 0);
16329 S0 = S0 ^ iv0;
16330 iv0 = HEAP[offset] | 0;
16331 S1 = S1 ^ iv1;
16332 iv1 = HEAP[offset | 1] | 0;
16333 S2 = S2 ^ iv2;
16334 iv2 = HEAP[offset | 2] | 0;
16335 S3 = S3 ^ iv3;
16336 iv3 = HEAP[offset | 3] | 0;
16337 S4 = S4 ^ iv4;
16338 iv4 = HEAP[offset | 4] | 0;
16339 S5 = S5 ^ iv5;
16340 iv5 = HEAP[offset | 5] | 0;
16341 S6 = S6 ^ iv6;
16342 iv6 = HEAP[offset | 6] | 0;
16343 S7 = S7 ^ iv7;
16344 iv7 = HEAP[offset | 7] | 0;
16345 S8 = S8 ^ iv8;
16346 iv8 = HEAP[offset | 8] | 0;
16347 S9 = S9 ^ iv9;
16348 iv9 = HEAP[offset | 9] | 0;
16349 SA = SA ^ ivA;
16350 ivA = HEAP[offset | 10] | 0;
16351 SB = SB ^ ivB;
16352 ivB = HEAP[offset | 11] | 0;
16353 SC = SC ^ ivC;
16354 ivC = HEAP[offset | 12] | 0;
16355 SD = SD ^ ivD;
16356 ivD = HEAP[offset | 13] | 0;
16357 SE = SE ^ ivE;
16358 ivE = HEAP[offset | 14] | 0;
16359 SF = SF ^ ivF;
16360 ivF = HEAP[offset | 15] | 0;
16361 HEAP[offset] = S0;
16362 HEAP[offset | 1] = S1;
16363 HEAP[offset | 2] = S2;
16364 HEAP[offset | 3] = S3;
16365 HEAP[offset | 4] = S4;
16366 HEAP[offset | 5] = S5;
16367 HEAP[offset | 6] = S6;
16368 HEAP[offset | 7] = S7;
16369 HEAP[offset | 8] = S8;
16370 HEAP[offset | 9] = S9;
16371 HEAP[offset | 10] = SA;
16372 HEAP[offset | 11] = SB;
16373 HEAP[offset | 12] = SC;
16374 HEAP[offset | 13] = SD;
16375 HEAP[offset | 14] = SE;
16376 HEAP[offset | 15] = SF;
16377 offset = offset + 16 | 0;
16378 length = length - 16 | 0;
16379 decrypted = decrypted + 16 | 0;
16380 }
16381 S0 = iv0;
16382 S1 = iv1;
16383 S2 = iv2;
16384 S3 = iv3;
16385 S4 = iv4;
16386 S5 = iv5;
16387 S6 = iv6;
16388 S7 = iv7;
16389 S8 = iv8;
16390 S9 = iv9;
16391 SA = ivA;
16392 SB = ivB;
16393 SC = ivC;
16394 SD = ivD;
16395 SE = ivE;
16396 SF = ivF;
16397 return decrypted | 0;
16398 }
16399 function cbc_mac(offset, length, output) {
16400 offset = offset | 0;
16401 length = length | 0;
16402 output = output | 0;
16403 if (offset & 15) return -1;
16404 if (~output) if (output & 31) return -1;
16405 while ((length | 0) >= 16) {
16406 _encrypt(S0 ^ HEAP[offset], S1 ^ HEAP[offset | 1], S2 ^ HEAP[offset | 2], S3 ^ HEAP[offset | 3], S4 ^ HEAP[offset | 4], S5 ^ HEAP[offset | 5], S6 ^ HEAP[offset | 6], S7 ^ HEAP[offset | 7], S8 ^ HEAP[offset | 8], S9 ^ HEAP[offset | 9], SA ^ HEAP[offset | 10], SB ^ HEAP[offset | 11], SC ^ HEAP[offset | 12], SD ^ HEAP[offset | 13], SE ^ HEAP[offset | 14], SF ^ HEAP[offset | 15]);
16407 offset = offset + 16 | 0;
16408 length = length - 16 | 0;
16409 }
16410 if ((length | 0) > 0) {
16411 S0 = S0 ^ HEAP[offset];
16412 if ((length | 0) > 1) S1 = S1 ^ HEAP[offset | 1];
16413 if ((length | 0) > 2) S2 = S2 ^ HEAP[offset | 2];
16414 if ((length | 0) > 3) S3 = S3 ^ HEAP[offset | 3];
16415 if ((length | 0) > 4) S4 = S4 ^ HEAP[offset | 4];
16416 if ((length | 0) > 5) S5 = S5 ^ HEAP[offset | 5];
16417 if ((length | 0) > 6) S6 = S6 ^ HEAP[offset | 6];
16418 if ((length | 0) > 7) S7 = S7 ^ HEAP[offset | 7];
16419 if ((length | 0) > 8) S8 = S8 ^ HEAP[offset | 8];
16420 if ((length | 0) > 9) S9 = S9 ^ HEAP[offset | 9];
16421 if ((length | 0) > 10) SA = SA ^ HEAP[offset | 10];
16422 if ((length | 0) > 11) SB = SB ^ HEAP[offset | 11];
16423 if ((length | 0) > 12) SC = SC ^ HEAP[offset | 12];
16424 if ((length | 0) > 13) SD = SD ^ HEAP[offset | 13];
16425 if ((length | 0) > 14) SE = SE ^ HEAP[offset | 14];
16426 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16427 offset = offset + length | 0;
16428 length = 0;
16429 }
16430 if (~output) {
16431 HEAP[output | 0] = S0;
16432 HEAP[output | 1] = S1;
16433 HEAP[output | 2] = S2;
16434 HEAP[output | 3] = S3;
16435 HEAP[output | 4] = S4;
16436 HEAP[output | 5] = S5;
16437 HEAP[output | 6] = S6;
16438 HEAP[output | 7] = S7;
16439 HEAP[output | 8] = S8;
16440 HEAP[output | 9] = S9;
16441 HEAP[output | 10] = SA;
16442 HEAP[output | 11] = SB;
16443 HEAP[output | 12] = SC;
16444 HEAP[output | 13] = SD;
16445 HEAP[output | 14] = SE;
16446 HEAP[output | 15] = SF;
16447 }
16448 return 0;
16449 }
16450 function ccm_encrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16451 offset = offset | 0;
16452 length = length | 0;
16453 nonce0 = nonce0 | 0;
16454 nonce1 = nonce1 | 0;
16455 nonce2 = nonce2 | 0;
16456 nonce3 = nonce3 | 0;
16457 nonce4 = nonce4 | 0;
16458 nonce5 = nonce5 | 0;
16459 nonce6 = nonce6 | 0;
16460 nonce7 = nonce7 | 0;
16461 nonce8 = nonce8 | 0;
16462 nonce9 = nonce9 | 0;
16463 nonceA = nonceA | 0;
16464 nonceB = nonceB | 0;
16465 nonceC = nonceC | 0;
16466 nonceD = nonceD | 0;
16467 counter0 = counter0 | 0;
16468 counter1 = counter1 | 0;
16469 var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sA = 0, sB = 0, sC = 0, sD = 0, sE = 0, sF = 0, encrypted = 0;
16470 if (offset & 15) return -1;
16471 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16472 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16473 while ((length | 0) >= 16) {
16474 s0 = HEAP[offset] | 0;
16475 s1 = HEAP[offset | 1] | 0;
16476 s2 = HEAP[offset | 2] | 0;
16477 s3 = HEAP[offset | 3] | 0;
16478 s4 = HEAP[offset | 4] | 0;
16479 s5 = HEAP[offset | 5] | 0;
16480 s6 = HEAP[offset | 6] | 0;
16481 s7 = HEAP[offset | 7] | 0;
16482 s8 = HEAP[offset | 8] | 0;
16483 s9 = HEAP[offset | 9] | 0;
16484 sA = HEAP[offset | 10] | 0;
16485 sB = HEAP[offset | 11] | 0;
16486 sC = HEAP[offset | 12] | 0;
16487 sD = HEAP[offset | 13] | 0;
16488 sE = HEAP[offset | 14] | 0;
16489 sF = HEAP[offset | 15] | 0;
16490 _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255);
16491 HEAP[offset] = s0 ^ S0;
16492 HEAP[offset | 1] = s1 ^ S1;
16493 HEAP[offset | 2] = s2 ^ S2;
16494 HEAP[offset | 3] = s3 ^ S3;
16495 HEAP[offset | 4] = s4 ^ S4;
16496 HEAP[offset | 5] = s5 ^ S5;
16497 HEAP[offset | 6] = s6 ^ S6;
16498 HEAP[offset | 7] = s7 ^ S7;
16499 HEAP[offset | 8] = s8 ^ S8;
16500 HEAP[offset | 9] = s9 ^ S9;
16501 HEAP[offset | 10] = sA ^ SA;
16502 HEAP[offset | 11] = sB ^ SB;
16503 HEAP[offset | 12] = sC ^ SC;
16504 HEAP[offset | 13] = sD ^ SD;
16505 HEAP[offset | 14] = sE ^ SE;
16506 HEAP[offset | 15] = sF ^ SF;
16507 _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF);
16508 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16509 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16510 encrypted = encrypted + 16 | 0;
16511 offset = offset + 16 | 0;
16512 length = length - 16 | 0;
16513 counter1 = counter1 + 1 | 0;
16514 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16515 }
16516 if ((length | 0) > 0) {
16517 s0 = HEAP[offset] | 0;
16518 s1 = (length | 0) > 1 ? HEAP[offset | 1] | 0 : 0;
16519 s2 = (length | 0) > 2 ? HEAP[offset | 2] | 0 : 0;
16520 s3 = (length | 0) > 3 ? HEAP[offset | 3] | 0 : 0;
16521 s4 = (length | 0) > 4 ? HEAP[offset | 4] | 0 : 0;
16522 s5 = (length | 0) > 5 ? HEAP[offset | 5] | 0 : 0;
16523 s6 = (length | 0) > 6 ? HEAP[offset | 6] | 0 : 0;
16524 s7 = (length | 0) > 7 ? HEAP[offset | 7] | 0 : 0;
16525 s8 = (length | 0) > 8 ? HEAP[offset | 8] | 0 : 0;
16526 s9 = (length | 0) > 9 ? HEAP[offset | 9] | 0 : 0;
16527 sA = (length | 0) > 10 ? HEAP[offset | 10] | 0 : 0;
16528 sB = (length | 0) > 11 ? HEAP[offset | 11] | 0 : 0;
16529 sC = (length | 0) > 12 ? HEAP[offset | 12] | 0 : 0;
16530 sD = (length | 0) > 13 ? HEAP[offset | 13] | 0 : 0;
16531 sE = (length | 0) > 14 ? HEAP[offset | 14] | 0 : 0;
16532 _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255);
16533 HEAP[offset] = s0 ^ S0;
16534 if ((length | 0) > 1) HEAP[offset | 1] = s1 ^ S1;
16535 if ((length | 0) > 2) HEAP[offset | 2] = s2 ^ S2;
16536 if ((length | 0) > 3) HEAP[offset | 3] = s3 ^ S3;
16537 if ((length | 0) > 4) HEAP[offset | 4] = s4 ^ S4;
16538 if ((length | 0) > 5) HEAP[offset | 5] = s5 ^ S5;
16539 if ((length | 0) > 6) HEAP[offset | 6] = s6 ^ S6;
16540 if ((length | 0) > 7) HEAP[offset | 7] = s7 ^ S7;
16541 if ((length | 0) > 8) HEAP[offset | 8] = s8 ^ S8;
16542 if ((length | 0) > 9) HEAP[offset | 9] = s9 ^ S9;
16543 if ((length | 0) > 10) HEAP[offset | 10] = sA ^ SA;
16544 if ((length | 0) > 11) HEAP[offset | 11] = sB ^ SB;
16545 if ((length | 0) > 12) HEAP[offset | 12] = sC ^ SC;
16546 if ((length | 0) > 13) HEAP[offset | 13] = sD ^ SD;
16547 if ((length | 0) > 14) HEAP[offset | 14] = sE ^ SE;
16548 _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, ivF);
16549 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16550 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16551 encrypted = encrypted + length | 0;
16552 offset = offset + length | 0;
16553 length = 0;
16554 counter1 = counter1 + 1 | 0;
16555 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16556 }
16557 return encrypted | 0;
16558 }
16559 function ccm_decrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16560 offset = offset | 0;
16561 length = length | 0;
16562 nonce0 = nonce0 | 0;
16563 nonce1 = nonce1 | 0;
16564 nonce2 = nonce2 | 0;
16565 nonce3 = nonce3 | 0;
16566 nonce4 = nonce4 | 0;
16567 nonce5 = nonce5 | 0;
16568 nonce6 = nonce6 | 0;
16569 nonce7 = nonce7 | 0;
16570 nonce8 = nonce8 | 0;
16571 nonce9 = nonce9 | 0;
16572 nonceA = nonceA | 0;
16573 nonceB = nonceB | 0;
16574 nonceC = nonceC | 0;
16575 nonceD = nonceD | 0;
16576 counter0 = counter0 | 0;
16577 counter1 = counter1 | 0;
16578 var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, s0 = 0, s1 = 0, s2 = 0, s3 = 0, s4 = 0, s5 = 0, s6 = 0, s7 = 0, s8 = 0, s9 = 0, sA = 0, sB = 0, sC = 0, sD = 0, sE = 0, sF = 0, decrypted = 0;
16579 if (offset & 15) return -1;
16580 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16581 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16582 while ((length | 0) >= 16) {
16583 _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255);
16584 HEAP[offset] = s0 = HEAP[offset] ^ S0;
16585 HEAP[offset | 1] = s1 = HEAP[offset | 1] ^ S1;
16586 HEAP[offset | 2] = s2 = HEAP[offset | 2] ^ S2;
16587 HEAP[offset | 3] = s3 = HEAP[offset | 3] ^ S3;
16588 HEAP[offset | 4] = s4 = HEAP[offset | 4] ^ S4;
16589 HEAP[offset | 5] = s5 = HEAP[offset | 5] ^ S5;
16590 HEAP[offset | 6] = s6 = HEAP[offset | 6] ^ S6;
16591 HEAP[offset | 7] = s7 = HEAP[offset | 7] ^ S7;
16592 HEAP[offset | 8] = s8 = HEAP[offset | 8] ^ S8;
16593 HEAP[offset | 9] = s9 = HEAP[offset | 9] ^ S9;
16594 HEAP[offset | 10] = sA = HEAP[offset | 10] ^ SA;
16595 HEAP[offset | 11] = sB = HEAP[offset | 11] ^ SB;
16596 HEAP[offset | 12] = sC = HEAP[offset | 12] ^ SC;
16597 HEAP[offset | 13] = sD = HEAP[offset | 13] ^ SD;
16598 HEAP[offset | 14] = sE = HEAP[offset | 14] ^ SE;
16599 HEAP[offset | 15] = sF = HEAP[offset | 15] ^ SF;
16600 _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF);
16601 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16602 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16603 decrypted = decrypted + 16 | 0;
16604 offset = offset + 16 | 0;
16605 length = length - 16 | 0;
16606 counter1 = counter1 + 1 | 0;
16607 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16608 }
16609 if ((length | 0) > 0) {
16610 _encrypt(nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8 ^ counter0 >>> 24, nonce9 ^ counter0 >>> 16 & 255, nonceA ^ counter0 >>> 8 & 255, nonceB ^ counter0 & 255, nonceC ^ counter1 >>> 24, nonceD ^ counter1 >>> 16 & 255, counter1 >>> 8 & 255, counter1 & 255);
16611 s0 = HEAP[offset] ^ S0;
16612 s1 = (length | 0) > 1 ? HEAP[offset | 1] ^ S1 : 0;
16613 s2 = (length | 0) > 2 ? HEAP[offset | 2] ^ S2 : 0;
16614 s3 = (length | 0) > 3 ? HEAP[offset | 3] ^ S3 : 0;
16615 s4 = (length | 0) > 4 ? HEAP[offset | 4] ^ S4 : 0;
16616 s5 = (length | 0) > 5 ? HEAP[offset | 5] ^ S5 : 0;
16617 s6 = (length | 0) > 6 ? HEAP[offset | 6] ^ S6 : 0;
16618 s7 = (length | 0) > 7 ? HEAP[offset | 7] ^ S7 : 0;
16619 s8 = (length | 0) > 8 ? HEAP[offset | 8] ^ S8 : 0;
16620 s9 = (length | 0) > 9 ? HEAP[offset | 9] ^ S9 : 0;
16621 sA = (length | 0) > 10 ? HEAP[offset | 10] ^ SA : 0;
16622 sB = (length | 0) > 11 ? HEAP[offset | 11] ^ SB : 0;
16623 sC = (length | 0) > 12 ? HEAP[offset | 12] ^ SC : 0;
16624 sD = (length | 0) > 13 ? HEAP[offset | 13] ^ SD : 0;
16625 sE = (length | 0) > 14 ? HEAP[offset | 14] ^ SE : 0;
16626 sF = (length | 0) > 15 ? HEAP[offset | 15] ^ SF : 0;
16627 HEAP[offset] = s0;
16628 if ((length | 0) > 1) HEAP[offset | 1] = s1;
16629 if ((length | 0) > 2) HEAP[offset | 2] = s2;
16630 if ((length | 0) > 3) HEAP[offset | 3] = s3;
16631 if ((length | 0) > 4) HEAP[offset | 4] = s4;
16632 if ((length | 0) > 5) HEAP[offset | 5] = s5;
16633 if ((length | 0) > 6) HEAP[offset | 6] = s6;
16634 if ((length | 0) > 7) HEAP[offset | 7] = s7;
16635 if ((length | 0) > 8) HEAP[offset | 8] = s8;
16636 if ((length | 0) > 9) HEAP[offset | 9] = s9;
16637 if ((length | 0) > 10) HEAP[offset | 10] = sA;
16638 if ((length | 0) > 11) HEAP[offset | 11] = sB;
16639 if ((length | 0) > 12) HEAP[offset | 12] = sC;
16640 if ((length | 0) > 13) HEAP[offset | 13] = sD;
16641 if ((length | 0) > 14) HEAP[offset | 14] = sE;
16642 _encrypt(s0 ^ iv0, s1 ^ iv1, s2 ^ iv2, s3 ^ iv3, s4 ^ iv4, s5 ^ iv5, s6 ^ iv6, s7 ^ iv7, s8 ^ iv8, s9 ^ iv9, sA ^ ivA, sB ^ ivB, sC ^ ivC, sD ^ ivD, sE ^ ivE, sF ^ ivF);
16643 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16644 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16645 decrypted = decrypted + length | 0;
16646 offset = offset + length | 0;
16647 length = 0;
16648 counter1 = counter1 + 1 | 0;
16649 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16650 }
16651 return decrypted | 0;
16652 }
16653 function cfb_encrypt(offset, length) {
16654 offset = offset | 0;
16655 length = length | 0;
16656 var encrypted = 0;
16657 if (offset & 15) return -1;
16658 while ((length | 0) >= 16) {
16659 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16660 S0 = S0 ^ HEAP[offset];
16661 S1 = S1 ^ HEAP[offset | 1];
16662 S2 = S2 ^ HEAP[offset | 2];
16663 S3 = S3 ^ HEAP[offset | 3];
16664 S4 = S4 ^ HEAP[offset | 4];
16665 S5 = S5 ^ HEAP[offset | 5];
16666 S6 = S6 ^ HEAP[offset | 6];
16667 S7 = S7 ^ HEAP[offset | 7];
16668 S8 = S8 ^ HEAP[offset | 8];
16669 S9 = S9 ^ HEAP[offset | 9];
16670 SA = SA ^ HEAP[offset | 10];
16671 SB = SB ^ HEAP[offset | 11];
16672 SC = SC ^ HEAP[offset | 12];
16673 SD = SD ^ HEAP[offset | 13];
16674 SE = SE ^ HEAP[offset | 14];
16675 SF = SF ^ HEAP[offset | 15];
16676 HEAP[offset] = S0;
16677 HEAP[offset | 1] = S1;
16678 HEAP[offset | 2] = S2;
16679 HEAP[offset | 3] = S3;
16680 HEAP[offset | 4] = S4;
16681 HEAP[offset | 5] = S5;
16682 HEAP[offset | 6] = S6;
16683 HEAP[offset | 7] = S7;
16684 HEAP[offset | 8] = S8;
16685 HEAP[offset | 9] = S9;
16686 HEAP[offset | 10] = SA;
16687 HEAP[offset | 11] = SB;
16688 HEAP[offset | 12] = SC;
16689 HEAP[offset | 13] = SD;
16690 HEAP[offset | 14] = SE;
16691 HEAP[offset | 15] = SF;
16692 offset = offset + 16 | 0;
16693 length = length - 16 | 0;
16694 encrypted = encrypted + 16 | 0;
16695 }
16696 if ((length | 0) > 0) {
16697 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16698 HEAP[offset] = HEAP[offset] ^ S0;
16699 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16700 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16701 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16702 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16703 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16704 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16705 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16706 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16707 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16708 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16709 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16710 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16711 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16712 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16713 encrypted = encrypted + length | 0;
16714 offset = offset + length | 0;
16715 length = 0;
16716 }
16717 return encrypted | 0;
16718 }
16719 function cfb_decrypt(offset, length) {
16720 offset = offset | 0;
16721 length = length | 0;
16722 var iv0 = 0, iv1 = 0, iv2 = 0, iv3 = 0, iv4 = 0, iv5 = 0, iv6 = 0, iv7 = 0, iv8 = 0, iv9 = 0, ivA = 0, ivB = 0, ivC = 0, ivD = 0, ivE = 0, ivF = 0, decrypted = 0;
16723 if (offset & 15) return -1;
16724 while ((length | 0) >= 16) {
16725 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16726 iv0 = HEAP[offset] | 0;
16727 iv1 = HEAP[offset | 1] | 0;
16728 iv2 = HEAP[offset | 2] | 0;
16729 iv3 = HEAP[offset | 3] | 0;
16730 iv4 = HEAP[offset | 4] | 0;
16731 iv5 = HEAP[offset | 5] | 0;
16732 iv6 = HEAP[offset | 6] | 0;
16733 iv7 = HEAP[offset | 7] | 0;
16734 iv8 = HEAP[offset | 8] | 0;
16735 iv9 = HEAP[offset | 9] | 0;
16736 ivA = HEAP[offset | 10] | 0;
16737 ivB = HEAP[offset | 11] | 0;
16738 ivC = HEAP[offset | 12] | 0;
16739 ivD = HEAP[offset | 13] | 0;
16740 ivE = HEAP[offset | 14] | 0;
16741 ivF = HEAP[offset | 15] | 0;
16742 HEAP[offset] = S0 ^ iv0;
16743 HEAP[offset | 1] = S1 ^ iv1;
16744 HEAP[offset | 2] = S2 ^ iv2;
16745 HEAP[offset | 3] = S3 ^ iv3;
16746 HEAP[offset | 4] = S4 ^ iv4;
16747 HEAP[offset | 5] = S5 ^ iv5;
16748 HEAP[offset | 6] = S6 ^ iv6;
16749 HEAP[offset | 7] = S7 ^ iv7;
16750 HEAP[offset | 8] = S8 ^ iv8;
16751 HEAP[offset | 9] = S9 ^ iv9;
16752 HEAP[offset | 10] = SA ^ ivA;
16753 HEAP[offset | 11] = SB ^ ivB;
16754 HEAP[offset | 12] = SC ^ ivC;
16755 HEAP[offset | 13] = SD ^ ivD;
16756 HEAP[offset | 14] = SE ^ ivE;
16757 HEAP[offset | 15] = SF ^ ivF;
16758 S0 = iv0;
16759 S1 = iv1;
16760 S2 = iv2;
16761 S3 = iv3;
16762 S4 = iv4;
16763 S5 = iv5;
16764 S6 = iv6;
16765 S7 = iv7;
16766 S8 = iv8;
16767 S9 = iv9;
16768 SA = ivA;
16769 SB = ivB;
16770 SC = ivC;
16771 SD = ivD;
16772 SE = ivE;
16773 SF = ivF;
16774 offset = offset + 16 | 0;
16775 length = length - 16 | 0;
16776 decrypted = decrypted + 16 | 0;
16777 }
16778 if ((length | 0) > 0) {
16779 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16780 HEAP[offset] = HEAP[offset] ^ S0;
16781 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16782 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16783 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16784 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16785 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16786 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16787 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16788 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16789 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16790 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16791 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16792 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16793 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16794 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16795 decrypted = decrypted + length | 0;
16796 offset = offset + length | 0;
16797 length = 0;
16798 }
16799 return decrypted | 0;
16800 }
16801 return {
16802 init_state: init_state,
16803 save_state: save_state,
16804 init_key_128: init_key_128,
16805 init_key_256: init_key_256,
16806 cbc_encrypt: cbc_encrypt,
16807 cbc_decrypt: cbc_decrypt,
16808 cbc_mac: cbc_mac,
16809 ccm_encrypt: ccm_encrypt,
16810 ccm_decrypt: ccm_decrypt,
16811 cfb_encrypt: cfb_encrypt,
16812 cfb_decrypt: cfb_decrypt
16813 };
16814 }
16815 function aes_asm(stdlib, foreign, buffer) {
16816 var heap = new Uint8Array(buffer);
16817 heap.set(_aes_tables);
16818 return _aes_asm(stdlib, foreign, buffer);
16819 }
16820 var _aes_block_size = 16;
16821 function _aes_constructor(options) {
16822 options = options || {};
16823 options.heapSize = options.heapSize || 4096;
16824 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
16825 this.BLOCK_SIZE = _aes_block_size;
16826 this.heap = options.heap || new Uint8Array(options.heapSize);
16827 this.asm = options.asm || aes_asm(global, null, this.heap.buffer);
16828 this.pos = _aes_heap_start;
16829 this.len = 0;
16830 this.key = null;
16831 this.result = null;
16832 this.reset(options);
16833 }
16834 function _aes_reset(options) {
16835 options = options || {};
16836 this.result = null;
16837 this.pos = _aes_heap_start;
16838 this.len = 0;
16839 var asm = this.asm;
16840 var key = options.key;
16841 if (key !== undefined) {
16842 if (is_buffer(key) || is_bytes(key)) {
16843 key = new Uint8Array(key);
16844 } else if (is_string(key)) {
16845 var str = key;
16846 key = new Uint8Array(str.length);
16847 for (var i = 0; i < str.length; ++i) key[i] = str.charCodeAt(i);
16848 } else {
16849 throw new TypeError("unexpected key type");
16850 }
16851 if (key.length === 16) {
16852 this.key = key;
16853 asm.init_key_128.call(asm, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8], key[9], key[10], key[11], key[12], key[13], key[14], key[15]);
16854 } else if (key.length === 24) {
16855 throw new IllegalArgumentError("illegal key size");
16856 } else if (key.length === 32) {
16857 this.key = key;
16858 asm.init_key_256.call(asm, key[0], key[1], key[2], key[3], key[4], key[5], key[6], key[7], key[8], key[9], key[10], key[11], key[12], key[13], key[14], key[15], key[16], key[17], key[18], key[19], key[20], key[21], key[22], key[23], key[24], key[25], key[26], key[27], key[28], key[29], key[30], key[31]);
16859 } else {
16860 throw new IllegalArgumentError("illegal key size");
16861 }
16862 }
16863 return this;
16864 }
16865 function _aes_init_iv(iv) {
16866 var asm = this.asm;
16867 if (iv !== undefined) {
16868 if (is_buffer(iv) || is_bytes(iv)) {
16869 iv = new Uint8Array(iv);
16870 } else if (is_string(iv)) {
16871 var str = iv;
16872 iv = new Uint8Array(str.length);
16873 for (var i = 0; i < str.length; ++i) iv[i] = str.charCodeAt(i);
16874 } else {
16875 throw new TypeError("unexpected iv type");
16876 }
16877 if (iv.length !== _aes_block_size) throw new IllegalArgumentError("illegal iv size");
16878 this.iv = iv;
16879 asm.init_state.call(asm, iv[0], iv[1], iv[2], iv[3], iv[4], iv[5], iv[6], iv[7], iv[8], iv[9], iv[10], iv[11], iv[12], iv[13], iv[14], iv[15]);
16880 } else {
16881 this.iv = null;
16882 asm.init_state.call(asm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
16883 }
16884 }
16885 function _aes_heap_write(heap, hpos, data, dpos, dlen) {
16886 var hlen = heap.byteLength - hpos, wlen = hlen < dlen ? hlen : dlen;
16887 if (is_buffer(data) || is_bytes(data)) {
16888 heap.set(new Uint8Array(data.buffer || data, dpos, wlen), hpos);
16889 } else if (is_string(data)) {
16890 for (var i = 0; i < wlen; ++i) heap[hpos + i] = data.charCodeAt(dpos + i);
16891 } else {
16892 throw new TypeError("unexpected data type");
16893 }
16894 return wlen;
16895 }
16896 function cbc_aes_constructor(options) {
16897 this.padding = true;
16898 this.mode = "cbc";
16899 this.iv = null;
16900 _aes_constructor.call(this, options);
16901 }
16902 function cbc_aes_encrypt_constructor(options) {
16903 cbc_aes_constructor.call(this, options);
16904 }
16905 function cbc_aes_decrypt_constructor(options) {
16906 cbc_aes_constructor.call(this, options);
16907 }
16908 function cbc_aes_reset(options) {
16909 options = options || {};
16910 _aes_reset.call(this, options);
16911 var padding = options.padding;
16912 if (padding !== undefined) {
16913 this.padding = !!padding;
16914 } else {
16915 this.padding = true;
16916 }
16917 _aes_init_iv.call(this, options.iv);
16918 return this;
16919 }
16920 function cbc_aes_encrypt_process(data) {
16921 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16922 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
16923 var result = new Uint8Array(rlen);
16924 while (dlen > 0) {
16925 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16926 len += wlen;
16927 dpos += wlen;
16928 dlen -= wlen;
16929 wlen = asm.cbc_encrypt(pos, len);
16930 result.set(heap.subarray(pos, pos + wlen), rpos);
16931 rpos += wlen;
16932 if (wlen < len) {
16933 pos += wlen;
16934 len -= wlen;
16935 } else {
16936 pos = _aes_heap_start;
16937 len = 0;
16938 }
16939 }
16940 this.result = result;
16941 this.pos = pos;
16942 this.len = len;
16943 return this;
16944 }
16945 function cbc_aes_encrypt_finish() {
16946 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16947 var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len, rlen = _aes_block_size * Math.ceil(len / _aes_block_size);
16948 if (len % _aes_block_size === 0) {
16949 if (padding) rlen += _aes_block_size;
16950 } else if (!padding) {
16951 throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
16952 }
16953 var result = new Uint8Array(rlen);
16954 if (len < rlen) {
16955 var plen = _aes_block_size - len % _aes_block_size;
16956 for (var p = 0; p < plen; ++p) heap[pos + len + p] = plen;
16957 len += plen;
16958 }
16959 asm.cbc_encrypt(pos, len);
16960 result.set(heap.subarray(pos, pos + len));
16961 this.result = result;
16962 this.pos = _aes_heap_start;
16963 this.len = 0;
16964 return this;
16965 }
16966 function cbc_aes_encrypt(data) {
16967 var result1 = cbc_aes_encrypt_process.call(this, data).result, result2 = cbc_aes_encrypt_finish.call(this).result, result;
16968 result = new Uint8Array(result1.length + result2.length);
16969 result.set(result1);
16970 result.set(result2, result1.length);
16971 this.result = result;
16972 return this;
16973 }
16974 function cbc_aes_decrypt_process(data) {
16975 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16976 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
16977 var result = new Uint8Array(rlen);
16978 while (dlen > 0) {
16979 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16980 len += wlen;
16981 dpos += wlen;
16982 dlen -= wlen;
16983 wlen = asm.cbc_decrypt(pos, len - (padding && dlen === 0 && len % _aes_block_size === 0 ? _aes_block_size : 0));
16984 result.set(heap.subarray(pos, pos + wlen), rpos);
16985 rpos += wlen;
16986 if (wlen < len) {
16987 pos += wlen;
16988 len -= wlen;
16989 } else {
16990 pos = _aes_heap_start;
16991 len = 0;
16992 }
16993 }
16994 this.result = result.subarray(0, rpos);
16995 this.pos = pos;
16996 this.len = len;
16997 return this;
16998 }
16999 function cbc_aes_decrypt_finish() {
17000 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17001 var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len;
17002 if (len === 0) {
17003 if (!padding) {
17004 this.result = new Uint8Array(0);
17005 this.pos = _aes_heap_start;
17006 this.len = 0;
17007 return this;
17008 } else {
17009 throw new IllegalStateError("padding not found");
17010 }
17011 }
17012 if (len % _aes_block_size !== 0) throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
17013 var result = new Uint8Array(len);
17014 asm.cbc_decrypt(pos, len);
17015 result.set(heap.subarray(pos, pos + len));
17016 if (padding) {
17017 var pad = result[len - 1];
17018 result = result.subarray(0, len - pad);
17019 }
17020 this.result = result;
17021 this.pos = _aes_heap_start;
17022 this.len = 0;
17023 return this;
17024 }
17025 function cbc_aes_decrypt(data) {
17026 var result1 = cbc_aes_decrypt_process.call(this, data).result, result2 = cbc_aes_decrypt_finish.call(this).result, result;
17027 result = new Uint8Array(result1.length + result2.length);
17028 result.set(result1);
17029 result.set(result2, result1.length);
17030 this.result = result;
17031 return this;
17032 }
17033 var cbc_aes_encrypt_prototype = cbc_aes_encrypt_constructor.prototype;
17034 cbc_aes_encrypt_prototype.reset = cbc_aes_reset;
17035 cbc_aes_encrypt_prototype.process = cbc_aes_encrypt_process;
17036 cbc_aes_encrypt_prototype.finish = cbc_aes_encrypt_finish;
17037 var cbc_aes_decrypt_prototype = cbc_aes_decrypt_constructor.prototype;
17038 cbc_aes_decrypt_prototype.reset = cbc_aes_reset;
17039 cbc_aes_decrypt_prototype.process = cbc_aes_decrypt_process;
17040 cbc_aes_decrypt_prototype.finish = cbc_aes_decrypt_finish;
17041 var cbc_aes_prototype = cbc_aes_constructor.prototype;
17042 cbc_aes_prototype.reset = cbc_aes_reset;
17043 cbc_aes_prototype.encrypt = cbc_aes_encrypt;
17044 cbc_aes_prototype.decrypt = cbc_aes_decrypt;
17045 function _cbc_mac_process(data) {
17046 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, wlen = 0;
17047 while (dlen > 0) {
17048 wlen = _aes_heap_write(this.heap, _aes_heap_start, data, dpos, dlen);
17049 this.asm.cbc_mac(_aes_heap_start, wlen, -1);
17050 dpos += wlen;
17051 dlen -= wlen;
17052 }
17053 }
17054 var _ccm_adata_maxLength = 65279, _ccm_data_maxLength = 68719476720;
17055 function ccm_aes_constructor(options) {
17056 this.padding = false;
17057 this.mode = "ccm";
17058 this.tagSize = _aes_block_size;
17059 this.lengthSize = 4;
17060 this.nonce = null;
17061 this.adata = null;
17062 this.iv = null;
17063 this.dataLength = -1;
17064 this.dataLeft = -1;
17065 this.counter = 1;
17066 _aes_constructor.call(this, options);
17067 }
17068 function ccm_aes_encrypt_constructor(options) {
17069 ccm_aes_constructor.call(this, options);
17070 }
17071 function ccm_aes_decrypt_constructor(options) {
17072 ccm_aes_constructor.call(this, options);
17073 }
17074 function _ccm_calculate_iv() {
17075 var nonce = this.nonce, adata = this.adata, tagSize = this.tagSize, lengthSize = this.lengthSize, dataLength = this.dataLength;
17076 var data = new Uint8Array(_aes_block_size + (adata ? 2 + adata.byteLength : 0));
17077 data[0] = (adata ? 64 : 0) | tagSize - 2 << 2 | lengthSize - 1;
17078 data.set(nonce, 1);
17079 if (lengthSize > 4) data[11] = (dataLength - (dataLength >>> 0)) / 4294967296 & 15;
17080 if (lengthSize > 3) data[12] = dataLength >>> 24;
17081 if (lengthSize > 2) data[13] = dataLength >>> 16 & 255;
17082 data[14] = dataLength >>> 8 & 255;
17083 data[15] = dataLength & 255;
17084 if (adata) {
17085 data[16] = adata.byteLength >>> 8 & 255;
17086 data[17] = adata.byteLength & 255;
17087 data.set(adata, 18);
17088 }
17089 _cbc_mac_process.call(this, data);
17090 this.asm.save_state(_aes_heap_start);
17091 this.iv = new Uint8Array(this.heap.subarray(_aes_heap_start, _aes_heap_start + _aes_block_size));
17092 }
17093 function ccm_aes_reset(options) {
17094 options = options || {};
17095 _aes_reset.call(this, options);
17096 _aes_init_iv.call(this, options.iv);
17097 var tagSize = options.tagSize;
17098 if (tagSize !== undefined) {
17099 if (!is_number(tagSize)) throw new TypeError("tagSize must be a number");
17100 if (tagSize < 4 || tagSize > 16 || tagSize & 1) throw new IllegalArgumentError("illegal tagSize value");
17101 this.tagSize = tagSize;
17102 } else {
17103 this.tagSize = _aes_block_size;
17104 }
17105 var lengthSize = options.lengthSize, nonce = options.nonce;
17106 if (nonce !== undefined) {
17107 if (is_buffer(nonce) || is_bytes(nonce)) {
17108 nonce = new Uint8Array(nonce);
17109 } else if (is_string(nonce)) {
17110 var str = nonce;
17111 nonce = new Uint8Array(str.length);
17112 for (var i = 0; i < str.length; ++i) nonce[i] = str.charCodeAt(i);
17113 } else {
17114 throw new TypeError("unexpected nonce type");
17115 }
17116 if (nonce.length < 10 || nonce.length > 13) throw new IllegalArgumentError("illegal nonce length");
17117 lengthSize = lengthSize || 15 - nonce.length;
17118 this.nonce = nonce;
17119 } else {
17120 this.nonce = null;
17121 }
17122 if (lengthSize !== undefined) {
17123 if (!is_number(lengthSize)) throw new TypeError("lengthSize must be a number");
17124 if (lengthSize < 2 || lengthSize > 5 || nonce.length + lengthSize !== 15) throw new IllegalArgumentError("illegal lengthSize value");
17125 this.lengthSize = lengthSize;
17126 } else {
17127 this.lengthSize = lengthSize = 4;
17128 }
17129 var iv = this.iv;
17130 var counter = options.counter;
17131 if (counter !== undefined) {
17132 if (iv === null) throw new IllegalStateError("iv is also required");
17133 if (!is_number(counter)) throw new TypeError("counter must be a number");
17134 this.counter = counter;
17135 } else {
17136 this.counter = 1;
17137 }
17138 var dataLength = options.dataLength;
17139 if (dataLength !== undefined) {
17140 if (!is_number(dataLength)) throw new TypeError("dataLength must be a number");
17141 if (dataLength < 0 || dataLength > _ccm_data_maxLength || dataLength > Math.pow(2, 8 * lengthSize) - 1) throw new IllegalArgumentError("illegal dataLength value");
17142 this.dataLength = dataLength;
17143 var dataLeft = options.dataLeft || dataLength;
17144 if (!is_number(dataLeft)) throw new TypeError("dataLeft must be a number");
17145 if (dataLeft < 0 || dataLeft > dataLength) throw new IllegalArgumentError("illegal dataLeft value");
17146 this.dataLeft = dataLeft;
17147 } else {
17148 this.dataLength = dataLength = -1;
17149 this.dataLeft = dataLength;
17150 }
17151 var adata = options.adata;
17152 if (adata !== undefined) {
17153 if (iv !== null) throw new IllegalStateError("you must specify either adata or iv, not both");
17154 if (is_buffer(adata) || is_bytes(adata)) {
17155 adata = new Uint8Array(adata);
17156 } else if (is_string(adata)) {
17157 var str = adata;
17158 adata = new Uint8Array(str.length);
17159 for (var i = 0; i < str.length; ++i) adata[i] = str.charCodeAt(i);
17160 } else {
17161 throw new TypeError("unexpected adata type");
17162 }
17163 if (adata.byteLength === 0 || adata.byteLength > _ccm_adata_maxLength) throw new IllegalArgumentError("illegal adata length");
17164 this.adata = adata;
17165 this.counter = 1;
17166 } else {
17167 this.adata = adata = null;
17168 }
17169 if (dataLength !== -1) _ccm_calculate_iv.call(this);
17170 return this;
17171 }
17172 function ccm_aes_encrypt_process(data) {
17173 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17174 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
17175 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17176 var result = new Uint8Array(rlen);
17177 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17178 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17179 while (dlen > 0) {
17180 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17181 len += wlen;
17182 dpos += wlen;
17183 dlen -= wlen;
17184 asm_args[0] = pos;
17185 asm_args[1] = len & ~15;
17186 asm_args[16] = counter / 4294967296 >>> 0;
17187 asm_args[17] = counter >>> 0;
17188 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17189 result.set(heap.subarray(pos, pos + wlen), rpos);
17190 counter += wlen >>> 4;
17191 rpos += wlen;
17192 if (wlen < len) {
17193 pos += wlen;
17194 len -= wlen;
17195 } else {
17196 pos = _aes_heap_start;
17197 len = 0;
17198 }
17199 }
17200 this.result = result;
17201 this.counter = counter;
17202 this.pos = pos;
17203 this.len = len;
17204 return this;
17205 }
17206 function ccm_aes_encrypt_finish() {
17207 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17208 var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, wlen = 0;
17209 var result = new Uint8Array(len + tagSize);
17210 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17211 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17212 asm_args[0] = pos;
17213 asm_args[1] = len;
17214 asm_args[16] = counter / 4294967296 >>> 0;
17215 asm_args[17] = counter >>> 0;
17216 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17217 result.set(heap.subarray(pos, pos + wlen));
17218 counter = 1;
17219 pos = _aes_heap_start;
17220 len = 0;
17221 asm.save_state(_aes_heap_start);
17222 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17223 asm_args[17] = 0;
17224 asm.ccm_encrypt.apply(asm, asm_args);
17225 result.set(heap.subarray(_aes_heap_start, _aes_heap_start + tagSize), wlen);
17226 this.result = result;
17227 this.counter = counter;
17228 this.pos = pos;
17229 this.len = len;
17230 return this;
17231 }
17232 function ccm_aes_encrypt(data) {
17233 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17234 var result1 = ccm_aes_encrypt_process.call(this, data).result, result2 = ccm_aes_encrypt_finish.call(this).result, result;
17235 result = new Uint8Array(result1.length + result2.length);
17236 result.set(result1);
17237 result.set(result2, result1.length);
17238 this.result = result;
17239 return this;
17240 }
17241 function ccm_aes_decrypt_process(data) {
17242 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17243 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
17244 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17245 var result = new Uint8Array(rlen);
17246 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17247 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17248 while (dlen > 0) {
17249 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17250 len += wlen;
17251 dpos += wlen;
17252 dlen -= wlen;
17253 asm_args[0] = pos;
17254 asm_args[1] = len + dlen - tagSize >= _aes_block_size ? dlen >= tagSize ? len & ~15 : len + dlen - tagSize & ~15 : 0;
17255 asm_args[16] = counter / 4294967296 >>> 0;
17256 asm_args[17] = counter >>> 0;
17257 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17258 result.set(heap.subarray(pos, pos + wlen), rpos);
17259 counter += wlen >>> 4;
17260 rpos += wlen;
17261 if (wlen < len) {
17262 pos += wlen;
17263 len -= wlen;
17264 } else {
17265 pos = _aes_heap_start;
17266 len = 0;
17267 }
17268 }
17269 this.result = result.subarray(0, rpos);
17270 this.counter = counter;
17271 this.pos = pos;
17272 this.len = len;
17273 return this;
17274 }
17275 function ccm_aes_decrypt_finish() {
17276 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17277 var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, rlen = len - tagSize, wlen = 0;
17278 if (len < tagSize) throw new IllegalStateError("authentication tag not found");
17279 var result = new Uint8Array(rlen), atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));
17280 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17281 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17282 asm_args[0] = pos;
17283 asm_args[1] = rlen;
17284 asm_args[16] = counter / 4294967296 >>> 0;
17285 asm_args[17] = counter >>> 0;
17286 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17287 result.set(heap.subarray(pos, pos + wlen));
17288 counter = 1;
17289 pos = _aes_heap_start;
17290 len = 0;
17291 asm.save_state(_aes_heap_start);
17292 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17293 asm_args[17] = 0;
17294 asm.ccm_encrypt.apply(asm, asm_args);
17295 var acheck = 0;
17296 for (var i = 0; i < tagSize; ++i) acheck |= atag[i] ^ heap[_aes_heap_start + i];
17297 if (acheck) throw new SecurityError("data integrity check failed");
17298 this.result = result;
17299 this.counter = counter;
17300 this.pos = pos;
17301 this.len = len;
17302 return this;
17303 }
17304 function ccm_aes_decrypt(data) {
17305 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17306 var result1 = ccm_aes_decrypt_process.call(this, data).result, result2 = ccm_aes_decrypt_finish.call(this).result, result;
17307 result = new Uint8Array(result1.length + result2.length);
17308 result.set(result1);
17309 result.set(result2, result1.length);
17310 this.result = result;
17311 return this;
17312 }
17313 var ccm_aes_prototype = ccm_aes_constructor.prototype;
17314 ccm_aes_prototype.reset = ccm_aes_reset;
17315 ccm_aes_prototype.encrypt = ccm_aes_encrypt;
17316 ccm_aes_prototype.decrypt = ccm_aes_decrypt;
17317 var ccm_aes_encrypt_prototype = ccm_aes_encrypt_constructor.prototype;
17318 ccm_aes_encrypt_prototype.reset = ccm_aes_reset;
17319 ccm_aes_encrypt_prototype.process = ccm_aes_encrypt_process;
17320 ccm_aes_encrypt_prototype.finish = ccm_aes_encrypt_finish;
17321 var ccm_aes_decrypt_prototype = ccm_aes_decrypt_constructor.prototype;
17322 ccm_aes_decrypt_prototype.reset = ccm_aes_reset;
17323 ccm_aes_decrypt_prototype.process = ccm_aes_decrypt_process;
17324 ccm_aes_decrypt_prototype.finish = ccm_aes_decrypt_finish;
17325 function cfb_aes_constructor(options) {
17326 this.padding = false;
17327 this.mode = "cfb";
17328 this.iv = null;
17329 _aes_constructor.call(this, options);
17330 }
17331 function cfb_aes_encrypt_constructor(options) {
17332 cfb_aes_constructor.call(this, options);
17333 }
17334 function cfb_aes_decrypt_constructor(options) {
17335 cfb_aes_constructor.call(this, options);
17336 }
17337 function cfb_aes_reset(options) {
17338 options = options || {};
17339 _aes_reset.call(this, options);
17340 _aes_init_iv.call(this, options.iv);
17341 return this;
17342 }
17343 function cfb_aes_encrypt_process(data) {
17344 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17345 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
17346 var result = new Uint8Array(rlen);
17347 while (dlen > 0) {
17348 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17349 len += wlen;
17350 dpos += wlen;
17351 dlen -= wlen;
17352 wlen = asm.cfb_encrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17353 result.set(heap.subarray(pos, pos + wlen), rpos);
17354 rpos += wlen;
17355 if (wlen < len) {
17356 pos += wlen;
17357 len -= wlen;
17358 } else {
17359 pos = _aes_heap_start;
17360 len = 0;
17361 }
17362 }
17363 this.result = result;
17364 this.pos = pos;
17365 this.len = len;
17366 return this;
17367 }
17368 function cfb_aes_encrypt_finish() {
17369 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17370 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17371 var result = new Uint8Array(len);
17372 asm.cfb_encrypt(pos, len);
17373 result.set(heap.subarray(pos, pos + len));
17374 this.result = result;
17375 this.pos = _aes_heap_start;
17376 this.len = 0;
17377 return this;
17378 }
17379 function cfb_aes_encrypt(data) {
17380 var result1 = cfb_aes_encrypt_process.call(this, data).result, result2 = cfb_aes_encrypt_finish.call(this).result, result;
17381 result = new Uint8Array(result1.length + result2.length);
17382 result.set(result1);
17383 result.set(result2, result1.length);
17384 this.result = result;
17385 return this;
17386 }
17387 function cfb_aes_decrypt_process(data) {
17388 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17389 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, asm = this.asm, heap = this.heap, pos = this.pos, len = this.len, rpos = 0, rlen = _aes_block_size * Math.floor((len + dlen) / _aes_block_size), wlen = 0;
17390 var result = new Uint8Array(rlen);
17391 while (dlen > 0) {
17392 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17393 len += wlen;
17394 dpos += wlen;
17395 dlen -= wlen;
17396 wlen = asm.cfb_decrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17397 result.set(heap.subarray(pos, pos + wlen), rpos);
17398 rpos += wlen;
17399 if (wlen < len) {
17400 pos += wlen;
17401 len -= wlen;
17402 } else {
17403 pos = _aes_heap_start;
17404 len = 0;
17405 }
17406 }
17407 this.result = result.subarray(0, rpos);
17408 this.pos = pos;
17409 this.len = len;
17410 return this;
17411 }
17412 function cfb_aes_decrypt_finish() {
17413 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17414 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17415 if (len === 0) {
17416 this.result = new Uint8Array(0);
17417 this.pos = _aes_heap_start;
17418 this.len = 0;
17419 return this;
17420 }
17421 var result = new Uint8Array(len);
17422 asm.cfb_decrypt(pos, len);
17423 result.set(heap.subarray(pos, pos + len));
17424 this.result = result;
17425 this.pos = _aes_heap_start;
17426 this.len = 0;
17427 return this;
17428 }
17429 function cfb_aes_decrypt(data) {
17430 var result1 = cfb_aes_decrypt_process.call(this, data).result, result2 = cfb_aes_decrypt_finish.call(this).result, result;
17431 result = new Uint8Array(result1.length + result2.length);
17432 result.set(result1);
17433 result.set(result2, result1.length);
17434 this.result = result;
17435 return this;
17436 }
17437 var cfb_aes_encrypt_prototype = cfb_aes_encrypt_constructor.prototype;
17438 cfb_aes_encrypt_prototype.reset = cfb_aes_reset;
17439 cfb_aes_encrypt_prototype.process = cfb_aes_encrypt_process;
17440 cfb_aes_encrypt_prototype.finish = cfb_aes_encrypt_finish;
17441 var cfb_aes_decrypt_prototype = cfb_aes_decrypt_constructor.prototype;
17442 cfb_aes_decrypt_prototype.reset = cfb_aes_reset;
17443 cfb_aes_decrypt_prototype.process = cfb_aes_decrypt_process;
17444 cfb_aes_decrypt_prototype.finish = cfb_aes_decrypt_finish;
17445 var cfb_aes_prototype = cfb_aes_constructor.prototype;
17446 cfb_aes_prototype.reset = cfb_aes_reset;
17447 cfb_aes_prototype.encrypt = cfb_aes_encrypt;
17448 cfb_aes_prototype.decrypt = cfb_aes_decrypt;
17449 function sha256_asm(stdlib, foreign, buffer) {
17450 // Closure Compiler warning - commented out
17451 //"use asm";
17452 var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0, TOTAL = 0;
17453 var I0 = 0, I1 = 0, I2 = 0, I3 = 0, I4 = 0, I5 = 0, I6 = 0, I7 = 0, O0 = 0, O1 = 0, O2 = 0, O3 = 0, O4 = 0, O5 = 0, O6 = 0, O7 = 0;
17454 var HEAP = new stdlib.Uint8Array(buffer);
17455 function _core(w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15) {
17456 w0 = w0 | 0;
17457 w1 = w1 | 0;
17458 w2 = w2 | 0;
17459 w3 = w3 | 0;
17460 w4 = w4 | 0;
17461 w5 = w5 | 0;
17462 w6 = w6 | 0;
17463 w7 = w7 | 0;
17464 w8 = w8 | 0;
17465 w9 = w9 | 0;
17466 w10 = w10 | 0;
17467 w11 = w11 | 0;
17468 w12 = w12 | 0;
17469 w13 = w13 | 0;
17470 w14 = w14 | 0;
17471 w15 = w15 | 0;
17472 var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, t = 0;
17473 a = H0;
17474 b = H1;
17475 c = H2;
17476 d = H3;
17477 e = H4;
17478 f = H5;
17479 g = H6;
17480 h = H7;
17481 t = w0 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1116352408 | 0;
17482 h = g;
17483 g = f;
17484 f = e;
17485 e = d + t | 0;
17486 d = c;
17487 c = b;
17488 b = a;
17489 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17490 t = w1 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1899447441 | 0;
17491 h = g;
17492 g = f;
17493 f = e;
17494 e = d + t | 0;
17495 d = c;
17496 c = b;
17497 b = a;
17498 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17499 t = w2 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3049323471 | 0;
17500 h = g;
17501 g = f;
17502 f = e;
17503 e = d + t | 0;
17504 d = c;
17505 c = b;
17506 b = a;
17507 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17508 t = w3 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3921009573 | 0;
17509 h = g;
17510 g = f;
17511 f = e;
17512 e = d + t | 0;
17513 d = c;
17514 c = b;
17515 b = a;
17516 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17517 t = w4 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 961987163 | 0;
17518 h = g;
17519 g = f;
17520 f = e;
17521 e = d + t | 0;
17522 d = c;
17523 c = b;
17524 b = a;
17525 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17526 t = w5 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1508970993 | 0;
17527 h = g;
17528 g = f;
17529 f = e;
17530 e = d + t | 0;
17531 d = c;
17532 c = b;
17533 b = a;
17534 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17535 t = w6 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2453635748 | 0;
17536 h = g;
17537 g = f;
17538 f = e;
17539 e = d + t | 0;
17540 d = c;
17541 c = b;
17542 b = a;
17543 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17544 t = w7 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2870763221 | 0;
17545 h = g;
17546 g = f;
17547 f = e;
17548 e = d + t | 0;
17549 d = c;
17550 c = b;
17551 b = a;
17552 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17553 t = w8 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3624381080 | 0;
17554 h = g;
17555 g = f;
17556 f = e;
17557 e = d + t | 0;
17558 d = c;
17559 c = b;
17560 b = a;
17561 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17562 t = w9 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 310598401 | 0;
17563 h = g;
17564 g = f;
17565 f = e;
17566 e = d + t | 0;
17567 d = c;
17568 c = b;
17569 b = a;
17570 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17571 t = w10 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 607225278 | 0;
17572 h = g;
17573 g = f;
17574 f = e;
17575 e = d + t | 0;
17576 d = c;
17577 c = b;
17578 b = a;
17579 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17580 t = w11 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1426881987 | 0;
17581 h = g;
17582 g = f;
17583 f = e;
17584 e = d + t | 0;
17585 d = c;
17586 c = b;
17587 b = a;
17588 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17589 t = w12 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1925078388 | 0;
17590 h = g;
17591 g = f;
17592 f = e;
17593 e = d + t | 0;
17594 d = c;
17595 c = b;
17596 b = a;
17597 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17598 t = w13 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2162078206 | 0;
17599 h = g;
17600 g = f;
17601 f = e;
17602 e = d + t | 0;
17603 d = c;
17604 c = b;
17605 b = a;
17606 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17607 t = w14 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2614888103 | 0;
17608 h = g;
17609 g = f;
17610 f = e;
17611 e = d + t | 0;
17612 d = c;
17613 c = b;
17614 b = a;
17615 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17616 t = w15 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3248222580 | 0;
17617 h = g;
17618 g = f;
17619 f = e;
17620 e = d + t | 0;
17621 d = c;
17622 c = b;
17623 b = a;
17624 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17625 w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0;
17626 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3835390401 | 0;
17627 h = g;
17628 g = f;
17629 f = e;
17630 e = d + t | 0;
17631 d = c;
17632 c = b;
17633 b = a;
17634 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17635 w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0;
17636 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4022224774 | 0;
17637 h = g;
17638 g = f;
17639 f = e;
17640 e = d + t | 0;
17641 d = c;
17642 c = b;
17643 b = a;
17644 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17645 w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0;
17646 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 264347078 | 0;
17647 h = g;
17648 g = f;
17649 f = e;
17650 e = d + t | 0;
17651 d = c;
17652 c = b;
17653 b = a;
17654 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17655 w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0;
17656 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 604807628 | 0;
17657 h = g;
17658 g = f;
17659 f = e;
17660 e = d + t | 0;
17661 d = c;
17662 c = b;
17663 b = a;
17664 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17665 w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0;
17666 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 770255983 | 0;
17667 h = g;
17668 g = f;
17669 f = e;
17670 e = d + t | 0;
17671 d = c;
17672 c = b;
17673 b = a;
17674 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17675 w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0;
17676 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1249150122 | 0;
17677 h = g;
17678 g = f;
17679 f = e;
17680 e = d + t | 0;
17681 d = c;
17682 c = b;
17683 b = a;
17684 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17685 w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0;
17686 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1555081692 | 0;
17687 h = g;
17688 g = f;
17689 f = e;
17690 e = d + t | 0;
17691 d = c;
17692 c = b;
17693 b = a;
17694 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17695 w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0;
17696 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1996064986 | 0;
17697 h = g;
17698 g = f;
17699 f = e;
17700 e = d + t | 0;
17701 d = c;
17702 c = b;
17703 b = a;
17704 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17705 w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0;
17706 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2554220882 | 0;
17707 h = g;
17708 g = f;
17709 f = e;
17710 e = d + t | 0;
17711 d = c;
17712 c = b;
17713 b = a;
17714 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17715 w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0;
17716 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2821834349 | 0;
17717 h = g;
17718 g = f;
17719 f = e;
17720 e = d + t | 0;
17721 d = c;
17722 c = b;
17723 b = a;
17724 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17725 w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0;
17726 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2952996808 | 0;
17727 h = g;
17728 g = f;
17729 f = e;
17730 e = d + t | 0;
17731 d = c;
17732 c = b;
17733 b = a;
17734 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17735 w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0;
17736 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3210313671 | 0;
17737 h = g;
17738 g = f;
17739 f = e;
17740 e = d + t | 0;
17741 d = c;
17742 c = b;
17743 b = a;
17744 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17745 w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0;
17746 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3336571891 | 0;
17747 h = g;
17748 g = f;
17749 f = e;
17750 e = d + t | 0;
17751 d = c;
17752 c = b;
17753 b = a;
17754 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17755 w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0;
17756 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3584528711 | 0;
17757 h = g;
17758 g = f;
17759 f = e;
17760 e = d + t | 0;
17761 d = c;
17762 c = b;
17763 b = a;
17764 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17765 w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0;
17766 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 113926993 | 0;
17767 h = g;
17768 g = f;
17769 f = e;
17770 e = d + t | 0;
17771 d = c;
17772 c = b;
17773 b = a;
17774 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17775 w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0;
17776 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 338241895 | 0;
17777 h = g;
17778 g = f;
17779 f = e;
17780 e = d + t | 0;
17781 d = c;
17782 c = b;
17783 b = a;
17784 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17785 w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0;
17786 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 666307205 | 0;
17787 h = g;
17788 g = f;
17789 f = e;
17790 e = d + t | 0;
17791 d = c;
17792 c = b;
17793 b = a;
17794 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17795 w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0;
17796 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 773529912 | 0;
17797 h = g;
17798 g = f;
17799 f = e;
17800 e = d + t | 0;
17801 d = c;
17802 c = b;
17803 b = a;
17804 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17805 w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0;
17806 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1294757372 | 0;
17807 h = g;
17808 g = f;
17809 f = e;
17810 e = d + t | 0;
17811 d = c;
17812 c = b;
17813 b = a;
17814 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17815 w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0;
17816 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1396182291 | 0;
17817 h = g;
17818 g = f;
17819 f = e;
17820 e = d + t | 0;
17821 d = c;
17822 c = b;
17823 b = a;
17824 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17825 w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0;
17826 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1695183700 | 0;
17827 h = g;
17828 g = f;
17829 f = e;
17830 e = d + t | 0;
17831 d = c;
17832 c = b;
17833 b = a;
17834 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17835 w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0;
17836 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1986661051 | 0;
17837 h = g;
17838 g = f;
17839 f = e;
17840 e = d + t | 0;
17841 d = c;
17842 c = b;
17843 b = a;
17844 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17845 w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0;
17846 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2177026350 | 0;
17847 h = g;
17848 g = f;
17849 f = e;
17850 e = d + t | 0;
17851 d = c;
17852 c = b;
17853 b = a;
17854 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17855 w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0;
17856 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2456956037 | 0;
17857 h = g;
17858 g = f;
17859 f = e;
17860 e = d + t | 0;
17861 d = c;
17862 c = b;
17863 b = a;
17864 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17865 w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0;
17866 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2730485921 | 0;
17867 h = g;
17868 g = f;
17869 f = e;
17870 e = d + t | 0;
17871 d = c;
17872 c = b;
17873 b = a;
17874 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17875 w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0;
17876 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2820302411 | 0;
17877 h = g;
17878 g = f;
17879 f = e;
17880 e = d + t | 0;
17881 d = c;
17882 c = b;
17883 b = a;
17884 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17885 w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0;
17886 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3259730800 | 0;
17887 h = g;
17888 g = f;
17889 f = e;
17890 e = d + t | 0;
17891 d = c;
17892 c = b;
17893 b = a;
17894 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17895 w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0;
17896 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3345764771 | 0;
17897 h = g;
17898 g = f;
17899 f = e;
17900 e = d + t | 0;
17901 d = c;
17902 c = b;
17903 b = a;
17904 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17905 w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0;
17906 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3516065817 | 0;
17907 h = g;
17908 g = f;
17909 f = e;
17910 e = d + t | 0;
17911 d = c;
17912 c = b;
17913 b = a;
17914 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17915 w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0;
17916 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3600352804 | 0;
17917 h = g;
17918 g = f;
17919 f = e;
17920 e = d + t | 0;
17921 d = c;
17922 c = b;
17923 b = a;
17924 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17925 w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0;
17926 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4094571909 | 0;
17927 h = g;
17928 g = f;
17929 f = e;
17930 e = d + t | 0;
17931 d = c;
17932 c = b;
17933 b = a;
17934 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17935 w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0;
17936 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 275423344 | 0;
17937 h = g;
17938 g = f;
17939 f = e;
17940 e = d + t | 0;
17941 d = c;
17942 c = b;
17943 b = a;
17944 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17945 w0 = t = (w1 >>> 7 ^ w1 >>> 18 ^ w1 >>> 3 ^ w1 << 25 ^ w1 << 14) + (w14 >>> 17 ^ w14 >>> 19 ^ w14 >>> 10 ^ w14 << 15 ^ w14 << 13) + w0 + w9 | 0;
17946 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 430227734 | 0;
17947 h = g;
17948 g = f;
17949 f = e;
17950 e = d + t | 0;
17951 d = c;
17952 c = b;
17953 b = a;
17954 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17955 w1 = t = (w2 >>> 7 ^ w2 >>> 18 ^ w2 >>> 3 ^ w2 << 25 ^ w2 << 14) + (w15 >>> 17 ^ w15 >>> 19 ^ w15 >>> 10 ^ w15 << 15 ^ w15 << 13) + w1 + w10 | 0;
17956 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 506948616 | 0;
17957 h = g;
17958 g = f;
17959 f = e;
17960 e = d + t | 0;
17961 d = c;
17962 c = b;
17963 b = a;
17964 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17965 w2 = t = (w3 >>> 7 ^ w3 >>> 18 ^ w3 >>> 3 ^ w3 << 25 ^ w3 << 14) + (w0 >>> 17 ^ w0 >>> 19 ^ w0 >>> 10 ^ w0 << 15 ^ w0 << 13) + w2 + w11 | 0;
17966 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 659060556 | 0;
17967 h = g;
17968 g = f;
17969 f = e;
17970 e = d + t | 0;
17971 d = c;
17972 c = b;
17973 b = a;
17974 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17975 w3 = t = (w4 >>> 7 ^ w4 >>> 18 ^ w4 >>> 3 ^ w4 << 25 ^ w4 << 14) + (w1 >>> 17 ^ w1 >>> 19 ^ w1 >>> 10 ^ w1 << 15 ^ w1 << 13) + w3 + w12 | 0;
17976 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 883997877 | 0;
17977 h = g;
17978 g = f;
17979 f = e;
17980 e = d + t | 0;
17981 d = c;
17982 c = b;
17983 b = a;
17984 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17985 w4 = t = (w5 >>> 7 ^ w5 >>> 18 ^ w5 >>> 3 ^ w5 << 25 ^ w5 << 14) + (w2 >>> 17 ^ w2 >>> 19 ^ w2 >>> 10 ^ w2 << 15 ^ w2 << 13) + w4 + w13 | 0;
17986 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 958139571 | 0;
17987 h = g;
17988 g = f;
17989 f = e;
17990 e = d + t | 0;
17991 d = c;
17992 c = b;
17993 b = a;
17994 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17995 w5 = t = (w6 >>> 7 ^ w6 >>> 18 ^ w6 >>> 3 ^ w6 << 25 ^ w6 << 14) + (w3 >>> 17 ^ w3 >>> 19 ^ w3 >>> 10 ^ w3 << 15 ^ w3 << 13) + w5 + w14 | 0;
17996 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1322822218 | 0;
17997 h = g;
17998 g = f;
17999 f = e;
18000 e = d + t | 0;
18001 d = c;
18002 c = b;
18003 b = a;
18004 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18005 w6 = t = (w7 >>> 7 ^ w7 >>> 18 ^ w7 >>> 3 ^ w7 << 25 ^ w7 << 14) + (w4 >>> 17 ^ w4 >>> 19 ^ w4 >>> 10 ^ w4 << 15 ^ w4 << 13) + w6 + w15 | 0;
18006 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1537002063 | 0;
18007 h = g;
18008 g = f;
18009 f = e;
18010 e = d + t | 0;
18011 d = c;
18012 c = b;
18013 b = a;
18014 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18015 w7 = t = (w8 >>> 7 ^ w8 >>> 18 ^ w8 >>> 3 ^ w8 << 25 ^ w8 << 14) + (w5 >>> 17 ^ w5 >>> 19 ^ w5 >>> 10 ^ w5 << 15 ^ w5 << 13) + w7 + w0 | 0;
18016 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1747873779 | 0;
18017 h = g;
18018 g = f;
18019 f = e;
18020 e = d + t | 0;
18021 d = c;
18022 c = b;
18023 b = a;
18024 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18025 w8 = t = (w9 >>> 7 ^ w9 >>> 18 ^ w9 >>> 3 ^ w9 << 25 ^ w9 << 14) + (w6 >>> 17 ^ w6 >>> 19 ^ w6 >>> 10 ^ w6 << 15 ^ w6 << 13) + w8 + w1 | 0;
18026 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1955562222 | 0;
18027 h = g;
18028 g = f;
18029 f = e;
18030 e = d + t | 0;
18031 d = c;
18032 c = b;
18033 b = a;
18034 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18035 w9 = t = (w10 >>> 7 ^ w10 >>> 18 ^ w10 >>> 3 ^ w10 << 25 ^ w10 << 14) + (w7 >>> 17 ^ w7 >>> 19 ^ w7 >>> 10 ^ w7 << 15 ^ w7 << 13) + w9 + w2 | 0;
18036 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2024104815 | 0;
18037 h = g;
18038 g = f;
18039 f = e;
18040 e = d + t | 0;
18041 d = c;
18042 c = b;
18043 b = a;
18044 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18045 w10 = t = (w11 >>> 7 ^ w11 >>> 18 ^ w11 >>> 3 ^ w11 << 25 ^ w11 << 14) + (w8 >>> 17 ^ w8 >>> 19 ^ w8 >>> 10 ^ w8 << 15 ^ w8 << 13) + w10 + w3 | 0;
18046 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2227730452 | 0;
18047 h = g;
18048 g = f;
18049 f = e;
18050 e = d + t | 0;
18051 d = c;
18052 c = b;
18053 b = a;
18054 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18055 w11 = t = (w12 >>> 7 ^ w12 >>> 18 ^ w12 >>> 3 ^ w12 << 25 ^ w12 << 14) + (w9 >>> 17 ^ w9 >>> 19 ^ w9 >>> 10 ^ w9 << 15 ^ w9 << 13) + w11 + w4 | 0;
18056 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2361852424 | 0;
18057 h = g;
18058 g = f;
18059 f = e;
18060 e = d + t | 0;
18061 d = c;
18062 c = b;
18063 b = a;
18064 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18065 w12 = t = (w13 >>> 7 ^ w13 >>> 18 ^ w13 >>> 3 ^ w13 << 25 ^ w13 << 14) + (w10 >>> 17 ^ w10 >>> 19 ^ w10 >>> 10 ^ w10 << 15 ^ w10 << 13) + w12 + w5 | 0;
18066 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2428436474 | 0;
18067 h = g;
18068 g = f;
18069 f = e;
18070 e = d + t | 0;
18071 d = c;
18072 c = b;
18073 b = a;
18074 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18075 w13 = t = (w14 >>> 7 ^ w14 >>> 18 ^ w14 >>> 3 ^ w14 << 25 ^ w14 << 14) + (w11 >>> 17 ^ w11 >>> 19 ^ w11 >>> 10 ^ w11 << 15 ^ w11 << 13) + w13 + w6 | 0;
18076 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2756734187 | 0;
18077 h = g;
18078 g = f;
18079 f = e;
18080 e = d + t | 0;
18081 d = c;
18082 c = b;
18083 b = a;
18084 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18085 w14 = t = (w15 >>> 7 ^ w15 >>> 18 ^ w15 >>> 3 ^ w15 << 25 ^ w15 << 14) + (w12 >>> 17 ^ w12 >>> 19 ^ w12 >>> 10 ^ w12 << 15 ^ w12 << 13) + w14 + w7 | 0;
18086 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3204031479 | 0;
18087 h = g;
18088 g = f;
18089 f = e;
18090 e = d + t | 0;
18091 d = c;
18092 c = b;
18093 b = a;
18094 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18095 w15 = t = (w0 >>> 7 ^ w0 >>> 18 ^ w0 >>> 3 ^ w0 << 25 ^ w0 << 14) + (w13 >>> 17 ^ w13 >>> 19 ^ w13 >>> 10 ^ w13 << 15 ^ w13 << 13) + w15 + w8 | 0;
18096 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3329325298 | 0;
18097 h = g;
18098 g = f;
18099 f = e;
18100 e = d + t | 0;
18101 d = c;
18102 c = b;
18103 b = a;
18104 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18105 H0 = H0 + a | 0;
18106 H1 = H1 + b | 0;
18107 H2 = H2 + c | 0;
18108 H3 = H3 + d | 0;
18109 H4 = H4 + e | 0;
18110 H5 = H5 + f | 0;
18111 H6 = H6 + g | 0;
18112 H7 = H7 + h | 0;
18113 }
18114 function _core_heap(offset) {
18115 offset = offset | 0;
18116 _core(HEAP[offset | 0] << 24 | HEAP[offset | 1] << 16 | HEAP[offset | 2] << 8 | HEAP[offset | 3], HEAP[offset | 4] << 24 | HEAP[offset | 5] << 16 | HEAP[offset | 6] << 8 | HEAP[offset | 7], HEAP[offset | 8] << 24 | HEAP[offset | 9] << 16 | HEAP[offset | 10] << 8 | HEAP[offset | 11], HEAP[offset | 12] << 24 | HEAP[offset | 13] << 16 | HEAP[offset | 14] << 8 | HEAP[offset | 15], HEAP[offset | 16] << 24 | HEAP[offset | 17] << 16 | HEAP[offset | 18] << 8 | HEAP[offset | 19], HEAP[offset | 20] << 24 | HEAP[offset | 21] << 16 | HEAP[offset | 22] << 8 | HEAP[offset | 23], HEAP[offset | 24] << 24 | HEAP[offset | 25] << 16 | HEAP[offset | 26] << 8 | HEAP[offset | 27], HEAP[offset | 28] << 24 | HEAP[offset | 29] << 16 | HEAP[offset | 30] << 8 | HEAP[offset | 31], HEAP[offset | 32] << 24 | HEAP[offset | 33] << 16 | HEAP[offset | 34] << 8 | HEAP[offset | 35], HEAP[offset | 36] << 24 | HEAP[offset | 37] << 16 | HEAP[offset | 38] << 8 | HEAP[offset | 39], HEAP[offset | 40] << 24 | HEAP[offset | 41] << 16 | HEAP[offset | 42] << 8 | HEAP[offset | 43], HEAP[offset | 44] << 24 | HEAP[offset | 45] << 16 | HEAP[offset | 46] << 8 | HEAP[offset | 47], HEAP[offset | 48] << 24 | HEAP[offset | 49] << 16 | HEAP[offset | 50] << 8 | HEAP[offset | 51], HEAP[offset | 52] << 24 | HEAP[offset | 53] << 16 | HEAP[offset | 54] << 8 | HEAP[offset | 55], HEAP[offset | 56] << 24 | HEAP[offset | 57] << 16 | HEAP[offset | 58] << 8 | HEAP[offset | 59], HEAP[offset | 60] << 24 | HEAP[offset | 61] << 16 | HEAP[offset | 62] << 8 | HEAP[offset | 63]);
18117 }
18118 function _state_to_heap(output) {
18119 output = output | 0;
18120 HEAP[output | 0] = H0 >>> 24;
18121 HEAP[output | 1] = H0 >>> 16 & 255;
18122 HEAP[output | 2] = H0 >>> 8 & 255;
18123 HEAP[output | 3] = H0 & 255;
18124 HEAP[output | 4] = H1 >>> 24;
18125 HEAP[output | 5] = H1 >>> 16 & 255;
18126 HEAP[output | 6] = H1 >>> 8 & 255;
18127 HEAP[output | 7] = H1 & 255;
18128 HEAP[output | 8] = H2 >>> 24;
18129 HEAP[output | 9] = H2 >>> 16 & 255;
18130 HEAP[output | 10] = H2 >>> 8 & 255;
18131 HEAP[output | 11] = H2 & 255;
18132 HEAP[output | 12] = H3 >>> 24;
18133 HEAP[output | 13] = H3 >>> 16 & 255;
18134 HEAP[output | 14] = H3 >>> 8 & 255;
18135 HEAP[output | 15] = H3 & 255;
18136 HEAP[output | 16] = H4 >>> 24;
18137 HEAP[output | 17] = H4 >>> 16 & 255;
18138 HEAP[output | 18] = H4 >>> 8 & 255;
18139 HEAP[output | 19] = H4 & 255;
18140 HEAP[output | 20] = H5 >>> 24;
18141 HEAP[output | 21] = H5 >>> 16 & 255;
18142 HEAP[output | 22] = H5 >>> 8 & 255;
18143 HEAP[output | 23] = H5 & 255;
18144 HEAP[output | 24] = H6 >>> 24;
18145 HEAP[output | 25] = H6 >>> 16 & 255;
18146 HEAP[output | 26] = H6 >>> 8 & 255;
18147 HEAP[output | 27] = H6 & 255;
18148 HEAP[output | 28] = H7 >>> 24;
18149 HEAP[output | 29] = H7 >>> 16 & 255;
18150 HEAP[output | 30] = H7 >>> 8 & 255;
18151 HEAP[output | 31] = H7 & 255;
18152 }
18153 function reset() {
18154 H0 = 1779033703;
18155 H1 = 3144134277;
18156 H2 = 1013904242;
18157 H3 = 2773480762;
18158 H4 = 1359893119;
18159 H5 = 2600822924;
18160 H6 = 528734635;
18161 H7 = 1541459225;
18162 TOTAL = 0;
18163 }
18164 function init(h0, h1, h2, h3, h4, h5, h6, h7, total) {
18165 h0 = h0 | 0;
18166 h1 = h1 | 0;
18167 h2 = h2 | 0;
18168 h3 = h3 | 0;
18169 h4 = h4 | 0;
18170 h5 = h5 | 0;
18171 h6 = h6 | 0;
18172 h7 = h7 | 0;
18173 total = total | 0;
18174 H0 = h0;
18175 H1 = h1;
18176 H2 = h2;
18177 H3 = h3;
18178 H4 = h4;
18179 H5 = h5;
18180 H6 = h6;
18181 H7 = h7;
18182 TOTAL = total;
18183 }
18184 function process(offset, length) {
18185 offset = offset | 0;
18186 length = length | 0;
18187 var hashed = 0;
18188 if (offset & 63) return -1;
18189 while ((length | 0) >= 64) {
18190 _core_heap(offset);
18191 offset = offset + 64 | 0;
18192 length = length - 64 | 0;
18193 hashed = hashed + 64 | 0;
18194 }
18195 TOTAL = TOTAL + hashed | 0;
18196 return hashed | 0;
18197 }
18198 function finish(offset, length, output) {
18199 offset = offset | 0;
18200 length = length | 0;
18201 output = output | 0;
18202 var hashed = 0, i = 0;
18203 if (offset & 63) return -1;
18204 if (~output) if (output & 31) return -1;
18205 if ((length | 0) >= 64) {
18206 hashed = process(offset, length) | 0;
18207 if ((hashed | 0) == -1) return -1;
18208 offset = offset + hashed | 0;
18209 length = length - hashed | 0;
18210 }
18211 hashed = hashed + length | 0;
18212 TOTAL = TOTAL + length | 0;
18213 HEAP[offset | length] = 128;
18214 if ((length | 0) >= 56) {
18215 for (i = length + 1 | 0; (i | 0) < 64; i = i + 1 | 0) HEAP[offset | i] = 0;
18216 _core_heap(offset);
18217 length = 0;
18218 HEAP[offset | 0] = 0;
18219 }
18220 for (i = length + 1 | 0; (i | 0) < 59; i = i + 1 | 0) HEAP[offset | i] = 0;
18221 HEAP[offset | 59] = TOTAL >>> 29;
18222 HEAP[offset | 60] = TOTAL >>> 21 & 255;
18223 HEAP[offset | 61] = TOTAL >>> 13 & 255;
18224 HEAP[offset | 62] = TOTAL >>> 5 & 255;
18225 HEAP[offset | 63] = TOTAL << 3 & 255;
18226 _core_heap(offset);
18227 if (~output) _state_to_heap(output);
18228 return hashed | 0;
18229 }
18230 function hmac_reset() {
18231 H0 = I0;
18232 H1 = I1;
18233 H2 = I2;
18234 H3 = I3;
18235 H4 = I4;
18236 H5 = I5;
18237 H6 = I6;
18238 H7 = I7;
18239 TOTAL = 64;
18240 }
18241 function _hmac_opad() {
18242 H0 = O0;
18243 H1 = O1;
18244 H2 = O2;
18245 H3 = O3;
18246 H4 = O4;
18247 H5 = O5;
18248 H6 = O6;
18249 H7 = O7;
18250 TOTAL = 64;
18251 }
18252 function hmac_init(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) {
18253 p0 = p0 | 0;
18254 p1 = p1 | 0;
18255 p2 = p2 | 0;
18256 p3 = p3 | 0;
18257 p4 = p4 | 0;
18258 p5 = p5 | 0;
18259 p6 = p6 | 0;
18260 p7 = p7 | 0;
18261 p8 = p8 | 0;
18262 p9 = p9 | 0;
18263 p10 = p10 | 0;
18264 p11 = p11 | 0;
18265 p12 = p12 | 0;
18266 p13 = p13 | 0;
18267 p14 = p14 | 0;
18268 p15 = p15 | 0;
18269 reset();
18270 _core(p0 ^ 1549556828, p1 ^ 1549556828, p2 ^ 1549556828, p3 ^ 1549556828, p4 ^ 1549556828, p5 ^ 1549556828, p6 ^ 1549556828, p7 ^ 1549556828, p8 ^ 1549556828, p9 ^ 1549556828, p10 ^ 1549556828, p11 ^ 1549556828, p12 ^ 1549556828, p13 ^ 1549556828, p14 ^ 1549556828, p15 ^ 1549556828);
18271 O0 = H0;
18272 O1 = H1;
18273 O2 = H2;
18274 O3 = H3;
18275 O4 = H4;
18276 O5 = H5;
18277 O6 = H6;
18278 O7 = H7;
18279 reset();
18280 _core(p0 ^ 909522486, p1 ^ 909522486, p2 ^ 909522486, p3 ^ 909522486, p4 ^ 909522486, p5 ^ 909522486, p6 ^ 909522486, p7 ^ 909522486, p8 ^ 909522486, p9 ^ 909522486, p10 ^ 909522486, p11 ^ 909522486, p12 ^ 909522486, p13 ^ 909522486, p14 ^ 909522486, p15 ^ 909522486);
18281 I0 = H0;
18282 I1 = H1;
18283 I2 = H2;
18284 I3 = H3;
18285 I4 = H4;
18286 I5 = H5;
18287 I6 = H6;
18288 I7 = H7;
18289 TOTAL = 64;
18290 }
18291 function hmac_finish(offset, length, output) {
18292 offset = offset | 0;
18293 length = length | 0;
18294 output = output | 0;
18295 var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, hashed = 0;
18296 if (offset & 63) return -1;
18297 if (~output) if (output & 31) return -1;
18298 hashed = finish(offset, length, -1) | 0;
18299 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18300 _hmac_opad();
18301 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18302 if (~output) _state_to_heap(output);
18303 return hashed | 0;
18304 }
18305 function pbkdf2_generate_block(offset, length, block, count, output) {
18306 offset = offset | 0;
18307 length = length | 0;
18308 block = block | 0;
18309 count = count | 0;
18310 output = output | 0;
18311 var h0 = 0, h1 = 0, h2 = 0, h3 = 0, h4 = 0, h5 = 0, h6 = 0, h7 = 0, t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0;
18312 if (offset & 63) return -1;
18313 if (~output) if (output & 31) return -1;
18314 HEAP[offset + length | 0] = block >>> 24;
18315 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
18316 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
18317 HEAP[offset + length + 3 | 0] = block & 255;
18318 // Closure compiler warning - The result of the 'bitor' operator is not being used
18319 //hmac_finish(offset, length + 4 | 0, -1) | 0;
18320 hmac_finish(offset, length + 4 | 0, -1);
18321 h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5,
18322 h6 = t6 = H6, h7 = t7 = H7;
18323 count = count - 1 | 0;
18324 while ((count | 0) > 0) {
18325 hmac_reset();
18326 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18327 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18328 _hmac_opad();
18329 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18330 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18331 h0 = h0 ^ H0;
18332 h1 = h1 ^ H1;
18333 h2 = h2 ^ H2;
18334 h3 = h3 ^ H3;
18335 h4 = h4 ^ H4;
18336 h5 = h5 ^ H5;
18337 h6 = h6 ^ H6;
18338 h7 = h7 ^ H7;
18339 count = count - 1 | 0;
18340 }
18341 H0 = h0;
18342 H1 = h1;
18343 H2 = h2;
18344 H3 = h3;
18345 H4 = h4;
18346 H5 = h5;
18347 H6 = h6;
18348 H7 = h7;
18349 if (~output) _state_to_heap(output);
18350 return 0;
18351 }
18352 return {
18353 reset: reset,
18354 init: init,
18355 process: process,
18356 finish: finish,
18357 hmac_reset: hmac_reset,
18358 hmac_init: hmac_init,
18359 hmac_finish: hmac_finish,
18360 pbkdf2_generate_block: pbkdf2_generate_block
18361 };
18362 }
18363 var _sha256_block_size = 64, _sha256_hash_size = 32;
18364 function sha256_constructor(options) {
18365 options = options || {};
18366 options.heapSize = options.heapSize || 4096;
18367 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
18368 this.heap = options.heap || new Uint8Array(options.heapSize);
18369 this.asm = options.asm || sha256_asm(global, null, this.heap.buffer);
18370 this.BLOCK_SIZE = _sha256_block_size;
18371 this.HASH_SIZE = _sha256_hash_size;
18372 this.reset();
18373 }
18374 function sha256_reset() {
18375 this.result = null;
18376 this.pos = 0;
18377 this.len = 0;
18378 this.asm.reset();
18379 return this;
18380 }
18381 function sha256_process(data) {
18382 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18383 var dpos = 0, dlen = 0, clen = 0;
18384 if (is_buffer(data) || is_bytes(data)) {
18385 dpos = data.byteOffset || 0;
18386 dlen = data.byteLength;
18387 } else if (is_string(data)) {
18388 dlen = data.length;
18389 } else {
18390 throw new TypeError("data isn't of expected type");
18391 }
18392 while (dlen > 0) {
18393 clen = this.heap.byteLength - this.pos - this.len;
18394 clen = clen < dlen ? clen : dlen;
18395 if (is_buffer(data) || is_bytes(data)) {
18396 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
18397 } else {
18398 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
18399 }
18400 this.len += clen;
18401 dpos += clen;
18402 dlen -= clen;
18403 clen = this.asm.process(this.pos, this.len);
18404 if (clen < this.len) {
18405 this.pos += clen;
18406 this.len -= clen;
18407 } else {
18408 this.pos = 0;
18409 this.len = 0;
18410 }
18411 }
18412 return this;
18413 }
18414 function sha256_finish() {
18415 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18416 this.asm.finish(this.pos, this.len, 0);
18417 this.result = new Uint8Array(_sha256_hash_size);
18418 this.result.set(this.heap.subarray(0, _sha256_hash_size));
18419 this.pos = 0;
18420 this.len = 0;
18421 return this;
18422 }
18423 sha256_constructor.BLOCK_SIZE = _sha256_block_size;
18424 sha256_constructor.HASH_SIZE = _sha256_hash_size;
18425 var sha256_prototype = sha256_constructor.prototype;
18426 sha256_prototype.reset = sha256_reset;
18427 sha256_prototype.process = sha256_process;
18428 sha256_prototype.finish = sha256_finish;
18429 function sha512_asm(stdlib, foreign, buffer) {
18430 // Closure Compiler warning - commented out
18431 //"use asm";
18432 var H0h = 0, H0l = 0, H1h = 0, H1l = 0, H2h = 0, H2l = 0, H3h = 0, H3l = 0, H4h = 0, H4l = 0, H5h = 0, H5l = 0, H6h = 0, H6l = 0, H7h = 0, H7l = 0, TOTAL = 0;
18433 var I0h = 0, I0l = 0, I1h = 0, I1l = 0, I2h = 0, I2l = 0, I3h = 0, I3l = 0, I4h = 0, I4l = 0, I5h = 0, I5l = 0, I6h = 0, I6l = 0, I7h = 0, I7l = 0, O0h = 0, O0l = 0, O1h = 0, O1l = 0, O2h = 0, O2l = 0, O3h = 0, O3l = 0, O4h = 0, O4l = 0, O5h = 0, O5l = 0, O6h = 0, O6l = 0, O7h = 0, O7l = 0;
18434 var HEAP = new stdlib.Uint8Array(buffer);
18435 function _core(w0h, w0l, w1h, w1l, w2h, w2l, w3h, w3l, w4h, w4l, w5h, w5l, w6h, w6l, w7h, w7l, w8h, w8l, w9h, w9l, w10h, w10l, w11h, w11l, w12h, w12l, w13h, w13l, w14h, w14l, w15h, w15l) {
18436 w0h = w0h | 0;
18437 w0l = w0l | 0;
18438 w1h = w1h | 0;
18439 w1l = w1l | 0;
18440 w2h = w2h | 0;
18441 w2l = w2l | 0;
18442 w3h = w3h | 0;
18443 w3l = w3l | 0;
18444 w4h = w4h | 0;
18445 w4l = w4l | 0;
18446 w5h = w5h | 0;
18447 w5l = w5l | 0;
18448 w6h = w6h | 0;
18449 w6l = w6l | 0;
18450 w7h = w7h | 0;
18451 w7l = w7l | 0;
18452 w8h = w8h | 0;
18453 w8l = w8l | 0;
18454 w9h = w9h | 0;
18455 w9l = w9l | 0;
18456 w10h = w10h | 0;
18457 w10l = w10l | 0;
18458 w11h = w11h | 0;
18459 w11l = w11l | 0;
18460 w12h = w12h | 0;
18461 w12l = w12l | 0;
18462 w13h = w13h | 0;
18463 w13l = w13l | 0;
18464 w14h = w14h | 0;
18465 w14l = w14l | 0;
18466 w15h = w15h | 0;
18467 w15l = w15l | 0;
18468 var ah = 0, al = 0, bh = 0, bl = 0, ch = 0, cl = 0, dh = 0, dl = 0, eh = 0, el = 0, fh = 0, fl = 0, gh = 0, gl = 0, hh = 0, hl = 0, th = 0, tl = 0, xl = 0;
18469 ah = H0h;
18470 al = H0l;
18471 bh = H1h;
18472 bl = H1l;
18473 ch = H2h;
18474 cl = H2l;
18475 dh = H3h;
18476 dl = H3l;
18477 eh = H4h;
18478 el = H4l;
18479 fh = H5h;
18480 fl = H5l;
18481 gh = H6h;
18482 gl = H6l;
18483 hh = H7h;
18484 hl = H7l;
18485 tl = 3609767458 + w0l | 0;
18486 th = 1116352408 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18487 tl = tl + hl | 0;
18488 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18489 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18490 tl = tl + xl | 0;
18491 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18492 xl = gl ^ el & (fl ^ gl) | 0;
18493 tl = tl + xl | 0;
18494 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18495 hl = gl;
18496 hh = gh;
18497 gl = fl;
18498 gh = fh;
18499 fl = el;
18500 fh = eh;
18501 el = dl + tl | 0;
18502 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18503 dl = cl;
18504 dh = ch;
18505 cl = bl;
18506 ch = bh;
18507 bl = al;
18508 bh = ah;
18509 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18510 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18511 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18512 al = al + xl | 0;
18513 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18514 tl = 602891725 + w1l | 0;
18515 th = 1899447441 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18516 tl = tl + hl | 0;
18517 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18518 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18519 tl = tl + xl | 0;
18520 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18521 xl = gl ^ el & (fl ^ gl) | 0;
18522 tl = tl + xl | 0;
18523 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18524 hl = gl;
18525 hh = gh;
18526 gl = fl;
18527 gh = fh;
18528 fl = el;
18529 fh = eh;
18530 el = dl + tl | 0;
18531 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18532 dl = cl;
18533 dh = ch;
18534 cl = bl;
18535 ch = bh;
18536 bl = al;
18537 bh = ah;
18538 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18539 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18540 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18541 al = al + xl | 0;
18542 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18543 tl = 3964484399 + w2l | 0;
18544 th = 3049323471 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
18545 tl = tl + hl | 0;
18546 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18547 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18548 tl = tl + xl | 0;
18549 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18550 xl = gl ^ el & (fl ^ gl) | 0;
18551 tl = tl + xl | 0;
18552 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18553 hl = gl;
18554 hh = gh;
18555 gl = fl;
18556 gh = fh;
18557 fl = el;
18558 fh = eh;
18559 el = dl + tl | 0;
18560 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18561 dl = cl;
18562 dh = ch;
18563 cl = bl;
18564 ch = bh;
18565 bl = al;
18566 bh = ah;
18567 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18568 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18569 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18570 al = al + xl | 0;
18571 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18572 tl = 2173295548 + w3l | 0;
18573 th = 3921009573 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
18574 tl = tl + hl | 0;
18575 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18576 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18577 tl = tl + xl | 0;
18578 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18579 xl = gl ^ el & (fl ^ gl) | 0;
18580 tl = tl + xl | 0;
18581 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18582 hl = gl;
18583 hh = gh;
18584 gl = fl;
18585 gh = fh;
18586 fl = el;
18587 fh = eh;
18588 el = dl + tl | 0;
18589 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18590 dl = cl;
18591 dh = ch;
18592 cl = bl;
18593 ch = bh;
18594 bl = al;
18595 bh = ah;
18596 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18597 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18598 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18599 al = al + xl | 0;
18600 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18601 tl = 4081628472 + w4l | 0;
18602 th = 961987163 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
18603 tl = tl + hl | 0;
18604 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18605 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18606 tl = tl + xl | 0;
18607 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18608 xl = gl ^ el & (fl ^ gl) | 0;
18609 tl = tl + xl | 0;
18610 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18611 hl = gl;
18612 hh = gh;
18613 gl = fl;
18614 gh = fh;
18615 fl = el;
18616 fh = eh;
18617 el = dl + tl | 0;
18618 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18619 dl = cl;
18620 dh = ch;
18621 cl = bl;
18622 ch = bh;
18623 bl = al;
18624 bh = ah;
18625 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18626 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18627 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18628 al = al + xl | 0;
18629 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18630 tl = 3053834265 + w5l | 0;
18631 th = 1508970993 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
18632 tl = tl + hl | 0;
18633 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18634 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18635 tl = tl + xl | 0;
18636 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18637 xl = gl ^ el & (fl ^ gl) | 0;
18638 tl = tl + xl | 0;
18639 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18640 hl = gl;
18641 hh = gh;
18642 gl = fl;
18643 gh = fh;
18644 fl = el;
18645 fh = eh;
18646 el = dl + tl | 0;
18647 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18648 dl = cl;
18649 dh = ch;
18650 cl = bl;
18651 ch = bh;
18652 bl = al;
18653 bh = ah;
18654 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18655 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18656 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18657 al = al + xl | 0;
18658 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18659 tl = 2937671579 + w6l | 0;
18660 th = 2453635748 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
18661 tl = tl + hl | 0;
18662 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18663 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18664 tl = tl + xl | 0;
18665 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18666 xl = gl ^ el & (fl ^ gl) | 0;
18667 tl = tl + xl | 0;
18668 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18669 hl = gl;
18670 hh = gh;
18671 gl = fl;
18672 gh = fh;
18673 fl = el;
18674 fh = eh;
18675 el = dl + tl | 0;
18676 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18677 dl = cl;
18678 dh = ch;
18679 cl = bl;
18680 ch = bh;
18681 bl = al;
18682 bh = ah;
18683 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18684 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18685 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18686 al = al + xl | 0;
18687 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18688 tl = 3664609560 + w7l | 0;
18689 th = 2870763221 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
18690 tl = tl + hl | 0;
18691 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18692 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18693 tl = tl + xl | 0;
18694 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18695 xl = gl ^ el & (fl ^ gl) | 0;
18696 tl = tl + xl | 0;
18697 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18698 hl = gl;
18699 hh = gh;
18700 gl = fl;
18701 gh = fh;
18702 fl = el;
18703 fh = eh;
18704 el = dl + tl | 0;
18705 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18706 dl = cl;
18707 dh = ch;
18708 cl = bl;
18709 ch = bh;
18710 bl = al;
18711 bh = ah;
18712 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18713 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18714 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18715 al = al + xl | 0;
18716 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18717 tl = 2734883394 + w8l | 0;
18718 th = 3624381080 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
18719 tl = tl + hl | 0;
18720 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18721 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18722 tl = tl + xl | 0;
18723 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18724 xl = gl ^ el & (fl ^ gl) | 0;
18725 tl = tl + xl | 0;
18726 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18727 hl = gl;
18728 hh = gh;
18729 gl = fl;
18730 gh = fh;
18731 fl = el;
18732 fh = eh;
18733 el = dl + tl | 0;
18734 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18735 dl = cl;
18736 dh = ch;
18737 cl = bl;
18738 ch = bh;
18739 bl = al;
18740 bh = ah;
18741 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18742 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18743 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18744 al = al + xl | 0;
18745 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18746 tl = 1164996542 + w9l | 0;
18747 th = 310598401 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18748 tl = tl + hl | 0;
18749 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18750 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18751 tl = tl + xl | 0;
18752 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18753 xl = gl ^ el & (fl ^ gl) | 0;
18754 tl = tl + xl | 0;
18755 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18756 hl = gl;
18757 hh = gh;
18758 gl = fl;
18759 gh = fh;
18760 fl = el;
18761 fh = eh;
18762 el = dl + tl | 0;
18763 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18764 dl = cl;
18765 dh = ch;
18766 cl = bl;
18767 ch = bh;
18768 bl = al;
18769 bh = ah;
18770 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18771 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18772 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18773 al = al + xl | 0;
18774 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18775 tl = 1323610764 + w10l | 0;
18776 th = 607225278 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18777 tl = tl + hl | 0;
18778 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18779 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18780 tl = tl + xl | 0;
18781 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18782 xl = gl ^ el & (fl ^ gl) | 0;
18783 tl = tl + xl | 0;
18784 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18785 hl = gl;
18786 hh = gh;
18787 gl = fl;
18788 gh = fh;
18789 fl = el;
18790 fh = eh;
18791 el = dl + tl | 0;
18792 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18793 dl = cl;
18794 dh = ch;
18795 cl = bl;
18796 ch = bh;
18797 bl = al;
18798 bh = ah;
18799 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18800 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18801 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18802 al = al + xl | 0;
18803 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18804 tl = 3590304994 + w11l | 0;
18805 th = 1426881987 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
18806 tl = tl + hl | 0;
18807 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18808 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18809 tl = tl + xl | 0;
18810 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18811 xl = gl ^ el & (fl ^ gl) | 0;
18812 tl = tl + xl | 0;
18813 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18814 hl = gl;
18815 hh = gh;
18816 gl = fl;
18817 gh = fh;
18818 fl = el;
18819 fh = eh;
18820 el = dl + tl | 0;
18821 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18822 dl = cl;
18823 dh = ch;
18824 cl = bl;
18825 ch = bh;
18826 bl = al;
18827 bh = ah;
18828 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18829 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18830 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18831 al = al + xl | 0;
18832 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18833 tl = 4068182383 + w12l | 0;
18834 th = 1925078388 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
18835 tl = tl + hl | 0;
18836 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18837 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18838 tl = tl + xl | 0;
18839 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18840 xl = gl ^ el & (fl ^ gl) | 0;
18841 tl = tl + xl | 0;
18842 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18843 hl = gl;
18844 hh = gh;
18845 gl = fl;
18846 gh = fh;
18847 fl = el;
18848 fh = eh;
18849 el = dl + tl | 0;
18850 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18851 dl = cl;
18852 dh = ch;
18853 cl = bl;
18854 ch = bh;
18855 bl = al;
18856 bh = ah;
18857 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18858 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18859 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18860 al = al + xl | 0;
18861 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18862 tl = 991336113 + w13l | 0;
18863 th = 2162078206 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
18864 tl = tl + hl | 0;
18865 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18866 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18867 tl = tl + xl | 0;
18868 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18869 xl = gl ^ el & (fl ^ gl) | 0;
18870 tl = tl + xl | 0;
18871 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18872 hl = gl;
18873 hh = gh;
18874 gl = fl;
18875 gh = fh;
18876 fl = el;
18877 fh = eh;
18878 el = dl + tl | 0;
18879 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18880 dl = cl;
18881 dh = ch;
18882 cl = bl;
18883 ch = bh;
18884 bl = al;
18885 bh = ah;
18886 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18887 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18888 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18889 al = al + xl | 0;
18890 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18891 tl = 633803317 + w14l | 0;
18892 th = 2614888103 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
18893 tl = tl + hl | 0;
18894 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18895 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18896 tl = tl + xl | 0;
18897 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18898 xl = gl ^ el & (fl ^ gl) | 0;
18899 tl = tl + xl | 0;
18900 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18901 hl = gl;
18902 hh = gh;
18903 gl = fl;
18904 gh = fh;
18905 fl = el;
18906 fh = eh;
18907 el = dl + tl | 0;
18908 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18909 dl = cl;
18910 dh = ch;
18911 cl = bl;
18912 ch = bh;
18913 bl = al;
18914 bh = ah;
18915 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18916 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18917 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18918 al = al + xl | 0;
18919 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18920 tl = 3479774868 + w15l | 0;
18921 th = 3248222580 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
18922 tl = tl + hl | 0;
18923 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18924 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18925 tl = tl + xl | 0;
18926 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18927 xl = gl ^ el & (fl ^ gl) | 0;
18928 tl = tl + xl | 0;
18929 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18930 hl = gl;
18931 hh = gh;
18932 gl = fl;
18933 gh = fh;
18934 fl = el;
18935 fh = eh;
18936 el = dl + tl | 0;
18937 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18938 dl = cl;
18939 dh = ch;
18940 cl = bl;
18941 ch = bh;
18942 bl = al;
18943 bh = ah;
18944 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18945 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18946 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18947 al = al + xl | 0;
18948 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18949 w0l = w0l + w9l | 0;
18950 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18951 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
18952 w0l = w0l + xl | 0;
18953 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18954 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
18955 w0l = w0l + xl | 0;
18956 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18957 tl = 2666613458 + w0l | 0;
18958 th = 3835390401 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18959 tl = tl + hl | 0;
18960 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18961 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18962 tl = tl + xl | 0;
18963 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18964 xl = gl ^ el & (fl ^ gl) | 0;
18965 tl = tl + xl | 0;
18966 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18967 hl = gl;
18968 hh = gh;
18969 gl = fl;
18970 gh = fh;
18971 fl = el;
18972 fh = eh;
18973 el = dl + tl | 0;
18974 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18975 dl = cl;
18976 dh = ch;
18977 cl = bl;
18978 ch = bh;
18979 bl = al;
18980 bh = ah;
18981 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18982 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18983 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18984 al = al + xl | 0;
18985 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18986 w1l = w1l + w10l | 0;
18987 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18988 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
18989 w1l = w1l + xl | 0;
18990 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18991 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
18992 w1l = w1l + xl | 0;
18993 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18994 tl = 944711139 + w1l | 0;
18995 th = 4022224774 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18996 tl = tl + hl | 0;
18997 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18998 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18999 tl = tl + xl | 0;
19000 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19001 xl = gl ^ el & (fl ^ gl) | 0;
19002 tl = tl + xl | 0;
19003 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19004 hl = gl;
19005 hh = gh;
19006 gl = fl;
19007 gh = fh;
19008 fl = el;
19009 fh = eh;
19010 el = dl + tl | 0;
19011 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19012 dl = cl;
19013 dh = ch;
19014 cl = bl;
19015 ch = bh;
19016 bl = al;
19017 bh = ah;
19018 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19019 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19020 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19021 al = al + xl | 0;
19022 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19023 w2l = w2l + w11l | 0;
19024 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19025 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
19026 w2l = w2l + xl | 0;
19027 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19028 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
19029 w2l = w2l + xl | 0;
19030 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19031 tl = 2341262773 + w2l | 0;
19032 th = 264347078 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19033 tl = tl + hl | 0;
19034 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19035 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19036 tl = tl + xl | 0;
19037 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19038 xl = gl ^ el & (fl ^ gl) | 0;
19039 tl = tl + xl | 0;
19040 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19041 hl = gl;
19042 hh = gh;
19043 gl = fl;
19044 gh = fh;
19045 fl = el;
19046 fh = eh;
19047 el = dl + tl | 0;
19048 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19049 dl = cl;
19050 dh = ch;
19051 cl = bl;
19052 ch = bh;
19053 bl = al;
19054 bh = ah;
19055 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19056 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19057 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19058 al = al + xl | 0;
19059 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19060 w3l = w3l + w12l | 0;
19061 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19062 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
19063 w3l = w3l + xl | 0;
19064 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19065 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19066 w3l = w3l + xl | 0;
19067 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19068 tl = 2007800933 + w3l | 0;
19069 th = 604807628 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19070 tl = tl + hl | 0;
19071 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19072 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19073 tl = tl + xl | 0;
19074 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19075 xl = gl ^ el & (fl ^ gl) | 0;
19076 tl = tl + xl | 0;
19077 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19078 hl = gl;
19079 hh = gh;
19080 gl = fl;
19081 gh = fh;
19082 fl = el;
19083 fh = eh;
19084 el = dl + tl | 0;
19085 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19086 dl = cl;
19087 dh = ch;
19088 cl = bl;
19089 ch = bh;
19090 bl = al;
19091 bh = ah;
19092 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19093 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19094 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19095 al = al + xl | 0;
19096 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19097 w4l = w4l + w13l | 0;
19098 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19099 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19100 w4l = w4l + xl | 0;
19101 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19102 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19103 w4l = w4l + xl | 0;
19104 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19105 tl = 1495990901 + w4l | 0;
19106 th = 770255983 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19107 tl = tl + hl | 0;
19108 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19109 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19110 tl = tl + xl | 0;
19111 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19112 xl = gl ^ el & (fl ^ gl) | 0;
19113 tl = tl + xl | 0;
19114 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19115 hl = gl;
19116 hh = gh;
19117 gl = fl;
19118 gh = fh;
19119 fl = el;
19120 fh = eh;
19121 el = dl + tl | 0;
19122 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19123 dl = cl;
19124 dh = ch;
19125 cl = bl;
19126 ch = bh;
19127 bl = al;
19128 bh = ah;
19129 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19130 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19131 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19132 al = al + xl | 0;
19133 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19134 w5l = w5l + w14l | 0;
19135 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19136 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19137 w5l = w5l + xl | 0;
19138 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19139 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19140 w5l = w5l + xl | 0;
19141 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19142 tl = 1856431235 + w5l | 0;
19143 th = 1249150122 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19144 tl = tl + hl | 0;
19145 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19146 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19147 tl = tl + xl | 0;
19148 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19149 xl = gl ^ el & (fl ^ gl) | 0;
19150 tl = tl + xl | 0;
19151 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19152 hl = gl;
19153 hh = gh;
19154 gl = fl;
19155 gh = fh;
19156 fl = el;
19157 fh = eh;
19158 el = dl + tl | 0;
19159 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19160 dl = cl;
19161 dh = ch;
19162 cl = bl;
19163 ch = bh;
19164 bl = al;
19165 bh = ah;
19166 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19167 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19168 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19169 al = al + xl | 0;
19170 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19171 w6l = w6l + w15l | 0;
19172 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19173 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19174 w6l = w6l + xl | 0;
19175 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19176 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19177 w6l = w6l + xl | 0;
19178 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19179 tl = 3175218132 + w6l | 0;
19180 th = 1555081692 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19181 tl = tl + hl | 0;
19182 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19183 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19184 tl = tl + xl | 0;
19185 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19186 xl = gl ^ el & (fl ^ gl) | 0;
19187 tl = tl + xl | 0;
19188 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19189 hl = gl;
19190 hh = gh;
19191 gl = fl;
19192 gh = fh;
19193 fl = el;
19194 fh = eh;
19195 el = dl + tl | 0;
19196 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19197 dl = cl;
19198 dh = ch;
19199 cl = bl;
19200 ch = bh;
19201 bl = al;
19202 bh = ah;
19203 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19204 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19205 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19206 al = al + xl | 0;
19207 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19208 w7l = w7l + w0l | 0;
19209 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19210 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19211 w7l = w7l + xl | 0;
19212 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19213 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19214 w7l = w7l + xl | 0;
19215 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19216 tl = 2198950837 + w7l | 0;
19217 th = 1996064986 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19218 tl = tl + hl | 0;
19219 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19220 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19221 tl = tl + xl | 0;
19222 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19223 xl = gl ^ el & (fl ^ gl) | 0;
19224 tl = tl + xl | 0;
19225 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19226 hl = gl;
19227 hh = gh;
19228 gl = fl;
19229 gh = fh;
19230 fl = el;
19231 fh = eh;
19232 el = dl + tl | 0;
19233 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19234 dl = cl;
19235 dh = ch;
19236 cl = bl;
19237 ch = bh;
19238 bl = al;
19239 bh = ah;
19240 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19241 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19242 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19243 al = al + xl | 0;
19244 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19245 w8l = w8l + w1l | 0;
19246 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19247 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19248 w8l = w8l + xl | 0;
19249 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19250 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19251 w8l = w8l + xl | 0;
19252 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19253 tl = 3999719339 + w8l | 0;
19254 th = 2554220882 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19255 tl = tl + hl | 0;
19256 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19257 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19258 tl = tl + xl | 0;
19259 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19260 xl = gl ^ el & (fl ^ gl) | 0;
19261 tl = tl + xl | 0;
19262 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19263 hl = gl;
19264 hh = gh;
19265 gl = fl;
19266 gh = fh;
19267 fl = el;
19268 fh = eh;
19269 el = dl + tl | 0;
19270 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19271 dl = cl;
19272 dh = ch;
19273 cl = bl;
19274 ch = bh;
19275 bl = al;
19276 bh = ah;
19277 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19278 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19279 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19280 al = al + xl | 0;
19281 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19282 w9l = w9l + w2l | 0;
19283 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19284 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19285 w9l = w9l + xl | 0;
19286 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19287 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19288 w9l = w9l + xl | 0;
19289 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19290 tl = 766784016 + w9l | 0;
19291 th = 2821834349 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19292 tl = tl + hl | 0;
19293 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19294 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19295 tl = tl + xl | 0;
19296 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19297 xl = gl ^ el & (fl ^ gl) | 0;
19298 tl = tl + xl | 0;
19299 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19300 hl = gl;
19301 hh = gh;
19302 gl = fl;
19303 gh = fh;
19304 fl = el;
19305 fh = eh;
19306 el = dl + tl | 0;
19307 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19308 dl = cl;
19309 dh = ch;
19310 cl = bl;
19311 ch = bh;
19312 bl = al;
19313 bh = ah;
19314 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19315 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19316 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19317 al = al + xl | 0;
19318 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19319 w10l = w10l + w3l | 0;
19320 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19321 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19322 w10l = w10l + xl | 0;
19323 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19324 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19325 w10l = w10l + xl | 0;
19326 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19327 tl = 2566594879 + w10l | 0;
19328 th = 2952996808 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19329 tl = tl + hl | 0;
19330 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19331 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19332 tl = tl + xl | 0;
19333 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19334 xl = gl ^ el & (fl ^ gl) | 0;
19335 tl = tl + xl | 0;
19336 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19337 hl = gl;
19338 hh = gh;
19339 gl = fl;
19340 gh = fh;
19341 fl = el;
19342 fh = eh;
19343 el = dl + tl | 0;
19344 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19345 dl = cl;
19346 dh = ch;
19347 cl = bl;
19348 ch = bh;
19349 bl = al;
19350 bh = ah;
19351 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19352 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19353 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19354 al = al + xl | 0;
19355 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19356 w11l = w11l + w4l | 0;
19357 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19358 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19359 w11l = w11l + xl | 0;
19360 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19361 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19362 w11l = w11l + xl | 0;
19363 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19364 tl = 3203337956 + w11l | 0;
19365 th = 3210313671 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19366 tl = tl + hl | 0;
19367 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19368 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19369 tl = tl + xl | 0;
19370 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19371 xl = gl ^ el & (fl ^ gl) | 0;
19372 tl = tl + xl | 0;
19373 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19374 hl = gl;
19375 hh = gh;
19376 gl = fl;
19377 gh = fh;
19378 fl = el;
19379 fh = eh;
19380 el = dl + tl | 0;
19381 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19382 dl = cl;
19383 dh = ch;
19384 cl = bl;
19385 ch = bh;
19386 bl = al;
19387 bh = ah;
19388 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19389 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19390 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19391 al = al + xl | 0;
19392 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19393 w12l = w12l + w5l | 0;
19394 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19395 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19396 w12l = w12l + xl | 0;
19397 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19398 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19399 w12l = w12l + xl | 0;
19400 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19401 tl = 1034457026 + w12l | 0;
19402 th = 3336571891 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19403 tl = tl + hl | 0;
19404 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19405 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19406 tl = tl + xl | 0;
19407 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19408 xl = gl ^ el & (fl ^ gl) | 0;
19409 tl = tl + xl | 0;
19410 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19411 hl = gl;
19412 hh = gh;
19413 gl = fl;
19414 gh = fh;
19415 fl = el;
19416 fh = eh;
19417 el = dl + tl | 0;
19418 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19419 dl = cl;
19420 dh = ch;
19421 cl = bl;
19422 ch = bh;
19423 bl = al;
19424 bh = ah;
19425 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19426 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19427 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19428 al = al + xl | 0;
19429 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19430 w13l = w13l + w6l | 0;
19431 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19432 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
19433 w13l = w13l + xl | 0;
19434 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19435 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
19436 w13l = w13l + xl | 0;
19437 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19438 tl = 2466948901 + w13l | 0;
19439 th = 3584528711 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19440 tl = tl + hl | 0;
19441 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19442 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19443 tl = tl + xl | 0;
19444 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19445 xl = gl ^ el & (fl ^ gl) | 0;
19446 tl = tl + xl | 0;
19447 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19448 hl = gl;
19449 hh = gh;
19450 gl = fl;
19451 gh = fh;
19452 fl = el;
19453 fh = eh;
19454 el = dl + tl | 0;
19455 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19456 dl = cl;
19457 dh = ch;
19458 cl = bl;
19459 ch = bh;
19460 bl = al;
19461 bh = ah;
19462 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19463 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19464 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19465 al = al + xl | 0;
19466 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19467 w14l = w14l + w7l | 0;
19468 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19469 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
19470 w14l = w14l + xl | 0;
19471 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19472 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
19473 w14l = w14l + xl | 0;
19474 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19475 tl = 3758326383 + w14l | 0;
19476 th = 113926993 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19477 tl = tl + hl | 0;
19478 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19479 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19480 tl = tl + xl | 0;
19481 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19482 xl = gl ^ el & (fl ^ gl) | 0;
19483 tl = tl + xl | 0;
19484 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19485 hl = gl;
19486 hh = gh;
19487 gl = fl;
19488 gh = fh;
19489 fl = el;
19490 fh = eh;
19491 el = dl + tl | 0;
19492 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19493 dl = cl;
19494 dh = ch;
19495 cl = bl;
19496 ch = bh;
19497 bl = al;
19498 bh = ah;
19499 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19500 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19501 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19502 al = al + xl | 0;
19503 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19504 w15l = w15l + w8l | 0;
19505 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19506 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
19507 w15l = w15l + xl | 0;
19508 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19509 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
19510 w15l = w15l + xl | 0;
19511 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19512 tl = 168717936 + w15l | 0;
19513 th = 338241895 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19514 tl = tl + hl | 0;
19515 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19516 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19517 tl = tl + xl | 0;
19518 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19519 xl = gl ^ el & (fl ^ gl) | 0;
19520 tl = tl + xl | 0;
19521 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19522 hl = gl;
19523 hh = gh;
19524 gl = fl;
19525 gh = fh;
19526 fl = el;
19527 fh = eh;
19528 el = dl + tl | 0;
19529 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19530 dl = cl;
19531 dh = ch;
19532 cl = bl;
19533 ch = bh;
19534 bl = al;
19535 bh = ah;
19536 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19537 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19538 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19539 al = al + xl | 0;
19540 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19541 w0l = w0l + w9l | 0;
19542 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19543 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
19544 w0l = w0l + xl | 0;
19545 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19546 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
19547 w0l = w0l + xl | 0;
19548 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19549 tl = 1188179964 + w0l | 0;
19550 th = 666307205 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19551 tl = tl + hl | 0;
19552 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19553 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19554 tl = tl + xl | 0;
19555 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19556 xl = gl ^ el & (fl ^ gl) | 0;
19557 tl = tl + xl | 0;
19558 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19559 hl = gl;
19560 hh = gh;
19561 gl = fl;
19562 gh = fh;
19563 fl = el;
19564 fh = eh;
19565 el = dl + tl | 0;
19566 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19567 dl = cl;
19568 dh = ch;
19569 cl = bl;
19570 ch = bh;
19571 bl = al;
19572 bh = ah;
19573 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19574 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19575 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19576 al = al + xl | 0;
19577 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19578 w1l = w1l + w10l | 0;
19579 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19580 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
19581 w1l = w1l + xl | 0;
19582 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19583 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
19584 w1l = w1l + xl | 0;
19585 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19586 tl = 1546045734 + w1l | 0;
19587 th = 773529912 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19588 tl = tl + hl | 0;
19589 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19590 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19591 tl = tl + xl | 0;
19592 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19593 xl = gl ^ el & (fl ^ gl) | 0;
19594 tl = tl + xl | 0;
19595 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19596 hl = gl;
19597 hh = gh;
19598 gl = fl;
19599 gh = fh;
19600 fl = el;
19601 fh = eh;
19602 el = dl + tl | 0;
19603 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19604 dl = cl;
19605 dh = ch;
19606 cl = bl;
19607 ch = bh;
19608 bl = al;
19609 bh = ah;
19610 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19611 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19612 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19613 al = al + xl | 0;
19614 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19615 w2l = w2l + w11l | 0;
19616 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19617 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
19618 w2l = w2l + xl | 0;
19619 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19620 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
19621 w2l = w2l + xl | 0;
19622 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19623 tl = 1522805485 + w2l | 0;
19624 th = 1294757372 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19625 tl = tl + hl | 0;
19626 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19627 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19628 tl = tl + xl | 0;
19629 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19630 xl = gl ^ el & (fl ^ gl) | 0;
19631 tl = tl + xl | 0;
19632 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19633 hl = gl;
19634 hh = gh;
19635 gl = fl;
19636 gh = fh;
19637 fl = el;
19638 fh = eh;
19639 el = dl + tl | 0;
19640 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19641 dl = cl;
19642 dh = ch;
19643 cl = bl;
19644 ch = bh;
19645 bl = al;
19646 bh = ah;
19647 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19648 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19649 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19650 al = al + xl | 0;
19651 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19652 w3l = w3l + w12l | 0;
19653 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19654 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
19655 w3l = w3l + xl | 0;
19656 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19657 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19658 w3l = w3l + xl | 0;
19659 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19660 tl = 2643833823 + w3l | 0;
19661 th = 1396182291 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19662 tl = tl + hl | 0;
19663 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19664 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19665 tl = tl + xl | 0;
19666 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19667 xl = gl ^ el & (fl ^ gl) | 0;
19668 tl = tl + xl | 0;
19669 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19670 hl = gl;
19671 hh = gh;
19672 gl = fl;
19673 gh = fh;
19674 fl = el;
19675 fh = eh;
19676 el = dl + tl | 0;
19677 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19678 dl = cl;
19679 dh = ch;
19680 cl = bl;
19681 ch = bh;
19682 bl = al;
19683 bh = ah;
19684 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19685 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19686 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19687 al = al + xl | 0;
19688 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19689 w4l = w4l + w13l | 0;
19690 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19691 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19692 w4l = w4l + xl | 0;
19693 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19694 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19695 w4l = w4l + xl | 0;
19696 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19697 tl = 2343527390 + w4l | 0;
19698 th = 1695183700 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19699 tl = tl + hl | 0;
19700 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19701 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19702 tl = tl + xl | 0;
19703 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19704 xl = gl ^ el & (fl ^ gl) | 0;
19705 tl = tl + xl | 0;
19706 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19707 hl = gl;
19708 hh = gh;
19709 gl = fl;
19710 gh = fh;
19711 fl = el;
19712 fh = eh;
19713 el = dl + tl | 0;
19714 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19715 dl = cl;
19716 dh = ch;
19717 cl = bl;
19718 ch = bh;
19719 bl = al;
19720 bh = ah;
19721 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19722 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19723 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19724 al = al + xl | 0;
19725 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19726 w5l = w5l + w14l | 0;
19727 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19728 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19729 w5l = w5l + xl | 0;
19730 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19731 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19732 w5l = w5l + xl | 0;
19733 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19734 tl = 1014477480 + w5l | 0;
19735 th = 1986661051 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19736 tl = tl + hl | 0;
19737 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19738 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19739 tl = tl + xl | 0;
19740 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19741 xl = gl ^ el & (fl ^ gl) | 0;
19742 tl = tl + xl | 0;
19743 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19744 hl = gl;
19745 hh = gh;
19746 gl = fl;
19747 gh = fh;
19748 fl = el;
19749 fh = eh;
19750 el = dl + tl | 0;
19751 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19752 dl = cl;
19753 dh = ch;
19754 cl = bl;
19755 ch = bh;
19756 bl = al;
19757 bh = ah;
19758 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19759 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19760 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19761 al = al + xl | 0;
19762 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19763 w6l = w6l + w15l | 0;
19764 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19765 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19766 w6l = w6l + xl | 0;
19767 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19768 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19769 w6l = w6l + xl | 0;
19770 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19771 tl = 1206759142 + w6l | 0;
19772 th = 2177026350 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19773 tl = tl + hl | 0;
19774 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19775 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19776 tl = tl + xl | 0;
19777 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19778 xl = gl ^ el & (fl ^ gl) | 0;
19779 tl = tl + xl | 0;
19780 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19781 hl = gl;
19782 hh = gh;
19783 gl = fl;
19784 gh = fh;
19785 fl = el;
19786 fh = eh;
19787 el = dl + tl | 0;
19788 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19789 dl = cl;
19790 dh = ch;
19791 cl = bl;
19792 ch = bh;
19793 bl = al;
19794 bh = ah;
19795 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19796 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19797 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19798 al = al + xl | 0;
19799 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19800 w7l = w7l + w0l | 0;
19801 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19802 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19803 w7l = w7l + xl | 0;
19804 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19805 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19806 w7l = w7l + xl | 0;
19807 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19808 tl = 344077627 + w7l | 0;
19809 th = 2456956037 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19810 tl = tl + hl | 0;
19811 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19812 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19813 tl = tl + xl | 0;
19814 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19815 xl = gl ^ el & (fl ^ gl) | 0;
19816 tl = tl + xl | 0;
19817 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19818 hl = gl;
19819 hh = gh;
19820 gl = fl;
19821 gh = fh;
19822 fl = el;
19823 fh = eh;
19824 el = dl + tl | 0;
19825 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19826 dl = cl;
19827 dh = ch;
19828 cl = bl;
19829 ch = bh;
19830 bl = al;
19831 bh = ah;
19832 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19833 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19834 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19835 al = al + xl | 0;
19836 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19837 w8l = w8l + w1l | 0;
19838 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19839 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19840 w8l = w8l + xl | 0;
19841 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19842 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19843 w8l = w8l + xl | 0;
19844 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19845 tl = 1290863460 + w8l | 0;
19846 th = 2730485921 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19847 tl = tl + hl | 0;
19848 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19849 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19850 tl = tl + xl | 0;
19851 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19852 xl = gl ^ el & (fl ^ gl) | 0;
19853 tl = tl + xl | 0;
19854 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19855 hl = gl;
19856 hh = gh;
19857 gl = fl;
19858 gh = fh;
19859 fl = el;
19860 fh = eh;
19861 el = dl + tl | 0;
19862 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19863 dl = cl;
19864 dh = ch;
19865 cl = bl;
19866 ch = bh;
19867 bl = al;
19868 bh = ah;
19869 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19870 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19871 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19872 al = al + xl | 0;
19873 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19874 w9l = w9l + w2l | 0;
19875 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19876 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19877 w9l = w9l + xl | 0;
19878 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19879 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19880 w9l = w9l + xl | 0;
19881 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19882 tl = 3158454273 + w9l | 0;
19883 th = 2820302411 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19884 tl = tl + hl | 0;
19885 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19886 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19887 tl = tl + xl | 0;
19888 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19889 xl = gl ^ el & (fl ^ gl) | 0;
19890 tl = tl + xl | 0;
19891 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19892 hl = gl;
19893 hh = gh;
19894 gl = fl;
19895 gh = fh;
19896 fl = el;
19897 fh = eh;
19898 el = dl + tl | 0;
19899 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19900 dl = cl;
19901 dh = ch;
19902 cl = bl;
19903 ch = bh;
19904 bl = al;
19905 bh = ah;
19906 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19907 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19908 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19909 al = al + xl | 0;
19910 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19911 w10l = w10l + w3l | 0;
19912 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19913 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19914 w10l = w10l + xl | 0;
19915 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19916 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19917 w10l = w10l + xl | 0;
19918 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19919 tl = 3505952657 + w10l | 0;
19920 th = 3259730800 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19921 tl = tl + hl | 0;
19922 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19923 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19924 tl = tl + xl | 0;
19925 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19926 xl = gl ^ el & (fl ^ gl) | 0;
19927 tl = tl + xl | 0;
19928 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19929 hl = gl;
19930 hh = gh;
19931 gl = fl;
19932 gh = fh;
19933 fl = el;
19934 fh = eh;
19935 el = dl + tl | 0;
19936 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19937 dl = cl;
19938 dh = ch;
19939 cl = bl;
19940 ch = bh;
19941 bl = al;
19942 bh = ah;
19943 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19944 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19945 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19946 al = al + xl | 0;
19947 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19948 w11l = w11l + w4l | 0;
19949 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19950 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19951 w11l = w11l + xl | 0;
19952 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19953 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19954 w11l = w11l + xl | 0;
19955 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19956 tl = 106217008 + w11l | 0;
19957 th = 3345764771 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19958 tl = tl + hl | 0;
19959 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19960 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19961 tl = tl + xl | 0;
19962 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19963 xl = gl ^ el & (fl ^ gl) | 0;
19964 tl = tl + xl | 0;
19965 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19966 hl = gl;
19967 hh = gh;
19968 gl = fl;
19969 gh = fh;
19970 fl = el;
19971 fh = eh;
19972 el = dl + tl | 0;
19973 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19974 dl = cl;
19975 dh = ch;
19976 cl = bl;
19977 ch = bh;
19978 bl = al;
19979 bh = ah;
19980 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19981 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19982 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19983 al = al + xl | 0;
19984 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19985 w12l = w12l + w5l | 0;
19986 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19987 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19988 w12l = w12l + xl | 0;
19989 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19990 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19991 w12l = w12l + xl | 0;
19992 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19993 tl = 3606008344 + w12l | 0;
19994 th = 3516065817 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19995 tl = tl + hl | 0;
19996 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19997 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19998 tl = tl + xl | 0;
19999 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20000 xl = gl ^ el & (fl ^ gl) | 0;
20001 tl = tl + xl | 0;
20002 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20003 hl = gl;
20004 hh = gh;
20005 gl = fl;
20006 gh = fh;
20007 fl = el;
20008 fh = eh;
20009 el = dl + tl | 0;
20010 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20011 dl = cl;
20012 dh = ch;
20013 cl = bl;
20014 ch = bh;
20015 bl = al;
20016 bh = ah;
20017 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20018 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20019 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20020 al = al + xl | 0;
20021 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20022 w13l = w13l + w6l | 0;
20023 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20024 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
20025 w13l = w13l + xl | 0;
20026 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20027 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
20028 w13l = w13l + xl | 0;
20029 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20030 tl = 1432725776 + w13l | 0;
20031 th = 3600352804 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20032 tl = tl + hl | 0;
20033 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20034 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20035 tl = tl + xl | 0;
20036 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20037 xl = gl ^ el & (fl ^ gl) | 0;
20038 tl = tl + xl | 0;
20039 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20040 hl = gl;
20041 hh = gh;
20042 gl = fl;
20043 gh = fh;
20044 fl = el;
20045 fh = eh;
20046 el = dl + tl | 0;
20047 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20048 dl = cl;
20049 dh = ch;
20050 cl = bl;
20051 ch = bh;
20052 bl = al;
20053 bh = ah;
20054 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20055 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20056 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20057 al = al + xl | 0;
20058 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20059 w14l = w14l + w7l | 0;
20060 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20061 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
20062 w14l = w14l + xl | 0;
20063 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20064 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
20065 w14l = w14l + xl | 0;
20066 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20067 tl = 1467031594 + w14l | 0;
20068 th = 4094571909 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20069 tl = tl + hl | 0;
20070 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20071 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20072 tl = tl + xl | 0;
20073 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20074 xl = gl ^ el & (fl ^ gl) | 0;
20075 tl = tl + xl | 0;
20076 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20077 hl = gl;
20078 hh = gh;
20079 gl = fl;
20080 gh = fh;
20081 fl = el;
20082 fh = eh;
20083 el = dl + tl | 0;
20084 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20085 dl = cl;
20086 dh = ch;
20087 cl = bl;
20088 ch = bh;
20089 bl = al;
20090 bh = ah;
20091 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20092 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20093 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20094 al = al + xl | 0;
20095 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20096 w15l = w15l + w8l | 0;
20097 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20098 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20099 w15l = w15l + xl | 0;
20100 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20101 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20102 w15l = w15l + xl | 0;
20103 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20104 tl = 851169720 + w15l | 0;
20105 th = 275423344 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20106 tl = tl + hl | 0;
20107 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20108 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20109 tl = tl + xl | 0;
20110 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20111 xl = gl ^ el & (fl ^ gl) | 0;
20112 tl = tl + xl | 0;
20113 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20114 hl = gl;
20115 hh = gh;
20116 gl = fl;
20117 gh = fh;
20118 fl = el;
20119 fh = eh;
20120 el = dl + tl | 0;
20121 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20122 dl = cl;
20123 dh = ch;
20124 cl = bl;
20125 ch = bh;
20126 bl = al;
20127 bh = ah;
20128 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20129 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20130 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20131 al = al + xl | 0;
20132 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20133 w0l = w0l + w9l | 0;
20134 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20135 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20136 w0l = w0l + xl | 0;
20137 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20138 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20139 w0l = w0l + xl | 0;
20140 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20141 tl = 3100823752 + w0l | 0;
20142 th = 430227734 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20143 tl = tl + hl | 0;
20144 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20145 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20146 tl = tl + xl | 0;
20147 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20148 xl = gl ^ el & (fl ^ gl) | 0;
20149 tl = tl + xl | 0;
20150 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20151 hl = gl;
20152 hh = gh;
20153 gl = fl;
20154 gh = fh;
20155 fl = el;
20156 fh = eh;
20157 el = dl + tl | 0;
20158 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20159 dl = cl;
20160 dh = ch;
20161 cl = bl;
20162 ch = bh;
20163 bl = al;
20164 bh = ah;
20165 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20166 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20167 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20168 al = al + xl | 0;
20169 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20170 w1l = w1l + w10l | 0;
20171 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20172 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20173 w1l = w1l + xl | 0;
20174 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20175 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20176 w1l = w1l + xl | 0;
20177 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20178 tl = 1363258195 + w1l | 0;
20179 th = 506948616 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20180 tl = tl + hl | 0;
20181 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20182 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20183 tl = tl + xl | 0;
20184 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20185 xl = gl ^ el & (fl ^ gl) | 0;
20186 tl = tl + xl | 0;
20187 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20188 hl = gl;
20189 hh = gh;
20190 gl = fl;
20191 gh = fh;
20192 fl = el;
20193 fh = eh;
20194 el = dl + tl | 0;
20195 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20196 dl = cl;
20197 dh = ch;
20198 cl = bl;
20199 ch = bh;
20200 bl = al;
20201 bh = ah;
20202 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20203 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20204 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20205 al = al + xl | 0;
20206 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20207 w2l = w2l + w11l | 0;
20208 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20209 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20210 w2l = w2l + xl | 0;
20211 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20212 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20213 w2l = w2l + xl | 0;
20214 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20215 tl = 3750685593 + w2l | 0;
20216 th = 659060556 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20217 tl = tl + hl | 0;
20218 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20219 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20220 tl = tl + xl | 0;
20221 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20222 xl = gl ^ el & (fl ^ gl) | 0;
20223 tl = tl + xl | 0;
20224 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20225 hl = gl;
20226 hh = gh;
20227 gl = fl;
20228 gh = fh;
20229 fl = el;
20230 fh = eh;
20231 el = dl + tl | 0;
20232 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20233 dl = cl;
20234 dh = ch;
20235 cl = bl;
20236 ch = bh;
20237 bl = al;
20238 bh = ah;
20239 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20240 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20241 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20242 al = al + xl | 0;
20243 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20244 w3l = w3l + w12l | 0;
20245 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20246 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20247 w3l = w3l + xl | 0;
20248 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20249 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20250 w3l = w3l + xl | 0;
20251 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20252 tl = 3785050280 + w3l | 0;
20253 th = 883997877 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20254 tl = tl + hl | 0;
20255 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20256 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20257 tl = tl + xl | 0;
20258 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20259 xl = gl ^ el & (fl ^ gl) | 0;
20260 tl = tl + xl | 0;
20261 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20262 hl = gl;
20263 hh = gh;
20264 gl = fl;
20265 gh = fh;
20266 fl = el;
20267 fh = eh;
20268 el = dl + tl | 0;
20269 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20270 dl = cl;
20271 dh = ch;
20272 cl = bl;
20273 ch = bh;
20274 bl = al;
20275 bh = ah;
20276 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20277 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20278 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20279 al = al + xl | 0;
20280 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20281 w4l = w4l + w13l | 0;
20282 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20283 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20284 w4l = w4l + xl | 0;
20285 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20286 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20287 w4l = w4l + xl | 0;
20288 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20289 tl = 3318307427 + w4l | 0;
20290 th = 958139571 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20291 tl = tl + hl | 0;
20292 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20293 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20294 tl = tl + xl | 0;
20295 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20296 xl = gl ^ el & (fl ^ gl) | 0;
20297 tl = tl + xl | 0;
20298 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20299 hl = gl;
20300 hh = gh;
20301 gl = fl;
20302 gh = fh;
20303 fl = el;
20304 fh = eh;
20305 el = dl + tl | 0;
20306 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20307 dl = cl;
20308 dh = ch;
20309 cl = bl;
20310 ch = bh;
20311 bl = al;
20312 bh = ah;
20313 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20314 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20315 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20316 al = al + xl | 0;
20317 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20318 w5l = w5l + w14l | 0;
20319 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20320 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20321 w5l = w5l + xl | 0;
20322 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20323 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20324 w5l = w5l + xl | 0;
20325 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20326 tl = 3812723403 + w5l | 0;
20327 th = 1322822218 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20328 tl = tl + hl | 0;
20329 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20330 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20331 tl = tl + xl | 0;
20332 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20333 xl = gl ^ el & (fl ^ gl) | 0;
20334 tl = tl + xl | 0;
20335 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20336 hl = gl;
20337 hh = gh;
20338 gl = fl;
20339 gh = fh;
20340 fl = el;
20341 fh = eh;
20342 el = dl + tl | 0;
20343 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20344 dl = cl;
20345 dh = ch;
20346 cl = bl;
20347 ch = bh;
20348 bl = al;
20349 bh = ah;
20350 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20351 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20352 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20353 al = al + xl | 0;
20354 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20355 w6l = w6l + w15l | 0;
20356 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20357 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20358 w6l = w6l + xl | 0;
20359 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20360 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20361 w6l = w6l + xl | 0;
20362 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20363 tl = 2003034995 + w6l | 0;
20364 th = 1537002063 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20365 tl = tl + hl | 0;
20366 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20367 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20368 tl = tl + xl | 0;
20369 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20370 xl = gl ^ el & (fl ^ gl) | 0;
20371 tl = tl + xl | 0;
20372 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20373 hl = gl;
20374 hh = gh;
20375 gl = fl;
20376 gh = fh;
20377 fl = el;
20378 fh = eh;
20379 el = dl + tl | 0;
20380 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20381 dl = cl;
20382 dh = ch;
20383 cl = bl;
20384 ch = bh;
20385 bl = al;
20386 bh = ah;
20387 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20388 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20389 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20390 al = al + xl | 0;
20391 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20392 w7l = w7l + w0l | 0;
20393 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20394 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20395 w7l = w7l + xl | 0;
20396 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20397 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20398 w7l = w7l + xl | 0;
20399 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20400 tl = 3602036899 + w7l | 0;
20401 th = 1747873779 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20402 tl = tl + hl | 0;
20403 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20404 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20405 tl = tl + xl | 0;
20406 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20407 xl = gl ^ el & (fl ^ gl) | 0;
20408 tl = tl + xl | 0;
20409 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20410 hl = gl;
20411 hh = gh;
20412 gl = fl;
20413 gh = fh;
20414 fl = el;
20415 fh = eh;
20416 el = dl + tl | 0;
20417 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20418 dl = cl;
20419 dh = ch;
20420 cl = bl;
20421 ch = bh;
20422 bl = al;
20423 bh = ah;
20424 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20425 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20426 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20427 al = al + xl | 0;
20428 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20429 w8l = w8l + w1l | 0;
20430 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20431 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
20432 w8l = w8l + xl | 0;
20433 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20434 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
20435 w8l = w8l + xl | 0;
20436 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20437 tl = 1575990012 + w8l | 0;
20438 th = 1955562222 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20439 tl = tl + hl | 0;
20440 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20441 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20442 tl = tl + xl | 0;
20443 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20444 xl = gl ^ el & (fl ^ gl) | 0;
20445 tl = tl + xl | 0;
20446 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20447 hl = gl;
20448 hh = gh;
20449 gl = fl;
20450 gh = fh;
20451 fl = el;
20452 fh = eh;
20453 el = dl + tl | 0;
20454 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20455 dl = cl;
20456 dh = ch;
20457 cl = bl;
20458 ch = bh;
20459 bl = al;
20460 bh = ah;
20461 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20462 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20463 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20464 al = al + xl | 0;
20465 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20466 w9l = w9l + w2l | 0;
20467 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20468 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
20469 w9l = w9l + xl | 0;
20470 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20471 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
20472 w9l = w9l + xl | 0;
20473 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20474 tl = 1125592928 + w9l | 0;
20475 th = 2024104815 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20476 tl = tl + hl | 0;
20477 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20478 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20479 tl = tl + xl | 0;
20480 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20481 xl = gl ^ el & (fl ^ gl) | 0;
20482 tl = tl + xl | 0;
20483 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20484 hl = gl;
20485 hh = gh;
20486 gl = fl;
20487 gh = fh;
20488 fl = el;
20489 fh = eh;
20490 el = dl + tl | 0;
20491 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20492 dl = cl;
20493 dh = ch;
20494 cl = bl;
20495 ch = bh;
20496 bl = al;
20497 bh = ah;
20498 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20499 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20500 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20501 al = al + xl | 0;
20502 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20503 w10l = w10l + w3l | 0;
20504 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20505 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
20506 w10l = w10l + xl | 0;
20507 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20508 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
20509 w10l = w10l + xl | 0;
20510 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20511 tl = 2716904306 + w10l | 0;
20512 th = 2227730452 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20513 tl = tl + hl | 0;
20514 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20515 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20516 tl = tl + xl | 0;
20517 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20518 xl = gl ^ el & (fl ^ gl) | 0;
20519 tl = tl + xl | 0;
20520 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20521 hl = gl;
20522 hh = gh;
20523 gl = fl;
20524 gh = fh;
20525 fl = el;
20526 fh = eh;
20527 el = dl + tl | 0;
20528 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20529 dl = cl;
20530 dh = ch;
20531 cl = bl;
20532 ch = bh;
20533 bl = al;
20534 bh = ah;
20535 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20536 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20537 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20538 al = al + xl | 0;
20539 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20540 w11l = w11l + w4l | 0;
20541 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20542 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
20543 w11l = w11l + xl | 0;
20544 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20545 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
20546 w11l = w11l + xl | 0;
20547 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20548 tl = 442776044 + w11l | 0;
20549 th = 2361852424 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20550 tl = tl + hl | 0;
20551 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20552 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20553 tl = tl + xl | 0;
20554 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20555 xl = gl ^ el & (fl ^ gl) | 0;
20556 tl = tl + xl | 0;
20557 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20558 hl = gl;
20559 hh = gh;
20560 gl = fl;
20561 gh = fh;
20562 fl = el;
20563 fh = eh;
20564 el = dl + tl | 0;
20565 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20566 dl = cl;
20567 dh = ch;
20568 cl = bl;
20569 ch = bh;
20570 bl = al;
20571 bh = ah;
20572 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20573 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20574 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20575 al = al + xl | 0;
20576 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20577 w12l = w12l + w5l | 0;
20578 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20579 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
20580 w12l = w12l + xl | 0;
20581 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20582 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
20583 w12l = w12l + xl | 0;
20584 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20585 tl = 593698344 + w12l | 0;
20586 th = 2428436474 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20587 tl = tl + hl | 0;
20588 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20589 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20590 tl = tl + xl | 0;
20591 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20592 xl = gl ^ el & (fl ^ gl) | 0;
20593 tl = tl + xl | 0;
20594 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20595 hl = gl;
20596 hh = gh;
20597 gl = fl;
20598 gh = fh;
20599 fl = el;
20600 fh = eh;
20601 el = dl + tl | 0;
20602 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20603 dl = cl;
20604 dh = ch;
20605 cl = bl;
20606 ch = bh;
20607 bl = al;
20608 bh = ah;
20609 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20610 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20611 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20612 al = al + xl | 0;
20613 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20614 w13l = w13l + w6l | 0;
20615 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20616 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
20617 w13l = w13l + xl | 0;
20618 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20619 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
20620 w13l = w13l + xl | 0;
20621 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20622 tl = 3733110249 + w13l | 0;
20623 th = 2756734187 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20624 tl = tl + hl | 0;
20625 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20626 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20627 tl = tl + xl | 0;
20628 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20629 xl = gl ^ el & (fl ^ gl) | 0;
20630 tl = tl + xl | 0;
20631 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20632 hl = gl;
20633 hh = gh;
20634 gl = fl;
20635 gh = fh;
20636 fl = el;
20637 fh = eh;
20638 el = dl + tl | 0;
20639 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20640 dl = cl;
20641 dh = ch;
20642 cl = bl;
20643 ch = bh;
20644 bl = al;
20645 bh = ah;
20646 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20647 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20648 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20649 al = al + xl | 0;
20650 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20651 w14l = w14l + w7l | 0;
20652 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20653 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
20654 w14l = w14l + xl | 0;
20655 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20656 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
20657 w14l = w14l + xl | 0;
20658 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20659 tl = 2999351573 + w14l | 0;
20660 th = 3204031479 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20661 tl = tl + hl | 0;
20662 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20663 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20664 tl = tl + xl | 0;
20665 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20666 xl = gl ^ el & (fl ^ gl) | 0;
20667 tl = tl + xl | 0;
20668 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20669 hl = gl;
20670 hh = gh;
20671 gl = fl;
20672 gh = fh;
20673 fl = el;
20674 fh = eh;
20675 el = dl + tl | 0;
20676 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20677 dl = cl;
20678 dh = ch;
20679 cl = bl;
20680 ch = bh;
20681 bl = al;
20682 bh = ah;
20683 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20684 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20685 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20686 al = al + xl | 0;
20687 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20688 w15l = w15l + w8l | 0;
20689 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20690 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20691 w15l = w15l + xl | 0;
20692 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20693 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20694 w15l = w15l + xl | 0;
20695 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20696 tl = 3815920427 + w15l | 0;
20697 th = 3329325298 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20698 tl = tl + hl | 0;
20699 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20700 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20701 tl = tl + xl | 0;
20702 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20703 xl = gl ^ el & (fl ^ gl) | 0;
20704 tl = tl + xl | 0;
20705 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20706 hl = gl;
20707 hh = gh;
20708 gl = fl;
20709 gh = fh;
20710 fl = el;
20711 fh = eh;
20712 el = dl + tl | 0;
20713 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20714 dl = cl;
20715 dh = ch;
20716 cl = bl;
20717 ch = bh;
20718 bl = al;
20719 bh = ah;
20720 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20721 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20722 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20723 al = al + xl | 0;
20724 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20725 w0l = w0l + w9l | 0;
20726 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20727 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20728 w0l = w0l + xl | 0;
20729 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20730 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20731 w0l = w0l + xl | 0;
20732 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20733 tl = 3928383900 + w0l | 0;
20734 th = 3391569614 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20735 tl = tl + hl | 0;
20736 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20737 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20738 tl = tl + xl | 0;
20739 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20740 xl = gl ^ el & (fl ^ gl) | 0;
20741 tl = tl + xl | 0;
20742 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20743 hl = gl;
20744 hh = gh;
20745 gl = fl;
20746 gh = fh;
20747 fl = el;
20748 fh = eh;
20749 el = dl + tl | 0;
20750 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20751 dl = cl;
20752 dh = ch;
20753 cl = bl;
20754 ch = bh;
20755 bl = al;
20756 bh = ah;
20757 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20758 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20759 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20760 al = al + xl | 0;
20761 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20762 w1l = w1l + w10l | 0;
20763 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20764 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20765 w1l = w1l + xl | 0;
20766 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20767 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20768 w1l = w1l + xl | 0;
20769 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20770 tl = 566280711 + w1l | 0;
20771 th = 3515267271 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20772 tl = tl + hl | 0;
20773 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20774 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20775 tl = tl + xl | 0;
20776 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20777 xl = gl ^ el & (fl ^ gl) | 0;
20778 tl = tl + xl | 0;
20779 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20780 hl = gl;
20781 hh = gh;
20782 gl = fl;
20783 gh = fh;
20784 fl = el;
20785 fh = eh;
20786 el = dl + tl | 0;
20787 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20788 dl = cl;
20789 dh = ch;
20790 cl = bl;
20791 ch = bh;
20792 bl = al;
20793 bh = ah;
20794 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20795 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20796 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20797 al = al + xl | 0;
20798 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20799 w2l = w2l + w11l | 0;
20800 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20801 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20802 w2l = w2l + xl | 0;
20803 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20804 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20805 w2l = w2l + xl | 0;
20806 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20807 tl = 3454069534 + w2l | 0;
20808 th = 3940187606 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20809 tl = tl + hl | 0;
20810 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20811 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20812 tl = tl + xl | 0;
20813 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20814 xl = gl ^ el & (fl ^ gl) | 0;
20815 tl = tl + xl | 0;
20816 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20817 hl = gl;
20818 hh = gh;
20819 gl = fl;
20820 gh = fh;
20821 fl = el;
20822 fh = eh;
20823 el = dl + tl | 0;
20824 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20825 dl = cl;
20826 dh = ch;
20827 cl = bl;
20828 ch = bh;
20829 bl = al;
20830 bh = ah;
20831 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20832 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20833 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20834 al = al + xl | 0;
20835 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20836 w3l = w3l + w12l | 0;
20837 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20838 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20839 w3l = w3l + xl | 0;
20840 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20841 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20842 w3l = w3l + xl | 0;
20843 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20844 tl = 4000239992 + w3l | 0;
20845 th = 4118630271 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20846 tl = tl + hl | 0;
20847 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20848 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20849 tl = tl + xl | 0;
20850 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20851 xl = gl ^ el & (fl ^ gl) | 0;
20852 tl = tl + xl | 0;
20853 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20854 hl = gl;
20855 hh = gh;
20856 gl = fl;
20857 gh = fh;
20858 fl = el;
20859 fh = eh;
20860 el = dl + tl | 0;
20861 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20862 dl = cl;
20863 dh = ch;
20864 cl = bl;
20865 ch = bh;
20866 bl = al;
20867 bh = ah;
20868 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20869 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20870 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20871 al = al + xl | 0;
20872 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20873 w4l = w4l + w13l | 0;
20874 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20875 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20876 w4l = w4l + xl | 0;
20877 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20878 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20879 w4l = w4l + xl | 0;
20880 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20881 tl = 1914138554 + w4l | 0;
20882 th = 116418474 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20883 tl = tl + hl | 0;
20884 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20885 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20886 tl = tl + xl | 0;
20887 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20888 xl = gl ^ el & (fl ^ gl) | 0;
20889 tl = tl + xl | 0;
20890 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20891 hl = gl;
20892 hh = gh;
20893 gl = fl;
20894 gh = fh;
20895 fl = el;
20896 fh = eh;
20897 el = dl + tl | 0;
20898 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20899 dl = cl;
20900 dh = ch;
20901 cl = bl;
20902 ch = bh;
20903 bl = al;
20904 bh = ah;
20905 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20906 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20907 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20908 al = al + xl | 0;
20909 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20910 w5l = w5l + w14l | 0;
20911 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20912 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20913 w5l = w5l + xl | 0;
20914 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20915 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20916 w5l = w5l + xl | 0;
20917 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20918 tl = 2731055270 + w5l | 0;
20919 th = 174292421 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20920 tl = tl + hl | 0;
20921 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20922 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20923 tl = tl + xl | 0;
20924 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20925 xl = gl ^ el & (fl ^ gl) | 0;
20926 tl = tl + xl | 0;
20927 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20928 hl = gl;
20929 hh = gh;
20930 gl = fl;
20931 gh = fh;
20932 fl = el;
20933 fh = eh;
20934 el = dl + tl | 0;
20935 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20936 dl = cl;
20937 dh = ch;
20938 cl = bl;
20939 ch = bh;
20940 bl = al;
20941 bh = ah;
20942 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20943 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20944 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20945 al = al + xl | 0;
20946 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20947 w6l = w6l + w15l | 0;
20948 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20949 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20950 w6l = w6l + xl | 0;
20951 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20952 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20953 w6l = w6l + xl | 0;
20954 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20955 tl = 3203993006 + w6l | 0;
20956 th = 289380356 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20957 tl = tl + hl | 0;
20958 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20959 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20960 tl = tl + xl | 0;
20961 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20962 xl = gl ^ el & (fl ^ gl) | 0;
20963 tl = tl + xl | 0;
20964 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20965 hl = gl;
20966 hh = gh;
20967 gl = fl;
20968 gh = fh;
20969 fl = el;
20970 fh = eh;
20971 el = dl + tl | 0;
20972 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20973 dl = cl;
20974 dh = ch;
20975 cl = bl;
20976 ch = bh;
20977 bl = al;
20978 bh = ah;
20979 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20980 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20981 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20982 al = al + xl | 0;
20983 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20984 w7l = w7l + w0l | 0;
20985 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20986 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20987 w7l = w7l + xl | 0;
20988 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20989 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20990 w7l = w7l + xl | 0;
20991 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20992 tl = 320620315 + w7l | 0;
20993 th = 460393269 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20994 tl = tl + hl | 0;
20995 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20996 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20997 tl = tl + xl | 0;
20998 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20999 xl = gl ^ el & (fl ^ gl) | 0;
21000 tl = tl + xl | 0;
21001 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21002 hl = gl;
21003 hh = gh;
21004 gl = fl;
21005 gh = fh;
21006 fl = el;
21007 fh = eh;
21008 el = dl + tl | 0;
21009 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21010 dl = cl;
21011 dh = ch;
21012 cl = bl;
21013 ch = bh;
21014 bl = al;
21015 bh = ah;
21016 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21017 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21018 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21019 al = al + xl | 0;
21020 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21021 w8l = w8l + w1l | 0;
21022 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
21023 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
21024 w8l = w8l + xl | 0;
21025 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21026 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
21027 w8l = w8l + xl | 0;
21028 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21029 tl = 587496836 + w8l | 0;
21030 th = 685471733 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
21031 tl = tl + hl | 0;
21032 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21033 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21034 tl = tl + xl | 0;
21035 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21036 xl = gl ^ el & (fl ^ gl) | 0;
21037 tl = tl + xl | 0;
21038 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21039 hl = gl;
21040 hh = gh;
21041 gl = fl;
21042 gh = fh;
21043 fl = el;
21044 fh = eh;
21045 el = dl + tl | 0;
21046 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21047 dl = cl;
21048 dh = ch;
21049 cl = bl;
21050 ch = bh;
21051 bl = al;
21052 bh = ah;
21053 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21054 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21055 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21056 al = al + xl | 0;
21057 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21058 w9l = w9l + w2l | 0;
21059 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
21060 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
21061 w9l = w9l + xl | 0;
21062 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21063 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
21064 w9l = w9l + xl | 0;
21065 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21066 tl = 1086792851 + w9l | 0;
21067 th = 852142971 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
21068 tl = tl + hl | 0;
21069 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21070 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21071 tl = tl + xl | 0;
21072 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21073 xl = gl ^ el & (fl ^ gl) | 0;
21074 tl = tl + xl | 0;
21075 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21076 hl = gl;
21077 hh = gh;
21078 gl = fl;
21079 gh = fh;
21080 fl = el;
21081 fh = eh;
21082 el = dl + tl | 0;
21083 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21084 dl = cl;
21085 dh = ch;
21086 cl = bl;
21087 ch = bh;
21088 bl = al;
21089 bh = ah;
21090 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21091 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21092 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21093 al = al + xl | 0;
21094 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21095 w10l = w10l + w3l | 0;
21096 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
21097 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
21098 w10l = w10l + xl | 0;
21099 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21100 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
21101 w10l = w10l + xl | 0;
21102 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21103 tl = 365543100 + w10l | 0;
21104 th = 1017036298 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
21105 tl = tl + hl | 0;
21106 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21107 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21108 tl = tl + xl | 0;
21109 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21110 xl = gl ^ el & (fl ^ gl) | 0;
21111 tl = tl + xl | 0;
21112 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21113 hl = gl;
21114 hh = gh;
21115 gl = fl;
21116 gh = fh;
21117 fl = el;
21118 fh = eh;
21119 el = dl + tl | 0;
21120 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21121 dl = cl;
21122 dh = ch;
21123 cl = bl;
21124 ch = bh;
21125 bl = al;
21126 bh = ah;
21127 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21128 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21129 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21130 al = al + xl | 0;
21131 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21132 w11l = w11l + w4l | 0;
21133 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
21134 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
21135 w11l = w11l + xl | 0;
21136 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21137 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
21138 w11l = w11l + xl | 0;
21139 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21140 tl = 2618297676 + w11l | 0;
21141 th = 1126000580 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
21142 tl = tl + hl | 0;
21143 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21144 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21145 tl = tl + xl | 0;
21146 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21147 xl = gl ^ el & (fl ^ gl) | 0;
21148 tl = tl + xl | 0;
21149 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21150 hl = gl;
21151 hh = gh;
21152 gl = fl;
21153 gh = fh;
21154 fl = el;
21155 fh = eh;
21156 el = dl + tl | 0;
21157 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21158 dl = cl;
21159 dh = ch;
21160 cl = bl;
21161 ch = bh;
21162 bl = al;
21163 bh = ah;
21164 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21165 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21166 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21167 al = al + xl | 0;
21168 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21169 w12l = w12l + w5l | 0;
21170 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
21171 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
21172 w12l = w12l + xl | 0;
21173 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21174 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
21175 w12l = w12l + xl | 0;
21176 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21177 tl = 3409855158 + w12l | 0;
21178 th = 1288033470 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
21179 tl = tl + hl | 0;
21180 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21181 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21182 tl = tl + xl | 0;
21183 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21184 xl = gl ^ el & (fl ^ gl) | 0;
21185 tl = tl + xl | 0;
21186 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21187 hl = gl;
21188 hh = gh;
21189 gl = fl;
21190 gh = fh;
21191 fl = el;
21192 fh = eh;
21193 el = dl + tl | 0;
21194 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21195 dl = cl;
21196 dh = ch;
21197 cl = bl;
21198 ch = bh;
21199 bl = al;
21200 bh = ah;
21201 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21202 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21203 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21204 al = al + xl | 0;
21205 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21206 w13l = w13l + w6l | 0;
21207 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
21208 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
21209 w13l = w13l + xl | 0;
21210 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21211 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
21212 w13l = w13l + xl | 0;
21213 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21214 tl = 4234509866 + w13l | 0;
21215 th = 1501505948 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
21216 tl = tl + hl | 0;
21217 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21218 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21219 tl = tl + xl | 0;
21220 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21221 xl = gl ^ el & (fl ^ gl) | 0;
21222 tl = tl + xl | 0;
21223 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21224 hl = gl;
21225 hh = gh;
21226 gl = fl;
21227 gh = fh;
21228 fl = el;
21229 fh = eh;
21230 el = dl + tl | 0;
21231 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21232 dl = cl;
21233 dh = ch;
21234 cl = bl;
21235 ch = bh;
21236 bl = al;
21237 bh = ah;
21238 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21239 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21240 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21241 al = al + xl | 0;
21242 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21243 w14l = w14l + w7l | 0;
21244 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
21245 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
21246 w14l = w14l + xl | 0;
21247 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21248 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
21249 w14l = w14l + xl | 0;
21250 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21251 tl = 987167468 + w14l | 0;
21252 th = 1607167915 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
21253 tl = tl + hl | 0;
21254 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21255 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21256 tl = tl + xl | 0;
21257 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21258 xl = gl ^ el & (fl ^ gl) | 0;
21259 tl = tl + xl | 0;
21260 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21261 hl = gl;
21262 hh = gh;
21263 gl = fl;
21264 gh = fh;
21265 fl = el;
21266 fh = eh;
21267 el = dl + tl | 0;
21268 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21269 dl = cl;
21270 dh = ch;
21271 cl = bl;
21272 ch = bh;
21273 bl = al;
21274 bh = ah;
21275 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21276 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21277 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21278 al = al + xl | 0;
21279 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21280 w15l = w15l + w8l | 0;
21281 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
21282 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
21283 w15l = w15l + xl | 0;
21284 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21285 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
21286 w15l = w15l + xl | 0;
21287 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21288 tl = 1246189591 + w15l | 0;
21289 th = 1816402316 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
21290 tl = tl + hl | 0;
21291 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21292 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21293 tl = tl + xl | 0;
21294 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21295 xl = gl ^ el & (fl ^ gl) | 0;
21296 tl = tl + xl | 0;
21297 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21298 hl = gl;
21299 hh = gh;
21300 gl = fl;
21301 gh = fh;
21302 fl = el;
21303 fh = eh;
21304 el = dl + tl | 0;
21305 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21306 dl = cl;
21307 dh = ch;
21308 cl = bl;
21309 ch = bh;
21310 bl = al;
21311 bh = ah;
21312 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21313 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21314 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21315 al = al + xl | 0;
21316 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21317 H0l = H0l + al | 0;
21318 H0h = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0) | 0;
21319 H1l = H1l + bl | 0;
21320 H1h = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0) | 0;
21321 H2l = H2l + cl | 0;
21322 H2h = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0) | 0;
21323 H3l = H3l + dl | 0;
21324 H3h = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21325 H4l = H4l + el | 0;
21326 H4h = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0) | 0;
21327 H5l = H5l + fl | 0;
21328 H5h = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0) | 0;
21329 H6l = H6l + gl | 0;
21330 H6h = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0) | 0;
21331 H7l = H7l + hl | 0;
21332 H7h = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21333 }
21334 function _core_heap(offset) {
21335 offset = offset | 0;
21336 _core(HEAP[offset | 0] << 24 | HEAP[offset | 1] << 16 | HEAP[offset | 2] << 8 | HEAP[offset | 3], HEAP[offset | 4] << 24 | HEAP[offset | 5] << 16 | HEAP[offset | 6] << 8 | HEAP[offset | 7], HEAP[offset | 8] << 24 | HEAP[offset | 9] << 16 | HEAP[offset | 10] << 8 | HEAP[offset | 11], HEAP[offset | 12] << 24 | HEAP[offset | 13] << 16 | HEAP[offset | 14] << 8 | HEAP[offset | 15], HEAP[offset | 16] << 24 | HEAP[offset | 17] << 16 | HEAP[offset | 18] << 8 | HEAP[offset | 19], HEAP[offset | 20] << 24 | HEAP[offset | 21] << 16 | HEAP[offset | 22] << 8 | HEAP[offset | 23], HEAP[offset | 24] << 24 | HEAP[offset | 25] << 16 | HEAP[offset | 26] << 8 | HEAP[offset | 27], HEAP[offset | 28] << 24 | HEAP[offset | 29] << 16 | HEAP[offset | 30] << 8 | HEAP[offset | 31], HEAP[offset | 32] << 24 | HEAP[offset | 33] << 16 | HEAP[offset | 34] << 8 | HEAP[offset | 35], HEAP[offset | 36] << 24 | HEAP[offset | 37] << 16 | HEAP[offset | 38] << 8 | HEAP[offset | 39], HEAP[offset | 40] << 24 | HEAP[offset | 41] << 16 | HEAP[offset | 42] << 8 | HEAP[offset | 43], HEAP[offset | 44] << 24 | HEAP[offset | 45] << 16 | HEAP[offset | 46] << 8 | HEAP[offset | 47], HEAP[offset | 48] << 24 | HEAP[offset | 49] << 16 | HEAP[offset | 50] << 8 | HEAP[offset | 51], HEAP[offset | 52] << 24 | HEAP[offset | 53] << 16 | HEAP[offset | 54] << 8 | HEAP[offset | 55], HEAP[offset | 56] << 24 | HEAP[offset | 57] << 16 | HEAP[offset | 58] << 8 | HEAP[offset | 59], HEAP[offset | 60] << 24 | HEAP[offset | 61] << 16 | HEAP[offset | 62] << 8 | HEAP[offset | 63], HEAP[offset | 64] << 24 | HEAP[offset | 65] << 16 | HEAP[offset | 66] << 8 | HEAP[offset | 67], HEAP[offset | 68] << 24 | HEAP[offset | 69] << 16 | HEAP[offset | 70] << 8 | HEAP[offset | 71], HEAP[offset | 72] << 24 | HEAP[offset | 73] << 16 | HEAP[offset | 74] << 8 | HEAP[offset | 75], HEAP[offset | 76] << 24 | HEAP[offset | 77] << 16 | HEAP[offset | 78] << 8 | HEAP[offset | 79], HEAP[offset | 80] << 24 | HEAP[offset | 81] << 16 | HEAP[offset | 82] << 8 | HEAP[offset | 83], HEAP[offset | 84] << 24 | HEAP[offset | 85] << 16 | HEAP[offset | 86] << 8 | HEAP[offset | 87], HEAP[offset | 88] << 24 | HEAP[offset | 89] << 16 | HEAP[offset | 90] << 8 | HEAP[offset | 91], HEAP[offset | 92] << 24 | HEAP[offset | 93] << 16 | HEAP[offset | 94] << 8 | HEAP[offset | 95], HEAP[offset | 96] << 24 | HEAP[offset | 97] << 16 | HEAP[offset | 98] << 8 | HEAP[offset | 99], HEAP[offset | 100] << 24 | HEAP[offset | 101] << 16 | HEAP[offset | 102] << 8 | HEAP[offset | 103], HEAP[offset | 104] << 24 | HEAP[offset | 105] << 16 | HEAP[offset | 106] << 8 | HEAP[offset | 107], HEAP[offset | 108] << 24 | HEAP[offset | 109] << 16 | HEAP[offset | 110] << 8 | HEAP[offset | 111], HEAP[offset | 112] << 24 | HEAP[offset | 113] << 16 | HEAP[offset | 114] << 8 | HEAP[offset | 115], HEAP[offset | 116] << 24 | HEAP[offset | 117] << 16 | HEAP[offset | 118] << 8 | HEAP[offset | 119], HEAP[offset | 120] << 24 | HEAP[offset | 121] << 16 | HEAP[offset | 122] << 8 | HEAP[offset | 123], HEAP[offset | 124] << 24 | HEAP[offset | 125] << 16 | HEAP[offset | 126] << 8 | HEAP[offset | 127]);
21337 }
21338 function _state_to_heap(output) {
21339 output = output | 0;
21340 HEAP[output | 0] = H0h >>> 24;
21341 HEAP[output | 1] = H0h >>> 16 & 255;
21342 HEAP[output | 2] = H0h >>> 8 & 255;
21343 HEAP[output | 3] = H0h & 255;
21344 HEAP[output | 4] = H0l >>> 24;
21345 HEAP[output | 5] = H0l >>> 16 & 255;
21346 HEAP[output | 6] = H0l >>> 8 & 255;
21347 HEAP[output | 7] = H0l & 255;
21348 HEAP[output | 8] = H1h >>> 24;
21349 HEAP[output | 9] = H1h >>> 16 & 255;
21350 HEAP[output | 10] = H1h >>> 8 & 255;
21351 HEAP[output | 11] = H1h & 255;
21352 HEAP[output | 12] = H1l >>> 24;
21353 HEAP[output | 13] = H1l >>> 16 & 255;
21354 HEAP[output | 14] = H1l >>> 8 & 255;
21355 HEAP[output | 15] = H1l & 255;
21356 HEAP[output | 16] = H2h >>> 24;
21357 HEAP[output | 17] = H2h >>> 16 & 255;
21358 HEAP[output | 18] = H2h >>> 8 & 255;
21359 HEAP[output | 19] = H2h & 255;
21360 HEAP[output | 20] = H2l >>> 24;
21361 HEAP[output | 21] = H2l >>> 16 & 255;
21362 HEAP[output | 22] = H2l >>> 8 & 255;
21363 HEAP[output | 23] = H2l & 255;
21364 HEAP[output | 24] = H3h >>> 24;
21365 HEAP[output | 25] = H3h >>> 16 & 255;
21366 HEAP[output | 26] = H3h >>> 8 & 255;
21367 HEAP[output | 27] = H3h & 255;
21368 HEAP[output | 28] = H3l >>> 24;
21369 HEAP[output | 29] = H3l >>> 16 & 255;
21370 HEAP[output | 30] = H3l >>> 8 & 255;
21371 HEAP[output | 31] = H3l & 255;
21372 HEAP[output | 32] = H4h >>> 24;
21373 HEAP[output | 33] = H4h >>> 16 & 255;
21374 HEAP[output | 34] = H4h >>> 8 & 255;
21375 HEAP[output | 35] = H4h & 255;
21376 HEAP[output | 36] = H4l >>> 24;
21377 HEAP[output | 37] = H4l >>> 16 & 255;
21378 HEAP[output | 38] = H4l >>> 8 & 255;
21379 HEAP[output | 39] = H4l & 255;
21380 HEAP[output | 40] = H5h >>> 24;
21381 HEAP[output | 41] = H5h >>> 16 & 255;
21382 HEAP[output | 42] = H5h >>> 8 & 255;
21383 HEAP[output | 43] = H5h & 255;
21384 HEAP[output | 44] = H5l >>> 24;
21385 HEAP[output | 45] = H5l >>> 16 & 255;
21386 HEAP[output | 46] = H5l >>> 8 & 255;
21387 HEAP[output | 47] = H5l & 255;
21388 HEAP[output | 48] = H6h >>> 24;
21389 HEAP[output | 49] = H6h >>> 16 & 255;
21390 HEAP[output | 50] = H6h >>> 8 & 255;
21391 HEAP[output | 51] = H6h & 255;
21392 HEAP[output | 52] = H6l >>> 24;
21393 HEAP[output | 53] = H6l >>> 16 & 255;
21394 HEAP[output | 54] = H6l >>> 8 & 255;
21395 HEAP[output | 55] = H6l & 255;
21396 HEAP[output | 56] = H7h >>> 24;
21397 HEAP[output | 57] = H7h >>> 16 & 255;
21398 HEAP[output | 58] = H7h >>> 8 & 255;
21399 HEAP[output | 59] = H7h & 255;
21400 HEAP[output | 60] = H7l >>> 24;
21401 HEAP[output | 61] = H7l >>> 16 & 255;
21402 HEAP[output | 62] = H7l >>> 8 & 255;
21403 HEAP[output | 63] = H7l & 255;
21404 }
21405 function reset() {
21406 H0h = 1779033703;
21407 H0l = 4089235720;
21408 H1h = 3144134277;
21409 H1l = 2227873595;
21410 H2h = 1013904242;
21411 H2l = 4271175723;
21412 H3h = 2773480762;
21413 H3l = 1595750129;
21414 H4h = 1359893119;
21415 H4l = 2917565137;
21416 H5h = 2600822924;
21417 H5l = 725511199;
21418 H6h = 528734635;
21419 H6l = 4215389547;
21420 H7h = 1541459225;
21421 H7l = 327033209;
21422 TOTAL = 0;
21423 }
21424 function init(h0h, h0l, h1h, h1l, h2h, h2l, h3h, h3l, h4h, h4l, h5h, h5l, h6h, h6l, h7h, h7l, total) {
21425 h0h = h0h | 0;
21426 h0l = h0l | 0;
21427 h1h = h1h | 0;
21428 h1l = h1l | 0;
21429 h2h = h2h | 0;
21430 h2l = h2l | 0;
21431 h3h = h3h | 0;
21432 h3l = h3l | 0;
21433 h4h = h4h | 0;
21434 h4l = h4l | 0;
21435 h5h = h5h | 0;
21436 h5l = h5l | 0;
21437 h6h = h6h | 0;
21438 h6l = h6l | 0;
21439 h7h = h7h | 0;
21440 h7l = h7l | 0;
21441 total = total | 0;
21442 H0h = h0h;
21443 H0l = h0l;
21444 H1h = h1h;
21445 H1l = h1l;
21446 H2h = h2h;
21447 H2l = h2l;
21448 H3h = h3h;
21449 H3l = h3l;
21450 H4h = h4h;
21451 H4l = h4l;
21452 H5h = h5h;
21453 H5l = h5l;
21454 H6h = h6h;
21455 H6l = h6l;
21456 H7h = h7h;
21457 H7l = h7l;
21458 TOTAL = total;
21459 }
21460 function process(offset, length) {
21461 offset = offset | 0;
21462 length = length | 0;
21463 var hashed = 0;
21464 if (offset & 127) return -1;
21465 while ((length | 0) >= 128) {
21466 _core_heap(offset);
21467 offset = offset + 128 | 0;
21468 length = length - 128 | 0;
21469 hashed = hashed + 128 | 0;
21470 }
21471 TOTAL = TOTAL + hashed | 0;
21472 return hashed | 0;
21473 }
21474 function finish(offset, length, output) {
21475 offset = offset | 0;
21476 length = length | 0;
21477 output = output | 0;
21478 var hashed = 0, i = 0;
21479 if (offset & 127) return -1;
21480 if (~output) if (output & 63) return -1;
21481 if ((length | 0) >= 128) {
21482 hashed = process(offset, length) | 0;
21483 if ((hashed | 0) == -1) return -1;
21484 offset = offset + hashed | 0;
21485 length = length - hashed | 0;
21486 }
21487 hashed = hashed + length | 0;
21488 TOTAL = TOTAL + length | 0;
21489 HEAP[offset | length] = 128;
21490 if ((length | 0) >= 112) {
21491 for (i = length + 1 | 0; (i | 0) < 128; i = i + 1 | 0) HEAP[offset | i] = 0;
21492 _core_heap(offset);
21493 length = 0;
21494 HEAP[offset | 0] = 0;
21495 }
21496 for (i = length + 1 | 0; (i | 0) < 123; i = i + 1 | 0) HEAP[offset | i] = 0;
21497 HEAP[offset | 123] = TOTAL >>> 29;
21498 HEAP[offset | 124] = TOTAL >>> 21 & 255;
21499 HEAP[offset | 125] = TOTAL >>> 13 & 255;
21500 HEAP[offset | 126] = TOTAL >>> 5 & 255;
21501 HEAP[offset | 127] = TOTAL << 3 & 255;
21502 _core_heap(offset);
21503 if (~output) _state_to_heap(output);
21504 return hashed | 0;
21505 }
21506 function hmac_reset() {
21507 H0h = I0h;
21508 H0l = I0l;
21509 H1h = I1h;
21510 H1l = I1l;
21511 H2h = I2h;
21512 H2l = I2l;
21513 H3h = I3h;
21514 H3l = I3l;
21515 H4h = I4h;
21516 H4l = I4l;
21517 H5h = I5h;
21518 H5l = I5l;
21519 H6h = I6h;
21520 H6l = I6l;
21521 H7h = I7h;
21522 H7l = I7l;
21523 TOTAL = 128;
21524 }
21525 function _hmac_opad() {
21526 H0h = O0h;
21527 H0l = O0l;
21528 H1h = O1h;
21529 H1l = O1l;
21530 H2h = O2h;
21531 H2l = O2l;
21532 H3h = O3h;
21533 H3l = O3l;
21534 H4h = O4h;
21535 H4l = O4l;
21536 H5h = O5h;
21537 H5l = O5l;
21538 H6h = O6h;
21539 H6l = O6l;
21540 H7h = O7h;
21541 H7l = O7l;
21542 TOTAL = 128;
21543 }
21544 function hmac_init(p0h, p0l, p1h, p1l, p2h, p2l, p3h, p3l, p4h, p4l, p5h, p5l, p6h, p6l, p7h, p7l, p8h, p8l, p9h, p9l, p10h, p10l, p11h, p11l, p12h, p12l, p13h, p13l, p14h, p14l, p15h, p15l) {
21545 p0h = p0h | 0;
21546 p0l = p0l | 0;
21547 p1h = p1h | 0;
21548 p1l = p1l | 0;
21549 p2h = p2h | 0;
21550 p2l = p2l | 0;
21551 p3h = p3h | 0;
21552 p3l = p3l | 0;
21553 p4h = p4h | 0;
21554 p4l = p4l | 0;
21555 p5h = p5h | 0;
21556 p5l = p5l | 0;
21557 p6h = p6h | 0;
21558 p6l = p6l | 0;
21559 p7h = p7h | 0;
21560 p7l = p7l | 0;
21561 p8h = p8h | 0;
21562 p8l = p8l | 0;
21563 p9h = p9h | 0;
21564 p9l = p9l | 0;
21565 p10h = p10h | 0;
21566 p10l = p10l | 0;
21567 p11h = p11h | 0;
21568 p11l = p11l | 0;
21569 p12h = p12h | 0;
21570 p12l = p12l | 0;
21571 p13h = p13h | 0;
21572 p13l = p13l | 0;
21573 p14h = p14h | 0;
21574 p14l = p14l | 0;
21575 p15h = p15h | 0;
21576 p15l = p15l | 0;
21577 reset();
21578 _core(p0h ^ 1549556828, p0l ^ 1549556828, p1h ^ 1549556828, p1l ^ 1549556828, p2h ^ 1549556828, p2l ^ 1549556828, p3h ^ 1549556828, p3l ^ 1549556828, p4h ^ 1549556828, p4l ^ 1549556828, p5h ^ 1549556828, p5l ^ 1549556828, p6h ^ 1549556828, p6l ^ 1549556828, p7h ^ 1549556828, p7l ^ 1549556828, p8h ^ 1549556828, p8l ^ 1549556828, p9h ^ 1549556828, p9l ^ 1549556828, p10h ^ 1549556828, p10l ^ 1549556828, p11h ^ 1549556828, p11l ^ 1549556828, p12h ^ 1549556828, p12l ^ 1549556828, p13h ^ 1549556828, p13l ^ 1549556828, p14h ^ 1549556828, p14l ^ 1549556828, p15h ^ 1549556828, p15l ^ 1549556828);
21579 O0h = H0h;
21580 O0l = H0l;
21581 O1h = H1h;
21582 O1l = H1l;
21583 O2h = H2h;
21584 O2l = H2l;
21585 O3h = H3h;
21586 O3l = H3l;
21587 O4h = H4h;
21588 O4l = H4l;
21589 O5h = H5h;
21590 O5l = H5l;
21591 O6h = H6h;
21592 O6l = H6l;
21593 O7h = H7h;
21594 O7l = H7l;
21595 reset();
21596 _core(p0h ^ 909522486, p0l ^ 909522486, p1h ^ 909522486, p1l ^ 909522486, p2h ^ 909522486, p2l ^ 909522486, p3h ^ 909522486, p3l ^ 909522486, p4h ^ 909522486, p4l ^ 909522486, p5h ^ 909522486, p5l ^ 909522486, p6h ^ 909522486, p6l ^ 909522486, p7h ^ 909522486, p7l ^ 909522486, p8h ^ 909522486, p8l ^ 909522486, p9h ^ 909522486, p9l ^ 909522486, p10h ^ 909522486, p10l ^ 909522486, p11h ^ 909522486, p11l ^ 909522486, p12h ^ 909522486, p12l ^ 909522486, p13h ^ 909522486, p13l ^ 909522486, p14h ^ 909522486, p14l ^ 909522486, p15h ^ 909522486, p15l ^ 909522486);
21597 I0h = H0h;
21598 I0l = H0l;
21599 I1h = H1h;
21600 I1l = H1l;
21601 I2h = H2h;
21602 I2l = H2l;
21603 I3h = H3h;
21604 I3l = H3l;
21605 I4h = H4h;
21606 I4l = H4l;
21607 I5h = H5h;
21608 I5l = H5l;
21609 I6h = H6h;
21610 I6l = H6l;
21611 I7h = H7h;
21612 I7l = H7l;
21613 TOTAL = 128;
21614 }
21615 function hmac_finish(offset, length, output) {
21616 offset = offset | 0;
21617 length = length | 0;
21618 output = output | 0;
21619 var t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0, t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0, hashed = 0;
21620 if (offset & 127) return -1;
21621 if (~output) if (output & 63) return -1;
21622 hashed = finish(offset, length, -1) | 0;
21623 t0h = H0h;
21624 t0l = H0l;
21625 t1h = H1h;
21626 t1l = H1l;
21627 t2h = H2h;
21628 t2l = H2l;
21629 t3h = H3h;
21630 t3l = H3l;
21631 t4h = H4h;
21632 t4l = H4l;
21633 t5h = H5h;
21634 t5l = H5l;
21635 t6h = H6h;
21636 t6l = H6l;
21637 t7h = H7h;
21638 t7l = H7l;
21639 _hmac_opad();
21640 _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536);
21641 if (~output) _state_to_heap(output);
21642 return hashed | 0;
21643 }
21644 function pbkdf2_generate_block(offset, length, block, count, output) {
21645 offset = offset | 0;
21646 length = length | 0;
21647 block = block | 0;
21648 count = count | 0;
21649 output = output | 0;
21650 var h0h = 0, h0l = 0, h1h = 0, h1l = 0, h2h = 0, h2l = 0, h3h = 0, h3l = 0, h4h = 0, h4l = 0, h5h = 0, h5l = 0, h6h = 0, h6l = 0, h7h = 0, h7l = 0, t0h = 0, t0l = 0, t1h = 0, t1l = 0, t2h = 0, t2l = 0, t3h = 0, t3l = 0, t4h = 0, t4l = 0, t5h = 0, t5l = 0, t6h = 0, t6l = 0, t7h = 0, t7l = 0;
21651 if (offset & 127) return -1;
21652 if (~output) if (output & 63) return -1;
21653 HEAP[offset + length | 0] = block >>> 24;
21654 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
21655 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
21656 HEAP[offset + length + 3 | 0] = block & 255;
21657 // Closure compiler warning - The result of the 'bitor' operator is not being used
21658 //hmac_finish(offset, length + 4 | 0, -1) | 0;
21659 hmac_finish(offset, length + 4 | 0, -1);
21660 h0h = t0h = H0h;
21661 h0l = t0l = H0l;
21662 h1h = t1h = H1h;
21663 h1l = t1l = H1l;
21664 h2h = t2h = H2h;
21665 h2l = t2l = H2l;
21666 h3h = t3h = H3h;
21667 h3l = t3l = H3l;
21668 h4h = t4h = H4h;
21669 h4l = t4l = H4l;
21670 h5h = t5h = H5h;
21671 h5l = t5l = H5l;
21672 h6h = t6h = H6h;
21673 h6l = t6l = H6l;
21674 h7h = t7h = H7h;
21675 h7l = t7l = H7l;
21676 count = count - 1 | 0;
21677 while ((count | 0) > 0) {
21678 hmac_reset();
21679 _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536);
21680 t0h = H0h;
21681 t0l = H0l;
21682 t1h = H1h;
21683 t1l = H1l;
21684 t2h = H2h;
21685 t2l = H2l;
21686 t3h = H3h;
21687 t3l = H3l;
21688 t4h = H4h;
21689 t4l = H4l;
21690 t5h = H5h;
21691 t5l = H5l;
21692 t6h = H6h;
21693 t6l = H6l;
21694 t7h = H7h;
21695 t7l = H7l;
21696 _hmac_opad();
21697 _core(t0h, t0l, t1h, t1l, t2h, t2l, t3h, t3l, t4h, t4l, t5h, t5l, t6h, t6l, t7h, t7l, 2147483648, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1536);
21698 t0h = H0h;
21699 t0l = H0l;
21700 t1h = H1h;
21701 t1l = H1l;
21702 t2h = H2h;
21703 t2l = H2l;
21704 t3h = H3h;
21705 t3l = H3l;
21706 t4h = H4h;
21707 t4l = H4l;
21708 t5h = H5h;
21709 t5l = H5l;
21710 t6h = H6h;
21711 t6l = H6l;
21712 t7h = H7h;
21713 t7l = H7l;
21714 h0h = h0h ^ H0h;
21715 h0l = h0l ^ H0l;
21716 h1h = h1h ^ H1h;
21717 h1l = h1l ^ H1l;
21718 h2h = h2h ^ H2h;
21719 h2l = h2l ^ H2l;
21720 h3h = h3h ^ H3h;
21721 h3l = h3l ^ H3l;
21722 h4h = h4h ^ H4h;
21723 h4l = h4l ^ H4l;
21724 h5h = h5h ^ H5h;
21725 h5l = h5l ^ H5l;
21726 h6h = h6h ^ H6h;
21727 h6l = h6l ^ H6l;
21728 h7h = h7h ^ H7h;
21729 h7l = h7l ^ H7l;
21730 count = count - 1 | 0;
21731 }
21732 H0h = h0h;
21733 H0l = h0l;
21734 H1h = h1h;
21735 H1l = h1l;
21736 H2h = h2h;
21737 H2l = h2l;
21738 H3h = h3h;
21739 H3l = h3l;
21740 H4h = h4h;
21741 H4l = h4l;
21742 H5h = h5h;
21743 H5l = h5l;
21744 H6h = h6h;
21745 H6l = h6l;
21746 H7h = h7h;
21747 H7l = h7l;
21748 if (~output) _state_to_heap(output);
21749 return 0;
21750 }
21751 return {
21752 reset: reset,
21753 init: init,
21754 process: process,
21755 finish: finish,
21756 hmac_reset: hmac_reset,
21757 hmac_init: hmac_init,
21758 hmac_finish: hmac_finish,
21759 pbkdf2_generate_block: pbkdf2_generate_block
21760 };
21761 }
21762 var _sha512_block_size = 128, _sha512_hash_size = 64;
21763 function sha512_constructor(options) {
21764 options = options || {};
21765 options.heapSize = options.heapSize || 4096;
21766 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
21767 this.heap = options.heap || new Uint8Array(options.heapSize);
21768 this.asm = options.asm || sha512_asm(global, null, this.heap.buffer);
21769 this.BLOCK_SIZE = _sha512_block_size;
21770 this.HASH_SIZE = _sha512_hash_size;
21771 this.reset();
21772 }
21773 function sha512_reset() {
21774 this.result = null;
21775 this.pos = 0;
21776 this.len = 0;
21777 this.asm.reset();
21778 return this;
21779 }
21780 function sha512_process(data) {
21781 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21782 var dpos = 0, dlen = 0, clen = 0;
21783 if (is_buffer(data) || is_bytes(data)) {
21784 dpos = data.byteOffset || 0;
21785 dlen = data.byteLength;
21786 } else if (is_string(data)) {
21787 dlen = data.length;
21788 } else {
21789 throw new TypeError("data isn't of expected type");
21790 }
21791 while (dlen > 0) {
21792 clen = this.heap.byteLength - this.pos - this.len;
21793 clen = clen < dlen ? clen : dlen;
21794 if (is_buffer(data) || is_bytes(data)) {
21795 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
21796 } else {
21797 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
21798 }
21799 this.len += clen;
21800 dpos += clen;
21801 dlen -= clen;
21802 clen = this.asm.process(this.pos, this.len);
21803 if (clen < this.len) {
21804 this.pos += clen;
21805 this.len -= clen;
21806 } else {
21807 this.pos = 0;
21808 this.len = 0;
21809 }
21810 }
21811 return this;
21812 }
21813 function sha512_finish() {
21814 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21815 this.asm.finish(this.pos, this.len, 0);
21816 this.result = new Uint8Array(_sha512_hash_size);
21817 this.result.set(this.heap.subarray(0, _sha512_hash_size));
21818 this.pos = 0;
21819 this.len = 0;
21820 return this;
21821 }
21822 sha512_constructor.BLOCK_SIZE = _sha512_block_size;
21823 sha512_constructor.HASH_SIZE = _sha512_hash_size;
21824 var sha512_prototype = sha512_constructor.prototype;
21825 sha512_prototype.reset = sha512_reset;
21826 sha512_prototype.process = sha512_process;
21827 sha512_prototype.finish = sha512_finish;
21828 function hmac_constructor(options) {
21829 options = options || {};
21830 if (!options.hash) throw new SyntaxError("option 'hash' is required");
21831 if (!options.hash.HASH_SIZE) throw new SyntaxError("option 'hash' supplied doesn't seem to be a valid hash function");
21832 this.hash = options.hash;
21833 this.BLOCK_SIZE = this.hash.BLOCK_SIZE;
21834 this.HMAC_SIZE = this.hash.HASH_SIZE;
21835 this.key = null;
21836 this.verify = null;
21837 this.result = null;
21838 if (options.password !== undefined || options.verify !== undefined) this.reset(options);
21839 return this;
21840 }
21841 function hmac_sha256_constructor(options) {
21842 options = options || {};
21843 if (!(options.hash instanceof sha256_constructor)) options.hash = new sha256_constructor(options);
21844 hmac_constructor.call(this, options);
21845 return this;
21846 }
21847 function hmac_sha512_constructor(options) {
21848 options = options || {};
21849 if (!(options.hash instanceof sha512_constructor)) options.hash = new sha512_constructor(options);
21850 hmac_constructor.call(this, options);
21851 return this;
21852 }
21853 function _hmac_key(hash, password) {
21854 var key;
21855 if (is_buffer(password) || is_bytes(password)) {
21856 key = new Uint8Array(hash.BLOCK_SIZE);
21857 if (password.byteLength > hash.BLOCK_SIZE) {
21858 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21859 } else if (is_buffer(password)) {
21860 key.set(new Uint8Array(password));
21861 } else {
21862 key.set(password);
21863 }
21864 } else if (is_string(password)) {
21865 key = new Uint8Array(hash.BLOCK_SIZE);
21866 if (password.length > hash.BLOCK_SIZE) {
21867 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21868 } else {
21869 for (var i = 0; i < password.length; ++i) key[i] = password.charCodeAt(i);
21870 }
21871 } else {
21872 throw new TypeError("password isn't of expected type");
21873 }
21874 return key;
21875 }
21876 function _hmac_init_verify(verify) {
21877 if (is_buffer(verify) || is_bytes(verify)) {
21878 verify = new Uint8Array(verify);
21879 } else if (is_string(verify)) {
21880 verify = string_to_bytes(verify);
21881 } else {
21882 throw new TypeError("verify tag isn't of expected type");
21883 }
21884 if (verify.length !== this.HMAC_SIZE) throw new IllegalArgumentError("illegal verification tag size");
21885 this.verify = verify;
21886 }
21887 function hmac_reset(options) {
21888 options = options || {};
21889 var password = options.password;
21890 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21891 this.result = null;
21892 this.hash.reset();
21893 if (password || is_string(password)) this.key = _hmac_key(this.hash, password);
21894 var ipad = new Uint8Array(this.key);
21895 for (var i = 0; i < ipad.length; ++i) ipad[i] ^= 54;
21896 this.hash.process(ipad);
21897 var verify = options.verify;
21898 if (verify !== undefined) {
21899 _hmac_init_verify.call(this, verify);
21900 } else {
21901 this.verify = null;
21902 }
21903 return this;
21904 }
21905 function hmac_sha256_reset(options) {
21906 options = options || {};
21907 var password = options.password;
21908 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21909 this.result = null;
21910 this.hash.reset();
21911 if (password || is_string(password)) {
21912 this.key = _hmac_key(this.hash, password);
21913 this.hash.reset().asm.hmac_init(this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3], this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7], this.key[8] << 24 | this.key[9] << 16 | this.key[10] << 8 | this.key[11], this.key[12] << 24 | this.key[13] << 16 | this.key[14] << 8 | this.key[15], this.key[16] << 24 | this.key[17] << 16 | this.key[18] << 8 | this.key[19], this.key[20] << 24 | this.key[21] << 16 | this.key[22] << 8 | this.key[23], this.key[24] << 24 | this.key[25] << 16 | this.key[26] << 8 | this.key[27], this.key[28] << 24 | this.key[29] << 16 | this.key[30] << 8 | this.key[31], this.key[32] << 24 | this.key[33] << 16 | this.key[34] << 8 | this.key[35], this.key[36] << 24 | this.key[37] << 16 | this.key[38] << 8 | this.key[39], this.key[40] << 24 | this.key[41] << 16 | this.key[42] << 8 | this.key[43], this.key[44] << 24 | this.key[45] << 16 | this.key[46] << 8 | this.key[47], this.key[48] << 24 | this.key[49] << 16 | this.key[50] << 8 | this.key[51], this.key[52] << 24 | this.key[53] << 16 | this.key[54] << 8 | this.key[55], this.key[56] << 24 | this.key[57] << 16 | this.key[58] << 8 | this.key[59], this.key[60] << 24 | this.key[61] << 16 | this.key[62] << 8 | this.key[63]);
21914 } else {
21915 this.hash.asm.hmac_reset();
21916 }
21917 var verify = options.verify;
21918 if (verify !== undefined) {
21919 _hmac_init_verify.call(this, verify);
21920 } else {
21921 this.verify = null;
21922 }
21923 return this;
21924 }
21925 function hmac_sha512_reset(options) {
21926 options = options || {};
21927 var password = options.password;
21928 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21929 this.result = null;
21930 this.hash.reset();
21931 if (password || is_string(password)) {
21932 this.key = _hmac_key(this.hash, password);
21933 this.hash.reset().asm.hmac_init(this.key[0] << 24 | this.key[1] << 16 | this.key[2] << 8 | this.key[3], this.key[4] << 24 | this.key[5] << 16 | this.key[6] << 8 | this.key[7], this.key[8] << 24 | this.key[9] << 16 | this.key[10] << 8 | this.key[11], this.key[12] << 24 | this.key[13] << 16 | this.key[14] << 8 | this.key[15], this.key[16] << 24 | this.key[17] << 16 | this.key[18] << 8 | this.key[19], this.key[20] << 24 | this.key[21] << 16 | this.key[22] << 8 | this.key[23], this.key[24] << 24 | this.key[25] << 16 | this.key[26] << 8 | this.key[27], this.key[28] << 24 | this.key[29] << 16 | this.key[30] << 8 | this.key[31], this.key[32] << 24 | this.key[33] << 16 | this.key[34] << 8 | this.key[35], this.key[36] << 24 | this.key[37] << 16 | this.key[38] << 8 | this.key[39], this.key[40] << 24 | this.key[41] << 16 | this.key[42] << 8 | this.key[43], this.key[44] << 24 | this.key[45] << 16 | this.key[46] << 8 | this.key[47], this.key[48] << 24 | this.key[49] << 16 | this.key[50] << 8 | this.key[51], this.key[52] << 24 | this.key[53] << 16 | this.key[54] << 8 | this.key[55], this.key[56] << 24 | this.key[57] << 16 | this.key[58] << 8 | this.key[59], this.key[60] << 24 | this.key[61] << 16 | this.key[62] << 8 | this.key[63], this.key[64] << 24 | this.key[65] << 16 | this.key[66] << 8 | this.key[67], this.key[68] << 24 | this.key[69] << 16 | this.key[70] << 8 | this.key[71], this.key[72] << 24 | this.key[73] << 16 | this.key[74] << 8 | this.key[75], this.key[76] << 24 | this.key[77] << 16 | this.key[78] << 8 | this.key[79], this.key[80] << 24 | this.key[81] << 16 | this.key[82] << 8 | this.key[83], this.key[84] << 24 | this.key[85] << 16 | this.key[86] << 8 | this.key[87], this.key[88] << 24 | this.key[89] << 16 | this.key[90] << 8 | this.key[91], this.key[92] << 24 | this.key[93] << 16 | this.key[94] << 8 | this.key[95], this.key[96] << 24 | this.key[97] << 16 | this.key[98] << 8 | this.key[99], this.key[100] << 24 | this.key[101] << 16 | this.key[102] << 8 | this.key[103], this.key[104] << 24 | this.key[105] << 16 | this.key[106] << 8 | this.key[107], this.key[108] << 24 | this.key[109] << 16 | this.key[110] << 8 | this.key[111], this.key[112] << 24 | this.key[113] << 16 | this.key[114] << 8 | this.key[115], this.key[116] << 24 | this.key[117] << 16 | this.key[118] << 8 | this.key[119], this.key[120] << 24 | this.key[121] << 16 | this.key[122] << 8 | this.key[123], this.key[124] << 24 | this.key[125] << 16 | this.key[126] << 8 | this.key[127]);
21934 } else {
21935 this.hash.asm.hmac_reset();
21936 }
21937 var verify = options.verify;
21938 if (verify !== undefined) {
21939 _hmac_init_verify.call(this, verify);
21940 } else {
21941 this.verify = null;
21942 }
21943 return this;
21944 }
21945 function hmac_process(data) {
21946 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21947 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21948 this.hash.process(data);
21949 return this;
21950 }
21951 function hmac_finish() {
21952 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21953 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21954 var inner_result = this.hash.finish().result;
21955 var opad = new Uint8Array(this.key);
21956 for (var i = 0; i < opad.length; ++i) opad[i] ^= 92;
21957 var verify = this.verify;
21958 var result = this.hash.reset().process(opad).process(inner_result).finish().result;
21959 if (verify) {
21960 if (verify.length === result.length) {
21961 var diff = 0;
21962 for (var i = 0; i < verify.length; i++) {
21963 diff |= verify[i] ^ result[i];
21964 }
21965 this.result = !diff;
21966 } else {
21967 this.result = false;
21968 }
21969 } else {
21970 this.result = result;
21971 }
21972 return this;
21973 }
21974 function hmac_sha256_finish() {
21975 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21976 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21977 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
21978 asm.hmac_finish(hash.pos, hash.len, 0);
21979 var verify = this.verify;
21980 var result = new Uint8Array(_sha256_hash_size);
21981 result.set(heap.subarray(0, _sha256_hash_size));
21982 if (verify) {
21983 if (verify.length === result.length) {
21984 var diff = 0;
21985 for (var i = 0; i < verify.length; i++) {
21986 diff |= verify[i] ^ result[i];
21987 }
21988 this.result = !diff;
21989 } else {
21990 this.result = false;
21991 }
21992 } else {
21993 this.result = result;
21994 }
21995 return this;
21996 }
21997 function hmac_sha512_finish() {
21998 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21999 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22000 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
22001 asm.hmac_finish(hash.pos, hash.len, 0);
22002 var verify = this.verify;
22003 var result = new Uint8Array(_sha512_hash_size);
22004 result.set(heap.subarray(0, _sha512_hash_size));
22005 if (verify) {
22006 if (verify.length === result.length) {
22007 var diff = 0;
22008 for (var i = 0; i < verify.length; i++) {
22009 diff |= verify[i] ^ result[i];
22010 }
22011 this.result = !diff;
22012 } else {
22013 this.result = false;
22014 }
22015 } else {
22016 this.result = result;
22017 }
22018 return this;
22019 }
22020 var hmac_prototype = hmac_constructor.prototype;
22021 hmac_prototype.reset = hmac_reset;
22022 hmac_prototype.process = hmac_process;
22023 hmac_prototype.finish = hmac_finish;
22024 hmac_sha256_constructor.BLOCK_SIZE = sha256_constructor.BLOCK_SIZE;
22025 hmac_sha256_constructor.HMAC_SIZE = sha256_constructor.HASH_SIZE;
22026 var hmac_sha256_prototype = hmac_sha256_constructor.prototype;
22027 hmac_sha256_prototype.reset = hmac_sha256_reset;
22028 hmac_sha256_prototype.process = hmac_process;
22029 hmac_sha256_prototype.finish = hmac_sha256_finish;
22030 hmac_sha512_constructor.BLOCK_SIZE = sha512_constructor.BLOCK_SIZE;
22031 hmac_sha512_constructor.HMAC_SIZE = sha512_constructor.HASH_SIZE;
22032 var hmac_sha512_prototype = hmac_sha512_constructor.prototype;
22033 hmac_sha512_prototype.reset = hmac_sha512_reset;
22034 hmac_sha512_prototype.process = hmac_process;
22035 hmac_sha512_prototype.finish = hmac_sha512_finish;
22036 function pbkdf2_constructor(options) {
22037 options = options || {};
22038 if (!options.hmac) throw new SyntaxError("option 'hmac' is required");
22039 if (!options.hmac.HMAC_SIZE) throw new SyntaxError("option 'hmac' supplied doesn't seem to be a valid HMAC function");
22040 this.hmac = options.hmac;
22041 this.count = options.count || 4096;
22042 this.length = options.length || this.hmac.HMAC_SIZE;
22043 this.result = null;
22044 var password = options.password;
22045 if (password || is_string(password)) this.reset(options);
22046 return this;
22047 }
22048 function pbkdf2_hmac_sha256_constructor(options) {
22049 options = options || {};
22050 if (!(options.hmac instanceof hmac_sha256_constructor)) options.hmac = new hmac_sha256_constructor(options);
22051 pbkdf2_constructor.call(this, options);
22052 return this;
22053 }
22054 function pbkdf2_hmac_sha512_constructor(options) {
22055 options = options || {};
22056 if (!(options.hmac instanceof hmac_sha512_constructor)) options.hmac = new hmac_sha512_constructor(options);
22057 pbkdf2_constructor.call(this, options);
22058 return this;
22059 }
22060 function pbkdf2_reset(options) {
22061 this.result = null;
22062 this.hmac.reset(options);
22063 return this;
22064 }
22065 function pbkdf2_generate(salt, count, length) {
22066 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22067 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22068 count = count || this.count;
22069 length = length || this.length;
22070 this.result = new Uint8Array(length);
22071 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22072 for (var i = 1; i <= blocks; ++i) {
22073 var j = (i - 1) * this.hmac.HMAC_SIZE;
22074 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22075 var tmp = new Uint8Array(this.hmac.reset().process(salt).process(new Uint8Array([ i >>> 24 & 255, i >>> 16 & 255, i >>> 8 & 255, i & 255 ])).finish().result);
22076 this.result.set(tmp.subarray(0, l), j);
22077 for (var k = 1; k < count; ++k) {
22078 tmp = new Uint8Array(this.hmac.reset().process(tmp).finish().result);
22079 for (var r = 0; r < l; ++r) this.result[j + r] ^= tmp[r];
22080 }
22081 }
22082 return this;
22083 }
22084 function pbkdf2_hmac_sha256_generate(salt, count, length) {
22085 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22086 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22087 count = count || this.count;
22088 length = length || this.length;
22089 this.result = new Uint8Array(length);
22090 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22091 for (var i = 1; i <= blocks; ++i) {
22092 var j = (i - 1) * this.hmac.HMAC_SIZE;
22093 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22094 this.hmac.reset().process(salt);
22095 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22096 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22097 }
22098 return this;
22099 }
22100 function pbkdf2_hmac_sha512_generate(salt, count, length) {
22101 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22102 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22103 count = count || this.count;
22104 length = length || this.length;
22105 this.result = new Uint8Array(length);
22106 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22107 for (var i = 1; i <= blocks; ++i) {
22108 var j = (i - 1) * this.hmac.HMAC_SIZE;
22109 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22110 this.hmac.reset().process(salt);
22111 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22112 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22113 }
22114 return this;
22115 }
22116 var pbkdf2_prototype = pbkdf2_constructor.prototype;
22117 pbkdf2_prototype.reset = pbkdf2_reset;
22118 pbkdf2_prototype.generate = pbkdf2_generate;
22119 var pbkdf2_hmac_sha256_prototype = pbkdf2_hmac_sha256_constructor.prototype;
22120 pbkdf2_hmac_sha256_prototype.reset = pbkdf2_reset;
22121 pbkdf2_hmac_sha256_prototype.generate = pbkdf2_hmac_sha256_generate;
22122 var pbkdf2_hmac_sha512_prototype = pbkdf2_hmac_sha512_constructor.prototype;
22123 pbkdf2_hmac_sha512_prototype.reset = pbkdf2_reset;
22124 pbkdf2_hmac_sha512_prototype.generate = pbkdf2_hmac_sha512_generate;
22125 global.IllegalStateError = IllegalStateError;
22126 global.IllegalArgumentError = IllegalArgumentError;
22127 global.SecurityError = SecurityError;
22128 exports.string_to_bytes = string_to_bytes;
22129 exports.hex_to_bytes = hex_to_bytes;
22130 exports.base64_to_bytes = base64_to_bytes;
22131 exports.bytes_to_string = bytes_to_string;
22132 exports.bytes_to_hex = bytes_to_hex;
22133 exports.bytes_to_base64 = bytes_to_base64;
22134 var SHA256_instance = new sha256_constructor({
22135 heapSize: 1048576
22136 });
22137 function sha256_bytes(data) {
22138 if (data === undefined) throw new SyntaxError("data required");
22139 return SHA256_instance.reset().process(data).finish().result;
22140 }
22141 function sha256_hex(data) {
22142 var result = sha256_bytes(data);
22143 return bytes_to_hex(result);
22144 }
22145 function sha256_base64(data) {
22146 var result = sha256_bytes(data);
22147 return bytes_to_base64(result);
22148 }
22149 exports.SHA256 = {
22150 bytes: sha256_bytes,
22151 hex: sha256_hex,
22152 base64: sha256_base64
22153 };
22154 var SHA512_instance = new sha512_constructor({
22155 heapSize: 1048576
22156 });
22157 function sha512_bytes(data) {
22158 if (data === undefined) throw new SyntaxError("data required");
22159 return SHA512_instance.reset().process(data).finish().result;
22160 }
22161 function sha512_hex(data) {
22162 var result = sha512_bytes(data);
22163 return bytes_to_hex(result);
22164 }
22165 function sha512_base64(data) {
22166 var result = sha512_bytes(data);
22167 return bytes_to_base64(result);
22168 }
22169 exports.SHA512 = {
22170 bytes: sha512_bytes,
22171 hex: sha512_hex,
22172 base64: sha512_base64
22173 };
22174 var hmac_sha256_instance = new hmac_sha256_constructor({
22175 hash: SHA256_instance
22176 });
22177 function hmac_sha256_bytes(data, password) {
22178 if (data === undefined) throw new SyntaxError("data required");
22179 if (password === undefined) throw new SyntaxError("password required");
22180 return hmac_sha256_instance.reset({
22181 password: password
22182 }).process(data).finish().result;
22183 }
22184 function hmac_sha256_hex(data, password) {
22185 var result = hmac_sha256_bytes(data, password);
22186 return bytes_to_hex(result);
22187 }
22188 function hmac_sha256_base64(data, password) {
22189 var result = hmac_sha256_bytes(data, password);
22190 return bytes_to_base64(result);
22191 }
22192 exports.HMAC = exports.HMAC_SHA256 = {
22193 bytes: hmac_sha256_bytes,
22194 hex: hmac_sha256_hex,
22195 base64: hmac_sha256_base64
22196 };
22197 var hmac_sha512_instance = new hmac_sha512_constructor({
22198 hash: SHA512_instance
22199 });
22200 function hmac_sha512_bytes(data, password) {
22201 if (data === undefined) throw new SyntaxError("data required");
22202 if (password === undefined) throw new SyntaxError("password required");
22203 return hmac_sha512_instance.reset({
22204 password: password
22205 }).process(data).finish().result;
22206 }
22207 function hmac_sha512_hex(data, password) {
22208 var result = hmac_sha512_bytes(data, password);
22209 return bytes_to_hex(result);
22210 }
22211 function hmac_sha512_base64(data, password) {
22212 var result = hmac_sha512_bytes(data, password);
22213 return bytes_to_base64(result);
22214 }
22215 exports.HMAC_SHA512 = {
22216 bytes: hmac_sha512_bytes,
22217 hex: hmac_sha512_hex,
22218 base64: hmac_sha512_base64
22219 };
22220 var pbkdf2_hmac_sha256_instance = new pbkdf2_hmac_sha256_constructor({
22221 hmac: hmac_sha256_instance
22222 });
22223 function pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen) {
22224 if (password === undefined) throw new SyntaxError("password required");
22225 if (salt === undefined) throw new SyntaxError("salt required");
22226 return pbkdf2_hmac_sha256_instance.reset({
22227 password: password
22228 }).generate(salt, iterations, dklen).result;
22229 }
22230 function pbkdf2_hmac_sha256_hex(password, salt, iterations, dklen) {
22231 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22232 return bytes_to_hex(result);
22233 }
22234 function pbkdf2_hmac_sha256_base64(password, salt, iterations, dklen) {
22235 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22236 return bytes_to_base64(result);
22237 }
22238 exports.PBKDF2 = exports.PBKDF2_HMAC_SHA256 = {
22239 bytes: pbkdf2_hmac_sha256_bytes,
22240 hex: pbkdf2_hmac_sha256_hex,
22241 base64: pbkdf2_hmac_sha256_base64
22242 };
22243 var pbkdf2_hmac_sha512_instance = new pbkdf2_hmac_sha512_constructor({
22244 hmac: hmac_sha512_instance
22245 });
22246 function pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen) {
22247 if (password === undefined) throw new SyntaxError("password required");
22248 if (salt === undefined) throw new SyntaxError("salt required");
22249 return pbkdf2_hmac_sha512_instance.reset({
22250 password: password
22251 }).generate(salt, iterations, dklen).result;
22252 }
22253 function pbkdf2_hmac_sha512_hex(password, salt, iterations, dklen) {
22254 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22255 return bytes_to_hex(result);
22256 }
22257 function pbkdf2_hmac_sha512_base64(password, salt, iterations, dklen) {
22258 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22259 return bytes_to_base64(result);
22260 }
22261 exports.PBKDF2_HMAC_SHA512 = {
22262 bytes: pbkdf2_hmac_sha512_bytes,
22263 hex: pbkdf2_hmac_sha512_hex,
22264 base64: pbkdf2_hmac_sha512_base64
22265 };
22266 var cbc_aes_instance = new cbc_aes_constructor({
22267 heapSize: 1048576
22268 });
22269 function cbc_aes_encrypt_bytes(data, key, padding, iv) {
22270 if (data === undefined) throw new SyntaxError("data required");
22271 if (key === undefined) throw new SyntaxError("key required");
22272 return cbc_aes_instance.reset({
22273 key: key,
22274 padding: padding,
22275 iv: iv
22276 }).encrypt(data).result;
22277 }
22278 function cbc_aes_decrypt_bytes(data, key, padding, iv) {
22279 if (data === undefined) throw new SyntaxError("data required");
22280 if (key === undefined) throw new SyntaxError("key required");
22281 return cbc_aes_instance.reset({
22282 key: key,
22283 padding: padding,
22284 iv: iv
22285 }).decrypt(data).result;
22286 }
22287 exports.AES = exports.AES_CBC = {
22288 encrypt: cbc_aes_encrypt_bytes,
22289 decrypt: cbc_aes_decrypt_bytes
22290 };
22291 var ccm_aes_instance = new ccm_aes_constructor({
22292 heap: cbc_aes_instance.heap,
22293 asm: cbc_aes_instance.asm
22294 });
22295 function ccm_aes_encrypt_bytes(data, key, nonce, adata, tagSize) {
22296 if (data === undefined) throw new SyntaxError("data required");
22297 if (key === undefined) throw new SyntaxError("key required");
22298 if (nonce === undefined) throw new SyntaxError("nonce required");
22299 var dataLength = data.byteLength || data.length || 0;
22300 return ccm_aes_instance.reset({
22301 key: key,
22302 nonce: nonce,
22303 adata: adata,
22304 tagSize: tagSize,
22305 dataLength: dataLength
22306 }).encrypt(data).result;
22307 }
22308 function ccm_aes_decrypt_bytes(data, key, nonce, adata, tagSize) {
22309 if (data === undefined) throw new SyntaxError("data required");
22310 if (key === undefined) throw new SyntaxError("key required");
22311 if (nonce === undefined) throw new SyntaxError("nonce required");
22312 var dataLength = data.byteLength || data.length || 0;
22313 tagSize = tagSize || _aes_block_size;
22314 return ccm_aes_instance.reset({
22315 key: key,
22316 nonce: nonce,
22317 adata: adata,
22318 tagSize: tagSize,
22319 dataLength: dataLength - tagSize
22320 }).decrypt(data).result;
22321 }
22322 exports.AES_CCM = {
22323 encrypt: ccm_aes_encrypt_bytes,
22324 decrypt: ccm_aes_decrypt_bytes
22325 };
22326 var cfb_aes_instance = new cfb_aes_constructor({
22327 heap: cbc_aes_instance.heap,
22328 asm: cbc_aes_instance.asm
22329 });
22330 function cfb_aes_encrypt_bytes(data, key, padding, iv) {
22331 if (data === undefined) throw new SyntaxError("data required");
22332 if (key === undefined) throw new SyntaxError("key required");
22333 return cfb_aes_instance.reset({
22334 key: key,
22335 padding: padding,
22336 iv: iv
22337 }).encrypt(data).result;
22338 }
22339 function cfb_aes_decrypt_bytes(data, key, padding, iv) {
22340 if (data === undefined) throw new SyntaxError("data required");
22341 if (key === undefined) throw new SyntaxError("key required");
22342 return cfb_aes_instance.reset({
22343 key: key,
22344 padding: padding,
22345 iv: iv
22346 }).decrypt(data).result;
22347 }
22348 exports.AES_CFB = {
22349 encrypt: cfb_aes_encrypt_bytes,
22350 decrypt: cfb_aes_decrypt_bytes
22351 };
22352 var cfb_aes_decrypt_instance = new cfb_aes_decrypt_constructor({
22353 heap: cbc_aes_instance.heap,
22354 asm: cbc_aes_instance.asm
22355 });
22356 function cfb_aes_decrypt_init(key, padding, iv) {
22357 if (key === undefined) throw new SyntaxError("key required");
22358 return cfb_aes_decrypt_instance.reset({
22359 key: key,
22360 padding: padding,
22361 iv: iv
22362 });
22363 }
22364 exports.AES_CFB = exports.AES_CFB || {};
22365 exports.AES_CFB.decryptor = {
22366 init: cfb_aes_decrypt_init
22367 };
22368 })({}, function() {
22369 return this;
22370 }());
22371 </script>
22372
22373 <!--<script src="/js/jsbip39.js"></script>-->
22374 <script>
22375 /*
22376 * Copyright (c) 2013 Pavol Rusnak
22377 *
22378 * Permission is hereby granted, free of charge, to any person obtaining a copy of
22379 * this software and associated documentation files (the "Software"), to deal in
22380 * the Software without restriction, including without limitation the rights to
22381 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22382 * of the Software, and to permit persons to whom the Software is furnished to do
22383 * so, subject to the following conditions:
22384 *
22385 * The above copyright notice and this permission notice shall be included in all
22386 * copies or substantial portions of the Software.
22387 *
22388 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22389 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22390 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22391 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22392 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22393 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22394 */
22395
22396 /*
22397 * Javascript port from python by Ian Coleman
22398 *
22399 * Includes code from asmCrypto
22400 * https://github.com/tresorit/asmcrypto.js
22401 */
22402
22403 var Mnemonic = function(language) {
22404
22405 var PBKDF2_ROUNDS = 2048;
22406 var RADIX = 2048;
22407
22408 var self = this;
22409 var wordlist = [];
22410
22411 function init() {
22412 wordlist = WORDLISTS[language];
22413 if (wordlist.length != RADIX) {
22414 err = 'Wordlist should contain ' + RADIX + ' words, but it contains ' + wordlist.length + ' words.';
22415 throw err;
22416 }
22417 }
22418
22419 self.generate = function(strength) {
22420 strength = strength || 128;
22421 var r = strength % 32;
22422 if (r > 0) {
22423 throw 'Strength should be divisible by 32, but it is not (' + r + ').';
22424 }
22425 var hasStrongCrypto = 'crypto' in window && window['crypto'] !== null;
22426 if (!hasStrongCrypto) {
22427 throw 'Mnemonic should be generated with strong randomness, but crypto.getRandomValues is unavailable';
22428 }
22429 var buffer = new Uint8Array(strength / 8);
22430 var data = crypto.getRandomValues(buffer);
22431 return self.toMnemonic(data);
22432 }
22433
22434 self.toMnemonic = function(data) {
22435 if (data.length % 4 > 0) {
22436 throw 'Data length in bits should be divisible by 32, but it is not (' + data.length + ' bytes = ' + data.length*8 + ' bits).'
22437 }
22438
22439 //h = hashlib.sha256(data).hexdigest()
22440 var uintArray = new Uint8Array(data);
22441 var h = asmCrypto.SHA256.bytes(uintArray);
22442
22443 // b is a binary string, eg '00111010101100...'
22444 //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \
22445 // bin(int(h, 16))[2:].zfill(256)[:len(data) * 8 / 32]
22446 //
22447 // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8)
22448 // c = bin(int(h, 16))[2:].zfill(256)
22449 // d = c[:len(data) * 8 / 32]
22450 var a = byteArrayToBinaryString(data);
22451 var c = byteArrayToBinaryString(h);
22452 var d = c.substring(0, data.length * 8 / 32);
22453 // b = line1 + line2
22454 var b = a + d;
22455
22456 var result = [];
22457 var blen = b.length / 11;
22458 for (var i=0; i<blen; i++) {
22459 var idx = parseInt(b.substring(i * 11, (i + 1) * 11), 2);
22460 result.push(wordlist[idx]);
22461 }
22462 return result.join(' ');
22463 }
22464
22465 self.check = function(mnemonic) {
22466 var mnemonic = mnemonic.split(' ')
22467 if (mnemonic.length % 3 > 0) {
22468 return false
22469 }
22470 // idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
22471 var idx = [];
22472 for (var i=0; i<mnemonic.length; i++) {
22473 var word = mnemonic[i];
22474 var wordIndex = wordlist.indexOf(word);
22475 if (wordIndex == -1) {
22476 return false;
22477 }
22478 var binaryIndex = zfill(wordIndex.toString(2), 11);
22479 idx.push(binaryIndex);
22480 }
22481 var b = idx.join('');
22482 var l = b.length;
22483 //d = b[:l / 33 * 32]
22484 //h = b[-l / 33:]
22485 var d = b.substring(0, l / 33 * 32);
22486 var h = b.substring(l - l / 33, l);
22487 //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8))
22488 //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33]
22489 var nd = binaryStringToByteArray(d);
22490 var ndHash = asmCrypto.SHA256.bytes(nd);
22491 var ndBstr = zfill(byteArrayToBinaryString(ndHash), 256);
22492 var nh = ndBstr.substring(0,l/33);
22493 return h == nh;
22494 }
22495
22496 self.toSeed = function(mnemonic, passphrase) {
22497 passphrase = passphrase || '';
22498 mnemonic = normalizeString(mnemonic)
22499 passphrase = normalizeString(passphrase)
22500 passphrase = "mnemonic" + passphrase;
22501 //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64)
22502 return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8);
22503 }
22504
22505 function normalizeString(str) {
22506 if (typeof str.normalize == "function") {
22507 return str.normalize("NFKD");
22508 }
22509 else {
22510 // TODO find a library to do this
22511 // Not supported on firefox mobile
22512 console.warn("NFKD Normalization is unavailable");
22513 return str;
22514 }
22515 }
22516
22517 function byteArrayToBinaryString(data) {
22518 var bin = "";
22519 for (var i=0; i<data.length; i++) {
22520 bin += zfill(data[i].toString(2), 8);
22521 }
22522 return bin;
22523 }
22524
22525 function binaryStringToByteArray(str) {
22526 var arrayLen = str.length / 8;
22527 var array = new Uint8Array(arrayLen);
22528 for (var i=0; i<arrayLen; i++) {
22529 var valueStr = str.substring(0,8);
22530 var value = parseInt(valueStr, 2);
22531 array[i] = value;
22532 str = str.slice(8);
22533 }
22534 return array;
22535 }
22536
22537 // Pad a numeric string on the left with zero digits until the given width
22538 // is reached.
22539 // Note this differs to the python implementation because it does not
22540 // handle numbers starting with a sign.
22541 function zfill(source, length) {
22542 source = source.toString();
22543 while (source.length < length) {
22544 source = '0' + source;
22545 }
22546 return source;
22547 }
22548
22549 init();
22550
22551 }
22552
22553 WORDLISTS = {
22554 "english": [
22555 "abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
22556 "access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
22557 "action","actor","actress","actual","adapt","add","addict","address","adjust","admit",
22558 "adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent",
22559 "agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert",
22560 "alien","all","alley","allow","almost","alone","alpha","already","also","alter",
22561 "always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger",
22562 "angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique",
22563 "anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic",
22564 "area","arena","argue","arm","armed","armor","army","around","arrange","arrest",
22565 "arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset",
22566 "assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction",
22567 "audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake",
22568 "aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge",
22569 "bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain",
22570 "barrel","base","basic","basket","battle","beach","bean","beauty","because","become",
22571 "beef","before","begin","behave","behind","believe","below","belt","bench","benefit",
22572 "best","betray","better","between","beyond","bicycle","bid","bike","bind","biology",
22573 "bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless",
22574 "blind","blood","blossom","blouse","blue","blur","blush","board","boat","body",
22575 "boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss",
22576 "bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread",
22577 "breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze",
22578 "broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb",
22579 "bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy",
22580 "butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call",
22581 "calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas",
22582 "canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry",
22583 "cart","case","cash","casino","castle","casual","cat","catalog","catch","category",
22584 "cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century",
22585 "cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase",
22586 "chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child",
22587 "chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle",
22588 "citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk",
22589 "clever","click","client","cliff","climb","clinic","clip","clock","clog","close",
22590 "cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut",
22591 "code","coffee","coil","coin","collect","color","column","combine","come","comfort",
22592 "comic","common","company","concert","conduct","confirm","congress","connect","consider","control",
22593 "convince","cook","cool","copper","copy","coral","core","corn","correct","cost",
22594 "cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle",
22595 "craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek",
22596 "crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial",
22597 "cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup",
22598 "cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad",
22599 "damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal",
22600 "debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense",
22601 "define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny",
22602 "depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk",
22603 "despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond",
22604 "diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur",
22605 "direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance",
22606 "divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain",
22607 "donate","donkey","donor","door","dose","double","dove","draft","dragon","drama",
22608 "drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop",
22609 "drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf",
22610 "dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo",
22611 "ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow",
22612 "elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody",
22613 "embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless",
22614 "endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough",
22615 "enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip",
22616 "era","erase","erode","erosion","error","erupt","escape","essay","essence","estate",
22617 "eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange",
22618 "excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit",
22619 "exotic","expand","expect","expire","explain","expose","express","extend","extra","eye",
22620 "eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame",
22621 "family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father",
22622 "fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female",
22623 "fence","festival","fetch","fever","few","fiber","fiction","field","figure","file",
22624 "film","filter","final","find","fine","finger","finish","fire","firm","first",
22625 "fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor",
22626 "flee","flight","flip","float","flock","floor","flower","fluid","flush","fly",
22627 "foam","focus","fog","foil","fold","follow","food","foot","force","forest",
22628 "forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile",
22629 "frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen",
22630 "fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy",
22631 "gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp",
22632 "gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture",
22633 "ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance",
22634 "glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue",
22635 "goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown",
22636 "grab","grace","grain","grant","grape","grass","gravity","great","green","grid",
22637 "grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt",
22638 "guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy",
22639 "harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health",
22640 "heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden",
22641 "high","hill","hint","hip","hire","history","hobby","hockey","hold","hole",
22642 "holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital",
22643 "host","hotel","hour","hover","hub","huge","human","humble","humor","hundred",
22644 "hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea",
22645 "identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune",
22646 "impact","impose","improve","impulse","inch","include","income","increase","index","indicate",
22647 "indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury",
22648 "inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install",
22649 "intact","interest","into","invest","invite","involve","iron","island","isolate","issue",
22650 "item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel",
22651 "job","join","joke","journey","joy","judge","juice","jump","jungle","junior",
22652 "junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney",
22653 "kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife",
22654 "knock","know","lab","label","labor","ladder","lady","lake","lamp","language",
22655 "laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit",
22656 "layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal",
22657 "legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level",
22658 "liar","liberty","library","license","life","lift","light","like","limb","limit",
22659 "link","lion","liquid","list","little","live","lizard","load","loan","lobster",
22660 "local","lock","logic","lonely","long","loop","lottery","loud","lounge","love",
22661 "loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad",
22662 "magic","magnet","maid","mail","main","major","make","mammal","man","manage",
22663 "mandate","mango","mansion","manual","maple","marble","march","margin","marine","market",
22664 "marriage","mask","mass","master","match","material","math","matrix","matter","maximum",
22665 "maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt",
22666 "member","memory","mention","menu","mercy","merge","merit","merry","mesh","message",
22667 "metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor",
22668 "minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile",
22669 "model","modify","mom","moment","monitor","monkey","monster","month","moon","moral",
22670 "more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie",
22671 "much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual",
22672 "myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature",
22673 "near","neck","need","negative","neglect","neither","nephew","nerve","nest","net",
22674 "network","neutral","never","news","next","nice","night","noble","noise","nominee",
22675 "noodle","normal","north","nose","notable","note","nothing","notice","novel","now",
22676 "nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe",
22677 "obtain","obvious","occur","ocean","october","odor","off","offer","office","often",
22678 "oil","okay","old","olive","olympic","omit","once","one","onion","online",
22679 "only","open","opera","opinion","oppose","option","orange","orbit","orchard","order",
22680 "ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output",
22681 "outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact",
22682 "paddle","page","pair","palace","palm","panda","panel","panic","panther","paper",
22683 "parade","parent","park","parrot","party","pass","patch","path","patient","patrol",
22684 "pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen",
22685 "penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo",
22686 "phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot",
22687 "pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate",
22688 "play","please","pledge","pluck","plug","plunge","poem","poet","point","polar",
22689 "pole","police","pond","pony","pool","popular","portion","position","possible","post",
22690 "potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare",
22691 "present","pretty","prevent","price","pride","primary","print","priority","prison","private",
22692 "prize","problem","process","produce","profit","program","project","promote","proof","property",
22693 "prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin",
22694 "punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle",
22695 "pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit",
22696 "raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp",
22697 "ranch","random","range","rapid","rare","rate","rather","raven","raw","razor",
22698 "ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle",
22699 "reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release",
22700 "relief","rely","remain","remember","remind","remove","render","renew","rent","reopen",
22701 "repair","repeat","replace","report","require","rescue","resemble","resist","resource","response",
22702 "result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib",
22703 "ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot",
22704 "ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket",
22705 "romance","roof","rookie","room","rose","rotate","rough","round","route","royal",
22706 "rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness",
22707 "safe","sail","salad","salmon","salon","salt","salute","same","sample","sand",
22708 "satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter",
22709 "scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script",
22710 "scrub","sea","search","season","seat","second","secret","section","security","seed",
22711 "seek","segment","select","sell","seminar","senior","sense","sentence","series","service",
22712 "session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell",
22713 "sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop",
22714 "short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side",
22715 "siege","sight","sign","silent","silk","silly","silver","similar","simple","since",
22716 "sing","siren","sister","situate","six","size","skate","sketch","ski","skill",
22717 "skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight",
22718 "slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth",
22719 "snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda",
22720 "soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry",
22721 "sort","soul","sound","soup","source","south","space","spare","spatial","spawn",
22722 "speak","special","speed","spell","spend","sphere","spice","spider","spike","spin",
22723 "spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring",
22724 "spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp",
22725 "stand","start","state","stay","steak","steel","stem","step","stereo","stick",
22726 "still","sting","stock","stomach","stone","stool","story","stove","strategy","street",
22727 "strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway",
22728 "success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny",
22729 "sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey",
22730 "suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim",
22731 "swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag",
22732 "tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi",
22733 "teach","team","tell","ten","tenant","tennis","tent","term","test","text",
22734 "thank","that","theme","then","theory","there","they","thing","this","thought",
22735 "three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber",
22736 "time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler",
22737 "toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool",
22738 "tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist",
22739 "toward","tower","town","toy","track","trade","traffic","tragic","train","transfer",
22740 "trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick",
22741 "trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust",
22742 "truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle",
22743 "twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella",
22744 "unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform",
22745 "unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade",
22746 "uphold","upon","upper","upset","urban","urge","usage","use","used","useful",
22747 "useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van",
22748 "vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue",
22749 "verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory",
22750 "video","view","village","vintage","violin","virtual","virus","visa","visit","visual",
22751 "vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage",
22752 "wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash",
22753 "wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather",
22754 "web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat",
22755 "wheel","when","where","whip","whisper","wide","width","wife","wild","will",
22756 "win","window","wine","wing","wink","winner","winter","wire","wisdom","wise",
22757 "wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
22758 "worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
22759 "yellow","you","young","youth","zebra","zero","zone","zoo"]
22760 };
22761 </script>
22762
22763 <!--<script src="/js/index.js"></script>-->
22764 <script>
22765 (function() {
22766
22767 var mnemonic = new Mnemonic("english");
22768 var bip32RootKey = null;
22769 var bip32ExtendedKey = null;
22770 var network = Bitcoin.networks.bitcoin;
22771 var addressRowTemplate = $("#address-row-template");
22772
22773 var phraseChangeTimeoutEvent = null;
22774
22775 var DOM = {};
22776 DOM.phrase = $(".phrase");
22777 DOM.generate = $(".generate");
22778 DOM.rootKey = $(".root-key");
22779 DOM.extendedPrivKey = $(".extended-priv-key");
22780 DOM.extendedPubKey = $(".extended-pub-key");
22781 DOM.bip32path = $("#bip32-path");
22782 DOM.bip44path = $("#bip44-path");
22783 DOM.bip44purpose = $("#bip44 .purpose");
22784 DOM.bip44coin = $("#bip44 .coin");
22785 DOM.bip44account = $("#bip44 .account");
22786 DOM.bip44change = $("#bip44 .change");
22787 DOM.strength = $(".strength");
22788 DOM.addresses = $(".addresses");
22789 DOM.rowsToAdd = $(".rows-to-add");
22790 DOM.more = $(".more");
22791 DOM.feedback = $(".feedback");
22792 DOM.tab = $(".derivation-type a");
22793 DOM.indexToggle = $(".index-toggle");
22794 DOM.addressToggle = $(".address-toggle");
22795 DOM.privateKeyToggle = $(".private-key-toggle");
22796
22797 var derivationPath = DOM.bip44path.val();
22798
22799 function init() {
22800 // Events
22801 DOM.phrase.on("keyup", delayedPhraseChanged);
22802 DOM.generate.on("click", generateClicked);
22803 DOM.more.on("click", showMore);
22804 DOM.bip32path.on("keyup", bip32Changed);
22805 DOM.bip44purpose.on("keyup", bip44Changed);
22806 DOM.bip44coin.on("keyup", bip44Changed);
22807 DOM.bip44account.on("keyup", bip44Changed);
22808 DOM.bip44change.on("keyup", bip44Changed);
22809 DOM.tab.on("click", tabClicked);
22810 DOM.indexToggle.on("click", toggleIndexes);
22811 DOM.addressToggle.on("click", toggleAddresses);
22812 DOM.privateKeyToggle.on("click", togglePrivateKeys);
22813 disableForms();
22814 hidePending();
22815 hideValidationError();
22816 }
22817
22818 // Event handlers
22819
22820 function delayedPhraseChanged() {
22821 hideValidationError();
22822 showPending();
22823 if (phraseChangeTimeoutEvent != null) {
22824 clearTimeout(phraseChangeTimeoutEvent);
22825 }
22826 phraseChangeTimeoutEvent = setTimeout(phraseChanged, 400);
22827 }
22828
22829 function phraseChanged() {
22830 showPending();
22831 hideValidationError();
22832 // Get the mnemonic phrase
22833 var phrase = DOM.phrase.val();
22834 var errorText = findPhraseErrors(phrase);
22835 if (errorText) {
22836 showValidationError(errorText);
22837 return;
22838 }
22839 // Get the derivation path
22840 var errorText = findDerivationPathErrors();
22841 if (errorText) {
22842 showValidationError(errorText);
22843 return;
22844 }
22845 // Calculate and display
22846 calcBip32Seed(phrase, derivationPath);
22847 displayBip32Info();
22848 hidePending();
22849 }
22850
22851 function generateClicked() {
22852 clearDisplay();
22853 showPending();
22854 setTimeout(function() {
22855 var phrase = generateRandomPhrase();
22856 if (!phrase) {
22857 return;
22858 }
22859 phraseChanged();
22860 }, 50);
22861 }
22862
22863 function tabClicked(e) {
22864 var activePath = $(e.target.getAttribute("href") + " .path");
22865 derivationPath = activePath.val();
22866 derivationChanged();
22867 }
22868
22869 function derivationChanged() {
22870 delayedPhraseChanged();
22871 }
22872
22873 function bip32Changed() {
22874 derivationPath = DOM.bip32path.val();
22875 derivationChanged();
22876 }
22877
22878 function bip44Changed() {
22879 setBip44DerivationPath();
22880 derivationPath = DOM.bip44path.val();
22881 derivationChanged();
22882 }
22883
22884 function toggleIndexes() {
22885 $("td.index span").toggleClass("invisible");
22886 }
22887
22888 function toggleAddresses() {
22889 $("td.address span").toggleClass("invisible");
22890 }
22891
22892 function togglePrivateKeys() {
22893 $("td.privkey span").toggleClass("invisible");
22894 }
22895
22896 // Private methods
22897
22898 function generateRandomPhrase() {
22899 if (!hasStrongRandom()) {
22900 var errorText = "This browser does not support strong randomness";
22901 showValidationError(errorText);
22902 return;
22903 }
22904 var numWords = parseInt(DOM.strength.val());
22905 // Check strength is an integer
22906 if (isNaN(numWords)) {
22907 DOM.strength.val("12");
22908 numWords = 12;
22909 }
22910 // Check strength is a multiple of 32, if not round it down
22911 if (numWords % 3 != 0) {
22912 numWords = Math.floor(numWords / 3) * 3;
22913 DOM.strength.val(numWords);
22914 }
22915 // Check strength is at least 32
22916 if (numWords == 0) {
22917 numWords = 3;
22918 DOM.strength.val(numWords);
22919 }
22920 var strength = numWords / 3 * 32;
22921 var words = mnemonic.generate(strength);
22922 DOM.phrase.val(words);
22923 return words;
22924 }
22925
22926 function calcBip32Seed(phrase, path) {
22927 var seed = mnemonic.toSeed(phrase);
22928 var seedHash = Bitcoin.crypto.sha256(seed).toString("hex");
22929 bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network);
22930 bip32ExtendedKey = bip32RootKey;
22931 // Derive the key from the path
22932 var pathBits = path.split("/");
22933 for (var i=0; i<pathBits.length; i++) {
22934 var bit = pathBits[i];
22935 var index = parseInt(bit);
22936 if (isNaN(index)) {
22937 continue;
22938 }
22939 var hardened = bit[bit.length-1] == "'";
22940 if (hardened) {
22941 bip32ExtendedKey = bip32ExtendedKey.deriveHardened(index);
22942 }
22943 else {
22944 bip32ExtendedKey = bip32ExtendedKey.derive(index);
22945 }
22946 }
22947 }
22948
22949 function showValidationError(errorText) {
22950 DOM.feedback
22951 .text(errorText)
22952 .show();
22953 }
22954
22955 function hideValidationError() {
22956 DOM.feedback
22957 .text("")
22958 .hide();
22959 }
22960
22961 function findPhraseErrors(phrase) {
22962 // TODO make this right
22963 // Preprocess the words
22964 var parts = phrase.split(" ");
22965 var proper = [];
22966 for (var i=0; i<parts.length; i++) {
22967 var part = parts[i];
22968 if (part.length > 0) {
22969 // TODO check that lowercasing is always valid to do
22970 proper.push(part.toLowerCase());
22971 }
22972 }
22973 // TODO some levenstein on the words
22974 var properPhrase = proper.join(' ');
22975 // Check the words are valid
22976 var isValid = mnemonic.check(properPhrase);
22977 if (!isValid) {
22978 return "Invalid mnemonic";
22979 }
22980 return false;
22981 }
22982
22983 function findDerivationPathErrors(path) {
22984 // TODO
22985 return false;
22986 }
22987
22988 function displayBip32Info() {
22989 // Display the key
22990 var rootKey = bip32RootKey.toBase58();
22991 DOM.rootKey.val(rootKey);
22992 var extendedPrivKey = bip32ExtendedKey.toBase58();
22993 DOM.extendedPrivKey.val(extendedPrivKey);
22994 var extendedPubKey = bip32ExtendedKey.toBase58(false);
22995 DOM.extendedPubKey.val(extendedPubKey);
22996 // Display the addresses and privkeys
22997 clearAddressesList();
22998 displayAddresses(0, 20);
22999 }
23000
23001 function displayAddresses(start, total) {
23002 for (var i=0; i<total; i++) {
23003 var index = i+ start;
23004 var key = bip32ExtendedKey.derive(index);
23005 var address = key.getAddress().toString();
23006 var privkey = key.privKey.toWIF();
23007 addAddressToList(index, address, privkey);
23008 }
23009 }
23010
23011 function showMore() {
23012 var start = DOM.addresses.children().length;
23013 var rowsToAdd = parseInt(DOM.rowsToAdd.val());
23014 if (isNaN(rowsToAdd)) {
23015 rowsToAdd = 20;
23016 DOM.rowsToAdd.val("20");
23017 }
23018 if (rowsToAdd > 200) {
23019 var msg = "Generating " + rowsToAdd + " rows could take a while. ";
23020 msg += "Do you want to continue?";
23021 if (!confirm(msg)) {
23022 return;
23023 }
23024 }
23025 showPending();
23026 setTimeout(function() {
23027 displayAddresses(start, rowsToAdd);
23028 hidePending();
23029 }, 50);
23030 }
23031
23032 function clearDisplay() {
23033 clearAddressesList();
23034 clearKey();
23035 hideValidationError();
23036 }
23037
23038 function clearAddressesList() {
23039 DOM.addresses.empty();
23040 }
23041
23042 function clearKey() {
23043 DOM.rootKey.val("");
23044 DOM.extendedPrivKey.val("");
23045 DOM.extendedPubKey.val("");
23046 }
23047
23048 function addAddressToList(index, address, privkey) {
23049 var row = $(addressRowTemplate.html());
23050 row.find(".index span").text(index);
23051 row.find(".address span").text(address);
23052 row.find(".privkey span").text(privkey);
23053 DOM.addresses.append(row);
23054 }
23055
23056 function hasStrongRandom() {
23057 return 'crypto' in window && window['crypto'] !== null;
23058 }
23059
23060 function disableForms() {
23061 $("form").on("submit", function(e) {
23062 e.preventDefault();
23063 });
23064 }
23065
23066 function setBip44DerivationPath() {
23067 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
23068 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
23069 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
23070 var change = parseIntNoNaN(DOM.bip44change.val(), 0);
23071 var path = "m/";
23072 path += purpose + "'/";
23073 path += coin + "'/";
23074 path += account + "'/";
23075 path += change;
23076 DOM.bip44path.val(path);
23077 }
23078
23079 function parseIntNoNaN(val, defaultVal) {
23080 var v = parseInt(val);
23081 if (isNaN(v)) {
23082 return defaultVal;
23083 }
23084 return v;
23085 }
23086
23087 function showPending() {
23088 DOM.feedback
23089 .text("Calculating...")
23090 .show();
23091 }
23092
23093 function hidePending() {
23094 DOM.feedback
23095 .text("")
23096 .hide();
23097 }
23098
23099 init();
23100
23101 })();
23102 </script>
23103 </body>
23104 </html>