]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blob - bip39-standalone.html
Help text has correct left padding
[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>You can enter an existing BIP39 phrase, or generate a new random one. Typing your own twelve words will probably not work how you expect, since the words require a particular structure (the last word is a checksum)</p>
57 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki" target="_blank">BIP39 spec</a></p>
58 </div>
59 <div class="form-group">
60 <label for="phrase" class="col-sm-2 control-label">BIP39 Phrase</label>
61 <div class="col-sm-10">
62 <textarea id="phrase" class="phrase form-control"></textarea>
63 </div>
64 </div>
65 <div class="form-group">
66 <label for="strength" class="col-sm-2 control-label">Number of words</label>
67 <div class="col-sm-10">
68 <div class="input-group">
69 <input type="number" class="strength form-control" id="strength" value="12">
70 <span class="input-group-btn">
71 <button class="btn generate">Generate Random Phrase</button>
72 </span>
73 </div>
74 </div>
75 </div>
76 <div class="form-group">
77 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
78 <div class="col-sm-10">
79 <textarea id="root-key" class="root-key form-control" disabled="disabled"></textarea>
80 </div>
81 </div>
82 </form>
83 </div>
84 </div>
85
86 <hr>
87
88 <div class="row">
89 <div class="col-md-12">
90 <h2>Derivation Path</h2>
91 <ul class="derivation-type nav nav-tabs" role="tablist">
92 <li class="active">
93 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a></li>
94 <li><a href="#bip32" role="tab" data-toggle="tab">BIP32</a></li>
95 </ul>
96 <div class="derivation-type tab-content">
97 <div id="bip44" class="tab-pane active">
98 <form class="form-horizontal" role="form">
99 <br>
100 <div class="col-sm-2"></div>
101 <div class="col-sm-10">
102 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
103 </div>
104 <div class="form-group">
105 <label for="purpose" class="col-sm-2 control-label">
106 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
107 </label>
108 <div class="col-sm-10">
109 <input id="purpose" type="text" class="purpose form-control" value="44">
110 </div>
111 </div>
112 <div class="form-group">
113 <label for="coin" class="col-sm-2 control-label">
114 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
115 </label>
116 <div class="col-sm-10">
117 <input id="coin" type="text" class="coin form-control" value="0">
118 </div>
119 </div>
120 <div class="form-group">
121 <label for="account" class="col-sm-2 control-label">
122 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
123 </label>
124 <div class="col-sm-10">
125 <input id="account" type="text" class="account form-control" value="0">
126 </div>
127 </div>
128 <div class="form-group">
129 <label for="change" class="col-sm-2 control-label">
130 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
131 </label>
132 <div class="col-sm-10">
133 <input id="change" type="text" class="change form-control" value="0">
134 </div>
135 </div>
136 <div class="form-group">
137 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
138 <div class="col-sm-10">
139 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" disabled="disabled">
140 </div>
141 </div>
142 </form>
143 </div>
144 <div id="bip32" class="tab-pane">
145 <form class="form-horizontal" role="form">
146 <br>
147 <div class="col-sm-2"></div>
148 <div class="col-sm-10">
149 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
150 </div>
151 <div class="form-group">
152 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
153 <div class="col-sm-10">
154 <input id="bip32-path" type="text" class="path form-control" value="m/0">
155 </div>
156 </div>
157 </form>
158 </div>
159 </div>
160 <form class="form-horizontal" role="form">
161 <div class="form-group">
162 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
163 <div class="col-sm-10">
164 <textarea id="extended-priv-key" class="extended-priv-key form-control" disabled="disabled"></textarea>
165 </div>
166 </div>
167 <div class="form-group">
168 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
169 <div class="col-sm-10">
170 <textarea id="extended-pub-key" class="extended-pub-key form-control" disabled="disabled"></textarea>
171 </div>
172 </div>
173 </form>
174 </div>
175 </div>
176
177 <hr>
178
179 <div class="row">
180 <div class="col-md-12">
181 <h2>Derived Addresses</h2>
182 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
183 <table class="table table-striped">
184 <thead>
185 <th>
186 <div class="input-group">
187 Index&nbsp;&nbsp;
188 <button class="index-toggle">Toggle</button>
189 </div>
190 </th>
191 <th>
192 <div class="input-group">
193 Address&nbsp;&nbsp;
194 <button class="address-toggle">Toggle</button>
195 </div>
196 </th>
197 <th>
198 <div class="input-group">
199 Private Key&nbsp;&nbsp;
200 <button class="private-key-toggle">Toggle</button>
201 </div>
202 </th>
203 </thead>
204 <tbody class="addresses">
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 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
210 </tbody>
211 </table>
212 </div>
213 </div>
214 <span>Show next </button>
215 <input type="number" class="rows-to-add" value="20">
216 <button class="more">Show</button>
217
218 <hr>
219
220 <div class="row">
221 <div class="col-md-12">
222 <h2>More info</h2>
223 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
224 <p>
225 Read more at the
226 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
227 </p>
228 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
229 <p>
230 Read more at the
231 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
232 and see the demo at
233 <a href="http://bip32.org/" target="_blank">bip32.org</a>
234 </p>
235 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
236 <p>
237 Read more at the
238 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
239 </p>
240 <h3>Private Keys</h3>
241 <p>
242 Use private keys at
243 <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
244 but be careful - it can be easy to make mistakes if you
245 don't know what you're doing
246 </p>
247 </div>
248 </div>
249
250 <hr>
251
252 <div class="row">
253 <div class="col-md-12">
254 <h2>Derived Addresses</h2>
255 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
256 <table class="table table-striped">
257 <thead>
258 <th>
259 <div class="input-group">
260 Index&nbsp;&nbsp;
261 <button class="index-toggle">Toggle</button>
262 </div>
263 </th>
264 <th>
265 <div class="input-group">
266 Address&nbsp;&nbsp;
267 <button class="address-toggle">Toggle</button>
268 </div>
269 </th>
270 <th>
271 <div class="input-group">
272 Private Key&nbsp;&nbsp;
273 <button class="private-key-toggle">Toggle</button>
274 </div>
275 </th>
276 </thead>
277 <tbody class="addresses">
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 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
283 </tbody>
284 </table>
285 </div>
286 </div>
287 <span>Show next </button>
288 <input type="number" class="rows-to-add" value="20">
289 <button class="more">Show</button>
290
291 <hr>
292
293 <div class="row">
294 <div class="col-md-12">
295 <h2>More info</h2>
296 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
297 <p>
298 Read more at the
299 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
300 </p>
301 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
302 <p>
303 Read more at the
304 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
305 and see the demo at
306 <a href="http://bip32.org/" target="_blank">bip32.org</a>
307 </p>
308 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
309 <p>
310 Read more at the
311 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
312 </p>
313 <h3>Private Keys</h3>
314 <p>
315 Use private keys at
316 <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
317 but be careful - it can be easy to make mistakes if you
318 don't know what you're doing
319 </p>
320 </div>
321 </div>
322
323 <hr>
324
325 <div class="row">
326 <div class="col-md-12">
327
328 <h2>Offline Usage</h2>
329
330 <p>
331 You can use this tool without having to be online.
332 </p>
333 <p>
334 In your browser, select file save-as, and save this page
335 as a file.
336 </p>
337 <p>
338 Double-click that file to open it in a browser
339 on any offline computer.
340 </p>
341 <p>
342 Alternatively, download it from
343 <a href="https://github.com/dcpos/bip39">
344 https://github.com/dcpos/bip39
345 </a>
346
347 </div>
348 </div>
349
350 <hr>
351
352 <div class="row">
353 <div class="col-md-12">
354
355 <h2>This project is 100% open-source code</h2>
356
357 <p>
358 <span>Get the source code at - </span>
359 <a href="https://github.com/dcpos/bip39" target="_blank">
360 https://github.com/dcpos/bip39
361 </a>
362 </p>
363
364 <h3>Libraries</h3>
365
366 <p>
367 <span>BitcoinJS - </span>
368 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
369 https://github.com/bitcoinjs/bitcoinjs-lib
370 </a>
371 </p>
372
373 <p>
374 <span>jsBIP39 - </span>
375 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
376 https://github.com/iancoleman/jsbip39
377 </a>
378 </p>
379
380 <p>
381 <span>asmCrypto - </span>
382 <a href="https://github.com/vibornoff/asmcrypto.js" target="_blank">
383 https://github.com/vibornoff/asmcrypto.js
384 </a>
385 </p>
386
387 <p>
388 <span>jQuery - </span>
389 <a href="https://jquery.com/" target="_blank">
390 https://jquery.com/
391 </a>
392 </p>
393
394 <p>
395 <span>Twitter Bootstrap - </span>
396 <a href="http://getbootstrap.com/" target="_blank">
397 http://getbootstrap.com/
398 </a>
399 </p>
400
401 </div>
402 </div>
403
404 </div>
405
406 <div class="feedback-container">
407 <div class="feedback"></div>
408 </div>
409
410 <script type="text/template" id="address-row-template">
411 <tr>
412 <td class="index"><span></span></td>
413 <td class="address"><span></span></td>
414 <td class="privkey"><span></span></td>
415 </tr>
416 </script>
417
418 <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>-->
419 <script>
420 /*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
421 !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)
422 },_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))
423 },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});
424 </script>
425
426 <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>-->
427 <script>
428 /*!
429 * Bootstrap v3.2.0 (http://getbootstrap.com)
430 * Copyright 2011-2014 Twitter, Inc.
431 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
432 */
433 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);
434 </script>
435
436 <!--<script src="/js/bitcoinjs-1-0-0.js"></script>-->
437 <script>
438 (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){
439 var assert = _dereq_('assert')
440
441 module.exports = BigInteger
442
443 // JavaScript engine analysis
444 var canary = 0xdeadbeefcafe;
445 var j_lm = ((canary&0xffffff)==0xefcafe);
446
447 // (public) Constructor
448 function BigInteger(a,b,c) {
449 if (!(this instanceof BigInteger)) {
450 return new BigInteger(a, b, c);
451 }
452
453 if(a != null) {
454 if("number" == typeof a) this.fromNumber(a,b,c);
455 else if(b == null && "string" != typeof a) this.fromString(a,256);
456 else this.fromString(a,b);
457 }
458 }
459
460 var proto = BigInteger.prototype;
461
462 // return new, unset BigInteger
463 function nbi() { return new BigInteger(null); }
464
465 // Bits per digit
466 var dbits;
467
468 // am: Compute w_j += (x*this_i), propagate carries,
469 // c is initial carry, returns final carry.
470 // c < 3*dvalue, x < 2*dvalue, this_i < dvalue
471 // We need to select the fastest one that works in this environment.
472
473 // am1: use a single mult and divide to get the high bits,
474 // max digit bits should be 26 because
475 // max internal value = 2*dvalue^2-2*dvalue (< 2^53)
476 function am1(i,x,w,j,c,n) {
477 while(--n >= 0) {
478 var v = x*this[i++]+w[j]+c;
479 c = Math.floor(v/0x4000000);
480 w[j++] = v&0x3ffffff;
481 }
482 return c;
483 }
484 // am2 avoids a big mult-and-extract completely.
485 // Max digit bits should be <= 30 because we do bitwise ops
486 // on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
487 function am2(i,x,w,j,c,n) {
488 var xl = x&0x7fff, xh = x>>15;
489 while(--n >= 0) {
490 var l = this[i]&0x7fff;
491 var h = this[i++]>>15;
492 var m = xh*l+h*xl;
493 l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
494 c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
495 w[j++] = l&0x3fffffff;
496 }
497 return c;
498 }
499 // Alternately, set max digit bits to 28 since some
500 // browsers slow down when dealing with 32-bit numbers.
501 function am3(i,x,w,j,c,n) {
502 var xl = x&0x3fff, xh = x>>14;
503 while(--n >= 0) {
504 var l = this[i]&0x3fff;
505 var h = this[i++]>>14;
506 var m = xh*l+h*xl;
507 l = xl*l+((m&0x3fff)<<14)+w[j]+c;
508 c = (l>>28)+(m>>14)+xh*h;
509 w[j++] = l&0xfffffff;
510 }
511 return c;
512 }
513
514 // wtf?
515 BigInteger.prototype.am = am1;
516 dbits = 26;
517
518 /*
519 if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
520 BigInteger.prototype.am = am2;
521 dbits = 30;
522 }
523 else if(j_lm && (navigator.appName != "Netscape")) {
524 BigInteger.prototype.am = am1;
525 dbits = 26;
526 }
527 else { // Mozilla/Netscape seems to prefer am3
528 BigInteger.prototype.am = am3;
529 dbits = 28;
530 }
531 */
532
533 BigInteger.prototype.DB = dbits;
534 BigInteger.prototype.DM = ((1<<dbits)-1);
535 var DV = BigInteger.prototype.DV = (1<<dbits);
536
537 var BI_FP = 52;
538 BigInteger.prototype.FV = Math.pow(2,BI_FP);
539 BigInteger.prototype.F1 = BI_FP-dbits;
540 BigInteger.prototype.F2 = 2*dbits-BI_FP;
541
542 // Digit conversions
543 var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
544 var BI_RC = new Array();
545 var rr,vv;
546 rr = "0".charCodeAt(0);
547 for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
548 rr = "a".charCodeAt(0);
549 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
550 rr = "A".charCodeAt(0);
551 for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
552
553 function int2char(n) { return BI_RM.charAt(n); }
554 function intAt(s,i) {
555 var c = BI_RC[s.charCodeAt(i)];
556 return (c==null)?-1:c;
557 }
558
559 // (protected) copy this to r
560 function bnpCopyTo(r) {
561 for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
562 r.t = this.t;
563 r.s = this.s;
564 }
565
566 // (protected) set from integer value x, -DV <= x < DV
567 function bnpFromInt(x) {
568 this.t = 1;
569 this.s = (x<0)?-1:0;
570 if(x > 0) this[0] = x;
571 else if(x < -1) this[0] = x+DV;
572 else this.t = 0;
573 }
574
575 // return bigint initialized to value
576 function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
577
578 // (protected) set from string and radix
579 function bnpFromString(s,b) {
580 var self = this;
581
582 var k;
583 if(b == 16) k = 4;
584 else if(b == 8) k = 3;
585 else if(b == 256) k = 8; // byte array
586 else if(b == 2) k = 1;
587 else if(b == 32) k = 5;
588 else if(b == 4) k = 2;
589 else { self.fromRadix(s,b); return; }
590 self.t = 0;
591 self.s = 0;
592 var i = s.length, mi = false, sh = 0;
593 while(--i >= 0) {
594 var x = (k==8)?s[i]&0xff:intAt(s,i);
595 if(x < 0) {
596 if(s.charAt(i) == "-") mi = true;
597 continue;
598 }
599 mi = false;
600 if(sh == 0)
601 self[self.t++] = x;
602 else if(sh+k > self.DB) {
603 self[self.t-1] |= (x&((1<<(self.DB-sh))-1))<<sh;
604 self[self.t++] = (x>>(self.DB-sh));
605 }
606 else
607 self[self.t-1] |= x<<sh;
608 sh += k;
609 if(sh >= self.DB) sh -= self.DB;
610 }
611 if(k == 8 && (s[0]&0x80) != 0) {
612 self.s = -1;
613 if(sh > 0) self[self.t-1] |= ((1<<(self.DB-sh))-1)<<sh;
614 }
615 self.clamp();
616 if(mi) BigInteger.ZERO.subTo(self,self);
617 }
618
619 // (protected) clamp off excess high words
620 function bnpClamp() {
621 var c = this.s&this.DM;
622 while(this.t > 0 && this[this.t-1] == c) --this.t;
623 }
624
625 // (public) return string representation in given radix
626 function bnToString(b) {
627 var self = this;
628 if(self.s < 0) return "-"+self.negate().toString(b);
629 var k;
630 if(b == 16) k = 4;
631 else if(b == 8) k = 3;
632 else if(b == 2) k = 1;
633 else if(b == 32) k = 5;
634 else if(b == 4) k = 2;
635 else return self.toRadix(b);
636 var km = (1<<k)-1, d, m = false, r = "", i = self.t;
637 var p = self.DB-(i*self.DB)%k;
638 if(i-- > 0) {
639 if(p < self.DB && (d = self[i]>>p) > 0) { m = true; r = int2char(d); }
640 while(i >= 0) {
641 if(p < k) {
642 d = (self[i]&((1<<p)-1))<<(k-p);
643 d |= self[--i]>>(p+=self.DB-k);
644 }
645 else {
646 d = (self[i]>>(p-=k))&km;
647 if(p <= 0) { p += self.DB; --i; }
648 }
649 if(d > 0) m = true;
650 if(m) r += int2char(d);
651 }
652 }
653 return m?r:"0";
654 }
655
656 // (public) -this
657 function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
658
659 // (public) |this|
660 function bnAbs() { return (this.s<0)?this.negate():this; }
661
662 // (public) return + if this > a, - if this < a, 0 if equal
663 function bnCompareTo(a) {
664 var r = this.s-a.s;
665 if(r != 0) return r;
666 var i = this.t;
667 r = i-a.t;
668 if(r != 0) return (this.s<0)?-r:r;
669 while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
670 return 0;
671 }
672
673 // returns bit length of the integer x
674 function nbits(x) {
675 var r = 1, t;
676 if((t=x>>>16) != 0) { x = t; r += 16; }
677 if((t=x>>8) != 0) { x = t; r += 8; }
678 if((t=x>>4) != 0) { x = t; r += 4; }
679 if((t=x>>2) != 0) { x = t; r += 2; }
680 if((t=x>>1) != 0) { x = t; r += 1; }
681 return r;
682 }
683
684 // (public) return the number of bits in "this"
685 function bnBitLength() {
686 if(this.t <= 0) return 0;
687 return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
688 }
689
690 // (protected) r = this << n*DB
691 function bnpDLShiftTo(n,r) {
692 var i;
693 for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
694 for(i = n-1; i >= 0; --i) r[i] = 0;
695 r.t = this.t+n;
696 r.s = this.s;
697 }
698
699 // (protected) r = this >> n*DB
700 function bnpDRShiftTo(n,r) {
701 for(var i = n; i < this.t; ++i) r[i-n] = this[i];
702 r.t = Math.max(this.t-n,0);
703 r.s = this.s;
704 }
705
706 // (protected) r = this << n
707 function bnpLShiftTo(n,r) {
708 var self = this;
709 var bs = n%self.DB;
710 var cbs = self.DB-bs;
711 var bm = (1<<cbs)-1;
712 var ds = Math.floor(n/self.DB), c = (self.s<<bs)&self.DM, i;
713 for(i = self.t-1; i >= 0; --i) {
714 r[i+ds+1] = (self[i]>>cbs)|c;
715 c = (self[i]&bm)<<bs;
716 }
717 for(i = ds-1; i >= 0; --i) r[i] = 0;
718 r[ds] = c;
719 r.t = self.t+ds+1;
720 r.s = self.s;
721 r.clamp();
722 }
723
724 // (protected) r = this >> n
725 function bnpRShiftTo(n,r) {
726 var self = this;
727 r.s = self.s;
728 var ds = Math.floor(n/self.DB);
729 if(ds >= self.t) { r.t = 0; return; }
730 var bs = n%self.DB;
731 var cbs = self.DB-bs;
732 var bm = (1<<bs)-1;
733 r[0] = self[ds]>>bs;
734 for(var i = ds+1; i < self.t; ++i) {
735 r[i-ds-1] |= (self[i]&bm)<<cbs;
736 r[i-ds] = self[i]>>bs;
737 }
738 if(bs > 0) r[self.t-ds-1] |= (self.s&bm)<<cbs;
739 r.t = self.t-ds;
740 r.clamp();
741 }
742
743 // (protected) r = this - a
744 function bnpSubTo(a,r) {
745 var self = this;
746 var i = 0, c = 0, m = Math.min(a.t,self.t);
747 while(i < m) {
748 c += self[i]-a[i];
749 r[i++] = c&self.DM;
750 c >>= self.DB;
751 }
752 if(a.t < self.t) {
753 c -= a.s;
754 while(i < self.t) {
755 c += self[i];
756 r[i++] = c&self.DM;
757 c >>= self.DB;
758 }
759 c += self.s;
760 }
761 else {
762 c += self.s;
763 while(i < a.t) {
764 c -= a[i];
765 r[i++] = c&self.DM;
766 c >>= self.DB;
767 }
768 c -= a.s;
769 }
770 r.s = (c<0)?-1:0;
771 if(c < -1) r[i++] = self.DV+c;
772 else if(c > 0) r[i++] = c;
773 r.t = i;
774 r.clamp();
775 }
776
777 // (protected) r = this * a, r != this,a (HAC 14.12)
778 // "this" should be the larger one if appropriate.
779 function bnpMultiplyTo(a,r) {
780 var x = this.abs(), y = a.abs();
781 var i = x.t;
782 r.t = i+y.t;
783 while(--i >= 0) r[i] = 0;
784 for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
785 r.s = 0;
786 r.clamp();
787 if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
788 }
789
790 // (protected) r = this^2, r != this (HAC 14.16)
791 function bnpSquareTo(r) {
792 var x = this.abs();
793 var i = r.t = 2*x.t;
794 while(--i >= 0) r[i] = 0;
795 for(i = 0; i < x.t-1; ++i) {
796 var c = x.am(i,x[i],r,2*i,0,1);
797 if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
798 r[i+x.t] -= x.DV;
799 r[i+x.t+1] = 1;
800 }
801 }
802 if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
803 r.s = 0;
804 r.clamp();
805 }
806
807 // (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
808 // r != q, this != m. q or r may be null.
809 function bnpDivRemTo(m,q,r) {
810 var self = this;
811 var pm = m.abs();
812 if(pm.t <= 0) return;
813 var pt = self.abs();
814 if(pt.t < pm.t) {
815 if(q != null) q.fromInt(0);
816 if(r != null) self.copyTo(r);
817 return;
818 }
819 if(r == null) r = nbi();
820 var y = nbi(), ts = self.s, ms = m.s;
821 var nsh = self.DB-nbits(pm[pm.t-1]); // normalize modulus
822 if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
823 else { pm.copyTo(y); pt.copyTo(r); }
824 var ys = y.t;
825 var y0 = y[ys-1];
826 if(y0 == 0) return;
827 var yt = y0*(1<<self.F1)+((ys>1)?y[ys-2]>>self.F2:0);
828 var d1 = self.FV/yt, d2 = (1<<self.F1)/yt, e = 1<<self.F2;
829 var i = r.t, j = i-ys, t = (q==null)?nbi():q;
830 y.dlShiftTo(j,t);
831 if(r.compareTo(t) >= 0) {
832 r[r.t++] = 1;
833 r.subTo(t,r);
834 }
835 BigInteger.ONE.dlShiftTo(ys,t);
836 t.subTo(y,y); // "negative" y so we can replace sub with am later
837 while(y.t < ys) y[y.t++] = 0;
838 while(--j >= 0) {
839 // Estimate quotient digit
840 var qd = (r[--i]==y0)?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
841 if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
842 y.dlShiftTo(j,t);
843 r.subTo(t,r);
844 while(r[i] < --qd) r.subTo(t,r);
845 }
846 }
847 if(q != null) {
848 r.drShiftTo(ys,q);
849 if(ts != ms) BigInteger.ZERO.subTo(q,q);
850 }
851 r.t = ys;
852 r.clamp();
853 if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
854 if(ts < 0) BigInteger.ZERO.subTo(r,r);
855 }
856
857 // (public) this mod a
858 function bnMod(a) {
859 var r = nbi();
860 this.abs().divRemTo(a,null,r);
861 if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
862 return r;
863 }
864
865 // Modular reduction using "classic" algorithm
866 function Classic(m) { this.m = m; }
867 function cConvert(x) {
868 if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
869 else return x;
870 }
871 function cRevert(x) { return x; }
872 function cReduce(x) { x.divRemTo(this.m,null,x); }
873 function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
874 function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
875
876 Classic.prototype.convert = cConvert;
877 Classic.prototype.revert = cRevert;
878 Classic.prototype.reduce = cReduce;
879 Classic.prototype.mulTo = cMulTo;
880 Classic.prototype.sqrTo = cSqrTo;
881
882 // (protected) return "-1/this % 2^DB"; useful for Mont. reduction
883 // justification:
884 // xy == 1 (mod m)
885 // xy = 1+km
886 // xy(2-xy) = (1+km)(1-km)
887 // x[y(2-xy)] = 1-k^2m^2
888 // x[y(2-xy)] == 1 (mod m^2)
889 // if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
890 // should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
891 // JS multiply "overflows" differently from C/C++, so care is needed here.
892 function bnpInvDigit() {
893 if(this.t < 1) return 0;
894 var x = this[0];
895 if((x&1) == 0) return 0;
896 var y = x&3; // y == 1/x mod 2^2
897 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
898 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
899 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
900 // last step - calculate inverse mod DV directly;
901 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
902 y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
903 // we really want the negative inverse, and -DV < y < DV
904 return (y>0)?this.DV-y:-y;
905 }
906
907 // Montgomery reduction
908 function Montgomery(m) {
909 this.m = m;
910 this.mp = m.invDigit();
911 this.mpl = this.mp&0x7fff;
912 this.mph = this.mp>>15;
913 this.um = (1<<(m.DB-15))-1;
914 this.mt2 = 2*m.t;
915 }
916
917 // xR mod m
918 function montConvert(x) {
919 var r = nbi();
920 x.abs().dlShiftTo(this.m.t,r);
921 r.divRemTo(this.m,null,r);
922 if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
923 return r;
924 }
925
926 // x/R mod m
927 function montRevert(x) {
928 var r = nbi();
929 x.copyTo(r);
930 this.reduce(r);
931 return r;
932 }
933
934 // x = x/R mod m (HAC 14.32)
935 function montReduce(x) {
936 while(x.t <= this.mt2) // pad x so am has enough room later
937 x[x.t++] = 0;
938 for(var i = 0; i < this.m.t; ++i) {
939 // faster way of calculating u0 = x[i]*mp mod DV
940 var j = x[i]&0x7fff;
941 var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
942 // use am to combine the multiply-shift-add into one call
943 j = i+this.m.t;
944 x[j] += this.m.am(0,u0,x,i,0,this.m.t);
945 // propagate carry
946 while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
947 }
948 x.clamp();
949 x.drShiftTo(this.m.t,x);
950 if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
951 }
952
953 // r = "x^2/R mod m"; x != r
954 function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
955
956 // r = "xy/R mod m"; x,y != r
957 function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
958
959 Montgomery.prototype.convert = montConvert;
960 Montgomery.prototype.revert = montRevert;
961 Montgomery.prototype.reduce = montReduce;
962 Montgomery.prototype.mulTo = montMulTo;
963 Montgomery.prototype.sqrTo = montSqrTo;
964
965 // (protected) true iff this is even
966 function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
967
968 // (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
969 function bnpExp(e,z) {
970 if(e > 0xffffffff || e < 1) return BigInteger.ONE;
971 var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
972 g.copyTo(r);
973 while(--i >= 0) {
974 z.sqrTo(r,r2);
975 if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
976 else { var t = r; r = r2; r2 = t; }
977 }
978 return z.revert(r);
979 }
980
981 // (public) this^e % m, 0 <= e < 2^32
982 function bnModPowInt(e,m) {
983 var z;
984 if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
985 return this.exp(e,z);
986 }
987
988 // protected
989 proto.copyTo = bnpCopyTo;
990 proto.fromInt = bnpFromInt;
991 proto.fromString = bnpFromString;
992 proto.clamp = bnpClamp;
993 proto.dlShiftTo = bnpDLShiftTo;
994 proto.drShiftTo = bnpDRShiftTo;
995 proto.lShiftTo = bnpLShiftTo;
996 proto.rShiftTo = bnpRShiftTo;
997 proto.subTo = bnpSubTo;
998 proto.multiplyTo = bnpMultiplyTo;
999 proto.squareTo = bnpSquareTo;
1000 proto.divRemTo = bnpDivRemTo;
1001 proto.invDigit = bnpInvDigit;
1002 proto.isEven = bnpIsEven;
1003 proto.exp = bnpExp;
1004
1005 // public
1006 proto.toString = bnToString;
1007 proto.negate = bnNegate;
1008 proto.abs = bnAbs;
1009 proto.compareTo = bnCompareTo;
1010 proto.bitLength = bnBitLength;
1011 proto.mod = bnMod;
1012 proto.modPowInt = bnModPowInt;
1013
1014 //// jsbn2
1015
1016 function nbi() { return new BigInteger(null); }
1017
1018 // (public)
1019 function bnClone() { var r = nbi(); this.copyTo(r); return r; }
1020
1021 // (public) return value as integer
1022 function bnIntValue() {
1023 if(this.s < 0) {
1024 if(this.t == 1) return this[0]-this.DV;
1025 else if(this.t == 0) return -1;
1026 }
1027 else if(this.t == 1) return this[0];
1028 else if(this.t == 0) return 0;
1029 // assumes 16 < DB < 32
1030 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
1031 }
1032
1033 // (public) return value as byte
1034 function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
1035
1036 // (public) return value as short (assumes DB>=16)
1037 function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
1038
1039 // (protected) return x s.t. r^x < DV
1040 function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
1041
1042 // (public) 0 if this == 0, 1 if this > 0
1043 function bnSigNum() {
1044 if(this.s < 0) return -1;
1045 else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
1046 else return 1;
1047 }
1048
1049 // (protected) convert to radix string
1050 function bnpToRadix(b) {
1051 if(b == null) b = 10;
1052 if(this.signum() == 0 || b < 2 || b > 36) return "0";
1053 var cs = this.chunkSize(b);
1054 var a = Math.pow(b,cs);
1055 var d = nbv(a), y = nbi(), z = nbi(), r = "";
1056 this.divRemTo(d,y,z);
1057 while(y.signum() > 0) {
1058 r = (a+z.intValue()).toString(b).substr(1) + r;
1059 y.divRemTo(d,y,z);
1060 }
1061 return z.intValue().toString(b) + r;
1062 }
1063
1064 // (protected) convert from radix string
1065 function bnpFromRadix(s,b) {
1066 var self = this;
1067 self.fromInt(0);
1068 if(b == null) b = 10;
1069 var cs = self.chunkSize(b);
1070 var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
1071 for(var i = 0; i < s.length; ++i) {
1072 var x = intAt(s,i);
1073 if(x < 0) {
1074 if(s.charAt(i) == "-" && self.signum() == 0) mi = true;
1075 continue;
1076 }
1077 w = b*w+x;
1078 if(++j >= cs) {
1079 self.dMultiply(d);
1080 self.dAddOffset(w,0);
1081 j = 0;
1082 w = 0;
1083 }
1084 }
1085 if(j > 0) {
1086 self.dMultiply(Math.pow(b,j));
1087 self.dAddOffset(w,0);
1088 }
1089 if(mi) BigInteger.ZERO.subTo(self,self);
1090 }
1091
1092 // (protected) alternate constructor
1093 function bnpFromNumber(a,b,c) {
1094 var self = this;
1095 if("number" == typeof b) {
1096 // new BigInteger(int,int,RNG)
1097 if(a < 2) self.fromInt(1);
1098 else {
1099 self.fromNumber(a,c);
1100 if(!self.testBit(a-1)) // force MSB set
1101 self.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,self);
1102 if(self.isEven()) self.dAddOffset(1,0); // force odd
1103 while(!self.isProbablePrime(b)) {
1104 self.dAddOffset(2,0);
1105 if(self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a-1),self);
1106 }
1107 }
1108 }
1109 else {
1110 // new BigInteger(int,RNG)
1111 var x = new Array(), t = a&7;
1112 x.length = (a>>3)+1;
1113 b.nextBytes(x);
1114 if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
1115 self.fromString(x,256);
1116 }
1117 }
1118
1119 // (public) convert to bigendian byte array
1120 function bnToByteArray() {
1121 var self = this;
1122 var i = self.t, r = new Array();
1123 r[0] = self.s;
1124 var p = self.DB-(i*self.DB)%8, d, k = 0;
1125 if(i-- > 0) {
1126 if(p < self.DB && (d = self[i]>>p) != (self.s&self.DM)>>p)
1127 r[k++] = d|(self.s<<(self.DB-p));
1128 while(i >= 0) {
1129 if(p < 8) {
1130 d = (self[i]&((1<<p)-1))<<(8-p);
1131 d |= self[--i]>>(p+=self.DB-8);
1132 }
1133 else {
1134 d = (self[i]>>(p-=8))&0xff;
1135 if(p <= 0) { p += self.DB; --i; }
1136 }
1137 if((d&0x80) != 0) d |= -256;
1138 if(k === 0 && (self.s&0x80) != (d&0x80)) ++k;
1139 if(k > 0 || d != self.s) r[k++] = d;
1140 }
1141 }
1142 return r;
1143 }
1144
1145 function bnEquals(a) { return(this.compareTo(a)==0); }
1146 function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
1147 function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
1148
1149 // (protected) r = this op a (bitwise)
1150 function bnpBitwiseTo(a,op,r) {
1151 var self = this;
1152 var i, f, m = Math.min(a.t,self.t);
1153 for(i = 0; i < m; ++i) r[i] = op(self[i],a[i]);
1154 if(a.t < self.t) {
1155 f = a.s&self.DM;
1156 for(i = m; i < self.t; ++i) r[i] = op(self[i],f);
1157 r.t = self.t;
1158 }
1159 else {
1160 f = self.s&self.DM;
1161 for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
1162 r.t = a.t;
1163 }
1164 r.s = op(self.s,a.s);
1165 r.clamp();
1166 }
1167
1168 // (public) this & a
1169 function op_and(x,y) { return x&y; }
1170 function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
1171
1172 // (public) this | a
1173 function op_or(x,y) { return x|y; }
1174 function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
1175
1176 // (public) this ^ a
1177 function op_xor(x,y) { return x^y; }
1178 function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
1179
1180 // (public) this & ~a
1181 function op_andnot(x,y) { return x&~y; }
1182 function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
1183
1184 // (public) ~this
1185 function bnNot() {
1186 var r = nbi();
1187 for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
1188 r.t = this.t;
1189 r.s = ~this.s;
1190 return r;
1191 }
1192
1193 // (public) this << n
1194 function bnShiftLeft(n) {
1195 var r = nbi();
1196 if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
1197 return r;
1198 }
1199
1200 // (public) this >> n
1201 function bnShiftRight(n) {
1202 var r = nbi();
1203 if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
1204 return r;
1205 }
1206
1207 // return index of lowest 1-bit in x, x < 2^31
1208 function lbit(x) {
1209 if(x == 0) return -1;
1210 var r = 0;
1211 if((x&0xffff) == 0) { x >>= 16; r += 16; }
1212 if((x&0xff) == 0) { x >>= 8; r += 8; }
1213 if((x&0xf) == 0) { x >>= 4; r += 4; }
1214 if((x&3) == 0) { x >>= 2; r += 2; }
1215 if((x&1) == 0) ++r;
1216 return r;
1217 }
1218
1219 // (public) returns index of lowest 1-bit (or -1 if none)
1220 function bnGetLowestSetBit() {
1221 for(var i = 0; i < this.t; ++i)
1222 if(this[i] != 0) return i*this.DB+lbit(this[i]);
1223 if(this.s < 0) return this.t*this.DB;
1224 return -1;
1225 }
1226
1227 // return number of 1 bits in x
1228 function cbit(x) {
1229 var r = 0;
1230 while(x != 0) { x &= x-1; ++r; }
1231 return r;
1232 }
1233
1234 // (public) return number of set bits
1235 function bnBitCount() {
1236 var r = 0, x = this.s&this.DM;
1237 for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
1238 return r;
1239 }
1240
1241 // (public) true iff nth bit is set
1242 function bnTestBit(n) {
1243 var j = Math.floor(n/this.DB);
1244 if(j >= this.t) return(this.s!=0);
1245 return((this[j]&(1<<(n%this.DB)))!=0);
1246 }
1247
1248 // (protected) this op (1<<n)
1249 function bnpChangeBit(n,op) {
1250 var r = BigInteger.ONE.shiftLeft(n);
1251 this.bitwiseTo(r,op,r);
1252 return r;
1253 }
1254
1255 // (public) this | (1<<n)
1256 function bnSetBit(n) { return this.changeBit(n,op_or); }
1257
1258 // (public) this & ~(1<<n)
1259 function bnClearBit(n) { return this.changeBit(n,op_andnot); }
1260
1261 // (public) this ^ (1<<n)
1262 function bnFlipBit(n) { return this.changeBit(n,op_xor); }
1263
1264 // (protected) r = this + a
1265 function bnpAddTo(a,r) {
1266 var self = this;
1267
1268 var i = 0, c = 0, m = Math.min(a.t,self.t);
1269 while(i < m) {
1270 c += self[i]+a[i];
1271 r[i++] = c&self.DM;
1272 c >>= self.DB;
1273 }
1274 if(a.t < self.t) {
1275 c += a.s;
1276 while(i < self.t) {
1277 c += self[i];
1278 r[i++] = c&self.DM;
1279 c >>= self.DB;
1280 }
1281 c += self.s;
1282 }
1283 else {
1284 c += self.s;
1285 while(i < a.t) {
1286 c += a[i];
1287 r[i++] = c&self.DM;
1288 c >>= self.DB;
1289 }
1290 c += a.s;
1291 }
1292 r.s = (c<0)?-1:0;
1293 if(c > 0) r[i++] = c;
1294 else if(c < -1) r[i++] = self.DV+c;
1295 r.t = i;
1296 r.clamp();
1297 }
1298
1299 // (public) this + a
1300 function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
1301
1302 // (public) this - a
1303 function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
1304
1305 // (public) this * a
1306 function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
1307
1308 // (public) this^2
1309 function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
1310
1311 // (public) this / a
1312 function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
1313
1314 // (public) this % a
1315 function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
1316
1317 // (public) [this/a,this%a]
1318 function bnDivideAndRemainder(a) {
1319 var q = nbi(), r = nbi();
1320 this.divRemTo(a,q,r);
1321 return new Array(q,r);
1322 }
1323
1324 // (protected) this *= n, this >= 0, 1 < n < DV
1325 function bnpDMultiply(n) {
1326 this[this.t] = this.am(0,n-1,this,0,0,this.t);
1327 ++this.t;
1328 this.clamp();
1329 }
1330
1331 // (protected) this += n << w words, this >= 0
1332 function bnpDAddOffset(n,w) {
1333 if(n == 0) return;
1334 while(this.t <= w) this[this.t++] = 0;
1335 this[w] += n;
1336 while(this[w] >= this.DV) {
1337 this[w] -= this.DV;
1338 if(++w >= this.t) this[this.t++] = 0;
1339 ++this[w];
1340 }
1341 }
1342
1343 // A "null" reducer
1344 function NullExp() {}
1345 function nNop(x) { return x; }
1346 function nMulTo(x,y,r) { x.multiplyTo(y,r); }
1347 function nSqrTo(x,r) { x.squareTo(r); }
1348
1349 NullExp.prototype.convert = nNop;
1350 NullExp.prototype.revert = nNop;
1351 NullExp.prototype.mulTo = nMulTo;
1352 NullExp.prototype.sqrTo = nSqrTo;
1353
1354 // (public) this^e
1355 function bnPow(e) { return this.exp(e,new NullExp()); }
1356
1357 // (protected) r = lower n words of "this * a", a.t <= n
1358 // "this" should be the larger one if appropriate.
1359 function bnpMultiplyLowerTo(a,n,r) {
1360 var i = Math.min(this.t+a.t,n);
1361 r.s = 0; // assumes a,this >= 0
1362 r.t = i;
1363 while(i > 0) r[--i] = 0;
1364 var j;
1365 for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
1366 for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
1367 r.clamp();
1368 }
1369
1370 // (protected) r = "this * a" without lower n words, n > 0
1371 // "this" should be the larger one if appropriate.
1372 function bnpMultiplyUpperTo(a,n,r) {
1373 --n;
1374 var i = r.t = this.t+a.t-n;
1375 r.s = 0; // assumes a,this >= 0
1376 while(--i >= 0) r[i] = 0;
1377 for(i = Math.max(n-this.t,0); i < a.t; ++i)
1378 r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
1379 r.clamp();
1380 r.drShiftTo(1,r);
1381 }
1382
1383 // Barrett modular reduction
1384 function Barrett(m) {
1385 // setup Barrett
1386 this.r2 = nbi();
1387 this.q3 = nbi();
1388 BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
1389 this.mu = this.r2.divide(m);
1390 this.m = m;
1391 }
1392
1393 function barrettConvert(x) {
1394 if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
1395 else if(x.compareTo(this.m) < 0) return x;
1396 else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
1397 }
1398
1399 function barrettRevert(x) { return x; }
1400
1401 // x = x mod m (HAC 14.42)
1402 function barrettReduce(x) {
1403 var self = this;
1404 x.drShiftTo(self.m.t-1,self.r2);
1405 if(x.t > self.m.t+1) { x.t = self.m.t+1; x.clamp(); }
1406 self.mu.multiplyUpperTo(self.r2,self.m.t+1,self.q3);
1407 self.m.multiplyLowerTo(self.q3,self.m.t+1,self.r2);
1408 while(x.compareTo(self.r2) < 0) x.dAddOffset(1,self.m.t+1);
1409 x.subTo(self.r2,x);
1410 while(x.compareTo(self.m) >= 0) x.subTo(self.m,x);
1411 }
1412
1413 // r = x^2 mod m; x != r
1414 function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
1415
1416 // r = x*y mod m; x,y != r
1417 function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
1418
1419 Barrett.prototype.convert = barrettConvert;
1420 Barrett.prototype.revert = barrettRevert;
1421 Barrett.prototype.reduce = barrettReduce;
1422 Barrett.prototype.mulTo = barrettMulTo;
1423 Barrett.prototype.sqrTo = barrettSqrTo;
1424
1425 // (public) this^e % m (HAC 14.85)
1426 function bnModPow(e,m) {
1427 var i = e.bitLength(), k, r = nbv(1), z;
1428 if(i <= 0) return r;
1429 else if(i < 18) k = 1;
1430 else if(i < 48) k = 3;
1431 else if(i < 144) k = 4;
1432 else if(i < 768) k = 5;
1433 else k = 6;
1434 if(i < 8)
1435 z = new Classic(m);
1436 else if(m.isEven())
1437 z = new Barrett(m);
1438 else
1439 z = new Montgomery(m);
1440
1441 // precomputation
1442 var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
1443 g[1] = z.convert(this);
1444 if(k > 1) {
1445 var g2 = nbi();
1446 z.sqrTo(g[1],g2);
1447 while(n <= km) {
1448 g[n] = nbi();
1449 z.mulTo(g2,g[n-2],g[n]);
1450 n += 2;
1451 }
1452 }
1453
1454 var j = e.t-1, w, is1 = true, r2 = nbi(), t;
1455 i = nbits(e[j])-1;
1456 while(j >= 0) {
1457 if(i >= k1) w = (e[j]>>(i-k1))&km;
1458 else {
1459 w = (e[j]&((1<<(i+1))-1))<<(k1-i);
1460 if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
1461 }
1462
1463 n = k;
1464 while((w&1) == 0) { w >>= 1; --n; }
1465 if((i -= n) < 0) { i += this.DB; --j; }
1466 if(is1) { // ret == 1, don't bother squaring or multiplying it
1467 g[w].copyTo(r);
1468 is1 = false;
1469 }
1470 else {
1471 while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
1472 if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
1473 z.mulTo(r2,g[w],r);
1474 }
1475
1476 while(j >= 0 && (e[j]&(1<<i)) == 0) {
1477 z.sqrTo(r,r2); t = r; r = r2; r2 = t;
1478 if(--i < 0) { i = this.DB-1; --j; }
1479 }
1480 }
1481 return z.revert(r);
1482 }
1483
1484 // (public) gcd(this,a) (HAC 14.54)
1485 function bnGCD(a) {
1486 var x = (this.s<0)?this.negate():this.clone();
1487 var y = (a.s<0)?a.negate():a.clone();
1488 if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
1489 var i = x.getLowestSetBit(), g = y.getLowestSetBit();
1490 if(g < 0) return x;
1491 if(i < g) g = i;
1492 if(g > 0) {
1493 x.rShiftTo(g,x);
1494 y.rShiftTo(g,y);
1495 }
1496 while(x.signum() > 0) {
1497 if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
1498 if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
1499 if(x.compareTo(y) >= 0) {
1500 x.subTo(y,x);
1501 x.rShiftTo(1,x);
1502 }
1503 else {
1504 y.subTo(x,y);
1505 y.rShiftTo(1,y);
1506 }
1507 }
1508 if(g > 0) y.lShiftTo(g,y);
1509 return y;
1510 }
1511
1512 // (protected) this % n, n < 2^26
1513 function bnpModInt(n) {
1514 if(n <= 0) return 0;
1515 var d = this.DV%n, r = (this.s<0)?n-1:0;
1516 if(this.t > 0)
1517 if(d == 0) r = this[0]%n;
1518 else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
1519 return r;
1520 }
1521
1522 // (public) 1/this % m (HAC 14.61)
1523 function bnModInverse(m) {
1524 var ac = m.isEven();
1525 if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
1526 var u = m.clone(), v = this.clone();
1527 var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
1528 while(u.signum() != 0) {
1529 while(u.isEven()) {
1530 u.rShiftTo(1,u);
1531 if(ac) {
1532 if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
1533 a.rShiftTo(1,a);
1534 }
1535 else if(!b.isEven()) b.subTo(m,b);
1536 b.rShiftTo(1,b);
1537 }
1538 while(v.isEven()) {
1539 v.rShiftTo(1,v);
1540 if(ac) {
1541 if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
1542 c.rShiftTo(1,c);
1543 }
1544 else if(!d.isEven()) d.subTo(m,d);
1545 d.rShiftTo(1,d);
1546 }
1547 if(u.compareTo(v) >= 0) {
1548 u.subTo(v,u);
1549 if(ac) a.subTo(c,a);
1550 b.subTo(d,b);
1551 }
1552 else {
1553 v.subTo(u,v);
1554 if(ac) c.subTo(a,c);
1555 d.subTo(b,d);
1556 }
1557 }
1558 if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
1559 if(d.compareTo(m) >= 0) return d.subtract(m);
1560 if(d.signum() < 0) d.addTo(m,d); else return d;
1561 if(d.signum() < 0) return d.add(m); else return d;
1562 }
1563
1564 // protected
1565 proto.chunkSize = bnpChunkSize;
1566 proto.toRadix = bnpToRadix;
1567 proto.fromRadix = bnpFromRadix;
1568 proto.fromNumber = bnpFromNumber;
1569 proto.bitwiseTo = bnpBitwiseTo;
1570 proto.changeBit = bnpChangeBit;
1571 proto.addTo = bnpAddTo;
1572 proto.dMultiply = bnpDMultiply;
1573 proto.dAddOffset = bnpDAddOffset;
1574 proto.multiplyLowerTo = bnpMultiplyLowerTo;
1575 proto.multiplyUpperTo = bnpMultiplyUpperTo;
1576 proto.modInt = bnpModInt;
1577
1578 // public
1579 proto.clone = bnClone;
1580 proto.intValue = bnIntValue;
1581 proto.byteValue = bnByteValue;
1582 proto.shortValue = bnShortValue;
1583 proto.signum = bnSigNum;
1584 proto.toByteArray = bnToByteArray;
1585 proto.equals = bnEquals;
1586 proto.min = bnMin;
1587 proto.max = bnMax;
1588 proto.and = bnAnd;
1589 proto.or = bnOr;
1590 proto.xor = bnXor;
1591 proto.andNot = bnAndNot;
1592 proto.not = bnNot;
1593 proto.shiftLeft = bnShiftLeft;
1594 proto.shiftRight = bnShiftRight;
1595 proto.getLowestSetBit = bnGetLowestSetBit;
1596 proto.bitCount = bnBitCount;
1597 proto.testBit = bnTestBit;
1598 proto.setBit = bnSetBit;
1599 proto.clearBit = bnClearBit;
1600 proto.flipBit = bnFlipBit;
1601 proto.add = bnAdd;
1602 proto.subtract = bnSubtract;
1603 proto.multiply = bnMultiply;
1604 proto.divide = bnDivide;
1605 proto.remainder = bnRemainder;
1606 proto.divideAndRemainder = bnDivideAndRemainder;
1607 proto.modPow = bnModPow;
1608 proto.modInverse = bnModInverse;
1609 proto.pow = bnPow;
1610 proto.gcd = bnGCD;
1611
1612 // JSBN-specific extension
1613 proto.square = bnSquare;
1614
1615 // BigInteger interfaces not implemented in jsbn:
1616
1617 // BigInteger(int signum, byte[] magnitude)
1618 // double doubleValue()
1619 // float floatValue()
1620 // int hashCode()
1621 // long longValue()
1622 // static BigInteger valueOf(long val)
1623
1624 // "constants"
1625 BigInteger.ZERO = nbv(0);
1626 BigInteger.ONE = nbv(1);
1627 BigInteger.valueOf = nbv;
1628
1629 },{"assert":4}],2:[function(_dereq_,module,exports){
1630 (function (Buffer){
1631 // FIXME: Kind of a weird way to throw exceptions, consider removing
1632 var assert = _dereq_('assert')
1633 var BigInteger = _dereq_('./bigi')
1634
1635 /**
1636 * Turns a byte array into a big integer.
1637 *
1638 * This function will interpret a byte array as a big integer in big
1639 * endian notation.
1640 */
1641 BigInteger.fromByteArrayUnsigned = function(byteArray) {
1642 // BigInteger expects a DER integer conformant byte array
1643 if (byteArray[0] & 0x80) {
1644 return new BigInteger([0].concat(byteArray))
1645 }
1646
1647 return new BigInteger(byteArray)
1648 }
1649
1650 /**
1651 * Returns a byte array representation of the big integer.
1652 *
1653 * This returns the absolute of the contained value in big endian
1654 * form. A value of zero results in an empty array.
1655 */
1656 BigInteger.prototype.toByteArrayUnsigned = function() {
1657 var byteArray = this.toByteArray()
1658 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
1659 }
1660
1661 BigInteger.fromDERInteger = function(byteArray) {
1662 return new BigInteger(byteArray)
1663 }
1664
1665 /*
1666 * Converts BigInteger to a DER integer representation.
1667 *
1668 * The format for this value uses the most significant bit as a sign
1669 * bit. If the most significant bit is already set and the integer is
1670 * positive, a 0x00 is prepended.
1671 *
1672 * Examples:
1673 *
1674 * 0 => 0x00
1675 * 1 => 0x01
1676 * -1 => 0x81
1677 * 127 => 0x7f
1678 * -127 => 0xff
1679 * 128 => 0x0080
1680 * -128 => 0x80
1681 * 255 => 0x00ff
1682 * -255 => 0xff
1683 * 16300 => 0x3fac
1684 * -16300 => 0xbfac
1685 * 62300 => 0x00f35c
1686 * -62300 => 0xf35c
1687 */
1688 BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
1689
1690 BigInteger.fromBuffer = function(buffer) {
1691 // BigInteger expects a DER integer conformant byte array
1692 if (buffer[0] & 0x80) {
1693 var byteArray = Array.prototype.slice.call(buffer)
1694
1695 return new BigInteger([0].concat(byteArray))
1696 }
1697
1698 return new BigInteger(buffer)
1699 }
1700
1701 BigInteger.fromHex = function(hex) {
1702 if (hex === '') return BigInteger.ZERO
1703
1704 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
1705 assert.equal(hex.length % 2, 0, 'Incomplete hex')
1706 return new BigInteger(hex, 16)
1707 }
1708
1709 BigInteger.prototype.toBuffer = function(size) {
1710 var byteArray = this.toByteArrayUnsigned()
1711 var zeros = []
1712
1713 var padding = size - byteArray.length
1714 while (zeros.length < padding) zeros.push(0)
1715
1716 return new Buffer(zeros.concat(byteArray))
1717 }
1718
1719 BigInteger.prototype.toHex = function(size) {
1720 return this.toBuffer(size).toString('hex')
1721 }
1722
1723 }).call(this,_dereq_("buffer").Buffer)
1724 },{"./bigi":1,"assert":4,"buffer":8}],3:[function(_dereq_,module,exports){
1725 var BigInteger = _dereq_('./bigi')
1726
1727 //addons
1728 _dereq_('./convert')
1729
1730 module.exports = BigInteger
1731 },{"./bigi":1,"./convert":2}],4:[function(_dereq_,module,exports){
1732 // http://wiki.commonjs.org/wiki/Unit_Testing/1.0
1733 //
1734 // THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
1735 //
1736 // Originally from narwhal.js (http://narwhaljs.org)
1737 // Copyright (c) 2009 Thomas Robinson <280north.com>
1738 //
1739 // Permission is hereby granted, free of charge, to any person obtaining a copy
1740 // of this software and associated documentation files (the 'Software'), to
1741 // deal in the Software without restriction, including without limitation the
1742 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1743 // sell copies of the Software, and to permit persons to whom the Software is
1744 // furnished to do so, subject to the following conditions:
1745 //
1746 // The above copyright notice and this permission notice shall be included in
1747 // all copies or substantial portions of the Software.
1748 //
1749 // THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1750 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1751 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1752 // AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1753 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1754 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1755
1756 // when used in node, this will actually load the util module we depend on
1757 // versus loading the builtin util module as happens otherwise
1758 // this is a bug in node module loading as far as I am concerned
1759 var util = _dereq_('util/');
1760
1761 var pSlice = Array.prototype.slice;
1762 var hasOwn = Object.prototype.hasOwnProperty;
1763
1764 // 1. The assert module provides functions that throw
1765 // AssertionError's when particular conditions are not met. The
1766 // assert module must conform to the following interface.
1767
1768 var assert = module.exports = ok;
1769
1770 // 2. The AssertionError is defined in assert.
1771 // new assert.AssertionError({ message: message,
1772 // actual: actual,
1773 // expected: expected })
1774
1775 assert.AssertionError = function AssertionError(options) {
1776 this.name = 'AssertionError';
1777 this.actual = options.actual;
1778 this.expected = options.expected;
1779 this.operator = options.operator;
1780 if (options.message) {
1781 this.message = options.message;
1782 this.generatedMessage = false;
1783 } else {
1784 this.message = getMessage(this);
1785 this.generatedMessage = true;
1786 }
1787 var stackStartFunction = options.stackStartFunction || fail;
1788
1789 if (Error.captureStackTrace) {
1790 Error.captureStackTrace(this, stackStartFunction);
1791 }
1792 else {
1793 // non v8 browsers so we can have a stacktrace
1794 var err = new Error();
1795 if (err.stack) {
1796 var out = err.stack;
1797
1798 // try to strip useless frames
1799 var fn_name = stackStartFunction.name;
1800 var idx = out.indexOf('\n' + fn_name);
1801 if (idx >= 0) {
1802 // once we have located the function frame
1803 // we need to strip out everything before it (and its line)
1804 var next_line = out.indexOf('\n', idx + 1);
1805 out = out.substring(next_line + 1);
1806 }
1807
1808 this.stack = out;
1809 }
1810 }
1811 };
1812
1813 // assert.AssertionError instanceof Error
1814 util.inherits(assert.AssertionError, Error);
1815
1816 function replacer(key, value) {
1817 if (util.isUndefined(value)) {
1818 return '' + value;
1819 }
1820 if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) {
1821 return value.toString();
1822 }
1823 if (util.isFunction(value) || util.isRegExp(value)) {
1824 return value.toString();
1825 }
1826 return value;
1827 }
1828
1829 function truncate(s, n) {
1830 if (util.isString(s)) {
1831 return s.length < n ? s : s.slice(0, n);
1832 } else {
1833 return s;
1834 }
1835 }
1836
1837 function getMessage(self) {
1838 return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
1839 self.operator + ' ' +
1840 truncate(JSON.stringify(self.expected, replacer), 128);
1841 }
1842
1843 // At present only the three keys mentioned above are used and
1844 // understood by the spec. Implementations or sub modules can pass
1845 // other keys to the AssertionError's constructor - they will be
1846 // ignored.
1847
1848 // 3. All of the following functions must throw an AssertionError
1849 // when a corresponding condition is not met, with a message that
1850 // may be undefined if not provided. All assertion methods provide
1851 // both the actual and expected values to the assertion error for
1852 // display purposes.
1853
1854 function fail(actual, expected, message, operator, stackStartFunction) {
1855 throw new assert.AssertionError({
1856 message: message,
1857 actual: actual,
1858 expected: expected,
1859 operator: operator,
1860 stackStartFunction: stackStartFunction
1861 });
1862 }
1863
1864 // EXTENSION! allows for well behaved errors defined elsewhere.
1865 assert.fail = fail;
1866
1867 // 4. Pure assertion tests whether a value is truthy, as determined
1868 // by !!guard.
1869 // assert.ok(guard, message_opt);
1870 // This statement is equivalent to assert.equal(true, !!guard,
1871 // message_opt);. To test strictly for the value true, use
1872 // assert.strictEqual(true, guard, message_opt);.
1873
1874 function ok(value, message) {
1875 if (!value) fail(value, true, message, '==', assert.ok);
1876 }
1877 assert.ok = ok;
1878
1879 // 5. The equality assertion tests shallow, coercive equality with
1880 // ==.
1881 // assert.equal(actual, expected, message_opt);
1882
1883 assert.equal = function equal(actual, expected, message) {
1884 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
1885 };
1886
1887 // 6. The non-equality assertion tests for whether two objects are not equal
1888 // with != assert.notEqual(actual, expected, message_opt);
1889
1890 assert.notEqual = function notEqual(actual, expected, message) {
1891 if (actual == expected) {
1892 fail(actual, expected, message, '!=', assert.notEqual);
1893 }
1894 };
1895
1896 // 7. The equivalence assertion tests a deep equality relation.
1897 // assert.deepEqual(actual, expected, message_opt);
1898
1899 assert.deepEqual = function deepEqual(actual, expected, message) {
1900 if (!_deepEqual(actual, expected)) {
1901 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
1902 }
1903 };
1904
1905 function _deepEqual(actual, expected) {
1906 // 7.1. All identical values are equivalent, as determined by ===.
1907 if (actual === expected) {
1908 return true;
1909
1910 } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
1911 if (actual.length != expected.length) return false;
1912
1913 for (var i = 0; i < actual.length; i++) {
1914 if (actual[i] !== expected[i]) return false;
1915 }
1916
1917 return true;
1918
1919 // 7.2. If the expected value is a Date object, the actual value is
1920 // equivalent if it is also a Date object that refers to the same time.
1921 } else if (util.isDate(actual) && util.isDate(expected)) {
1922 return actual.getTime() === expected.getTime();
1923
1924 // 7.3 If the expected value is a RegExp object, the actual value is
1925 // equivalent if it is also a RegExp object with the same source and
1926 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
1927 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
1928 return actual.source === expected.source &&
1929 actual.global === expected.global &&
1930 actual.multiline === expected.multiline &&
1931 actual.lastIndex === expected.lastIndex &&
1932 actual.ignoreCase === expected.ignoreCase;
1933
1934 // 7.4. Other pairs that do not both pass typeof value == 'object',
1935 // equivalence is determined by ==.
1936 } else if (!util.isObject(actual) && !util.isObject(expected)) {
1937 return actual == expected;
1938
1939 // 7.5 For all other Object pairs, including Array objects, equivalence is
1940 // determined by having the same number of owned properties (as verified
1941 // with Object.prototype.hasOwnProperty.call), the same set of keys
1942 // (although not necessarily the same order), equivalent values for every
1943 // corresponding key, and an identical 'prototype' property. Note: this
1944 // accounts for both named and indexed properties on Arrays.
1945 } else {
1946 return objEquiv(actual, expected);
1947 }
1948 }
1949
1950 function isArguments(object) {
1951 return Object.prototype.toString.call(object) == '[object Arguments]';
1952 }
1953
1954 function objEquiv(a, b) {
1955 if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
1956 return false;
1957 // an identical 'prototype' property.
1958 if (a.prototype !== b.prototype) return false;
1959 //~~~I've managed to break Object.keys through screwy arguments passing.
1960 // Converting to array solves the problem.
1961 if (isArguments(a)) {
1962 if (!isArguments(b)) {
1963 return false;
1964 }
1965 a = pSlice.call(a);
1966 b = pSlice.call(b);
1967 return _deepEqual(a, b);
1968 }
1969 try {
1970 var ka = objectKeys(a),
1971 kb = objectKeys(b),
1972 key, i;
1973 } catch (e) {//happens when one is a string literal and the other isn't
1974 return false;
1975 }
1976 // having the same number of owned properties (keys incorporates
1977 // hasOwnProperty)
1978 if (ka.length != kb.length)
1979 return false;
1980 //the same set of keys (although not necessarily the same order),
1981 ka.sort();
1982 kb.sort();
1983 //~~~cheap key test
1984 for (i = ka.length - 1; i >= 0; i--) {
1985 if (ka[i] != kb[i])
1986 return false;
1987 }
1988 //equivalent values for every corresponding key, and
1989 //~~~possibly expensive deep test
1990 for (i = ka.length - 1; i >= 0; i--) {
1991 key = ka[i];
1992 if (!_deepEqual(a[key], b[key])) return false;
1993 }
1994 return true;
1995 }
1996
1997 // 8. The non-equivalence assertion tests for any deep inequality.
1998 // assert.notDeepEqual(actual, expected, message_opt);
1999
2000 assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
2001 if (_deepEqual(actual, expected)) {
2002 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
2003 }
2004 };
2005
2006 // 9. The strict equality assertion tests strict equality, as determined by ===.
2007 // assert.strictEqual(actual, expected, message_opt);
2008
2009 assert.strictEqual = function strictEqual(actual, expected, message) {
2010 if (actual !== expected) {
2011 fail(actual, expected, message, '===', assert.strictEqual);
2012 }
2013 };
2014
2015 // 10. The strict non-equality assertion tests for strict inequality, as
2016 // determined by !==. assert.notStrictEqual(actual, expected, message_opt);
2017
2018 assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
2019 if (actual === expected) {
2020 fail(actual, expected, message, '!==', assert.notStrictEqual);
2021 }
2022 };
2023
2024 function expectedException(actual, expected) {
2025 if (!actual || !expected) {
2026 return false;
2027 }
2028
2029 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
2030 return expected.test(actual);
2031 } else if (actual instanceof expected) {
2032 return true;
2033 } else if (expected.call({}, actual) === true) {
2034 return true;
2035 }
2036
2037 return false;
2038 }
2039
2040 function _throws(shouldThrow, block, expected, message) {
2041 var actual;
2042
2043 if (util.isString(expected)) {
2044 message = expected;
2045 expected = null;
2046 }
2047
2048 try {
2049 block();
2050 } catch (e) {
2051 actual = e;
2052 }
2053
2054 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
2055 (message ? ' ' + message : '.');
2056
2057 if (shouldThrow && !actual) {
2058 fail(actual, expected, 'Missing expected exception' + message);
2059 }
2060
2061 if (!shouldThrow && expectedException(actual, expected)) {
2062 fail(actual, expected, 'Got unwanted exception' + message);
2063 }
2064
2065 if ((shouldThrow && actual && expected &&
2066 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
2067 throw actual;
2068 }
2069 }
2070
2071 // 11. Expected to throw an error:
2072 // assert.throws(block, Error_opt, message_opt);
2073
2074 assert.throws = function(block, /*optional*/error, /*optional*/message) {
2075 _throws.apply(this, [true].concat(pSlice.call(arguments)));
2076 };
2077
2078 // EXTENSION! This is annoying to write outside this module.
2079 assert.doesNotThrow = function(block, /*optional*/message) {
2080 _throws.apply(this, [false].concat(pSlice.call(arguments)));
2081 };
2082
2083 assert.ifError = function(err) { if (err) {throw err;}};
2084
2085 var objectKeys = Object.keys || function (obj) {
2086 var keys = [];
2087 for (var key in obj) {
2088 if (hasOwn.call(obj, key)) keys.push(key);
2089 }
2090 return keys;
2091 };
2092
2093 },{"util/":6}],5:[function(_dereq_,module,exports){
2094 module.exports = function isBuffer(arg) {
2095 return arg && typeof arg === 'object'
2096 && typeof arg.copy === 'function'
2097 && typeof arg.fill === 'function'
2098 && typeof arg.readUInt8 === 'function';
2099 }
2100 },{}],6:[function(_dereq_,module,exports){
2101 (function (process,global){
2102 // Copyright Joyent, Inc. and other Node contributors.
2103 //
2104 // Permission is hereby granted, free of charge, to any person obtaining a
2105 // copy of this software and associated documentation files (the
2106 // "Software"), to deal in the Software without restriction, including
2107 // without limitation the rights to use, copy, modify, merge, publish,
2108 // distribute, sublicense, and/or sell copies of the Software, and to permit
2109 // persons to whom the Software is furnished to do so, subject to the
2110 // following conditions:
2111 //
2112 // The above copyright notice and this permission notice shall be included
2113 // in all copies or substantial portions of the Software.
2114 //
2115 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2116 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2117 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2118 // NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2119 // DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2120 // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2121 // USE OR OTHER DEALINGS IN THE SOFTWARE.
2122
2123 var formatRegExp = /%[sdj%]/g;
2124 exports.format = function(f) {
2125 if (!isString(f)) {
2126 var objects = [];
2127 for (var i = 0; i < arguments.length; i++) {
2128 objects.push(inspect(arguments[i]));
2129 }
2130 return objects.join(' ');
2131 }
2132
2133 var i = 1;
2134 var args = arguments;
2135 var len = args.length;
2136 var str = String(f).replace(formatRegExp, function(x) {
2137 if (x === '%%') return '%';
2138 if (i >= len) return x;
2139 switch (x) {
2140 case '%s': return String(args[i++]);
2141 case '%d': return Number(args[i++]);
2142 case '%j':
2143 try {
2144 return JSON.stringify(args[i++]);
2145 } catch (_) {
2146 return '[Circular]';
2147 }
2148 default:
2149 return x;
2150 }
2151 });
2152 for (var x = args[i]; i < len; x = args[++i]) {
2153 if (isNull(x) || !isObject(x)) {
2154 str += ' ' + x;
2155 } else {
2156 str += ' ' + inspect(x);
2157 }
2158 }
2159 return str;
2160 };
2161
2162
2163 // Mark that a method should not be used.
2164 // Returns a modified function which warns once by default.
2165 // If --no-deprecation is set, then it is a no-op.
2166 exports.deprecate = function(fn, msg) {
2167 // Allow for deprecating things in the process of starting up.
2168 if (isUndefined(global.process)) {
2169 return function() {
2170 return exports.deprecate(fn, msg).apply(this, arguments);
2171 };
2172 }
2173
2174 if (process.noDeprecation === true) {
2175 return fn;
2176 }
2177
2178 var warned = false;
2179 function deprecated() {
2180 if (!warned) {
2181 if (process.throwDeprecation) {
2182 throw new Error(msg);
2183 } else if (process.traceDeprecation) {
2184 console.trace(msg);
2185 } else {
2186 console.error(msg);
2187 }
2188 warned = true;
2189 }
2190 return fn.apply(this, arguments);
2191 }
2192
2193 return deprecated;
2194 };
2195
2196
2197 var debugs = {};
2198 var debugEnviron;
2199 exports.debuglog = function(set) {
2200 if (isUndefined(debugEnviron))
2201 debugEnviron = process.env.NODE_DEBUG || '';
2202 set = set.toUpperCase();
2203 if (!debugs[set]) {
2204 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
2205 var pid = process.pid;
2206 debugs[set] = function() {
2207 var msg = exports.format.apply(exports, arguments);
2208 console.error('%s %d: %s', set, pid, msg);
2209 };
2210 } else {
2211 debugs[set] = function() {};
2212 }
2213 }
2214 return debugs[set];
2215 };
2216
2217
2218 /**
2219 * Echos the value of a value. Trys to print the value out
2220 * in the best way possible given the different types.
2221 *
2222 * @param {Object} obj The object to print out.
2223 * @param {Object} opts Optional options object that alters the output.
2224 */
2225 /* legacy: obj, showHidden, depth, colors*/
2226 function inspect(obj, opts) {
2227 // default options
2228 var ctx = {
2229 seen: [],
2230 stylize: stylizeNoColor
2231 };
2232 // legacy...
2233 if (arguments.length >= 3) ctx.depth = arguments[2];
2234 if (arguments.length >= 4) ctx.colors = arguments[3];
2235 if (isBoolean(opts)) {
2236 // legacy...
2237 ctx.showHidden = opts;
2238 } else if (opts) {
2239 // got an "options" object
2240 exports._extend(ctx, opts);
2241 }
2242 // set default options
2243 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
2244 if (isUndefined(ctx.depth)) ctx.depth = 2;
2245 if (isUndefined(ctx.colors)) ctx.colors = false;
2246 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
2247 if (ctx.colors) ctx.stylize = stylizeWithColor;
2248 return formatValue(ctx, obj, ctx.depth);
2249 }
2250 exports.inspect = inspect;
2251
2252
2253 // http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
2254 inspect.colors = {
2255 'bold' : [1, 22],
2256 'italic' : [3, 23],
2257 'underline' : [4, 24],
2258 'inverse' : [7, 27],
2259 'white' : [37, 39],
2260 'grey' : [90, 39],
2261 'black' : [30, 39],
2262 'blue' : [34, 39],
2263 'cyan' : [36, 39],
2264 'green' : [32, 39],
2265 'magenta' : [35, 39],
2266 'red' : [31, 39],
2267 'yellow' : [33, 39]
2268 };
2269
2270 // Don't use 'blue' not visible on cmd.exe
2271 inspect.styles = {
2272 'special': 'cyan',
2273 'number': 'yellow',
2274 'boolean': 'yellow',
2275 'undefined': 'grey',
2276 'null': 'bold',
2277 'string': 'green',
2278 'date': 'magenta',
2279 // "name": intentionally not styling
2280 'regexp': 'red'
2281 };
2282
2283
2284 function stylizeWithColor(str, styleType) {
2285 var style = inspect.styles[styleType];
2286
2287 if (style) {
2288 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
2289 '\u001b[' + inspect.colors[style][1] + 'm';
2290 } else {
2291 return str;
2292 }
2293 }
2294
2295
2296 function stylizeNoColor(str, styleType) {
2297 return str;
2298 }
2299
2300
2301 function arrayToHash(array) {
2302 var hash = {};
2303
2304 array.forEach(function(val, idx) {
2305 hash[val] = true;
2306 });
2307
2308 return hash;
2309 }
2310
2311
2312 function formatValue(ctx, value, recurseTimes) {
2313 // Provide a hook for user-specified inspect functions.
2314 // Check that value is an object with an inspect function on it
2315 if (ctx.customInspect &&
2316 value &&
2317 isFunction(value.inspect) &&
2318 // Filter out the util module, it's inspect function is special
2319 value.inspect !== exports.inspect &&
2320 // Also filter out any prototype objects using the circular check.
2321 !(value.constructor && value.constructor.prototype === value)) {
2322 var ret = value.inspect(recurseTimes, ctx);
2323 if (!isString(ret)) {
2324 ret = formatValue(ctx, ret, recurseTimes);
2325 }
2326 return ret;
2327 }
2328
2329 // Primitive types cannot have properties
2330 var primitive = formatPrimitive(ctx, value);
2331 if (primitive) {
2332 return primitive;
2333 }
2334
2335 // Look up the keys of the object.
2336 var keys = Object.keys(value);
2337 var visibleKeys = arrayToHash(keys);
2338
2339 if (ctx.showHidden) {
2340 keys = Object.getOwnPropertyNames(value);
2341 }
2342
2343 // IE doesn't make error fields non-enumerable
2344 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
2345 if (isError(value)
2346 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
2347 return formatError(value);
2348 }
2349
2350 // Some type of object without properties can be shortcutted.
2351 if (keys.length === 0) {
2352 if (isFunction(value)) {
2353 var name = value.name ? ': ' + value.name : '';
2354 return ctx.stylize('[Function' + name + ']', 'special');
2355 }
2356 if (isRegExp(value)) {
2357 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2358 }
2359 if (isDate(value)) {
2360 return ctx.stylize(Date.prototype.toString.call(value), 'date');
2361 }
2362 if (isError(value)) {
2363 return formatError(value);
2364 }
2365 }
2366
2367 var base = '', array = false, braces = ['{', '}'];
2368
2369 // Make Array say that they are Array
2370 if (isArray(value)) {
2371 array = true;
2372 braces = ['[', ']'];
2373 }
2374
2375 // Make functions say that they are functions
2376 if (isFunction(value)) {
2377 var n = value.name ? ': ' + value.name : '';
2378 base = ' [Function' + n + ']';
2379 }
2380
2381 // Make RegExps say that they are RegExps
2382 if (isRegExp(value)) {
2383 base = ' ' + RegExp.prototype.toString.call(value);
2384 }
2385
2386 // Make dates with properties first say the date
2387 if (isDate(value)) {
2388 base = ' ' + Date.prototype.toUTCString.call(value);
2389 }
2390
2391 // Make error with message first say the error
2392 if (isError(value)) {
2393 base = ' ' + formatError(value);
2394 }
2395
2396 if (keys.length === 0 && (!array || value.length == 0)) {
2397 return braces[0] + base + braces[1];
2398 }
2399
2400 if (recurseTimes < 0) {
2401 if (isRegExp(value)) {
2402 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2403 } else {
2404 return ctx.stylize('[Object]', 'special');
2405 }
2406 }
2407
2408 ctx.seen.push(value);
2409
2410 var output;
2411 if (array) {
2412 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
2413 } else {
2414 output = keys.map(function(key) {
2415 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
2416 });
2417 }
2418
2419 ctx.seen.pop();
2420
2421 return reduceToSingleString(output, base, braces);
2422 }
2423
2424
2425 function formatPrimitive(ctx, value) {
2426 if (isUndefined(value))
2427 return ctx.stylize('undefined', 'undefined');
2428 if (isString(value)) {
2429 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
2430 .replace(/'/g, "\\'")
2431 .replace(/\\"/g, '"') + '\'';
2432 return ctx.stylize(simple, 'string');
2433 }
2434 if (isNumber(value))
2435 return ctx.stylize('' + value, 'number');
2436 if (isBoolean(value))
2437 return ctx.stylize('' + value, 'boolean');
2438 // For some reason typeof null is "object", so special case here.
2439 if (isNull(value))
2440 return ctx.stylize('null', 'null');
2441 }
2442
2443
2444 function formatError(value) {
2445 return '[' + Error.prototype.toString.call(value) + ']';
2446 }
2447
2448
2449 function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
2450 var output = [];
2451 for (var i = 0, l = value.length; i < l; ++i) {
2452 if (hasOwnProperty(value, String(i))) {
2453 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2454 String(i), true));
2455 } else {
2456 output.push('');
2457 }
2458 }
2459 keys.forEach(function(key) {
2460 if (!key.match(/^\d+$/)) {
2461 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2462 key, true));
2463 }
2464 });
2465 return output;
2466 }
2467
2468
2469 function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
2470 var name, str, desc;
2471 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
2472 if (desc.get) {
2473 if (desc.set) {
2474 str = ctx.stylize('[Getter/Setter]', 'special');
2475 } else {
2476 str = ctx.stylize('[Getter]', 'special');
2477 }
2478 } else {
2479 if (desc.set) {
2480 str = ctx.stylize('[Setter]', 'special');
2481 }
2482 }
2483 if (!hasOwnProperty(visibleKeys, key)) {
2484 name = '[' + key + ']';
2485 }
2486 if (!str) {
2487 if (ctx.seen.indexOf(desc.value) < 0) {
2488 if (isNull(recurseTimes)) {
2489 str = formatValue(ctx, desc.value, null);
2490 } else {
2491 str = formatValue(ctx, desc.value, recurseTimes - 1);
2492 }
2493 if (str.indexOf('\n') > -1) {
2494 if (array) {
2495 str = str.split('\n').map(function(line) {
2496 return ' ' + line;
2497 }).join('\n').substr(2);
2498 } else {
2499 str = '\n' + str.split('\n').map(function(line) {
2500 return ' ' + line;
2501 }).join('\n');
2502 }
2503 }
2504 } else {
2505 str = ctx.stylize('[Circular]', 'special');
2506 }
2507 }
2508 if (isUndefined(name)) {
2509 if (array && key.match(/^\d+$/)) {
2510 return str;
2511 }
2512 name = JSON.stringify('' + key);
2513 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
2514 name = name.substr(1, name.length - 2);
2515 name = ctx.stylize(name, 'name');
2516 } else {
2517 name = name.replace(/'/g, "\\'")
2518 .replace(/\\"/g, '"')
2519 .replace(/(^"|"$)/g, "'");
2520 name = ctx.stylize(name, 'string');
2521 }
2522 }
2523
2524 return name + ': ' + str;
2525 }
2526
2527
2528 function reduceToSingleString(output, base, braces) {
2529 var numLinesEst = 0;
2530 var length = output.reduce(function(prev, cur) {
2531 numLinesEst++;
2532 if (cur.indexOf('\n') >= 0) numLinesEst++;
2533 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
2534 }, 0);
2535
2536 if (length > 60) {
2537 return braces[0] +
2538 (base === '' ? '' : base + '\n ') +
2539 ' ' +
2540 output.join(',\n ') +
2541 ' ' +
2542 braces[1];
2543 }
2544
2545 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
2546 }
2547
2548
2549 // NOTE: These type checking functions intentionally don't use `instanceof`
2550 // because it is fragile and can be easily faked with `Object.create()`.
2551 function isArray(ar) {
2552 return Array.isArray(ar);
2553 }
2554 exports.isArray = isArray;
2555
2556 function isBoolean(arg) {
2557 return typeof arg === 'boolean';
2558 }
2559 exports.isBoolean = isBoolean;
2560
2561 function isNull(arg) {
2562 return arg === null;
2563 }
2564 exports.isNull = isNull;
2565
2566 function isNullOrUndefined(arg) {
2567 return arg == null;
2568 }
2569 exports.isNullOrUndefined = isNullOrUndefined;
2570
2571 function isNumber(arg) {
2572 return typeof arg === 'number';
2573 }
2574 exports.isNumber = isNumber;
2575
2576 function isString(arg) {
2577 return typeof arg === 'string';
2578 }
2579 exports.isString = isString;
2580
2581 function isSymbol(arg) {
2582 return typeof arg === 'symbol';
2583 }
2584 exports.isSymbol = isSymbol;
2585
2586 function isUndefined(arg) {
2587 return arg === void 0;
2588 }
2589 exports.isUndefined = isUndefined;
2590
2591 function isRegExp(re) {
2592 return isObject(re) && objectToString(re) === '[object RegExp]';
2593 }
2594 exports.isRegExp = isRegExp;
2595
2596 function isObject(arg) {
2597 return typeof arg === 'object' && arg !== null;
2598 }
2599 exports.isObject = isObject;
2600
2601 function isDate(d) {
2602 return isObject(d) && objectToString(d) === '[object Date]';
2603 }
2604 exports.isDate = isDate;
2605
2606 function isError(e) {
2607 return isObject(e) &&
2608 (objectToString(e) === '[object Error]' || e instanceof Error);
2609 }
2610 exports.isError = isError;
2611
2612 function isFunction(arg) {
2613 return typeof arg === 'function';
2614 }
2615 exports.isFunction = isFunction;
2616
2617 function isPrimitive(arg) {
2618 return arg === null ||
2619 typeof arg === 'boolean' ||
2620 typeof arg === 'number' ||
2621 typeof arg === 'string' ||
2622 typeof arg === 'symbol' || // ES6 symbol
2623 typeof arg === 'undefined';
2624 }
2625 exports.isPrimitive = isPrimitive;
2626
2627 exports.isBuffer = _dereq_('./support/isBuffer');
2628
2629 function objectToString(o) {
2630 return Object.prototype.toString.call(o);
2631 }
2632
2633
2634 function pad(n) {
2635 return n < 10 ? '0' + n.toString(10) : n.toString(10);
2636 }
2637
2638
2639 var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
2640 'Oct', 'Nov', 'Dec'];
2641
2642 // 26 Feb 16:19:34
2643 function timestamp() {
2644 var d = new Date();
2645 var time = [pad(d.getHours()),
2646 pad(d.getMinutes()),
2647 pad(d.getSeconds())].join(':');
2648 return [d.getDate(), months[d.getMonth()], time].join(' ');
2649 }
2650
2651
2652 // log is just a thin wrapper to console.log that prepends a timestamp
2653 exports.log = function() {
2654 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
2655 };
2656
2657
2658 /**
2659 * Inherit the prototype methods from one constructor into another.
2660 *
2661 * The Function.prototype.inherits from lang.js rewritten as a standalone
2662 * function (not on Function.prototype). NOTE: If this file is to be loaded
2663 * during bootstrapping this function needs to be rewritten using some native
2664 * functions as prototype setup using normal JavaScript does not work as
2665 * expected during bootstrapping (see mirror.js in r114903).
2666 *
2667 * @param {function} ctor Constructor function which needs to inherit the
2668 * prototype.
2669 * @param {function} superCtor Constructor function to inherit prototype from.
2670 */
2671 exports.inherits = _dereq_('inherits');
2672
2673 exports._extend = function(origin, add) {
2674 // Don't do anything if add isn't an object
2675 if (!add || !isObject(add)) return origin;
2676
2677 var keys = Object.keys(add);
2678 var i = keys.length;
2679 while (i--) {
2680 origin[keys[i]] = add[keys[i]];
2681 }
2682 return origin;
2683 };
2684
2685 function hasOwnProperty(obj, prop) {
2686 return Object.prototype.hasOwnProperty.call(obj, prop);
2687 }
2688
2689 }).call(this,_dereq_("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2690 },{"./support/isBuffer":5,"FWaASH":12,"inherits":11}],7:[function(_dereq_,module,exports){
2691
2692 },{}],8:[function(_dereq_,module,exports){
2693 /*!
2694 * The buffer module from node.js, for the browser.
2695 *
2696 * at author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2697 * at license MIT
2698 */
2699
2700 var base64 = _dereq_('base64-js')
2701 var ieee754 = _dereq_('ieee754')
2702
2703 exports.Buffer = Buffer
2704 exports.SlowBuffer = Buffer
2705 exports.INSPECT_MAX_BYTES = 50
2706 Buffer.poolSize = 8192
2707
2708 /**
2709 * If `Buffer._useTypedArrays`:
2710 * === true Use Uint8Array implementation (fastest)
2711 * === false Use Object implementation (compatible down to IE6)
2712 */
2713 Buffer._useTypedArrays = (function () {
2714 // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
2715 // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
2716 // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
2717 // because we need to be able to add all the node Buffer API methods. This is an issue
2718 // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
2719 try {
2720 var buf = new ArrayBuffer(0)
2721 var arr = new Uint8Array(buf)
2722 arr.foo = function () { return 42 }
2723 return 42 === arr.foo() &&
2724 typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray`
2725 } catch (e) {
2726 return false
2727 }
2728 })()
2729
2730 /**
2731 * Class: Buffer
2732 * =============
2733 *
2734 * The Buffer constructor returns instances of `Uint8Array` that are augmented
2735 * with function properties for all the node `Buffer` API functions. We use
2736 * `Uint8Array` so that square bracket notation works as expected -- it returns
2737 * a single octet.
2738 *
2739 * By augmenting the instances, we can avoid modifying the `Uint8Array`
2740 * prototype.
2741 */
2742 function Buffer (subject, encoding, noZero) {
2743 if (!(this instanceof Buffer))
2744 return new Buffer(subject, encoding, noZero)
2745
2746 var type = typeof subject
2747
2748 if (encoding === 'base64' && type === 'string') {
2749 subject = base64clean(subject)
2750 }
2751
2752 // Find the length
2753 var length
2754 if (type === 'number')
2755 length = coerce(subject)
2756 else if (type === 'string')
2757 length = Buffer.byteLength(subject, encoding)
2758 else if (type === 'object')
2759 length = coerce(subject.length) // assume that object is array-like
2760 else
2761 throw new Error('First argument needs to be a number, array or string.')
2762
2763 var buf
2764 if (Buffer._useTypedArrays) {
2765 // Preferred: Return an augmented `Uint8Array` instance for best performance
2766 buf = Buffer._augment(new Uint8Array(length))
2767 } else {
2768 // Fallback: Return THIS instance of Buffer (created by `new`)
2769 buf = this
2770 buf.length = length
2771 buf._isBuffer = true
2772 }
2773
2774 var i
2775 if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') {
2776 // Speed optimization -- use set if we're copying from a typed array
2777 buf._set(subject)
2778 } else if (isArrayish(subject)) {
2779 // Treat array-ish objects as a byte array
2780 if (Buffer.isBuffer(subject)) {
2781 for (i = 0; i < length; i++)
2782 buf[i] = subject.readUInt8(i)
2783 } else {
2784 for (i = 0; i < length; i++)
2785 buf[i] = ((subject[i] % 256) + 256) % 256
2786 }
2787 } else if (type === 'string') {
2788 buf.write(subject, 0, encoding)
2789 } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) {
2790 for (i = 0; i < length; i++) {
2791 buf[i] = 0
2792 }
2793 }
2794
2795 return buf
2796 }
2797
2798 // STATIC METHODS
2799 // ==============
2800
2801 Buffer.isEncoding = function (encoding) {
2802 switch (String(encoding).toLowerCase()) {
2803 case 'hex':
2804 case 'utf8':
2805 case 'utf-8':
2806 case 'ascii':
2807 case 'binary':
2808 case 'base64':
2809 case 'raw':
2810 case 'ucs2':
2811 case 'ucs-2':
2812 case 'utf16le':
2813 case 'utf-16le':
2814 return true
2815 default:
2816 return false
2817 }
2818 }
2819
2820 Buffer.isBuffer = function (b) {
2821 return !!(b !== null && b !== undefined && b._isBuffer)
2822 }
2823
2824 Buffer.byteLength = function (str, encoding) {
2825 var ret
2826 str = str.toString()
2827 switch (encoding || 'utf8') {
2828 case 'hex':
2829 ret = str.length / 2
2830 break
2831 case 'utf8':
2832 case 'utf-8':
2833 ret = utf8ToBytes(str).length
2834 break
2835 case 'ascii':
2836 case 'binary':
2837 case 'raw':
2838 ret = str.length
2839 break
2840 case 'base64':
2841 ret = base64ToBytes(str).length
2842 break
2843 case 'ucs2':
2844 case 'ucs-2':
2845 case 'utf16le':
2846 case 'utf-16le':
2847 ret = str.length * 2
2848 break
2849 default:
2850 throw new Error('Unknown encoding')
2851 }
2852 return ret
2853 }
2854
2855 Buffer.concat = function (list, totalLength) {
2856 assert(isArray(list), 'Usage: Buffer.concat(list[, length])')
2857
2858 if (list.length === 0) {
2859 return new Buffer(0)
2860 } else if (list.length === 1) {
2861 return list[0]
2862 }
2863
2864 var i
2865 if (totalLength === undefined) {
2866 totalLength = 0
2867 for (i = 0; i < list.length; i++) {
2868 totalLength += list[i].length
2869 }
2870 }
2871
2872 var buf = new Buffer(totalLength)
2873 var pos = 0
2874 for (i = 0; i < list.length; i++) {
2875 var item = list[i]
2876 item.copy(buf, pos)
2877 pos += item.length
2878 }
2879 return buf
2880 }
2881
2882 Buffer.compare = function (a, b) {
2883 assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers')
2884 var x = a.length
2885 var y = b.length
2886 for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {}
2887 if (i !== len) {
2888 x = a[i]
2889 y = b[i]
2890 }
2891 if (x < y) {
2892 return -1
2893 }
2894 if (y < x) {
2895 return 1
2896 }
2897 return 0
2898 }
2899
2900 // BUFFER INSTANCE METHODS
2901 // =======================
2902
2903 function hexWrite (buf, string, offset, length) {
2904 offset = Number(offset) || 0
2905 var remaining = buf.length - offset
2906 if (!length) {
2907 length = remaining
2908 } else {
2909 length = Number(length)
2910 if (length > remaining) {
2911 length = remaining
2912 }
2913 }
2914
2915 // must be an even number of digits
2916 var strLen = string.length
2917 assert(strLen % 2 === 0, 'Invalid hex string')
2918
2919 if (length > strLen / 2) {
2920 length = strLen / 2
2921 }
2922 for (var i = 0; i < length; i++) {
2923 var byte = parseInt(string.substr(i * 2, 2), 16)
2924 assert(!isNaN(byte), 'Invalid hex string')
2925 buf[offset + i] = byte
2926 }
2927 return i
2928 }
2929
2930 function utf8Write (buf, string, offset, length) {
2931 var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
2932 return charsWritten
2933 }
2934
2935 function asciiWrite (buf, string, offset, length) {
2936 var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
2937 return charsWritten
2938 }
2939
2940 function binaryWrite (buf, string, offset, length) {
2941 return asciiWrite(buf, string, offset, length)
2942 }
2943
2944 function base64Write (buf, string, offset, length) {
2945 var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
2946 return charsWritten
2947 }
2948
2949 function utf16leWrite (buf, string, offset, length) {
2950 var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
2951 return charsWritten
2952 }
2953
2954 Buffer.prototype.write = function (string, offset, length, encoding) {
2955 // Support both (string, offset, length, encoding)
2956 // and the legacy (string, encoding, offset, length)
2957 if (isFinite(offset)) {
2958 if (!isFinite(length)) {
2959 encoding = length
2960 length = undefined
2961 }
2962 } else { // legacy
2963 var swap = encoding
2964 encoding = offset
2965 offset = length
2966 length = swap
2967 }
2968
2969 offset = Number(offset) || 0
2970 var remaining = this.length - offset
2971 if (!length) {
2972 length = remaining
2973 } else {
2974 length = Number(length)
2975 if (length > remaining) {
2976 length = remaining
2977 }
2978 }
2979 encoding = String(encoding || 'utf8').toLowerCase()
2980
2981 var ret
2982 switch (encoding) {
2983 case 'hex':
2984 ret = hexWrite(this, string, offset, length)
2985 break
2986 case 'utf8':
2987 case 'utf-8':
2988 ret = utf8Write(this, string, offset, length)
2989 break
2990 case 'ascii':
2991 ret = asciiWrite(this, string, offset, length)
2992 break
2993 case 'binary':
2994 ret = binaryWrite(this, string, offset, length)
2995 break
2996 case 'base64':
2997 ret = base64Write(this, string, offset, length)
2998 break
2999 case 'ucs2':
3000 case 'ucs-2':
3001 case 'utf16le':
3002 case 'utf-16le':
3003 ret = utf16leWrite(this, string, offset, length)
3004 break
3005 default:
3006 throw new Error('Unknown encoding')
3007 }
3008 return ret
3009 }
3010
3011 Buffer.prototype.toString = function (encoding, start, end) {
3012 var self = this
3013
3014 encoding = String(encoding || 'utf8').toLowerCase()
3015 start = Number(start) || 0
3016 end = (end === undefined) ? self.length : Number(end)
3017
3018 // Fastpath empty strings
3019 if (end === start)
3020 return ''
3021
3022 var ret
3023 switch (encoding) {
3024 case 'hex':
3025 ret = hexSlice(self, start, end)
3026 break
3027 case 'utf8':
3028 case 'utf-8':
3029 ret = utf8Slice(self, start, end)
3030 break
3031 case 'ascii':
3032 ret = asciiSlice(self, start, end)
3033 break
3034 case 'binary':
3035 ret = binarySlice(self, start, end)
3036 break
3037 case 'base64':
3038 ret = base64Slice(self, start, end)
3039 break
3040 case 'ucs2':
3041 case 'ucs-2':
3042 case 'utf16le':
3043 case 'utf-16le':
3044 ret = utf16leSlice(self, start, end)
3045 break
3046 default:
3047 throw new Error('Unknown encoding')
3048 }
3049 return ret
3050 }
3051
3052 Buffer.prototype.toJSON = function () {
3053 return {
3054 type: 'Buffer',
3055 data: Array.prototype.slice.call(this._arr || this, 0)
3056 }
3057 }
3058
3059 Buffer.prototype.equals = function (b) {
3060 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
3061 return Buffer.compare(this, b) === 0
3062 }
3063
3064 Buffer.prototype.compare = function (b) {
3065 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
3066 return Buffer.compare(this, b)
3067 }
3068
3069 // copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
3070 Buffer.prototype.copy = function (target, target_start, start, end) {
3071 var source = this
3072
3073 if (!start) start = 0
3074 if (!end && end !== 0) end = this.length
3075 if (!target_start) target_start = 0
3076
3077 // Copy 0 bytes; we're done
3078 if (end === start) return
3079 if (target.length === 0 || source.length === 0) return
3080
3081 // Fatal error conditions
3082 assert(end >= start, 'sourceEnd < sourceStart')
3083 assert(target_start >= 0 && target_start < target.length,
3084 'targetStart out of bounds')
3085 assert(start >= 0 && start < source.length, 'sourceStart out of bounds')
3086 assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds')
3087
3088 // Are we oob?
3089 if (end > this.length)
3090 end = this.length
3091 if (target.length - target_start < end - start)
3092 end = target.length - target_start + start
3093
3094 var len = end - start
3095
3096 if (len < 100 || !Buffer._useTypedArrays) {
3097 for (var i = 0; i < len; i++) {
3098 target[i + target_start] = this[i + start]
3099 }
3100 } else {
3101 target._set(this.subarray(start, start + len), target_start)
3102 }
3103 }
3104
3105 function base64Slice (buf, start, end) {
3106 if (start === 0 && end === buf.length) {
3107 return base64.fromByteArray(buf)
3108 } else {
3109 return base64.fromByteArray(buf.slice(start, end))
3110 }
3111 }
3112
3113 function utf8Slice (buf, start, end) {
3114 var res = ''
3115 var tmp = ''
3116 end = Math.min(buf.length, end)
3117
3118 for (var i = start; i < end; i++) {
3119 if (buf[i] <= 0x7F) {
3120 res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
3121 tmp = ''
3122 } else {
3123 tmp += '%' + buf[i].toString(16)
3124 }
3125 }
3126
3127 return res + decodeUtf8Char(tmp)
3128 }
3129
3130 function asciiSlice (buf, start, end) {
3131 var ret = ''
3132 end = Math.min(buf.length, end)
3133
3134 for (var i = start; i < end; i++) {
3135 ret += String.fromCharCode(buf[i])
3136 }
3137 return ret
3138 }
3139
3140 function binarySlice (buf, start, end) {
3141 return asciiSlice(buf, start, end)
3142 }
3143
3144 function hexSlice (buf, start, end) {
3145 var len = buf.length
3146
3147 if (!start || start < 0) start = 0
3148 if (!end || end < 0 || end > len) end = len
3149
3150 var out = ''
3151 for (var i = start; i < end; i++) {
3152 out += toHex(buf[i])
3153 }
3154 return out
3155 }
3156
3157 function utf16leSlice (buf, start, end) {
3158 var bytes = buf.slice(start, end)
3159 var res = ''
3160 for (var i = 0; i < bytes.length; i += 2) {
3161 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
3162 }
3163 return res
3164 }
3165
3166 Buffer.prototype.slice = function (start, end) {
3167 var len = this.length
3168 start = clamp(start, len, 0)
3169 end = clamp(end, len, len)
3170
3171 if (Buffer._useTypedArrays) {
3172 return Buffer._augment(this.subarray(start, end))
3173 } else {
3174 var sliceLen = end - start
3175 var newBuf = new Buffer(sliceLen, undefined, true)
3176 for (var i = 0; i < sliceLen; i++) {
3177 newBuf[i] = this[i + start]
3178 }
3179 return newBuf
3180 }
3181 }
3182
3183 // `get` will be removed in Node 0.13+
3184 Buffer.prototype.get = function (offset) {
3185 console.log('.get() is deprecated. Access using array indexes instead.')
3186 return this.readUInt8(offset)
3187 }
3188
3189 // `set` will be removed in Node 0.13+
3190 Buffer.prototype.set = function (v, offset) {
3191 console.log('.set() is deprecated. Access using array indexes instead.')
3192 return this.writeUInt8(v, offset)
3193 }
3194
3195 Buffer.prototype.readUInt8 = function (offset, noAssert) {
3196 if (!noAssert) {
3197 assert(offset !== undefined && offset !== null, 'missing offset')
3198 assert(offset < this.length, 'Trying to read beyond buffer length')
3199 }
3200
3201 if (offset >= this.length)
3202 return
3203
3204 return this[offset]
3205 }
3206
3207 function readUInt16 (buf, offset, littleEndian, noAssert) {
3208 if (!noAssert) {
3209 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3210 assert(offset !== undefined && offset !== null, 'missing offset')
3211 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3212 }
3213
3214 var len = buf.length
3215 if (offset >= len)
3216 return
3217
3218 var val
3219 if (littleEndian) {
3220 val = buf[offset]
3221 if (offset + 1 < len)
3222 val |= buf[offset + 1] << 8
3223 } else {
3224 val = buf[offset] << 8
3225 if (offset + 1 < len)
3226 val |= buf[offset + 1]
3227 }
3228 return val
3229 }
3230
3231 Buffer.prototype.readUInt16LE = function (offset, noAssert) {
3232 return readUInt16(this, offset, true, noAssert)
3233 }
3234
3235 Buffer.prototype.readUInt16BE = function (offset, noAssert) {
3236 return readUInt16(this, offset, false, noAssert)
3237 }
3238
3239 function readUInt32 (buf, offset, littleEndian, noAssert) {
3240 if (!noAssert) {
3241 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3242 assert(offset !== undefined && offset !== null, 'missing offset')
3243 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3244 }
3245
3246 var len = buf.length
3247 if (offset >= len)
3248 return
3249
3250 var val
3251 if (littleEndian) {
3252 if (offset + 2 < len)
3253 val = buf[offset + 2] << 16
3254 if (offset + 1 < len)
3255 val |= buf[offset + 1] << 8
3256 val |= buf[offset]
3257 if (offset + 3 < len)
3258 val = val + (buf[offset + 3] << 24 >>> 0)
3259 } else {
3260 if (offset + 1 < len)
3261 val = buf[offset + 1] << 16
3262 if (offset + 2 < len)
3263 val |= buf[offset + 2] << 8
3264 if (offset + 3 < len)
3265 val |= buf[offset + 3]
3266 val = val + (buf[offset] << 24 >>> 0)
3267 }
3268 return val
3269 }
3270
3271 Buffer.prototype.readUInt32LE = function (offset, noAssert) {
3272 return readUInt32(this, offset, true, noAssert)
3273 }
3274
3275 Buffer.prototype.readUInt32BE = function (offset, noAssert) {
3276 return readUInt32(this, offset, false, noAssert)
3277 }
3278
3279 Buffer.prototype.readInt8 = function (offset, noAssert) {
3280 if (!noAssert) {
3281 assert(offset !== undefined && offset !== null,
3282 'missing offset')
3283 assert(offset < this.length, 'Trying to read beyond buffer length')
3284 }
3285
3286 if (offset >= this.length)
3287 return
3288
3289 var neg = this[offset] & 0x80
3290 if (neg)
3291 return (0xff - this[offset] + 1) * -1
3292 else
3293 return this[offset]
3294 }
3295
3296 function readInt16 (buf, offset, littleEndian, noAssert) {
3297 if (!noAssert) {
3298 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3299 assert(offset !== undefined && offset !== null, 'missing offset')
3300 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3301 }
3302
3303 var len = buf.length
3304 if (offset >= len)
3305 return
3306
3307 var val = readUInt16(buf, offset, littleEndian, true)
3308 var neg = val & 0x8000
3309 if (neg)
3310 return (0xffff - val + 1) * -1
3311 else
3312 return val
3313 }
3314
3315 Buffer.prototype.readInt16LE = function (offset, noAssert) {
3316 return readInt16(this, offset, true, noAssert)
3317 }
3318
3319 Buffer.prototype.readInt16BE = function (offset, noAssert) {
3320 return readInt16(this, offset, false, noAssert)
3321 }
3322
3323 function readInt32 (buf, offset, littleEndian, noAssert) {
3324 if (!noAssert) {
3325 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3326 assert(offset !== undefined && offset !== null, 'missing offset')
3327 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3328 }
3329
3330 var len = buf.length
3331 if (offset >= len)
3332 return
3333
3334 var val = readUInt32(buf, offset, littleEndian, true)
3335 var neg = val & 0x80000000
3336 if (neg)
3337 return (0xffffffff - val + 1) * -1
3338 else
3339 return val
3340 }
3341
3342 Buffer.prototype.readInt32LE = function (offset, noAssert) {
3343 return readInt32(this, offset, true, noAssert)
3344 }
3345
3346 Buffer.prototype.readInt32BE = function (offset, noAssert) {
3347 return readInt32(this, offset, false, noAssert)
3348 }
3349
3350 function readFloat (buf, offset, littleEndian, noAssert) {
3351 if (!noAssert) {
3352 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3353 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3354 }
3355
3356 return ieee754.read(buf, offset, littleEndian, 23, 4)
3357 }
3358
3359 Buffer.prototype.readFloatLE = function (offset, noAssert) {
3360 return readFloat(this, offset, true, noAssert)
3361 }
3362
3363 Buffer.prototype.readFloatBE = function (offset, noAssert) {
3364 return readFloat(this, offset, false, noAssert)
3365 }
3366
3367 function readDouble (buf, offset, littleEndian, noAssert) {
3368 if (!noAssert) {
3369 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3370 assert(offset + 7 < buf.length, 'Trying to read beyond buffer length')
3371 }
3372
3373 return ieee754.read(buf, offset, littleEndian, 52, 8)
3374 }
3375
3376 Buffer.prototype.readDoubleLE = function (offset, noAssert) {
3377 return readDouble(this, offset, true, noAssert)
3378 }
3379
3380 Buffer.prototype.readDoubleBE = function (offset, noAssert) {
3381 return readDouble(this, offset, false, noAssert)
3382 }
3383
3384 Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
3385 if (!noAssert) {
3386 assert(value !== undefined && value !== null, 'missing value')
3387 assert(offset !== undefined && offset !== null, 'missing offset')
3388 assert(offset < this.length, 'trying to write beyond buffer length')
3389 verifuint(value, 0xff)
3390 }
3391
3392 if (offset >= this.length) return
3393
3394 this[offset] = value
3395 return offset + 1
3396 }
3397
3398 function writeUInt16 (buf, value, offset, littleEndian, noAssert) {
3399 if (!noAssert) {
3400 assert(value !== undefined && value !== null, 'missing value')
3401 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3402 assert(offset !== undefined && offset !== null, 'missing offset')
3403 assert(offset + 1 < buf.length, 'trying to write beyond buffer length')
3404 verifuint(value, 0xffff)
3405 }
3406
3407 var len = buf.length
3408 if (offset >= len)
3409 return
3410
3411 for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) {
3412 buf[offset + i] =
3413 (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
3414 (littleEndian ? i : 1 - i) * 8
3415 }
3416 return offset + 2
3417 }
3418
3419 Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) {
3420 return writeUInt16(this, value, offset, true, noAssert)
3421 }
3422
3423 Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) {
3424 return writeUInt16(this, value, offset, false, noAssert)
3425 }
3426
3427 function writeUInt32 (buf, value, offset, littleEndian, noAssert) {
3428 if (!noAssert) {
3429 assert(value !== undefined && value !== null, 'missing value')
3430 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3431 assert(offset !== undefined && offset !== null, 'missing offset')
3432 assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
3433 verifuint(value, 0xffffffff)
3434 }
3435
3436 var len = buf.length
3437 if (offset >= len)
3438 return
3439
3440 for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) {
3441 buf[offset + i] =
3442 (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
3443 }
3444 return offset + 4
3445 }
3446
3447 Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
3448 return writeUInt32(this, value, offset, true, noAssert)
3449 }
3450
3451 Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
3452 return writeUInt32(this, value, offset, false, noAssert)
3453 }
3454
3455 Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
3456 if (!noAssert) {
3457 assert(value !== undefined && value !== null, 'missing value')
3458 assert(offset !== undefined && offset !== null, 'missing offset')
3459 assert(offset < this.length, 'Trying to write beyond buffer length')
3460 verifsint(value, 0x7f, -0x80)
3461 }
3462
3463 if (offset >= this.length)
3464 return
3465
3466 if (value >= 0)
3467 this.writeUInt8(value, offset, noAssert)
3468 else
3469 this.writeUInt8(0xff + value + 1, offset, noAssert)
3470 return offset + 1
3471 }
3472
3473 function writeInt16 (buf, value, offset, littleEndian, noAssert) {
3474 if (!noAssert) {
3475 assert(value !== undefined && value !== null, 'missing value')
3476 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3477 assert(offset !== undefined && offset !== null, 'missing offset')
3478 assert(offset + 1 < buf.length, 'Trying to write beyond buffer length')
3479 verifsint(value, 0x7fff, -0x8000)
3480 }
3481
3482 var len = buf.length
3483 if (offset >= len)
3484 return
3485
3486 if (value >= 0)
3487 writeUInt16(buf, value, offset, littleEndian, noAssert)
3488 else
3489 writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert)
3490 return offset + 2
3491 }
3492
3493 Buffer.prototype.writeInt16LE = function (value, offset, noAssert) {
3494 return writeInt16(this, value, offset, true, noAssert)
3495 }
3496
3497 Buffer.prototype.writeInt16BE = function (value, offset, noAssert) {
3498 return writeInt16(this, value, offset, false, noAssert)
3499 }
3500
3501 function writeInt32 (buf, value, offset, littleEndian, noAssert) {
3502 if (!noAssert) {
3503 assert(value !== undefined && value !== null, 'missing value')
3504 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3505 assert(offset !== undefined && offset !== null, 'missing offset')
3506 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3507 verifsint(value, 0x7fffffff, -0x80000000)
3508 }
3509
3510 var len = buf.length
3511 if (offset >= len)
3512 return
3513
3514 if (value >= 0)
3515 writeUInt32(buf, value, offset, littleEndian, noAssert)
3516 else
3517 writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert)
3518 return offset + 4
3519 }
3520
3521 Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
3522 return writeInt32(this, value, offset, true, noAssert)
3523 }
3524
3525 Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
3526 return writeInt32(this, value, offset, false, noAssert)
3527 }
3528
3529 function writeFloat (buf, value, offset, littleEndian, noAssert) {
3530 if (!noAssert) {
3531 assert(value !== undefined && value !== null, 'missing value')
3532 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3533 assert(offset !== undefined && offset !== null, 'missing offset')
3534 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3535 verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38)
3536 }
3537
3538 var len = buf.length
3539 if (offset >= len)
3540 return
3541
3542 ieee754.write(buf, value, offset, littleEndian, 23, 4)
3543 return offset + 4
3544 }
3545
3546 Buffer.prototype.writeFloatLE = function (value, offset, noAssert) {
3547 return writeFloat(this, value, offset, true, noAssert)
3548 }
3549
3550 Buffer.prototype.writeFloatBE = function (value, offset, noAssert) {
3551 return writeFloat(this, value, offset, false, noAssert)
3552 }
3553
3554 function writeDouble (buf, value, offset, littleEndian, noAssert) {
3555 if (!noAssert) {
3556 assert(value !== undefined && value !== null, 'missing value')
3557 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3558 assert(offset !== undefined && offset !== null, 'missing offset')
3559 assert(offset + 7 < buf.length,
3560 'Trying to write beyond buffer length')
3561 verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308)
3562 }
3563
3564 var len = buf.length
3565 if (offset >= len)
3566 return
3567
3568 ieee754.write(buf, value, offset, littleEndian, 52, 8)
3569 return offset + 8
3570 }
3571
3572 Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) {
3573 return writeDouble(this, value, offset, true, noAssert)
3574 }
3575
3576 Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) {
3577 return writeDouble(this, value, offset, false, noAssert)
3578 }
3579
3580 // fill(value, start=0, end=buffer.length)
3581 Buffer.prototype.fill = function (value, start, end) {
3582 if (!value) value = 0
3583 if (!start) start = 0
3584 if (!end) end = this.length
3585
3586 assert(end >= start, 'end < start')
3587
3588 // Fill 0 bytes; we're done
3589 if (end === start) return
3590 if (this.length === 0) return
3591
3592 assert(start >= 0 && start < this.length, 'start out of bounds')
3593 assert(end >= 0 && end <= this.length, 'end out of bounds')
3594
3595 var i
3596 if (typeof value === 'number') {
3597 for (i = start; i < end; i++) {
3598 this[i] = value
3599 }
3600 } else {
3601 var bytes = utf8ToBytes(value.toString())
3602 var len = bytes.length
3603 for (i = start; i < end; i++) {
3604 this[i] = bytes[i % len]
3605 }
3606 }
3607
3608 return this
3609 }
3610
3611 Buffer.prototype.inspect = function () {
3612 var out = []
3613 var len = this.length
3614 for (var i = 0; i < len; i++) {
3615 out[i] = toHex(this[i])
3616 if (i === exports.INSPECT_MAX_BYTES) {
3617 out[i + 1] = '...'
3618 break
3619 }
3620 }
3621 return '<Buffer ' + out.join(' ') + '>'
3622 }
3623
3624 /**
3625 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
3626 * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
3627 */
3628 Buffer.prototype.toArrayBuffer = function () {
3629 if (typeof Uint8Array !== 'undefined') {
3630 if (Buffer._useTypedArrays) {
3631 return (new Buffer(this)).buffer
3632 } else {
3633 var buf = new Uint8Array(this.length)
3634 for (var i = 0, len = buf.length; i < len; i += 1) {
3635 buf[i] = this[i]
3636 }
3637 return buf.buffer
3638 }
3639 } else {
3640 throw new Error('Buffer.toArrayBuffer not supported in this browser')
3641 }
3642 }
3643
3644 // HELPER FUNCTIONS
3645 // ================
3646
3647 var BP = Buffer.prototype
3648
3649 /**
3650 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
3651 */
3652 Buffer._augment = function (arr) {
3653 arr._isBuffer = true
3654
3655 // save reference to original Uint8Array get/set methods before overwriting
3656 arr._get = arr.get
3657 arr._set = arr.set
3658
3659 // deprecated, will be removed in node 0.13+
3660 arr.get = BP.get
3661 arr.set = BP.set
3662
3663 arr.write = BP.write
3664 arr.toString = BP.toString
3665 arr.toLocaleString = BP.toString
3666 arr.toJSON = BP.toJSON
3667 arr.equals = BP.equals
3668 arr.compare = BP.compare
3669 arr.copy = BP.copy
3670 arr.slice = BP.slice
3671 arr.readUInt8 = BP.readUInt8
3672 arr.readUInt16LE = BP.readUInt16LE
3673 arr.readUInt16BE = BP.readUInt16BE
3674 arr.readUInt32LE = BP.readUInt32LE
3675 arr.readUInt32BE = BP.readUInt32BE
3676 arr.readInt8 = BP.readInt8
3677 arr.readInt16LE = BP.readInt16LE
3678 arr.readInt16BE = BP.readInt16BE
3679 arr.readInt32LE = BP.readInt32LE
3680 arr.readInt32BE = BP.readInt32BE
3681 arr.readFloatLE = BP.readFloatLE
3682 arr.readFloatBE = BP.readFloatBE
3683 arr.readDoubleLE = BP.readDoubleLE
3684 arr.readDoubleBE = BP.readDoubleBE
3685 arr.writeUInt8 = BP.writeUInt8
3686 arr.writeUInt16LE = BP.writeUInt16LE
3687 arr.writeUInt16BE = BP.writeUInt16BE
3688 arr.writeUInt32LE = BP.writeUInt32LE
3689 arr.writeUInt32BE = BP.writeUInt32BE
3690 arr.writeInt8 = BP.writeInt8
3691 arr.writeInt16LE = BP.writeInt16LE
3692 arr.writeInt16BE = BP.writeInt16BE
3693 arr.writeInt32LE = BP.writeInt32LE
3694 arr.writeInt32BE = BP.writeInt32BE
3695 arr.writeFloatLE = BP.writeFloatLE
3696 arr.writeFloatBE = BP.writeFloatBE
3697 arr.writeDoubleLE = BP.writeDoubleLE
3698 arr.writeDoubleBE = BP.writeDoubleBE
3699 arr.fill = BP.fill
3700 arr.inspect = BP.inspect
3701 arr.toArrayBuffer = BP.toArrayBuffer
3702
3703 return arr
3704 }
3705
3706 var INVALID_BASE64_RE = /[^+\/0-9A-z]/g
3707
3708 function base64clean (str) {
3709 // Node strips out invalid characters like \n and \t from the string, base64-js does not
3710 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
3711 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
3712 while (str.length % 4 !== 0) {
3713 str = str + '='
3714 }
3715 return str
3716 }
3717
3718 function stringtrim (str) {
3719 if (str.trim) return str.trim()
3720 return str.replace(/^\s+|\s+$/g, '')
3721 }
3722
3723 // slice(start, end)
3724 function clamp (index, len, defaultValue) {
3725 if (typeof index !== 'number') return defaultValue
3726 index = ~~index; // Coerce to integer.
3727 if (index >= len) return len
3728 if (index >= 0) return index
3729 index += len
3730 if (index >= 0) return index
3731 return 0
3732 }
3733
3734 function coerce (length) {
3735 // Coerce length to a number (possibly NaN), round up
3736 // in case it's fractional (e.g. 123.456) then do a
3737 // double negate to coerce a NaN to 0. Easy, right?
3738 length = ~~Math.ceil(+length)
3739 return length < 0 ? 0 : length
3740 }
3741
3742 function isArray (subject) {
3743 return (Array.isArray || function (subject) {
3744 return Object.prototype.toString.call(subject) === '[object Array]'
3745 })(subject)
3746 }
3747
3748 function isArrayish (subject) {
3749 return isArray(subject) || Buffer.isBuffer(subject) ||
3750 subject && typeof subject === 'object' &&
3751 typeof subject.length === 'number'
3752 }
3753
3754 function toHex (n) {
3755 if (n < 16) return '0' + n.toString(16)
3756 return n.toString(16)
3757 }
3758
3759 function utf8ToBytes (str) {
3760 var byteArray = []
3761 for (var i = 0; i < str.length; i++) {
3762 var b = str.charCodeAt(i)
3763 if (b <= 0x7F) {
3764 byteArray.push(b)
3765 } else {
3766 var start = i
3767 if (b >= 0xD800 && b <= 0xDFFF) i++
3768 var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%')
3769 for (var j = 0; j < h.length; j++) {
3770 byteArray.push(parseInt(h[j], 16))
3771 }
3772 }
3773 }
3774 return byteArray
3775 }
3776
3777 function asciiToBytes (str) {
3778 var byteArray = []
3779 for (var i = 0; i < str.length; i++) {
3780 // Node's code seems to be doing this and not & 0x7F..
3781 byteArray.push(str.charCodeAt(i) & 0xFF)
3782 }
3783 return byteArray
3784 }
3785
3786 function utf16leToBytes (str) {
3787 var c, hi, lo
3788 var byteArray = []
3789 for (var i = 0; i < str.length; i++) {
3790 c = str.charCodeAt(i)
3791 hi = c >> 8
3792 lo = c % 256
3793 byteArray.push(lo)
3794 byteArray.push(hi)
3795 }
3796
3797 return byteArray
3798 }
3799
3800 function base64ToBytes (str) {
3801 return base64.toByteArray(str)
3802 }
3803
3804 function blitBuffer (src, dst, offset, length) {
3805 for (var i = 0; i < length; i++) {
3806 if ((i + offset >= dst.length) || (i >= src.length))
3807 break
3808 dst[i + offset] = src[i]
3809 }
3810 return i
3811 }
3812
3813 function decodeUtf8Char (str) {
3814 try {
3815 return decodeURIComponent(str)
3816 } catch (err) {
3817 return String.fromCharCode(0xFFFD) // UTF 8 invalid char
3818 }
3819 }
3820
3821 /*
3822 * We have to make sure that the value is a valid integer. This means that it
3823 * is non-negative. It has no fractional component and that it does not
3824 * exceed the maximum allowed value.
3825 */
3826 function verifuint (value, max) {
3827 assert(typeof value === 'number', 'cannot write a non-number as a number')
3828 assert(value >= 0, 'specified a negative value for writing an unsigned value')
3829 assert(value <= max, 'value is larger than maximum value for type')
3830 assert(Math.floor(value) === value, 'value has a fractional component')
3831 }
3832
3833 function verifsint (value, max, min) {
3834 assert(typeof value === 'number', 'cannot write a non-number as a number')
3835 assert(value <= max, 'value larger than maximum allowed value')
3836 assert(value >= min, 'value smaller than minimum allowed value')
3837 assert(Math.floor(value) === value, 'value has a fractional component')
3838 }
3839
3840 function verifIEEE754 (value, max, min) {
3841 assert(typeof value === 'number', 'cannot write a non-number as a number')
3842 assert(value <= max, 'value larger than maximum allowed value')
3843 assert(value >= min, 'value smaller than minimum allowed value')
3844 }
3845
3846 function assert (test, message) {
3847 if (!test) throw new Error(message || 'Failed assertion')
3848 }
3849
3850 },{"base64-js":9,"ieee754":10}],9:[function(_dereq_,module,exports){
3851 var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
3852
3853 ;(function (exports) {
3854 'use strict';
3855
3856 var Arr = (typeof Uint8Array !== 'undefined')
3857 ? Uint8Array
3858 : Array
3859
3860 var PLUS = '+'.charCodeAt(0)
3861 var SLASH = '/'.charCodeAt(0)
3862 var NUMBER = '0'.charCodeAt(0)
3863 var LOWER = 'a'.charCodeAt(0)
3864 var UPPER = 'A'.charCodeAt(0)
3865
3866 function decode (elt) {
3867 var code = elt.charCodeAt(0)
3868 if (code === PLUS)
3869 return 62 // '+'
3870 if (code === SLASH)
3871 return 63 // '/'
3872 if (code < NUMBER)
3873 return -1 //no match
3874 if (code < NUMBER + 10)
3875 return code - NUMBER + 26 + 26
3876 if (code < UPPER + 26)
3877 return code - UPPER
3878 if (code < LOWER + 26)
3879 return code - LOWER + 26
3880 }
3881
3882 function b64ToByteArray (b64) {
3883 var i, j, l, tmp, placeHolders, arr
3884
3885 if (b64.length % 4 > 0) {
3886 throw new Error('Invalid string. Length must be a multiple of 4')
3887 }
3888
3889 // the number of equal signs (place holders)
3890 // if there are two placeholders, than the two characters before it
3891 // represent one byte
3892 // if there is only one, then the three characters before it represent 2 bytes
3893 // this is just a cheap hack to not do indexOf twice
3894 var len = b64.length
3895 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
3896
3897 // base64 is 4/3 + up to two characters of the original data
3898 arr = new Arr(b64.length * 3 / 4 - placeHolders)
3899
3900 // if there are placeholders, only get up to the last complete 4 chars
3901 l = placeHolders > 0 ? b64.length - 4 : b64.length
3902
3903 var L = 0
3904
3905 function push (v) {
3906 arr[L++] = v
3907 }
3908
3909 for (i = 0, j = 0; i < l; i += 4, j += 3) {
3910 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
3911 push((tmp & 0xFF0000) >> 16)
3912 push((tmp & 0xFF00) >> 8)
3913 push(tmp & 0xFF)
3914 }
3915
3916 if (placeHolders === 2) {
3917 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
3918 push(tmp & 0xFF)
3919 } else if (placeHolders === 1) {
3920 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
3921 push((tmp >> 8) & 0xFF)
3922 push(tmp & 0xFF)
3923 }
3924
3925 return arr
3926 }
3927
3928 function uint8ToBase64 (uint8) {
3929 var i,
3930 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
3931 output = "",
3932 temp, length
3933
3934 function encode (num) {
3935 return lookup.charAt(num)
3936 }
3937
3938 function tripletToBase64 (num) {
3939 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
3940 }
3941
3942 // go through the array every three bytes, we'll deal with trailing stuff later
3943 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
3944 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
3945 output += tripletToBase64(temp)
3946 }
3947
3948 // pad the end with zeros, but make sure to not forget the extra bytes
3949 switch (extraBytes) {
3950 case 1:
3951 temp = uint8[uint8.length - 1]
3952 output += encode(temp >> 2)
3953 output += encode((temp << 4) & 0x3F)
3954 output += '=='
3955 break
3956 case 2:
3957 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
3958 output += encode(temp >> 10)
3959 output += encode((temp >> 4) & 0x3F)
3960 output += encode((temp << 2) & 0x3F)
3961 output += '='
3962 break
3963 }
3964
3965 return output
3966 }
3967
3968 exports.toByteArray = b64ToByteArray
3969 exports.fromByteArray = uint8ToBase64
3970 }(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
3971
3972 },{}],10:[function(_dereq_,module,exports){
3973 exports.read = function(buffer, offset, isLE, mLen, nBytes) {
3974 var e, m,
3975 eLen = nBytes * 8 - mLen - 1,
3976 eMax = (1 << eLen) - 1,
3977 eBias = eMax >> 1,
3978 nBits = -7,
3979 i = isLE ? (nBytes - 1) : 0,
3980 d = isLE ? -1 : 1,
3981 s = buffer[offset + i];
3982
3983 i += d;
3984
3985 e = s & ((1 << (-nBits)) - 1);
3986 s >>= (-nBits);
3987 nBits += eLen;
3988 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8){};
3989
3990 m = e & ((1 << (-nBits)) - 1);
3991 e >>= (-nBits);
3992 nBits += mLen;
3993 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8){};
3994
3995 if (e === 0) {
3996 e = 1 - eBias;
3997 } else if (e === eMax) {
3998 return m ? NaN : ((s ? -1 : 1) * Infinity);
3999 } else {
4000 m = m + Math.pow(2, mLen);
4001 e = e - eBias;
4002 }
4003 return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
4004 };
4005
4006 exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
4007 var e, m, c,
4008 eLen = nBytes * 8 - mLen - 1,
4009 eMax = (1 << eLen) - 1,
4010 eBias = eMax >> 1,
4011 rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
4012 i = isLE ? 0 : (nBytes - 1),
4013 d = isLE ? 1 : -1,
4014 s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
4015
4016 value = Math.abs(value);
4017
4018 if (isNaN(value) || value === Infinity) {
4019 m = isNaN(value) ? 1 : 0;
4020 e = eMax;
4021 } else {
4022 e = Math.floor(Math.log(value) / Math.LN2);
4023 if (value * (c = Math.pow(2, -e)) < 1) {
4024 e--;
4025 c *= 2;
4026 }
4027 if (e + eBias >= 1) {
4028 value += rt / c;
4029 } else {
4030 value += rt * Math.pow(2, 1 - eBias);
4031 }
4032 if (value * c >= 2) {
4033 e++;
4034 c /= 2;
4035 }
4036
4037 if (e + eBias >= eMax) {
4038 m = 0;
4039 e = eMax;
4040 } else if (e + eBias >= 1) {
4041 m = (value * c - 1) * Math.pow(2, mLen);
4042 e = e + eBias;
4043 } else {
4044 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
4045 e = 0;
4046 }
4047 }
4048
4049 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8){};
4050
4051 e = (e << mLen) | m;
4052 eLen += mLen;
4053 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8){};
4054
4055 buffer[offset + i - d] |= s * 128;
4056 };
4057
4058 },{}],11:[function(_dereq_,module,exports){
4059 if (typeof Object.create === 'function') {
4060 // implementation from standard node.js 'util' module
4061 module.exports = function inherits(ctor, superCtor) {
4062 ctor.super_ = superCtor
4063 ctor.prototype = Object.create(superCtor.prototype, {
4064 constructor: {
4065 value: ctor,
4066 enumerable: false,
4067 writable: true,
4068 configurable: true
4069 }
4070 });
4071 };
4072 } else {
4073 // old school shim for old browsers
4074 module.exports = function inherits(ctor, superCtor) {
4075 ctor.super_ = superCtor
4076 var TempCtor = function () {}
4077 TempCtor.prototype = superCtor.prototype
4078 ctor.prototype = new TempCtor()
4079 ctor.prototype.constructor = ctor
4080 }
4081 }
4082
4083 },{}],12:[function(_dereq_,module,exports){
4084 // shim for using process in browser
4085
4086 var process = module.exports = {};
4087
4088 process.nextTick = (function () {
4089 var canSetImmediate = typeof window !== 'undefined'
4090 && window.setImmediate;
4091 var canPost = typeof window !== 'undefined'
4092 && window.postMessage && window.addEventListener
4093 ;
4094
4095 if (canSetImmediate) {
4096 return function (f) { return window.setImmediate(f) };
4097 }
4098
4099 if (canPost) {
4100 var queue = [];
4101 window.addEventListener('message', function (ev) {
4102 var source = ev.source;
4103 if ((source === window || source === null) && ev.data === 'process-tick') {
4104 ev.stopPropagation();
4105 if (queue.length > 0) {
4106 var fn = queue.shift();
4107 fn();
4108 }
4109 }
4110 }, true);
4111
4112 return function nextTick(fn) {
4113 queue.push(fn);
4114 window.postMessage('process-tick', '*');
4115 };
4116 }
4117
4118 return function nextTick(fn) {
4119 setTimeout(fn, 0);
4120 };
4121 })();
4122
4123 process.title = 'browser';
4124 process.browser = true;
4125 process.env = {};
4126 process.argv = [];
4127
4128 function noop() {}
4129
4130 process.on = noop;
4131 process.addListener = noop;
4132 process.once = noop;
4133 process.off = noop;
4134 process.removeListener = noop;
4135 process.removeAllListeners = noop;
4136 process.emit = noop;
4137
4138 process.binding = function (name) {
4139 throw new Error('process.binding is not supported');
4140 }
4141
4142 // TODO(shtylman)
4143 process.cwd = function () { return '/' };
4144 process.chdir = function (dir) {
4145 throw new Error('process.chdir is not supported');
4146 };
4147
4148 },{}],13:[function(_dereq_,module,exports){
4149 module.exports=_dereq_(5)
4150 },{}],14:[function(_dereq_,module,exports){
4151 module.exports=_dereq_(6)
4152 },{"./support/isBuffer":13,"FWaASH":12,"inherits":11}],15:[function(_dereq_,module,exports){
4153 (function (Buffer){
4154 // Base58 encoding/decoding
4155 // Originally written by Mike Hearn for BitcoinJ
4156 // Copyright (c) 2011 Google Inc
4157 // Ported to JavaScript by Stefan Thomas
4158 // Merged Buffer refactorings from base58-native by Stephen Pair
4159 // Copyright (c) 2013 BitPay Inc
4160
4161 var assert = _dereq_('assert')
4162 var BigInteger = _dereq_('bigi')
4163
4164 var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
4165 var ALPHABET_BUF = new Buffer(ALPHABET, 'ascii')
4166 var ALPHABET_MAP = {}
4167 for(var i = 0; i < ALPHABET.length; i++) {
4168 ALPHABET_MAP[ALPHABET.charAt(i)] = BigInteger.valueOf(i)
4169 }
4170 var BASE = new BigInteger('58')
4171
4172 function encode(buffer) {
4173 var bi = BigInteger.fromBuffer(buffer)
4174 var result = new Buffer(buffer.length << 1)
4175
4176 var i = result.length - 1
4177 while (bi.signum() > 0) {
4178 var remainder = bi.mod(BASE)
4179 bi = bi.divide(BASE)
4180
4181 result[i] = ALPHABET_BUF[remainder.intValue()]
4182 i--
4183 }
4184
4185 // deal with leading zeros
4186 var j = 0
4187 while (buffer[j] === 0) {
4188 result[i] = ALPHABET_BUF[0]
4189 j++
4190 i--
4191 }
4192
4193 return result.slice(i + 1, result.length).toString('ascii')
4194 }
4195
4196 function decode(string) {
4197 if (string.length === 0) return new Buffer(0)
4198
4199 var num = BigInteger.ZERO
4200
4201 for (var i = 0; i < string.length; i++) {
4202 num = num.multiply(BASE)
4203
4204 var figure = ALPHABET_MAP[string.charAt(i)]
4205 assert.notEqual(figure, undefined, 'Non-base58 character')
4206
4207 num = num.add(figure)
4208 }
4209
4210 // deal with leading zeros
4211 var j = 0
4212 while ((j < string.length) && (string[j] === ALPHABET[0])) {
4213 j++
4214 }
4215
4216 var buffer = num.toBuffer()
4217 var leadingZeros = new Buffer(j)
4218 leadingZeros.fill(0)
4219
4220 return Buffer.concat([leadingZeros, buffer])
4221 }
4222
4223 module.exports = {
4224 encode: encode,
4225 decode: decode
4226 }
4227
4228 }).call(this,_dereq_("buffer").Buffer)
4229 },{"assert":4,"bigi":3,"buffer":8}],16:[function(_dereq_,module,exports){
4230 (function (Buffer){
4231 var createHash = _dereq_('sha.js')
4232
4233 var md5 = toConstructor(_dereq_('./md5'))
4234 var rmd160 = toConstructor(_dereq_('ripemd160'))
4235
4236 function toConstructor (fn) {
4237 return function () {
4238 var buffers = []
4239 var m= {
4240 update: function (data, enc) {
4241 if(!Buffer.isBuffer(data)) data = new Buffer(data, enc)
4242 buffers.push(data)
4243 return this
4244 },
4245 digest: function (enc) {
4246 var buf = Buffer.concat(buffers)
4247 var r = fn(buf)
4248 buffers = null
4249 return enc ? r.toString(enc) : r
4250 }
4251 }
4252 return m
4253 }
4254 }
4255
4256 module.exports = function (alg) {
4257 if('md5' === alg) return new md5()
4258 if('rmd160' === alg) return new rmd160()
4259 return createHash(alg)
4260 }
4261
4262 }).call(this,_dereq_("buffer").Buffer)
4263 },{"./md5":20,"buffer":8,"ripemd160":21,"sha.js":23}],17:[function(_dereq_,module,exports){
4264 (function (Buffer){
4265 var createHash = _dereq_('./create-hash')
4266
4267 var blocksize = 64
4268 var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
4269
4270 module.exports = Hmac
4271
4272 function Hmac (alg, key) {
4273 if(!(this instanceof Hmac)) return new Hmac(alg, key)
4274 this._opad = opad
4275 this._alg = alg
4276
4277 key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key
4278
4279 if(key.length > blocksize) {
4280 key = createHash(alg).update(key).digest()
4281 } else if(key.length < blocksize) {
4282 key = Buffer.concat([key, zeroBuffer], blocksize)
4283 }
4284
4285 var ipad = this._ipad = new Buffer(blocksize)
4286 var opad = this._opad = new Buffer(blocksize)
4287
4288 for(var i = 0; i < blocksize; i++) {
4289 ipad[i] = key[i] ^ 0x36
4290 opad[i] = key[i] ^ 0x5C
4291 }
4292
4293 this._hash = createHash(alg).update(ipad)
4294 }
4295
4296 Hmac.prototype.update = function (data, enc) {
4297 this._hash.update(data, enc)
4298 return this
4299 }
4300
4301 Hmac.prototype.digest = function (enc) {
4302 var h = this._hash.digest()
4303 return createHash(this._alg).update(this._opad).update(h).digest(enc)
4304 }
4305
4306
4307 }).call(this,_dereq_("buffer").Buffer)
4308 },{"./create-hash":16,"buffer":8}],18:[function(_dereq_,module,exports){
4309 (function (Buffer){
4310 var intSize = 4;
4311 var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
4312 var chrsz = 8;
4313
4314 function toArray(buf, bigEndian) {
4315 if ((buf.length % intSize) !== 0) {
4316 var len = buf.length + (intSize - (buf.length % intSize));
4317 buf = Buffer.concat([buf, zeroBuffer], len);
4318 }
4319
4320 var arr = [];
4321 var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
4322 for (var i = 0; i < buf.length; i += intSize) {
4323 arr.push(fn.call(buf, i));
4324 }
4325 return arr;
4326 }
4327
4328 function toBuffer(arr, size, bigEndian) {
4329 var buf = new Buffer(size);
4330 var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
4331 for (var i = 0; i < arr.length; i++) {
4332 fn.call(buf, arr[i], i * 4, true);
4333 }
4334 return buf;
4335 }
4336
4337 function hash(buf, fn, hashSize, bigEndian) {
4338 if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
4339 var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
4340 return toBuffer(arr, hashSize, bigEndian);
4341 }
4342
4343 module.exports = { hash: hash };
4344
4345 }).call(this,_dereq_("buffer").Buffer)
4346 },{"buffer":8}],19:[function(_dereq_,module,exports){
4347 (function (Buffer){
4348 var rng = _dereq_('./rng')
4349
4350 function error () {
4351 var m = [].slice.call(arguments).join(' ')
4352 throw new Error([
4353 m,
4354 'we accept pull requests',
4355 'http://github.com/dominictarr/crypto-browserify'
4356 ].join('\n'))
4357 }
4358
4359 exports.createHash = _dereq_('./create-hash')
4360
4361 exports.createHmac = _dereq_('./create-hmac')
4362
4363 exports.randomBytes = function(size, callback) {
4364 if (callback && callback.call) {
4365 try {
4366 callback.call(this, undefined, new Buffer(rng(size)))
4367 } catch (err) { callback(err) }
4368 } else {
4369 return new Buffer(rng(size))
4370 }
4371 }
4372
4373 function each(a, f) {
4374 for(var i in a)
4375 f(a[i], i)
4376 }
4377
4378 exports.getHashes = function () {
4379 return ['sha1', 'sha256', 'md5', 'rmd160']
4380
4381 }
4382
4383 var p = _dereq_('./pbkdf2')(exports.createHmac)
4384 exports.pbkdf2 = p.pbkdf2
4385 exports.pbkdf2Sync = p.pbkdf2Sync
4386
4387
4388 // the least I can do is make error messages for the rest of the node.js/crypto api.
4389 each(['createCredentials'
4390 , 'createCipher'
4391 , 'createCipheriv'
4392 , 'createDecipher'
4393 , 'createDecipheriv'
4394 , 'createSign'
4395 , 'createVerify'
4396 , 'createDiffieHellman'
4397 ], function (name) {
4398 exports[name] = function () {
4399 error('sorry,', name, 'is not implemented yet')
4400 }
4401 })
4402
4403 }).call(this,_dereq_("buffer").Buffer)
4404 },{"./create-hash":16,"./create-hmac":17,"./pbkdf2":27,"./rng":28,"buffer":8}],20:[function(_dereq_,module,exports){
4405 /*
4406 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
4407 * Digest Algorithm, as defined in RFC 1321.
4408 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
4409 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4410 * Distributed under the BSD License
4411 * See http://pajhome.org.uk/crypt/md5 for more info.
4412 */
4413
4414 var helpers = _dereq_('./helpers');
4415
4416 /*
4417 * Calculate the MD5 of an array of little-endian words, and a bit length
4418 */
4419 function core_md5(x, len)
4420 {
4421 /* append padding */
4422 x[len >> 5] |= 0x80 << ((len) % 32);
4423 x[(((len + 64) >>> 9) << 4) + 14] = len;
4424
4425 var a = 1732584193;
4426 var b = -271733879;
4427 var c = -1732584194;
4428 var d = 271733878;
4429
4430 for(var i = 0; i < x.length; i += 16)
4431 {
4432 var olda = a;
4433 var oldb = b;
4434 var oldc = c;
4435 var oldd = d;
4436
4437 a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
4438 d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
4439 c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
4440 b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
4441 a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
4442 d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
4443 c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
4444 b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
4445 a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
4446 d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
4447 c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
4448 b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
4449 a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
4450 d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
4451 c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
4452 b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
4453
4454 a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
4455 d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
4456 c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
4457 b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
4458 a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
4459 d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
4460 c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
4461 b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
4462 a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
4463 d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
4464 c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
4465 b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
4466 a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
4467 d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
4468 c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
4469 b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
4470
4471 a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
4472 d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
4473 c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
4474 b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
4475 a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
4476 d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
4477 c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
4478 b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
4479 a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
4480 d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
4481 c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
4482 b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
4483 a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
4484 d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
4485 c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
4486 b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
4487
4488 a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
4489 d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
4490 c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
4491 b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
4492 a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
4493 d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
4494 c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
4495 b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
4496 a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
4497 d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
4498 c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
4499 b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
4500 a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
4501 d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
4502 c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
4503 b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
4504
4505 a = safe_add(a, olda);
4506 b = safe_add(b, oldb);
4507 c = safe_add(c, oldc);
4508 d = safe_add(d, oldd);
4509 }
4510 return Array(a, b, c, d);
4511
4512 }
4513
4514 /*
4515 * These functions implement the four basic operations the algorithm uses.
4516 */
4517 function md5_cmn(q, a, b, x, s, t)
4518 {
4519 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
4520 }
4521 function md5_ff(a, b, c, d, x, s, t)
4522 {
4523 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
4524 }
4525 function md5_gg(a, b, c, d, x, s, t)
4526 {
4527 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
4528 }
4529 function md5_hh(a, b, c, d, x, s, t)
4530 {
4531 return md5_cmn(b ^ c ^ d, a, b, x, s, t);
4532 }
4533 function md5_ii(a, b, c, d, x, s, t)
4534 {
4535 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
4536 }
4537
4538 /*
4539 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
4540 * to work around bugs in some JS interpreters.
4541 */
4542 function safe_add(x, y)
4543 {
4544 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
4545 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
4546 return (msw << 16) | (lsw & 0xFFFF);
4547 }
4548
4549 /*
4550 * Bitwise rotate a 32-bit number to the left.
4551 */
4552 function bit_rol(num, cnt)
4553 {
4554 return (num << cnt) | (num >>> (32 - cnt));
4555 }
4556
4557 module.exports = function md5(buf) {
4558 return helpers.hash(buf, core_md5, 16);
4559 };
4560
4561 },{"./helpers":18}],21:[function(_dereq_,module,exports){
4562 (function (Buffer){
4563
4564 module.exports = ripemd160
4565
4566
4567
4568 /*
4569 CryptoJS v3.1.2
4570 code.google.com/p/crypto-js
4571 (c) 2009-2013 by Jeff Mott. All rights reserved.
4572 code.google.com/p/crypto-js/wiki/License
4573 */
4574 /** @preserve
4575 (c) 2012 by Cédric Mesnil. All rights reserved.
4576
4577 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4578
4579 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
4580 - 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.
4581
4582 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.
4583 */
4584
4585 // Constants table
4586 var zl = [
4587 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
4588 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
4589 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
4590 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4591 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13];
4592 var zr = [
4593 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
4594 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
4595 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
4596 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
4597 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11];
4598 var sl = [
4599 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
4600 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
4601 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
4602 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
4603 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];
4604 var sr = [
4605 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
4606 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
4607 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
4608 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
4609 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];
4610
4611 var hl = [ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E];
4612 var hr = [ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000];
4613
4614 var bytesToWords = function (bytes) {
4615 var words = [];
4616 for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
4617 words[b >>> 5] |= bytes[i] << (24 - b % 32);
4618 }
4619 return words;
4620 };
4621
4622 var wordsToBytes = function (words) {
4623 var bytes = [];
4624 for (var b = 0; b < words.length * 32; b += 8) {
4625 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
4626 }
4627 return bytes;
4628 };
4629
4630 var processBlock = function (H, M, offset) {
4631
4632 // Swap endian
4633 for (var i = 0; i < 16; i++) {
4634 var offset_i = offset + i;
4635 var M_offset_i = M[offset_i];
4636
4637 // Swap
4638 M[offset_i] = (
4639 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
4640 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
4641 );
4642 }
4643
4644 // Working variables
4645 var al, bl, cl, dl, el;
4646 var ar, br, cr, dr, er;
4647
4648 ar = al = H[0];
4649 br = bl = H[1];
4650 cr = cl = H[2];
4651 dr = dl = H[3];
4652 er = el = H[4];
4653 // Computation
4654 var t;
4655 for (var i = 0; i < 80; i += 1) {
4656 t = (al + M[offset+zl[i]])|0;
4657 if (i<16){
4658 t += f1(bl,cl,dl) + hl[0];
4659 } else if (i<32) {
4660 t += f2(bl,cl,dl) + hl[1];
4661 } else if (i<48) {
4662 t += f3(bl,cl,dl) + hl[2];
4663 } else if (i<64) {
4664 t += f4(bl,cl,dl) + hl[3];
4665 } else {// if (i<80) {
4666 t += f5(bl,cl,dl) + hl[4];
4667 }
4668 t = t|0;
4669 t = rotl(t,sl[i]);
4670 t = (t+el)|0;
4671 al = el;
4672 el = dl;
4673 dl = rotl(cl, 10);
4674 cl = bl;
4675 bl = t;
4676
4677 t = (ar + M[offset+zr[i]])|0;
4678 if (i<16){
4679 t += f5(br,cr,dr) + hr[0];
4680 } else if (i<32) {
4681 t += f4(br,cr,dr) + hr[1];
4682 } else if (i<48) {
4683 t += f3(br,cr,dr) + hr[2];
4684 } else if (i<64) {
4685 t += f2(br,cr,dr) + hr[3];
4686 } else {// if (i<80) {
4687 t += f1(br,cr,dr) + hr[4];
4688 }
4689 t = t|0;
4690 t = rotl(t,sr[i]) ;
4691 t = (t+er)|0;
4692 ar = er;
4693 er = dr;
4694 dr = rotl(cr, 10);
4695 cr = br;
4696 br = t;
4697 }
4698 // Intermediate hash value
4699 t = (H[1] + cl + dr)|0;
4700 H[1] = (H[2] + dl + er)|0;
4701 H[2] = (H[3] + el + ar)|0;
4702 H[3] = (H[4] + al + br)|0;
4703 H[4] = (H[0] + bl + cr)|0;
4704 H[0] = t;
4705 };
4706
4707 function f1(x, y, z) {
4708 return ((x) ^ (y) ^ (z));
4709 }
4710
4711 function f2(x, y, z) {
4712 return (((x)&(y)) | ((~x)&(z)));
4713 }
4714
4715 function f3(x, y, z) {
4716 return (((x) | (~(y))) ^ (z));
4717 }
4718
4719 function f4(x, y, z) {
4720 return (((x) & (z)) | ((y)&(~(z))));
4721 }
4722
4723 function f5(x, y, z) {
4724 return ((x) ^ ((y) |(~(z))));
4725 }
4726
4727 function rotl(x,n) {
4728 return (x<<n) | (x>>>(32-n));
4729 }
4730
4731 function ripemd160(message) {
4732 var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];
4733
4734 if (typeof message == 'string')
4735 message = new Buffer(message, 'utf8');
4736
4737 var m = bytesToWords(message);
4738
4739 var nBitsLeft = message.length * 8;
4740 var nBitsTotal = message.length * 8;
4741
4742 // Add padding
4743 m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
4744 m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
4745 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
4746 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
4747 );
4748
4749 for (var i=0 ; i<m.length; i += 16) {
4750 processBlock(H, m, i);
4751 }
4752
4753 // Swap endian
4754 for (var i = 0; i < 5; i++) {
4755 // Shortcut
4756 var H_i = H[i];
4757
4758 // Swap
4759 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
4760 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
4761 }
4762
4763 var digestbytes = wordsToBytes(H);
4764 return new Buffer(digestbytes);
4765 }
4766
4767
4768
4769 }).call(this,_dereq_("buffer").Buffer)
4770 },{"buffer":8}],22:[function(_dereq_,module,exports){
4771 var u = _dereq_('./util')
4772 var write = u.write
4773 var fill = u.zeroFill
4774
4775 module.exports = function (Buffer) {
4776
4777 //prototype class for hash functions
4778 function Hash (blockSize, finalSize) {
4779 this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4)
4780 this._finalSize = finalSize
4781 this._blockSize = blockSize
4782 this._len = 0
4783 this._s = 0
4784 }
4785
4786 Hash.prototype.init = function () {
4787 this._s = 0
4788 this._len = 0
4789 }
4790
4791 function lengthOf(data, enc) {
4792 if(enc == null) return data.byteLength || data.length
4793 if(enc == 'ascii' || enc == 'binary') return data.length
4794 if(enc == 'hex') return data.length/2
4795 if(enc == 'base64') return data.length/3
4796 }
4797
4798 Hash.prototype.update = function (data, enc) {
4799 var bl = this._blockSize
4800
4801 //I'd rather do this with a streaming encoder, like the opposite of
4802 //http://nodejs.org/api/string_decoder.html
4803 var length
4804 if(!enc && 'string' === typeof data)
4805 enc = 'utf8'
4806
4807 if(enc) {
4808 if(enc === 'utf-8')
4809 enc = 'utf8'
4810
4811 if(enc === 'base64' || enc === 'utf8')
4812 data = new Buffer(data, enc), enc = null
4813
4814 length = lengthOf(data, enc)
4815 } else
4816 length = data.byteLength || data.length
4817
4818 var l = this._len += length
4819 var s = this._s = (this._s || 0)
4820 var f = 0
4821 var buffer = this._block
4822 while(s < l) {
4823 var t = Math.min(length, f + bl)
4824 write(buffer, data, enc, s%bl, f, t)
4825 var ch = (t - f);
4826 s += ch; f += ch
4827
4828 if(!(s%bl))
4829 this._update(buffer)
4830 }
4831 this._s = s
4832
4833 return this
4834
4835 }
4836
4837 Hash.prototype.digest = function (enc) {
4838 var bl = this._blockSize
4839 var fl = this._finalSize
4840 var len = this._len*8
4841
4842 var x = this._block
4843
4844 var bits = len % (bl*8)
4845
4846 //add end marker, so that appending 0's creats a different hash.
4847 x[this._len % bl] = 0x80
4848 fill(this._block, this._len % bl + 1)
4849
4850 if(bits >= fl*8) {
4851 this._update(this._block)
4852 u.zeroFill(this._block, 0)
4853 }
4854
4855 //TODO: handle case where the bit length is > Math.pow(2, 29)
4856 x.writeInt32BE(len, fl + 4) //big endian
4857
4858 var hash = this._update(this._block) || this._hash()
4859 if(enc == null) return hash
4860 return hash.toString(enc)
4861 }
4862
4863 Hash.prototype._update = function () {
4864 throw new Error('_update must be implemented by subclass')
4865 }
4866
4867 return Hash
4868 }
4869
4870 },{"./util":26}],23:[function(_dereq_,module,exports){
4871 var exports = module.exports = function (alg) {
4872 var Alg = exports[alg]
4873 if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')
4874 return new Alg()
4875 }
4876
4877 var Buffer = _dereq_('buffer').Buffer
4878 var Hash = _dereq_('./hash')(Buffer)
4879
4880 exports.sha =
4881 exports.sha1 = _dereq_('./sha1')(Buffer, Hash)
4882 exports.sha256 = _dereq_('./sha256')(Buffer, Hash)
4883
4884 },{"./hash":22,"./sha1":24,"./sha256":25,"buffer":8}],24:[function(_dereq_,module,exports){
4885 /*
4886 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
4887 * in FIPS PUB 180-1
4888 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
4889 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4890 * Distributed under the BSD License
4891 * See http://pajhome.org.uk/crypt/md5 for details.
4892 */
4893 module.exports = function (Buffer, Hash) {
4894
4895 var inherits = _dereq_('util').inherits
4896
4897 inherits(Sha1, Hash)
4898
4899 var A = 0|0
4900 var B = 4|0
4901 var C = 8|0
4902 var D = 12|0
4903 var E = 16|0
4904
4905 var BE = false
4906 var LE = true
4907
4908 var W = new Int32Array(80)
4909
4910 var POOL = []
4911
4912 function Sha1 () {
4913 if(POOL.length)
4914 return POOL.pop().init()
4915
4916 if(!(this instanceof Sha1)) return new Sha1()
4917 this._w = W
4918 Hash.call(this, 16*4, 14*4)
4919
4920 this._h = null
4921 this.init()
4922 }
4923
4924 Sha1.prototype.init = function () {
4925 this._a = 0x67452301
4926 this._b = 0xefcdab89
4927 this._c = 0x98badcfe
4928 this._d = 0x10325476
4929 this._e = 0xc3d2e1f0
4930
4931 Hash.prototype.init.call(this)
4932 return this
4933 }
4934
4935 Sha1.prototype._POOL = POOL
4936
4937 // assume that array is a Uint32Array with length=16,
4938 // and that if it is the last block, it already has the length and the 1 bit appended.
4939
4940
4941 var isDV = new Buffer(1) instanceof DataView
4942 function readInt32BE (X, i) {
4943 return isDV
4944 ? X.getInt32(i, false)
4945 : X.readInt32BE(i)
4946 }
4947
4948 Sha1.prototype._update = function (array) {
4949
4950 var X = this._block
4951 var h = this._h
4952 var a, b, c, d, e, _a, _b, _c, _d, _e
4953
4954 a = _a = this._a
4955 b = _b = this._b
4956 c = _c = this._c
4957 d = _d = this._d
4958 e = _e = this._e
4959
4960 var w = this._w
4961
4962 for(var j = 0; j < 80; j++) {
4963 var W = w[j]
4964 = j < 16
4965 //? X.getInt32(j*4, false)
4966 //? readInt32BE(X, j*4) //*/ X.readInt32BE(j*4) //*/
4967 ? X.readInt32BE(j*4)
4968 : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1)
4969
4970 var t =
4971 add(
4972 add(rol(a, 5), sha1_ft(j, b, c, d)),
4973 add(add(e, W), sha1_kt(j))
4974 );
4975
4976 e = d
4977 d = c
4978 c = rol(b, 30)
4979 b = a
4980 a = t
4981 }
4982
4983 this._a = add(a, _a)
4984 this._b = add(b, _b)
4985 this._c = add(c, _c)
4986 this._d = add(d, _d)
4987 this._e = add(e, _e)
4988 }
4989
4990 Sha1.prototype._hash = function () {
4991 if(POOL.length < 100) POOL.push(this)
4992 var H = new Buffer(20)
4993 //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0)
4994 H.writeInt32BE(this._a|0, A)
4995 H.writeInt32BE(this._b|0, B)
4996 H.writeInt32BE(this._c|0, C)
4997 H.writeInt32BE(this._d|0, D)
4998 H.writeInt32BE(this._e|0, E)
4999 return H
5000 }
5001
5002 /*
5003 * Perform the appropriate triplet combination function for the current
5004 * iteration
5005 */
5006 function sha1_ft(t, b, c, d) {
5007 if(t < 20) return (b & c) | ((~b) & d);
5008 if(t < 40) return b ^ c ^ d;
5009 if(t < 60) return (b & c) | (b & d) | (c & d);
5010 return b ^ c ^ d;
5011 }
5012
5013 /*
5014 * Determine the appropriate additive constant for the current iteration
5015 */
5016 function sha1_kt(t) {
5017 return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
5018 (t < 60) ? -1894007588 : -899497514;
5019 }
5020
5021 /*
5022 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
5023 * to work around bugs in some JS interpreters.
5024 * //dominictarr: this is 10 years old, so maybe this can be dropped?)
5025 *
5026 */
5027 function add(x, y) {
5028 return (x + y ) | 0
5029 //lets see how this goes on testling.
5030 // var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5031 // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5032 // return (msw << 16) | (lsw & 0xFFFF);
5033 }
5034
5035 /*
5036 * Bitwise rotate a 32-bit number to the left.
5037 */
5038 function rol(num, cnt) {
5039 return (num << cnt) | (num >>> (32 - cnt));
5040 }
5041
5042 return Sha1
5043 }
5044
5045 },{"util":14}],25:[function(_dereq_,module,exports){
5046
5047 /**
5048 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
5049 * in FIPS 180-2
5050 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
5051 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
5052 *
5053 */
5054
5055 var inherits = _dereq_('util').inherits
5056 var BE = false
5057 var LE = true
5058 var u = _dereq_('./util')
5059
5060 module.exports = function (Buffer, Hash) {
5061
5062 var K = [
5063 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
5064 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
5065 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
5066 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
5067 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
5068 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
5069 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
5070 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
5071 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
5072 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
5073 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
5074 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
5075 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
5076 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
5077 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
5078 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
5079 ]
5080
5081 inherits(Sha256, Hash)
5082 var W = new Array(64)
5083 var POOL = []
5084 function Sha256() {
5085 // Closure compiler warning - this code lacks side effects - thus commented out
5086 // if(POOL.length) {
5087 // return POOL.shift().init()
5088 // }
5089 //this._data = new Buffer(32)
5090
5091 this.init()
5092
5093 this._w = W //new Array(64)
5094
5095 Hash.call(this, 16*4, 14*4)
5096 };
5097
5098 Sha256.prototype.init = function () {
5099
5100 this._a = 0x6a09e667|0
5101 this._b = 0xbb67ae85|0
5102 this._c = 0x3c6ef372|0
5103 this._d = 0xa54ff53a|0
5104 this._e = 0x510e527f|0
5105 this._f = 0x9b05688c|0
5106 this._g = 0x1f83d9ab|0
5107 this._h = 0x5be0cd19|0
5108
5109 this._len = this._s = 0
5110
5111 return this
5112 }
5113
5114 var safe_add = function(x, y) {
5115 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5116 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5117 return (msw << 16) | (lsw & 0xFFFF);
5118 }
5119
5120 function S (X, n) {
5121 return (X >>> n) | (X << (32 - n));
5122 }
5123
5124 function R (X, n) {
5125 return (X >>> n);
5126 }
5127
5128 function Ch (x, y, z) {
5129 return ((x & y) ^ ((~x) & z));
5130 }
5131
5132 function Maj (x, y, z) {
5133 return ((x & y) ^ (x & z) ^ (y & z));
5134 }
5135
5136 function Sigma0256 (x) {
5137 return (S(x, 2) ^ S(x, 13) ^ S(x, 22));
5138 }
5139
5140 function Sigma1256 (x) {
5141 return (S(x, 6) ^ S(x, 11) ^ S(x, 25));
5142 }
5143
5144 function Gamma0256 (x) {
5145 return (S(x, 7) ^ S(x, 18) ^ R(x, 3));
5146 }
5147
5148 function Gamma1256 (x) {
5149 return (S(x, 17) ^ S(x, 19) ^ R(x, 10));
5150 }
5151
5152 Sha256.prototype._update = function(m) {
5153 var M = this._block
5154 var W = this._w
5155 var a, b, c, d, e, f, g, h
5156 var T1, T2
5157
5158 a = this._a | 0
5159 b = this._b | 0
5160 c = this._c | 0
5161 d = this._d | 0
5162 e = this._e | 0
5163 f = this._f | 0
5164 g = this._g | 0
5165 h = this._h | 0
5166
5167 for (var j = 0; j < 64; j++) {
5168 var w = W[j] = j < 16
5169 ? M.readInt32BE(j * 4)
5170 : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16]
5171
5172 T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w
5173
5174 T2 = Sigma0256(a) + Maj(a, b, c);
5175 h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2;
5176 }
5177
5178 this._a = (a + this._a) | 0
5179 this._b = (b + this._b) | 0
5180 this._c = (c + this._c) | 0
5181 this._d = (d + this._d) | 0
5182 this._e = (e + this._e) | 0
5183 this._f = (f + this._f) | 0
5184 this._g = (g + this._g) | 0
5185 this._h = (h + this._h) | 0
5186
5187 };
5188
5189 Sha256.prototype._hash = function () {
5190 if(POOL.length < 10)
5191 POOL.push(this)
5192
5193 var H = new Buffer(32)
5194
5195 H.writeInt32BE(this._a, 0)
5196 H.writeInt32BE(this._b, 4)
5197 H.writeInt32BE(this._c, 8)
5198 H.writeInt32BE(this._d, 12)
5199 H.writeInt32BE(this._e, 16)
5200 H.writeInt32BE(this._f, 20)
5201 H.writeInt32BE(this._g, 24)
5202 H.writeInt32BE(this._h, 28)
5203
5204 return H
5205 }
5206
5207 return Sha256
5208
5209 }
5210
5211 },{"./util":26,"util":14}],26:[function(_dereq_,module,exports){
5212 exports.write = write
5213 exports.zeroFill = zeroFill
5214
5215 exports.toString = toString
5216
5217 function write (buffer, string, enc, start, from, to, LE) {
5218 var l = (to - from)
5219 if(enc === 'ascii' || enc === 'binary') {
5220 for( var i = 0; i < l; i++) {
5221 buffer[start + i] = string.charCodeAt(i + from)
5222 }
5223 }
5224 else if(enc == null) {
5225 for( var i = 0; i < l; i++) {
5226 buffer[start + i] = string[i + from]
5227 }
5228 }
5229 else if(enc === 'hex') {
5230 for(var i = 0; i < l; i++) {
5231 var j = from + i
5232 buffer[start + i] = parseInt(string[j*2] + string[(j*2)+1], 16)
5233 }
5234 }
5235 else if(enc === 'base64') {
5236 throw new Error('base64 encoding not yet supported')
5237 }
5238 else
5239 throw new Error(enc +' encoding not yet supported')
5240 }
5241
5242 //always fill to the end!
5243 function zeroFill(buf, from) {
5244 for(var i = from; i < buf.length; i++)
5245 buf[i] = 0
5246 }
5247
5248
5249 },{}],27:[function(_dereq_,module,exports){
5250 (function (Buffer){
5251 // JavaScript PBKDF2 Implementation
5252 // Based on http://git.io/qsv2zw
5253 // Licensed under LGPL v3
5254 // Copyright (c) 2013 jduncanator
5255
5256 var blocksize = 64
5257 var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
5258
5259 module.exports = function (createHmac, exports) {
5260 exports = exports || {}
5261
5262 exports.pbkdf2 = function(password, salt, iterations, keylen, cb) {
5263 if('function' !== typeof cb)
5264 throw new Error('No callback provided to pbkdf2');
5265 setTimeout(function () {
5266 cb(null, exports.pbkdf2Sync(password, salt, iterations, keylen))
5267 })
5268 }
5269
5270 exports.pbkdf2Sync = function(key, salt, iterations, keylen) {
5271 if('number' !== typeof iterations)
5272 throw new TypeError('Iterations not a number')
5273 if(iterations < 0)
5274 throw new TypeError('Bad iterations')
5275 if('number' !== typeof keylen)
5276 throw new TypeError('Key length not a number')
5277 if(keylen < 0)
5278 throw new TypeError('Bad key length')
5279
5280 //stretch key to the correct length that hmac wants it,
5281 //otherwise this will happen every time hmac is called
5282 //twice per iteration.
5283 var key = !Buffer.isBuffer(key) ? new Buffer(key) : key
5284
5285 if(key.length > blocksize) {
5286 key = createHash(alg).update(key).digest()
5287 } else if(key.length < blocksize) {
5288 key = Buffer.concat([key, zeroBuffer], blocksize)
5289 }
5290
5291 var HMAC;
5292 var cplen, p = 0, i = 1, itmp = new Buffer(4), digtmp;
5293 var out = new Buffer(keylen);
5294 out.fill(0);
5295 while(keylen) {
5296 if(keylen > 20)
5297 cplen = 20;
5298 else
5299 cplen = keylen;
5300
5301 /* We are unlikely to ever use more than 256 blocks (5120 bits!)
5302 * but just in case...
5303 */
5304 itmp[0] = (i >> 24) & 0xff;
5305 itmp[1] = (i >> 16) & 0xff;
5306 itmp[2] = (i >> 8) & 0xff;
5307 itmp[3] = i & 0xff;
5308
5309 HMAC = createHmac('sha1', key);
5310 HMAC.update(salt)
5311 HMAC.update(itmp);
5312 digtmp = HMAC.digest();
5313 digtmp.copy(out, p, 0, cplen);
5314
5315 for(var j = 1; j < iterations; j++) {
5316 HMAC = createHmac('sha1', key);
5317 HMAC.update(digtmp);
5318 digtmp = HMAC.digest();
5319 for(var k = 0; k < cplen; k++) {
5320 out[k] ^= digtmp[k];
5321 }
5322 }
5323 keylen -= cplen;
5324 i++;
5325 p += cplen;
5326 }
5327
5328 return out;
5329 }
5330
5331 return exports
5332 }
5333
5334 }).call(this,_dereq_("buffer").Buffer)
5335 },{"buffer":8}],28:[function(_dereq_,module,exports){
5336 (function (Buffer){
5337 // Original code adapted from Robert Kieffer.
5338 // details at https://github.com/broofa/node-uuid
5339
5340
5341 (function() {
5342 var _global = this;
5343
5344 var mathRNG, whatwgRNG;
5345
5346 // NOTE: Math.random() does not guarantee "cryptographic quality"
5347 mathRNG = function(size) {
5348 var bytes = new Buffer(size);
5349 var r;
5350
5351 for (var i = 0, r; i < size; i++) {
5352 if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
5353 bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
5354 }
5355
5356 return bytes;
5357 }
5358
5359 if (_global.crypto && crypto.getRandomValues) {
5360 whatwgRNG = function(size) {
5361 var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array
5362 crypto.getRandomValues(bytes);
5363 return bytes;
5364 }
5365 }
5366
5367 module.exports = whatwgRNG || mathRNG;
5368
5369 }())
5370
5371 }).call(this,_dereq_("buffer").Buffer)
5372 },{"buffer":8}],29:[function(_dereq_,module,exports){
5373 ;(function (root, factory, undef) {
5374 if (typeof exports === "object") {
5375 // CommonJS
5376 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
5377 }
5378 else if (typeof define === "function" && define.amd) {
5379 // AMD
5380 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
5381 }
5382 else {
5383 // Global (browser)
5384 factory(root.CryptoJS);
5385 }
5386 }(this, function (CryptoJS) {
5387
5388 (function () {
5389 // Shortcuts
5390 var C = CryptoJS;
5391 var C_lib = C.lib;
5392 var BlockCipher = C_lib.BlockCipher;
5393 var C_algo = C.algo;
5394
5395 // Lookup tables
5396 var SBOX = [];
5397 var INV_SBOX = [];
5398 var SUB_MIX_0 = [];
5399 var SUB_MIX_1 = [];
5400 var SUB_MIX_2 = [];
5401 var SUB_MIX_3 = [];
5402 var INV_SUB_MIX_0 = [];
5403 var INV_SUB_MIX_1 = [];
5404 var INV_SUB_MIX_2 = [];
5405 var INV_SUB_MIX_3 = [];
5406
5407 // Compute lookup tables
5408 (function () {
5409 // Compute double table
5410 var d = [];
5411 for (var i = 0; i < 256; i++) {
5412 if (i < 128) {
5413 d[i] = i << 1;
5414 } else {
5415 d[i] = (i << 1) ^ 0x11b;
5416 }
5417 }
5418
5419 // Walk GF(2^8)
5420 var x = 0;
5421 var xi = 0;
5422 for (var i = 0; i < 256; i++) {
5423 // Compute sbox
5424 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
5425 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
5426 SBOX[x] = sx;
5427 INV_SBOX[sx] = x;
5428
5429 // Compute multiplication
5430 var x2 = d[x];
5431 var x4 = d[x2];
5432 var x8 = d[x4];
5433
5434 // Compute sub bytes, mix columns tables
5435 var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
5436 SUB_MIX_0[x] = (t << 24) | (t >>> 8);
5437 SUB_MIX_1[x] = (t << 16) | (t >>> 16);
5438 SUB_MIX_2[x] = (t << 8) | (t >>> 24);
5439 SUB_MIX_3[x] = t;
5440
5441 // Compute inv sub bytes, inv mix columns tables
5442 var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
5443 INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
5444 INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
5445 INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
5446 INV_SUB_MIX_3[sx] = t;
5447
5448 // Compute next counter
5449 if (!x) {
5450 x = xi = 1;
5451 } else {
5452 x = x2 ^ d[d[d[x8 ^ x2]]];
5453 xi ^= d[d[xi]];
5454 }
5455 }
5456 }());
5457
5458 // Precomputed Rcon lookup
5459 var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
5460
5461 /**
5462 * AES block cipher algorithm.
5463 */
5464 var AES = C_algo.AES = BlockCipher.extend({
5465 _doReset: function () {
5466 // Shortcuts
5467 var key = this._key;
5468 var keyWords = key.words;
5469 var keySize = key.sigBytes / 4;
5470
5471 // Compute number of rounds
5472 var nRounds = this._nRounds = keySize + 6
5473
5474 // Compute number of key schedule rows
5475 var ksRows = (nRounds + 1) * 4;
5476
5477 // Compute key schedule
5478 var keySchedule = this._keySchedule = [];
5479 for (var ksRow = 0; ksRow < ksRows; ksRow++) {
5480 if (ksRow < keySize) {
5481 keySchedule[ksRow] = keyWords[ksRow];
5482 } else {
5483 var t = keySchedule[ksRow - 1];
5484
5485 if (!(ksRow % keySize)) {
5486 // Rot word
5487 t = (t << 8) | (t >>> 24);
5488
5489 // Sub word
5490 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5491
5492 // Mix Rcon
5493 t ^= RCON[(ksRow / keySize) | 0] << 24;
5494 } else if (keySize > 6 && ksRow % keySize == 4) {
5495 // Sub word
5496 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5497 }
5498
5499 keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
5500 }
5501 }
5502
5503 // Compute inv key schedule
5504 var invKeySchedule = this._invKeySchedule = [];
5505 for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
5506 var ksRow = ksRows - invKsRow;
5507
5508 if (invKsRow % 4) {
5509 var t = keySchedule[ksRow];
5510 } else {
5511 var t = keySchedule[ksRow - 4];
5512 }
5513
5514 if (invKsRow < 4 || ksRow <= 4) {
5515 invKeySchedule[invKsRow] = t;
5516 } else {
5517 invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
5518 INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
5519 }
5520 }
5521 },
5522
5523 encryptBlock: function (M, offset) {
5524 this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
5525 },
5526
5527 decryptBlock: function (M, offset) {
5528 // Swap 2nd and 4th rows
5529 var t = M[offset + 1];
5530 M[offset + 1] = M[offset + 3];
5531 M[offset + 3] = t;
5532
5533 this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
5534
5535 // Inv swap 2nd and 4th rows
5536 var t = M[offset + 1];
5537 M[offset + 1] = M[offset + 3];
5538 M[offset + 3] = t;
5539 },
5540
5541 _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
5542 // Shortcut
5543 var nRounds = this._nRounds;
5544
5545 // Get input, add round key
5546 var s0 = M[offset] ^ keySchedule[0];
5547 var s1 = M[offset + 1] ^ keySchedule[1];
5548 var s2 = M[offset + 2] ^ keySchedule[2];
5549 var s3 = M[offset + 3] ^ keySchedule[3];
5550
5551 // Key schedule row counter
5552 var ksRow = 4;
5553
5554 // Rounds
5555 for (var round = 1; round < nRounds; round++) {
5556 // Shift rows, sub bytes, mix columns, add round key
5557 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++];
5558 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++];
5559 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++];
5560 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++];
5561
5562 // Update state
5563 s0 = t0;
5564 s1 = t1;
5565 s2 = t2;
5566 s3 = t3;
5567 }
5568
5569 // Shift rows, sub bytes, add round key
5570 var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
5571 var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
5572 var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
5573 var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
5574
5575 // Set output
5576 M[offset] = t0;
5577 M[offset + 1] = t1;
5578 M[offset + 2] = t2;
5579 M[offset + 3] = t3;
5580 },
5581
5582 keySize: 256/32
5583 });
5584
5585 /**
5586 * Shortcut functions to the cipher's object interface.
5587 *
5588 * @example
5589 *
5590 * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
5591 * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
5592 */
5593 C.AES = BlockCipher._createHelper(AES);
5594 }());
5595
5596
5597 return CryptoJS.AES;
5598
5599 }));
5600 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],30:[function(_dereq_,module,exports){
5601 ;(function (root, factory) {
5602 if (typeof exports === "object") {
5603 // CommonJS
5604 module.exports = exports = factory(_dereq_("./core"));
5605 }
5606 else if (typeof define === "function" && define.amd) {
5607 // AMD
5608 define(["./core"], factory);
5609 }
5610 else {
5611 // Global (browser)
5612 factory(root.CryptoJS);
5613 }
5614 }(this, function (CryptoJS) {
5615
5616 /**
5617 * Cipher core components.
5618 */
5619 CryptoJS.lib.Cipher || (function (undefined) {
5620 // Shortcuts
5621 var C = CryptoJS;
5622 var C_lib = C.lib;
5623 var Base = C_lib.Base;
5624 var WordArray = C_lib.WordArray;
5625 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
5626 var C_enc = C.enc;
5627 var Utf8 = C_enc.Utf8;
5628 var Base64 = C_enc.Base64;
5629 var C_algo = C.algo;
5630 var EvpKDF = C_algo.EvpKDF;
5631
5632 /**
5633 * Abstract base cipher template.
5634 *
5635 * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
5636 * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
5637 * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
5638 * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
5639 */
5640 var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
5641 /**
5642 * Configuration options.
5643 *
5644 * @property {WordArray} iv The IV to use for this operation.
5645 */
5646 cfg: Base.extend(),
5647
5648 /**
5649 * Creates this cipher in encryption mode.
5650 *
5651 * @param {WordArray} key The key.
5652 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5653 *
5654 * @return {Cipher} A cipher instance.
5655 *
5656 * @static
5657 *
5658 * @example
5659 *
5660 * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
5661 */
5662 createEncryptor: function (key, cfg) {
5663 return this.create(this._ENC_XFORM_MODE, key, cfg);
5664 },
5665
5666 /**
5667 * Creates this cipher in decryption mode.
5668 *
5669 * @param {WordArray} key The key.
5670 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5671 *
5672 * @return {Cipher} A cipher instance.
5673 *
5674 * @static
5675 *
5676 * @example
5677 *
5678 * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
5679 */
5680 createDecryptor: function (key, cfg) {
5681 return this.create(this._DEC_XFORM_MODE, key, cfg);
5682 },
5683
5684 /**
5685 * Initializes a newly created cipher.
5686 *
5687 * @param {number} xformMode Either the encryption or decryption transormation mode constant.
5688 * @param {WordArray} key The key.
5689 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5690 *
5691 * @example
5692 *
5693 * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
5694 */
5695 init: function (xformMode, key, cfg) {
5696 // Apply config defaults
5697 this.cfg = this.cfg.extend(cfg);
5698
5699 // Store transform mode and key
5700 this._xformMode = xformMode;
5701 this._key = key;
5702
5703 // Set initial values
5704 this.reset();
5705 },
5706
5707 /**
5708 * Resets this cipher to its initial state.
5709 *
5710 * @example
5711 *
5712 * cipher.reset();
5713 */
5714 reset: function () {
5715 // Reset data buffer
5716 BufferedBlockAlgorithm.reset.call(this);
5717
5718 // Perform concrete-cipher logic
5719 this._doReset();
5720 },
5721
5722 /**
5723 * Adds data to be encrypted or decrypted.
5724 *
5725 * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
5726 *
5727 * @return {WordArray} The data after processing.
5728 *
5729 * @example
5730 *
5731 * var encrypted = cipher.process('data');
5732 * var encrypted = cipher.process(wordArray);
5733 */
5734 process: function (dataUpdate) {
5735 // Append
5736 this._append(dataUpdate);
5737
5738 // Process available blocks
5739 return this._process();
5740 },
5741
5742 /**
5743 * Finalizes the encryption or decryption process.
5744 * Note that the finalize operation is effectively a destructive, read-once operation.
5745 *
5746 * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
5747 *
5748 * @return {WordArray} The data after final processing.
5749 *
5750 * @example
5751 *
5752 * var encrypted = cipher.finalize();
5753 * var encrypted = cipher.finalize('data');
5754 * var encrypted = cipher.finalize(wordArray);
5755 */
5756 finalize: function (dataUpdate) {
5757 // Final data update
5758 if (dataUpdate) {
5759 this._append(dataUpdate);
5760 }
5761
5762 // Perform concrete-cipher logic
5763 var finalProcessedData = this._doFinalize();
5764
5765 return finalProcessedData;
5766 },
5767
5768 keySize: 128/32,
5769
5770 ivSize: 128/32,
5771
5772 _ENC_XFORM_MODE: 1,
5773
5774 _DEC_XFORM_MODE: 2,
5775
5776 /**
5777 * Creates shortcut functions to a cipher's object interface.
5778 *
5779 * @param {Cipher} cipher The cipher to create a helper for.
5780 *
5781 * @return {Object} An object with encrypt and decrypt shortcut functions.
5782 *
5783 * @static
5784 *
5785 * @example
5786 *
5787 * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
5788 */
5789 _createHelper: (function () {
5790 function selectCipherStrategy(key) {
5791 if (typeof key == 'string') {
5792 return PasswordBasedCipher;
5793 } else {
5794 return SerializableCipher;
5795 }
5796 }
5797
5798 return function (cipher) {
5799 return {
5800 encrypt: function (message, key, cfg) {
5801 return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
5802 },
5803
5804 decrypt: function (ciphertext, key, cfg) {
5805 return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
5806 }
5807 };
5808 };
5809 }())
5810 });
5811
5812 /**
5813 * Abstract base stream cipher template.
5814 *
5815 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
5816 */
5817 var StreamCipher = C_lib.StreamCipher = Cipher.extend({
5818 _doFinalize: function () {
5819 // Process partial blocks
5820 var finalProcessedBlocks = this._process(!!'flush');
5821
5822 return finalProcessedBlocks;
5823 },
5824
5825 blockSize: 1
5826 });
5827
5828 /**
5829 * Mode namespace.
5830 */
5831 var C_mode = C.mode = {};
5832
5833 /**
5834 * Abstract base block cipher mode template.
5835 */
5836 var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
5837 /**
5838 * Creates this mode for encryption.
5839 *
5840 * @param {Cipher} cipher A block cipher instance.
5841 * @param {Array} iv The IV words.
5842 *
5843 * @static
5844 *
5845 * @example
5846 *
5847 * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
5848 */
5849 createEncryptor: function (cipher, iv) {
5850 return this.Encryptor.create(cipher, iv);
5851 },
5852
5853 /**
5854 * Creates this mode for decryption.
5855 *
5856 * @param {Cipher} cipher A block cipher instance.
5857 * @param {Array} iv The IV words.
5858 *
5859 * @static
5860 *
5861 * @example
5862 *
5863 * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
5864 */
5865 createDecryptor: function (cipher, iv) {
5866 return this.Decryptor.create(cipher, iv);
5867 },
5868
5869 /**
5870 * Initializes a newly created mode.
5871 *
5872 * @param {Cipher} cipher A block cipher instance.
5873 * @param {Array} iv The IV words.
5874 *
5875 * @example
5876 *
5877 * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
5878 */
5879 init: function (cipher, iv) {
5880 this._cipher = cipher;
5881 this._iv = iv;
5882 }
5883 });
5884
5885 /**
5886 * Cipher Block Chaining mode.
5887 */
5888 var CBC = C_mode.CBC = (function () {
5889 /**
5890 * Abstract base CBC mode.
5891 */
5892 var CBC = BlockCipherMode.extend();
5893
5894 /**
5895 * CBC encryptor.
5896 */
5897 CBC.Encryptor = CBC.extend({
5898 /**
5899 * Processes the data block at offset.
5900 *
5901 * @param {Array} words The data words to operate on.
5902 * @param {number} offset The offset where the block starts.
5903 *
5904 * @example
5905 *
5906 * mode.processBlock(data.words, offset);
5907 */
5908 processBlock: function (words, offset) {
5909 // Shortcuts
5910 var cipher = this._cipher;
5911 var blockSize = cipher.blockSize;
5912
5913 // XOR and encrypt
5914 xorBlock.call(this, words, offset, blockSize);
5915 cipher.encryptBlock(words, offset);
5916
5917 // Remember this block to use with next block
5918 this._prevBlock = words.slice(offset, offset + blockSize);
5919 }
5920 });
5921
5922 /**
5923 * CBC decryptor.
5924 */
5925 CBC.Decryptor = CBC.extend({
5926 /**
5927 * Processes the data block at offset.
5928 *
5929 * @param {Array} words The data words to operate on.
5930 * @param {number} offset The offset where the block starts.
5931 *
5932 * @example
5933 *
5934 * mode.processBlock(data.words, offset);
5935 */
5936 processBlock: function (words, offset) {
5937 // Shortcuts
5938 var cipher = this._cipher;
5939 var blockSize = cipher.blockSize;
5940
5941 // Remember this block to use with next block
5942 var thisBlock = words.slice(offset, offset + blockSize);
5943
5944 // Decrypt and XOR
5945 cipher.decryptBlock(words, offset);
5946 xorBlock.call(this, words, offset, blockSize);
5947
5948 // This block becomes the previous block
5949 this._prevBlock = thisBlock;
5950 }
5951 });
5952
5953 function xorBlock(words, offset, blockSize) {
5954 // Shortcut
5955 var iv = this._iv;
5956
5957 // Choose mixing block
5958 if (iv) {
5959 var block = iv;
5960
5961 // Remove IV for subsequent blocks
5962 this._iv = undefined;
5963 } else {
5964 var block = this._prevBlock;
5965 }
5966
5967 // XOR blocks
5968 for (var i = 0; i < blockSize; i++) {
5969 words[offset + i] ^= block[i];
5970 }
5971 }
5972
5973 return CBC;
5974 }());
5975
5976 /**
5977 * Padding namespace.
5978 */
5979 var C_pad = C.pad = {};
5980
5981 /**
5982 * PKCS #5/7 padding strategy.
5983 */
5984 var Pkcs7 = C_pad.Pkcs7 = {
5985 /**
5986 * Pads data using the algorithm defined in PKCS #5/7.
5987 *
5988 * @param {WordArray} data The data to pad.
5989 * @param {number} blockSize The multiple that the data should be padded to.
5990 *
5991 * @static
5992 *
5993 * @example
5994 *
5995 * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
5996 */
5997 pad: function (data, blockSize) {
5998 // Shortcut
5999 var blockSizeBytes = blockSize * 4;
6000
6001 // Count padding bytes
6002 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
6003
6004 // Create padding word
6005 var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
6006
6007 // Create padding
6008 var paddingWords = [];
6009 for (var i = 0; i < nPaddingBytes; i += 4) {
6010 paddingWords.push(paddingWord);
6011 }
6012 var padding = WordArray.create(paddingWords, nPaddingBytes);
6013
6014 // Add padding
6015 data.concat(padding);
6016 },
6017
6018 /**
6019 * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
6020 *
6021 * @param {WordArray} data The data to unpad.
6022 *
6023 * @static
6024 *
6025 * @example
6026 *
6027 * CryptoJS.pad.Pkcs7.unpad(wordArray);
6028 */
6029 unpad: function (data) {
6030 // Get number of padding bytes from last byte
6031 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
6032
6033 // Remove padding
6034 data.sigBytes -= nPaddingBytes;
6035 }
6036 };
6037
6038 /**
6039 * Abstract base block cipher template.
6040 *
6041 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
6042 */
6043 var BlockCipher = C_lib.BlockCipher = Cipher.extend({
6044 /**
6045 * Configuration options.
6046 *
6047 * @property {Mode} mode The block mode to use. Default: CBC
6048 * @property {Padding} padding The padding strategy to use. Default: Pkcs7
6049 */
6050 cfg: Cipher.cfg.extend({
6051 mode: CBC,
6052 padding: Pkcs7
6053 }),
6054
6055 reset: function () {
6056 // Reset cipher
6057 Cipher.reset.call(this);
6058
6059 // Shortcuts
6060 var cfg = this.cfg;
6061 var iv = cfg.iv;
6062 var mode = cfg.mode;
6063
6064 // Reset block mode
6065 if (this._xformMode == this._ENC_XFORM_MODE) {
6066 var modeCreator = mode.createEncryptor;
6067 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6068 var modeCreator = mode.createDecryptor;
6069
6070 // Keep at least one block in the buffer for unpadding
6071 this._minBufferSize = 1;
6072 }
6073 this._mode = modeCreator.call(mode, this, iv && iv.words);
6074 },
6075
6076 _doProcessBlock: function (words, offset) {
6077 this._mode.processBlock(words, offset);
6078 },
6079
6080 _doFinalize: function () {
6081 // Shortcut
6082 var padding = this.cfg.padding;
6083
6084 // Finalize
6085 if (this._xformMode == this._ENC_XFORM_MODE) {
6086 // Pad data
6087 padding.pad(this._data, this.blockSize);
6088
6089 // Process final blocks
6090 var finalProcessedBlocks = this._process(!!'flush');
6091 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6092 // Process final blocks
6093 var finalProcessedBlocks = this._process(!!'flush');
6094
6095 // Unpad data
6096 padding.unpad(finalProcessedBlocks);
6097 }
6098
6099 return finalProcessedBlocks;
6100 },
6101
6102 blockSize: 128/32
6103 });
6104
6105 /**
6106 * A collection of cipher parameters.
6107 *
6108 * @property {WordArray} ciphertext The raw ciphertext.
6109 * @property {WordArray} key The key to this ciphertext.
6110 * @property {WordArray} iv The IV used in the ciphering operation.
6111 * @property {WordArray} salt The salt used with a key derivation function.
6112 * @property {Cipher} algorithm The cipher algorithm.
6113 * @property {Mode} mode The block mode used in the ciphering operation.
6114 * @property {Padding} padding The padding scheme used in the ciphering operation.
6115 * @property {number} blockSize The block size of the cipher.
6116 * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
6117 */
6118 var CipherParams = C_lib.CipherParams = Base.extend({
6119 /**
6120 * Initializes a newly created cipher params object.
6121 *
6122 * @param {Object} cipherParams An object with any of the possible cipher parameters.
6123 *
6124 * @example
6125 *
6126 * var cipherParams = CryptoJS.lib.CipherParams.create({
6127 * ciphertext: ciphertextWordArray,
6128 * key: keyWordArray,
6129 * iv: ivWordArray,
6130 * salt: saltWordArray,
6131 * algorithm: CryptoJS.algo.AES,
6132 * mode: CryptoJS.mode.CBC,
6133 * padding: CryptoJS.pad.PKCS7,
6134 * blockSize: 4,
6135 * formatter: CryptoJS.format.OpenSSL
6136 * });
6137 */
6138 init: function (cipherParams) {
6139 this.mixIn(cipherParams);
6140 },
6141
6142 /**
6143 * Converts this cipher params object to a string.
6144 *
6145 * @param {Format} formatter (Optional) The formatting strategy to use.
6146 *
6147 * @return {string} The stringified cipher params.
6148 *
6149 * @throws Error If neither the formatter nor the default formatter is set.
6150 *
6151 * @example
6152 *
6153 * var string = cipherParams + '';
6154 * var string = cipherParams.toString();
6155 * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
6156 */
6157 toString: function (formatter) {
6158 return (formatter || this.formatter).stringify(this);
6159 }
6160 });
6161
6162 /**
6163 * Format namespace.
6164 */
6165 var C_format = C.format = {};
6166
6167 /**
6168 * OpenSSL formatting strategy.
6169 */
6170 var OpenSSLFormatter = C_format.OpenSSL = {
6171 /**
6172 * Converts a cipher params object to an OpenSSL-compatible string.
6173 *
6174 * @param {CipherParams} cipherParams The cipher params object.
6175 *
6176 * @return {string} The OpenSSL-compatible string.
6177 *
6178 * @static
6179 *
6180 * @example
6181 *
6182 * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
6183 */
6184 stringify: function (cipherParams) {
6185 // Shortcuts
6186 var ciphertext = cipherParams.ciphertext;
6187 var salt = cipherParams.salt;
6188
6189 // Format
6190 if (salt) {
6191 var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
6192 } else {
6193 var wordArray = ciphertext;
6194 }
6195
6196 return wordArray.toString(Base64);
6197 },
6198
6199 /**
6200 * Converts an OpenSSL-compatible string to a cipher params object.
6201 *
6202 * @param {string} openSSLStr The OpenSSL-compatible string.
6203 *
6204 * @return {CipherParams} The cipher params object.
6205 *
6206 * @static
6207 *
6208 * @example
6209 *
6210 * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
6211 */
6212 parse: function (openSSLStr) {
6213 // Parse base64
6214 var ciphertext = Base64.parse(openSSLStr);
6215
6216 // Shortcut
6217 var ciphertextWords = ciphertext.words;
6218
6219 // Test for salt
6220 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
6221 // Extract salt
6222 var salt = WordArray.create(ciphertextWords.slice(2, 4));
6223
6224 // Remove salt from ciphertext
6225 ciphertextWords.splice(0, 4);
6226 ciphertext.sigBytes -= 16;
6227 }
6228
6229 return CipherParams.create({ ciphertext: ciphertext, salt: salt });
6230 }
6231 };
6232
6233 /**
6234 * A cipher wrapper that returns ciphertext as a serializable cipher params object.
6235 */
6236 var SerializableCipher = C_lib.SerializableCipher = Base.extend({
6237 /**
6238 * Configuration options.
6239 *
6240 * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
6241 */
6242 cfg: Base.extend({
6243 format: OpenSSLFormatter
6244 }),
6245
6246 /**
6247 * Encrypts a message.
6248 *
6249 * @param {Cipher} cipher The cipher algorithm to use.
6250 * @param {WordArray|string} message The message to encrypt.
6251 * @param {WordArray} key The key.
6252 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6253 *
6254 * @return {CipherParams} A cipher params object.
6255 *
6256 * @static
6257 *
6258 * @example
6259 *
6260 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
6261 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
6262 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6263 */
6264 encrypt: function (cipher, message, key, cfg) {
6265 // Apply config defaults
6266 cfg = this.cfg.extend(cfg);
6267
6268 // Encrypt
6269 var encryptor = cipher.createEncryptor(key, cfg);
6270 var ciphertext = encryptor.finalize(message);
6271
6272 // Shortcut
6273 var cipherCfg = encryptor.cfg;
6274
6275 // Create and return serializable cipher params
6276 return CipherParams.create({
6277 ciphertext: ciphertext,
6278 key: key,
6279 iv: cipherCfg.iv,
6280 algorithm: cipher,
6281 mode: cipherCfg.mode,
6282 padding: cipherCfg.padding,
6283 blockSize: cipher.blockSize,
6284 formatter: cfg.format
6285 });
6286 },
6287
6288 /**
6289 * Decrypts serialized ciphertext.
6290 *
6291 * @param {Cipher} cipher The cipher algorithm to use.
6292 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6293 * @param {WordArray} key The key.
6294 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6295 *
6296 * @return {WordArray} The plaintext.
6297 *
6298 * @static
6299 *
6300 * @example
6301 *
6302 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6303 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6304 */
6305 decrypt: function (cipher, ciphertext, key, cfg) {
6306 // Apply config defaults
6307 cfg = this.cfg.extend(cfg);
6308
6309 // Convert string to CipherParams
6310 ciphertext = this._parse(ciphertext, cfg.format);
6311
6312 // Decrypt
6313 var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
6314
6315 return plaintext;
6316 },
6317
6318 /**
6319 * Converts serialized ciphertext to CipherParams,
6320 * else assumed CipherParams already and returns ciphertext unchanged.
6321 *
6322 * @param {CipherParams|string} ciphertext The ciphertext.
6323 * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
6324 *
6325 * @return {CipherParams} The unserialized ciphertext.
6326 *
6327 * @static
6328 *
6329 * @example
6330 *
6331 * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
6332 */
6333 _parse: function (ciphertext, format) {
6334 if (typeof ciphertext == 'string') {
6335 return format.parse(ciphertext, this);
6336 } else {
6337 return ciphertext;
6338 }
6339 }
6340 });
6341
6342 /**
6343 * Key derivation function namespace.
6344 */
6345 var C_kdf = C.kdf = {};
6346
6347 /**
6348 * OpenSSL key derivation function.
6349 */
6350 var OpenSSLKdf = C_kdf.OpenSSL = {
6351 /**
6352 * Derives a key and IV from a password.
6353 *
6354 * @param {string} password The password to derive from.
6355 * @param {number} keySize The size in words of the key to generate.
6356 * @param {number} ivSize The size in words of the IV to generate.
6357 * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
6358 *
6359 * @return {CipherParams} A cipher params object with the key, IV, and salt.
6360 *
6361 * @static
6362 *
6363 * @example
6364 *
6365 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
6366 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
6367 */
6368 execute: function (password, keySize, ivSize, salt) {
6369 // Generate random salt
6370 if (!salt) {
6371 salt = WordArray.random(64/8);
6372 }
6373
6374 // Derive key and IV
6375 var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
6376
6377 // Separate key and IV
6378 var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
6379 key.sigBytes = keySize * 4;
6380
6381 // Return params
6382 return CipherParams.create({ key: key, iv: iv, salt: salt });
6383 }
6384 };
6385
6386 /**
6387 * A serializable cipher wrapper that derives the key from a password,
6388 * and returns ciphertext as a serializable cipher params object.
6389 */
6390 var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
6391 /**
6392 * Configuration options.
6393 *
6394 * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
6395 */
6396 cfg: SerializableCipher.cfg.extend({
6397 kdf: OpenSSLKdf
6398 }),
6399
6400 /**
6401 * Encrypts a message using a password.
6402 *
6403 * @param {Cipher} cipher The cipher algorithm to use.
6404 * @param {WordArray|string} message The message to encrypt.
6405 * @param {string} password The password.
6406 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6407 *
6408 * @return {CipherParams} A cipher params object.
6409 *
6410 * @static
6411 *
6412 * @example
6413 *
6414 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
6415 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
6416 */
6417 encrypt: function (cipher, message, password, cfg) {
6418 // Apply config defaults
6419 cfg = this.cfg.extend(cfg);
6420
6421 // Derive key and other params
6422 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
6423
6424 // Add IV to config
6425 cfg.iv = derivedParams.iv;
6426
6427 // Encrypt
6428 var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
6429
6430 // Mix in derived params
6431 ciphertext.mixIn(derivedParams);
6432
6433 return ciphertext;
6434 },
6435
6436 /**
6437 * Decrypts serialized ciphertext using a password.
6438 *
6439 * @param {Cipher} cipher The cipher algorithm to use.
6440 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6441 * @param {string} password The password.
6442 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6443 *
6444 * @return {WordArray} The plaintext.
6445 *
6446 * @static
6447 *
6448 * @example
6449 *
6450 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
6451 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
6452 */
6453 decrypt: function (cipher, ciphertext, password, cfg) {
6454 // Apply config defaults
6455 cfg = this.cfg.extend(cfg);
6456
6457 // Convert string to CipherParams
6458 ciphertext = this._parse(ciphertext, cfg.format);
6459
6460 // Derive key and other params
6461 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
6462
6463 // Add IV to config
6464 cfg.iv = derivedParams.iv;
6465
6466 // Decrypt
6467 var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
6468
6469 return plaintext;
6470 }
6471 });
6472 }());
6473
6474
6475 }));
6476 },{"./core":31}],31:[function(_dereq_,module,exports){
6477 ;(function (root, factory) {
6478 if (typeof exports === "object") {
6479 // CommonJS
6480 module.exports = exports = factory();
6481 }
6482 else if (typeof define === "function" && define.amd) {
6483 // AMD
6484 define([], factory);
6485 }
6486 else {
6487 // Global (browser)
6488 root.CryptoJS = factory();
6489 }
6490 }(this, function () {
6491
6492 /**
6493 * CryptoJS core components.
6494 */
6495 var CryptoJS = CryptoJS || (function (Math, undefined) {
6496 /**
6497 * CryptoJS namespace.
6498 */
6499 var C = {};
6500
6501 /**
6502 * Library namespace.
6503 */
6504 var C_lib = C.lib = {};
6505
6506 /**
6507 * Base object for prototypal inheritance.
6508 */
6509 var Base = C_lib.Base = (function () {
6510 function F() {}
6511
6512 return {
6513 /**
6514 * Creates a new object that inherits from this object.
6515 *
6516 * @param {Object} overrides Properties to copy into the new object.
6517 *
6518 * @return {Object} The new object.
6519 *
6520 * @static
6521 *
6522 * @example
6523 *
6524 * var MyType = CryptoJS.lib.Base.extend({
6525 * field: 'value',
6526 *
6527 * method: function () {
6528 * }
6529 * });
6530 */
6531 extend: function (overrides) {
6532 // Spawn
6533 F.prototype = this;
6534 var subtype = new F();
6535
6536 // Augment
6537 if (overrides) {
6538 subtype.mixIn(overrides);
6539 }
6540
6541 // Create default initializer
6542 if (!subtype.hasOwnProperty('init')) {
6543 subtype.init = function () {
6544 subtype.$super.init.apply(this, arguments);
6545 };
6546 }
6547
6548 // Initializer's prototype is the subtype object
6549 subtype.init.prototype = subtype;
6550
6551 // Reference supertype
6552 subtype.$super = this;
6553
6554 return subtype;
6555 },
6556
6557 /**
6558 * Extends this object and runs the init method.
6559 * Arguments to create() will be passed to init().
6560 *
6561 * @return {Object} The new object.
6562 *
6563 * @static
6564 *
6565 * @example
6566 *
6567 * var instance = MyType.create();
6568 */
6569 create: function () {
6570 var instance = this.extend();
6571 instance.init.apply(instance, arguments);
6572
6573 return instance;
6574 },
6575
6576 /**
6577 * Initializes a newly created object.
6578 * Override this method to add some logic when your objects are created.
6579 *
6580 * @example
6581 *
6582 * var MyType = CryptoJS.lib.Base.extend({
6583 * init: function () {
6584 * // ...
6585 * }
6586 * });
6587 */
6588 init: function () {
6589 },
6590
6591 /**
6592 * Copies properties into this object.
6593 *
6594 * @param {Object} properties The properties to mix in.
6595 *
6596 * @example
6597 *
6598 * MyType.mixIn({
6599 * field: 'value'
6600 * });
6601 */
6602 mixIn: function (properties) {
6603 for (var propertyName in properties) {
6604 if (properties.hasOwnProperty(propertyName)) {
6605 this[propertyName] = properties[propertyName];
6606 }
6607 }
6608
6609 // IE won't copy toString using the loop above
6610 if (properties.hasOwnProperty('toString')) {
6611 this.toString = properties.toString;
6612 }
6613 },
6614
6615 /**
6616 * Creates a copy of this object.
6617 *
6618 * @return {Object} The clone.
6619 *
6620 * @example
6621 *
6622 * var clone = instance.clone();
6623 */
6624 clone: function () {
6625 return this.init.prototype.extend(this);
6626 }
6627 };
6628 }());
6629
6630 /**
6631 * An array of 32-bit words.
6632 *
6633 * @property {Array} words The array of 32-bit words.
6634 * @property {number} sigBytes The number of significant bytes in this word array.
6635 */
6636 var WordArray = C_lib.WordArray = Base.extend({
6637 /**
6638 * Initializes a newly created word array.
6639 *
6640 * @param {Array} words (Optional) An array of 32-bit words.
6641 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
6642 *
6643 * @example
6644 *
6645 * var wordArray = CryptoJS.lib.WordArray.create();
6646 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
6647 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
6648 */
6649 init: function (words, sigBytes) {
6650 words = this.words = words || [];
6651
6652 if (sigBytes != undefined) {
6653 this.sigBytes = sigBytes;
6654 } else {
6655 this.sigBytes = words.length * 4;
6656 }
6657 },
6658
6659 /**
6660 * Converts this word array to a string.
6661 *
6662 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
6663 *
6664 * @return {string} The stringified word array.
6665 *
6666 * @example
6667 *
6668 * var string = wordArray + '';
6669 * var string = wordArray.toString();
6670 * var string = wordArray.toString(CryptoJS.enc.Utf8);
6671 */
6672 toString: function (encoder) {
6673 return (encoder || Hex).stringify(this);
6674 },
6675
6676 /**
6677 * Concatenates a word array to this word array.
6678 *
6679 * @param {WordArray} wordArray The word array to append.
6680 *
6681 * @return {WordArray} This word array.
6682 *
6683 * @example
6684 *
6685 * wordArray1.concat(wordArray2);
6686 */
6687 concat: function (wordArray) {
6688 // Shortcuts
6689 var thisWords = this.words;
6690 var thatWords = wordArray.words;
6691 var thisSigBytes = this.sigBytes;
6692 var thatSigBytes = wordArray.sigBytes;
6693
6694 // Clamp excess bits
6695 this.clamp();
6696
6697 // Concat
6698 if (thisSigBytes % 4) {
6699 // Copy one byte at a time
6700 for (var i = 0; i < thatSigBytes; i++) {
6701 var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6702 thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
6703 }
6704 } else if (thatWords.length > 0xffff) {
6705 // Copy one word at a time
6706 for (var i = 0; i < thatSigBytes; i += 4) {
6707 thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
6708 }
6709 } else {
6710 // Copy all words at once
6711 thisWords.push.apply(thisWords, thatWords);
6712 }
6713 this.sigBytes += thatSigBytes;
6714
6715 // Chainable
6716 return this;
6717 },
6718
6719 /**
6720 * Removes insignificant bits.
6721 *
6722 * @example
6723 *
6724 * wordArray.clamp();
6725 */
6726 clamp: function () {
6727 // Shortcuts
6728 var words = this.words;
6729 var sigBytes = this.sigBytes;
6730
6731 // Clamp
6732 words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
6733 words.length = Math.ceil(sigBytes / 4);
6734 },
6735
6736 /**
6737 * Creates a copy of this word array.
6738 *
6739 * @return {WordArray} The clone.
6740 *
6741 * @example
6742 *
6743 * var clone = wordArray.clone();
6744 */
6745 clone: function () {
6746 var clone = Base.clone.call(this);
6747 clone.words = this.words.slice(0);
6748
6749 return clone;
6750 },
6751
6752 /**
6753 * Creates a word array filled with random bytes.
6754 *
6755 * @param {number} nBytes The number of random bytes to generate.
6756 *
6757 * @return {WordArray} The random word array.
6758 *
6759 * @static
6760 *
6761 * @example
6762 *
6763 * var wordArray = CryptoJS.lib.WordArray.random(16);
6764 */
6765 random: function (nBytes) {
6766 var words = [];
6767 for (var i = 0; i < nBytes; i += 4) {
6768 words.push((Math.random() * 0x100000000) | 0);
6769 }
6770
6771 return new WordArray.init(words, nBytes);
6772 }
6773 });
6774
6775 /**
6776 * Encoder namespace.
6777 */
6778 var C_enc = C.enc = {};
6779
6780 /**
6781 * Hex encoding strategy.
6782 */
6783 var Hex = C_enc.Hex = {
6784 /**
6785 * Converts a word array to a hex string.
6786 *
6787 * @param {WordArray} wordArray The word array.
6788 *
6789 * @return {string} The hex string.
6790 *
6791 * @static
6792 *
6793 * @example
6794 *
6795 * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
6796 */
6797 stringify: function (wordArray) {
6798 // Shortcuts
6799 var words = wordArray.words;
6800 var sigBytes = wordArray.sigBytes;
6801
6802 // Convert
6803 var hexChars = [];
6804 for (var i = 0; i < sigBytes; i++) {
6805 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6806 hexChars.push((bite >>> 4).toString(16));
6807 hexChars.push((bite & 0x0f).toString(16));
6808 }
6809
6810 return hexChars.join('');
6811 },
6812
6813 /**
6814 * Converts a hex string to a word array.
6815 *
6816 * @param {string} hexStr The hex string.
6817 *
6818 * @return {WordArray} The word array.
6819 *
6820 * @static
6821 *
6822 * @example
6823 *
6824 * var wordArray = CryptoJS.enc.Hex.parse(hexString);
6825 */
6826 parse: function (hexStr) {
6827 // Shortcut
6828 var hexStrLength = hexStr.length;
6829
6830 // Convert
6831 var words = [];
6832 for (var i = 0; i < hexStrLength; i += 2) {
6833 words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
6834 }
6835
6836 return new WordArray.init(words, hexStrLength / 2);
6837 }
6838 };
6839
6840 /**
6841 * Latin1 encoding strategy.
6842 */
6843 var Latin1 = C_enc.Latin1 = {
6844 /**
6845 * Converts a word array to a Latin1 string.
6846 *
6847 * @param {WordArray} wordArray The word array.
6848 *
6849 * @return {string} The Latin1 string.
6850 *
6851 * @static
6852 *
6853 * @example
6854 *
6855 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
6856 */
6857 stringify: function (wordArray) {
6858 // Shortcuts
6859 var words = wordArray.words;
6860 var sigBytes = wordArray.sigBytes;
6861
6862 // Convert
6863 var latin1Chars = [];
6864 for (var i = 0; i < sigBytes; i++) {
6865 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6866 latin1Chars.push(String.fromCharCode(bite));
6867 }
6868
6869 return latin1Chars.join('');
6870 },
6871
6872 /**
6873 * Converts a Latin1 string to a word array.
6874 *
6875 * @param {string} latin1Str The Latin1 string.
6876 *
6877 * @return {WordArray} The word array.
6878 *
6879 * @static
6880 *
6881 * @example
6882 *
6883 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
6884 */
6885 parse: function (latin1Str) {
6886 // Shortcut
6887 var latin1StrLength = latin1Str.length;
6888
6889 // Convert
6890 var words = [];
6891 for (var i = 0; i < latin1StrLength; i++) {
6892 words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
6893 }
6894
6895 return new WordArray.init(words, latin1StrLength);
6896 }
6897 };
6898
6899 /**
6900 * UTF-8 encoding strategy.
6901 */
6902 var Utf8 = C_enc.Utf8 = {
6903 /**
6904 * Converts a word array to a UTF-8 string.
6905 *
6906 * @param {WordArray} wordArray The word array.
6907 *
6908 * @return {string} The UTF-8 string.
6909 *
6910 * @static
6911 *
6912 * @example
6913 *
6914 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
6915 */
6916 stringify: function (wordArray) {
6917 try {
6918 return decodeURIComponent(escape(Latin1.stringify(wordArray)));
6919 } catch (e) {
6920 throw new Error('Malformed UTF-8 data');
6921 }
6922 },
6923
6924 /**
6925 * Converts a UTF-8 string to a word array.
6926 *
6927 * @param {string} utf8Str The UTF-8 string.
6928 *
6929 * @return {WordArray} The word array.
6930 *
6931 * @static
6932 *
6933 * @example
6934 *
6935 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
6936 */
6937 parse: function (utf8Str) {
6938 return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
6939 }
6940 };
6941
6942 /**
6943 * Abstract buffered block algorithm template.
6944 *
6945 * The property blockSize must be implemented in a concrete subtype.
6946 *
6947 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
6948 */
6949 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
6950 /**
6951 * Resets this block algorithm's data buffer to its initial state.
6952 *
6953 * @example
6954 *
6955 * bufferedBlockAlgorithm.reset();
6956 */
6957 reset: function () {
6958 // Initial values
6959 this._data = new WordArray.init();
6960 this._nDataBytes = 0;
6961 },
6962
6963 /**
6964 * Adds new data to this block algorithm's buffer.
6965 *
6966 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
6967 *
6968 * @example
6969 *
6970 * bufferedBlockAlgorithm._append('data');
6971 * bufferedBlockAlgorithm._append(wordArray);
6972 */
6973 _append: function (data) {
6974 // Convert string to WordArray, else assume WordArray already
6975 if (typeof data == 'string') {
6976 data = Utf8.parse(data);
6977 }
6978
6979 // Append
6980 this._data.concat(data);
6981 this._nDataBytes += data.sigBytes;
6982 },
6983
6984 /**
6985 * Processes available data blocks.
6986 *
6987 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
6988 *
6989 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
6990 *
6991 * @return {WordArray} The processed data.
6992 *
6993 * @example
6994 *
6995 * var processedData = bufferedBlockAlgorithm._process();
6996 * var processedData = bufferedBlockAlgorithm._process(!!'flush');
6997 */
6998 _process: function (doFlush) {
6999 // Shortcuts
7000 var data = this._data;
7001 var dataWords = data.words;
7002 var dataSigBytes = data.sigBytes;
7003 var blockSize = this.blockSize;
7004 var blockSizeBytes = blockSize * 4;
7005
7006 // Count blocks ready
7007 var nBlocksReady = dataSigBytes / blockSizeBytes;
7008 if (doFlush) {
7009 // Round up to include partial blocks
7010 nBlocksReady = Math.ceil(nBlocksReady);
7011 } else {
7012 // Round down to include only full blocks,
7013 // less the number of blocks that must remain in the buffer
7014 nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
7015 }
7016
7017 // Count words ready
7018 var nWordsReady = nBlocksReady * blockSize;
7019
7020 // Count bytes ready
7021 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
7022
7023 // Process blocks
7024 if (nWordsReady) {
7025 for (var offset = 0; offset < nWordsReady; offset += blockSize) {
7026 // Perform concrete-algorithm logic
7027 this._doProcessBlock(dataWords, offset);
7028 }
7029
7030 // Remove processed words
7031 var processedWords = dataWords.splice(0, nWordsReady);
7032 data.sigBytes -= nBytesReady;
7033 }
7034
7035 // Return processed words
7036 return new WordArray.init(processedWords, nBytesReady);
7037 },
7038
7039 /**
7040 * Creates a copy of this object.
7041 *
7042 * @return {Object} The clone.
7043 *
7044 * @example
7045 *
7046 * var clone = bufferedBlockAlgorithm.clone();
7047 */
7048 clone: function () {
7049 var clone = Base.clone.call(this);
7050 clone._data = this._data.clone();
7051
7052 return clone;
7053 },
7054
7055 _minBufferSize: 0
7056 });
7057
7058 /**
7059 * Abstract hasher template.
7060 *
7061 * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
7062 */
7063 var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
7064 /**
7065 * Configuration options.
7066 */
7067 cfg: Base.extend(),
7068
7069 /**
7070 * Initializes a newly created hasher.
7071 *
7072 * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
7073 *
7074 * @example
7075 *
7076 * var hasher = CryptoJS.algo.SHA256.create();
7077 */
7078 init: function (cfg) {
7079 // Apply config defaults
7080 this.cfg = this.cfg.extend(cfg);
7081
7082 // Set initial values
7083 this.reset();
7084 },
7085
7086 /**
7087 * Resets this hasher to its initial state.
7088 *
7089 * @example
7090 *
7091 * hasher.reset();
7092 */
7093 reset: function () {
7094 // Reset data buffer
7095 BufferedBlockAlgorithm.reset.call(this);
7096
7097 // Perform concrete-hasher logic
7098 this._doReset();
7099 },
7100
7101 /**
7102 * Updates this hasher with a message.
7103 *
7104 * @param {WordArray|string} messageUpdate The message to append.
7105 *
7106 * @return {Hasher} This hasher.
7107 *
7108 * @example
7109 *
7110 * hasher.update('message');
7111 * hasher.update(wordArray);
7112 */
7113 update: function (messageUpdate) {
7114 // Append
7115 this._append(messageUpdate);
7116
7117 // Update the hash
7118 this._process();
7119
7120 // Chainable
7121 return this;
7122 },
7123
7124 /**
7125 * Finalizes the hash computation.
7126 * Note that the finalize operation is effectively a destructive, read-once operation.
7127 *
7128 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7129 *
7130 * @return {WordArray} The hash.
7131 *
7132 * @example
7133 *
7134 * var hash = hasher.finalize();
7135 * var hash = hasher.finalize('message');
7136 * var hash = hasher.finalize(wordArray);
7137 */
7138 finalize: function (messageUpdate) {
7139 // Final message update
7140 if (messageUpdate) {
7141 this._append(messageUpdate);
7142 }
7143
7144 // Perform concrete-hasher logic
7145 var hash = this._doFinalize();
7146
7147 return hash;
7148 },
7149
7150 blockSize: 512/32,
7151
7152 /**
7153 * Creates a shortcut function to a hasher's object interface.
7154 *
7155 * @param {Hasher} hasher The hasher to create a helper for.
7156 *
7157 * @return {Function} The shortcut function.
7158 *
7159 * @static
7160 *
7161 * @example
7162 *
7163 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
7164 */
7165 _createHelper: function (hasher) {
7166 return function (message, cfg) {
7167 return new hasher.init(cfg).finalize(message);
7168 };
7169 },
7170
7171 /**
7172 * Creates a shortcut function to the HMAC's object interface.
7173 *
7174 * @param {Hasher} hasher The hasher to use in this HMAC helper.
7175 *
7176 * @return {Function} The shortcut function.
7177 *
7178 * @static
7179 *
7180 * @example
7181 *
7182 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
7183 */
7184 _createHmacHelper: function (hasher) {
7185 return function (message, key) {
7186 return new C_algo.HMAC.init(hasher, key).finalize(message);
7187 };
7188 }
7189 });
7190
7191 /**
7192 * Algorithm namespace.
7193 */
7194 var C_algo = C.algo = {};
7195
7196 return C;
7197 }(Math));
7198
7199
7200 return CryptoJS;
7201
7202 }));
7203 },{}],32:[function(_dereq_,module,exports){
7204 ;(function (root, factory) {
7205 if (typeof exports === "object") {
7206 // CommonJS
7207 module.exports = exports = factory(_dereq_("./core"));
7208 }
7209 else if (typeof define === "function" && define.amd) {
7210 // AMD
7211 define(["./core"], factory);
7212 }
7213 else {
7214 // Global (browser)
7215 factory(root.CryptoJS);
7216 }
7217 }(this, function (CryptoJS) {
7218
7219 (function () {
7220 // Shortcuts
7221 var C = CryptoJS;
7222 var C_lib = C.lib;
7223 var WordArray = C_lib.WordArray;
7224 var C_enc = C.enc;
7225
7226 /**
7227 * Base64 encoding strategy.
7228 */
7229 var Base64 = C_enc.Base64 = {
7230 /**
7231 * Converts a word array to a Base64 string.
7232 *
7233 * @param {WordArray} wordArray The word array.
7234 *
7235 * @return {string} The Base64 string.
7236 *
7237 * @static
7238 *
7239 * @example
7240 *
7241 * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
7242 */
7243 stringify: function (wordArray) {
7244 // Shortcuts
7245 var words = wordArray.words;
7246 var sigBytes = wordArray.sigBytes;
7247 var map = this._map;
7248
7249 // Clamp excess bits
7250 wordArray.clamp();
7251
7252 // Convert
7253 var base64Chars = [];
7254 for (var i = 0; i < sigBytes; i += 3) {
7255 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
7256 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
7257 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
7258
7259 var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
7260
7261 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
7262 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
7263 }
7264 }
7265
7266 // Add padding
7267 var paddingChar = map.charAt(64);
7268 if (paddingChar) {
7269 while (base64Chars.length % 4) {
7270 base64Chars.push(paddingChar);
7271 }
7272 }
7273
7274 return base64Chars.join('');
7275 },
7276
7277 /**
7278 * Converts a Base64 string to a word array.
7279 *
7280 * @param {string} base64Str The Base64 string.
7281 *
7282 * @return {WordArray} The word array.
7283 *
7284 * @static
7285 *
7286 * @example
7287 *
7288 * var wordArray = CryptoJS.enc.Base64.parse(base64String);
7289 */
7290 parse: function (base64Str) {
7291 // Shortcuts
7292 var base64StrLength = base64Str.length;
7293 var map = this._map;
7294
7295 // Ignore padding
7296 var paddingChar = map.charAt(64);
7297 if (paddingChar) {
7298 var paddingIndex = base64Str.indexOf(paddingChar);
7299 if (paddingIndex != -1) {
7300 base64StrLength = paddingIndex;
7301 }
7302 }
7303
7304 // Convert
7305 var words = [];
7306 var nBytes = 0;
7307 for (var i = 0; i < base64StrLength; i++) {
7308 if (i % 4) {
7309 var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
7310 var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
7311 words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
7312 nBytes++;
7313 }
7314 }
7315
7316 return WordArray.create(words, nBytes);
7317 },
7318
7319 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
7320 };
7321 }());
7322
7323
7324 return CryptoJS.enc.Base64;
7325
7326 }));
7327 },{"./core":31}],33:[function(_dereq_,module,exports){
7328 ;(function (root, factory) {
7329 if (typeof exports === "object") {
7330 // CommonJS
7331 module.exports = exports = factory(_dereq_("./core"));
7332 }
7333 else if (typeof define === "function" && define.amd) {
7334 // AMD
7335 define(["./core"], factory);
7336 }
7337 else {
7338 // Global (browser)
7339 factory(root.CryptoJS);
7340 }
7341 }(this, function (CryptoJS) {
7342
7343 (function () {
7344 // Shortcuts
7345 var C = CryptoJS;
7346 var C_lib = C.lib;
7347 var WordArray = C_lib.WordArray;
7348 var C_enc = C.enc;
7349
7350 /**
7351 * UTF-16 BE encoding strategy.
7352 */
7353 var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
7354 /**
7355 * Converts a word array to a UTF-16 BE string.
7356 *
7357 * @param {WordArray} wordArray The word array.
7358 *
7359 * @return {string} The UTF-16 BE string.
7360 *
7361 * @static
7362 *
7363 * @example
7364 *
7365 * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
7366 */
7367 stringify: function (wordArray) {
7368 // Shortcuts
7369 var words = wordArray.words;
7370 var sigBytes = wordArray.sigBytes;
7371
7372 // Convert
7373 var utf16Chars = [];
7374 for (var i = 0; i < sigBytes; i += 2) {
7375 var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
7376 utf16Chars.push(String.fromCharCode(codePoint));
7377 }
7378
7379 return utf16Chars.join('');
7380 },
7381
7382 /**
7383 * Converts a UTF-16 BE string to a word array.
7384 *
7385 * @param {string} utf16Str The UTF-16 BE string.
7386 *
7387 * @return {WordArray} The word array.
7388 *
7389 * @static
7390 *
7391 * @example
7392 *
7393 * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
7394 */
7395 parse: function (utf16Str) {
7396 // Shortcut
7397 var utf16StrLength = utf16Str.length;
7398
7399 // Convert
7400 var words = [];
7401 for (var i = 0; i < utf16StrLength; i++) {
7402 words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
7403 }
7404
7405 return WordArray.create(words, utf16StrLength * 2);
7406 }
7407 };
7408
7409 /**
7410 * UTF-16 LE encoding strategy.
7411 */
7412 C_enc.Utf16LE = {
7413 /**
7414 * Converts a word array to a UTF-16 LE string.
7415 *
7416 * @param {WordArray} wordArray The word array.
7417 *
7418 * @return {string} The UTF-16 LE string.
7419 *
7420 * @static
7421 *
7422 * @example
7423 *
7424 * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
7425 */
7426 stringify: function (wordArray) {
7427 // Shortcuts
7428 var words = wordArray.words;
7429 var sigBytes = wordArray.sigBytes;
7430
7431 // Convert
7432 var utf16Chars = [];
7433 for (var i = 0; i < sigBytes; i += 2) {
7434 var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
7435 utf16Chars.push(String.fromCharCode(codePoint));
7436 }
7437
7438 return utf16Chars.join('');
7439 },
7440
7441 /**
7442 * Converts a UTF-16 LE string to a word array.
7443 *
7444 * @param {string} utf16Str The UTF-16 LE string.
7445 *
7446 * @return {WordArray} The word array.
7447 *
7448 * @static
7449 *
7450 * @example
7451 *
7452 * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
7453 */
7454 parse: function (utf16Str) {
7455 // Shortcut
7456 var utf16StrLength = utf16Str.length;
7457
7458 // Convert
7459 var words = [];
7460 for (var i = 0; i < utf16StrLength; i++) {
7461 words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
7462 }
7463
7464 return WordArray.create(words, utf16StrLength * 2);
7465 }
7466 };
7467
7468 function swapEndian(word) {
7469 return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
7470 }
7471 }());
7472
7473
7474 return CryptoJS.enc.Utf16;
7475
7476 }));
7477 },{"./core":31}],34:[function(_dereq_,module,exports){
7478 ;(function (root, factory, undef) {
7479 if (typeof exports === "object") {
7480 // CommonJS
7481 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
7482 }
7483 else if (typeof define === "function" && define.amd) {
7484 // AMD
7485 define(["./core", "./sha1", "./hmac"], factory);
7486 }
7487 else {
7488 // Global (browser)
7489 factory(root.CryptoJS);
7490 }
7491 }(this, function (CryptoJS) {
7492
7493 (function () {
7494 // Shortcuts
7495 var C = CryptoJS;
7496 var C_lib = C.lib;
7497 var Base = C_lib.Base;
7498 var WordArray = C_lib.WordArray;
7499 var C_algo = C.algo;
7500 var MD5 = C_algo.MD5;
7501
7502 /**
7503 * This key derivation function is meant to conform with EVP_BytesToKey.
7504 * www.openssl.org/docs/crypto/EVP_BytesToKey.html
7505 */
7506 var EvpKDF = C_algo.EvpKDF = Base.extend({
7507 /**
7508 * Configuration options.
7509 *
7510 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
7511 * @property {Hasher} hasher The hash algorithm to use. Default: MD5
7512 * @property {number} iterations The number of iterations to perform. Default: 1
7513 */
7514 cfg: Base.extend({
7515 keySize: 128/32,
7516 hasher: MD5,
7517 iterations: 1
7518 }),
7519
7520 /**
7521 * Initializes a newly created key derivation function.
7522 *
7523 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
7524 *
7525 * @example
7526 *
7527 * var kdf = CryptoJS.algo.EvpKDF.create();
7528 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
7529 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
7530 */
7531 init: function (cfg) {
7532 this.cfg = this.cfg.extend(cfg);
7533 },
7534
7535 /**
7536 * Derives a key from a password.
7537 *
7538 * @param {WordArray|string} password The password.
7539 * @param {WordArray|string} salt A salt.
7540 *
7541 * @return {WordArray} The derived key.
7542 *
7543 * @example
7544 *
7545 * var key = kdf.compute(password, salt);
7546 */
7547 compute: function (password, salt) {
7548 // Shortcut
7549 var cfg = this.cfg;
7550
7551 // Init hasher
7552 var hasher = cfg.hasher.create();
7553
7554 // Initial values
7555 var derivedKey = WordArray.create();
7556
7557 // Shortcuts
7558 var derivedKeyWords = derivedKey.words;
7559 var keySize = cfg.keySize;
7560 var iterations = cfg.iterations;
7561
7562 // Generate key
7563 while (derivedKeyWords.length < keySize) {
7564 if (block) {
7565 hasher.update(block);
7566 }
7567 var block = hasher.update(password).finalize(salt);
7568 hasher.reset();
7569
7570 // Iterations
7571 for (var i = 1; i < iterations; i++) {
7572 block = hasher.finalize(block);
7573 hasher.reset();
7574 }
7575
7576 derivedKey.concat(block);
7577 }
7578 derivedKey.sigBytes = keySize * 4;
7579
7580 return derivedKey;
7581 }
7582 });
7583
7584 /**
7585 * Derives a key from a password.
7586 *
7587 * @param {WordArray|string} password The password.
7588 * @param {WordArray|string} salt A salt.
7589 * @param {Object} cfg (Optional) The configuration options to use for this computation.
7590 *
7591 * @return {WordArray} The derived key.
7592 *
7593 * @static
7594 *
7595 * @example
7596 *
7597 * var key = CryptoJS.EvpKDF(password, salt);
7598 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
7599 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
7600 */
7601 C.EvpKDF = function (password, salt, cfg) {
7602 return EvpKDF.create(cfg).compute(password, salt);
7603 };
7604 }());
7605
7606
7607 return CryptoJS.EvpKDF;
7608
7609 }));
7610 },{"./core":31,"./hmac":36,"./sha1":55}],35:[function(_dereq_,module,exports){
7611 ;(function (root, factory, undef) {
7612 if (typeof exports === "object") {
7613 // CommonJS
7614 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
7615 }
7616 else if (typeof define === "function" && define.amd) {
7617 // AMD
7618 define(["./core", "./cipher-core"], factory);
7619 }
7620 else {
7621 // Global (browser)
7622 factory(root.CryptoJS);
7623 }
7624 }(this, function (CryptoJS) {
7625
7626 (function (undefined) {
7627 // Shortcuts
7628 var C = CryptoJS;
7629 var C_lib = C.lib;
7630 var CipherParams = C_lib.CipherParams;
7631 var C_enc = C.enc;
7632 var Hex = C_enc.Hex;
7633 var C_format = C.format;
7634
7635 var HexFormatter = C_format.Hex = {
7636 /**
7637 * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
7638 *
7639 * @param {CipherParams} cipherParams The cipher params object.
7640 *
7641 * @return {string} The hexadecimally encoded string.
7642 *
7643 * @static
7644 *
7645 * @example
7646 *
7647 * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
7648 */
7649 stringify: function (cipherParams) {
7650 return cipherParams.ciphertext.toString(Hex);
7651 },
7652
7653 /**
7654 * Converts a hexadecimally encoded ciphertext string to a cipher params object.
7655 *
7656 * @param {string} input The hexadecimally encoded string.
7657 *
7658 * @return {CipherParams} The cipher params object.
7659 *
7660 * @static
7661 *
7662 * @example
7663 *
7664 * var cipherParams = CryptoJS.format.Hex.parse(hexString);
7665 */
7666 parse: function (input) {
7667 var ciphertext = Hex.parse(input);
7668 return CipherParams.create({ ciphertext: ciphertext });
7669 }
7670 };
7671 }());
7672
7673
7674 return CryptoJS.format.Hex;
7675
7676 }));
7677 },{"./cipher-core":30,"./core":31}],36:[function(_dereq_,module,exports){
7678 ;(function (root, factory) {
7679 if (typeof exports === "object") {
7680 // CommonJS
7681 module.exports = exports = factory(_dereq_("./core"));
7682 }
7683 else if (typeof define === "function" && define.amd) {
7684 // AMD
7685 define(["./core"], factory);
7686 }
7687 else {
7688 // Global (browser)
7689 factory(root.CryptoJS);
7690 }
7691 }(this, function (CryptoJS) {
7692
7693 (function () {
7694 // Shortcuts
7695 var C = CryptoJS;
7696 var C_lib = C.lib;
7697 var Base = C_lib.Base;
7698 var C_enc = C.enc;
7699 var Utf8 = C_enc.Utf8;
7700 var C_algo = C.algo;
7701
7702 /**
7703 * HMAC algorithm.
7704 */
7705 var HMAC = C_algo.HMAC = Base.extend({
7706 /**
7707 * Initializes a newly created HMAC.
7708 *
7709 * @param {Hasher} hasher The hash algorithm to use.
7710 * @param {WordArray|string} key The secret key.
7711 *
7712 * @example
7713 *
7714 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
7715 */
7716 init: function (hasher, key) {
7717 // Init hasher
7718 hasher = this._hasher = new hasher.init();
7719
7720 // Convert string to WordArray, else assume WordArray already
7721 if (typeof key == 'string') {
7722 key = Utf8.parse(key);
7723 }
7724
7725 // Shortcuts
7726 var hasherBlockSize = hasher.blockSize;
7727 var hasherBlockSizeBytes = hasherBlockSize * 4;
7728
7729 // Allow arbitrary length keys
7730 if (key.sigBytes > hasherBlockSizeBytes) {
7731 key = hasher.finalize(key);
7732 }
7733
7734 // Clamp excess bits
7735 key.clamp();
7736
7737 // Clone key for inner and outer pads
7738 var oKey = this._oKey = key.clone();
7739 var iKey = this._iKey = key.clone();
7740
7741 // Shortcuts
7742 var oKeyWords = oKey.words;
7743 var iKeyWords = iKey.words;
7744
7745 // XOR keys with pad constants
7746 for (var i = 0; i < hasherBlockSize; i++) {
7747 oKeyWords[i] ^= 0x5c5c5c5c;
7748 iKeyWords[i] ^= 0x36363636;
7749 }
7750 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
7751
7752 // Set initial values
7753 this.reset();
7754 },
7755
7756 /**
7757 * Resets this HMAC to its initial state.
7758 *
7759 * @example
7760 *
7761 * hmacHasher.reset();
7762 */
7763 reset: function () {
7764 // Shortcut
7765 var hasher = this._hasher;
7766
7767 // Reset
7768 hasher.reset();
7769 hasher.update(this._iKey);
7770 },
7771
7772 /**
7773 * Updates this HMAC with a message.
7774 *
7775 * @param {WordArray|string} messageUpdate The message to append.
7776 *
7777 * @return {HMAC} This HMAC instance.
7778 *
7779 * @example
7780 *
7781 * hmacHasher.update('message');
7782 * hmacHasher.update(wordArray);
7783 */
7784 update: function (messageUpdate) {
7785 this._hasher.update(messageUpdate);
7786
7787 // Chainable
7788 return this;
7789 },
7790
7791 /**
7792 * Finalizes the HMAC computation.
7793 * Note that the finalize operation is effectively a destructive, read-once operation.
7794 *
7795 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7796 *
7797 * @return {WordArray} The HMAC.
7798 *
7799 * @example
7800 *
7801 * var hmac = hmacHasher.finalize();
7802 * var hmac = hmacHasher.finalize('message');
7803 * var hmac = hmacHasher.finalize(wordArray);
7804 */
7805 finalize: function (messageUpdate) {
7806 // Shortcut
7807 var hasher = this._hasher;
7808
7809 // Compute HMAC
7810 var innerHash = hasher.finalize(messageUpdate);
7811 hasher.reset();
7812 var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
7813
7814 return hmac;
7815 }
7816 });
7817 }());
7818
7819
7820 }));
7821 },{"./core":31}],37:[function(_dereq_,module,exports){
7822 ;(function (root, factory, undef) {
7823 if (typeof exports === "object") {
7824 // CommonJS
7825 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"));
7826 }
7827 else if (typeof define === "function" && define.amd) {
7828 // AMD
7829 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);
7830 }
7831 else {
7832 // Global (browser)
7833 factory(root.CryptoJS);
7834 }
7835 }(this, function (CryptoJS) {
7836
7837 return CryptoJS;
7838
7839 }));
7840 },{"./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){
7841 ;(function (root, factory) {
7842 if (typeof exports === "object") {
7843 // CommonJS
7844 module.exports = exports = factory(_dereq_("./core"));
7845 }
7846 else if (typeof define === "function" && define.amd) {
7847 // AMD
7848 define(["./core"], factory);
7849 }
7850 else {
7851 // Global (browser)
7852 factory(root.CryptoJS);
7853 }
7854 }(this, function (CryptoJS) {
7855
7856 (function () {
7857 // Check if typed arrays are supported
7858 if (typeof ArrayBuffer != 'function') {
7859 return;
7860 }
7861
7862 // Shortcuts
7863 var C = CryptoJS;
7864 var C_lib = C.lib;
7865 var WordArray = C_lib.WordArray;
7866
7867 // Reference original init
7868 var superInit = WordArray.init;
7869
7870 // Augment WordArray.init to handle typed arrays
7871 var subInit = WordArray.init = function (typedArray) {
7872 // Convert buffers to uint8
7873 if (typedArray instanceof ArrayBuffer) {
7874 typedArray = new Uint8Array(typedArray);
7875 }
7876
7877 // Convert other array views to uint8
7878 if (
7879 typedArray instanceof Int8Array ||
7880 typedArray instanceof Uint8ClampedArray ||
7881 typedArray instanceof Int16Array ||
7882 typedArray instanceof Uint16Array ||
7883 typedArray instanceof Int32Array ||
7884 typedArray instanceof Uint32Array ||
7885 typedArray instanceof Float32Array ||
7886 typedArray instanceof Float64Array
7887 ) {
7888 typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
7889 }
7890
7891 // Handle Uint8Array
7892 if (typedArray instanceof Uint8Array) {
7893 // Shortcut
7894 var typedArrayByteLength = typedArray.byteLength;
7895
7896 // Extract bytes
7897 var words = [];
7898 for (var i = 0; i < typedArrayByteLength; i++) {
7899 words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
7900 }
7901
7902 // Initialize this word array
7903 superInit.call(this, words, typedArrayByteLength);
7904 } else {
7905 // Else call normal init
7906 superInit.apply(this, arguments);
7907 }
7908 };
7909
7910 subInit.prototype = WordArray;
7911 }());
7912
7913
7914 return CryptoJS.lib.WordArray;
7915
7916 }));
7917 },{"./core":31}],39:[function(_dereq_,module,exports){
7918 ;(function (root, factory) {
7919 if (typeof exports === "object") {
7920 // CommonJS
7921 module.exports = exports = factory(_dereq_("./core"));
7922 }
7923 else if (typeof define === "function" && define.amd) {
7924 // AMD
7925 define(["./core"], factory);
7926 }
7927 else {
7928 // Global (browser)
7929 factory(root.CryptoJS);
7930 }
7931 }(this, function (CryptoJS) {
7932
7933 (function (Math) {
7934 // Shortcuts
7935 var C = CryptoJS;
7936 var C_lib = C.lib;
7937 var WordArray = C_lib.WordArray;
7938 var Hasher = C_lib.Hasher;
7939 var C_algo = C.algo;
7940
7941 // Constants table
7942 var T = [];
7943
7944 // Compute constants
7945 (function () {
7946 for (var i = 0; i < 64; i++) {
7947 T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
7948 }
7949 }());
7950
7951 /**
7952 * MD5 hash algorithm.
7953 */
7954 var MD5 = C_algo.MD5 = Hasher.extend({
7955 _doReset: function () {
7956 this._hash = new WordArray.init([
7957 0x67452301, 0xefcdab89,
7958 0x98badcfe, 0x10325476
7959 ]);
7960 },
7961
7962 _doProcessBlock: function (M, offset) {
7963 // Swap endian
7964 for (var i = 0; i < 16; i++) {
7965 // Shortcuts
7966 var offset_i = offset + i;
7967 var M_offset_i = M[offset_i];
7968
7969 M[offset_i] = (
7970 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
7971 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
7972 );
7973 }
7974
7975 // Shortcuts
7976 var H = this._hash.words;
7977
7978 var M_offset_0 = M[offset + 0];
7979 var M_offset_1 = M[offset + 1];
7980 var M_offset_2 = M[offset + 2];
7981 var M_offset_3 = M[offset + 3];
7982 var M_offset_4 = M[offset + 4];
7983 var M_offset_5 = M[offset + 5];
7984 var M_offset_6 = M[offset + 6];
7985 var M_offset_7 = M[offset + 7];
7986 var M_offset_8 = M[offset + 8];
7987 var M_offset_9 = M[offset + 9];
7988 var M_offset_10 = M[offset + 10];
7989 var M_offset_11 = M[offset + 11];
7990 var M_offset_12 = M[offset + 12];
7991 var M_offset_13 = M[offset + 13];
7992 var M_offset_14 = M[offset + 14];
7993 var M_offset_15 = M[offset + 15];
7994
7995 // Working varialbes
7996 var a = H[0];
7997 var b = H[1];
7998 var c = H[2];
7999 var d = H[3];
8000
8001 // Computation
8002 a = FF(a, b, c, d, M_offset_0, 7, T[0]);
8003 d = FF(d, a, b, c, M_offset_1, 12, T[1]);
8004 c = FF(c, d, a, b, M_offset_2, 17, T[2]);
8005 b = FF(b, c, d, a, M_offset_3, 22, T[3]);
8006 a = FF(a, b, c, d, M_offset_4, 7, T[4]);
8007 d = FF(d, a, b, c, M_offset_5, 12, T[5]);
8008 c = FF(c, d, a, b, M_offset_6, 17, T[6]);
8009 b = FF(b, c, d, a, M_offset_7, 22, T[7]);
8010 a = FF(a, b, c, d, M_offset_8, 7, T[8]);
8011 d = FF(d, a, b, c, M_offset_9, 12, T[9]);
8012 c = FF(c, d, a, b, M_offset_10, 17, T[10]);
8013 b = FF(b, c, d, a, M_offset_11, 22, T[11]);
8014 a = FF(a, b, c, d, M_offset_12, 7, T[12]);
8015 d = FF(d, a, b, c, M_offset_13, 12, T[13]);
8016 c = FF(c, d, a, b, M_offset_14, 17, T[14]);
8017 b = FF(b, c, d, a, M_offset_15, 22, T[15]);
8018
8019 a = GG(a, b, c, d, M_offset_1, 5, T[16]);
8020 d = GG(d, a, b, c, M_offset_6, 9, T[17]);
8021 c = GG(c, d, a, b, M_offset_11, 14, T[18]);
8022 b = GG(b, c, d, a, M_offset_0, 20, T[19]);
8023 a = GG(a, b, c, d, M_offset_5, 5, T[20]);
8024 d = GG(d, a, b, c, M_offset_10, 9, T[21]);
8025 c = GG(c, d, a, b, M_offset_15, 14, T[22]);
8026 b = GG(b, c, d, a, M_offset_4, 20, T[23]);
8027 a = GG(a, b, c, d, M_offset_9, 5, T[24]);
8028 d = GG(d, a, b, c, M_offset_14, 9, T[25]);
8029 c = GG(c, d, a, b, M_offset_3, 14, T[26]);
8030 b = GG(b, c, d, a, M_offset_8, 20, T[27]);
8031 a = GG(a, b, c, d, M_offset_13, 5, T[28]);
8032 d = GG(d, a, b, c, M_offset_2, 9, T[29]);
8033 c = GG(c, d, a, b, M_offset_7, 14, T[30]);
8034 b = GG(b, c, d, a, M_offset_12, 20, T[31]);
8035
8036 a = HH(a, b, c, d, M_offset_5, 4, T[32]);
8037 d = HH(d, a, b, c, M_offset_8, 11, T[33]);
8038 c = HH(c, d, a, b, M_offset_11, 16, T[34]);
8039 b = HH(b, c, d, a, M_offset_14, 23, T[35]);
8040 a = HH(a, b, c, d, M_offset_1, 4, T[36]);
8041 d = HH(d, a, b, c, M_offset_4, 11, T[37]);
8042 c = HH(c, d, a, b, M_offset_7, 16, T[38]);
8043 b = HH(b, c, d, a, M_offset_10, 23, T[39]);
8044 a = HH(a, b, c, d, M_offset_13, 4, T[40]);
8045 d = HH(d, a, b, c, M_offset_0, 11, T[41]);
8046 c = HH(c, d, a, b, M_offset_3, 16, T[42]);
8047 b = HH(b, c, d, a, M_offset_6, 23, T[43]);
8048 a = HH(a, b, c, d, M_offset_9, 4, T[44]);
8049 d = HH(d, a, b, c, M_offset_12, 11, T[45]);
8050 c = HH(c, d, a, b, M_offset_15, 16, T[46]);
8051 b = HH(b, c, d, a, M_offset_2, 23, T[47]);
8052
8053 a = II(a, b, c, d, M_offset_0, 6, T[48]);
8054 d = II(d, a, b, c, M_offset_7, 10, T[49]);
8055 c = II(c, d, a, b, M_offset_14, 15, T[50]);
8056 b = II(b, c, d, a, M_offset_5, 21, T[51]);
8057 a = II(a, b, c, d, M_offset_12, 6, T[52]);
8058 d = II(d, a, b, c, M_offset_3, 10, T[53]);
8059 c = II(c, d, a, b, M_offset_10, 15, T[54]);
8060 b = II(b, c, d, a, M_offset_1, 21, T[55]);
8061 a = II(a, b, c, d, M_offset_8, 6, T[56]);
8062 d = II(d, a, b, c, M_offset_15, 10, T[57]);
8063 c = II(c, d, a, b, M_offset_6, 15, T[58]);
8064 b = II(b, c, d, a, M_offset_13, 21, T[59]);
8065 a = II(a, b, c, d, M_offset_4, 6, T[60]);
8066 d = II(d, a, b, c, M_offset_11, 10, T[61]);
8067 c = II(c, d, a, b, M_offset_2, 15, T[62]);
8068 b = II(b, c, d, a, M_offset_9, 21, T[63]);
8069
8070 // Intermediate hash value
8071 H[0] = (H[0] + a) | 0;
8072 H[1] = (H[1] + b) | 0;
8073 H[2] = (H[2] + c) | 0;
8074 H[3] = (H[3] + d) | 0;
8075 },
8076
8077 _doFinalize: function () {
8078 // Shortcuts
8079 var data = this._data;
8080 var dataWords = data.words;
8081
8082 var nBitsTotal = this._nDataBytes * 8;
8083 var nBitsLeft = data.sigBytes * 8;
8084
8085 // Add padding
8086 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
8087
8088 var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
8089 var nBitsTotalL = nBitsTotal;
8090 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
8091 (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
8092 (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
8093 );
8094 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
8095 (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
8096 (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
8097 );
8098
8099 data.sigBytes = (dataWords.length + 1) * 4;
8100
8101 // Hash final blocks
8102 this._process();
8103
8104 // Shortcuts
8105 var hash = this._hash;
8106 var H = hash.words;
8107
8108 // Swap endian
8109 for (var i = 0; i < 4; i++) {
8110 // Shortcut
8111 var H_i = H[i];
8112
8113 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
8114 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
8115 }
8116
8117 // Return final computed hash
8118 return hash;
8119 },
8120
8121 clone: function () {
8122 var clone = Hasher.clone.call(this);
8123 clone._hash = this._hash.clone();
8124
8125 return clone;
8126 }
8127 });
8128
8129 function FF(a, b, c, d, x, s, t) {
8130 var n = a + ((b & c) | (~b & d)) + x + t;
8131 return ((n << s) | (n >>> (32 - s))) + b;
8132 }
8133
8134 function GG(a, b, c, d, x, s, t) {
8135 var n = a + ((b & d) | (c & ~d)) + x + t;
8136 return ((n << s) | (n >>> (32 - s))) + b;
8137 }
8138
8139 function HH(a, b, c, d, x, s, t) {
8140 var n = a + (b ^ c ^ d) + x + t;
8141 return ((n << s) | (n >>> (32 - s))) + b;
8142 }
8143
8144 function II(a, b, c, d, x, s, t) {
8145 var n = a + (c ^ (b | ~d)) + x + t;
8146 return ((n << s) | (n >>> (32 - s))) + b;
8147 }
8148
8149 /**
8150 * Shortcut function to the hasher's object interface.
8151 *
8152 * @param {WordArray|string} message The message to hash.
8153 *
8154 * @return {WordArray} The hash.
8155 *
8156 * @static
8157 *
8158 * @example
8159 *
8160 * var hash = CryptoJS.MD5('message');
8161 * var hash = CryptoJS.MD5(wordArray);
8162 */
8163 C.MD5 = Hasher._createHelper(MD5);
8164
8165 /**
8166 * Shortcut function to the HMAC's object interface.
8167 *
8168 * @param {WordArray|string} message The message to hash.
8169 * @param {WordArray|string} key The secret key.
8170 *
8171 * @return {WordArray} The HMAC.
8172 *
8173 * @static
8174 *
8175 * @example
8176 *
8177 * var hmac = CryptoJS.HmacMD5(message, key);
8178 */
8179 C.HmacMD5 = Hasher._createHmacHelper(MD5);
8180 }(Math));
8181
8182
8183 return CryptoJS.MD5;
8184
8185 }));
8186 },{"./core":31}],40:[function(_dereq_,module,exports){
8187 ;(function (root, factory, undef) {
8188 if (typeof exports === "object") {
8189 // CommonJS
8190 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8191 }
8192 else if (typeof define === "function" && define.amd) {
8193 // AMD
8194 define(["./core", "./cipher-core"], factory);
8195 }
8196 else {
8197 // Global (browser)
8198 factory(root.CryptoJS);
8199 }
8200 }(this, function (CryptoJS) {
8201
8202 /**
8203 * Cipher Feedback block mode.
8204 */
8205 CryptoJS.mode.CFB = (function () {
8206 var CFB = CryptoJS.lib.BlockCipherMode.extend();
8207
8208 CFB.Encryptor = CFB.extend({
8209 processBlock: function (words, offset) {
8210 // Shortcuts
8211 var cipher = this._cipher;
8212 var blockSize = cipher.blockSize;
8213
8214 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8215
8216 // Remember this block to use with next block
8217 this._prevBlock = words.slice(offset, offset + blockSize);
8218 }
8219 });
8220
8221 CFB.Decryptor = CFB.extend({
8222 processBlock: function (words, offset) {
8223 // Shortcuts
8224 var cipher = this._cipher;
8225 var blockSize = cipher.blockSize;
8226
8227 // Remember this block to use with next block
8228 var thisBlock = words.slice(offset, offset + blockSize);
8229
8230 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8231
8232 // This block becomes the previous block
8233 this._prevBlock = thisBlock;
8234 }
8235 });
8236
8237 function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
8238 // Shortcut
8239 var iv = this._iv;
8240
8241 // Generate keystream
8242 if (iv) {
8243 var keystream = iv.slice(0);
8244
8245 // Remove IV for subsequent blocks
8246 this._iv = undefined;
8247 } else {
8248 var keystream = this._prevBlock;
8249 }
8250 cipher.encryptBlock(keystream, 0);
8251
8252 // Encrypt
8253 for (var i = 0; i < blockSize; i++) {
8254 words[offset + i] ^= keystream[i];
8255 }
8256 }
8257
8258 return CFB;
8259 }());
8260
8261
8262 return CryptoJS.mode.CFB;
8263
8264 }));
8265 },{"./cipher-core":30,"./core":31}],41:[function(_dereq_,module,exports){
8266 ;(function (root, factory, undef) {
8267 if (typeof exports === "object") {
8268 // CommonJS
8269 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8270 }
8271 else if (typeof define === "function" && define.amd) {
8272 // AMD
8273 define(["./core", "./cipher-core"], factory);
8274 }
8275 else {
8276 // Global (browser)
8277 factory(root.CryptoJS);
8278 }
8279 }(this, function (CryptoJS) {
8280
8281 /** @preserve
8282 * Counter block mode compatible with Dr Brian Gladman fileenc.c
8283 * derived from CryptoJS.mode.CTR
8284 * Jan Hruby jhruby.web@gmail.com
8285 */
8286 CryptoJS.mode.CTRGladman = (function () {
8287 var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
8288
8289 function incWord(word)
8290 {
8291 if (((word >> 24) & 0xff) === 0xff) { //overflow
8292 var b1 = (word >> 16)&0xff;
8293 var b2 = (word >> 8)&0xff;
8294 var b3 = word & 0xff;
8295
8296 if (b1 === 0xff) // overflow b1
8297 {
8298 b1 = 0;
8299 if (b2 === 0xff)
8300 {
8301 b2 = 0;
8302 if (b3 === 0xff)
8303 {
8304 b3 = 0;
8305 }
8306 else
8307 {
8308 ++b3;
8309 }
8310 }
8311 else
8312 {
8313 ++b2;
8314 }
8315 }
8316 else
8317 {
8318 ++b1;
8319 }
8320
8321 word = 0;
8322 word += (b1 << 16);
8323 word += (b2 << 8);
8324 word += b3;
8325 }
8326 else
8327 {
8328 word += (0x01 << 24);
8329 }
8330 return word;
8331 }
8332
8333 function incCounter(counter)
8334 {
8335 if ((counter[0] = incWord(counter[0])) === 0)
8336 {
8337 // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
8338 counter[1] = incWord(counter[1]);
8339 }
8340 return counter;
8341 }
8342
8343 var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
8344 processBlock: function (words, offset) {
8345 // Shortcuts
8346 var cipher = this._cipher
8347 var blockSize = cipher.blockSize;
8348 var iv = this._iv;
8349 var counter = this._counter;
8350
8351 // Generate keystream
8352 if (iv) {
8353 counter = this._counter = iv.slice(0);
8354
8355 // Remove IV for subsequent blocks
8356 this._iv = undefined;
8357 }
8358
8359 incCounter(counter);
8360
8361 var keystream = counter.slice(0);
8362 cipher.encryptBlock(keystream, 0);
8363
8364 // Encrypt
8365 for (var i = 0; i < blockSize; i++) {
8366 words[offset + i] ^= keystream[i];
8367 }
8368 }
8369 });
8370
8371 CTRGladman.Decryptor = Encryptor;
8372
8373 return CTRGladman;
8374 }());
8375
8376
8377
8378
8379 return CryptoJS.mode.CTRGladman;
8380
8381 }));
8382 },{"./cipher-core":30,"./core":31}],42:[function(_dereq_,module,exports){
8383 ;(function (root, factory, undef) {
8384 if (typeof exports === "object") {
8385 // CommonJS
8386 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8387 }
8388 else if (typeof define === "function" && define.amd) {
8389 // AMD
8390 define(["./core", "./cipher-core"], factory);
8391 }
8392 else {
8393 // Global (browser)
8394 factory(root.CryptoJS);
8395 }
8396 }(this, function (CryptoJS) {
8397
8398 /**
8399 * Counter block mode.
8400 */
8401 CryptoJS.mode.CTR = (function () {
8402 var CTR = CryptoJS.lib.BlockCipherMode.extend();
8403
8404 var Encryptor = CTR.Encryptor = CTR.extend({
8405 processBlock: function (words, offset) {
8406 // Shortcuts
8407 var cipher = this._cipher
8408 var blockSize = cipher.blockSize;
8409 var iv = this._iv;
8410 var counter = this._counter;
8411
8412 // Generate keystream
8413 if (iv) {
8414 counter = this._counter = iv.slice(0);
8415
8416 // Remove IV for subsequent blocks
8417 this._iv = undefined;
8418 }
8419 var keystream = counter.slice(0);
8420 cipher.encryptBlock(keystream, 0);
8421
8422 // Increment counter
8423 counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
8424
8425 // Encrypt
8426 for (var i = 0; i < blockSize; i++) {
8427 words[offset + i] ^= keystream[i];
8428 }
8429 }
8430 });
8431
8432 CTR.Decryptor = Encryptor;
8433
8434 return CTR;
8435 }());
8436
8437
8438 return CryptoJS.mode.CTR;
8439
8440 }));
8441 },{"./cipher-core":30,"./core":31}],43:[function(_dereq_,module,exports){
8442 ;(function (root, factory, undef) {
8443 if (typeof exports === "object") {
8444 // CommonJS
8445 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8446 }
8447 else if (typeof define === "function" && define.amd) {
8448 // AMD
8449 define(["./core", "./cipher-core"], factory);
8450 }
8451 else {
8452 // Global (browser)
8453 factory(root.CryptoJS);
8454 }
8455 }(this, function (CryptoJS) {
8456
8457 /**
8458 * Electronic Codebook block mode.
8459 */
8460 CryptoJS.mode.ECB = (function () {
8461 var ECB = CryptoJS.lib.BlockCipherMode.extend();
8462
8463 ECB.Encryptor = ECB.extend({
8464 processBlock: function (words, offset) {
8465 this._cipher.encryptBlock(words, offset);
8466 }
8467 });
8468
8469 ECB.Decryptor = ECB.extend({
8470 processBlock: function (words, offset) {
8471 this._cipher.decryptBlock(words, offset);
8472 }
8473 });
8474
8475 return ECB;
8476 }());
8477
8478
8479 return CryptoJS.mode.ECB;
8480
8481 }));
8482 },{"./cipher-core":30,"./core":31}],44:[function(_dereq_,module,exports){
8483 ;(function (root, factory, undef) {
8484 if (typeof exports === "object") {
8485 // CommonJS
8486 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8487 }
8488 else if (typeof define === "function" && define.amd) {
8489 // AMD
8490 define(["./core", "./cipher-core"], factory);
8491 }
8492 else {
8493 // Global (browser)
8494 factory(root.CryptoJS);
8495 }
8496 }(this, function (CryptoJS) {
8497
8498 /**
8499 * Output Feedback block mode.
8500 */
8501 CryptoJS.mode.OFB = (function () {
8502 var OFB = CryptoJS.lib.BlockCipherMode.extend();
8503
8504 var Encryptor = OFB.Encryptor = OFB.extend({
8505 processBlock: function (words, offset) {
8506 // Shortcuts
8507 var cipher = this._cipher
8508 var blockSize = cipher.blockSize;
8509 var iv = this._iv;
8510 var keystream = this._keystream;
8511
8512 // Generate keystream
8513 if (iv) {
8514 keystream = this._keystream = iv.slice(0);
8515
8516 // Remove IV for subsequent blocks
8517 this._iv = undefined;
8518 }
8519 cipher.encryptBlock(keystream, 0);
8520
8521 // Encrypt
8522 for (var i = 0; i < blockSize; i++) {
8523 words[offset + i] ^= keystream[i];
8524 }
8525 }
8526 });
8527
8528 OFB.Decryptor = Encryptor;
8529
8530 return OFB;
8531 }());
8532
8533
8534 return CryptoJS.mode.OFB;
8535
8536 }));
8537 },{"./cipher-core":30,"./core":31}],45:[function(_dereq_,module,exports){
8538 ;(function (root, factory, undef) {
8539 if (typeof exports === "object") {
8540 // CommonJS
8541 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8542 }
8543 else if (typeof define === "function" && define.amd) {
8544 // AMD
8545 define(["./core", "./cipher-core"], factory);
8546 }
8547 else {
8548 // Global (browser)
8549 factory(root.CryptoJS);
8550 }
8551 }(this, function (CryptoJS) {
8552
8553 /**
8554 * ANSI X.923 padding strategy.
8555 */
8556 CryptoJS.pad.AnsiX923 = {
8557 pad: function (data, blockSize) {
8558 // Shortcuts
8559 var dataSigBytes = data.sigBytes;
8560 var blockSizeBytes = blockSize * 4;
8561
8562 // Count padding bytes
8563 var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
8564
8565 // Compute last byte position
8566 var lastBytePos = dataSigBytes + nPaddingBytes - 1;
8567
8568 // Pad
8569 data.clamp();
8570 data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
8571 data.sigBytes += nPaddingBytes;
8572 },
8573
8574 unpad: function (data) {
8575 // Get number of padding bytes from last byte
8576 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8577
8578 // Remove padding
8579 data.sigBytes -= nPaddingBytes;
8580 }
8581 };
8582
8583
8584 return CryptoJS.pad.Ansix923;
8585
8586 }));
8587 },{"./cipher-core":30,"./core":31}],46:[function(_dereq_,module,exports){
8588 ;(function (root, factory, undef) {
8589 if (typeof exports === "object") {
8590 // CommonJS
8591 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8592 }
8593 else if (typeof define === "function" && define.amd) {
8594 // AMD
8595 define(["./core", "./cipher-core"], factory);
8596 }
8597 else {
8598 // Global (browser)
8599 factory(root.CryptoJS);
8600 }
8601 }(this, function (CryptoJS) {
8602
8603 /**
8604 * ISO 10126 padding strategy.
8605 */
8606 CryptoJS.pad.Iso10126 = {
8607 pad: function (data, blockSize) {
8608 // Shortcut
8609 var blockSizeBytes = blockSize * 4;
8610
8611 // Count padding bytes
8612 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
8613
8614 // Pad
8615 data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
8616 concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
8617 },
8618
8619 unpad: function (data) {
8620 // Get number of padding bytes from last byte
8621 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8622
8623 // Remove padding
8624 data.sigBytes -= nPaddingBytes;
8625 }
8626 };
8627
8628
8629 return CryptoJS.pad.Iso10126;
8630
8631 }));
8632 },{"./cipher-core":30,"./core":31}],47:[function(_dereq_,module,exports){
8633 ;(function (root, factory, undef) {
8634 if (typeof exports === "object") {
8635 // CommonJS
8636 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8637 }
8638 else if (typeof define === "function" && define.amd) {
8639 // AMD
8640 define(["./core", "./cipher-core"], factory);
8641 }
8642 else {
8643 // Global (browser)
8644 factory(root.CryptoJS);
8645 }
8646 }(this, function (CryptoJS) {
8647
8648 /**
8649 * ISO/IEC 9797-1 Padding Method 2.
8650 */
8651 CryptoJS.pad.Iso97971 = {
8652 pad: function (data, blockSize) {
8653 // Add 0x80 byte
8654 data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
8655
8656 // Zero pad the rest
8657 CryptoJS.pad.ZeroPadding.pad(data, blockSize);
8658 },
8659
8660 unpad: function (data) {
8661 // Remove zero padding
8662 CryptoJS.pad.ZeroPadding.unpad(data);
8663
8664 // Remove one more byte -- the 0x80 byte
8665 data.sigBytes--;
8666 }
8667 };
8668
8669
8670 return CryptoJS.pad.Iso97971;
8671
8672 }));
8673 },{"./cipher-core":30,"./core":31}],48:[function(_dereq_,module,exports){
8674 ;(function (root, factory, undef) {
8675 if (typeof exports === "object") {
8676 // CommonJS
8677 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8678 }
8679 else if (typeof define === "function" && define.amd) {
8680 // AMD
8681 define(["./core", "./cipher-core"], factory);
8682 }
8683 else {
8684 // Global (browser)
8685 factory(root.CryptoJS);
8686 }
8687 }(this, function (CryptoJS) {
8688
8689 /**
8690 * A noop padding strategy.
8691 */
8692 CryptoJS.pad.NoPadding = {
8693 pad: function () {
8694 },
8695
8696 unpad: function () {
8697 }
8698 };
8699
8700
8701 return CryptoJS.pad.NoPadding;
8702
8703 }));
8704 },{"./cipher-core":30,"./core":31}],49:[function(_dereq_,module,exports){
8705 ;(function (root, factory, undef) {
8706 if (typeof exports === "object") {
8707 // CommonJS
8708 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8709 }
8710 else if (typeof define === "function" && define.amd) {
8711 // AMD
8712 define(["./core", "./cipher-core"], factory);
8713 }
8714 else {
8715 // Global (browser)
8716 factory(root.CryptoJS);
8717 }
8718 }(this, function (CryptoJS) {
8719
8720 /**
8721 * Zero padding strategy.
8722 */
8723 CryptoJS.pad.ZeroPadding = {
8724 pad: function (data, blockSize) {
8725 // Shortcut
8726 var blockSizeBytes = blockSize * 4;
8727
8728 // Pad
8729 data.clamp();
8730 data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
8731 },
8732
8733 unpad: function (data) {
8734 // Shortcut
8735 var dataWords = data.words;
8736
8737 // Unpad
8738 var i = data.sigBytes - 1;
8739 while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
8740 i--;
8741 }
8742 data.sigBytes = i + 1;
8743 }
8744 };
8745
8746
8747 return CryptoJS.pad.ZeroPadding;
8748
8749 }));
8750 },{"./cipher-core":30,"./core":31}],50:[function(_dereq_,module,exports){
8751 ;(function (root, factory, undef) {
8752 if (typeof exports === "object") {
8753 // CommonJS
8754 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
8755 }
8756 else if (typeof define === "function" && define.amd) {
8757 // AMD
8758 define(["./core", "./sha1", "./hmac"], factory);
8759 }
8760 else {
8761 // Global (browser)
8762 factory(root.CryptoJS);
8763 }
8764 }(this, function (CryptoJS) {
8765
8766 (function () {
8767 // Shortcuts
8768 var C = CryptoJS;
8769 var C_lib = C.lib;
8770 var Base = C_lib.Base;
8771 var WordArray = C_lib.WordArray;
8772 var C_algo = C.algo;
8773 var SHA1 = C_algo.SHA1;
8774 var HMAC = C_algo.HMAC;
8775
8776 /**
8777 * Password-Based Key Derivation Function 2 algorithm.
8778 */
8779 var PBKDF2 = C_algo.PBKDF2 = Base.extend({
8780 /**
8781 * Configuration options.
8782 *
8783 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
8784 * @property {Hasher} hasher The hasher to use. Default: SHA1
8785 * @property {number} iterations The number of iterations to perform. Default: 1
8786 */
8787 cfg: Base.extend({
8788 keySize: 128/32,
8789 hasher: SHA1,
8790 iterations: 1
8791 }),
8792
8793 /**
8794 * Initializes a newly created key derivation function.
8795 *
8796 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
8797 *
8798 * @example
8799 *
8800 * var kdf = CryptoJS.algo.PBKDF2.create();
8801 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
8802 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
8803 */
8804 init: function (cfg) {
8805 this.cfg = this.cfg.extend(cfg);
8806 },
8807
8808 /**
8809 * Computes the Password-Based Key Derivation Function 2.
8810 *
8811 * @param {WordArray|string} password The password.
8812 * @param {WordArray|string} salt A salt.
8813 *
8814 * @return {WordArray} The derived key.
8815 *
8816 * @example
8817 *
8818 * var key = kdf.compute(password, salt);
8819 */
8820 compute: function (password, salt) {
8821 // Shortcut
8822 var cfg = this.cfg;
8823
8824 // Init HMAC
8825 var hmac = HMAC.create(cfg.hasher, password);
8826
8827 // Initial values
8828 var derivedKey = WordArray.create();
8829 var blockIndex = WordArray.create([0x00000001]);
8830
8831 // Shortcuts
8832 var derivedKeyWords = derivedKey.words;
8833 var blockIndexWords = blockIndex.words;
8834 var keySize = cfg.keySize;
8835 var iterations = cfg.iterations;
8836
8837 // Generate key
8838 while (derivedKeyWords.length < keySize) {
8839 var block = hmac.update(salt).finalize(blockIndex);
8840 hmac.reset();
8841
8842 // Shortcuts
8843 var blockWords = block.words;
8844 var blockWordsLength = blockWords.length;
8845
8846 // Iterations
8847 var intermediate = block;
8848 for (var i = 1; i < iterations; i++) {
8849 intermediate = hmac.finalize(intermediate);
8850 hmac.reset();
8851
8852 // Shortcut
8853 var intermediateWords = intermediate.words;
8854
8855 // XOR intermediate with block
8856 for (var j = 0; j < blockWordsLength; j++) {
8857 blockWords[j] ^= intermediateWords[j];
8858 }
8859 }
8860
8861 derivedKey.concat(block);
8862 blockIndexWords[0]++;
8863 }
8864 derivedKey.sigBytes = keySize * 4;
8865
8866 return derivedKey;
8867 }
8868 });
8869
8870 /**
8871 * Computes the Password-Based Key Derivation Function 2.
8872 *
8873 * @param {WordArray|string} password The password.
8874 * @param {WordArray|string} salt A salt.
8875 * @param {Object} cfg (Optional) The configuration options to use for this computation.
8876 *
8877 * @return {WordArray} The derived key.
8878 *
8879 * @static
8880 *
8881 * @example
8882 *
8883 * var key = CryptoJS.PBKDF2(password, salt);
8884 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
8885 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
8886 */
8887 C.PBKDF2 = function (password, salt, cfg) {
8888 return PBKDF2.create(cfg).compute(password, salt);
8889 };
8890 }());
8891
8892
8893 return CryptoJS.PBKDF2;
8894
8895 }));
8896 },{"./core":31,"./hmac":36,"./sha1":55}],51:[function(_dereq_,module,exports){
8897 ;(function (root, factory, undef) {
8898 if (typeof exports === "object") {
8899 // CommonJS
8900 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
8901 }
8902 else if (typeof define === "function" && define.amd) {
8903 // AMD
8904 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
8905 }
8906 else {
8907 // Global (browser)
8908 factory(root.CryptoJS);
8909 }
8910 }(this, function (CryptoJS) {
8911
8912 (function () {
8913 // Shortcuts
8914 var C = CryptoJS;
8915 var C_lib = C.lib;
8916 var StreamCipher = C_lib.StreamCipher;
8917 var C_algo = C.algo;
8918
8919 // Reusable objects
8920 var S = [];
8921 var C_ = [];
8922 var G = [];
8923
8924 /**
8925 * Rabbit stream cipher algorithm.
8926 *
8927 * This is a legacy version that neglected to convert the key to little-endian.
8928 * This error doesn't affect the cipher's security,
8929 * but it does affect its compatibility with other implementations.
8930 */
8931 var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
8932 _doReset: function () {
8933 // Shortcuts
8934 var K = this._key.words;
8935 var iv = this.cfg.iv;
8936
8937 // Generate initial state values
8938 var X = this._X = [
8939 K[0], (K[3] << 16) | (K[2] >>> 16),
8940 K[1], (K[0] << 16) | (K[3] >>> 16),
8941 K[2], (K[1] << 16) | (K[0] >>> 16),
8942 K[3], (K[2] << 16) | (K[1] >>> 16)
8943 ];
8944
8945 // Generate initial counter values
8946 var C = this._C = [
8947 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
8948 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
8949 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
8950 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
8951 ];
8952
8953 // Carry bit
8954 this._b = 0;
8955
8956 // Iterate the system four times
8957 for (var i = 0; i < 4; i++) {
8958 nextState.call(this);
8959 }
8960
8961 // Modify the counters
8962 for (var i = 0; i < 8; i++) {
8963 C[i] ^= X[(i + 4) & 7];
8964 }
8965
8966 // IV setup
8967 if (iv) {
8968 // Shortcuts
8969 var IV = iv.words;
8970 var IV_0 = IV[0];
8971 var IV_1 = IV[1];
8972
8973 // Generate four subvectors
8974 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
8975 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
8976 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
8977 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
8978
8979 // Modify counter values
8980 C[0] ^= i0;
8981 C[1] ^= i1;
8982 C[2] ^= i2;
8983 C[3] ^= i3;
8984 C[4] ^= i0;
8985 C[5] ^= i1;
8986 C[6] ^= i2;
8987 C[7] ^= i3;
8988
8989 // Iterate the system four times
8990 for (var i = 0; i < 4; i++) {
8991 nextState.call(this);
8992 }
8993 }
8994 },
8995
8996 _doProcessBlock: function (M, offset) {
8997 // Shortcut
8998 var X = this._X;
8999
9000 // Iterate the system
9001 nextState.call(this);
9002
9003 // Generate four keystream words
9004 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
9005 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
9006 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
9007 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
9008
9009 for (var i = 0; i < 4; i++) {
9010 // Swap endian
9011 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
9012 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
9013
9014 // Encrypt
9015 M[offset + i] ^= S[i];
9016 }
9017 },
9018
9019 blockSize: 128/32,
9020
9021 ivSize: 64/32
9022 });
9023
9024 function nextState() {
9025 // Shortcuts
9026 var X = this._X;
9027 var C = this._C;
9028
9029 // Save old counter values
9030 for (var i = 0; i < 8; i++) {
9031 C_[i] = C[i];
9032 }
9033
9034 // Calculate new counter values
9035 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
9036 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
9037 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
9038 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
9039 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
9040 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
9041 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
9042 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
9043 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
9044
9045 // Calculate the g-values
9046 for (var i = 0; i < 8; i++) {
9047 var gx = X[i] + C[i];
9048
9049 // Construct high and low argument for squaring
9050 var ga = gx & 0xffff;
9051 var gb = gx >>> 16;
9052
9053 // Calculate high and low result of squaring
9054 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
9055 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
9056
9057 // High XOR low
9058 G[i] = gh ^ gl;
9059 }
9060
9061 // Calculate new state values
9062 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
9063 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
9064 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
9065 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
9066 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9067 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9068 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9069 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9070 }
9071
9072 /**
9073 * Shortcut functions to the cipher's object interface.
9074 *
9075 * @example
9076 *
9077 * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
9078 * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
9079 */
9080 C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
9081 }());
9082
9083
9084 return CryptoJS.RabbitLegacy;
9085
9086 }));
9087 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],52:[function(_dereq_,module,exports){
9088 ;(function (root, factory, undef) {
9089 if (typeof exports === "object") {
9090 // CommonJS
9091 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9092 }
9093 else if (typeof define === "function" && define.amd) {
9094 // AMD
9095 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9096 }
9097 else {
9098 // Global (browser)
9099 factory(root.CryptoJS);
9100 }
9101 }(this, function (CryptoJS) {
9102
9103 (function () {
9104 // Shortcuts
9105 var C = CryptoJS;
9106 var C_lib = C.lib;
9107 var StreamCipher = C_lib.StreamCipher;
9108 var C_algo = C.algo;
9109
9110 // Reusable objects
9111 var S = [];
9112 var C_ = [];
9113 var G = [];
9114
9115 /**
9116 * Rabbit stream cipher algorithm
9117 */
9118 var Rabbit = C_algo.Rabbit = StreamCipher.extend({
9119 _doReset: function () {
9120 // Shortcuts
9121 var K = this._key.words;
9122 var iv = this.cfg.iv;
9123
9124 // Swap endian
9125 for (var i = 0; i < 4; i++) {
9126 K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
9127 (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
9128 }
9129
9130 // Generate initial state values
9131 var X = this._X = [
9132 K[0], (K[3] << 16) | (K[2] >>> 16),
9133 K[1], (K[0] << 16) | (K[3] >>> 16),
9134 K[2], (K[1] << 16) | (K[0] >>> 16),
9135 K[3], (K[2] << 16) | (K[1] >>> 16)
9136 ];
9137
9138 // Generate initial counter values
9139 var C = this._C = [
9140 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
9141 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
9142 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
9143 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
9144 ];
9145
9146 // Carry bit
9147 this._b = 0;
9148
9149 // Iterate the system four times
9150 for (var i = 0; i < 4; i++) {
9151 nextState.call(this);
9152 }
9153
9154 // Modify the counters
9155 for (var i = 0; i < 8; i++) {
9156 C[i] ^= X[(i + 4) & 7];
9157 }
9158
9159 // IV setup
9160 if (iv) {
9161 // Shortcuts
9162 var IV = iv.words;
9163 var IV_0 = IV[0];
9164 var IV_1 = IV[1];
9165
9166 // Generate four subvectors
9167 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
9168 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
9169 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
9170 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
9171
9172 // Modify counter values
9173 C[0] ^= i0;
9174 C[1] ^= i1;
9175 C[2] ^= i2;
9176 C[3] ^= i3;
9177 C[4] ^= i0;
9178 C[5] ^= i1;
9179 C[6] ^= i2;
9180 C[7] ^= i3;
9181
9182 // Iterate the system four times
9183 for (var i = 0; i < 4; i++) {
9184 nextState.call(this);
9185 }
9186 }
9187 },
9188
9189 _doProcessBlock: function (M, offset) {
9190 // Shortcut
9191 var X = this._X;
9192
9193 // Iterate the system
9194 nextState.call(this);
9195
9196 // Generate four keystream words
9197 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
9198 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
9199 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
9200 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
9201
9202 for (var i = 0; i < 4; i++) {
9203 // Swap endian
9204 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
9205 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
9206
9207 // Encrypt
9208 M[offset + i] ^= S[i];
9209 }
9210 },
9211
9212 blockSize: 128/32,
9213
9214 ivSize: 64/32
9215 });
9216
9217 function nextState() {
9218 // Shortcuts
9219 var X = this._X;
9220 var C = this._C;
9221
9222 // Save old counter values
9223 for (var i = 0; i < 8; i++) {
9224 C_[i] = C[i];
9225 }
9226
9227 // Calculate new counter values
9228 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
9229 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
9230 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
9231 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
9232 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
9233 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
9234 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
9235 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
9236 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
9237
9238 // Calculate the g-values
9239 for (var i = 0; i < 8; i++) {
9240 var gx = X[i] + C[i];
9241
9242 // Construct high and low argument for squaring
9243 var ga = gx & 0xffff;
9244 var gb = gx >>> 16;
9245
9246 // Calculate high and low result of squaring
9247 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
9248 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
9249
9250 // High XOR low
9251 G[i] = gh ^ gl;
9252 }
9253
9254 // Calculate new state values
9255 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
9256 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
9257 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
9258 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
9259 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9260 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9261 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9262 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9263 }
9264
9265 /**
9266 * Shortcut functions to the cipher's object interface.
9267 *
9268 * @example
9269 *
9270 * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
9271 * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
9272 */
9273 C.Rabbit = StreamCipher._createHelper(Rabbit);
9274 }());
9275
9276
9277 return CryptoJS.Rabbit;
9278
9279 }));
9280 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],53:[function(_dereq_,module,exports){
9281 ;(function (root, factory, undef) {
9282 if (typeof exports === "object") {
9283 // CommonJS
9284 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9285 }
9286 else if (typeof define === "function" && define.amd) {
9287 // AMD
9288 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9289 }
9290 else {
9291 // Global (browser)
9292 factory(root.CryptoJS);
9293 }
9294 }(this, function (CryptoJS) {
9295
9296 (function () {
9297 // Shortcuts
9298 var C = CryptoJS;
9299 var C_lib = C.lib;
9300 var StreamCipher = C_lib.StreamCipher;
9301 var C_algo = C.algo;
9302
9303 /**
9304 * RC4 stream cipher algorithm.
9305 */
9306 var RC4 = C_algo.RC4 = StreamCipher.extend({
9307 _doReset: function () {
9308 // Shortcuts
9309 var key = this._key;
9310 var keyWords = key.words;
9311 var keySigBytes = key.sigBytes;
9312
9313 // Init sbox
9314 var S = this._S = [];
9315 for (var i = 0; i < 256; i++) {
9316 S[i] = i;
9317 }
9318
9319 // Key setup
9320 for (var i = 0, j = 0; i < 256; i++) {
9321 var keyByteIndex = i % keySigBytes;
9322 var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
9323
9324 j = (j + S[i] + keyByte) % 256;
9325
9326 // Swap
9327 var t = S[i];
9328 S[i] = S[j];
9329 S[j] = t;
9330 }
9331
9332 // Counters
9333 this._i = this._j = 0;
9334 },
9335
9336 _doProcessBlock: function (M, offset) {
9337 M[offset] ^= generateKeystreamWord.call(this);
9338 },
9339
9340 keySize: 256/32,
9341
9342 ivSize: 0
9343 });
9344
9345 function generateKeystreamWord() {
9346 // Shortcuts
9347 var S = this._S;
9348 var i = this._i;
9349 var j = this._j;
9350
9351 // Generate keystream word
9352 var keystreamWord = 0;
9353 for (var n = 0; n < 4; n++) {
9354 i = (i + 1) % 256;
9355 j = (j + S[i]) % 256;
9356
9357 // Swap
9358 var t = S[i];
9359 S[i] = S[j];
9360 S[j] = t;
9361
9362 keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
9363 }
9364
9365 // Update counters
9366 this._i = i;
9367 this._j = j;
9368
9369 return keystreamWord;
9370 }
9371
9372 /**
9373 * Shortcut functions to the cipher's object interface.
9374 *
9375 * @example
9376 *
9377 * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
9378 * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
9379 */
9380 C.RC4 = StreamCipher._createHelper(RC4);
9381
9382 /**
9383 * Modified RC4 stream cipher algorithm.
9384 */
9385 var RC4Drop = C_algo.RC4Drop = RC4.extend({
9386 /**
9387 * Configuration options.
9388 *
9389 * @property {number} drop The number of keystream words to drop. Default 192
9390 */
9391 cfg: RC4.cfg.extend({
9392 drop: 192
9393 }),
9394
9395 _doReset: function () {
9396 RC4._doReset.call(this);
9397
9398 // Drop
9399 for (var i = this.cfg.drop; i > 0; i--) {
9400 generateKeystreamWord.call(this);
9401 }
9402 }
9403 });
9404
9405 /**
9406 * Shortcut functions to the cipher's object interface.
9407 *
9408 * @example
9409 *
9410 * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
9411 * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
9412 */
9413 C.RC4Drop = StreamCipher._createHelper(RC4Drop);
9414 }());
9415
9416
9417 return CryptoJS.RC4;
9418
9419 }));
9420 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],54:[function(_dereq_,module,exports){
9421 ;(function (root, factory) {
9422 if (typeof exports === "object") {
9423 // CommonJS
9424 module.exports = exports = factory(_dereq_("./core"));
9425 }
9426 else if (typeof define === "function" && define.amd) {
9427 // AMD
9428 define(["./core"], factory);
9429 }
9430 else {
9431 // Global (browser)
9432 factory(root.CryptoJS);
9433 }
9434 }(this, function (CryptoJS) {
9435
9436 /** @preserve
9437 (c) 2012 by Cédric Mesnil. All rights reserved.
9438
9439 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9440
9441 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9442 - 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.
9443
9444 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.
9445 */
9446
9447 (function (Math) {
9448 // Shortcuts
9449 var C = CryptoJS;
9450 var C_lib = C.lib;
9451 var WordArray = C_lib.WordArray;
9452 var Hasher = C_lib.Hasher;
9453 var C_algo = C.algo;
9454
9455 // Constants table
9456 var _zl = WordArray.create([
9457 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
9458 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
9459 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
9460 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
9461 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
9462 var _zr = WordArray.create([
9463 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
9464 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
9465 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
9466 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
9467 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
9468 var _sl = WordArray.create([
9469 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
9470 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
9471 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
9472 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9473 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
9474 var _sr = WordArray.create([
9475 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9476 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9477 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
9478 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
9479 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
9480
9481 var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
9482 var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
9483
9484 /**
9485 * RIPEMD160 hash algorithm.
9486 */
9487 var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
9488 _doReset: function () {
9489 this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
9490 },
9491
9492 _doProcessBlock: function (M, offset) {
9493
9494 // Swap endian
9495 for (var i = 0; i < 16; i++) {
9496 // Shortcuts
9497 var offset_i = offset + i;
9498 var M_offset_i = M[offset_i];
9499
9500 // Swap
9501 M[offset_i] = (
9502 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
9503 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
9504 );
9505 }
9506 // Shortcut
9507 var H = this._hash.words;
9508 var hl = _hl.words;
9509 var hr = _hr.words;
9510 var zl = _zl.words;
9511 var zr = _zr.words;
9512 var sl = _sl.words;
9513 var sr = _sr.words;
9514
9515 // Working variables
9516 var al, bl, cl, dl, el;
9517 var ar, br, cr, dr, er;
9518
9519 ar = al = H[0];
9520 br = bl = H[1];
9521 cr = cl = H[2];
9522 dr = dl = H[3];
9523 er = el = H[4];
9524 // Computation
9525 var t;
9526 for (var i = 0; i < 80; i += 1) {
9527 t = (al + M[offset+zl[i]])|0;
9528 if (i<16){
9529 t += f1(bl,cl,dl) + hl[0];
9530 } else if (i<32) {
9531 t += f2(bl,cl,dl) + hl[1];
9532 } else if (i<48) {
9533 t += f3(bl,cl,dl) + hl[2];
9534 } else if (i<64) {
9535 t += f4(bl,cl,dl) + hl[3];
9536 } else {// if (i<80) {
9537 t += f5(bl,cl,dl) + hl[4];
9538 }
9539 t = t|0;
9540 t = rotl(t,sl[i]);
9541 t = (t+el)|0;
9542 al = el;
9543 el = dl;
9544 dl = rotl(cl, 10);
9545 cl = bl;
9546 bl = t;
9547
9548 t = (ar + M[offset+zr[i]])|0;
9549 if (i<16){
9550 t += f5(br,cr,dr) + hr[0];
9551 } else if (i<32) {
9552 t += f4(br,cr,dr) + hr[1];
9553 } else if (i<48) {
9554 t += f3(br,cr,dr) + hr[2];
9555 } else if (i<64) {
9556 t += f2(br,cr,dr) + hr[3];
9557 } else {// if (i<80) {
9558 t += f1(br,cr,dr) + hr[4];
9559 }
9560 t = t|0;
9561 t = rotl(t,sr[i]) ;
9562 t = (t+er)|0;
9563 ar = er;
9564 er = dr;
9565 dr = rotl(cr, 10);
9566 cr = br;
9567 br = t;
9568 }
9569 // Intermediate hash value
9570 t = (H[1] + cl + dr)|0;
9571 H[1] = (H[2] + dl + er)|0;
9572 H[2] = (H[3] + el + ar)|0;
9573 H[3] = (H[4] + al + br)|0;
9574 H[4] = (H[0] + bl + cr)|0;
9575 H[0] = t;
9576 },
9577
9578 _doFinalize: function () {
9579 // Shortcuts
9580 var data = this._data;
9581 var dataWords = data.words;
9582
9583 var nBitsTotal = this._nDataBytes * 8;
9584 var nBitsLeft = data.sigBytes * 8;
9585
9586 // Add padding
9587 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9588 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
9589 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
9590 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
9591 );
9592 data.sigBytes = (dataWords.length + 1) * 4;
9593
9594 // Hash final blocks
9595 this._process();
9596
9597 // Shortcuts
9598 var hash = this._hash;
9599 var H = hash.words;
9600
9601 // Swap endian
9602 for (var i = 0; i < 5; i++) {
9603 // Shortcut
9604 var H_i = H[i];
9605
9606 // Swap
9607 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
9608 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
9609 }
9610
9611 // Return final computed hash
9612 return hash;
9613 },
9614
9615 clone: function () {
9616 var clone = Hasher.clone.call(this);
9617 clone._hash = this._hash.clone();
9618
9619 return clone;
9620 }
9621 });
9622
9623
9624 function f1(x, y, z) {
9625 return ((x) ^ (y) ^ (z));
9626
9627 }
9628
9629 function f2(x, y, z) {
9630 return (((x)&(y)) | ((~x)&(z)));
9631 }
9632
9633 function f3(x, y, z) {
9634 return (((x) | (~(y))) ^ (z));
9635 }
9636
9637 function f4(x, y, z) {
9638 return (((x) & (z)) | ((y)&(~(z))));
9639 }
9640
9641 function f5(x, y, z) {
9642 return ((x) ^ ((y) |(~(z))));
9643
9644 }
9645
9646 function rotl(x,n) {
9647 return (x<<n) | (x>>>(32-n));
9648 }
9649
9650
9651 /**
9652 * Shortcut function to the hasher's object interface.
9653 *
9654 * @param {WordArray|string} message The message to hash.
9655 *
9656 * @return {WordArray} The hash.
9657 *
9658 * @static
9659 *
9660 * @example
9661 *
9662 * var hash = CryptoJS.RIPEMD160('message');
9663 * var hash = CryptoJS.RIPEMD160(wordArray);
9664 */
9665 C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
9666
9667 /**
9668 * Shortcut function to the HMAC's object interface.
9669 *
9670 * @param {WordArray|string} message The message to hash.
9671 * @param {WordArray|string} key The secret key.
9672 *
9673 * @return {WordArray} The HMAC.
9674 *
9675 * @static
9676 *
9677 * @example
9678 *
9679 * var hmac = CryptoJS.HmacRIPEMD160(message, key);
9680 */
9681 C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
9682 }(Math));
9683
9684
9685 return CryptoJS.RIPEMD160;
9686
9687 }));
9688 },{"./core":31}],55:[function(_dereq_,module,exports){
9689 ;(function (root, factory) {
9690 if (typeof exports === "object") {
9691 // CommonJS
9692 module.exports = exports = factory(_dereq_("./core"));
9693 }
9694 else if (typeof define === "function" && define.amd) {
9695 // AMD
9696 define(["./core"], factory);
9697 }
9698 else {
9699 // Global (browser)
9700 factory(root.CryptoJS);
9701 }
9702 }(this, function (CryptoJS) {
9703
9704 (function () {
9705 // Shortcuts
9706 var C = CryptoJS;
9707 var C_lib = C.lib;
9708 var WordArray = C_lib.WordArray;
9709 var Hasher = C_lib.Hasher;
9710 var C_algo = C.algo;
9711
9712 // Reusable object
9713 var W = [];
9714
9715 /**
9716 * SHA-1 hash algorithm.
9717 */
9718 var SHA1 = C_algo.SHA1 = Hasher.extend({
9719 _doReset: function () {
9720 this._hash = new WordArray.init([
9721 0x67452301, 0xefcdab89,
9722 0x98badcfe, 0x10325476,
9723 0xc3d2e1f0
9724 ]);
9725 },
9726
9727 _doProcessBlock: function (M, offset) {
9728 // Shortcut
9729 var H = this._hash.words;
9730
9731 // Working variables
9732 var a = H[0];
9733 var b = H[1];
9734 var c = H[2];
9735 var d = H[3];
9736 var e = H[4];
9737
9738 // Computation
9739 for (var i = 0; i < 80; i++) {
9740 if (i < 16) {
9741 W[i] = M[offset + i] | 0;
9742 } else {
9743 var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
9744 W[i] = (n << 1) | (n >>> 31);
9745 }
9746
9747 var t = ((a << 5) | (a >>> 27)) + e + W[i];
9748 if (i < 20) {
9749 t += ((b & c) | (~b & d)) + 0x5a827999;
9750 } else if (i < 40) {
9751 t += (b ^ c ^ d) + 0x6ed9eba1;
9752 } else if (i < 60) {
9753 t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
9754 } else /* if (i < 80) */ {
9755 t += (b ^ c ^ d) - 0x359d3e2a;
9756 }
9757
9758 e = d;
9759 d = c;
9760 c = (b << 30) | (b >>> 2);
9761 b = a;
9762 a = t;
9763 }
9764
9765 // Intermediate hash value
9766 H[0] = (H[0] + a) | 0;
9767 H[1] = (H[1] + b) | 0;
9768 H[2] = (H[2] + c) | 0;
9769 H[3] = (H[3] + d) | 0;
9770 H[4] = (H[4] + e) | 0;
9771 },
9772
9773 _doFinalize: function () {
9774 // Shortcuts
9775 var data = this._data;
9776 var dataWords = data.words;
9777
9778 var nBitsTotal = this._nDataBytes * 8;
9779 var nBitsLeft = data.sigBytes * 8;
9780
9781 // Add padding
9782 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9783 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
9784 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
9785 data.sigBytes = dataWords.length * 4;
9786
9787 // Hash final blocks
9788 this._process();
9789
9790 // Return final computed hash
9791 return this._hash;
9792 },
9793
9794 clone: function () {
9795 var clone = Hasher.clone.call(this);
9796 clone._hash = this._hash.clone();
9797
9798 return clone;
9799 }
9800 });
9801
9802 /**
9803 * Shortcut function to the hasher's object interface.
9804 *
9805 * @param {WordArray|string} message The message to hash.
9806 *
9807 * @return {WordArray} The hash.
9808 *
9809 * @static
9810 *
9811 * @example
9812 *
9813 * var hash = CryptoJS.SHA1('message');
9814 * var hash = CryptoJS.SHA1(wordArray);
9815 */
9816 C.SHA1 = Hasher._createHelper(SHA1);
9817
9818 /**
9819 * Shortcut function to the HMAC's object interface.
9820 *
9821 * @param {WordArray|string} message The message to hash.
9822 * @param {WordArray|string} key The secret key.
9823 *
9824 * @return {WordArray} The HMAC.
9825 *
9826 * @static
9827 *
9828 * @example
9829 *
9830 * var hmac = CryptoJS.HmacSHA1(message, key);
9831 */
9832 C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
9833 }());
9834
9835
9836 return CryptoJS.SHA1;
9837
9838 }));
9839 },{"./core":31}],56:[function(_dereq_,module,exports){
9840 ;(function (root, factory, undef) {
9841 if (typeof exports === "object") {
9842 // CommonJS
9843 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha256"));
9844 }
9845 else if (typeof define === "function" && define.amd) {
9846 // AMD
9847 define(["./core", "./sha256"], factory);
9848 }
9849 else {
9850 // Global (browser)
9851 factory(root.CryptoJS);
9852 }
9853 }(this, function (CryptoJS) {
9854
9855 (function () {
9856 // Shortcuts
9857 var C = CryptoJS;
9858 var C_lib = C.lib;
9859 var WordArray = C_lib.WordArray;
9860 var C_algo = C.algo;
9861 var SHA256 = C_algo.SHA256;
9862
9863 /**
9864 * SHA-224 hash algorithm.
9865 */
9866 var SHA224 = C_algo.SHA224 = SHA256.extend({
9867 _doReset: function () {
9868 this._hash = new WordArray.init([
9869 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
9870 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
9871 ]);
9872 },
9873
9874 _doFinalize: function () {
9875 var hash = SHA256._doFinalize.call(this);
9876
9877 hash.sigBytes -= 4;
9878
9879 return hash;
9880 }
9881 });
9882
9883 /**
9884 * Shortcut function to the hasher's object interface.
9885 *
9886 * @param {WordArray|string} message The message to hash.
9887 *
9888 * @return {WordArray} The hash.
9889 *
9890 * @static
9891 *
9892 * @example
9893 *
9894 * var hash = CryptoJS.SHA224('message');
9895 * var hash = CryptoJS.SHA224(wordArray);
9896 */
9897 C.SHA224 = SHA256._createHelper(SHA224);
9898
9899 /**
9900 * Shortcut function to the HMAC's object interface.
9901 *
9902 * @param {WordArray|string} message The message to hash.
9903 * @param {WordArray|string} key The secret key.
9904 *
9905 * @return {WordArray} The HMAC.
9906 *
9907 * @static
9908 *
9909 * @example
9910 *
9911 * var hmac = CryptoJS.HmacSHA224(message, key);
9912 */
9913 C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
9914 }());
9915
9916
9917 return CryptoJS.SHA224;
9918
9919 }));
9920 },{"./core":31,"./sha256":57}],57:[function(_dereq_,module,exports){
9921 ;(function (root, factory) {
9922 if (typeof exports === "object") {
9923 // CommonJS
9924 module.exports = exports = factory(_dereq_("./core"));
9925 }
9926 else if (typeof define === "function" && define.amd) {
9927 // AMD
9928 define(["./core"], factory);
9929 }
9930 else {
9931 // Global (browser)
9932 factory(root.CryptoJS);
9933 }
9934 }(this, function (CryptoJS) {
9935
9936 (function (Math) {
9937 // Shortcuts
9938 var C = CryptoJS;
9939 var C_lib = C.lib;
9940 var WordArray = C_lib.WordArray;
9941 var Hasher = C_lib.Hasher;
9942 var C_algo = C.algo;
9943
9944 // Initialization and round constants tables
9945 var H = [];
9946 var K = [];
9947
9948 // Compute constants
9949 (function () {
9950 function isPrime(n) {
9951 var sqrtN = Math.sqrt(n);
9952 for (var factor = 2; factor <= sqrtN; factor++) {
9953 if (!(n % factor)) {
9954 return false;
9955 }
9956 }
9957
9958 return true;
9959 }
9960
9961 function getFractionalBits(n) {
9962 return ((n - (n | 0)) * 0x100000000) | 0;
9963 }
9964
9965 var n = 2;
9966 var nPrime = 0;
9967 while (nPrime < 64) {
9968 if (isPrime(n)) {
9969 if (nPrime < 8) {
9970 H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
9971 }
9972 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
9973
9974 nPrime++;
9975 }
9976
9977 n++;
9978 }
9979 }());
9980
9981 // Reusable object
9982 var W = [];
9983
9984 /**
9985 * SHA-256 hash algorithm.
9986 */
9987 var SHA256 = C_algo.SHA256 = Hasher.extend({
9988 _doReset: function () {
9989 this._hash = new WordArray.init(H.slice(0));
9990 },
9991
9992 _doProcessBlock: function (M, offset) {
9993 // Shortcut
9994 var H = this._hash.words;
9995
9996 // Working variables
9997 var a = H[0];
9998 var b = H[1];
9999 var c = H[2];
10000 var d = H[3];
10001 var e = H[4];
10002 var f = H[5];
10003 var g = H[6];
10004 var h = H[7];
10005
10006 // Computation
10007 for (var i = 0; i < 64; i++) {
10008 if (i < 16) {
10009 W[i] = M[offset + i] | 0;
10010 } else {
10011 var gamma0x = W[i - 15];
10012 var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
10013 ((gamma0x << 14) | (gamma0x >>> 18)) ^
10014 (gamma0x >>> 3);
10015
10016 var gamma1x = W[i - 2];
10017 var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
10018 ((gamma1x << 13) | (gamma1x >>> 19)) ^
10019 (gamma1x >>> 10);
10020
10021 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
10022 }
10023
10024 var ch = (e & f) ^ (~e & g);
10025 var maj = (a & b) ^ (a & c) ^ (b & c);
10026
10027 var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
10028 var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
10029
10030 var t1 = h + sigma1 + ch + K[i] + W[i];
10031 var t2 = sigma0 + maj;
10032
10033 h = g;
10034 g = f;
10035 f = e;
10036 e = (d + t1) | 0;
10037 d = c;
10038 c = b;
10039 b = a;
10040 a = (t1 + t2) | 0;
10041 }
10042
10043 // Intermediate hash value
10044 H[0] = (H[0] + a) | 0;
10045 H[1] = (H[1] + b) | 0;
10046 H[2] = (H[2] + c) | 0;
10047 H[3] = (H[3] + d) | 0;
10048 H[4] = (H[4] + e) | 0;
10049 H[5] = (H[5] + f) | 0;
10050 H[6] = (H[6] + g) | 0;
10051 H[7] = (H[7] + h) | 0;
10052 },
10053
10054 _doFinalize: function () {
10055 // Shortcuts
10056 var data = this._data;
10057 var dataWords = data.words;
10058
10059 var nBitsTotal = this._nDataBytes * 8;
10060 var nBitsLeft = data.sigBytes * 8;
10061
10062 // Add padding
10063 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
10064 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
10065 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
10066 data.sigBytes = dataWords.length * 4;
10067
10068 // Hash final blocks
10069 this._process();
10070
10071 // Return final computed hash
10072 return this._hash;
10073 },
10074
10075 clone: function () {
10076 var clone = Hasher.clone.call(this);
10077 clone._hash = this._hash.clone();
10078
10079 return clone;
10080 }
10081 });
10082
10083 /**
10084 * Shortcut function to the hasher's object interface.
10085 *
10086 * @param {WordArray|string} message The message to hash.
10087 *
10088 * @return {WordArray} The hash.
10089 *
10090 * @static
10091 *
10092 * @example
10093 *
10094 * var hash = CryptoJS.SHA256('message');
10095 * var hash = CryptoJS.SHA256(wordArray);
10096 */
10097 C.SHA256 = Hasher._createHelper(SHA256);
10098
10099 /**
10100 * Shortcut function to the HMAC's object interface.
10101 *
10102 * @param {WordArray|string} message The message to hash.
10103 * @param {WordArray|string} key The secret key.
10104 *
10105 * @return {WordArray} The HMAC.
10106 *
10107 * @static
10108 *
10109 * @example
10110 *
10111 * var hmac = CryptoJS.HmacSHA256(message, key);
10112 */
10113 C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
10114 }(Math));
10115
10116
10117 return CryptoJS.SHA256;
10118
10119 }));
10120 },{"./core":31}],58:[function(_dereq_,module,exports){
10121 ;(function (root, factory, undef) {
10122 if (typeof exports === "object") {
10123 // CommonJS
10124 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10125 }
10126 else if (typeof define === "function" && define.amd) {
10127 // AMD
10128 define(["./core", "./x64-core"], factory);
10129 }
10130 else {
10131 // Global (browser)
10132 factory(root.CryptoJS);
10133 }
10134 }(this, function (CryptoJS) {
10135
10136 (function (Math) {
10137 // Shortcuts
10138 var C = CryptoJS;
10139 var C_lib = C.lib;
10140 var WordArray = C_lib.WordArray;
10141 var Hasher = C_lib.Hasher;
10142 var C_x64 = C.x64;
10143 var X64Word = C_x64.Word;
10144 var C_algo = C.algo;
10145
10146 // Constants tables
10147 var RHO_OFFSETS = [];
10148 var PI_INDEXES = [];
10149 var ROUND_CONSTANTS = [];
10150
10151 // Compute Constants
10152 (function () {
10153 // Compute rho offset constants
10154 var x = 1, y = 0;
10155 for (var t = 0; t < 24; t++) {
10156 RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
10157
10158 var newX = y % 5;
10159 var newY = (2 * x + 3 * y) % 5;
10160 x = newX;
10161 y = newY;
10162 }
10163
10164 // Compute pi index constants
10165 for (var x = 0; x < 5; x++) {
10166 for (var y = 0; y < 5; y++) {
10167 PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
10168 }
10169 }
10170
10171 // Compute round constants
10172 var LFSR = 0x01;
10173 for (var i = 0; i < 24; i++) {
10174 var roundConstantMsw = 0;
10175 var roundConstantLsw = 0;
10176
10177 for (var j = 0; j < 7; j++) {
10178 if (LFSR & 0x01) {
10179 var bitPosition = (1 << j) - 1;
10180 if (bitPosition < 32) {
10181 roundConstantLsw ^= 1 << bitPosition;
10182 } else /* if (bitPosition >= 32) */ {
10183 roundConstantMsw ^= 1 << (bitPosition - 32);
10184 }
10185 }
10186
10187 // Compute next LFSR
10188 if (LFSR & 0x80) {
10189 // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
10190 LFSR = (LFSR << 1) ^ 0x71;
10191 } else {
10192 LFSR <<= 1;
10193 }
10194 }
10195
10196 ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
10197 }
10198 }());
10199
10200 // Reusable objects for temporary values
10201 var T = [];
10202 (function () {
10203 for (var i = 0; i < 25; i++) {
10204 T[i] = X64Word.create();
10205 }
10206 }());
10207
10208 /**
10209 * SHA-3 hash algorithm.
10210 */
10211 var SHA3 = C_algo.SHA3 = Hasher.extend({
10212 /**
10213 * Configuration options.
10214 *
10215 * @property {number} outputLength
10216 * The desired number of bits in the output hash.
10217 * Only values permitted are: 224, 256, 384, 512.
10218 * Default: 512
10219 */
10220 cfg: Hasher.cfg.extend({
10221 outputLength: 512
10222 }),
10223
10224 _doReset: function () {
10225 var state = this._state = []
10226 for (var i = 0; i < 25; i++) {
10227 state[i] = new X64Word.init();
10228 }
10229
10230 this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
10231 },
10232
10233 _doProcessBlock: function (M, offset) {
10234 // Shortcuts
10235 var state = this._state;
10236 var nBlockSizeLanes = this.blockSize / 2;
10237
10238 // Absorb
10239 for (var i = 0; i < nBlockSizeLanes; i++) {
10240 // Shortcuts
10241 var M2i = M[offset + 2 * i];
10242 var M2i1 = M[offset + 2 * i + 1];
10243
10244 // Swap endian
10245 M2i = (
10246 (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
10247 (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
10248 );
10249 M2i1 = (
10250 (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
10251 (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
10252 );
10253
10254 // Absorb message into state
10255 var lane = state[i];
10256 lane.high ^= M2i1;
10257 lane.low ^= M2i;
10258 }
10259
10260 // Rounds
10261 for (var round = 0; round < 24; round++) {
10262 // Theta
10263 for (var x = 0; x < 5; x++) {
10264 // Mix column lanes
10265 var tMsw = 0, tLsw = 0;
10266 for (var y = 0; y < 5; y++) {
10267 var lane = state[x + 5 * y];
10268 tMsw ^= lane.high;
10269 tLsw ^= lane.low;
10270 }
10271
10272 // Temporary values
10273 var Tx = T[x];
10274 Tx.high = tMsw;
10275 Tx.low = tLsw;
10276 }
10277 for (var x = 0; x < 5; x++) {
10278 // Shortcuts
10279 var Tx4 = T[(x + 4) % 5];
10280 var Tx1 = T[(x + 1) % 5];
10281 var Tx1Msw = Tx1.high;
10282 var Tx1Lsw = Tx1.low;
10283
10284 // Mix surrounding columns
10285 var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
10286 var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
10287 for (var y = 0; y < 5; y++) {
10288 var lane = state[x + 5 * y];
10289 lane.high ^= tMsw;
10290 lane.low ^= tLsw;
10291 }
10292 }
10293
10294 // Rho Pi
10295 for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
10296 // Shortcuts
10297 var lane = state[laneIndex];
10298 var laneMsw = lane.high;
10299 var laneLsw = lane.low;
10300 var rhoOffset = RHO_OFFSETS[laneIndex];
10301
10302 // Rotate lanes
10303 if (rhoOffset < 32) {
10304 var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
10305 var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
10306 } else /* if (rhoOffset >= 32) */ {
10307 var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
10308 var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
10309 }
10310
10311 // Transpose lanes
10312 var TPiLane = T[PI_INDEXES[laneIndex]];
10313 TPiLane.high = tMsw;
10314 TPiLane.low = tLsw;
10315 }
10316
10317 // Rho pi at x = y = 0
10318 var T0 = T[0];
10319 var state0 = state[0];
10320 T0.high = state0.high;
10321 T0.low = state0.low;
10322
10323 // Chi
10324 for (var x = 0; x < 5; x++) {
10325 for (var y = 0; y < 5; y++) {
10326 // Shortcuts
10327 var laneIndex = x + 5 * y;
10328 var lane = state[laneIndex];
10329 var TLane = T[laneIndex];
10330 var Tx1Lane = T[((x + 1) % 5) + 5 * y];
10331 var Tx2Lane = T[((x + 2) % 5) + 5 * y];
10332
10333 // Mix rows
10334 lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
10335 lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
10336 }
10337 }
10338
10339 // Iota
10340 var lane = state[0];
10341 var roundConstant = ROUND_CONSTANTS[round];
10342 lane.high ^= roundConstant.high;
10343 lane.low ^= roundConstant.low;;
10344 }
10345 },
10346
10347 _doFinalize: function () {
10348 // Shortcuts
10349 var data = this._data;
10350 var dataWords = data.words;
10351 var nBitsTotal = this._nDataBytes * 8;
10352 var nBitsLeft = data.sigBytes * 8;
10353 var blockSizeBits = this.blockSize * 32;
10354
10355 // Add padding
10356 dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
10357 dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
10358 data.sigBytes = dataWords.length * 4;
10359
10360 // Hash final blocks
10361 this._process();
10362
10363 // Shortcuts
10364 var state = this._state;
10365 var outputLengthBytes = this.cfg.outputLength / 8;
10366 var outputLengthLanes = outputLengthBytes / 8;
10367
10368 // Squeeze
10369 var hashWords = [];
10370 for (var i = 0; i < outputLengthLanes; i++) {
10371 // Shortcuts
10372 var lane = state[i];
10373 var laneMsw = lane.high;
10374 var laneLsw = lane.low;
10375
10376 // Swap endian
10377 laneMsw = (
10378 (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
10379 (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
10380 );
10381 laneLsw = (
10382 (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
10383 (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
10384 );
10385
10386 // Squeeze state to retrieve hash
10387 hashWords.push(laneLsw);
10388 hashWords.push(laneMsw);
10389 }
10390
10391 // Return final computed hash
10392 return new WordArray.init(hashWords, outputLengthBytes);
10393 },
10394
10395 clone: function () {
10396 var clone = Hasher.clone.call(this);
10397
10398 var state = clone._state = this._state.slice(0);
10399 for (var i = 0; i < 25; i++) {
10400 state[i] = state[i].clone();
10401 }
10402
10403 return clone;
10404 }
10405 });
10406
10407 /**
10408 * Shortcut function to the hasher's object interface.
10409 *
10410 * @param {WordArray|string} message The message to hash.
10411 *
10412 * @return {WordArray} The hash.
10413 *
10414 * @static
10415 *
10416 * @example
10417 *
10418 * var hash = CryptoJS.SHA3('message');
10419 * var hash = CryptoJS.SHA3(wordArray);
10420 */
10421 C.SHA3 = Hasher._createHelper(SHA3);
10422
10423 /**
10424 * Shortcut function to the HMAC's object interface.
10425 *
10426 * @param {WordArray|string} message The message to hash.
10427 * @param {WordArray|string} key The secret key.
10428 *
10429 * @return {WordArray} The HMAC.
10430 *
10431 * @static
10432 *
10433 * @example
10434 *
10435 * var hmac = CryptoJS.HmacSHA3(message, key);
10436 */
10437 C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
10438 }(Math));
10439
10440
10441 return CryptoJS.SHA3;
10442
10443 }));
10444 },{"./core":31,"./x64-core":62}],59:[function(_dereq_,module,exports){
10445 ;(function (root, factory, undef) {
10446 if (typeof exports === "object") {
10447 // CommonJS
10448 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./sha512"));
10449 }
10450 else if (typeof define === "function" && define.amd) {
10451 // AMD
10452 define(["./core", "./x64-core", "./sha512"], factory);
10453 }
10454 else {
10455 // Global (browser)
10456 factory(root.CryptoJS);
10457 }
10458 }(this, function (CryptoJS) {
10459
10460 (function () {
10461 // Shortcuts
10462 var C = CryptoJS;
10463 var C_x64 = C.x64;
10464 var X64Word = C_x64.Word;
10465 var X64WordArray = C_x64.WordArray;
10466 var C_algo = C.algo;
10467 var SHA512 = C_algo.SHA512;
10468
10469 /**
10470 * SHA-384 hash algorithm.
10471 */
10472 var SHA384 = C_algo.SHA384 = SHA512.extend({
10473 _doReset: function () {
10474 this._hash = new X64WordArray.init([
10475 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
10476 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
10477 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
10478 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
10479 ]);
10480 },
10481
10482 _doFinalize: function () {
10483 var hash = SHA512._doFinalize.call(this);
10484
10485 hash.sigBytes -= 16;
10486
10487 return hash;
10488 }
10489 });
10490
10491 /**
10492 * Shortcut function to the hasher's object interface.
10493 *
10494 * @param {WordArray|string} message The message to hash.
10495 *
10496 * @return {WordArray} The hash.
10497 *
10498 * @static
10499 *
10500 * @example
10501 *
10502 * var hash = CryptoJS.SHA384('message');
10503 * var hash = CryptoJS.SHA384(wordArray);
10504 */
10505 C.SHA384 = SHA512._createHelper(SHA384);
10506
10507 /**
10508 * Shortcut function to the HMAC's object interface.
10509 *
10510 * @param {WordArray|string} message The message to hash.
10511 * @param {WordArray|string} key The secret key.
10512 *
10513 * @return {WordArray} The HMAC.
10514 *
10515 * @static
10516 *
10517 * @example
10518 *
10519 * var hmac = CryptoJS.HmacSHA384(message, key);
10520 */
10521 C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
10522 }());
10523
10524
10525 return CryptoJS.SHA384;
10526
10527 }));
10528 },{"./core":31,"./sha512":60,"./x64-core":62}],60:[function(_dereq_,module,exports){
10529 ;(function (root, factory, undef) {
10530 if (typeof exports === "object") {
10531 // CommonJS
10532 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10533 }
10534 else if (typeof define === "function" && define.amd) {
10535 // AMD
10536 define(["./core", "./x64-core"], factory);
10537 }
10538 else {
10539 // Global (browser)
10540 factory(root.CryptoJS);
10541 }
10542 }(this, function (CryptoJS) {
10543
10544 (function () {
10545 // Shortcuts
10546 var C = CryptoJS;
10547 var C_lib = C.lib;
10548 var Hasher = C_lib.Hasher;
10549 var C_x64 = C.x64;
10550 var X64Word = C_x64.Word;
10551 var X64WordArray = C_x64.WordArray;
10552 var C_algo = C.algo;
10553
10554 function X64Word_create() {
10555 return X64Word.create.apply(X64Word, arguments);
10556 }
10557
10558 // Constants
10559 var K = [
10560 X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
10561 X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
10562 X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
10563 X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
10564 X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
10565 X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
10566 X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
10567 X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
10568 X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
10569 X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
10570 X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
10571 X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
10572 X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
10573 X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
10574 X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
10575 X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
10576 X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
10577 X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
10578 X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
10579 X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
10580 X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
10581 X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
10582 X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
10583 X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
10584 X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
10585 X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
10586 X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
10587 X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
10588 X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
10589 X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
10590 X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
10591 X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
10592 X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
10593 X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
10594 X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
10595 X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
10596 X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
10597 X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
10598 X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
10599 X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
10600 ];
10601
10602 // Reusable objects
10603 var W = [];
10604 (function () {
10605 for (var i = 0; i < 80; i++) {
10606 W[i] = X64Word_create();
10607 }
10608 }());
10609
10610 /**
10611 * SHA-512 hash algorithm.
10612 */
10613 var SHA512 = C_algo.SHA512 = Hasher.extend({
10614 _doReset: function () {
10615 this._hash = new X64WordArray.init([
10616 new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
10617 new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
10618 new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
10619 new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
10620 ]);
10621 },
10622
10623 _doProcessBlock: function (M, offset) {
10624 // Shortcuts
10625 var H = this._hash.words;
10626
10627 var H0 = H[0];
10628 var H1 = H[1];
10629 var H2 = H[2];
10630 var H3 = H[3];
10631 var H4 = H[4];
10632 var H5 = H[5];
10633 var H6 = H[6];
10634 var H7 = H[7];
10635
10636 var H0h = H0.high;
10637 var H0l = H0.low;
10638 var H1h = H1.high;
10639 var H1l = H1.low;
10640 var H2h = H2.high;
10641 var H2l = H2.low;
10642 var H3h = H3.high;
10643 var H3l = H3.low;
10644 var H4h = H4.high;
10645 var H4l = H4.low;
10646 var H5h = H5.high;
10647 var H5l = H5.low;
10648 var H6h = H6.high;
10649 var H6l = H6.low;
10650 var H7h = H7.high;
10651 var H7l = H7.low;
10652
10653 // Working variables
10654 var ah = H0h;
10655 var al = H0l;
10656 var bh = H1h;
10657 var bl = H1l;
10658 var ch = H2h;
10659 var cl = H2l;
10660 var dh = H3h;
10661 var dl = H3l;
10662 var eh = H4h;
10663 var el = H4l;
10664 var fh = H5h;
10665 var fl = H5l;
10666 var gh = H6h;
10667 var gl = H6l;
10668 var hh = H7h;
10669 var hl = H7l;
10670
10671 // Rounds
10672 for (var i = 0; i < 80; i++) {
10673 // Shortcut
10674 var Wi = W[i];
10675
10676 // Extend message
10677 if (i < 16) {
10678 var Wih = Wi.high = M[offset + i * 2] | 0;
10679 var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
10680 } else {
10681 // Gamma0
10682 var gamma0x = W[i - 15];
10683 var gamma0xh = gamma0x.high;
10684 var gamma0xl = gamma0x.low;
10685 var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
10686 var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
10687
10688 // Gamma1
10689 var gamma1x = W[i - 2];
10690 var gamma1xh = gamma1x.high;
10691 var gamma1xl = gamma1x.low;
10692 var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
10693 var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
10694
10695 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
10696 var Wi7 = W[i - 7];
10697 var Wi7h = Wi7.high;
10698 var Wi7l = Wi7.low;
10699
10700 var Wi16 = W[i - 16];
10701 var Wi16h = Wi16.high;
10702 var Wi16l = Wi16.low;
10703
10704 var Wil = gamma0l + Wi7l;
10705 var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
10706 var Wil = Wil + gamma1l;
10707 var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
10708 var Wil = Wil + Wi16l;
10709 var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
10710
10711 Wi.high = Wih;
10712 Wi.low = Wil;
10713 }
10714
10715 var chh = (eh & fh) ^ (~eh & gh);
10716 var chl = (el & fl) ^ (~el & gl);
10717 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
10718 var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
10719
10720 var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
10721 var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
10722 var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
10723 var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
10724
10725 // t1 = h + sigma1 + ch + K[i] + W[i]
10726 var Ki = K[i];
10727 var Kih = Ki.high;
10728 var Kil = Ki.low;
10729
10730 var t1l = hl + sigma1l;
10731 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
10732 var t1l = t1l + chl;
10733 var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
10734 var t1l = t1l + Kil;
10735 var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
10736 var t1l = t1l + Wil;
10737 var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
10738
10739 // t2 = sigma0 + maj
10740 var t2l = sigma0l + majl;
10741 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
10742
10743 // Update working variables
10744 hh = gh;
10745 hl = gl;
10746 gh = fh;
10747 gl = fl;
10748 fh = eh;
10749 fl = el;
10750 el = (dl + t1l) | 0;
10751 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
10752 dh = ch;
10753 dl = cl;
10754 ch = bh;
10755 cl = bl;
10756 bh = ah;
10757 bl = al;
10758 al = (t1l + t2l) | 0;
10759 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
10760 }
10761
10762 // Intermediate hash value
10763 H0l = H0.low = (H0l + al);
10764 H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
10765 H1l = H1.low = (H1l + bl);
10766 H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
10767 H2l = H2.low = (H2l + cl);
10768 H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
10769 H3l = H3.low = (H3l + dl);
10770 H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
10771 H4l = H4.low = (H4l + el);
10772 H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
10773 H5l = H5.low = (H5l + fl);
10774 H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
10775 H6l = H6.low = (H6l + gl);
10776 H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
10777 H7l = H7.low = (H7l + hl);
10778 H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
10779 },
10780
10781 _doFinalize: function () {
10782 // Shortcuts
10783 var data = this._data;
10784 var dataWords = data.words;
10785
10786 var nBitsTotal = this._nDataBytes * 8;
10787 var nBitsLeft = data.sigBytes * 8;
10788
10789 // Add padding
10790 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
10791 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
10792 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
10793 data.sigBytes = dataWords.length * 4;
10794
10795 // Hash final blocks
10796 this._process();
10797
10798 // Convert hash to 32-bit word array before returning
10799 var hash = this._hash.toX32();
10800
10801 // Return final computed hash
10802 return hash;
10803 },
10804
10805 clone: function () {
10806 var clone = Hasher.clone.call(this);
10807 clone._hash = this._hash.clone();
10808
10809 return clone;
10810 },
10811
10812 blockSize: 1024/32
10813 });
10814
10815 /**
10816 * Shortcut function to the hasher's object interface.
10817 *
10818 * @param {WordArray|string} message The message to hash.
10819 *
10820 * @return {WordArray} The hash.
10821 *
10822 * @static
10823 *
10824 * @example
10825 *
10826 * var hash = CryptoJS.SHA512('message');
10827 * var hash = CryptoJS.SHA512(wordArray);
10828 */
10829 C.SHA512 = Hasher._createHelper(SHA512);
10830
10831 /**
10832 * Shortcut function to the HMAC's object interface.
10833 *
10834 * @param {WordArray|string} message The message to hash.
10835 * @param {WordArray|string} key The secret key.
10836 *
10837 * @return {WordArray} The HMAC.
10838 *
10839 * @static
10840 *
10841 * @example
10842 *
10843 * var hmac = CryptoJS.HmacSHA512(message, key);
10844 */
10845 C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
10846 }());
10847
10848
10849 return CryptoJS.SHA512;
10850
10851 }));
10852 },{"./core":31,"./x64-core":62}],61:[function(_dereq_,module,exports){
10853 ;(function (root, factory, undef) {
10854 if (typeof exports === "object") {
10855 // CommonJS
10856 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
10857 }
10858 else if (typeof define === "function" && define.amd) {
10859 // AMD
10860 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
10861 }
10862 else {
10863 // Global (browser)
10864 factory(root.CryptoJS);
10865 }
10866 }(this, function (CryptoJS) {
10867
10868 (function () {
10869 // Shortcuts
10870 var C = CryptoJS;
10871 var C_lib = C.lib;
10872 var WordArray = C_lib.WordArray;
10873 var BlockCipher = C_lib.BlockCipher;
10874 var C_algo = C.algo;
10875
10876 // Permuted Choice 1 constants
10877 var PC1 = [
10878 57, 49, 41, 33, 25, 17, 9, 1,
10879 58, 50, 42, 34, 26, 18, 10, 2,
10880 59, 51, 43, 35, 27, 19, 11, 3,
10881 60, 52, 44, 36, 63, 55, 47, 39,
10882 31, 23, 15, 7, 62, 54, 46, 38,
10883 30, 22, 14, 6, 61, 53, 45, 37,
10884 29, 21, 13, 5, 28, 20, 12, 4
10885 ];
10886
10887 // Permuted Choice 2 constants
10888 var PC2 = [
10889 14, 17, 11, 24, 1, 5,
10890 3, 28, 15, 6, 21, 10,
10891 23, 19, 12, 4, 26, 8,
10892 16, 7, 27, 20, 13, 2,
10893 41, 52, 31, 37, 47, 55,
10894 30, 40, 51, 45, 33, 48,
10895 44, 49, 39, 56, 34, 53,
10896 46, 42, 50, 36, 29, 32
10897 ];
10898
10899 // Cumulative bit shift constants
10900 var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
10901
10902 // SBOXes and round permutation constants
10903 var SBOX_P = [
10904 {
10905 0x0: 0x808200,
10906 0x10000000: 0x8000,
10907 0x20000000: 0x808002,
10908 0x30000000: 0x2,
10909 0x40000000: 0x200,
10910 0x50000000: 0x808202,
10911 0x60000000: 0x800202,
10912 0x70000000: 0x800000,
10913 0x80000000: 0x202,
10914 0x90000000: 0x800200,
10915 0xa0000000: 0x8200,
10916 0xb0000000: 0x808000,
10917 0xc0000000: 0x8002,
10918 0xd0000000: 0x800002,
10919 0xe0000000: 0x0,
10920 0xf0000000: 0x8202,
10921 0x8000000: 0x0,
10922 0x18000000: 0x808202,
10923 0x28000000: 0x8202,
10924 0x38000000: 0x8000,
10925 0x48000000: 0x808200,
10926 0x58000000: 0x200,
10927 0x68000000: 0x808002,
10928 0x78000000: 0x2,
10929 0x88000000: 0x800200,
10930 0x98000000: 0x8200,
10931 0xa8000000: 0x808000,
10932 0xb8000000: 0x800202,
10933 0xc8000000: 0x800002,
10934 0xd8000000: 0x8002,
10935 0xe8000000: 0x202,
10936 0xf8000000: 0x800000,
10937 0x1: 0x8000,
10938 0x10000001: 0x2,
10939 0x20000001: 0x808200,
10940 0x30000001: 0x800000,
10941 0x40000001: 0x808002,
10942 0x50000001: 0x8200,
10943 0x60000001: 0x200,
10944 0x70000001: 0x800202,
10945 0x80000001: 0x808202,
10946 0x90000001: 0x808000,
10947 0xa0000001: 0x800002,
10948 0xb0000001: 0x8202,
10949 0xc0000001: 0x202,
10950 0xd0000001: 0x800200,
10951 0xe0000001: 0x8002,
10952 0xf0000001: 0x0,
10953 0x8000001: 0x808202,
10954 0x18000001: 0x808000,
10955 0x28000001: 0x800000,
10956 0x38000001: 0x200,
10957 0x48000001: 0x8000,
10958 0x58000001: 0x800002,
10959 0x68000001: 0x2,
10960 0x78000001: 0x8202,
10961 0x88000001: 0x8002,
10962 0x98000001: 0x800202,
10963 0xa8000001: 0x202,
10964 0xb8000001: 0x808200,
10965 0xc8000001: 0x800200,
10966 0xd8000001: 0x0,
10967 0xe8000001: 0x8200,
10968 0xf8000001: 0x808002
10969 },
10970 {
10971 0x0: 0x40084010,
10972 0x1000000: 0x4000,
10973 0x2000000: 0x80000,
10974 0x3000000: 0x40080010,
10975 0x4000000: 0x40000010,
10976 0x5000000: 0x40084000,
10977 0x6000000: 0x40004000,
10978 0x7000000: 0x10,
10979 0x8000000: 0x84000,
10980 0x9000000: 0x40004010,
10981 0xa000000: 0x40000000,
10982 0xb000000: 0x84010,
10983 0xc000000: 0x80010,
10984 0xd000000: 0x0,
10985 0xe000000: 0x4010,
10986 0xf000000: 0x40080000,
10987 0x800000: 0x40004000,
10988 0x1800000: 0x84010,
10989 0x2800000: 0x10,
10990 0x3800000: 0x40004010,
10991 0x4800000: 0x40084010,
10992 0x5800000: 0x40000000,
10993 0x6800000: 0x80000,
10994 0x7800000: 0x40080010,
10995 0x8800000: 0x80010,
10996 0x9800000: 0x0,
10997 0xa800000: 0x4000,
10998 0xb800000: 0x40080000,
10999 0xc800000: 0x40000010,
11000 0xd800000: 0x84000,
11001 0xe800000: 0x40084000,
11002 0xf800000: 0x4010,
11003 0x10000000: 0x0,
11004 0x11000000: 0x40080010,
11005 0x12000000: 0x40004010,
11006 0x13000000: 0x40084000,
11007 0x14000000: 0x40080000,
11008 0x15000000: 0x10,
11009 0x16000000: 0x84010,
11010 0x17000000: 0x4000,
11011 0x18000000: 0x4010,
11012 0x19000000: 0x80000,
11013 0x1a000000: 0x80010,
11014 0x1b000000: 0x40000010,
11015 0x1c000000: 0x84000,
11016 0x1d000000: 0x40004000,
11017 0x1e000000: 0x40000000,
11018 0x1f000000: 0x40084010,
11019 0x10800000: 0x84010,
11020 0x11800000: 0x80000,
11021 0x12800000: 0x40080000,
11022 0x13800000: 0x4000,
11023 0x14800000: 0x40004000,
11024 0x15800000: 0x40084010,
11025 0x16800000: 0x10,
11026 0x17800000: 0x40000000,
11027 0x18800000: 0x40084000,
11028 0x19800000: 0x40000010,
11029 0x1a800000: 0x40004010,
11030 0x1b800000: 0x80010,
11031 0x1c800000: 0x0,
11032 0x1d800000: 0x4010,
11033 0x1e800000: 0x40080010,
11034 0x1f800000: 0x84000
11035 },
11036 {
11037 0x0: 0x104,
11038 0x100000: 0x0,
11039 0x200000: 0x4000100,
11040 0x300000: 0x10104,
11041 0x400000: 0x10004,
11042 0x500000: 0x4000004,
11043 0x600000: 0x4010104,
11044 0x700000: 0x4010000,
11045 0x800000: 0x4000000,
11046 0x900000: 0x4010100,
11047 0xa00000: 0x10100,
11048 0xb00000: 0x4010004,
11049 0xc00000: 0x4000104,
11050 0xd00000: 0x10000,
11051 0xe00000: 0x4,
11052 0xf00000: 0x100,
11053 0x80000: 0x4010100,
11054 0x180000: 0x4010004,
11055 0x280000: 0x0,
11056 0x380000: 0x4000100,
11057 0x480000: 0x4000004,
11058 0x580000: 0x10000,
11059 0x680000: 0x10004,
11060 0x780000: 0x104,
11061 0x880000: 0x4,
11062 0x980000: 0x100,
11063 0xa80000: 0x4010000,
11064 0xb80000: 0x10104,
11065 0xc80000: 0x10100,
11066 0xd80000: 0x4000104,
11067 0xe80000: 0x4010104,
11068 0xf80000: 0x4000000,
11069 0x1000000: 0x4010100,
11070 0x1100000: 0x10004,
11071 0x1200000: 0x10000,
11072 0x1300000: 0x4000100,
11073 0x1400000: 0x100,
11074 0x1500000: 0x4010104,
11075 0x1600000: 0x4000004,
11076 0x1700000: 0x0,
11077 0x1800000: 0x4000104,
11078 0x1900000: 0x4000000,
11079 0x1a00000: 0x4,
11080 0x1b00000: 0x10100,
11081 0x1c00000: 0x4010000,
11082 0x1d00000: 0x104,
11083 0x1e00000: 0x10104,
11084 0x1f00000: 0x4010004,
11085 0x1080000: 0x4000000,
11086 0x1180000: 0x104,
11087 0x1280000: 0x4010100,
11088 0x1380000: 0x0,
11089 0x1480000: 0x10004,
11090 0x1580000: 0x4000100,
11091 0x1680000: 0x100,
11092 0x1780000: 0x4010004,
11093 0x1880000: 0x10000,
11094 0x1980000: 0x4010104,
11095 0x1a80000: 0x10104,
11096 0x1b80000: 0x4000004,
11097 0x1c80000: 0x4000104,
11098 0x1d80000: 0x4010000,
11099 0x1e80000: 0x4,
11100 0x1f80000: 0x10100
11101 },
11102 {
11103 0x0: 0x80401000,
11104 0x10000: 0x80001040,
11105 0x20000: 0x401040,
11106 0x30000: 0x80400000,
11107 0x40000: 0x0,
11108 0x50000: 0x401000,
11109 0x60000: 0x80000040,
11110 0x70000: 0x400040,
11111 0x80000: 0x80000000,
11112 0x90000: 0x400000,
11113 0xa0000: 0x40,
11114 0xb0000: 0x80001000,
11115 0xc0000: 0x80400040,
11116 0xd0000: 0x1040,
11117 0xe0000: 0x1000,
11118 0xf0000: 0x80401040,
11119 0x8000: 0x80001040,
11120 0x18000: 0x40,
11121 0x28000: 0x80400040,
11122 0x38000: 0x80001000,
11123 0x48000: 0x401000,
11124 0x58000: 0x80401040,
11125 0x68000: 0x0,
11126 0x78000: 0x80400000,
11127 0x88000: 0x1000,
11128 0x98000: 0x80401000,
11129 0xa8000: 0x400000,
11130 0xb8000: 0x1040,
11131 0xc8000: 0x80000000,
11132 0xd8000: 0x400040,
11133 0xe8000: 0x401040,
11134 0xf8000: 0x80000040,
11135 0x100000: 0x400040,
11136 0x110000: 0x401000,
11137 0x120000: 0x80000040,
11138 0x130000: 0x0,
11139 0x140000: 0x1040,
11140 0x150000: 0x80400040,
11141 0x160000: 0x80401000,
11142 0x170000: 0x80001040,
11143 0x180000: 0x80401040,
11144 0x190000: 0x80000000,
11145 0x1a0000: 0x80400000,
11146 0x1b0000: 0x401040,
11147 0x1c0000: 0x80001000,
11148 0x1d0000: 0x400000,
11149 0x1e0000: 0x40,
11150 0x1f0000: 0x1000,
11151 0x108000: 0x80400000,
11152 0x118000: 0x80401040,
11153 0x128000: 0x0,
11154 0x138000: 0x401000,
11155 0x148000: 0x400040,
11156 0x158000: 0x80000000,
11157 0x168000: 0x80001040,
11158 0x178000: 0x40,
11159 0x188000: 0x80000040,
11160 0x198000: 0x1000,
11161 0x1a8000: 0x80001000,
11162 0x1b8000: 0x80400040,
11163 0x1c8000: 0x1040,
11164 0x1d8000: 0x80401000,
11165 0x1e8000: 0x400000,
11166 0x1f8000: 0x401040
11167 },
11168 {
11169 0x0: 0x80,
11170 0x1000: 0x1040000,
11171 0x2000: 0x40000,
11172 0x3000: 0x20000000,
11173 0x4000: 0x20040080,
11174 0x5000: 0x1000080,
11175 0x6000: 0x21000080,
11176 0x7000: 0x40080,
11177 0x8000: 0x1000000,
11178 0x9000: 0x20040000,
11179 0xa000: 0x20000080,
11180 0xb000: 0x21040080,
11181 0xc000: 0x21040000,
11182 0xd000: 0x0,
11183 0xe000: 0x1040080,
11184 0xf000: 0x21000000,
11185 0x800: 0x1040080,
11186 0x1800: 0x21000080,
11187 0x2800: 0x80,
11188 0x3800: 0x1040000,
11189 0x4800: 0x40000,
11190 0x5800: 0x20040080,
11191 0x6800: 0x21040000,
11192 0x7800: 0x20000000,
11193 0x8800: 0x20040000,
11194 0x9800: 0x0,
11195 0xa800: 0x21040080,
11196 0xb800: 0x1000080,
11197 0xc800: 0x20000080,
11198 0xd800: 0x21000000,
11199 0xe800: 0x1000000,
11200 0xf800: 0x40080,
11201 0x10000: 0x40000,
11202 0x11000: 0x80,
11203 0x12000: 0x20000000,
11204 0x13000: 0x21000080,
11205 0x14000: 0x1000080,
11206 0x15000: 0x21040000,
11207 0x16000: 0x20040080,
11208 0x17000: 0x1000000,
11209 0x18000: 0x21040080,
11210 0x19000: 0x21000000,
11211 0x1a000: 0x1040000,
11212 0x1b000: 0x20040000,
11213 0x1c000: 0x40080,
11214 0x1d000: 0x20000080,
11215 0x1e000: 0x0,
11216 0x1f000: 0x1040080,
11217 0x10800: 0x21000080,
11218 0x11800: 0x1000000,
11219 0x12800: 0x1040000,
11220 0x13800: 0x20040080,
11221 0x14800: 0x20000000,
11222 0x15800: 0x1040080,
11223 0x16800: 0x80,
11224 0x17800: 0x21040000,
11225 0x18800: 0x40080,
11226 0x19800: 0x21040080,
11227 0x1a800: 0x0,
11228 0x1b800: 0x21000000,
11229 0x1c800: 0x1000080,
11230 0x1d800: 0x40000,
11231 0x1e800: 0x20040000,
11232 0x1f800: 0x20000080
11233 },
11234 {
11235 0x0: 0x10000008,
11236 0x100: 0x2000,
11237 0x200: 0x10200000,
11238 0x300: 0x10202008,
11239 0x400: 0x10002000,
11240 0x500: 0x200000,
11241 0x600: 0x200008,
11242 0x700: 0x10000000,
11243 0x800: 0x0,
11244 0x900: 0x10002008,
11245 0xa00: 0x202000,
11246 0xb00: 0x8,
11247 0xc00: 0x10200008,
11248 0xd00: 0x202008,
11249 0xe00: 0x2008,
11250 0xf00: 0x10202000,
11251 0x80: 0x10200000,
11252 0x180: 0x10202008,
11253 0x280: 0x8,
11254 0x380: 0x200000,
11255 0x480: 0x202008,
11256 0x580: 0x10000008,
11257 0x680: 0x10002000,
11258 0x780: 0x2008,
11259 0x880: 0x200008,
11260 0x980: 0x2000,
11261 0xa80: 0x10002008,
11262 0xb80: 0x10200008,
11263 0xc80: 0x0,
11264 0xd80: 0x10202000,
11265 0xe80: 0x202000,
11266 0xf80: 0x10000000,
11267 0x1000: 0x10002000,
11268 0x1100: 0x10200008,
11269 0x1200: 0x10202008,
11270 0x1300: 0x2008,
11271 0x1400: 0x200000,
11272 0x1500: 0x10000000,
11273 0x1600: 0x10000008,
11274 0x1700: 0x202000,
11275 0x1800: 0x202008,
11276 0x1900: 0x0,
11277 0x1a00: 0x8,
11278 0x1b00: 0x10200000,
11279 0x1c00: 0x2000,
11280 0x1d00: 0x10002008,
11281 0x1e00: 0x10202000,
11282 0x1f00: 0x200008,
11283 0x1080: 0x8,
11284 0x1180: 0x202000,
11285 0x1280: 0x200000,
11286 0x1380: 0x10000008,
11287 0x1480: 0x10002000,
11288 0x1580: 0x2008,
11289 0x1680: 0x10202008,
11290 0x1780: 0x10200000,
11291 0x1880: 0x10202000,
11292 0x1980: 0x10200008,
11293 0x1a80: 0x2000,
11294 0x1b80: 0x202008,
11295 0x1c80: 0x200008,
11296 0x1d80: 0x0,
11297 0x1e80: 0x10000000,
11298 0x1f80: 0x10002008
11299 },
11300 {
11301 0x0: 0x100000,
11302 0x10: 0x2000401,
11303 0x20: 0x400,
11304 0x30: 0x100401,
11305 0x40: 0x2100401,
11306 0x50: 0x0,
11307 0x60: 0x1,
11308 0x70: 0x2100001,
11309 0x80: 0x2000400,
11310 0x90: 0x100001,
11311 0xa0: 0x2000001,
11312 0xb0: 0x2100400,
11313 0xc0: 0x2100000,
11314 0xd0: 0x401,
11315 0xe0: 0x100400,
11316 0xf0: 0x2000000,
11317 0x8: 0x2100001,
11318 0x18: 0x0,
11319 0x28: 0x2000401,
11320 0x38: 0x2100400,
11321 0x48: 0x100000,
11322 0x58: 0x2000001,
11323 0x68: 0x2000000,
11324 0x78: 0x401,
11325 0x88: 0x100401,
11326 0x98: 0x2000400,
11327 0xa8: 0x2100000,
11328 0xb8: 0x100001,
11329 0xc8: 0x400,
11330 0xd8: 0x2100401,
11331 0xe8: 0x1,
11332 0xf8: 0x100400,
11333 0x100: 0x2000000,
11334 0x110: 0x100000,
11335 0x120: 0x2000401,
11336 0x130: 0x2100001,
11337 0x140: 0x100001,
11338 0x150: 0x2000400,
11339 0x160: 0x2100400,
11340 0x170: 0x100401,
11341 0x180: 0x401,
11342 0x190: 0x2100401,
11343 0x1a0: 0x100400,
11344 0x1b0: 0x1,
11345 0x1c0: 0x0,
11346 0x1d0: 0x2100000,
11347 0x1e0: 0x2000001,
11348 0x1f0: 0x400,
11349 0x108: 0x100400,
11350 0x118: 0x2000401,
11351 0x128: 0x2100001,
11352 0x138: 0x1,
11353 0x148: 0x2000000,
11354 0x158: 0x100000,
11355 0x168: 0x401,
11356 0x178: 0x2100400,
11357 0x188: 0x2000001,
11358 0x198: 0x2100000,
11359 0x1a8: 0x0,
11360 0x1b8: 0x2100401,
11361 0x1c8: 0x100401,
11362 0x1d8: 0x400,
11363 0x1e8: 0x2000400,
11364 0x1f8: 0x100001
11365 },
11366 {
11367 0x0: 0x8000820,
11368 0x1: 0x20000,
11369 0x2: 0x8000000,
11370 0x3: 0x20,
11371 0x4: 0x20020,
11372 0x5: 0x8020820,
11373 0x6: 0x8020800,
11374 0x7: 0x800,
11375 0x8: 0x8020000,
11376 0x9: 0x8000800,
11377 0xa: 0x20800,
11378 0xb: 0x8020020,
11379 0xc: 0x820,
11380 0xd: 0x0,
11381 0xe: 0x8000020,
11382 0xf: 0x20820,
11383 0x80000000: 0x800,
11384 0x80000001: 0x8020820,
11385 0x80000002: 0x8000820,
11386 0x80000003: 0x8000000,
11387 0x80000004: 0x8020000,
11388 0x80000005: 0x20800,
11389 0x80000006: 0x20820,
11390 0x80000007: 0x20,
11391 0x80000008: 0x8000020,
11392 0x80000009: 0x820,
11393 0x8000000a: 0x20020,
11394 0x8000000b: 0x8020800,
11395 0x8000000c: 0x0,
11396 0x8000000d: 0x8020020,
11397 0x8000000e: 0x8000800,
11398 0x8000000f: 0x20000,
11399 0x10: 0x20820,
11400 0x11: 0x8020800,
11401 0x12: 0x20,
11402 0x13: 0x800,
11403 0x14: 0x8000800,
11404 0x15: 0x8000020,
11405 0x16: 0x8020020,
11406 0x17: 0x20000,
11407 0x18: 0x0,
11408 0x19: 0x20020,
11409 0x1a: 0x8020000,
11410 0x1b: 0x8000820,
11411 0x1c: 0x8020820,
11412 0x1d: 0x20800,
11413 0x1e: 0x820,
11414 0x1f: 0x8000000,
11415 0x80000010: 0x20000,
11416 0x80000011: 0x800,
11417 0x80000012: 0x8020020,
11418 0x80000013: 0x20820,
11419 0x80000014: 0x20,
11420 0x80000015: 0x8020000,
11421 0x80000016: 0x8000000,
11422 0x80000017: 0x8000820,
11423 0x80000018: 0x8020820,
11424 0x80000019: 0x8000020,
11425 0x8000001a: 0x8000800,
11426 0x8000001b: 0x0,
11427 0x8000001c: 0x20800,
11428 0x8000001d: 0x820,
11429 0x8000001e: 0x20020,
11430 0x8000001f: 0x8020800
11431 }
11432 ];
11433
11434 // Masks that select the SBOX input
11435 var SBOX_MASK = [
11436 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
11437 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
11438 ];
11439
11440 /**
11441 * DES block cipher algorithm.
11442 */
11443 var DES = C_algo.DES = BlockCipher.extend({
11444 _doReset: function () {
11445 // Shortcuts
11446 var key = this._key;
11447 var keyWords = key.words;
11448
11449 // Select 56 bits according to PC1
11450 var keyBits = [];
11451 for (var i = 0; i < 56; i++) {
11452 var keyBitPos = PC1[i] - 1;
11453 keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
11454 }
11455
11456 // Assemble 16 subkeys
11457 var subKeys = this._subKeys = [];
11458 for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
11459 // Create subkey
11460 var subKey = subKeys[nSubKey] = [];
11461
11462 // Shortcut
11463 var bitShift = BIT_SHIFTS[nSubKey];
11464
11465 // Select 48 bits according to PC2
11466 for (var i = 0; i < 24; i++) {
11467 // Select from the left 28 key bits
11468 subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
11469
11470 // Select from the right 28 key bits
11471 subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
11472 }
11473
11474 // Since each subkey is applied to an expanded 32-bit input,
11475 // the subkey can be broken into 8 values scaled to 32-bits,
11476 // which allows the key to be used without expansion
11477 subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
11478 for (var i = 1; i < 7; i++) {
11479 subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
11480 }
11481 subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
11482 }
11483
11484 // Compute inverse subkeys
11485 var invSubKeys = this._invSubKeys = [];
11486 for (var i = 0; i < 16; i++) {
11487 invSubKeys[i] = subKeys[15 - i];
11488 }
11489 },
11490
11491 encryptBlock: function (M, offset) {
11492 this._doCryptBlock(M, offset, this._subKeys);
11493 },
11494
11495 decryptBlock: function (M, offset) {
11496 this._doCryptBlock(M, offset, this._invSubKeys);
11497 },
11498
11499 _doCryptBlock: function (M, offset, subKeys) {
11500 // Get input
11501 this._lBlock = M[offset];
11502 this._rBlock = M[offset + 1];
11503
11504 // Initial permutation
11505 exchangeLR.call(this, 4, 0x0f0f0f0f);
11506 exchangeLR.call(this, 16, 0x0000ffff);
11507 exchangeRL.call(this, 2, 0x33333333);
11508 exchangeRL.call(this, 8, 0x00ff00ff);
11509 exchangeLR.call(this, 1, 0x55555555);
11510
11511 // Rounds
11512 for (var round = 0; round < 16; round++) {
11513 // Shortcuts
11514 var subKey = subKeys[round];
11515 var lBlock = this._lBlock;
11516 var rBlock = this._rBlock;
11517
11518 // Feistel function
11519 var f = 0;
11520 for (var i = 0; i < 8; i++) {
11521 f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
11522 }
11523 this._lBlock = rBlock;
11524 this._rBlock = lBlock ^ f;
11525 }
11526
11527 // Undo swap from last round
11528 var t = this._lBlock;
11529 this._lBlock = this._rBlock;
11530 this._rBlock = t;
11531
11532 // Final permutation
11533 exchangeLR.call(this, 1, 0x55555555);
11534 exchangeRL.call(this, 8, 0x00ff00ff);
11535 exchangeRL.call(this, 2, 0x33333333);
11536 exchangeLR.call(this, 16, 0x0000ffff);
11537 exchangeLR.call(this, 4, 0x0f0f0f0f);
11538
11539 // Set output
11540 M[offset] = this._lBlock;
11541 M[offset + 1] = this._rBlock;
11542 },
11543
11544 keySize: 64/32,
11545
11546 ivSize: 64/32,
11547
11548 blockSize: 64/32
11549 });
11550
11551 // Swap bits across the left and right words
11552 function exchangeLR(offset, mask) {
11553 var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
11554 this._rBlock ^= t;
11555 this._lBlock ^= t << offset;
11556 }
11557
11558 function exchangeRL(offset, mask) {
11559 var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
11560 this._lBlock ^= t;
11561 this._rBlock ^= t << offset;
11562 }
11563
11564 /**
11565 * Shortcut functions to the cipher's object interface.
11566 *
11567 * @example
11568 *
11569 * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
11570 * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
11571 */
11572 C.DES = BlockCipher._createHelper(DES);
11573
11574 /**
11575 * Triple-DES block cipher algorithm.
11576 */
11577 var TripleDES = C_algo.TripleDES = BlockCipher.extend({
11578 _doReset: function () {
11579 // Shortcuts
11580 var key = this._key;
11581 var keyWords = key.words;
11582
11583 // Create DES instances
11584 this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
11585 this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
11586 this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
11587 },
11588
11589 encryptBlock: function (M, offset) {
11590 this._des1.encryptBlock(M, offset);
11591 this._des2.decryptBlock(M, offset);
11592 this._des3.encryptBlock(M, offset);
11593 },
11594
11595 decryptBlock: function (M, offset) {
11596 this._des3.decryptBlock(M, offset);
11597 this._des2.encryptBlock(M, offset);
11598 this._des1.decryptBlock(M, offset);
11599 },
11600
11601 keySize: 192/32,
11602
11603 ivSize: 64/32,
11604
11605 blockSize: 64/32
11606 });
11607
11608 /**
11609 * Shortcut functions to the cipher's object interface.
11610 *
11611 * @example
11612 *
11613 * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
11614 * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
11615 */
11616 C.TripleDES = BlockCipher._createHelper(TripleDES);
11617 }());
11618
11619
11620 return CryptoJS.TripleDES;
11621
11622 }));
11623 },{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],62:[function(_dereq_,module,exports){
11624 ;(function (root, factory) {
11625 if (typeof exports === "object") {
11626 // CommonJS
11627 module.exports = exports = factory(_dereq_("./core"));
11628 }
11629 else if (typeof define === "function" && define.amd) {
11630 // AMD
11631 define(["./core"], factory);
11632 }
11633 else {
11634 // Global (browser)
11635 factory(root.CryptoJS);
11636 }
11637 }(this, function (CryptoJS) {
11638
11639 (function (undefined) {
11640 // Shortcuts
11641 var C = CryptoJS;
11642 var C_lib = C.lib;
11643 var Base = C_lib.Base;
11644 var X32WordArray = C_lib.WordArray;
11645
11646 /**
11647 * x64 namespace.
11648 */
11649 var C_x64 = C.x64 = {};
11650
11651 /**
11652 * A 64-bit word.
11653 */
11654 var X64Word = C_x64.Word = Base.extend({
11655 /**
11656 * Initializes a newly created 64-bit word.
11657 *
11658 * @param {number} high The high 32 bits.
11659 * @param {number} low The low 32 bits.
11660 *
11661 * @example
11662 *
11663 * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
11664 */
11665 init: function (high, low) {
11666 this.high = high;
11667 this.low = low;
11668 }
11669
11670 /**
11671 * Bitwise NOTs this word.
11672 *
11673 * @return {X64Word} A new x64-Word object after negating.
11674 *
11675 * @example
11676 *
11677 * var negated = x64Word.not();
11678 */
11679 // not: function () {
11680 // var high = ~this.high;
11681 // var low = ~this.low;
11682
11683 // return X64Word.create(high, low);
11684 // },
11685
11686 /**
11687 * Bitwise ANDs this word with the passed word.
11688 *
11689 * @param {X64Word} word The x64-Word to AND with this word.
11690 *
11691 * @return {X64Word} A new x64-Word object after ANDing.
11692 *
11693 * @example
11694 *
11695 * var anded = x64Word.and(anotherX64Word);
11696 */
11697 // and: function (word) {
11698 // var high = this.high & word.high;
11699 // var low = this.low & word.low;
11700
11701 // return X64Word.create(high, low);
11702 // },
11703
11704 /**
11705 * Bitwise ORs this word with the passed word.
11706 *
11707 * @param {X64Word} word The x64-Word to OR with this word.
11708 *
11709 * @return {X64Word} A new x64-Word object after ORing.
11710 *
11711 * @example
11712 *
11713 * var ored = x64Word.or(anotherX64Word);
11714 */
11715 // or: function (word) {
11716 // var high = this.high | word.high;
11717 // var low = this.low | word.low;
11718
11719 // return X64Word.create(high, low);
11720 // },
11721
11722 /**
11723 * Bitwise XORs this word with the passed word.
11724 *
11725 * @param {X64Word} word The x64-Word to XOR with this word.
11726 *
11727 * @return {X64Word} A new x64-Word object after XORing.
11728 *
11729 * @example
11730 *
11731 * var xored = x64Word.xor(anotherX64Word);
11732 */
11733 // xor: function (word) {
11734 // var high = this.high ^ word.high;
11735 // var low = this.low ^ word.low;
11736
11737 // return X64Word.create(high, low);
11738 // },
11739
11740 /**
11741 * Shifts this word n bits to the left.
11742 *
11743 * @param {number} n The number of bits to shift.
11744 *
11745 * @return {X64Word} A new x64-Word object after shifting.
11746 *
11747 * @example
11748 *
11749 * var shifted = x64Word.shiftL(25);
11750 */
11751 // shiftL: function (n) {
11752 // if (n < 32) {
11753 // var high = (this.high << n) | (this.low >>> (32 - n));
11754 // var low = this.low << n;
11755 // } else {
11756 // var high = this.low << (n - 32);
11757 // var low = 0;
11758 // }
11759
11760 // return X64Word.create(high, low);
11761 // },
11762
11763 /**
11764 * Shifts this word n bits to the right.
11765 *
11766 * @param {number} n The number of bits to shift.
11767 *
11768 * @return {X64Word} A new x64-Word object after shifting.
11769 *
11770 * @example
11771 *
11772 * var shifted = x64Word.shiftR(7);
11773 */
11774 // shiftR: function (n) {
11775 // if (n < 32) {
11776 // var low = (this.low >>> n) | (this.high << (32 - n));
11777 // var high = this.high >>> n;
11778 // } else {
11779 // var low = this.high >>> (n - 32);
11780 // var high = 0;
11781 // }
11782
11783 // return X64Word.create(high, low);
11784 // },
11785
11786 /**
11787 * Rotates this word n bits to the left.
11788 *
11789 * @param {number} n The number of bits to rotate.
11790 *
11791 * @return {X64Word} A new x64-Word object after rotating.
11792 *
11793 * @example
11794 *
11795 * var rotated = x64Word.rotL(25);
11796 */
11797 // rotL: function (n) {
11798 // return this.shiftL(n).or(this.shiftR(64 - n));
11799 // },
11800
11801 /**
11802 * Rotates this word n bits to the right.
11803 *
11804 * @param {number} n The number of bits to rotate.
11805 *
11806 * @return {X64Word} A new x64-Word object after rotating.
11807 *
11808 * @example
11809 *
11810 * var rotated = x64Word.rotR(7);
11811 */
11812 // rotR: function (n) {
11813 // return this.shiftR(n).or(this.shiftL(64 - n));
11814 // },
11815
11816 /**
11817 * Adds this word with the passed word.
11818 *
11819 * @param {X64Word} word The x64-Word to add with this word.
11820 *
11821 * @return {X64Word} A new x64-Word object after adding.
11822 *
11823 * @example
11824 *
11825 * var added = x64Word.add(anotherX64Word);
11826 */
11827 // add: function (word) {
11828 // var low = (this.low + word.low) | 0;
11829 // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
11830 // var high = (this.high + word.high + carry) | 0;
11831
11832 // return X64Word.create(high, low);
11833 // }
11834 });
11835
11836 /**
11837 * An array of 64-bit words.
11838 *
11839 * @property {Array} words The array of CryptoJS.x64.Word objects.
11840 * @property {number} sigBytes The number of significant bytes in this word array.
11841 */
11842 var X64WordArray = C_x64.WordArray = Base.extend({
11843 /**
11844 * Initializes a newly created word array.
11845 *
11846 * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
11847 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
11848 *
11849 * @example
11850 *
11851 * var wordArray = CryptoJS.x64.WordArray.create();
11852 *
11853 * var wordArray = CryptoJS.x64.WordArray.create([
11854 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11855 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11856 * ]);
11857 *
11858 * var wordArray = CryptoJS.x64.WordArray.create([
11859 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11860 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11861 * ], 10);
11862 */
11863 init: function (words, sigBytes) {
11864 words = this.words = words || [];
11865
11866 if (sigBytes != undefined) {
11867 this.sigBytes = sigBytes;
11868 } else {
11869 this.sigBytes = words.length * 8;
11870 }
11871 },
11872
11873 /**
11874 * Converts this 64-bit word array to a 32-bit word array.
11875 *
11876 * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
11877 *
11878 * @example
11879 *
11880 * var x32WordArray = x64WordArray.toX32();
11881 */
11882 toX32: function () {
11883 // Shortcuts
11884 var x64Words = this.words;
11885 var x64WordsLength = x64Words.length;
11886
11887 // Convert
11888 var x32Words = [];
11889 for (var i = 0; i < x64WordsLength; i++) {
11890 var x64Word = x64Words[i];
11891 x32Words.push(x64Word.high);
11892 x32Words.push(x64Word.low);
11893 }
11894
11895 return X32WordArray.create(x32Words, this.sigBytes);
11896 },
11897
11898 /**
11899 * Creates a copy of this word array.
11900 *
11901 * @return {X64WordArray} The clone.
11902 *
11903 * @example
11904 *
11905 * var clone = x64WordArray.clone();
11906 */
11907 clone: function () {
11908 var clone = Base.clone.call(this);
11909
11910 // Clone "words" array
11911 var words = clone.words = this.words.slice(0);
11912
11913 // Clone each X64Word object
11914 var wordsLength = words.length;
11915 for (var i = 0; i < wordsLength; i++) {
11916 words[i] = words[i].clone();
11917 }
11918
11919 return clone;
11920 }
11921 });
11922 }());
11923
11924
11925 return CryptoJS;
11926
11927 }));
11928 },{"./core":31}],63:[function(_dereq_,module,exports){
11929 var assert = _dereq_('assert')
11930 var BigInteger = _dereq_('bigi')
11931
11932 var Point = _dereq_('./point')
11933
11934 function Curve(p, a, b, Gx, Gy, n, h) {
11935 this.p = p
11936 this.a = a
11937 this.b = b
11938 this.G = Point.fromAffine(this, Gx, Gy)
11939 this.n = n
11940 this.h = h
11941
11942 this.infinity = new Point(this, null, null, BigInteger.ZERO)
11943
11944 // result caching
11945 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
11946 }
11947
11948 Curve.prototype.pointFromX = function(isOdd, x) {
11949 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
11950 var beta = alpha.modPow(this.pOverFour, this.p)
11951
11952 var y = beta
11953 if (beta.isEven() ^ !isOdd) {
11954 y = this.p.subtract(y) // -y % p
11955 }
11956
11957 return Point.fromAffine(this, x, y)
11958 }
11959
11960 Curve.prototype.isInfinity = function(Q) {
11961 if (Q === this.infinity) return true
11962
11963 return Q.z.signum() === 0 && Q.y.signum() !== 0
11964 }
11965
11966 Curve.prototype.isOnCurve = function(Q) {
11967 if (this.isInfinity(Q)) return true
11968
11969 var x = Q.affineX
11970 var y = Q.affineY
11971 var a = this.a
11972 var b = this.b
11973 var p = this.p
11974
11975 // Check that xQ and yQ are integers in the interval [0, p - 1]
11976 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
11977 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
11978
11979 // and check that y^2 = x^3 + ax + b (mod p)
11980 var lhs = y.square().mod(p)
11981 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
11982 return lhs.equals(rhs)
11983 }
11984
11985 /**
11986 * Validate an elliptic curve point.
11987 *
11988 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
11989 */
11990 Curve.prototype.validate = function(Q) {
11991 // Check Q != O
11992 assert(!this.isInfinity(Q), 'Point is at infinity')
11993 assert(this.isOnCurve(Q), 'Point is not on the curve')
11994
11995 // Check nQ = O (where Q is a scalar multiple of G)
11996 var nQ = Q.multiply(this.n)
11997 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
11998
11999 return true
12000 }
12001
12002 module.exports = Curve
12003
12004 },{"./point":67,"assert":4,"bigi":3}],64:[function(_dereq_,module,exports){
12005 module.exports={
12006 "secp128r1": {
12007 "p": "fffffffdffffffffffffffffffffffff",
12008 "a": "fffffffdfffffffffffffffffffffffc",
12009 "b": "e87579c11079f43dd824993c2cee5ed3",
12010 "n": "fffffffe0000000075a30d1b9038a115",
12011 "h": "01",
12012 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
12013 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
12014 },
12015 "secp160k1": {
12016 "p": "fffffffffffffffffffffffffffffffeffffac73",
12017 "a": "00",
12018 "b": "07",
12019 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
12020 "h": "01",
12021 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
12022 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
12023 },
12024 "secp160r1": {
12025 "p": "ffffffffffffffffffffffffffffffff7fffffff",
12026 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
12027 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
12028 "n": "0100000000000000000001f4c8f927aed3ca752257",
12029 "h": "01",
12030 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
12031 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
12032 },
12033 "secp192k1": {
12034 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
12035 "a": "00",
12036 "b": "03",
12037 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
12038 "h": "01",
12039 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
12040 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
12041 },
12042 "secp192r1": {
12043 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
12044 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
12045 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
12046 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
12047 "h": "01",
12048 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
12049 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
12050 },
12051 "secp224r1": {
12052 "p": "ffffffffffffffffffffffffffffffff000000000000000000000001",
12053 "a": "fffffffffffffffffffffffffffffffefffffffffffffffffffffffe",
12054 "b": "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4",
12055 "n": "ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d",
12056 "h": "01",
12057 "Gx": "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21",
12058 "Gy": "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"
12059 },
12060 "secp256k1": {
12061 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
12062 "a": "00",
12063 "b": "07",
12064 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
12065 "h": "01",
12066 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
12067 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
12068 },
12069 "secp256r1": {
12070 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
12071 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
12072 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
12073 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
12074 "h": "01",
12075 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
12076 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
12077 }
12078 }
12079
12080 },{}],65:[function(_dereq_,module,exports){
12081 var Point = _dereq_('./point')
12082 var Curve = _dereq_('./curve')
12083
12084 var getCurveByName = _dereq_('./names')
12085
12086 module.exports = {
12087 Curve: Curve,
12088 Point: Point,
12089 getCurveByName: getCurveByName
12090 }
12091
12092 },{"./curve":63,"./names":66,"./point":67}],66:[function(_dereq_,module,exports){
12093 var BigInteger = _dereq_('bigi')
12094
12095 var curves = _dereq_('./curves')
12096 var Curve = _dereq_('./curve')
12097
12098 function getCurveByName(name) {
12099 var curve = curves[name]
12100 if (!curve) return null
12101
12102 var p = new BigInteger(curve.p, 16)
12103 var a = new BigInteger(curve.a, 16)
12104 var b = new BigInteger(curve.b, 16)
12105 var n = new BigInteger(curve.n, 16)
12106 var h = new BigInteger(curve.h, 16)
12107 var Gx = new BigInteger(curve.Gx, 16)
12108 var Gy = new BigInteger(curve.Gy, 16)
12109
12110 return new Curve(p, a, b, Gx, Gy, n, h)
12111 }
12112
12113 module.exports = getCurveByName
12114
12115 },{"./curve":63,"./curves":64,"bigi":3}],67:[function(_dereq_,module,exports){
12116 (function (Buffer){
12117 var assert = _dereq_('assert')
12118 var BigInteger = _dereq_('bigi')
12119
12120 var THREE = BigInteger.valueOf(3)
12121
12122 function Point(curve, x, y, z) {
12123 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
12124
12125 this.curve = curve
12126 this.x = x
12127 this.y = y
12128 this.z = z
12129 this._zInv = null
12130
12131 this.compressed = true
12132 }
12133
12134 Object.defineProperty(Point.prototype, 'zInv', {
12135 get: function() {
12136 if (this._zInv === null) {
12137 this._zInv = this.z.modInverse(this.curve.p)
12138 }
12139
12140 return this._zInv
12141 }
12142 })
12143
12144 Object.defineProperty(Point.prototype, 'affineX', {
12145 get: function() {
12146 return this.x.multiply(this.zInv).mod(this.curve.p)
12147 }
12148 })
12149
12150 Object.defineProperty(Point.prototype, 'affineY', {
12151 get: function() {
12152 return this.y.multiply(this.zInv).mod(this.curve.p)
12153 }
12154 })
12155
12156 Point.fromAffine = function(curve, x, y) {
12157 return new Point(curve, x, y, BigInteger.ONE)
12158 }
12159
12160 Point.prototype.equals = function(other) {
12161 if (other === this) return true
12162 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
12163 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
12164
12165 // u = Y2 * Z1 - Y1 * Z2
12166 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
12167
12168 if (u.signum() !== 0) return false
12169
12170 // v = X2 * Z1 - X1 * Z2
12171 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
12172
12173 return v.signum() === 0
12174 }
12175
12176 Point.prototype.negate = function() {
12177 var y = this.curve.p.subtract(this.y)
12178
12179 return new Point(this.curve, this.x, y, this.z)
12180 }
12181
12182 Point.prototype.add = function(b) {
12183 if (this.curve.isInfinity(this)) return b
12184 if (this.curve.isInfinity(b)) return this
12185
12186 var x1 = this.x
12187 var y1 = this.y
12188 var x2 = b.x
12189 var y2 = b.y
12190
12191 // u = Y2 * Z1 - Y1 * Z2
12192 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
12193 // v = X2 * Z1 - X1 * Z2
12194 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
12195
12196 if (v.signum() === 0) {
12197 if (u.signum() === 0) {
12198 return this.twice() // this == b, so double
12199 }
12200
12201 return this.curve.infinity // this = -b, so infinity
12202 }
12203
12204 var v2 = v.square()
12205 var v3 = v2.multiply(v)
12206 var x1v2 = x1.multiply(v2)
12207 var zu2 = u.square().multiply(this.z)
12208
12209 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
12210 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
12211 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
12212 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)
12213 // z3 = v^3 * z1 * z2
12214 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
12215
12216 return new Point(this.curve, x3, y3, z3)
12217 }
12218
12219 Point.prototype.twice = function() {
12220 if (this.curve.isInfinity(this)) return this
12221 if (this.y.signum() === 0) return this.curve.infinity
12222
12223 var x1 = this.x
12224 var y1 = this.y
12225
12226 var y1z1 = y1.multiply(this.z)
12227 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
12228 var a = this.curve.a
12229
12230 // w = 3 * x1^2 + a * z1^2
12231 var w = x1.square().multiply(THREE)
12232
12233 if (a.signum() !== 0) {
12234 w = w.add(this.z.square().multiply(a))
12235 }
12236
12237 w = w.mod(this.curve.p)
12238 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
12239 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
12240 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
12241 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
12242 // z3 = 8 * (y1 * z1)^3
12243 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
12244
12245 return new Point(this.curve, x3, y3, z3)
12246 }
12247
12248 // Simple NAF (Non-Adjacent Form) multiplication algorithm
12249 // TODO: modularize the multiplication algorithm
12250 Point.prototype.multiply = function(k) {
12251 if (this.curve.isInfinity(this)) return this
12252 if (k.signum() === 0) return this.curve.infinity
12253
12254 var e = k
12255 var h = e.multiply(THREE)
12256
12257 var neg = this.negate()
12258 var R = this
12259
12260 for (var i = h.bitLength() - 2; i > 0; --i) {
12261 R = R.twice()
12262
12263 var hBit = h.testBit(i)
12264 var eBit = e.testBit(i)
12265
12266 if (hBit != eBit) {
12267 R = R.add(hBit ? this : neg)
12268 }
12269 }
12270
12271 return R
12272 }
12273
12274 // Compute this*j + x*k (simultaneous multiplication)
12275 Point.prototype.multiplyTwo = function(j, x, k) {
12276 var i
12277
12278 if (j.bitLength() > k.bitLength())
12279 i = j.bitLength() - 1
12280 else
12281 i = k.bitLength() - 1
12282
12283 var R = this.curve.infinity
12284 var both = this.add(x)
12285
12286 while (i >= 0) {
12287 R = R.twice()
12288
12289 var jBit = j.testBit(i)
12290 var kBit = k.testBit(i)
12291
12292 if (jBit) {
12293 if (kBit) {
12294 R = R.add(both)
12295
12296 } else {
12297 R = R.add(this)
12298 }
12299
12300 } else {
12301 if (kBit) {
12302 R = R.add(x)
12303 }
12304 }
12305 --i
12306 }
12307
12308 return R
12309 }
12310
12311 Point.prototype.getEncoded = function(compressed) {
12312 if (compressed == undefined) compressed = this.compressed
12313 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00'
12314
12315 var x = this.affineX
12316 var y = this.affineY
12317
12318 var buffer
12319
12320 // Determine size of q in bytes
12321 var byteLength = Math.floor((this.curve.p.bitLength() + 7) / 8)
12322
12323 // 0x02/0x03 | X
12324 if (compressed) {
12325 buffer = new Buffer(1 + byteLength)
12326 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
12327
12328 // 0x04 | X | Y
12329 } else {
12330 buffer = new Buffer(1 + byteLength + byteLength)
12331 buffer.writeUInt8(0x04, 0)
12332
12333 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
12334 }
12335
12336 x.toBuffer(byteLength).copy(buffer, 1)
12337
12338 return buffer
12339 }
12340
12341 Point.decodeFrom = function(curve, buffer) {
12342 var type = buffer.readUInt8(0)
12343 var compressed = (type !== 4)
12344
12345 var x = BigInteger.fromBuffer(buffer.slice(1, 33))
12346 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
12347
12348 var Q
12349 if (compressed) {
12350 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
12351 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
12352
12353 var isOdd = (type === 0x03)
12354 Q = curve.pointFromX(isOdd, x)
12355
12356 } else {
12357 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
12358
12359 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
12360 Q = Point.fromAffine(curve, x, y)
12361 }
12362
12363 Q.compressed = compressed
12364 return Q
12365 }
12366
12367 Point.prototype.toString = function () {
12368 if (this.curve.isInfinity(this)) return '(INFINITY)'
12369
12370 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
12371 }
12372
12373 module.exports = Point
12374
12375 }).call(this,_dereq_("buffer").Buffer)
12376 },{"assert":4,"bigi":3,"buffer":8}],68:[function(_dereq_,module,exports){
12377 (function (process,Buffer){
12378 // Closure compiler error - result of 'not' operator not being used
12379 //!function(globals){
12380 (function(globals){
12381 'use strict'
12382
12383 //*** UMD BEGIN
12384 if (typeof define !== 'undefined' && define.amd) { //require.js / AMD
12385 define([], function() {
12386 return secureRandom
12387 })
12388 } else if (typeof module !== 'undefined' && module.exports) { //CommonJS
12389 module.exports = secureRandom
12390 } else { //script / browser
12391 globals.secureRandom = secureRandom
12392 }
12393 //*** UMD END
12394
12395 //options.type is the only valid option
12396 function secureRandom(count, options) {
12397 options = options || {type: 'Array'}
12398 //we check for process.pid to prevent browserify from tricking us
12399 if (typeof process != 'undefined' && typeof process.pid == 'number') {
12400 return nodeRandom(count, options)
12401 } else {
12402 var crypto = window.crypto || window.msCrypto
12403 if (!crypto) throw new Error("Your browser does not support window.crypto.")
12404 return browserRandom(count, options)
12405 }
12406 }
12407
12408 function nodeRandom(count, options) {
12409 var crypto = _dereq_('crypto')
12410 var buf = crypto.randomBytes(count)
12411
12412 switch (options.type) {
12413 case 'Array':
12414 return [].slice.call(buf)
12415 case 'Buffer':
12416 return buf
12417 case 'Uint8Array':
12418 var arr = new Uint8Array(count)
12419 for (var i = 0; i < count; ++i) { arr[i] = buf.readUInt8(i) }
12420 return arr
12421 default:
12422 throw new Error(options.type + " is unsupported.")
12423 }
12424 }
12425
12426 function browserRandom(count, options) {
12427 var nativeArr = new Uint8Array(count)
12428 var crypto = window.crypto || window.msCrypto
12429 crypto.getRandomValues(nativeArr)
12430
12431 switch (options.type) {
12432 case 'Array':
12433 return [].slice.call(nativeArr)
12434 case 'Buffer':
12435 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.')}
12436 return new Buffer(nativeArr)
12437 case 'Uint8Array':
12438 return nativeArr
12439 default:
12440 throw new Error(options.type + " is unsupported.")
12441 }
12442 }
12443
12444 secureRandom.randomArray = function(byteCount) {
12445 return secureRandom(byteCount, {type: 'Array'})
12446 }
12447
12448 secureRandom.randomUint8Array = function(byteCount) {
12449 return secureRandom(byteCount, {type: 'Uint8Array'})
12450 }
12451
12452 secureRandom.randomBuffer = function(byteCount) {
12453 return secureRandom(byteCount, {type: 'Buffer'})
12454 }
12455
12456
12457 })(this);
12458
12459 }).call(this,_dereq_("FWaASH"),_dereq_("buffer").Buffer)
12460 },{"FWaASH":12,"buffer":8,"crypto":7}],69:[function(_dereq_,module,exports){
12461 (function (Buffer){
12462 var assert = _dereq_('assert')
12463 var base58check = _dereq_('./base58check')
12464 var networks = _dereq_('./networks')
12465 var scripts = _dereq_('./scripts')
12466
12467 function findScriptTypeByVersion(version) {
12468 for (var networkName in networks) {
12469 var network = networks[networkName]
12470
12471 if (version === network.pubKeyHash) return 'pubkeyhash'
12472 if (version === network.scriptHash) return 'scripthash'
12473 }
12474 }
12475
12476 function Address(hash, version) {
12477 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
12478 assert.strictEqual(hash.length, 20, 'Invalid hash length')
12479 assert.strictEqual(version & 0xff, version, 'Invalid version byte')
12480
12481 this.hash = hash
12482 this.version = version
12483 }
12484
12485 // Import functions
12486 Address.fromBase58Check = function(string) {
12487 var payload = base58check.decode(string)
12488 var version = payload.readUInt8(0)
12489 var hash = payload.slice(1)
12490
12491 return new Address(hash, version)
12492 }
12493
12494 Address.fromOutputScript = function(script, network) {
12495 network = network || networks.bitcoin
12496
12497 var type = scripts.classifyOutput(script)
12498
12499 if (type === 'pubkeyhash') return new Address(script.chunks[2], network.pubKeyHash)
12500 if (type === 'scripthash') return new Address(script.chunks[1], network.scriptHash)
12501
12502 assert(false, type + ' has no matching Address')
12503 }
12504
12505 // Export functions
12506 Address.prototype.toBase58Check = function () {
12507 var payload = new Buffer(21)
12508 payload.writeUInt8(this.version, 0)
12509 this.hash.copy(payload, 1)
12510
12511 return base58check.encode(payload)
12512 }
12513
12514 Address.prototype.toOutputScript = function() {
12515 var scriptType = findScriptTypeByVersion(this.version)
12516
12517 if (scriptType === 'pubkeyhash') return scripts.pubKeyHashOutput(this.hash)
12518 if (scriptType === 'scripthash') return scripts.scriptHashOutput(this.hash)
12519
12520 assert(false, this.toString() + ' has no matching Script')
12521 }
12522
12523 Address.prototype.toString = Address.prototype.toBase58Check
12524
12525 module.exports = Address
12526
12527 }).call(this,_dereq_("buffer").Buffer)
12528 },{"./base58check":70,"./networks":81,"./scripts":84,"assert":4,"buffer":8}],70:[function(_dereq_,module,exports){
12529 (function (Buffer){
12530 // https://en.bitcoin.it/wiki/Base58Check_encoding
12531 var assert = _dereq_('assert')
12532 var base58 = _dereq_('bs58')
12533 var crypto = _dereq_('./crypto')
12534
12535 // Encode a buffer as a base58-check-encoded string
12536 function encode(payload) {
12537 var checksum = crypto.hash256(payload).slice(0, 4)
12538
12539 return base58.encode(Buffer.concat([
12540 payload,
12541 checksum
12542 ]))
12543 }
12544
12545 // Decode a base58-check-encoded string to a buffer
12546 function decode(string) {
12547 var buffer = base58.decode(string)
12548
12549 var payload = buffer.slice(0, -4)
12550 var checksum = buffer.slice(-4)
12551 var newChecksum = crypto.hash256(payload).slice(0, 4)
12552
12553 assert.deepEqual(newChecksum, checksum, 'Invalid checksum')
12554
12555 return payload
12556 }
12557
12558 module.exports = {
12559 encode: encode,
12560 decode: decode
12561 }
12562
12563 }).call(this,_dereq_("buffer").Buffer)
12564 },{"./crypto":73,"assert":4,"bs58":15,"buffer":8}],71:[function(_dereq_,module,exports){
12565 var assert = _dereq_('assert')
12566 var opcodes = _dereq_('./opcodes')
12567
12568 // https://github.com/feross/buffer/blob/master/index.js#L1127
12569 function verifuint(value, max) {
12570 assert(typeof value === 'number', 'cannot write a non-number as a number')
12571 assert(value >= 0, 'specified a negative value for writing an unsigned value')
12572 assert(value <= max, 'value is larger than maximum value for type')
12573 assert(Math.floor(value) === value, 'value has a fractional component')
12574 }
12575
12576 function pushDataSize(i) {
12577 return i < opcodes.OP_PUSHDATA1 ? 1
12578 : i < 0xff ? 2
12579 : i < 0xffff ? 3
12580 : 5
12581 }
12582
12583 function readPushDataInt(buffer, offset) {
12584 var opcode = buffer.readUInt8(offset)
12585 var number, size
12586
12587 // ~6 bit
12588 if (opcode < opcodes.OP_PUSHDATA1) {
12589 number = opcode
12590 size = 1
12591
12592 // 8 bit
12593 } else if (opcode === opcodes.OP_PUSHDATA1) {
12594 number = buffer.readUInt8(offset + 1)
12595 size = 2
12596
12597 // 16 bit
12598 } else if (opcode === opcodes.OP_PUSHDATA2) {
12599 number = buffer.readUInt16LE(offset + 1)
12600 size = 3
12601
12602 // 32 bit
12603 } else {
12604 assert.equal(opcode, opcodes.OP_PUSHDATA4, 'Unexpected opcode')
12605
12606 number = buffer.readUInt32LE(offset + 1)
12607 size = 5
12608
12609 }
12610
12611 return {
12612 opcode: opcode,
12613 number: number,
12614 size: size
12615 }
12616 }
12617
12618 function readUInt64LE(buffer, offset) {
12619 var a = buffer.readUInt32LE(offset)
12620 var b = buffer.readUInt32LE(offset + 4)
12621 b *= 0x100000000
12622
12623 verifuint(b + a, 0x001fffffffffffff)
12624
12625 return b + a
12626 }
12627
12628 function readVarInt(buffer, offset) {
12629 var t = buffer.readUInt8(offset)
12630 var number, size
12631
12632 // 8 bit
12633 if (t < 253) {
12634 number = t
12635 size = 1
12636
12637 // 16 bit
12638 } else if (t < 254) {
12639 number = buffer.readUInt16LE(offset + 1)
12640 size = 3
12641
12642 // 32 bit
12643 } else if (t < 255) {
12644 number = buffer.readUInt32LE(offset + 1)
12645 size = 5
12646
12647 // 64 bit
12648 } else {
12649 number = readUInt64LE(buffer, offset + 1)
12650 size = 9
12651 }
12652
12653 return {
12654 number: number,
12655 size: size
12656 }
12657 }
12658
12659 function writePushDataInt(buffer, number, offset) {
12660 var size = pushDataSize(number)
12661
12662 // ~6 bit
12663 if (size === 1) {
12664 buffer.writeUInt8(number, offset)
12665
12666 // 8 bit
12667 } else if (size === 2) {
12668 buffer.writeUInt8(opcodes.OP_PUSHDATA1, offset)
12669 buffer.writeUInt8(number, offset + 1)
12670
12671 // 16 bit
12672 } else if (size === 3) {
12673 buffer.writeUInt8(opcodes.OP_PUSHDATA2, offset)
12674 buffer.writeUInt16LE(number, offset + 1)
12675
12676 // 32 bit
12677 } else {
12678 buffer.writeUInt8(opcodes.OP_PUSHDATA4, offset)
12679 buffer.writeUInt32LE(number, offset + 1)
12680
12681 }
12682
12683 return size
12684 }
12685
12686 function writeUInt64LE(buffer, value, offset) {
12687 verifuint(value, 0x001fffffffffffff)
12688
12689 buffer.writeInt32LE(value & -1, offset)
12690 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
12691 }
12692
12693 function varIntSize(i) {
12694 return i < 253 ? 1
12695 : i < 0x10000 ? 3
12696 : i < 0x100000000 ? 5
12697 : 9
12698 }
12699
12700 function writeVarInt(buffer, number, offset) {
12701 var size = varIntSize(number)
12702
12703 // 8 bit
12704 if (size === 1) {
12705 buffer.writeUInt8(number, offset)
12706
12707 // 16 bit
12708 } else if (size === 3) {
12709 buffer.writeUInt8(253, offset)
12710 buffer.writeUInt16LE(number, offset + 1)
12711
12712 // 32 bit
12713 } else if (size === 5) {
12714 buffer.writeUInt8(254, offset)
12715 buffer.writeUInt32LE(number, offset + 1)
12716
12717 // 64 bit
12718 } else {
12719 buffer.writeUInt8(255, offset)
12720 writeUInt64LE(buffer, number, offset + 1)
12721 }
12722
12723 return size
12724 }
12725
12726 module.exports = {
12727 pushDataSize: pushDataSize,
12728 readPushDataInt: readPushDataInt,
12729 readUInt64LE: readUInt64LE,
12730 readVarInt: readVarInt,
12731 varIntSize: varIntSize,
12732 writePushDataInt: writePushDataInt,
12733 writeUInt64LE: writeUInt64LE,
12734 writeVarInt: writeVarInt
12735 }
12736
12737 },{"./opcodes":82,"assert":4}],72:[function(_dereq_,module,exports){
12738 (function (Buffer){
12739 var assert = _dereq_('assert')
12740 var Crypto = _dereq_('crypto-js')
12741 var WordArray = Crypto.lib.WordArray
12742
12743 function bufferToWordArray(buffer) {
12744 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got', buffer)
12745
12746 var words = []
12747 for (var i = 0, b = 0; i < buffer.length; i++, b += 8) {
12748 words[b >>> 5] |= buffer[i] << (24 - b % 32)
12749 }
12750
12751 return new WordArray.init(words, buffer.length)
12752 }
12753
12754 function wordArrayToBuffer(wordArray) {
12755 assert(Array.isArray(wordArray.words), 'Expected WordArray, got' + wordArray)
12756
12757 var words = wordArray.words
12758 var buffer = new Buffer(words.length * 4)
12759
12760 words.forEach(function(value, i) {
12761 buffer.writeInt32BE(value & -1, i * 4)
12762 })
12763
12764 return buffer
12765 }
12766
12767 module.exports = {
12768 bufferToWordArray: bufferToWordArray,
12769 wordArrayToBuffer: wordArrayToBuffer
12770 }
12771
12772 }).call(this,_dereq_("buffer").Buffer)
12773 },{"assert":4,"buffer":8,"crypto-js":37}],73:[function(_dereq_,module,exports){
12774 (function (Buffer){
12775 // Crypto, crypto, where art thou crypto
12776 var assert = _dereq_('assert')
12777 var CryptoJS = _dereq_('crypto-js')
12778 var crypto = _dereq_('crypto')
12779 var convert = _dereq_('./convert')
12780
12781 function hash160(buffer) {
12782 return ripemd160(sha256(buffer))
12783 }
12784
12785 function hash256(buffer) {
12786 return sha256(sha256(buffer))
12787 }
12788
12789 function ripemd160(buffer) {
12790 return crypto.createHash('rmd160').update(buffer).digest()
12791 }
12792
12793 function sha1(buffer) {
12794 return crypto.createHash('sha1').update(buffer).digest()
12795 }
12796
12797 function sha256(buffer) {
12798 return crypto.createHash('sha256').update(buffer).digest()
12799 }
12800
12801 // FIXME: Name not consistent with others
12802 function HmacSHA256(buffer, secret) {
12803 return crypto.createHmac('sha256', secret).update(buffer).digest()
12804 }
12805
12806 function HmacSHA512(data, secret) {
12807 assert(Buffer.isBuffer(data), 'Expected Buffer for data, got ' + data)
12808 assert(Buffer.isBuffer(secret), 'Expected Buffer for secret, got ' + secret)
12809
12810 var dataWords = convert.bufferToWordArray(data)
12811 var secretWords = convert.bufferToWordArray(secret)
12812
12813 var hash = CryptoJS.HmacSHA512(dataWords, secretWords)
12814
12815 return convert.wordArrayToBuffer(hash)
12816 }
12817
12818 module.exports = {
12819 ripemd160: ripemd160,
12820 sha1: sha1,
12821 sha256: sha256,
12822 hash160: hash160,
12823 hash256: hash256,
12824 HmacSHA256: HmacSHA256,
12825 HmacSHA512: HmacSHA512
12826 }
12827
12828 }).call(this,_dereq_("buffer").Buffer)
12829 },{"./convert":72,"assert":4,"buffer":8,"crypto":19,"crypto-js":37}],74:[function(_dereq_,module,exports){
12830 (function (Buffer){
12831 var assert = _dereq_('assert')
12832 var crypto = _dereq_('./crypto')
12833
12834 var BigInteger = _dereq_('bigi')
12835 var ECSignature = _dereq_('./ecsignature')
12836 var Point = _dereq_('ecurve').Point
12837
12838 // https://tools.ietf.org/html/rfc6979#section-3.2
12839 function deterministicGenerateK(curve, hash, d) {
12840 assert(Buffer.isBuffer(hash), 'Hash must be a Buffer, not ' + hash)
12841 assert.equal(hash.length, 32, 'Hash must be 256 bit')
12842 assert(d instanceof BigInteger, 'Private key must be a BigInteger')
12843
12844 var x = d.toBuffer(32)
12845 var k = new Buffer(32)
12846 var v = new Buffer(32)
12847
12848 // Step B
12849 v.fill(1)
12850
12851 // Step C
12852 k.fill(0)
12853
12854 // Step D
12855 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0]), x, hash]), k)
12856
12857 // Step E
12858 v = crypto.HmacSHA256(v, k)
12859
12860 // Step F
12861 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([1]), x, hash]), k)
12862
12863 // Step G
12864 v = crypto.HmacSHA256(v, k)
12865
12866 // Step H1/H2a, ignored as tlen === qlen (256 bit)
12867 // Step H2b
12868 v = crypto.HmacSHA256(v, k)
12869
12870 var T = BigInteger.fromBuffer(v)
12871
12872 // Step H3, repeat until T is within the interval [1, n - 1]
12873 while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0)) {
12874 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0])]), k)
12875 v = crypto.HmacSHA256(v, k)
12876
12877 T = BigInteger.fromBuffer(v)
12878 }
12879
12880 return T
12881 }
12882
12883 function sign(curve, hash, d) {
12884 var k = deterministicGenerateK(curve, hash, d)
12885
12886 var n = curve.n
12887 var G = curve.G
12888 var Q = G.multiply(k)
12889 var e = BigInteger.fromBuffer(hash)
12890
12891 var r = Q.affineX.mod(n)
12892 assert.notEqual(r.signum(), 0, 'Invalid R value')
12893
12894 var s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
12895 assert.notEqual(s.signum(), 0, 'Invalid S value')
12896
12897 var N_OVER_TWO = n.shiftRight(1)
12898
12899 // enforce low S values, see bip62: 'low s values in signatures'
12900 if (s.compareTo(N_OVER_TWO) > 0) {
12901 s = n.subtract(s)
12902 }
12903
12904 return new ECSignature(r, s)
12905 }
12906
12907 function verify(curve, hash, signature, Q) {
12908 var e = BigInteger.fromBuffer(hash)
12909
12910 return verifyRaw(curve, e, signature, Q)
12911 }
12912
12913 function verifyRaw(curve, e, signature, Q) {
12914 var n = curve.n
12915 var G = curve.G
12916
12917 var r = signature.r
12918 var s = signature.s
12919
12920 if (r.signum() === 0 || r.compareTo(n) >= 0) return false
12921 if (s.signum() === 0 || s.compareTo(n) >= 0) return false
12922
12923 var c = s.modInverse(n)
12924
12925 var u1 = e.multiply(c).mod(n)
12926 var u2 = r.multiply(c).mod(n)
12927
12928 var point = G.multiplyTwo(u1, Q, u2)
12929 var v = point.affineX.mod(n)
12930
12931 return v.equals(r)
12932 }
12933
12934 /**
12935 * Recover a public key from a signature.
12936 *
12937 * See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public
12938 * Key Recovery Operation".
12939 *
12940 * http://www.secg.org/download/aid-780/sec1-v2.pdf
12941 */
12942 function recoverPubKey(curve, e, signature, i) {
12943 assert.strictEqual(i & 3, i, 'Recovery param is more than two bits')
12944
12945 var r = signature.r
12946 var s = signature.s
12947
12948 // A set LSB signifies that the y-coordinate is odd
12949 var isYOdd = i & 1
12950
12951 // The more significant bit specifies whether we should use the
12952 // first or second candidate key.
12953 var isSecondKey = i >> 1
12954
12955 var n = curve.n
12956 var G = curve.G
12957
12958 // 1.1 Let x = r + jn
12959 var x = isSecondKey ? r.add(n) : r
12960 var R = curve.pointFromX(isYOdd, x)
12961
12962 // 1.4 Check that nR is at infinity
12963 var nR = R.multiply(n)
12964 assert(curve.isInfinity(nR), 'nR is not a valid curve point')
12965
12966 // Compute -e from e
12967 var eNeg = e.negate().mod(n)
12968
12969 // 1.6.1 Compute Q = r^-1 (sR - eG)
12970 // Q = r^-1 (sR + -eG)
12971 var rInv = r.modInverse(n)
12972
12973 var Q = R.multiplyTwo(s, G, eNeg).multiply(rInv)
12974 curve.validate(Q)
12975
12976 return Q
12977 }
12978
12979 /**
12980 * Calculate pubkey extraction parameter.
12981 *
12982 * When extracting a pubkey from a signature, we have to
12983 * distinguish four different cases. Rather than putting this
12984 * burden on the verifier, Bitcoin includes a 2-bit value with the
12985 * signature.
12986 *
12987 * This function simply tries all four cases and returns the value
12988 * that resulted in a successful pubkey recovery.
12989 */
12990 function calcPubKeyRecoveryParam(curve, e, signature, Q) {
12991 for (var i = 0; i < 4; i++) {
12992 var Qprime = recoverPubKey(curve, e, signature, i)
12993
12994 // 1.6.2 Verify Q
12995 if (Qprime.equals(Q)) {
12996 return i
12997 }
12998 }
12999
13000 throw new Error('Unable to find valid recovery factor')
13001 }
13002
13003 module.exports = {
13004 calcPubKeyRecoveryParam: calcPubKeyRecoveryParam,
13005 deterministicGenerateK: deterministicGenerateK,
13006 recoverPubKey: recoverPubKey,
13007 sign: sign,
13008 verify: verify,
13009 verifyRaw: verifyRaw
13010 }
13011
13012 }).call(this,_dereq_("buffer").Buffer)
13013 },{"./crypto":73,"./ecsignature":77,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],75:[function(_dereq_,module,exports){
13014 (function (Buffer){
13015 var assert = _dereq_('assert')
13016 var base58check = _dereq_('./base58check')
13017 var ecdsa = _dereq_('./ecdsa')
13018 var networks = _dereq_('./networks')
13019 var secureRandom = _dereq_('secure-random')
13020
13021 var BigInteger = _dereq_('bigi')
13022 var ECPubKey = _dereq_('./ecpubkey')
13023
13024 var ecurve = _dereq_('ecurve')
13025 var curve = ecurve.getCurveByName('secp256k1')
13026
13027 function ECKey(d, compressed) {
13028 assert(d.signum() > 0, 'Private key must be greater than 0')
13029 assert(d.compareTo(curve.n) < 0, 'Private key must be less than the curve order')
13030
13031 var Q = curve.G.multiply(d)
13032
13033 this.d = d
13034 this.pub = new ECPubKey(Q, compressed)
13035 }
13036
13037 // Static constructors
13038 ECKey.fromWIF = function(string) {
13039 var payload = base58check.decode(string)
13040 var compressed = false
13041
13042 // Ignore the version byte
13043 payload = payload.slice(1)
13044
13045 if (payload.length === 33) {
13046 assert.strictEqual(payload[32], 0x01, 'Invalid compression flag')
13047
13048 // Truncate the compression flag
13049 payload = payload.slice(0, -1)
13050 compressed = true
13051 }
13052
13053 assert.equal(payload.length, 32, 'Invalid WIF payload length')
13054
13055 var d = BigInteger.fromBuffer(payload)
13056 return new ECKey(d, compressed)
13057 }
13058
13059 ECKey.makeRandom = function(compressed, rng) {
13060 rng = rng || secureRandom.randomBuffer
13061
13062 var buffer = rng(32)
13063 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
13064
13065 var d = BigInteger.fromBuffer(buffer)
13066 d = d.mod(curve.n)
13067
13068 return new ECKey(d, compressed)
13069 }
13070
13071 // Export functions
13072 ECKey.prototype.toWIF = function(network) {
13073 network = network || networks.bitcoin
13074
13075 var bufferLen = this.pub.compressed ? 34 : 33
13076 var buffer = new Buffer(bufferLen)
13077
13078 buffer.writeUInt8(network.wif, 0)
13079 this.d.toBuffer(32).copy(buffer, 1)
13080
13081 if (this.pub.compressed) {
13082 buffer.writeUInt8(0x01, 33)
13083 }
13084
13085 return base58check.encode(buffer)
13086 }
13087
13088 // Operations
13089 ECKey.prototype.sign = function(hash) {
13090 return ecdsa.sign(curve, hash, this.d)
13091 }
13092
13093 module.exports = ECKey
13094
13095 }).call(this,_dereq_("buffer").Buffer)
13096 },{"./base58check":70,"./ecdsa":74,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65,"secure-random":68}],76:[function(_dereq_,module,exports){
13097 (function (Buffer){
13098 var assert = _dereq_('assert')
13099 var crypto = _dereq_('./crypto')
13100 var ecdsa = _dereq_('./ecdsa')
13101 var networks = _dereq_('./networks')
13102
13103 var Address = _dereq_('./address')
13104
13105 var ecurve = _dereq_('ecurve')
13106 var curve = ecurve.getCurveByName('secp256k1')
13107
13108 function ECPubKey(Q, compressed) {
13109 assert(Q instanceof ecurve.Point, 'Expected Point, got ' + Q)
13110
13111 if (compressed == undefined) compressed = true
13112 assert.strictEqual(typeof compressed, 'boolean', 'Expected boolean, got ' + compressed)
13113
13114 this.compressed = compressed
13115 this.Q = Q
13116 }
13117
13118 // Static constructors
13119 ECPubKey.fromBuffer = function(buffer) {
13120 var Q = ecurve.Point.decodeFrom(curve, buffer)
13121 return new ECPubKey(Q, Q.compressed)
13122 }
13123
13124 ECPubKey.fromHex = function(hex) {
13125 return ECPubKey.fromBuffer(new Buffer(hex, 'hex'))
13126 }
13127
13128 // Operations
13129 ECPubKey.prototype.getAddress = function(network) {
13130 network = network || networks.bitcoin
13131
13132 return new Address(crypto.hash160(this.toBuffer()), network.pubKeyHash)
13133 }
13134
13135 ECPubKey.prototype.verify = function(hash, signature) {
13136 return ecdsa.verify(curve, hash, signature, this.Q)
13137 }
13138
13139 // Export functions
13140 ECPubKey.prototype.toBuffer = function() {
13141 return this.Q.getEncoded(this.compressed)
13142 }
13143
13144 ECPubKey.prototype.toHex = function() {
13145 return this.toBuffer().toString('hex')
13146 }
13147
13148 module.exports = ECPubKey
13149
13150 }).call(this,_dereq_("buffer").Buffer)
13151 },{"./address":69,"./crypto":73,"./ecdsa":74,"./networks":81,"assert":4,"buffer":8,"ecurve":65}],77:[function(_dereq_,module,exports){
13152 (function (Buffer){
13153 var assert = _dereq_('assert')
13154 var BigInteger = _dereq_('bigi')
13155
13156 function ECSignature(r, s) {
13157 assert(r instanceof BigInteger, 'Expected BigInteger, got ' + r)
13158 assert(s instanceof BigInteger, 'Expected BigInteger, got ' + s)
13159 this.r = r
13160 this.s = s
13161 }
13162
13163 // Import operations
13164 ECSignature.parseCompact = function(buffer) {
13165 assert.equal(buffer.length, 65, 'Invalid signature length')
13166 var i = buffer.readUInt8(0) - 27
13167
13168 // At most 3 bits
13169 assert.equal(i, i & 7, 'Invalid signature parameter')
13170 var compressed = !!(i & 4)
13171
13172 // Recovery param only
13173 i = i & 3
13174
13175 var r = BigInteger.fromBuffer(buffer.slice(1, 33))
13176 var s = BigInteger.fromBuffer(buffer.slice(33))
13177
13178 return {
13179 compressed: compressed,
13180 i: i,
13181 signature: new ECSignature(r, s)
13182 }
13183 }
13184
13185 ECSignature.fromDER = function(buffer) {
13186 assert.equal(buffer.readUInt8(0), 0x30, 'Not a DER sequence')
13187 assert.equal(buffer.readUInt8(1), buffer.length - 2, 'Invalid sequence length')
13188 assert.equal(buffer.readUInt8(2), 0x02, 'Expected a DER integer')
13189
13190 var rLen = buffer.readUInt8(3)
13191 assert(rLen > 0, 'R length is zero')
13192
13193 var offset = 4 + rLen
13194 assert.equal(buffer.readUInt8(offset), 0x02, 'Expected a DER integer (2)')
13195
13196 var sLen = buffer.readUInt8(offset + 1)
13197 assert(sLen > 0, 'S length is zero')
13198
13199 var rB = buffer.slice(4, offset)
13200 var sB = buffer.slice(offset + 2)
13201 offset += 2 + sLen
13202
13203 if (rLen > 1 && rB.readUInt8(0) === 0x00) {
13204 assert(rB.readUInt8(1) & 0x80, 'R value excessively padded')
13205 }
13206
13207 if (sLen > 1 && sB.readUInt8(0) === 0x00) {
13208 assert(sB.readUInt8(1) & 0x80, 'S value excessively padded')
13209 }
13210
13211 assert.equal(offset, buffer.length, 'Invalid DER encoding')
13212 var r = BigInteger.fromDERInteger(rB)
13213 var s = BigInteger.fromDERInteger(sB)
13214
13215 assert(r.signum() >= 0, 'R value is negative')
13216 assert(s.signum() >= 0, 'S value is negative')
13217
13218 return new ECSignature(r, s)
13219 }
13220
13221 // FIXME: 0x00, 0x04, 0x80 are SIGHASH_* boundary constants, importing Transaction causes a circular dependency
13222 ECSignature.parseScriptSignature = function(buffer) {
13223 var hashType = buffer.readUInt8(buffer.length - 1)
13224 var hashTypeMod = hashType & ~0x80
13225
13226 assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType')
13227
13228 return {
13229 signature: ECSignature.fromDER(buffer.slice(0, -1)),
13230 hashType: hashType
13231 }
13232 }
13233
13234 // Export operations
13235 ECSignature.prototype.toCompact = function(i, compressed) {
13236 if (compressed) i += 4
13237 i += 27
13238
13239 var buffer = new Buffer(65)
13240 buffer.writeUInt8(i, 0)
13241
13242 this.r.toBuffer(32).copy(buffer, 1)
13243 this.s.toBuffer(32).copy(buffer, 33)
13244
13245 return buffer
13246 }
13247
13248 ECSignature.prototype.toDER = function() {
13249 var rBa = this.r.toDERInteger()
13250 var sBa = this.s.toDERInteger()
13251
13252 var sequence = []
13253 sequence.push(0x02) // INTEGER
13254 sequence.push(rBa.length)
13255 sequence = sequence.concat(rBa)
13256
13257 sequence.push(0x02) // INTEGER
13258 sequence.push(sBa.length)
13259 sequence = sequence.concat(sBa)
13260
13261 sequence.unshift(sequence.length)
13262 sequence.unshift(0x30) // SEQUENCE
13263
13264 return new Buffer(sequence)
13265 }
13266
13267 ECSignature.prototype.toScriptSignature = function(hashType) {
13268 var hashTypeBuffer = new Buffer(1)
13269 hashTypeBuffer.writeUInt8(hashType, 0)
13270
13271 return Buffer.concat([this.toDER(), hashTypeBuffer])
13272 }
13273
13274 module.exports = ECSignature
13275
13276 }).call(this,_dereq_("buffer").Buffer)
13277 },{"assert":4,"bigi":3,"buffer":8}],78:[function(_dereq_,module,exports){
13278 (function (Buffer){
13279 var assert = _dereq_('assert')
13280 var base58check = _dereq_('./base58check')
13281 var crypto = _dereq_('./crypto')
13282 var networks = _dereq_('./networks')
13283
13284 var BigInteger = _dereq_('bigi')
13285 var ECKey = _dereq_('./eckey')
13286 var ECPubKey = _dereq_('./ecpubkey')
13287
13288 var ecurve = _dereq_('ecurve')
13289 var curve = ecurve.getCurveByName('secp256k1')
13290
13291 function findBIP32ParamsByVersion(version) {
13292 for (var name in networks) {
13293 var network = networks[name]
13294
13295 for (var type in network.bip32) {
13296 if (version != network.bip32[type]) continue
13297
13298 return {
13299 isPrivate: (type === 'private'),
13300 network: network
13301 }
13302 }
13303 }
13304
13305 assert(false, 'Could not find version ' + version.toString(16))
13306 }
13307
13308 function HDNode(K, chainCode, network) {
13309 network = network || networks.bitcoin
13310
13311 assert(Buffer.isBuffer(chainCode), 'Expected Buffer, got ' + chainCode)
13312 assert(network.bip32, 'Unknown BIP32 constants for network')
13313
13314 this.chainCode = chainCode
13315 this.depth = 0
13316 this.index = 0
13317 this.network = network
13318
13319 if (K instanceof BigInteger) {
13320 this.privKey = new ECKey(K, true)
13321 this.pubKey = this.privKey.pub
13322 } else {
13323 this.pubKey = new ECPubKey(K, true)
13324 }
13325 }
13326
13327 HDNode.MASTER_SECRET = new Buffer('Bitcoin seed')
13328 HDNode.HIGHEST_BIT = 0x80000000
13329 HDNode.LENGTH = 78
13330
13331 HDNode.fromSeedBuffer = function(seed, network) {
13332 var I = crypto.HmacSHA512(seed, HDNode.MASTER_SECRET)
13333 var IL = I.slice(0, 32)
13334 var IR = I.slice(32)
13335
13336 // In case IL is 0 or >= n, the master key is invalid
13337 // This is handled by `new ECKey` in the HDNode constructor
13338 var pIL = BigInteger.fromBuffer(IL)
13339
13340 return new HDNode(pIL, IR, network)
13341 }
13342
13343 HDNode.fromSeedHex = function(hex, network) {
13344 return HDNode.fromSeedBuffer(new Buffer(hex, 'hex'), network)
13345 }
13346
13347 HDNode.fromBase58 = function(string) {
13348 return HDNode.fromBuffer(base58check.decode(string))
13349 }
13350
13351 HDNode.fromBuffer = function(buffer) {
13352 assert.strictEqual(buffer.length, HDNode.LENGTH, 'Invalid buffer length')
13353
13354 // 4 byte: version bytes
13355 var version = buffer.readUInt32BE(0)
13356 var params = findBIP32ParamsByVersion(version)
13357
13358 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
13359 var depth = buffer.readUInt8(4)
13360
13361 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13362 var parentFingerprint = buffer.readUInt32BE(5)
13363 if (depth === 0) {
13364 assert.strictEqual(parentFingerprint, 0x00000000, 'Invalid parent fingerprint')
13365 }
13366
13367 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13368 // This is encoded in MSB order. (0x00000000 if master key)
13369 var index = buffer.readUInt32BE(9)
13370 assert(depth > 0 || index === 0, 'Invalid index')
13371
13372 // 32 bytes: the chain code
13373 var chainCode = buffer.slice(13, 45)
13374 var hd
13375
13376 // 33 bytes: private key data (0x00 + k)
13377 if (params.isPrivate) {
13378 assert.strictEqual(buffer.readUInt8(45), 0x00, 'Invalid private key')
13379 var data = buffer.slice(46, 78)
13380 var d = BigInteger.fromBuffer(data)
13381 hd = new HDNode(d, chainCode, params.network)
13382
13383 // 33 bytes: public key data (0x02 + X or 0x03 + X)
13384 } else {
13385 var data = buffer.slice(45, 78)
13386 var Q = ecurve.Point.decodeFrom(curve, data)
13387 assert.equal(Q.compressed, true, 'Invalid public key')
13388
13389 // Verify that the X coordinate in the public point corresponds to a point on the curve.
13390 // If not, the extended public key is invalid.
13391 curve.validate(Q)
13392
13393 hd = new HDNode(Q, chainCode, params.network)
13394 }
13395
13396 hd.depth = depth
13397 hd.index = index
13398 hd.parentFingerprint = parentFingerprint
13399
13400 return hd
13401 }
13402
13403 HDNode.fromHex = function(hex) {
13404 return HDNode.fromBuffer(new Buffer(hex, 'hex'))
13405 }
13406
13407 HDNode.prototype.getIdentifier = function() {
13408 return crypto.hash160(this.pubKey.toBuffer())
13409 }
13410
13411 HDNode.prototype.getFingerprint = function() {
13412 return this.getIdentifier().slice(0, 4)
13413 }
13414
13415 HDNode.prototype.getAddress = function() {
13416 return this.pubKey.getAddress(this.network)
13417 }
13418
13419 HDNode.prototype.toBase58 = function(isPrivate) {
13420 return base58check.encode(this.toBuffer(isPrivate))
13421 }
13422
13423 HDNode.prototype.toBuffer = function(isPrivate) {
13424 if (isPrivate == undefined) isPrivate = !!this.privKey
13425
13426 // Version
13427 var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
13428 var buffer = new Buffer(HDNode.LENGTH)
13429
13430 // 4 bytes: version bytes
13431 buffer.writeUInt32BE(version, 0)
13432
13433 // Depth
13434 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
13435 buffer.writeUInt8(this.depth, 4)
13436
13437 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13438 var fingerprint = (this.depth === 0) ? 0x00000000 : this.parentFingerprint
13439 buffer.writeUInt32BE(fingerprint, 5)
13440
13441 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13442 // This is encoded in Big endian. (0x00000000 if master key)
13443 buffer.writeUInt32BE(this.index, 9)
13444
13445 // 32 bytes: the chain code
13446 this.chainCode.copy(buffer, 13)
13447
13448 // 33 bytes: the public key or private key data
13449 if (isPrivate) {
13450 assert(this.privKey, 'Missing private key')
13451
13452 // 0x00 + k for private keys
13453 buffer.writeUInt8(0, 45)
13454 this.privKey.d.toBuffer(32).copy(buffer, 46)
13455 } else {
13456
13457 // X9.62 encoding for public keys
13458 this.pubKey.toBuffer().copy(buffer, 45)
13459 }
13460
13461 return buffer
13462 }
13463
13464 HDNode.prototype.toHex = function(isPrivate) {
13465 return this.toBuffer(isPrivate).toString('hex')
13466 }
13467
13468 // https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
13469 HDNode.prototype.derive = function(index) {
13470 var isHardened = index >= HDNode.HIGHEST_BIT
13471 var indexBuffer = new Buffer(4)
13472 indexBuffer.writeUInt32BE(index, 0)
13473
13474 var data
13475
13476 // Hardened child
13477 if (isHardened) {
13478 assert(this.privKey, 'Could not derive hardened child key')
13479
13480 // data = 0x00 || ser256(kpar) || ser32(index)
13481 data = Buffer.concat([
13482 this.privKey.d.toBuffer(33),
13483 indexBuffer
13484 ])
13485
13486 // Normal child
13487 } else {
13488 // data = serP(point(kpar)) || ser32(index)
13489 // = serP(Kpar) || ser32(index)
13490 data = Buffer.concat([
13491 this.pubKey.toBuffer(),
13492 indexBuffer
13493 ])
13494 }
13495
13496 var I = crypto.HmacSHA512(data, this.chainCode)
13497 var IL = I.slice(0, 32)
13498 var IR = I.slice(32)
13499
13500 var pIL = BigInteger.fromBuffer(IL)
13501
13502 // In case parse256(IL) >= n, proceed with the next value for i
13503 if (pIL.compareTo(curve.n) >= 0) {
13504 return this.derive(index + 1)
13505 }
13506
13507 // Private parent key -> private child key
13508 var hd
13509 if (this.privKey) {
13510 // ki = parse256(IL) + kpar (mod n)
13511 var ki = pIL.add(this.privKey.d).mod(curve.n)
13512
13513 // In case ki == 0, proceed with the next value for i
13514 if (ki.signum() === 0) {
13515 return this.derive(index + 1)
13516 }
13517
13518 hd = new HDNode(ki, IR, this.network)
13519
13520 // Public parent key -> public child key
13521 } else {
13522 // Ki = point(parse256(IL)) + Kpar
13523 // = G*IL + Kpar
13524 var Ki = curve.G.multiply(pIL).add(this.pubKey.Q)
13525
13526 // In case Ki is the point at infinity, proceed with the next value for i
13527 if (curve.isInfinity(Ki)) {
13528 return this.derive(index + 1)
13529 }
13530
13531 hd = new HDNode(Ki, IR, this.network)
13532 }
13533
13534 hd.depth = this.depth + 1
13535 hd.index = index
13536 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
13537
13538 return hd
13539 }
13540
13541 HDNode.prototype.deriveHardened = function(index) {
13542 // Only derives hardened private keys by default
13543 return this.derive(index + HDNode.HIGHEST_BIT)
13544 }
13545
13546 HDNode.prototype.toString = HDNode.prototype.toBase58
13547
13548 module.exports = HDNode
13549
13550 }).call(this,_dereq_("buffer").Buffer)
13551 },{"./base58check":70,"./crypto":73,"./eckey":75,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],79:[function(_dereq_,module,exports){
13552 module.exports = {
13553 Address: _dereq_('./address'),
13554 base58check: _dereq_('./base58check'),
13555 bufferutils: _dereq_('./bufferutils'),
13556 convert: _dereq_('./convert'),
13557 crypto: _dereq_('./crypto'),
13558 ecdsa: _dereq_('./ecdsa'),
13559 ECKey: _dereq_('./eckey'),
13560 ECPubKey: _dereq_('./ecpubkey'),
13561 ECSignature: _dereq_('./ecsignature'),
13562 Message: _dereq_('./message'),
13563 opcodes: _dereq_('./opcodes'),
13564 HDNode: _dereq_('./hdnode'),
13565 Script: _dereq_('./script'),
13566 scripts: _dereq_('./scripts'),
13567 Transaction: _dereq_('./transaction'),
13568 networks: _dereq_('./networks'),
13569 Wallet: _dereq_('./wallet')
13570 }
13571
13572 },{"./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){
13573 (function (Buffer){
13574 /// Implements Bitcoin's feature for signing arbitrary messages.
13575 var Address = _dereq_('./address')
13576 var BigInteger = _dereq_('bigi')
13577 var bufferutils = _dereq_('./bufferutils')
13578 var crypto = _dereq_('./crypto')
13579 var ecdsa = _dereq_('./ecdsa')
13580 var networks = _dereq_('./networks')
13581
13582 var Address = _dereq_('./address')
13583 var ECPubKey = _dereq_('./ecpubkey')
13584 var ECSignature = _dereq_('./ecsignature')
13585
13586 var ecurve = _dereq_('ecurve')
13587 var ecparams = ecurve.getCurveByName('secp256k1')
13588
13589 function magicHash(message, network) {
13590 var magicPrefix = new Buffer(network.magicPrefix)
13591 var messageBuffer = new Buffer(message)
13592 var lengthBuffer = new Buffer(bufferutils.varIntSize(messageBuffer.length))
13593 bufferutils.writeVarInt(lengthBuffer, messageBuffer.length, 0)
13594
13595 var buffer = Buffer.concat([magicPrefix, lengthBuffer, messageBuffer])
13596 return crypto.hash256(buffer)
13597 }
13598
13599 function sign(privKey, message, network) {
13600 network = network || networks.bitcoin
13601
13602 var hash = magicHash(message, network)
13603 var signature = privKey.sign(hash)
13604 var e = BigInteger.fromBuffer(hash)
13605 var i = ecdsa.calcPubKeyRecoveryParam(ecparams, e, signature, privKey.pub.Q)
13606
13607 return signature.toCompact(i, privKey.pub.compressed)
13608 }
13609
13610 // TODO: network could be implied from address
13611 function verify(address, signatureBuffer, message, network) {
13612 if (address instanceof Address) {
13613 address = address.toString()
13614 }
13615 network = network || networks.bitcoin
13616
13617 var hash = magicHash(message, network)
13618 var parsed = ECSignature.parseCompact(signatureBuffer)
13619 var e = BigInteger.fromBuffer(hash)
13620 var Q = ecdsa.recoverPubKey(ecparams, e, parsed.signature, parsed.i)
13621
13622 var pubKey = new ECPubKey(Q, parsed.compressed)
13623 return pubKey.getAddress(network).toString() === address
13624 }
13625
13626 module.exports = {
13627 magicHash: magicHash,
13628 sign: sign,
13629 verify: verify
13630 }
13631
13632 }).call(this,_dereq_("buffer").Buffer)
13633 },{"./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){
13634 // https://en.bitcoin.it/wiki/List_of_address_prefixes
13635 // Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
13636
13637 var networks = {
13638 bitcoin: {
13639 magicPrefix: '\x18Bitcoin Signed Message:\n',
13640 bip32: {
13641 public: 0x0488b21e,
13642 private: 0x0488ade4
13643 },
13644 pubKeyHash: 0x00,
13645 scriptHash: 0x05,
13646 wif: 0x80,
13647 dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
13648 feePerKb: 10000, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/main.cpp#L53
13649 estimateFee: estimateFee('bitcoin')
13650 },
13651 dogecoin: {
13652 magicPrefix: '\x19Dogecoin Signed Message:\n',
13653 bip32: {
13654 public: 0x02facafd,
13655 private: 0x02fac398
13656 },
13657 pubKeyHash: 0x1e,
13658 scriptHash: 0x16,
13659 wif: 0x9e,
13660 dustThreshold: 0, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/core.h#L155-L160
13661 dustSoftThreshold: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.h#L62
13662 feePerKb: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.cpp#L58
13663 estimateFee: estimateFee('dogecoin')
13664 },
13665 litecoin: {
13666 magicPrefix: '\x19Litecoin Signed Message:\n',
13667 bip32: {
13668 public: 0x019da462,
13669 private: 0x019d9cfe
13670 },
13671 pubKeyHash: 0x30,
13672 scriptHash: 0x05,
13673 wif: 0xb0,
13674 dustThreshold: 0, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L360-L365
13675 dustSoftThreshold: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.h#L53
13676 feePerKb: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L56
13677 estimateFee: estimateFee('litecoin')
13678 },
13679 testnet: {
13680 magicPrefix: '\x18Bitcoin Signed Message:\n',
13681 bip32: {
13682 public: 0x043587cf,
13683 private: 0x04358394
13684 },
13685 pubKeyHash: 0x6f,
13686 scriptHash: 0xc4,
13687 wif: 0xef,
13688 dustThreshold: 546,
13689 feePerKb: 10000,
13690 estimateFee: estimateFee('testnet')
13691 }
13692 }
13693
13694 function estimateFee(type) {
13695 return function(tx) {
13696 var network = networks[type]
13697 var baseFee = network.feePerKb
13698 var byteSize = tx.toBuffer().length
13699
13700 var fee = baseFee * Math.ceil(byteSize / 1000)
13701 if (network.dustSoftThreshold == undefined) return fee
13702
13703 tx.outs.forEach(function(e){
13704 if (e.value < network.dustSoftThreshold) {
13705 fee += baseFee
13706 }
13707 })
13708
13709 return fee
13710 }
13711 }
13712
13713 module.exports = networks
13714
13715 },{}],82:[function(_dereq_,module,exports){
13716 module.exports = {
13717 // push value
13718 OP_FALSE : 0,
13719 OP_0 : 0,
13720 OP_PUSHDATA1 : 76,
13721 OP_PUSHDATA2 : 77,
13722 OP_PUSHDATA4 : 78,
13723 OP_1NEGATE : 79,
13724 OP_RESERVED : 80,
13725 OP_1 : 81,
13726 OP_TRUE : 81,
13727 OP_2 : 82,
13728 OP_3 : 83,
13729 OP_4 : 84,
13730 OP_5 : 85,
13731 OP_6 : 86,
13732 OP_7 : 87,
13733 OP_8 : 88,
13734 OP_9 : 89,
13735 OP_10 : 90,
13736 OP_11 : 91,
13737 OP_12 : 92,
13738 OP_13 : 93,
13739 OP_14 : 94,
13740 OP_15 : 95,
13741 OP_16 : 96,
13742
13743 // control
13744 OP_NOP : 97,
13745 OP_VER : 98,
13746 OP_IF : 99,
13747 OP_NOTIF : 100,
13748 OP_VERIF : 101,
13749 OP_VERNOTIF : 102,
13750 OP_ELSE : 103,
13751 OP_ENDIF : 104,
13752 OP_VERIFY : 105,
13753 OP_RETURN : 106,
13754
13755 // stack ops
13756 OP_TOALTSTACK : 107,
13757 OP_FROMALTSTACK : 108,
13758 OP_2DROP : 109,
13759 OP_2DUP : 110,
13760 OP_3DUP : 111,
13761 OP_2OVER : 112,
13762 OP_2ROT : 113,
13763 OP_2SWAP : 114,
13764 OP_IFDUP : 115,
13765 OP_DEPTH : 116,
13766 OP_DROP : 117,
13767 OP_DUP : 118,
13768 OP_NIP : 119,
13769 OP_OVER : 120,
13770 OP_PICK : 121,
13771 OP_ROLL : 122,
13772 OP_ROT : 123,
13773 OP_SWAP : 124,
13774 OP_TUCK : 125,
13775
13776 // splice ops
13777 OP_CAT : 126,
13778 OP_SUBSTR : 127,
13779 OP_LEFT : 128,
13780 OP_RIGHT : 129,
13781 OP_SIZE : 130,
13782
13783 // bit logic
13784 OP_INVERT : 131,
13785 OP_AND : 132,
13786 OP_OR : 133,
13787 OP_XOR : 134,
13788 OP_EQUAL : 135,
13789 OP_EQUALVERIFY : 136,
13790 OP_RESERVED1 : 137,
13791 OP_RESERVED2 : 138,
13792
13793 // numeric
13794 OP_1ADD : 139,
13795 OP_1SUB : 140,
13796 OP_2MUL : 141,
13797 OP_2DIV : 142,
13798 OP_NEGATE : 143,
13799 OP_ABS : 144,
13800 OP_NOT : 145,
13801 OP_0NOTEQUAL : 146,
13802
13803 OP_ADD : 147,
13804 OP_SUB : 148,
13805 OP_MUL : 149,
13806 OP_DIV : 150,
13807 OP_MOD : 151,
13808 OP_LSHIFT : 152,
13809 OP_RSHIFT : 153,
13810
13811 OP_BOOLAND : 154,
13812 OP_BOOLOR : 155,
13813 OP_NUMEQUAL : 156,
13814 OP_NUMEQUALVERIFY : 157,
13815 OP_NUMNOTEQUAL : 158,
13816 OP_LESSTHAN : 159,
13817 OP_GREATERTHAN : 160,
13818 OP_LESSTHANOREQUAL : 161,
13819 OP_GREATERTHANOREQUAL : 162,
13820 OP_MIN : 163,
13821 OP_MAX : 164,
13822
13823 OP_WITHIN : 165,
13824
13825 // crypto
13826 OP_RIPEMD160 : 166,
13827 OP_SHA1 : 167,
13828 OP_SHA256 : 168,
13829 OP_HASH160 : 169,
13830 OP_HASH256 : 170,
13831 OP_CODESEPARATOR : 171,
13832 OP_CHECKSIG : 172,
13833 OP_CHECKSIGVERIFY : 173,
13834 OP_CHECKMULTISIG : 174,
13835 OP_CHECKMULTISIGVERIFY : 175,
13836
13837 // expansion
13838 OP_NOP1 : 176,
13839 OP_NOP2 : 177,
13840 OP_NOP3 : 178,
13841 OP_NOP4 : 179,
13842 OP_NOP5 : 180,
13843 OP_NOP6 : 181,
13844 OP_NOP7 : 182,
13845 OP_NOP8 : 183,
13846 OP_NOP9 : 184,
13847 OP_NOP10 : 185,
13848
13849 // template matching params
13850 OP_PUBKEYHASH : 253,
13851 OP_PUBKEY : 254,
13852 OP_INVALIDOPCODE : 255
13853 }
13854
13855 },{}],83:[function(_dereq_,module,exports){
13856 (function (Buffer){
13857 var assert = _dereq_('assert')
13858 var bufferutils = _dereq_('./bufferutils')
13859 var crypto = _dereq_('./crypto')
13860 var opcodes = _dereq_('./opcodes')
13861
13862 function Script(buffer, chunks) {
13863 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
13864 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13865
13866 this.buffer = buffer
13867 this.chunks = chunks
13868 }
13869
13870 // Import operations
13871 Script.fromASM = function(asm) {
13872 var strChunks = asm.split(' ')
13873
13874 var chunks = strChunks.map(function(strChunk) {
13875 if (strChunk in opcodes) {
13876 return opcodes[strChunk]
13877
13878 } else {
13879 return new Buffer(strChunk, 'hex')
13880 }
13881 })
13882
13883 return Script.fromChunks(chunks)
13884 }
13885
13886 Script.fromBuffer = function(buffer) {
13887 var chunks = []
13888
13889 var i = 0
13890
13891 while (i < buffer.length) {
13892 var opcode = buffer.readUInt8(i)
13893
13894 if ((opcode > opcodes.OP_0) && (opcode <= opcodes.OP_PUSHDATA4)) {
13895 var d = bufferutils.readPushDataInt(buffer, i)
13896 i += d.size
13897
13898 var data = buffer.slice(i, i + d.number)
13899 i += d.number
13900
13901 chunks.push(data)
13902
13903 } else {
13904 chunks.push(opcode)
13905
13906 i += 1
13907 }
13908 }
13909
13910 return new Script(buffer, chunks)
13911 }
13912
13913 Script.fromChunks = function(chunks) {
13914 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13915
13916 var bufferSize = chunks.reduce(function(accum, chunk) {
13917 if (Buffer.isBuffer(chunk)) {
13918 return accum + bufferutils.pushDataSize(chunk.length) + chunk.length
13919 }
13920
13921 return accum + 1
13922 }, 0.0)
13923
13924 var buffer = new Buffer(bufferSize)
13925 var offset = 0
13926
13927 chunks.forEach(function(chunk) {
13928 if (Buffer.isBuffer(chunk)) {
13929 offset += bufferutils.writePushDataInt(buffer, chunk.length, offset)
13930
13931 chunk.copy(buffer, offset)
13932 offset += chunk.length
13933
13934 } else {
13935 buffer.writeUInt8(chunk, offset)
13936 offset += 1
13937 }
13938 })
13939
13940 assert.equal(offset, buffer.length, 'Could not decode chunks')
13941 return new Script(buffer, chunks)
13942 }
13943
13944 Script.fromHex = function(hex) {
13945 return Script.fromBuffer(new Buffer(hex, 'hex'))
13946 }
13947
13948 // Constants
13949 Script.EMPTY = Script.fromChunks([])
13950
13951 // Operations
13952 Script.prototype.getHash = function() {
13953 return crypto.hash160(this.buffer)
13954 }
13955
13956 // FIXME: doesn't work for data chunks, maybe time to use buffertools.compare...
13957 Script.prototype.without = function(needle) {
13958 return Script.fromChunks(this.chunks.filter(function(op) {
13959 return op !== needle
13960 }))
13961 }
13962
13963 // Export operations
13964 var reverseOps = []
13965 for (var op in opcodes) {
13966 var code = opcodes[op]
13967 reverseOps[code] = op
13968 }
13969
13970 Script.prototype.toASM = function() {
13971 return this.chunks.map(function(chunk) {
13972 if (Buffer.isBuffer(chunk)) {
13973 return chunk.toString('hex')
13974
13975 } else {
13976 return reverseOps[chunk]
13977 }
13978 }).join(' ')
13979 }
13980
13981 Script.prototype.toBuffer = function() {
13982 return this.buffer
13983 }
13984
13985 Script.prototype.toHex = function() {
13986 return this.toBuffer().toString('hex')
13987 }
13988
13989 module.exports = Script
13990
13991 }).call(this,_dereq_("buffer").Buffer)
13992 },{"./bufferutils":71,"./crypto":73,"./opcodes":82,"assert":4,"buffer":8}],84:[function(_dereq_,module,exports){
13993 (function (Buffer){
13994 var assert = _dereq_('assert')
13995 var opcodes = _dereq_('./opcodes')
13996
13997 // FIXME: use ECPubKey, currently the circular dependency breaks everything.
13998 //
13999 // Solutions:
14000 // * Remove ECPubKey.getAddress
14001 // - Minimal change, but likely unpopular
14002 // * Move all script related functionality out of Address
14003 // - Means a lot of changes to Transaction/Wallet
14004 // * Ignore it (existing solution)
14005 // * Some form of hackery with commonjs
14006 //
14007 var ecurve = _dereq_('ecurve')
14008 var curve = ecurve.getCurveByName('secp256k1')
14009
14010 var ECSignature = _dereq_('./ecsignature')
14011 var Script = _dereq_('./script')
14012
14013 function classifyOutput(script) {
14014 assert(script instanceof Script, 'Expected Script, got ', script)
14015
14016 if (isPubKeyHashOutput.call(script)) {
14017 return 'pubkeyhash'
14018 } else if (isScriptHashOutput.call(script)) {
14019 return 'scripthash'
14020 } else if (isMultisigOutput.call(script)) {
14021 return 'multisig'
14022 } else if (isPubKeyOutput.call(script)) {
14023 return 'pubkey'
14024 } else if (isNulldataOutput.call(script)) {
14025 return 'nulldata'
14026 } else {
14027 return 'nonstandard'
14028 }
14029 }
14030
14031 function classifyInput(script) {
14032 assert(script instanceof Script, 'Expected Script, got ', script)
14033
14034 if (isPubKeyHashInput.call(script)) {
14035 return 'pubkeyhash'
14036 } else if (isScriptHashInput.call(script)) {
14037 return 'scripthash'
14038 } else if (isMultisigInput.call(script)) {
14039 return 'multisig'
14040 } else if (isPubKeyInput.call(script)) {
14041 return 'pubkey'
14042 } else {
14043 return 'nonstandard'
14044 }
14045 }
14046
14047 function isCanonicalPubKey(buffer) {
14048 if (!Buffer.isBuffer(buffer)) return false
14049
14050 try {
14051 // FIXME: boo
14052 ecurve.Point.decodeFrom(curve, buffer)
14053 } catch (e) {
14054 if (!(e.message.match(/Invalid sequence (length|tag)/))) throw e
14055
14056 return false
14057 }
14058
14059 return true
14060 }
14061
14062 function isCanonicalSignature(buffer) {
14063 if (!Buffer.isBuffer(buffer)) return false
14064
14065 try {
14066 ECSignature.parseScriptSignature(buffer)
14067 } catch(e) {
14068 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
14069
14070 return false
14071 }
14072
14073 return true
14074 }
14075
14076 function isPubKeyHashInput() {
14077 return this.chunks.length === 2 &&
14078 isCanonicalSignature(this.chunks[0]) &&
14079 isCanonicalPubKey(this.chunks[1])
14080 }
14081
14082 function isPubKeyHashOutput() {
14083 return this.chunks.length === 5 &&
14084 this.chunks[0] === opcodes.OP_DUP &&
14085 this.chunks[1] === opcodes.OP_HASH160 &&
14086 Buffer.isBuffer(this.chunks[2]) &&
14087 this.chunks[2].length === 20 &&
14088 this.chunks[3] === opcodes.OP_EQUALVERIFY &&
14089 this.chunks[4] === opcodes.OP_CHECKSIG
14090 }
14091
14092 function isPubKeyInput() {
14093 return this.chunks.length === 1 &&
14094 isCanonicalSignature(this.chunks[0])
14095 }
14096
14097 function isPubKeyOutput() {
14098 return this.chunks.length === 2 &&
14099 isCanonicalPubKey(this.chunks[0]) &&
14100 this.chunks[1] === opcodes.OP_CHECKSIG
14101 }
14102
14103 function isScriptHashInput() {
14104 if (this.chunks.length < 2) return false
14105 var lastChunk = this.chunks[this.chunks.length - 1]
14106
14107 if (!Buffer.isBuffer(lastChunk)) return false
14108
14109 var scriptSig = Script.fromChunks(this.chunks.slice(0, -1))
14110 var scriptPubKey = Script.fromBuffer(lastChunk)
14111
14112 return classifyInput(scriptSig) === classifyOutput(scriptPubKey)
14113 }
14114
14115 function isScriptHashOutput() {
14116 return this.chunks.length === 3 &&
14117 this.chunks[0] === opcodes.OP_HASH160 &&
14118 Buffer.isBuffer(this.chunks[1]) &&
14119 this.chunks[1].length === 20 &&
14120 this.chunks[2] === opcodes.OP_EQUAL
14121 }
14122
14123 function isMultisigInput() {
14124 return this.chunks[0] === opcodes.OP_0 &&
14125 this.chunks.slice(1).every(isCanonicalSignature)
14126 }
14127
14128 function isMultisigOutput() {
14129 if (this.chunks < 4) return false
14130 if (this.chunks[this.chunks.length - 1] !== opcodes.OP_CHECKMULTISIG) return false
14131
14132 var mOp = this.chunks[0]
14133 if (mOp === opcodes.OP_0) return false
14134 if (mOp < opcodes.OP_1) return false
14135 if (mOp > opcodes.OP_16) return false
14136
14137 var nOp = this.chunks[this.chunks.length - 2]
14138 if (nOp === opcodes.OP_0) return false
14139 if (nOp < opcodes.OP_1) return false
14140 if (nOp > opcodes.OP_16) return false
14141
14142 var m = mOp - (opcodes.OP_1 - 1)
14143 var n = nOp - (opcodes.OP_1 - 1)
14144 if (n < m) return false
14145
14146 var pubKeys = this.chunks.slice(1, -2)
14147 if (n < pubKeys.length) return false
14148
14149 return pubKeys.every(isCanonicalPubKey)
14150 }
14151
14152 function isNulldataOutput() {
14153 return this.chunks[0] === opcodes.OP_RETURN
14154 }
14155
14156 // Standard Script Templates
14157 // {pubKey} OP_CHECKSIG
14158 function pubKeyOutput(pubKey) {
14159 return Script.fromChunks([
14160 pubKey.toBuffer(),
14161 opcodes.OP_CHECKSIG
14162 ])
14163 }
14164
14165 // OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
14166 function pubKeyHashOutput(hash) {
14167 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14168
14169 return Script.fromChunks([
14170 opcodes.OP_DUP,
14171 opcodes.OP_HASH160,
14172 hash,
14173 opcodes.OP_EQUALVERIFY,
14174 opcodes.OP_CHECKSIG
14175 ])
14176 }
14177
14178 // OP_HASH160 {scriptHash} OP_EQUAL
14179 function scriptHashOutput(hash) {
14180 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14181
14182 return Script.fromChunks([
14183 opcodes.OP_HASH160,
14184 hash,
14185 opcodes.OP_EQUAL
14186 ])
14187 }
14188
14189 // m [pubKeys ...] n OP_CHECKMULTISIG
14190 function multisigOutput(m, pubKeys) {
14191 assert(Array.isArray(pubKeys), 'Expected Array, got ' + pubKeys)
14192 assert(pubKeys.length >= m, 'Not enough pubKeys provided')
14193
14194 var pubKeyBuffers = pubKeys.map(function(pubKey) {
14195 return pubKey.toBuffer()
14196 })
14197 var n = pubKeys.length
14198
14199 return Script.fromChunks([].concat(
14200 (opcodes.OP_1 - 1) + m,
14201 pubKeyBuffers,
14202 (opcodes.OP_1 - 1) + n,
14203 opcodes.OP_CHECKMULTISIG
14204 ))
14205 }
14206
14207 // {signature}
14208 function pubKeyInput(signature) {
14209 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14210
14211 return Script.fromChunks([signature])
14212 }
14213
14214 // {signature} {pubKey}
14215 function pubKeyHashInput(signature, pubKey) {
14216 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14217
14218 return Script.fromChunks([signature, pubKey.toBuffer()])
14219 }
14220
14221 // <scriptSig> {serialized scriptPubKey script}
14222 function scriptHashInput(scriptSig, scriptPubKey) {
14223 return Script.fromChunks([].concat(
14224 scriptSig.chunks,
14225 scriptPubKey.toBuffer()
14226 ))
14227 }
14228
14229 // OP_0 [signatures ...]
14230 function multisigInput(signatures, scriptPubKey) {
14231 if (scriptPubKey) {
14232 assert(isMultisigOutput.call(scriptPubKey))
14233
14234 var m = scriptPubKey.chunks[0]
14235 var k = m - (opcodes.OP_1 - 1)
14236 assert(k <= signatures.length, 'Not enough signatures provided')
14237 }
14238
14239 return Script.fromChunks([].concat(opcodes.OP_0, signatures))
14240 }
14241
14242 module.exports = {
14243 classifyInput: classifyInput,
14244 classifyOutput: classifyOutput,
14245 multisigInput: multisigInput,
14246 multisigOutput: multisigOutput,
14247 pubKeyHashInput: pubKeyHashInput,
14248 pubKeyHashOutput: pubKeyHashOutput,
14249 pubKeyInput: pubKeyInput,
14250 pubKeyOutput: pubKeyOutput,
14251 scriptHashInput: scriptHashInput,
14252 scriptHashOutput: scriptHashOutput
14253 }
14254
14255 }).call(this,_dereq_("buffer").Buffer)
14256 },{"./ecsignature":77,"./opcodes":82,"./script":83,"assert":4,"buffer":8,"ecurve":65}],85:[function(_dereq_,module,exports){
14257 (function (Buffer){
14258 var assert = _dereq_('assert')
14259 var bufferutils = _dereq_('./bufferutils')
14260 var crypto = _dereq_('./crypto')
14261 var opcodes = _dereq_('./opcodes')
14262 var scripts = _dereq_('./scripts')
14263
14264 var Address = _dereq_('./address')
14265 var ECKey = _dereq_('./eckey')
14266 var ECSignature = _dereq_('./ecsignature')
14267 var Script = _dereq_('./script')
14268
14269 Transaction.DEFAULT_SEQUENCE = 0xffffffff
14270 Transaction.SIGHASH_ALL = 0x01
14271 Transaction.SIGHASH_NONE = 0x02
14272 Transaction.SIGHASH_SINGLE = 0x03
14273 Transaction.SIGHASH_ANYONECANPAY = 0x80
14274
14275 function Transaction() {
14276 this.version = 1
14277 this.locktime = 0
14278 this.ins = []
14279 this.outs = []
14280 }
14281
14282 /**
14283 * Create a new txin.
14284 *
14285 * Can be called with any of:
14286 *
14287 * - A transaction and an index
14288 * - A transaction hash and an index
14289 *
14290 * Note that this method does not sign the created input.
14291 */
14292 Transaction.prototype.addInput = function(tx, index, sequence) {
14293 if (sequence == undefined) sequence = Transaction.DEFAULT_SEQUENCE
14294
14295 var hash
14296
14297 if (typeof tx === 'string') {
14298 hash = new Buffer(tx, 'hex')
14299
14300 // TxId hex is big-endian, we need little-endian
14301 Array.prototype.reverse.call(hash)
14302
14303 } else if (tx instanceof Transaction) {
14304 hash = tx.getHash()
14305
14306 } else {
14307 hash = tx
14308 }
14309
14310 assert(Buffer.isBuffer(hash), 'Expected Transaction, txId or txHash, got ' + tx)
14311 assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length)
14312 assert.equal(typeof index, 'number', 'Expected number index, got ' + index)
14313
14314 return (this.ins.push({
14315 hash: hash,
14316 index: index,
14317 script: Script.EMPTY,
14318 sequence: sequence
14319 }) - 1)
14320 }
14321
14322 /**
14323 * Create a new txout.
14324 *
14325 * Can be called with:
14326 *
14327 * - A base58 address string and a value
14328 * - An Address object and a value
14329 * - A scriptPubKey Script and a value
14330 */
14331 Transaction.prototype.addOutput = function(scriptPubKey, value) {
14332 // Attempt to get a valid address if it's a base58 address string
14333 if (typeof scriptPubKey === 'string') {
14334 scriptPubKey = Address.fromBase58Check(scriptPubKey)
14335 }
14336
14337 // Attempt to get a valid script if it's an Address object
14338 if (scriptPubKey instanceof Address) {
14339 var address = scriptPubKey
14340
14341 scriptPubKey = address.toOutputScript()
14342 }
14343
14344 return (this.outs.push({
14345 script: scriptPubKey,
14346 value: value,
14347 }) - 1)
14348 }
14349
14350 Transaction.prototype.toBuffer = function () {
14351 var txInSize = this.ins.reduce(function(a, x) {
14352 return a + (40 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14353 }, 0)
14354
14355 var txOutSize = this.outs.reduce(function(a, x) {
14356 return a + (8 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14357 }, 0)
14358
14359 var buffer = new Buffer(
14360 8 +
14361 bufferutils.varIntSize(this.ins.length) +
14362 bufferutils.varIntSize(this.outs.length) +
14363 txInSize +
14364 txOutSize
14365 )
14366
14367 var offset = 0
14368 function writeSlice(slice) {
14369 slice.copy(buffer, offset)
14370 offset += slice.length
14371 }
14372 function writeUInt32(i) {
14373 buffer.writeUInt32LE(i, offset)
14374 offset += 4
14375 }
14376 function writeUInt64(i) {
14377 bufferutils.writeUInt64LE(buffer, i, offset)
14378 offset += 8
14379 }
14380 function writeVarInt(i) {
14381 var n = bufferutils.writeVarInt(buffer, i, offset)
14382 offset += n
14383 }
14384
14385 writeUInt32(this.version)
14386 writeVarInt(this.ins.length)
14387
14388 this.ins.forEach(function(txin) {
14389 writeSlice(txin.hash)
14390 writeUInt32(txin.index)
14391 writeVarInt(txin.script.buffer.length)
14392 writeSlice(txin.script.buffer)
14393 writeUInt32(txin.sequence)
14394 })
14395
14396 writeVarInt(this.outs.length)
14397 this.outs.forEach(function(txout) {
14398 writeUInt64(txout.value)
14399 writeVarInt(txout.script.buffer.length)
14400 writeSlice(txout.script.buffer)
14401 })
14402
14403 writeUInt32(this.locktime)
14404
14405 return buffer
14406 }
14407
14408 Transaction.prototype.toHex = function() {
14409 return this.toBuffer().toString('hex')
14410 }
14411
14412 /**
14413 * Hash transaction for signing a specific input.
14414 *
14415 * Bitcoin uses a different hash for each signed transaction input. This
14416 * method copies the transaction, makes the necessary changes based on the
14417 * hashType, serializes and finally hashes the result. This hash can then be
14418 * used to sign the transaction input in question.
14419 */
14420 Transaction.prototype.hashForSignature = function(prevOutScript, inIndex, hashType) {
14421 assert(inIndex >= 0, 'Invalid vin index')
14422 assert(inIndex < this.ins.length, 'Invalid vin index')
14423 assert(prevOutScript instanceof Script, 'Invalid Script object')
14424
14425 var txTmp = this.clone()
14426 var hashScript = prevOutScript.without(opcodes.OP_CODESEPARATOR)
14427
14428 // Blank out other inputs' signatures
14429 txTmp.ins.forEach(function(txin) {
14430 txin.script = Script.EMPTY
14431 })
14432 txTmp.ins[inIndex].script = hashScript
14433
14434 var hashTypeModifier = hashType & 0x1f
14435 if (hashTypeModifier === Transaction.SIGHASH_NONE) {
14436 assert(false, 'SIGHASH_NONE not yet supported')
14437
14438 } else if (hashTypeModifier === Transaction.SIGHASH_SINGLE) {
14439 assert(false, 'SIGHASH_SINGLE not yet supported')
14440
14441 }
14442
14443 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
14444 assert(false, 'SIGHASH_ANYONECANPAY not yet supported')
14445 }
14446
14447 var hashTypeBuffer = new Buffer(4)
14448 hashTypeBuffer.writeInt32LE(hashType, 0)
14449
14450 var buffer = Buffer.concat([txTmp.toBuffer(), hashTypeBuffer])
14451 return crypto.hash256(buffer)
14452 }
14453
14454 Transaction.prototype.getHash = function () {
14455 return crypto.hash256(this.toBuffer())
14456 }
14457
14458 Transaction.prototype.getId = function () {
14459 var buffer = this.getHash()
14460
14461 // Big-endian is used for TxHash
14462 Array.prototype.reverse.call(buffer)
14463
14464 return buffer.toString('hex')
14465 }
14466
14467 Transaction.prototype.clone = function () {
14468 var newTx = new Transaction()
14469 newTx.version = this.version
14470 newTx.locktime = this.locktime
14471
14472 newTx.ins = this.ins.map(function(txin) {
14473 return {
14474 hash: txin.hash,
14475 index: txin.index,
14476 script: txin.script,
14477 sequence: txin.sequence
14478 }
14479 })
14480
14481 newTx.outs = this.outs.map(function(txout) {
14482 return {
14483 script: txout.script,
14484 value: txout.value
14485 }
14486 })
14487
14488 return newTx
14489 }
14490
14491 Transaction.fromBuffer = function(buffer) {
14492 var offset = 0
14493 function readSlice(n) {
14494 offset += n
14495 return buffer.slice(offset - n, offset)
14496 }
14497 function readUInt32() {
14498 var i = buffer.readUInt32LE(offset)
14499 offset += 4
14500 return i
14501 }
14502 function readUInt64() {
14503 var i = bufferutils.readUInt64LE(buffer, offset)
14504 offset += 8
14505 return i
14506 }
14507 function readVarInt() {
14508 var vi = bufferutils.readVarInt(buffer, offset)
14509 offset += vi.size
14510 return vi.number
14511 }
14512
14513 var tx = new Transaction()
14514 tx.version = readUInt32()
14515
14516 var vinLen = readVarInt()
14517 for (var i = 0; i < vinLen; ++i) {
14518 var hash = readSlice(32)
14519 var vout = readUInt32()
14520 var scriptLen = readVarInt()
14521 var script = readSlice(scriptLen)
14522 var sequence = readUInt32()
14523
14524 tx.ins.push({
14525 hash: hash,
14526 index: vout,
14527 script: Script.fromBuffer(script),
14528 sequence: sequence
14529 })
14530 }
14531
14532 var voutLen = readVarInt()
14533 for (i = 0; i < voutLen; ++i) {
14534 var value = readUInt64()
14535 var scriptLen = readVarInt()
14536 var script = readSlice(scriptLen)
14537
14538 tx.outs.push({
14539 value: value,
14540 script: Script.fromBuffer(script)
14541 })
14542 }
14543
14544 tx.locktime = readUInt32()
14545 assert.equal(offset, buffer.length, 'Transaction has unexpected data')
14546
14547 return tx
14548 }
14549
14550 Transaction.fromHex = function(hex) {
14551 return Transaction.fromBuffer(new Buffer(hex, 'hex'))
14552 }
14553
14554 /**
14555 * Signs a pubKeyHash output at some index with the given key
14556 */
14557 Transaction.prototype.sign = function(index, privKey, hashType) {
14558 var prevOutScript = privKey.pub.getAddress().toOutputScript()
14559 var signature = this.signInput(index, prevOutScript, privKey, hashType)
14560
14561 // FIXME: Assumed prior TX was pay-to-pubkey-hash
14562 var scriptSig = scripts.pubKeyHashInput(signature, privKey.pub)
14563 this.setInputScript(index, scriptSig)
14564 }
14565
14566 Transaction.prototype.signInput = function(index, prevOutScript, privKey, hashType) {
14567 hashType = hashType || Transaction.SIGHASH_ALL
14568
14569 var hash = this.hashForSignature(prevOutScript, index, hashType)
14570 var signature = privKey.sign(hash)
14571
14572 return signature.toScriptSignature(hashType)
14573 }
14574
14575 Transaction.prototype.setInputScript = function(index, script) {
14576 this.ins[index].script = script
14577 }
14578
14579 // FIXME: could be validateInput(index, prevTxOut, pub)
14580 Transaction.prototype.validateInput = function(index, prevOutScript, pubKey, buffer) {
14581 var parsed = ECSignature.parseScriptSignature(buffer)
14582 var hash = this.hashForSignature(prevOutScript, index, parsed.hashType)
14583
14584 return pubKey.verify(hash, parsed.signature)
14585 }
14586
14587 module.exports = Transaction
14588
14589 }).call(this,_dereq_("buffer").Buffer)
14590 },{"./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){
14591 (function (Buffer){
14592 var assert = _dereq_('assert')
14593 var networks = _dereq_('./networks')
14594 var rng = _dereq_('secure-random')
14595
14596 var Address = _dereq_('./address')
14597 var HDNode = _dereq_('./hdnode')
14598 var Transaction = _dereq_('./transaction')
14599
14600 function Wallet(seed, network) {
14601 network = network || networks.bitcoin
14602
14603 // Stored in a closure to make accidental serialization less likely
14604 var masterkey = null
14605 var me = this
14606 var accountZero = null
14607 var internalAccount = null
14608 var externalAccount = null
14609
14610 // Addresses
14611 this.addresses = []
14612 this.changeAddresses = []
14613
14614 // Transaction output data
14615 this.outputs = {}
14616
14617 // Make a new master key
14618 this.newMasterKey = function(seed) {
14619 seed = seed || new Buffer(rng(32))
14620 masterkey = HDNode.fromSeedBuffer(seed, network)
14621
14622 // HD first-level child derivation method should be hardened
14623 // See https://bitcointalk.org/index.php?topic=405179.msg4415254#msg4415254
14624 accountZero = masterkey.deriveHardened(0)
14625 externalAccount = accountZero.derive(0)
14626 internalAccount = accountZero.derive(1)
14627
14628 me.addresses = []
14629 me.changeAddresses = []
14630
14631 me.outputs = {}
14632 }
14633
14634 this.newMasterKey(seed)
14635
14636 this.generateAddress = function() {
14637 var key = externalAccount.derive(this.addresses.length)
14638 this.addresses.push(key.getAddress().toString())
14639 return this.addresses[this.addresses.length - 1]
14640 }
14641
14642 this.generateChangeAddress = function() {
14643 var key = internalAccount.derive(this.changeAddresses.length)
14644 this.changeAddresses.push(key.getAddress().toString())
14645 return this.changeAddresses[this.changeAddresses.length - 1]
14646 }
14647
14648 this.getBalance = function() {
14649 return this.getUnspentOutputs().reduce(function(memo, output){
14650 return memo + output.value
14651 }, 0)
14652 }
14653
14654 this.getUnspentOutputs = function() {
14655 var utxo = []
14656
14657 for(var key in this.outputs){
14658 var output = this.outputs[key]
14659 if(!output.to) utxo.push(outputToUnspentOutput(output))
14660 }
14661
14662 return utxo
14663 }
14664
14665 this.setUnspentOutputs = function(utxo) {
14666 var outputs = {}
14667
14668 utxo.forEach(function(uo){
14669 validateUnspentOutput(uo)
14670 var o = unspentOutputToOutput(uo)
14671 outputs[o.from] = o
14672 })
14673
14674 this.outputs = outputs
14675 }
14676
14677 function outputToUnspentOutput(output){
14678 var hashAndIndex = output.from.split(":")
14679
14680 return {
14681 hash: hashAndIndex[0],
14682 outputIndex: parseInt(hashAndIndex[1]),
14683 address: output.address,
14684 value: output.value,
14685 pending: output.pending
14686 }
14687 }
14688
14689 function unspentOutputToOutput(o) {
14690 var hash = o.hash
14691 var key = hash + ":" + o.outputIndex
14692 return {
14693 from: key,
14694 address: o.address,
14695 value: o.value,
14696 pending: o.pending
14697 }
14698 }
14699
14700 function validateUnspentOutput(uo) {
14701 var missingField
14702
14703 if (isNullOrUndefined(uo.hash)) {
14704 missingField = "hash"
14705 }
14706
14707 var requiredKeys = ['outputIndex', 'address', 'value']
14708 requiredKeys.forEach(function (key) {
14709 if (isNullOrUndefined(uo[key])){
14710 missingField = key
14711 }
14712 })
14713
14714 if (missingField) {
14715 var message = [
14716 'Invalid unspent output: key', missingField, 'is missing.',
14717 'A valid unspent output must contain'
14718 ]
14719 message.push(requiredKeys.join(', '))
14720 message.push("and hash")
14721 throw new Error(message.join(' '))
14722 }
14723 }
14724
14725 function isNullOrUndefined(value) {
14726 return value == undefined
14727 }
14728
14729 this.processPendingTx = function(tx){
14730 processTx(tx, true)
14731 }
14732
14733 this.processConfirmedTx = function(tx){
14734 processTx(tx, false)
14735 }
14736
14737 function processTx(tx, isPending) {
14738 var txid = tx.getId()
14739
14740 tx.outs.forEach(function(txOut, i) {
14741 var address
14742
14743 try {
14744 address = Address.fromOutputScript(txOut.script, network).toString()
14745 } catch(e) {
14746 if (!(e.message.match(/has no matching Address/))) throw e
14747 }
14748
14749 if (isMyAddress(address)) {
14750 var output = txid + ':' + i
14751
14752 me.outputs[output] = {
14753 from: output,
14754 value: txOut.value,
14755 address: address,
14756 pending: isPending
14757 }
14758 }
14759 })
14760
14761 tx.ins.forEach(function(txIn, i) {
14762 // copy and convert to big-endian hex
14763 var txinId = new Buffer(txIn.hash)
14764 Array.prototype.reverse.call(txinId)
14765 txinId = txinId.toString('hex')
14766
14767 var output = txinId + ':' + txIn.index
14768
14769 if (!(output in me.outputs)) return
14770
14771 if (isPending) {
14772 me.outputs[output].to = txid + ':' + i
14773 me.outputs[output].pending = true
14774 } else {
14775 delete me.outputs[output]
14776 }
14777 })
14778 }
14779
14780 this.createTx = function(to, value, fixedFee, changeAddress) {
14781 assert(value > network.dustThreshold, value + ' must be above dust threshold (' + network.dustThreshold + ' Satoshis)')
14782
14783 var utxos = getCandidateOutputs(value)
14784 var accum = 0
14785 var subTotal = value
14786 var addresses = []
14787
14788 var tx = new Transaction()
14789 tx.addOutput(to, value)
14790
14791 for (var i = 0; i < utxos.length; ++i) {
14792 var utxo = utxos[i]
14793 addresses.push(utxo.address)
14794
14795 var outpoint = utxo.from.split(':')
14796 tx.addInput(outpoint[0], parseInt(outpoint[1]))
14797
14798 var fee = fixedFee == undefined ? estimateFeePadChangeOutput(tx) : fixedFee
14799
14800 accum += utxo.value
14801 subTotal = value + fee
14802 if (accum >= subTotal) {
14803 var change = accum - subTotal
14804
14805 if (change > network.dustThreshold) {
14806 tx.addOutput(changeAddress || getChangeAddress(), change)
14807 }
14808
14809 break
14810 }
14811 }
14812
14813 assert(accum >= subTotal, 'Not enough funds (incl. fee): ' + accum + ' < ' + subTotal)
14814
14815 this.signWith(tx, addresses)
14816 return tx
14817 }
14818
14819 function getCandidateOutputs() {
14820 var unspent = []
14821
14822 for (var key in me.outputs) {
14823 var output = me.outputs[key]
14824 if (!output.pending) unspent.push(output)
14825 }
14826
14827 var sortByValueDesc = unspent.sort(function(o1, o2){
14828 return o2.value - o1.value
14829 })
14830
14831 return sortByValueDesc
14832 }
14833
14834 function estimateFeePadChangeOutput(tx) {
14835 var tmpTx = tx.clone()
14836 tmpTx.addOutput(getChangeAddress(), network.dustSoftThreshold || 0)
14837
14838 return network.estimateFee(tmpTx)
14839 }
14840
14841 function getChangeAddress() {
14842 if(me.changeAddresses.length === 0) me.generateChangeAddress();
14843 return me.changeAddresses[me.changeAddresses.length - 1]
14844 }
14845
14846 this.signWith = function(tx, addresses) {
14847 assert.equal(tx.ins.length, addresses.length, 'Number of addresses must match number of transaction inputs')
14848
14849 addresses.forEach(function(address, i) {
14850 var key = me.getPrivateKeyForAddress(address)
14851
14852 tx.sign(i, key)
14853 })
14854
14855 return tx
14856 }
14857
14858 this.getMasterKey = function() { return masterkey }
14859 this.getAccountZero = function() { return accountZero }
14860 this.getInternalAccount = function() { return internalAccount }
14861 this.getExternalAccount = function() { return externalAccount }
14862
14863 this.getPrivateKey = function(index) {
14864 return externalAccount.derive(index).privKey
14865 }
14866
14867 this.getInternalPrivateKey = function(index) {
14868 return internalAccount.derive(index).privKey
14869 }
14870
14871 this.getPrivateKeyForAddress = function(address) {
14872 var index
14873 if((index = this.addresses.indexOf(address)) > -1) {
14874 return this.getPrivateKey(index)
14875 } else if((index = this.changeAddresses.indexOf(address)) > -1) {
14876 return this.getInternalPrivateKey(index)
14877 } else {
14878 throw new Error('Unknown address. Make sure the address is from the keychain and has been generated.')
14879 }
14880 }
14881
14882 function isReceiveAddress(address){
14883 return me.addresses.indexOf(address) > -1
14884 }
14885
14886 function isChangeAddress(address){
14887 return me.changeAddresses.indexOf(address) > -1
14888 }
14889
14890 function isMyAddress(address) {
14891 return isReceiveAddress(address) || isChangeAddress(address)
14892 }
14893 }
14894
14895 module.exports = Wallet
14896
14897 }).call(this,_dereq_("buffer").Buffer)
14898 },{"./address":69,"./hdnode":78,"./networks":81,"./transaction":85,"assert":4,"buffer":8,"secure-random":68}]},{},[79])
14899 (79)
14900 });
14901 </script>
14902
14903 <!--<script src="/js/asmcrypto.js"></script>-->
14904 <script>
14905 // INCLUDE ASMCRYPTO
14906 // https://rawgit.com/tresorit/asmcrypto.js/598a1098504f1b2d0e615bc51dd8404afd2d338b/asmcrypto.js
14907 // Provides PBKDF2 functionality
14908 // It's faster than CryptoJS
14909 // Couldn't get SJCL working as desired
14910
14911
14912 (function(exports, global) {
14913 "use strict";
14914 global["asmCrypto"] = exports;
14915 function string_to_bytes(str) {
14916 var i, len = str.length, arr = new Uint8Array(len);
14917 for (i = 0; i < len; i += 1) {
14918 arr[i] = str.charCodeAt(i);
14919 }
14920 return arr;
14921 }
14922 function hex_to_bytes(str) {
14923 var arr = [], len = str.length, i;
14924 if (len & 1) {
14925 str = "0" + str;
14926 len++;
14927 }
14928 for (i = 0; i < len; i += 2) {
14929 arr.push(parseInt(str.substr(i, 2), 16));
14930 }
14931 return new Uint8Array(arr);
14932 }
14933 function base64_to_bytes(str) {
14934 return string_to_bytes(atob(str));
14935 }
14936 function bytes_to_string(arr) {
14937 var str = "";
14938 for (var i = 0; i < arr.length; i++) str += String.fromCharCode(arr[i]);
14939 return str;
14940 }
14941 function bytes_to_hex(arr) {
14942 var sz = (arr.byteLength || arr.length) / arr.length, str = "";
14943 for (var i = 0; i < arr.length; i++) {
14944 var h = arr[i].toString(16);
14945 if (h.length < 2 * sz) str += "00000000000000".substr(0, 2 * sz - h.length);
14946 str += h;
14947 }
14948 return str;
14949 }
14950 function bytes_to_base64(arr) {
14951 return btoa(bytes_to_string(arr));
14952 }
14953 function pow2_ceil(a) {
14954 a -= 1;
14955 a |= a >>> 1;
14956 a |= a >>> 2;
14957 a |= a >>> 4;
14958 a |= a >>> 8;
14959 a |= a >>> 16;
14960 a += 1;
14961 return a;
14962 }
14963 function is_number(a) {
14964 return typeof a === "number";
14965 }
14966 function is_string(a) {
14967 return typeof a === "string";
14968 }
14969 function is_buffer(a) {
14970 return a instanceof ArrayBuffer;
14971 }
14972 function is_bytes(a) {
14973 return a instanceof Uint8Array;
14974 }
14975 function is_typed_array(a) {
14976 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;
14977 }
14978 function IllegalStateError() {
14979 Error.apply(this, arguments);
14980 }
14981 IllegalStateError.prototype = new Error();
14982 function IllegalArgumentError() {
14983 Error.apply(this, arguments);
14984 }
14985 IllegalArgumentError.prototype = new Error();
14986 function SecurityError() {
14987 Error.apply(this, arguments);
14988 }
14989 IllegalArgumentError.prototype = new Error();
14990 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 ];
14991 var _aes_heap_start = 2048;
14992 function _aes_asm(stdlib, foreign, buffer) {
14993 // Closure Compiler warning - commented out
14994 //"use asm";
14995 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;
14996 var keySize = 0;
14997 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;
14998 var HEAP = new stdlib.Uint8Array(buffer);
14999 function _expand_key_128() {
15000 var sbox = 0;
15001 R10 = R00 ^ HEAP[sbox | R0D] ^ 1;
15002 R11 = R01 ^ HEAP[sbox | R0E];
15003 R12 = R02 ^ HEAP[sbox | R0F];
15004 R13 = R03 ^ HEAP[sbox | R0C];
15005 R14 = R04 ^ R10;
15006 R15 = R05 ^ R11;
15007 R16 = R06 ^ R12;
15008 R17 = R07 ^ R13;
15009 R18 = R08 ^ R14;
15010 R19 = R09 ^ R15;
15011 R1A = R0A ^ R16;
15012 R1B = R0B ^ R17;
15013 R1C = R0C ^ R18;
15014 R1D = R0D ^ R19;
15015 R1E = R0E ^ R1A;
15016 R1F = R0F ^ R1B;
15017 R20 = R10 ^ HEAP[sbox | R1D] ^ 2;
15018 R21 = R11 ^ HEAP[sbox | R1E];
15019 R22 = R12 ^ HEAP[sbox | R1F];
15020 R23 = R13 ^ HEAP[sbox | R1C];
15021 R24 = R14 ^ R20;
15022 R25 = R15 ^ R21;
15023 R26 = R16 ^ R22;
15024 R27 = R17 ^ R23;
15025 R28 = R18 ^ R24;
15026 R29 = R19 ^ R25;
15027 R2A = R1A ^ R26;
15028 R2B = R1B ^ R27;
15029 R2C = R1C ^ R28;
15030 R2D = R1D ^ R29;
15031 R2E = R1E ^ R2A;
15032 R2F = R1F ^ R2B;
15033 R30 = R20 ^ HEAP[sbox | R2D] ^ 4;
15034 R31 = R21 ^ HEAP[sbox | R2E];
15035 R32 = R22 ^ HEAP[sbox | R2F];
15036 R33 = R23 ^ HEAP[sbox | R2C];
15037 R34 = R24 ^ R30;
15038 R35 = R25 ^ R31;
15039 R36 = R26 ^ R32;
15040 R37 = R27 ^ R33;
15041 R38 = R28 ^ R34;
15042 R39 = R29 ^ R35;
15043 R3A = R2A ^ R36;
15044 R3B = R2B ^ R37;
15045 R3C = R2C ^ R38;
15046 R3D = R2D ^ R39;
15047 R3E = R2E ^ R3A;
15048 R3F = R2F ^ R3B;
15049 R40 = R30 ^ HEAP[sbox | R3D] ^ 8;
15050 R41 = R31 ^ HEAP[sbox | R3E];
15051 R42 = R32 ^ HEAP[sbox | R3F];
15052 R43 = R33 ^ HEAP[sbox | R3C];
15053 R44 = R34 ^ R40;
15054 R45 = R35 ^ R41;
15055 R46 = R36 ^ R42;
15056 R47 = R37 ^ R43;
15057 R48 = R38 ^ R44;
15058 R49 = R39 ^ R45;
15059 R4A = R3A ^ R46;
15060 R4B = R3B ^ R47;
15061 R4C = R3C ^ R48;
15062 R4D = R3D ^ R49;
15063 R4E = R3E ^ R4A;
15064 R4F = R3F ^ R4B;
15065 R50 = R40 ^ HEAP[sbox | R4D] ^ 16;
15066 R51 = R41 ^ HEAP[sbox | R4E];
15067 R52 = R42 ^ HEAP[sbox | R4F];
15068 R53 = R43 ^ HEAP[sbox | R4C];
15069 R54 = R44 ^ R50;
15070 R55 = R45 ^ R51;
15071 R56 = R46 ^ R52;
15072 R57 = R47 ^ R53;
15073 R58 = R48 ^ R54;
15074 R59 = R49 ^ R55;
15075 R5A = R4A ^ R56;
15076 R5B = R4B ^ R57;
15077 R5C = R4C ^ R58;
15078 R5D = R4D ^ R59;
15079 R5E = R4E ^ R5A;
15080 R5F = R4F ^ R5B;
15081 R60 = R50 ^ HEAP[sbox | R5D] ^ 32;
15082 R61 = R51 ^ HEAP[sbox | R5E];
15083 R62 = R52 ^ HEAP[sbox | R5F];
15084 R63 = R53 ^ HEAP[sbox | R5C];
15085 R64 = R54 ^ R60;
15086 R65 = R55 ^ R61;
15087 R66 = R56 ^ R62;
15088 R67 = R57 ^ R63;
15089 R68 = R58 ^ R64;
15090 R69 = R59 ^ R65;
15091 R6A = R5A ^ R66;
15092 R6B = R5B ^ R67;
15093 R6C = R5C ^ R68;
15094 R6D = R5D ^ R69;
15095 R6E = R5E ^ R6A;
15096 R6F = R5F ^ R6B;
15097 R70 = R60 ^ HEAP[sbox | R6D] ^ 64;
15098 R71 = R61 ^ HEAP[sbox | R6E];
15099 R72 = R62 ^ HEAP[sbox | R6F];
15100 R73 = R63 ^ HEAP[sbox | R6C];
15101 R74 = R64 ^ R70;
15102 R75 = R65 ^ R71;
15103 R76 = R66 ^ R72;
15104 R77 = R67 ^ R73;
15105 R78 = R68 ^ R74;
15106 R79 = R69 ^ R75;
15107 R7A = R6A ^ R76;
15108 R7B = R6B ^ R77;
15109 R7C = R6C ^ R78;
15110 R7D = R6D ^ R79;
15111 R7E = R6E ^ R7A;
15112 R7F = R6F ^ R7B;
15113 R80 = R70 ^ HEAP[sbox | R7D] ^ 128;
15114 R81 = R71 ^ HEAP[sbox | R7E];
15115 R82 = R72 ^ HEAP[sbox | R7F];
15116 R83 = R73 ^ HEAP[sbox | R7C];
15117 R84 = R74 ^ R80;
15118 R85 = R75 ^ R81;
15119 R86 = R76 ^ R82;
15120 R87 = R77 ^ R83;
15121 R88 = R78 ^ R84;
15122 R89 = R79 ^ R85;
15123 R8A = R7A ^ R86;
15124 R8B = R7B ^ R87;
15125 R8C = R7C ^ R88;
15126 R8D = R7D ^ R89;
15127 R8E = R7E ^ R8A;
15128 R8F = R7F ^ R8B;
15129 R90 = R80 ^ HEAP[sbox | R8D] ^ 27;
15130 R91 = R81 ^ HEAP[sbox | R8E];
15131 R92 = R82 ^ HEAP[sbox | R8F];
15132 R93 = R83 ^ HEAP[sbox | R8C];
15133 R94 = R84 ^ R90;
15134 R95 = R85 ^ R91;
15135 R96 = R86 ^ R92;
15136 R97 = R87 ^ R93;
15137 R98 = R88 ^ R94;
15138 R99 = R89 ^ R95;
15139 R9A = R8A ^ R96;
15140 R9B = R8B ^ R97;
15141 R9C = R8C ^ R98;
15142 R9D = R8D ^ R99;
15143 R9E = R8E ^ R9A;
15144 R9F = R8F ^ R9B;
15145 RA0 = R90 ^ HEAP[sbox | R9D] ^ 54;
15146 RA1 = R91 ^ HEAP[sbox | R9E];
15147 RA2 = R92 ^ HEAP[sbox | R9F];
15148 RA3 = R93 ^ HEAP[sbox | R9C];
15149 RA4 = R94 ^ RA0;
15150 RA5 = R95 ^ RA1;
15151 RA6 = R96 ^ RA2;
15152 RA7 = R97 ^ RA3;
15153 RA8 = R98 ^ RA4;
15154 RA9 = R99 ^ RA5;
15155 RAA = R9A ^ RA6;
15156 RAB = R9B ^ RA7;
15157 RAC = R9C ^ RA8;
15158 RAD = R9D ^ RA9;
15159 RAE = R9E ^ RAA;
15160 RAF = R9F ^ RAB;
15161 }
15162 function _expand_key_256() {
15163 var sbox = 0;
15164 R20 = R00 ^ HEAP[sbox | R1D] ^ 1;
15165 R21 = R01 ^ HEAP[sbox | R1E];
15166 R22 = R02 ^ HEAP[sbox | R1F];
15167 R23 = R03 ^ HEAP[sbox | R1C];
15168 R24 = R04 ^ R20;
15169 R25 = R05 ^ R21;
15170 R26 = R06 ^ R22;
15171 R27 = R07 ^ R23;
15172 R28 = R08 ^ R24;
15173 R29 = R09 ^ R25;
15174 R2A = R0A ^ R26;
15175 R2B = R0B ^ R27;
15176 R2C = R0C ^ R28;
15177 R2D = R0D ^ R29;
15178 R2E = R0E ^ R2A;
15179 R2F = R0F ^ R2B;
15180 R30 = R10 ^ HEAP[sbox | R2C];
15181 R31 = R11 ^ HEAP[sbox | R2D];
15182 R32 = R12 ^ HEAP[sbox | R2E];
15183 R33 = R13 ^ HEAP[sbox | R2F];
15184 R34 = R14 ^ R30;
15185 R35 = R15 ^ R31;
15186 R36 = R16 ^ R32;
15187 R37 = R17 ^ R33;
15188 R38 = R18 ^ R34;
15189 R39 = R19 ^ R35;
15190 R3A = R1A ^ R36;
15191 R3B = R1B ^ R37;
15192 R3C = R1C ^ R38;
15193 R3D = R1D ^ R39;
15194 R3E = R1E ^ R3A;
15195 R3F = R1F ^ R3B;
15196 R40 = R20 ^ HEAP[sbox | R3D] ^ 2;
15197 R41 = R21 ^ HEAP[sbox | R3E];
15198 R42 = R22 ^ HEAP[sbox | R3F];
15199 R43 = R23 ^ HEAP[sbox | R3C];
15200 R44 = R24 ^ R40;
15201 R45 = R25 ^ R41;
15202 R46 = R26 ^ R42;
15203 R47 = R27 ^ R43;
15204 R48 = R28 ^ R44;
15205 R49 = R29 ^ R45;
15206 R4A = R2A ^ R46;
15207 R4B = R2B ^ R47;
15208 R4C = R2C ^ R48;
15209 R4D = R2D ^ R49;
15210 R4E = R2E ^ R4A;
15211 R4F = R2F ^ R4B;
15212 R50 = R30 ^ HEAP[sbox | R4C];
15213 R51 = R31 ^ HEAP[sbox | R4D];
15214 R52 = R32 ^ HEAP[sbox | R4E];
15215 R53 = R33 ^ HEAP[sbox | R4F];
15216 R54 = R34 ^ R50;
15217 R55 = R35 ^ R51;
15218 R56 = R36 ^ R52;
15219 R57 = R37 ^ R53;
15220 R58 = R38 ^ R54;
15221 R59 = R39 ^ R55;
15222 R5A = R3A ^ R56;
15223 R5B = R3B ^ R57;
15224 R5C = R3C ^ R58;
15225 R5D = R3D ^ R59;
15226 R5E = R3E ^ R5A;
15227 R5F = R3F ^ R5B;
15228 R60 = R40 ^ HEAP[sbox | R5D] ^ 4;
15229 R61 = R41 ^ HEAP[sbox | R5E];
15230 R62 = R42 ^ HEAP[sbox | R5F];
15231 R63 = R43 ^ HEAP[sbox | R5C];
15232 R64 = R44 ^ R60;
15233 R65 = R45 ^ R61;
15234 R66 = R46 ^ R62;
15235 R67 = R47 ^ R63;
15236 R68 = R48 ^ R64;
15237 R69 = R49 ^ R65;
15238 R6A = R4A ^ R66;
15239 R6B = R4B ^ R67;
15240 R6C = R4C ^ R68;
15241 R6D = R4D ^ R69;
15242 R6E = R4E ^ R6A;
15243 R6F = R4F ^ R6B;
15244 R70 = R50 ^ HEAP[sbox | R6C];
15245 R71 = R51 ^ HEAP[sbox | R6D];
15246 R72 = R52 ^ HEAP[sbox | R6E];
15247 R73 = R53 ^ HEAP[sbox | R6F];
15248 R74 = R54 ^ R70;
15249 R75 = R55 ^ R71;
15250 R76 = R56 ^ R72;
15251 R77 = R57 ^ R73;
15252 R78 = R58 ^ R74;
15253 R79 = R59 ^ R75;
15254 R7A = R5A ^ R76;
15255 R7B = R5B ^ R77;
15256 R7C = R5C ^ R78;
15257 R7D = R5D ^ R79;
15258 R7E = R5E ^ R7A;
15259 R7F = R5F ^ R7B;
15260 R80 = R60 ^ HEAP[sbox | R7D] ^ 8;
15261 R81 = R61 ^ HEAP[sbox | R7E];
15262 R82 = R62 ^ HEAP[sbox | R7F];
15263 R83 = R63 ^ HEAP[sbox | R7C];
15264 R84 = R64 ^ R80;
15265 R85 = R65 ^ R81;
15266 R86 = R66 ^ R82;
15267 R87 = R67 ^ R83;
15268 R88 = R68 ^ R84;
15269 R89 = R69 ^ R85;
15270 R8A = R6A ^ R86;
15271 R8B = R6B ^ R87;
15272 R8C = R6C ^ R88;
15273 R8D = R6D ^ R89;
15274 R8E = R6E ^ R8A;
15275 R8F = R6F ^ R8B;
15276 R90 = R70 ^ HEAP[sbox | R8C];
15277 R91 = R71 ^ HEAP[sbox | R8D];
15278 R92 = R72 ^ HEAP[sbox | R8E];
15279 R93 = R73 ^ HEAP[sbox | R8F];
15280 R94 = R74 ^ R90;
15281 R95 = R75 ^ R91;
15282 R96 = R76 ^ R92;
15283 R97 = R77 ^ R93;
15284 R98 = R78 ^ R94;
15285 R99 = R79 ^ R95;
15286 R9A = R7A ^ R96;
15287 R9B = R7B ^ R97;
15288 R9C = R7C ^ R98;
15289 R9D = R7D ^ R99;
15290 R9E = R7E ^ R9A;
15291 R9F = R7F ^ R9B;
15292 RA0 = R80 ^ HEAP[sbox | R9D] ^ 16;
15293 RA1 = R81 ^ HEAP[sbox | R9E];
15294 RA2 = R82 ^ HEAP[sbox | R9F];
15295 RA3 = R83 ^ HEAP[sbox | R9C];
15296 RA4 = R84 ^ RA0;
15297 RA5 = R85 ^ RA1;
15298 RA6 = R86 ^ RA2;
15299 RA7 = R87 ^ RA3;
15300 RA8 = R88 ^ RA4;
15301 RA9 = R89 ^ RA5;
15302 RAA = R8A ^ RA6;
15303 RAB = R8B ^ RA7;
15304 RAC = R8C ^ RA8;
15305 RAD = R8D ^ RA9;
15306 RAE = R8E ^ RAA;
15307 RAF = R8F ^ RAB;
15308 RB0 = R90 ^ HEAP[sbox | RAC];
15309 RB1 = R91 ^ HEAP[sbox | RAD];
15310 RB2 = R92 ^ HEAP[sbox | RAE];
15311 RB3 = R93 ^ HEAP[sbox | RAF];
15312 RB4 = R94 ^ RB0;
15313 RB5 = R95 ^ RB1;
15314 RB6 = R96 ^ RB2;
15315 RB7 = R97 ^ RB3;
15316 RB8 = R98 ^ RB4;
15317 RB9 = R99 ^ RB5;
15318 RBA = R9A ^ RB6;
15319 RBB = R9B ^ RB7;
15320 RBC = R9C ^ RB8;
15321 RBD = R9D ^ RB9;
15322 RBE = R9E ^ RBA;
15323 RBF = R9F ^ RBB;
15324 RC0 = RA0 ^ HEAP[sbox | RBD] ^ 32;
15325 RC1 = RA1 ^ HEAP[sbox | RBE];
15326 RC2 = RA2 ^ HEAP[sbox | RBF];
15327 RC3 = RA3 ^ HEAP[sbox | RBC];
15328 RC4 = RA4 ^ RC0;
15329 RC5 = RA5 ^ RC1;
15330 RC6 = RA6 ^ RC2;
15331 RC7 = RA7 ^ RC3;
15332 RC8 = RA8 ^ RC4;
15333 RC9 = RA9 ^ RC5;
15334 RCA = RAA ^ RC6;
15335 RCB = RAB ^ RC7;
15336 RCC = RAC ^ RC8;
15337 RCD = RAD ^ RC9;
15338 RCE = RAE ^ RCA;
15339 RCF = RAF ^ RCB;
15340 RD0 = RB0 ^ HEAP[sbox | RCC];
15341 RD1 = RB1 ^ HEAP[sbox | RCD];
15342 RD2 = RB2 ^ HEAP[sbox | RCE];
15343 RD3 = RB3 ^ HEAP[sbox | RCF];
15344 RD4 = RB4 ^ RD0;
15345 RD5 = RB5 ^ RD1;
15346 RD6 = RB6 ^ RD2;
15347 RD7 = RB7 ^ RD3;
15348 RD8 = RB8 ^ RD4;
15349 RD9 = RB9 ^ RD5;
15350 RDA = RBA ^ RD6;
15351 RDB = RBB ^ RD7;
15352 RDC = RBC ^ RD8;
15353 RDD = RBD ^ RD9;
15354 RDE = RBE ^ RDA;
15355 RDF = RBF ^ RDB;
15356 RE0 = RC0 ^ HEAP[sbox | RDD] ^ 64;
15357 RE1 = RC1 ^ HEAP[sbox | RDE];
15358 RE2 = RC2 ^ HEAP[sbox | RDF];
15359 RE3 = RC3 ^ HEAP[sbox | RDC];
15360 RE4 = RC4 ^ RE0;
15361 RE5 = RC5 ^ RE1;
15362 RE6 = RC6 ^ RE2;
15363 RE7 = RC7 ^ RE3;
15364 RE8 = RC8 ^ RE4;
15365 RE9 = RC9 ^ RE5;
15366 REA = RCA ^ RE6;
15367 REB = RCB ^ RE7;
15368 REC = RCC ^ RE8;
15369 RED = RCD ^ RE9;
15370 REE = RCE ^ REA;
15371 REF = RCF ^ REB;
15372 }
15373 function _encrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15374 s0 = s0 | 0;
15375 s1 = s1 | 0;
15376 s2 = s2 | 0;
15377 s3 = s3 | 0;
15378 s4 = s4 | 0;
15379 s5 = s5 | 0;
15380 s6 = s6 | 0;
15381 s7 = s7 | 0;
15382 s8 = s8 | 0;
15383 s9 = s9 | 0;
15384 sA = sA | 0;
15385 sB = sB | 0;
15386 sC = sC | 0;
15387 sD = sD | 0;
15388 sE = sE | 0;
15389 sF = sF | 0;
15390 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;
15391 s0 = s0 ^ R00;
15392 s1 = s1 ^ R01;
15393 s2 = s2 ^ R02;
15394 s3 = s3 ^ R03;
15395 s4 = s4 ^ R04;
15396 s5 = s5 ^ R05;
15397 s6 = s6 ^ R06;
15398 s7 = s7 ^ R07;
15399 s8 = s8 ^ R08;
15400 s9 = s9 ^ R09;
15401 sA = sA ^ R0A;
15402 sB = sB ^ R0B;
15403 sC = sC ^ R0C;
15404 sD = sD ^ R0D;
15405 sE = sE ^ R0E;
15406 sF = sF ^ R0F;
15407 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R10;
15408 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R11;
15409 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R12;
15410 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R13;
15411 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R14;
15412 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R15;
15413 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R16;
15414 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R17;
15415 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R18;
15416 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R19;
15417 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R1A;
15418 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R1B;
15419 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R1C;
15420 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R1D;
15421 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R1E;
15422 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R1F;
15423 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R20;
15424 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R21;
15425 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R22;
15426 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R23;
15427 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R24;
15428 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R25;
15429 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R26;
15430 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R27;
15431 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R28;
15432 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R29;
15433 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R2A;
15434 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R2B;
15435 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R2C;
15436 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R2D;
15437 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R2E;
15438 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R2F;
15439 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R30;
15440 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R31;
15441 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R32;
15442 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R33;
15443 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R34;
15444 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R35;
15445 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R36;
15446 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R37;
15447 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R38;
15448 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R39;
15449 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R3A;
15450 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R3B;
15451 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R3C;
15452 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R3D;
15453 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R3E;
15454 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R3F;
15455 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R40;
15456 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R41;
15457 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R42;
15458 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R43;
15459 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R44;
15460 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R45;
15461 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R46;
15462 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R47;
15463 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R48;
15464 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R49;
15465 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R4A;
15466 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R4B;
15467 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R4C;
15468 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R4D;
15469 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R4E;
15470 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R4F;
15471 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R50;
15472 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R51;
15473 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R52;
15474 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R53;
15475 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R54;
15476 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R55;
15477 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R56;
15478 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R57;
15479 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R58;
15480 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R59;
15481 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R5A;
15482 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R5B;
15483 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R5C;
15484 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R5D;
15485 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R5E;
15486 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R5F;
15487 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R60;
15488 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R61;
15489 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R62;
15490 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R63;
15491 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R64;
15492 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R65;
15493 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R66;
15494 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R67;
15495 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R68;
15496 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R69;
15497 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R6A;
15498 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R6B;
15499 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R6C;
15500 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R6D;
15501 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R6E;
15502 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R6F;
15503 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R70;
15504 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R71;
15505 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R72;
15506 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R73;
15507 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R74;
15508 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R75;
15509 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R76;
15510 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R77;
15511 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R78;
15512 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R79;
15513 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R7A;
15514 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R7B;
15515 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R7C;
15516 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R7D;
15517 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R7E;
15518 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R7F;
15519 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R80;
15520 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R81;
15521 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R82;
15522 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R83;
15523 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R84;
15524 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R85;
15525 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R86;
15526 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R87;
15527 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R88;
15528 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R89;
15529 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R8A;
15530 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R8B;
15531 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R8C;
15532 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R8D;
15533 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R8E;
15534 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R8F;
15535 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R90;
15536 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R91;
15537 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R92;
15538 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R93;
15539 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R94;
15540 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R95;
15541 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R96;
15542 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R97;
15543 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R98;
15544 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R99;
15545 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R9A;
15546 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R9B;
15547 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R9C;
15548 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R9D;
15549 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R9E;
15550 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R9F;
15551 if ((keySize | 0) == 16) {
15552 S0 = HEAP[sbox | t0] ^ RA0;
15553 S1 = HEAP[sbox | t5] ^ RA1;
15554 S2 = HEAP[sbox | tA] ^ RA2;
15555 S3 = HEAP[sbox | tF] ^ RA3;
15556 S4 = HEAP[sbox | t4] ^ RA4;
15557 S5 = HEAP[sbox | t9] ^ RA5;
15558 S6 = HEAP[sbox | tE] ^ RA6;
15559 S7 = HEAP[sbox | t3] ^ RA7;
15560 S8 = HEAP[sbox | t8] ^ RA8;
15561 S9 = HEAP[sbox | tD] ^ RA9;
15562 SA = HEAP[sbox | t2] ^ RAA;
15563 SB = HEAP[sbox | t7] ^ RAB;
15564 SC = HEAP[sbox | tC] ^ RAC;
15565 SD = HEAP[sbox | t1] ^ RAD;
15566 SE = HEAP[sbox | t6] ^ RAE;
15567 SF = HEAP[sbox | tB] ^ RAF;
15568 return;
15569 }
15570 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RA0;
15571 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RA1;
15572 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RA2;
15573 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RA3;
15574 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RA4;
15575 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RA5;
15576 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RA6;
15577 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RA7;
15578 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RA8;
15579 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RA9;
15580 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RAA;
15581 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RAB;
15582 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RAC;
15583 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RAD;
15584 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RAE;
15585 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RAF;
15586 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RB0;
15587 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RB1;
15588 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RB2;
15589 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RB3;
15590 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RB4;
15591 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RB5;
15592 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RB6;
15593 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RB7;
15594 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RB8;
15595 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RB9;
15596 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RBA;
15597 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RBB;
15598 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RBC;
15599 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RBD;
15600 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RBE;
15601 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RBF;
15602 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RC0;
15603 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RC1;
15604 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RC2;
15605 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RC3;
15606 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RC4;
15607 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RC5;
15608 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RC6;
15609 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RC7;
15610 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RC8;
15611 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RC9;
15612 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RCA;
15613 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RCB;
15614 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RCC;
15615 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RCD;
15616 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RCE;
15617 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RCF;
15618 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RD0;
15619 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RD1;
15620 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RD2;
15621 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RD3;
15622 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RD4;
15623 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RD5;
15624 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RD6;
15625 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RD7;
15626 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RD8;
15627 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RD9;
15628 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RDA;
15629 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RDB;
15630 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RDC;
15631 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RDD;
15632 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RDE;
15633 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RDF;
15634 S0 = HEAP[sbox | t0] ^ RE0;
15635 S1 = HEAP[sbox | t5] ^ RE1;
15636 S2 = HEAP[sbox | tA] ^ RE2;
15637 S3 = HEAP[sbox | tF] ^ RE3;
15638 S4 = HEAP[sbox | t4] ^ RE4;
15639 S5 = HEAP[sbox | t9] ^ RE5;
15640 S6 = HEAP[sbox | tE] ^ RE6;
15641 S7 = HEAP[sbox | t3] ^ RE7;
15642 S8 = HEAP[sbox | t8] ^ RE8;
15643 S9 = HEAP[sbox | tD] ^ RE9;
15644 SA = HEAP[sbox | t2] ^ REA;
15645 SB = HEAP[sbox | t7] ^ REB;
15646 SC = HEAP[sbox | tC] ^ REC;
15647 SD = HEAP[sbox | t1] ^ RED;
15648 SE = HEAP[sbox | t6] ^ REE;
15649 SF = HEAP[sbox | tB] ^ REF;
15650 }
15651 function _decrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15652 s0 = s0 | 0;
15653 s1 = s1 | 0;
15654 s2 = s2 | 0;
15655 s3 = s3 | 0;
15656 s4 = s4 | 0;
15657 s5 = s5 | 0;
15658 s6 = s6 | 0;
15659 s7 = s7 | 0;
15660 s8 = s8 | 0;
15661 s9 = s9 | 0;
15662 sA = sA | 0;
15663 sB = sB | 0;
15664 sC = sC | 0;
15665 sD = sD | 0;
15666 sE = sE | 0;
15667 sF = sF | 0;
15668 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;
15669 if ((keySize | 0) == 32) {
15670 t0 = HEAP[inv_sbox | s0 ^ RE0] ^ RD0;
15671 t1 = HEAP[inv_sbox | sD ^ RED] ^ RD1;
15672 t2 = HEAP[inv_sbox | sA ^ REA] ^ RD2;
15673 t3 = HEAP[inv_sbox | s7 ^ RE7] ^ RD3;
15674 t4 = HEAP[inv_sbox | s4 ^ RE4] ^ RD4;
15675 t5 = HEAP[inv_sbox | s1 ^ RE1] ^ RD5;
15676 t6 = HEAP[inv_sbox | sE ^ REE] ^ RD6;
15677 t7 = HEAP[inv_sbox | sB ^ REB] ^ RD7;
15678 t8 = HEAP[inv_sbox | s8 ^ RE8] ^ RD8;
15679 t9 = HEAP[inv_sbox | s5 ^ RE5] ^ RD9;
15680 tA = HEAP[inv_sbox | s2 ^ RE2] ^ RDA;
15681 tB = HEAP[inv_sbox | sF ^ REF] ^ RDB;
15682 tC = HEAP[inv_sbox | sC ^ REC] ^ RDC;
15683 tD = HEAP[inv_sbox | s9 ^ RE9] ^ RDD;
15684 tE = HEAP[inv_sbox | s6 ^ RE6] ^ RDE;
15685 tF = HEAP[inv_sbox | s3 ^ RE3] ^ RDF;
15686 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15687 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15688 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15689 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15690 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15691 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15692 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15693 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15694 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15695 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15696 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15697 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15698 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15699 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15700 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15701 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15702 t0 = HEAP[inv_sbox | s0] ^ RC0;
15703 t1 = HEAP[inv_sbox | s1] ^ RC1;
15704 t2 = HEAP[inv_sbox | s2] ^ RC2;
15705 t3 = HEAP[inv_sbox | s3] ^ RC3;
15706 t4 = HEAP[inv_sbox | s4] ^ RC4;
15707 t5 = HEAP[inv_sbox | s5] ^ RC5;
15708 t6 = HEAP[inv_sbox | s6] ^ RC6;
15709 t7 = HEAP[inv_sbox | s7] ^ RC7;
15710 t8 = HEAP[inv_sbox | s8] ^ RC8;
15711 t9 = HEAP[inv_sbox | s9] ^ RC9;
15712 tA = HEAP[inv_sbox | sA] ^ RCA;
15713 tB = HEAP[inv_sbox | sB] ^ RCB;
15714 tC = HEAP[inv_sbox | sC] ^ RCC;
15715 tD = HEAP[inv_sbox | sD] ^ RCD;
15716 tE = HEAP[inv_sbox | sE] ^ RCE;
15717 tF = HEAP[inv_sbox | sF] ^ RCF;
15718 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15719 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15720 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15721 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15722 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15723 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15724 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15725 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15726 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15727 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15728 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15729 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15730 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15731 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15732 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15733 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15734 t0 = HEAP[inv_sbox | s0] ^ RB0;
15735 t1 = HEAP[inv_sbox | s1] ^ RB1;
15736 t2 = HEAP[inv_sbox | s2] ^ RB2;
15737 t3 = HEAP[inv_sbox | s3] ^ RB3;
15738 t4 = HEAP[inv_sbox | s4] ^ RB4;
15739 t5 = HEAP[inv_sbox | s5] ^ RB5;
15740 t6 = HEAP[inv_sbox | s6] ^ RB6;
15741 t7 = HEAP[inv_sbox | s7] ^ RB7;
15742 t8 = HEAP[inv_sbox | s8] ^ RB8;
15743 t9 = HEAP[inv_sbox | s9] ^ RB9;
15744 tA = HEAP[inv_sbox | sA] ^ RBA;
15745 tB = HEAP[inv_sbox | sB] ^ RBB;
15746 tC = HEAP[inv_sbox | sC] ^ RBC;
15747 tD = HEAP[inv_sbox | sD] ^ RBD;
15748 tE = HEAP[inv_sbox | sE] ^ RBE;
15749 tF = HEAP[inv_sbox | sF] ^ RBF;
15750 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15751 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15752 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15753 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15754 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15755 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15756 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15757 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15758 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15759 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15760 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15761 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15762 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15763 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15764 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15765 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15766 t0 = HEAP[inv_sbox | s0] ^ RA0;
15767 t1 = HEAP[inv_sbox | s1] ^ RA1;
15768 t2 = HEAP[inv_sbox | s2] ^ RA2;
15769 t3 = HEAP[inv_sbox | s3] ^ RA3;
15770 t4 = HEAP[inv_sbox | s4] ^ RA4;
15771 t5 = HEAP[inv_sbox | s5] ^ RA5;
15772 t6 = HEAP[inv_sbox | s6] ^ RA6;
15773 t7 = HEAP[inv_sbox | s7] ^ RA7;
15774 t8 = HEAP[inv_sbox | s8] ^ RA8;
15775 t9 = HEAP[inv_sbox | s9] ^ RA9;
15776 tA = HEAP[inv_sbox | sA] ^ RAA;
15777 tB = HEAP[inv_sbox | sB] ^ RAB;
15778 tC = HEAP[inv_sbox | sC] ^ RAC;
15779 tD = HEAP[inv_sbox | sD] ^ RAD;
15780 tE = HEAP[inv_sbox | sE] ^ RAE;
15781 tF = HEAP[inv_sbox | sF] ^ RAF;
15782 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15783 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15784 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15785 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15786 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15787 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15788 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15789 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15790 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15791 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15792 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15793 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15794 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15795 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15796 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15797 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15798 t0 = HEAP[inv_sbox | s0] ^ R90;
15799 t1 = HEAP[inv_sbox | s1] ^ R91;
15800 t2 = HEAP[inv_sbox | s2] ^ R92;
15801 t3 = HEAP[inv_sbox | s3] ^ R93;
15802 t4 = HEAP[inv_sbox | s4] ^ R94;
15803 t5 = HEAP[inv_sbox | s5] ^ R95;
15804 t6 = HEAP[inv_sbox | s6] ^ R96;
15805 t7 = HEAP[inv_sbox | s7] ^ R97;
15806 t8 = HEAP[inv_sbox | s8] ^ R98;
15807 t9 = HEAP[inv_sbox | s9] ^ R99;
15808 tA = HEAP[inv_sbox | sA] ^ R9A;
15809 tB = HEAP[inv_sbox | sB] ^ R9B;
15810 tC = HEAP[inv_sbox | sC] ^ R9C;
15811 tD = HEAP[inv_sbox | sD] ^ R9D;
15812 tE = HEAP[inv_sbox | sE] ^ R9E;
15813 tF = HEAP[inv_sbox | sF] ^ R9F;
15814 } else {
15815 t0 = HEAP[inv_sbox | s0 ^ RA0] ^ R90;
15816 t1 = HEAP[inv_sbox | sD ^ RAD] ^ R91;
15817 t2 = HEAP[inv_sbox | sA ^ RAA] ^ R92;
15818 t3 = HEAP[inv_sbox | s7 ^ RA7] ^ R93;
15819 t4 = HEAP[inv_sbox | s4 ^ RA4] ^ R94;
15820 t5 = HEAP[inv_sbox | s1 ^ RA1] ^ R95;
15821 t6 = HEAP[inv_sbox | sE ^ RAE] ^ R96;
15822 t7 = HEAP[inv_sbox | sB ^ RAB] ^ R97;
15823 t8 = HEAP[inv_sbox | s8 ^ RA8] ^ R98;
15824 t9 = HEAP[inv_sbox | s5 ^ RA5] ^ R99;
15825 tA = HEAP[inv_sbox | s2 ^ RA2] ^ R9A;
15826 tB = HEAP[inv_sbox | sF ^ RAF] ^ R9B;
15827 tC = HEAP[inv_sbox | sC ^ RAC] ^ R9C;
15828 tD = HEAP[inv_sbox | s9 ^ RA9] ^ R9D;
15829 tE = HEAP[inv_sbox | s6 ^ RA6] ^ R9E;
15830 tF = HEAP[inv_sbox | s3 ^ RA3] ^ R9F;
15831 }
15832 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15833 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15834 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15835 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15836 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15837 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15838 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15839 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15840 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15841 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15842 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15843 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15844 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15845 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15846 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15847 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15848 t0 = HEAP[inv_sbox | s0] ^ R80;
15849 t1 = HEAP[inv_sbox | s1] ^ R81;
15850 t2 = HEAP[inv_sbox | s2] ^ R82;
15851 t3 = HEAP[inv_sbox | s3] ^ R83;
15852 t4 = HEAP[inv_sbox | s4] ^ R84;
15853 t5 = HEAP[inv_sbox | s5] ^ R85;
15854 t6 = HEAP[inv_sbox | s6] ^ R86;
15855 t7 = HEAP[inv_sbox | s7] ^ R87;
15856 t8 = HEAP[inv_sbox | s8] ^ R88;
15857 t9 = HEAP[inv_sbox | s9] ^ R89;
15858 tA = HEAP[inv_sbox | sA] ^ R8A;
15859 tB = HEAP[inv_sbox | sB] ^ R8B;
15860 tC = HEAP[inv_sbox | sC] ^ R8C;
15861 tD = HEAP[inv_sbox | sD] ^ R8D;
15862 tE = HEAP[inv_sbox | sE] ^ R8E;
15863 tF = HEAP[inv_sbox | sF] ^ R8F;
15864 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15865 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15866 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15867 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15868 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15869 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15870 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15871 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15872 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15873 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15874 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15875 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15876 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15877 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15878 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15879 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15880 t0 = HEAP[inv_sbox | s0] ^ R70;
15881 t1 = HEAP[inv_sbox | s1] ^ R71;
15882 t2 = HEAP[inv_sbox | s2] ^ R72;
15883 t3 = HEAP[inv_sbox | s3] ^ R73;
15884 t4 = HEAP[inv_sbox | s4] ^ R74;
15885 t5 = HEAP[inv_sbox | s5] ^ R75;
15886 t6 = HEAP[inv_sbox | s6] ^ R76;
15887 t7 = HEAP[inv_sbox | s7] ^ R77;
15888 t8 = HEAP[inv_sbox | s8] ^ R78;
15889 t9 = HEAP[inv_sbox | s9] ^ R79;
15890 tA = HEAP[inv_sbox | sA] ^ R7A;
15891 tB = HEAP[inv_sbox | sB] ^ R7B;
15892 tC = HEAP[inv_sbox | sC] ^ R7C;
15893 tD = HEAP[inv_sbox | sD] ^ R7D;
15894 tE = HEAP[inv_sbox | sE] ^ R7E;
15895 tF = HEAP[inv_sbox | sF] ^ R7F;
15896 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15897 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15898 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15899 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15900 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15901 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15902 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15903 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15904 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15905 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15906 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15907 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15908 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15909 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15910 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15911 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15912 t0 = HEAP[inv_sbox | s0] ^ R60;
15913 t1 = HEAP[inv_sbox | s1] ^ R61;
15914 t2 = HEAP[inv_sbox | s2] ^ R62;
15915 t3 = HEAP[inv_sbox | s3] ^ R63;
15916 t4 = HEAP[inv_sbox | s4] ^ R64;
15917 t5 = HEAP[inv_sbox | s5] ^ R65;
15918 t6 = HEAP[inv_sbox | s6] ^ R66;
15919 t7 = HEAP[inv_sbox | s7] ^ R67;
15920 t8 = HEAP[inv_sbox | s8] ^ R68;
15921 t9 = HEAP[inv_sbox | s9] ^ R69;
15922 tA = HEAP[inv_sbox | sA] ^ R6A;
15923 tB = HEAP[inv_sbox | sB] ^ R6B;
15924 tC = HEAP[inv_sbox | sC] ^ R6C;
15925 tD = HEAP[inv_sbox | sD] ^ R6D;
15926 tE = HEAP[inv_sbox | sE] ^ R6E;
15927 tF = HEAP[inv_sbox | sF] ^ R6F;
15928 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15929 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15930 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15931 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15932 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15933 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15934 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15935 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15936 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15937 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15938 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15939 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15940 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15941 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15942 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15943 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15944 t0 = HEAP[inv_sbox | s0] ^ R50;
15945 t1 = HEAP[inv_sbox | s1] ^ R51;
15946 t2 = HEAP[inv_sbox | s2] ^ R52;
15947 t3 = HEAP[inv_sbox | s3] ^ R53;
15948 t4 = HEAP[inv_sbox | s4] ^ R54;
15949 t5 = HEAP[inv_sbox | s5] ^ R55;
15950 t6 = HEAP[inv_sbox | s6] ^ R56;
15951 t7 = HEAP[inv_sbox | s7] ^ R57;
15952 t8 = HEAP[inv_sbox | s8] ^ R58;
15953 t9 = HEAP[inv_sbox | s9] ^ R59;
15954 tA = HEAP[inv_sbox | sA] ^ R5A;
15955 tB = HEAP[inv_sbox | sB] ^ R5B;
15956 tC = HEAP[inv_sbox | sC] ^ R5C;
15957 tD = HEAP[inv_sbox | sD] ^ R5D;
15958 tE = HEAP[inv_sbox | sE] ^ R5E;
15959 tF = HEAP[inv_sbox | sF] ^ R5F;
15960 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15961 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15962 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15963 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15964 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15965 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15966 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15967 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15968 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15969 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15970 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15971 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15972 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15973 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15974 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15975 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15976 t0 = HEAP[inv_sbox | s0] ^ R40;
15977 t1 = HEAP[inv_sbox | s1] ^ R41;
15978 t2 = HEAP[inv_sbox | s2] ^ R42;
15979 t3 = HEAP[inv_sbox | s3] ^ R43;
15980 t4 = HEAP[inv_sbox | s4] ^ R44;
15981 t5 = HEAP[inv_sbox | s5] ^ R45;
15982 t6 = HEAP[inv_sbox | s6] ^ R46;
15983 t7 = HEAP[inv_sbox | s7] ^ R47;
15984 t8 = HEAP[inv_sbox | s8] ^ R48;
15985 t9 = HEAP[inv_sbox | s9] ^ R49;
15986 tA = HEAP[inv_sbox | sA] ^ R4A;
15987 tB = HEAP[inv_sbox | sB] ^ R4B;
15988 tC = HEAP[inv_sbox | sC] ^ R4C;
15989 tD = HEAP[inv_sbox | sD] ^ R4D;
15990 tE = HEAP[inv_sbox | sE] ^ R4E;
15991 tF = HEAP[inv_sbox | sF] ^ R4F;
15992 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15993 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15994 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15995 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15996 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15997 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15998 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15999 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16000 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16001 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16002 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16003 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16004 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16005 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16006 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16007 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16008 t0 = HEAP[inv_sbox | s0] ^ R30;
16009 t1 = HEAP[inv_sbox | s1] ^ R31;
16010 t2 = HEAP[inv_sbox | s2] ^ R32;
16011 t3 = HEAP[inv_sbox | s3] ^ R33;
16012 t4 = HEAP[inv_sbox | s4] ^ R34;
16013 t5 = HEAP[inv_sbox | s5] ^ R35;
16014 t6 = HEAP[inv_sbox | s6] ^ R36;
16015 t7 = HEAP[inv_sbox | s7] ^ R37;
16016 t8 = HEAP[inv_sbox | s8] ^ R38;
16017 t9 = HEAP[inv_sbox | s9] ^ R39;
16018 tA = HEAP[inv_sbox | sA] ^ R3A;
16019 tB = HEAP[inv_sbox | sB] ^ R3B;
16020 tC = HEAP[inv_sbox | sC] ^ R3C;
16021 tD = HEAP[inv_sbox | sD] ^ R3D;
16022 tE = HEAP[inv_sbox | sE] ^ R3E;
16023 tF = HEAP[inv_sbox | sF] ^ R3F;
16024 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16025 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16026 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16027 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16028 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16029 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16030 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16031 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16032 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16033 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16034 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16035 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16036 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16037 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16038 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16039 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16040 t0 = HEAP[inv_sbox | s0] ^ R20;
16041 t1 = HEAP[inv_sbox | s1] ^ R21;
16042 t2 = HEAP[inv_sbox | s2] ^ R22;
16043 t3 = HEAP[inv_sbox | s3] ^ R23;
16044 t4 = HEAP[inv_sbox | s4] ^ R24;
16045 t5 = HEAP[inv_sbox | s5] ^ R25;
16046 t6 = HEAP[inv_sbox | s6] ^ R26;
16047 t7 = HEAP[inv_sbox | s7] ^ R27;
16048 t8 = HEAP[inv_sbox | s8] ^ R28;
16049 t9 = HEAP[inv_sbox | s9] ^ R29;
16050 tA = HEAP[inv_sbox | sA] ^ R2A;
16051 tB = HEAP[inv_sbox | sB] ^ R2B;
16052 tC = HEAP[inv_sbox | sC] ^ R2C;
16053 tD = HEAP[inv_sbox | sD] ^ R2D;
16054 tE = HEAP[inv_sbox | sE] ^ R2E;
16055 tF = HEAP[inv_sbox | sF] ^ R2F;
16056 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16057 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16058 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16059 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16060 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16061 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16062 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16063 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16064 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16065 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16066 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16067 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16068 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16069 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16070 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16071 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16072 t0 = HEAP[inv_sbox | s0] ^ R10;
16073 t1 = HEAP[inv_sbox | s1] ^ R11;
16074 t2 = HEAP[inv_sbox | s2] ^ R12;
16075 t3 = HEAP[inv_sbox | s3] ^ R13;
16076 t4 = HEAP[inv_sbox | s4] ^ R14;
16077 t5 = HEAP[inv_sbox | s5] ^ R15;
16078 t6 = HEAP[inv_sbox | s6] ^ R16;
16079 t7 = HEAP[inv_sbox | s7] ^ R17;
16080 t8 = HEAP[inv_sbox | s8] ^ R18;
16081 t9 = HEAP[inv_sbox | s9] ^ R19;
16082 tA = HEAP[inv_sbox | sA] ^ R1A;
16083 tB = HEAP[inv_sbox | sB] ^ R1B;
16084 tC = HEAP[inv_sbox | sC] ^ R1C;
16085 tD = HEAP[inv_sbox | sD] ^ R1D;
16086 tE = HEAP[inv_sbox | sE] ^ R1E;
16087 tF = HEAP[inv_sbox | sF] ^ R1F;
16088 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16089 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16090 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16091 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16092 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16093 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16094 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16095 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16096 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16097 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16098 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16099 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16100 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16101 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16102 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16103 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16104 S0 = HEAP[inv_sbox | s0] ^ R00;
16105 S1 = HEAP[inv_sbox | s1] ^ R01;
16106 S2 = HEAP[inv_sbox | s2] ^ R02;
16107 S3 = HEAP[inv_sbox | s3] ^ R03;
16108 S4 = HEAP[inv_sbox | s4] ^ R04;
16109 S5 = HEAP[inv_sbox | s5] ^ R05;
16110 S6 = HEAP[inv_sbox | s6] ^ R06;
16111 S7 = HEAP[inv_sbox | s7] ^ R07;
16112 S8 = HEAP[inv_sbox | s8] ^ R08;
16113 S9 = HEAP[inv_sbox | s9] ^ R09;
16114 SA = HEAP[inv_sbox | sA] ^ R0A;
16115 SB = HEAP[inv_sbox | sB] ^ R0B;
16116 SC = HEAP[inv_sbox | sC] ^ R0C;
16117 SD = HEAP[inv_sbox | sD] ^ R0D;
16118 SE = HEAP[inv_sbox | sE] ^ R0E;
16119 SF = HEAP[inv_sbox | sF] ^ R0F;
16120 }
16121 function init_state(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
16122 s0 = s0 | 0;
16123 s1 = s1 | 0;
16124 s2 = s2 | 0;
16125 s3 = s3 | 0;
16126 s4 = s4 | 0;
16127 s5 = s5 | 0;
16128 s6 = s6 | 0;
16129 s7 = s7 | 0;
16130 s8 = s8 | 0;
16131 s9 = s9 | 0;
16132 sA = sA | 0;
16133 sB = sB | 0;
16134 sC = sC | 0;
16135 sD = sD | 0;
16136 sE = sE | 0;
16137 sF = sF | 0;
16138 S0 = s0;
16139 S1 = s1;
16140 S2 = s2;
16141 S3 = s3;
16142 S4 = s4;
16143 S5 = s5;
16144 S6 = s6;
16145 S7 = s7;
16146 S8 = s8;
16147 S9 = s9;
16148 SA = sA;
16149 SB = sB;
16150 SC = sC;
16151 SD = sD;
16152 SE = sE;
16153 SF = sF;
16154 }
16155 function save_state(offset) {
16156 offset = offset | 0;
16157 HEAP[offset] = S0;
16158 HEAP[offset | 1] = S1;
16159 HEAP[offset | 2] = S2;
16160 HEAP[offset | 3] = S3;
16161 HEAP[offset | 4] = S4;
16162 HEAP[offset | 5] = S5;
16163 HEAP[offset | 6] = S6;
16164 HEAP[offset | 7] = S7;
16165 HEAP[offset | 8] = S8;
16166 HEAP[offset | 9] = S9;
16167 HEAP[offset | 10] = SA;
16168 HEAP[offset | 11] = SB;
16169 HEAP[offset | 12] = SC;
16170 HEAP[offset | 13] = SD;
16171 HEAP[offset | 14] = SE;
16172 HEAP[offset | 15] = SF;
16173 }
16174 function init_key_128(k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, kA, kB, kC, kD, kE, kF) {
16175 k0 = k0 | 0;
16176 k1 = k1 | 0;
16177 k2 = k2 | 0;
16178 k3 = k3 | 0;
16179 k4 = k4 | 0;
16180 k5 = k5 | 0;
16181 k6 = k6 | 0;
16182 k7 = k7 | 0;
16183 k8 = k8 | 0;
16184 k9 = k9 | 0;
16185 kA = kA | 0;
16186 kB = kB | 0;
16187 kC = kC | 0;
16188 kD = kD | 0;
16189 kE = kE | 0;
16190 kF = kF | 0;
16191 R00 = k0;
16192 R01 = k1;
16193 R02 = k2;
16194 R03 = k3;
16195 R04 = k4;
16196 R05 = k5;
16197 R06 = k6;
16198 R07 = k7;
16199 R08 = k8;
16200 R09 = k9;
16201 R0A = kA;
16202 R0B = kB;
16203 R0C = kC;
16204 R0D = kD;
16205 R0E = kE;
16206 R0F = kF;
16207 keySize = 16;
16208 _expand_key_128();
16209 }
16210 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) {
16211 k00 = k00 | 0;
16212 k01 = k01 | 0;
16213 k02 = k02 | 0;
16214 k03 = k03 | 0;
16215 k04 = k04 | 0;
16216 k05 = k05 | 0;
16217 k06 = k06 | 0;
16218 k07 = k07 | 0;
16219 k08 = k08 | 0;
16220 k09 = k09 | 0;
16221 k0A = k0A | 0;
16222 k0B = k0B | 0;
16223 k0C = k0C | 0;
16224 k0D = k0D | 0;
16225 k0E = k0E | 0;
16226 k0F = k0F | 0;
16227 k10 = k10 | 0;
16228 k11 = k11 | 0;
16229 k12 = k12 | 0;
16230 k13 = k13 | 0;
16231 k14 = k14 | 0;
16232 k15 = k15 | 0;
16233 k16 = k16 | 0;
16234 k17 = k17 | 0;
16235 k18 = k18 | 0;
16236 k19 = k19 | 0;
16237 k1A = k1A | 0;
16238 k1B = k1B | 0;
16239 k1C = k1C | 0;
16240 k1D = k1D | 0;
16241 k1E = k1E | 0;
16242 k1F = k1F | 0;
16243 R00 = k00;
16244 R01 = k01;
16245 R02 = k02;
16246 R03 = k03;
16247 R04 = k04;
16248 R05 = k05;
16249 R06 = k06;
16250 R07 = k07;
16251 R08 = k08;
16252 R09 = k09;
16253 R0A = k0A;
16254 R0B = k0B;
16255 R0C = k0C;
16256 R0D = k0D;
16257 R0E = k0E;
16258 R0F = k0F;
16259 R10 = k10;
16260 R11 = k11;
16261 R12 = k12;
16262 R13 = k13;
16263 R14 = k14;
16264 R15 = k15;
16265 R16 = k16;
16266 R17 = k17;
16267 R18 = k18;
16268 R19 = k19;
16269 R1A = k1A;
16270 R1B = k1B;
16271 R1C = k1C;
16272 R1D = k1D;
16273 R1E = k1E;
16274 R1F = k1F;
16275 keySize = 32;
16276 _expand_key_256();
16277 }
16278 function cbc_encrypt(offset, length) {
16279 offset = offset | 0;
16280 length = length | 0;
16281 var encrypted = 0;
16282 if (offset & 15) return -1;
16283 while ((length | 0) >= 16) {
16284 _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]);
16285 HEAP[offset] = S0;
16286 HEAP[offset | 1] = S1;
16287 HEAP[offset | 2] = S2;
16288 HEAP[offset | 3] = S3;
16289 HEAP[offset | 4] = S4;
16290 HEAP[offset | 5] = S5;
16291 HEAP[offset | 6] = S6;
16292 HEAP[offset | 7] = S7;
16293 HEAP[offset | 8] = S8;
16294 HEAP[offset | 9] = S9;
16295 HEAP[offset | 10] = SA;
16296 HEAP[offset | 11] = SB;
16297 HEAP[offset | 12] = SC;
16298 HEAP[offset | 13] = SD;
16299 HEAP[offset | 14] = SE;
16300 HEAP[offset | 15] = SF;
16301 offset = offset + 16 | 0;
16302 length = length - 16 | 0;
16303 encrypted = encrypted + 16 | 0;
16304 }
16305 return encrypted | 0;
16306 }
16307 function cbc_decrypt(offset, length) {
16308 offset = offset | 0;
16309 length = length | 0;
16310 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;
16311 if (offset & 15) return -1;
16312 iv0 = S0;
16313 iv1 = S1;
16314 iv2 = S2;
16315 iv3 = S3;
16316 iv4 = S4;
16317 iv5 = S5;
16318 iv6 = S6;
16319 iv7 = S7;
16320 iv8 = S8;
16321 iv9 = S9;
16322 ivA = SA;
16323 ivB = SB;
16324 ivC = SC;
16325 ivD = SD;
16326 ivE = SE;
16327 ivF = SF;
16328 while ((length | 0) >= 16) {
16329 _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);
16330 S0 = S0 ^ iv0;
16331 iv0 = HEAP[offset] | 0;
16332 S1 = S1 ^ iv1;
16333 iv1 = HEAP[offset | 1] | 0;
16334 S2 = S2 ^ iv2;
16335 iv2 = HEAP[offset | 2] | 0;
16336 S3 = S3 ^ iv3;
16337 iv3 = HEAP[offset | 3] | 0;
16338 S4 = S4 ^ iv4;
16339 iv4 = HEAP[offset | 4] | 0;
16340 S5 = S5 ^ iv5;
16341 iv5 = HEAP[offset | 5] | 0;
16342 S6 = S6 ^ iv6;
16343 iv6 = HEAP[offset | 6] | 0;
16344 S7 = S7 ^ iv7;
16345 iv7 = HEAP[offset | 7] | 0;
16346 S8 = S8 ^ iv8;
16347 iv8 = HEAP[offset | 8] | 0;
16348 S9 = S9 ^ iv9;
16349 iv9 = HEAP[offset | 9] | 0;
16350 SA = SA ^ ivA;
16351 ivA = HEAP[offset | 10] | 0;
16352 SB = SB ^ ivB;
16353 ivB = HEAP[offset | 11] | 0;
16354 SC = SC ^ ivC;
16355 ivC = HEAP[offset | 12] | 0;
16356 SD = SD ^ ivD;
16357 ivD = HEAP[offset | 13] | 0;
16358 SE = SE ^ ivE;
16359 ivE = HEAP[offset | 14] | 0;
16360 SF = SF ^ ivF;
16361 ivF = HEAP[offset | 15] | 0;
16362 HEAP[offset] = S0;
16363 HEAP[offset | 1] = S1;
16364 HEAP[offset | 2] = S2;
16365 HEAP[offset | 3] = S3;
16366 HEAP[offset | 4] = S4;
16367 HEAP[offset | 5] = S5;
16368 HEAP[offset | 6] = S6;
16369 HEAP[offset | 7] = S7;
16370 HEAP[offset | 8] = S8;
16371 HEAP[offset | 9] = S9;
16372 HEAP[offset | 10] = SA;
16373 HEAP[offset | 11] = SB;
16374 HEAP[offset | 12] = SC;
16375 HEAP[offset | 13] = SD;
16376 HEAP[offset | 14] = SE;
16377 HEAP[offset | 15] = SF;
16378 offset = offset + 16 | 0;
16379 length = length - 16 | 0;
16380 decrypted = decrypted + 16 | 0;
16381 }
16382 S0 = iv0;
16383 S1 = iv1;
16384 S2 = iv2;
16385 S3 = iv3;
16386 S4 = iv4;
16387 S5 = iv5;
16388 S6 = iv6;
16389 S7 = iv7;
16390 S8 = iv8;
16391 S9 = iv9;
16392 SA = ivA;
16393 SB = ivB;
16394 SC = ivC;
16395 SD = ivD;
16396 SE = ivE;
16397 SF = ivF;
16398 return decrypted | 0;
16399 }
16400 function cbc_mac(offset, length, output) {
16401 offset = offset | 0;
16402 length = length | 0;
16403 output = output | 0;
16404 if (offset & 15) return -1;
16405 if (~output) if (output & 31) return -1;
16406 while ((length | 0) >= 16) {
16407 _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]);
16408 offset = offset + 16 | 0;
16409 length = length - 16 | 0;
16410 }
16411 if ((length | 0) > 0) {
16412 S0 = S0 ^ HEAP[offset];
16413 if ((length | 0) > 1) S1 = S1 ^ HEAP[offset | 1];
16414 if ((length | 0) > 2) S2 = S2 ^ HEAP[offset | 2];
16415 if ((length | 0) > 3) S3 = S3 ^ HEAP[offset | 3];
16416 if ((length | 0) > 4) S4 = S4 ^ HEAP[offset | 4];
16417 if ((length | 0) > 5) S5 = S5 ^ HEAP[offset | 5];
16418 if ((length | 0) > 6) S6 = S6 ^ HEAP[offset | 6];
16419 if ((length | 0) > 7) S7 = S7 ^ HEAP[offset | 7];
16420 if ((length | 0) > 8) S8 = S8 ^ HEAP[offset | 8];
16421 if ((length | 0) > 9) S9 = S9 ^ HEAP[offset | 9];
16422 if ((length | 0) > 10) SA = SA ^ HEAP[offset | 10];
16423 if ((length | 0) > 11) SB = SB ^ HEAP[offset | 11];
16424 if ((length | 0) > 12) SC = SC ^ HEAP[offset | 12];
16425 if ((length | 0) > 13) SD = SD ^ HEAP[offset | 13];
16426 if ((length | 0) > 14) SE = SE ^ HEAP[offset | 14];
16427 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16428 offset = offset + length | 0;
16429 length = 0;
16430 }
16431 if (~output) {
16432 HEAP[output | 0] = S0;
16433 HEAP[output | 1] = S1;
16434 HEAP[output | 2] = S2;
16435 HEAP[output | 3] = S3;
16436 HEAP[output | 4] = S4;
16437 HEAP[output | 5] = S5;
16438 HEAP[output | 6] = S6;
16439 HEAP[output | 7] = S7;
16440 HEAP[output | 8] = S8;
16441 HEAP[output | 9] = S9;
16442 HEAP[output | 10] = SA;
16443 HEAP[output | 11] = SB;
16444 HEAP[output | 12] = SC;
16445 HEAP[output | 13] = SD;
16446 HEAP[output | 14] = SE;
16447 HEAP[output | 15] = SF;
16448 }
16449 return 0;
16450 }
16451 function ccm_encrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16452 offset = offset | 0;
16453 length = length | 0;
16454 nonce0 = nonce0 | 0;
16455 nonce1 = nonce1 | 0;
16456 nonce2 = nonce2 | 0;
16457 nonce3 = nonce3 | 0;
16458 nonce4 = nonce4 | 0;
16459 nonce5 = nonce5 | 0;
16460 nonce6 = nonce6 | 0;
16461 nonce7 = nonce7 | 0;
16462 nonce8 = nonce8 | 0;
16463 nonce9 = nonce9 | 0;
16464 nonceA = nonceA | 0;
16465 nonceB = nonceB | 0;
16466 nonceC = nonceC | 0;
16467 nonceD = nonceD | 0;
16468 counter0 = counter0 | 0;
16469 counter1 = counter1 | 0;
16470 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;
16471 if (offset & 15) return -1;
16472 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16473 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16474 while ((length | 0) >= 16) {
16475 s0 = HEAP[offset] | 0;
16476 s1 = HEAP[offset | 1] | 0;
16477 s2 = HEAP[offset | 2] | 0;
16478 s3 = HEAP[offset | 3] | 0;
16479 s4 = HEAP[offset | 4] | 0;
16480 s5 = HEAP[offset | 5] | 0;
16481 s6 = HEAP[offset | 6] | 0;
16482 s7 = HEAP[offset | 7] | 0;
16483 s8 = HEAP[offset | 8] | 0;
16484 s9 = HEAP[offset | 9] | 0;
16485 sA = HEAP[offset | 10] | 0;
16486 sB = HEAP[offset | 11] | 0;
16487 sC = HEAP[offset | 12] | 0;
16488 sD = HEAP[offset | 13] | 0;
16489 sE = HEAP[offset | 14] | 0;
16490 sF = HEAP[offset | 15] | 0;
16491 _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);
16492 HEAP[offset] = s0 ^ S0;
16493 HEAP[offset | 1] = s1 ^ S1;
16494 HEAP[offset | 2] = s2 ^ S2;
16495 HEAP[offset | 3] = s3 ^ S3;
16496 HEAP[offset | 4] = s4 ^ S4;
16497 HEAP[offset | 5] = s5 ^ S5;
16498 HEAP[offset | 6] = s6 ^ S6;
16499 HEAP[offset | 7] = s7 ^ S7;
16500 HEAP[offset | 8] = s8 ^ S8;
16501 HEAP[offset | 9] = s9 ^ S9;
16502 HEAP[offset | 10] = sA ^ SA;
16503 HEAP[offset | 11] = sB ^ SB;
16504 HEAP[offset | 12] = sC ^ SC;
16505 HEAP[offset | 13] = sD ^ SD;
16506 HEAP[offset | 14] = sE ^ SE;
16507 HEAP[offset | 15] = sF ^ SF;
16508 _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);
16509 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16510 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16511 encrypted = encrypted + 16 | 0;
16512 offset = offset + 16 | 0;
16513 length = length - 16 | 0;
16514 counter1 = counter1 + 1 | 0;
16515 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16516 }
16517 if ((length | 0) > 0) {
16518 s0 = HEAP[offset] | 0;
16519 s1 = (length | 0) > 1 ? HEAP[offset | 1] | 0 : 0;
16520 s2 = (length | 0) > 2 ? HEAP[offset | 2] | 0 : 0;
16521 s3 = (length | 0) > 3 ? HEAP[offset | 3] | 0 : 0;
16522 s4 = (length | 0) > 4 ? HEAP[offset | 4] | 0 : 0;
16523 s5 = (length | 0) > 5 ? HEAP[offset | 5] | 0 : 0;
16524 s6 = (length | 0) > 6 ? HEAP[offset | 6] | 0 : 0;
16525 s7 = (length | 0) > 7 ? HEAP[offset | 7] | 0 : 0;
16526 s8 = (length | 0) > 8 ? HEAP[offset | 8] | 0 : 0;
16527 s9 = (length | 0) > 9 ? HEAP[offset | 9] | 0 : 0;
16528 sA = (length | 0) > 10 ? HEAP[offset | 10] | 0 : 0;
16529 sB = (length | 0) > 11 ? HEAP[offset | 11] | 0 : 0;
16530 sC = (length | 0) > 12 ? HEAP[offset | 12] | 0 : 0;
16531 sD = (length | 0) > 13 ? HEAP[offset | 13] | 0 : 0;
16532 sE = (length | 0) > 14 ? HEAP[offset | 14] | 0 : 0;
16533 _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);
16534 HEAP[offset] = s0 ^ S0;
16535 if ((length | 0) > 1) HEAP[offset | 1] = s1 ^ S1;
16536 if ((length | 0) > 2) HEAP[offset | 2] = s2 ^ S2;
16537 if ((length | 0) > 3) HEAP[offset | 3] = s3 ^ S3;
16538 if ((length | 0) > 4) HEAP[offset | 4] = s4 ^ S4;
16539 if ((length | 0) > 5) HEAP[offset | 5] = s5 ^ S5;
16540 if ((length | 0) > 6) HEAP[offset | 6] = s6 ^ S6;
16541 if ((length | 0) > 7) HEAP[offset | 7] = s7 ^ S7;
16542 if ((length | 0) > 8) HEAP[offset | 8] = s8 ^ S8;
16543 if ((length | 0) > 9) HEAP[offset | 9] = s9 ^ S9;
16544 if ((length | 0) > 10) HEAP[offset | 10] = sA ^ SA;
16545 if ((length | 0) > 11) HEAP[offset | 11] = sB ^ SB;
16546 if ((length | 0) > 12) HEAP[offset | 12] = sC ^ SC;
16547 if ((length | 0) > 13) HEAP[offset | 13] = sD ^ SD;
16548 if ((length | 0) > 14) HEAP[offset | 14] = sE ^ SE;
16549 _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);
16550 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16551 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16552 encrypted = encrypted + length | 0;
16553 offset = offset + length | 0;
16554 length = 0;
16555 counter1 = counter1 + 1 | 0;
16556 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16557 }
16558 return encrypted | 0;
16559 }
16560 function ccm_decrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16561 offset = offset | 0;
16562 length = length | 0;
16563 nonce0 = nonce0 | 0;
16564 nonce1 = nonce1 | 0;
16565 nonce2 = nonce2 | 0;
16566 nonce3 = nonce3 | 0;
16567 nonce4 = nonce4 | 0;
16568 nonce5 = nonce5 | 0;
16569 nonce6 = nonce6 | 0;
16570 nonce7 = nonce7 | 0;
16571 nonce8 = nonce8 | 0;
16572 nonce9 = nonce9 | 0;
16573 nonceA = nonceA | 0;
16574 nonceB = nonceB | 0;
16575 nonceC = nonceC | 0;
16576 nonceD = nonceD | 0;
16577 counter0 = counter0 | 0;
16578 counter1 = counter1 | 0;
16579 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;
16580 if (offset & 15) return -1;
16581 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16582 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16583 while ((length | 0) >= 16) {
16584 _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);
16585 HEAP[offset] = s0 = HEAP[offset] ^ S0;
16586 HEAP[offset | 1] = s1 = HEAP[offset | 1] ^ S1;
16587 HEAP[offset | 2] = s2 = HEAP[offset | 2] ^ S2;
16588 HEAP[offset | 3] = s3 = HEAP[offset | 3] ^ S3;
16589 HEAP[offset | 4] = s4 = HEAP[offset | 4] ^ S4;
16590 HEAP[offset | 5] = s5 = HEAP[offset | 5] ^ S5;
16591 HEAP[offset | 6] = s6 = HEAP[offset | 6] ^ S6;
16592 HEAP[offset | 7] = s7 = HEAP[offset | 7] ^ S7;
16593 HEAP[offset | 8] = s8 = HEAP[offset | 8] ^ S8;
16594 HEAP[offset | 9] = s9 = HEAP[offset | 9] ^ S9;
16595 HEAP[offset | 10] = sA = HEAP[offset | 10] ^ SA;
16596 HEAP[offset | 11] = sB = HEAP[offset | 11] ^ SB;
16597 HEAP[offset | 12] = sC = HEAP[offset | 12] ^ SC;
16598 HEAP[offset | 13] = sD = HEAP[offset | 13] ^ SD;
16599 HEAP[offset | 14] = sE = HEAP[offset | 14] ^ SE;
16600 HEAP[offset | 15] = sF = HEAP[offset | 15] ^ SF;
16601 _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);
16602 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16603 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16604 decrypted = decrypted + 16 | 0;
16605 offset = offset + 16 | 0;
16606 length = length - 16 | 0;
16607 counter1 = counter1 + 1 | 0;
16608 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16609 }
16610 if ((length | 0) > 0) {
16611 _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);
16612 s0 = HEAP[offset] ^ S0;
16613 s1 = (length | 0) > 1 ? HEAP[offset | 1] ^ S1 : 0;
16614 s2 = (length | 0) > 2 ? HEAP[offset | 2] ^ S2 : 0;
16615 s3 = (length | 0) > 3 ? HEAP[offset | 3] ^ S3 : 0;
16616 s4 = (length | 0) > 4 ? HEAP[offset | 4] ^ S4 : 0;
16617 s5 = (length | 0) > 5 ? HEAP[offset | 5] ^ S5 : 0;
16618 s6 = (length | 0) > 6 ? HEAP[offset | 6] ^ S6 : 0;
16619 s7 = (length | 0) > 7 ? HEAP[offset | 7] ^ S7 : 0;
16620 s8 = (length | 0) > 8 ? HEAP[offset | 8] ^ S8 : 0;
16621 s9 = (length | 0) > 9 ? HEAP[offset | 9] ^ S9 : 0;
16622 sA = (length | 0) > 10 ? HEAP[offset | 10] ^ SA : 0;
16623 sB = (length | 0) > 11 ? HEAP[offset | 11] ^ SB : 0;
16624 sC = (length | 0) > 12 ? HEAP[offset | 12] ^ SC : 0;
16625 sD = (length | 0) > 13 ? HEAP[offset | 13] ^ SD : 0;
16626 sE = (length | 0) > 14 ? HEAP[offset | 14] ^ SE : 0;
16627 sF = (length | 0) > 15 ? HEAP[offset | 15] ^ SF : 0;
16628 HEAP[offset] = s0;
16629 if ((length | 0) > 1) HEAP[offset | 1] = s1;
16630 if ((length | 0) > 2) HEAP[offset | 2] = s2;
16631 if ((length | 0) > 3) HEAP[offset | 3] = s3;
16632 if ((length | 0) > 4) HEAP[offset | 4] = s4;
16633 if ((length | 0) > 5) HEAP[offset | 5] = s5;
16634 if ((length | 0) > 6) HEAP[offset | 6] = s6;
16635 if ((length | 0) > 7) HEAP[offset | 7] = s7;
16636 if ((length | 0) > 8) HEAP[offset | 8] = s8;
16637 if ((length | 0) > 9) HEAP[offset | 9] = s9;
16638 if ((length | 0) > 10) HEAP[offset | 10] = sA;
16639 if ((length | 0) > 11) HEAP[offset | 11] = sB;
16640 if ((length | 0) > 12) HEAP[offset | 12] = sC;
16641 if ((length | 0) > 13) HEAP[offset | 13] = sD;
16642 if ((length | 0) > 14) HEAP[offset | 14] = sE;
16643 _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);
16644 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16645 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16646 decrypted = decrypted + length | 0;
16647 offset = offset + length | 0;
16648 length = 0;
16649 counter1 = counter1 + 1 | 0;
16650 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16651 }
16652 return decrypted | 0;
16653 }
16654 function cfb_encrypt(offset, length) {
16655 offset = offset | 0;
16656 length = length | 0;
16657 var encrypted = 0;
16658 if (offset & 15) return -1;
16659 while ((length | 0) >= 16) {
16660 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16661 S0 = S0 ^ HEAP[offset];
16662 S1 = S1 ^ HEAP[offset | 1];
16663 S2 = S2 ^ HEAP[offset | 2];
16664 S3 = S3 ^ HEAP[offset | 3];
16665 S4 = S4 ^ HEAP[offset | 4];
16666 S5 = S5 ^ HEAP[offset | 5];
16667 S6 = S6 ^ HEAP[offset | 6];
16668 S7 = S7 ^ HEAP[offset | 7];
16669 S8 = S8 ^ HEAP[offset | 8];
16670 S9 = S9 ^ HEAP[offset | 9];
16671 SA = SA ^ HEAP[offset | 10];
16672 SB = SB ^ HEAP[offset | 11];
16673 SC = SC ^ HEAP[offset | 12];
16674 SD = SD ^ HEAP[offset | 13];
16675 SE = SE ^ HEAP[offset | 14];
16676 SF = SF ^ HEAP[offset | 15];
16677 HEAP[offset] = S0;
16678 HEAP[offset | 1] = S1;
16679 HEAP[offset | 2] = S2;
16680 HEAP[offset | 3] = S3;
16681 HEAP[offset | 4] = S4;
16682 HEAP[offset | 5] = S5;
16683 HEAP[offset | 6] = S6;
16684 HEAP[offset | 7] = S7;
16685 HEAP[offset | 8] = S8;
16686 HEAP[offset | 9] = S9;
16687 HEAP[offset | 10] = SA;
16688 HEAP[offset | 11] = SB;
16689 HEAP[offset | 12] = SC;
16690 HEAP[offset | 13] = SD;
16691 HEAP[offset | 14] = SE;
16692 HEAP[offset | 15] = SF;
16693 offset = offset + 16 | 0;
16694 length = length - 16 | 0;
16695 encrypted = encrypted + 16 | 0;
16696 }
16697 if ((length | 0) > 0) {
16698 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16699 HEAP[offset] = HEAP[offset] ^ S0;
16700 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16701 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16702 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16703 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16704 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16705 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16706 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16707 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16708 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16709 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16710 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16711 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16712 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16713 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16714 encrypted = encrypted + length | 0;
16715 offset = offset + length | 0;
16716 length = 0;
16717 }
16718 return encrypted | 0;
16719 }
16720 function cfb_decrypt(offset, length) {
16721 offset = offset | 0;
16722 length = length | 0;
16723 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;
16724 if (offset & 15) return -1;
16725 while ((length | 0) >= 16) {
16726 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16727 iv0 = HEAP[offset] | 0;
16728 iv1 = HEAP[offset | 1] | 0;
16729 iv2 = HEAP[offset | 2] | 0;
16730 iv3 = HEAP[offset | 3] | 0;
16731 iv4 = HEAP[offset | 4] | 0;
16732 iv5 = HEAP[offset | 5] | 0;
16733 iv6 = HEAP[offset | 6] | 0;
16734 iv7 = HEAP[offset | 7] | 0;
16735 iv8 = HEAP[offset | 8] | 0;
16736 iv9 = HEAP[offset | 9] | 0;
16737 ivA = HEAP[offset | 10] | 0;
16738 ivB = HEAP[offset | 11] | 0;
16739 ivC = HEAP[offset | 12] | 0;
16740 ivD = HEAP[offset | 13] | 0;
16741 ivE = HEAP[offset | 14] | 0;
16742 ivF = HEAP[offset | 15] | 0;
16743 HEAP[offset] = S0 ^ iv0;
16744 HEAP[offset | 1] = S1 ^ iv1;
16745 HEAP[offset | 2] = S2 ^ iv2;
16746 HEAP[offset | 3] = S3 ^ iv3;
16747 HEAP[offset | 4] = S4 ^ iv4;
16748 HEAP[offset | 5] = S5 ^ iv5;
16749 HEAP[offset | 6] = S6 ^ iv6;
16750 HEAP[offset | 7] = S7 ^ iv7;
16751 HEAP[offset | 8] = S8 ^ iv8;
16752 HEAP[offset | 9] = S9 ^ iv9;
16753 HEAP[offset | 10] = SA ^ ivA;
16754 HEAP[offset | 11] = SB ^ ivB;
16755 HEAP[offset | 12] = SC ^ ivC;
16756 HEAP[offset | 13] = SD ^ ivD;
16757 HEAP[offset | 14] = SE ^ ivE;
16758 HEAP[offset | 15] = SF ^ ivF;
16759 S0 = iv0;
16760 S1 = iv1;
16761 S2 = iv2;
16762 S3 = iv3;
16763 S4 = iv4;
16764 S5 = iv5;
16765 S6 = iv6;
16766 S7 = iv7;
16767 S8 = iv8;
16768 S9 = iv9;
16769 SA = ivA;
16770 SB = ivB;
16771 SC = ivC;
16772 SD = ivD;
16773 SE = ivE;
16774 SF = ivF;
16775 offset = offset + 16 | 0;
16776 length = length - 16 | 0;
16777 decrypted = decrypted + 16 | 0;
16778 }
16779 if ((length | 0) > 0) {
16780 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16781 HEAP[offset] = HEAP[offset] ^ S0;
16782 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16783 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16784 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16785 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16786 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16787 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16788 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16789 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16790 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16791 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16792 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16793 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16794 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16795 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16796 decrypted = decrypted + length | 0;
16797 offset = offset + length | 0;
16798 length = 0;
16799 }
16800 return decrypted | 0;
16801 }
16802 return {
16803 init_state: init_state,
16804 save_state: save_state,
16805 init_key_128: init_key_128,
16806 init_key_256: init_key_256,
16807 cbc_encrypt: cbc_encrypt,
16808 cbc_decrypt: cbc_decrypt,
16809 cbc_mac: cbc_mac,
16810 ccm_encrypt: ccm_encrypt,
16811 ccm_decrypt: ccm_decrypt,
16812 cfb_encrypt: cfb_encrypt,
16813 cfb_decrypt: cfb_decrypt
16814 };
16815 }
16816 function aes_asm(stdlib, foreign, buffer) {
16817 var heap = new Uint8Array(buffer);
16818 heap.set(_aes_tables);
16819 return _aes_asm(stdlib, foreign, buffer);
16820 }
16821 var _aes_block_size = 16;
16822 function _aes_constructor(options) {
16823 options = options || {};
16824 options.heapSize = options.heapSize || 4096;
16825 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
16826 this.BLOCK_SIZE = _aes_block_size;
16827 this.heap = options.heap || new Uint8Array(options.heapSize);
16828 this.asm = options.asm || aes_asm(global, null, this.heap.buffer);
16829 this.pos = _aes_heap_start;
16830 this.len = 0;
16831 this.key = null;
16832 this.result = null;
16833 this.reset(options);
16834 }
16835 function _aes_reset(options) {
16836 options = options || {};
16837 this.result = null;
16838 this.pos = _aes_heap_start;
16839 this.len = 0;
16840 var asm = this.asm;
16841 var key = options.key;
16842 if (key !== undefined) {
16843 if (is_buffer(key) || is_bytes(key)) {
16844 key = new Uint8Array(key);
16845 } else if (is_string(key)) {
16846 var str = key;
16847 key = new Uint8Array(str.length);
16848 for (var i = 0; i < str.length; ++i) key[i] = str.charCodeAt(i);
16849 } else {
16850 throw new TypeError("unexpected key type");
16851 }
16852 if (key.length === 16) {
16853 this.key = key;
16854 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]);
16855 } else if (key.length === 24) {
16856 throw new IllegalArgumentError("illegal key size");
16857 } else if (key.length === 32) {
16858 this.key = key;
16859 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]);
16860 } else {
16861 throw new IllegalArgumentError("illegal key size");
16862 }
16863 }
16864 return this;
16865 }
16866 function _aes_init_iv(iv) {
16867 var asm = this.asm;
16868 if (iv !== undefined) {
16869 if (is_buffer(iv) || is_bytes(iv)) {
16870 iv = new Uint8Array(iv);
16871 } else if (is_string(iv)) {
16872 var str = iv;
16873 iv = new Uint8Array(str.length);
16874 for (var i = 0; i < str.length; ++i) iv[i] = str.charCodeAt(i);
16875 } else {
16876 throw new TypeError("unexpected iv type");
16877 }
16878 if (iv.length !== _aes_block_size) throw new IllegalArgumentError("illegal iv size");
16879 this.iv = iv;
16880 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]);
16881 } else {
16882 this.iv = null;
16883 asm.init_state.call(asm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
16884 }
16885 }
16886 function _aes_heap_write(heap, hpos, data, dpos, dlen) {
16887 var hlen = heap.byteLength - hpos, wlen = hlen < dlen ? hlen : dlen;
16888 if (is_buffer(data) || is_bytes(data)) {
16889 heap.set(new Uint8Array(data.buffer || data, dpos, wlen), hpos);
16890 } else if (is_string(data)) {
16891 for (var i = 0; i < wlen; ++i) heap[hpos + i] = data.charCodeAt(dpos + i);
16892 } else {
16893 throw new TypeError("unexpected data type");
16894 }
16895 return wlen;
16896 }
16897 function cbc_aes_constructor(options) {
16898 this.padding = true;
16899 this.mode = "cbc";
16900 this.iv = null;
16901 _aes_constructor.call(this, options);
16902 }
16903 function cbc_aes_encrypt_constructor(options) {
16904 cbc_aes_constructor.call(this, options);
16905 }
16906 function cbc_aes_decrypt_constructor(options) {
16907 cbc_aes_constructor.call(this, options);
16908 }
16909 function cbc_aes_reset(options) {
16910 options = options || {};
16911 _aes_reset.call(this, options);
16912 var padding = options.padding;
16913 if (padding !== undefined) {
16914 this.padding = !!padding;
16915 } else {
16916 this.padding = true;
16917 }
16918 _aes_init_iv.call(this, options.iv);
16919 return this;
16920 }
16921 function cbc_aes_encrypt_process(data) {
16922 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16923 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;
16924 var result = new Uint8Array(rlen);
16925 while (dlen > 0) {
16926 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16927 len += wlen;
16928 dpos += wlen;
16929 dlen -= wlen;
16930 wlen = asm.cbc_encrypt(pos, len);
16931 result.set(heap.subarray(pos, pos + wlen), rpos);
16932 rpos += wlen;
16933 if (wlen < len) {
16934 pos += wlen;
16935 len -= wlen;
16936 } else {
16937 pos = _aes_heap_start;
16938 len = 0;
16939 }
16940 }
16941 this.result = result;
16942 this.pos = pos;
16943 this.len = len;
16944 return this;
16945 }
16946 function cbc_aes_encrypt_finish() {
16947 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16948 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);
16949 if (len % _aes_block_size === 0) {
16950 if (padding) rlen += _aes_block_size;
16951 } else if (!padding) {
16952 throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
16953 }
16954 var result = new Uint8Array(rlen);
16955 if (len < rlen) {
16956 var plen = _aes_block_size - len % _aes_block_size;
16957 for (var p = 0; p < plen; ++p) heap[pos + len + p] = plen;
16958 len += plen;
16959 }
16960 asm.cbc_encrypt(pos, len);
16961 result.set(heap.subarray(pos, pos + len));
16962 this.result = result;
16963 this.pos = _aes_heap_start;
16964 this.len = 0;
16965 return this;
16966 }
16967 function cbc_aes_encrypt(data) {
16968 var result1 = cbc_aes_encrypt_process.call(this, data).result, result2 = cbc_aes_encrypt_finish.call(this).result, result;
16969 result = new Uint8Array(result1.length + result2.length);
16970 result.set(result1);
16971 result.set(result2, result1.length);
16972 this.result = result;
16973 return this;
16974 }
16975 function cbc_aes_decrypt_process(data) {
16976 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16977 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;
16978 var result = new Uint8Array(rlen);
16979 while (dlen > 0) {
16980 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16981 len += wlen;
16982 dpos += wlen;
16983 dlen -= wlen;
16984 wlen = asm.cbc_decrypt(pos, len - (padding && dlen === 0 && len % _aes_block_size === 0 ? _aes_block_size : 0));
16985 result.set(heap.subarray(pos, pos + wlen), rpos);
16986 rpos += wlen;
16987 if (wlen < len) {
16988 pos += wlen;
16989 len -= wlen;
16990 } else {
16991 pos = _aes_heap_start;
16992 len = 0;
16993 }
16994 }
16995 this.result = result.subarray(0, rpos);
16996 this.pos = pos;
16997 this.len = len;
16998 return this;
16999 }
17000 function cbc_aes_decrypt_finish() {
17001 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17002 var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len;
17003 if (len === 0) {
17004 if (!padding) {
17005 this.result = new Uint8Array(0);
17006 this.pos = _aes_heap_start;
17007 this.len = 0;
17008 return this;
17009 } else {
17010 throw new IllegalStateError("padding not found");
17011 }
17012 }
17013 if (len % _aes_block_size !== 0) throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
17014 var result = new Uint8Array(len);
17015 asm.cbc_decrypt(pos, len);
17016 result.set(heap.subarray(pos, pos + len));
17017 if (padding) {
17018 var pad = result[len - 1];
17019 result = result.subarray(0, len - pad);
17020 }
17021 this.result = result;
17022 this.pos = _aes_heap_start;
17023 this.len = 0;
17024 return this;
17025 }
17026 function cbc_aes_decrypt(data) {
17027 var result1 = cbc_aes_decrypt_process.call(this, data).result, result2 = cbc_aes_decrypt_finish.call(this).result, result;
17028 result = new Uint8Array(result1.length + result2.length);
17029 result.set(result1);
17030 result.set(result2, result1.length);
17031 this.result = result;
17032 return this;
17033 }
17034 var cbc_aes_encrypt_prototype = cbc_aes_encrypt_constructor.prototype;
17035 cbc_aes_encrypt_prototype.reset = cbc_aes_reset;
17036 cbc_aes_encrypt_prototype.process = cbc_aes_encrypt_process;
17037 cbc_aes_encrypt_prototype.finish = cbc_aes_encrypt_finish;
17038 var cbc_aes_decrypt_prototype = cbc_aes_decrypt_constructor.prototype;
17039 cbc_aes_decrypt_prototype.reset = cbc_aes_reset;
17040 cbc_aes_decrypt_prototype.process = cbc_aes_decrypt_process;
17041 cbc_aes_decrypt_prototype.finish = cbc_aes_decrypt_finish;
17042 var cbc_aes_prototype = cbc_aes_constructor.prototype;
17043 cbc_aes_prototype.reset = cbc_aes_reset;
17044 cbc_aes_prototype.encrypt = cbc_aes_encrypt;
17045 cbc_aes_prototype.decrypt = cbc_aes_decrypt;
17046 function _cbc_mac_process(data) {
17047 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, wlen = 0;
17048 while (dlen > 0) {
17049 wlen = _aes_heap_write(this.heap, _aes_heap_start, data, dpos, dlen);
17050 this.asm.cbc_mac(_aes_heap_start, wlen, -1);
17051 dpos += wlen;
17052 dlen -= wlen;
17053 }
17054 }
17055 var _ccm_adata_maxLength = 65279, _ccm_data_maxLength = 68719476720;
17056 function ccm_aes_constructor(options) {
17057 this.padding = false;
17058 this.mode = "ccm";
17059 this.tagSize = _aes_block_size;
17060 this.lengthSize = 4;
17061 this.nonce = null;
17062 this.adata = null;
17063 this.iv = null;
17064 this.dataLength = -1;
17065 this.dataLeft = -1;
17066 this.counter = 1;
17067 _aes_constructor.call(this, options);
17068 }
17069 function ccm_aes_encrypt_constructor(options) {
17070 ccm_aes_constructor.call(this, options);
17071 }
17072 function ccm_aes_decrypt_constructor(options) {
17073 ccm_aes_constructor.call(this, options);
17074 }
17075 function _ccm_calculate_iv() {
17076 var nonce = this.nonce, adata = this.adata, tagSize = this.tagSize, lengthSize = this.lengthSize, dataLength = this.dataLength;
17077 var data = new Uint8Array(_aes_block_size + (adata ? 2 + adata.byteLength : 0));
17078 data[0] = (adata ? 64 : 0) | tagSize - 2 << 2 | lengthSize - 1;
17079 data.set(nonce, 1);
17080 if (lengthSize > 4) data[11] = (dataLength - (dataLength >>> 0)) / 4294967296 & 15;
17081 if (lengthSize > 3) data[12] = dataLength >>> 24;
17082 if (lengthSize > 2) data[13] = dataLength >>> 16 & 255;
17083 data[14] = dataLength >>> 8 & 255;
17084 data[15] = dataLength & 255;
17085 if (adata) {
17086 data[16] = adata.byteLength >>> 8 & 255;
17087 data[17] = adata.byteLength & 255;
17088 data.set(adata, 18);
17089 }
17090 _cbc_mac_process.call(this, data);
17091 this.asm.save_state(_aes_heap_start);
17092 this.iv = new Uint8Array(this.heap.subarray(_aes_heap_start, _aes_heap_start + _aes_block_size));
17093 }
17094 function ccm_aes_reset(options) {
17095 options = options || {};
17096 _aes_reset.call(this, options);
17097 _aes_init_iv.call(this, options.iv);
17098 var tagSize = options.tagSize;
17099 if (tagSize !== undefined) {
17100 if (!is_number(tagSize)) throw new TypeError("tagSize must be a number");
17101 if (tagSize < 4 || tagSize > 16 || tagSize & 1) throw new IllegalArgumentError("illegal tagSize value");
17102 this.tagSize = tagSize;
17103 } else {
17104 this.tagSize = _aes_block_size;
17105 }
17106 var lengthSize = options.lengthSize, nonce = options.nonce;
17107 if (nonce !== undefined) {
17108 if (is_buffer(nonce) || is_bytes(nonce)) {
17109 nonce = new Uint8Array(nonce);
17110 } else if (is_string(nonce)) {
17111 var str = nonce;
17112 nonce = new Uint8Array(str.length);
17113 for (var i = 0; i < str.length; ++i) nonce[i] = str.charCodeAt(i);
17114 } else {
17115 throw new TypeError("unexpected nonce type");
17116 }
17117 if (nonce.length < 10 || nonce.length > 13) throw new IllegalArgumentError("illegal nonce length");
17118 lengthSize = lengthSize || 15 - nonce.length;
17119 this.nonce = nonce;
17120 } else {
17121 this.nonce = null;
17122 }
17123 if (lengthSize !== undefined) {
17124 if (!is_number(lengthSize)) throw new TypeError("lengthSize must be a number");
17125 if (lengthSize < 2 || lengthSize > 5 || nonce.length + lengthSize !== 15) throw new IllegalArgumentError("illegal lengthSize value");
17126 this.lengthSize = lengthSize;
17127 } else {
17128 this.lengthSize = lengthSize = 4;
17129 }
17130 var iv = this.iv;
17131 var counter = options.counter;
17132 if (counter !== undefined) {
17133 if (iv === null) throw new IllegalStateError("iv is also required");
17134 if (!is_number(counter)) throw new TypeError("counter must be a number");
17135 this.counter = counter;
17136 } else {
17137 this.counter = 1;
17138 }
17139 var dataLength = options.dataLength;
17140 if (dataLength !== undefined) {
17141 if (!is_number(dataLength)) throw new TypeError("dataLength must be a number");
17142 if (dataLength < 0 || dataLength > _ccm_data_maxLength || dataLength > Math.pow(2, 8 * lengthSize) - 1) throw new IllegalArgumentError("illegal dataLength value");
17143 this.dataLength = dataLength;
17144 var dataLeft = options.dataLeft || dataLength;
17145 if (!is_number(dataLeft)) throw new TypeError("dataLeft must be a number");
17146 if (dataLeft < 0 || dataLeft > dataLength) throw new IllegalArgumentError("illegal dataLeft value");
17147 this.dataLeft = dataLeft;
17148 } else {
17149 this.dataLength = dataLength = -1;
17150 this.dataLeft = dataLength;
17151 }
17152 var adata = options.adata;
17153 if (adata !== undefined) {
17154 if (iv !== null) throw new IllegalStateError("you must specify either adata or iv, not both");
17155 if (is_buffer(adata) || is_bytes(adata)) {
17156 adata = new Uint8Array(adata);
17157 } else if (is_string(adata)) {
17158 var str = adata;
17159 adata = new Uint8Array(str.length);
17160 for (var i = 0; i < str.length; ++i) adata[i] = str.charCodeAt(i);
17161 } else {
17162 throw new TypeError("unexpected adata type");
17163 }
17164 if (adata.byteLength === 0 || adata.byteLength > _ccm_adata_maxLength) throw new IllegalArgumentError("illegal adata length");
17165 this.adata = adata;
17166 this.counter = 1;
17167 } else {
17168 this.adata = adata = null;
17169 }
17170 if (dataLength !== -1) _ccm_calculate_iv.call(this);
17171 return this;
17172 }
17173 function ccm_aes_encrypt_process(data) {
17174 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17175 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;
17176 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17177 var result = new Uint8Array(rlen);
17178 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17179 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17180 while (dlen > 0) {
17181 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17182 len += wlen;
17183 dpos += wlen;
17184 dlen -= wlen;
17185 asm_args[0] = pos;
17186 asm_args[1] = len & ~15;
17187 asm_args[16] = counter / 4294967296 >>> 0;
17188 asm_args[17] = counter >>> 0;
17189 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17190 result.set(heap.subarray(pos, pos + wlen), rpos);
17191 counter += wlen >>> 4;
17192 rpos += wlen;
17193 if (wlen < len) {
17194 pos += wlen;
17195 len -= wlen;
17196 } else {
17197 pos = _aes_heap_start;
17198 len = 0;
17199 }
17200 }
17201 this.result = result;
17202 this.counter = counter;
17203 this.pos = pos;
17204 this.len = len;
17205 return this;
17206 }
17207 function ccm_aes_encrypt_finish() {
17208 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17209 var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, wlen = 0;
17210 var result = new Uint8Array(len + tagSize);
17211 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17212 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17213 asm_args[0] = pos;
17214 asm_args[1] = len;
17215 asm_args[16] = counter / 4294967296 >>> 0;
17216 asm_args[17] = counter >>> 0;
17217 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17218 result.set(heap.subarray(pos, pos + wlen));
17219 counter = 1;
17220 pos = _aes_heap_start;
17221 len = 0;
17222 asm.save_state(_aes_heap_start);
17223 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17224 asm_args[17] = 0;
17225 asm.ccm_encrypt.apply(asm, asm_args);
17226 result.set(heap.subarray(_aes_heap_start, _aes_heap_start + tagSize), wlen);
17227 this.result = result;
17228 this.counter = counter;
17229 this.pos = pos;
17230 this.len = len;
17231 return this;
17232 }
17233 function ccm_aes_encrypt(data) {
17234 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17235 var result1 = ccm_aes_encrypt_process.call(this, data).result, result2 = ccm_aes_encrypt_finish.call(this).result, result;
17236 result = new Uint8Array(result1.length + result2.length);
17237 result.set(result1);
17238 result.set(result2, result1.length);
17239 this.result = result;
17240 return this;
17241 }
17242 function ccm_aes_decrypt_process(data) {
17243 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17244 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;
17245 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17246 var result = new Uint8Array(rlen);
17247 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17248 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17249 while (dlen > 0) {
17250 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17251 len += wlen;
17252 dpos += wlen;
17253 dlen -= wlen;
17254 asm_args[0] = pos;
17255 asm_args[1] = len + dlen - tagSize >= _aes_block_size ? dlen >= tagSize ? len & ~15 : len + dlen - tagSize & ~15 : 0;
17256 asm_args[16] = counter / 4294967296 >>> 0;
17257 asm_args[17] = counter >>> 0;
17258 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17259 result.set(heap.subarray(pos, pos + wlen), rpos);
17260 counter += wlen >>> 4;
17261 rpos += wlen;
17262 if (wlen < len) {
17263 pos += wlen;
17264 len -= wlen;
17265 } else {
17266 pos = _aes_heap_start;
17267 len = 0;
17268 }
17269 }
17270 this.result = result.subarray(0, rpos);
17271 this.counter = counter;
17272 this.pos = pos;
17273 this.len = len;
17274 return this;
17275 }
17276 function ccm_aes_decrypt_finish() {
17277 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17278 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;
17279 if (len < tagSize) throw new IllegalStateError("authentication tag not found");
17280 var result = new Uint8Array(rlen), atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));
17281 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17282 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17283 asm_args[0] = pos;
17284 asm_args[1] = rlen;
17285 asm_args[16] = counter / 4294967296 >>> 0;
17286 asm_args[17] = counter >>> 0;
17287 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17288 result.set(heap.subarray(pos, pos + wlen));
17289 counter = 1;
17290 pos = _aes_heap_start;
17291 len = 0;
17292 asm.save_state(_aes_heap_start);
17293 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17294 asm_args[17] = 0;
17295 asm.ccm_encrypt.apply(asm, asm_args);
17296 var acheck = 0;
17297 for (var i = 0; i < tagSize; ++i) acheck |= atag[i] ^ heap[_aes_heap_start + i];
17298 if (acheck) throw new SecurityError("data integrity check failed");
17299 this.result = result;
17300 this.counter = counter;
17301 this.pos = pos;
17302 this.len = len;
17303 return this;
17304 }
17305 function ccm_aes_decrypt(data) {
17306 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17307 var result1 = ccm_aes_decrypt_process.call(this, data).result, result2 = ccm_aes_decrypt_finish.call(this).result, result;
17308 result = new Uint8Array(result1.length + result2.length);
17309 result.set(result1);
17310 result.set(result2, result1.length);
17311 this.result = result;
17312 return this;
17313 }
17314 var ccm_aes_prototype = ccm_aes_constructor.prototype;
17315 ccm_aes_prototype.reset = ccm_aes_reset;
17316 ccm_aes_prototype.encrypt = ccm_aes_encrypt;
17317 ccm_aes_prototype.decrypt = ccm_aes_decrypt;
17318 var ccm_aes_encrypt_prototype = ccm_aes_encrypt_constructor.prototype;
17319 ccm_aes_encrypt_prototype.reset = ccm_aes_reset;
17320 ccm_aes_encrypt_prototype.process = ccm_aes_encrypt_process;
17321 ccm_aes_encrypt_prototype.finish = ccm_aes_encrypt_finish;
17322 var ccm_aes_decrypt_prototype = ccm_aes_decrypt_constructor.prototype;
17323 ccm_aes_decrypt_prototype.reset = ccm_aes_reset;
17324 ccm_aes_decrypt_prototype.process = ccm_aes_decrypt_process;
17325 ccm_aes_decrypt_prototype.finish = ccm_aes_decrypt_finish;
17326 function cfb_aes_constructor(options) {
17327 this.padding = false;
17328 this.mode = "cfb";
17329 this.iv = null;
17330 _aes_constructor.call(this, options);
17331 }
17332 function cfb_aes_encrypt_constructor(options) {
17333 cfb_aes_constructor.call(this, options);
17334 }
17335 function cfb_aes_decrypt_constructor(options) {
17336 cfb_aes_constructor.call(this, options);
17337 }
17338 function cfb_aes_reset(options) {
17339 options = options || {};
17340 _aes_reset.call(this, options);
17341 _aes_init_iv.call(this, options.iv);
17342 return this;
17343 }
17344 function cfb_aes_encrypt_process(data) {
17345 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17346 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;
17347 var result = new Uint8Array(rlen);
17348 while (dlen > 0) {
17349 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17350 len += wlen;
17351 dpos += wlen;
17352 dlen -= wlen;
17353 wlen = asm.cfb_encrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17354 result.set(heap.subarray(pos, pos + wlen), rpos);
17355 rpos += wlen;
17356 if (wlen < len) {
17357 pos += wlen;
17358 len -= wlen;
17359 } else {
17360 pos = _aes_heap_start;
17361 len = 0;
17362 }
17363 }
17364 this.result = result;
17365 this.pos = pos;
17366 this.len = len;
17367 return this;
17368 }
17369 function cfb_aes_encrypt_finish() {
17370 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17371 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17372 var result = new Uint8Array(len);
17373 asm.cfb_encrypt(pos, len);
17374 result.set(heap.subarray(pos, pos + len));
17375 this.result = result;
17376 this.pos = _aes_heap_start;
17377 this.len = 0;
17378 return this;
17379 }
17380 function cfb_aes_encrypt(data) {
17381 var result1 = cfb_aes_encrypt_process.call(this, data).result, result2 = cfb_aes_encrypt_finish.call(this).result, result;
17382 result = new Uint8Array(result1.length + result2.length);
17383 result.set(result1);
17384 result.set(result2, result1.length);
17385 this.result = result;
17386 return this;
17387 }
17388 function cfb_aes_decrypt_process(data) {
17389 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17390 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;
17391 var result = new Uint8Array(rlen);
17392 while (dlen > 0) {
17393 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17394 len += wlen;
17395 dpos += wlen;
17396 dlen -= wlen;
17397 wlen = asm.cfb_decrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17398 result.set(heap.subarray(pos, pos + wlen), rpos);
17399 rpos += wlen;
17400 if (wlen < len) {
17401 pos += wlen;
17402 len -= wlen;
17403 } else {
17404 pos = _aes_heap_start;
17405 len = 0;
17406 }
17407 }
17408 this.result = result.subarray(0, rpos);
17409 this.pos = pos;
17410 this.len = len;
17411 return this;
17412 }
17413 function cfb_aes_decrypt_finish() {
17414 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17415 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17416 if (len === 0) {
17417 this.result = new Uint8Array(0);
17418 this.pos = _aes_heap_start;
17419 this.len = 0;
17420 return this;
17421 }
17422 var result = new Uint8Array(len);
17423 asm.cfb_decrypt(pos, len);
17424 result.set(heap.subarray(pos, pos + len));
17425 this.result = result;
17426 this.pos = _aes_heap_start;
17427 this.len = 0;
17428 return this;
17429 }
17430 function cfb_aes_decrypt(data) {
17431 var result1 = cfb_aes_decrypt_process.call(this, data).result, result2 = cfb_aes_decrypt_finish.call(this).result, result;
17432 result = new Uint8Array(result1.length + result2.length);
17433 result.set(result1);
17434 result.set(result2, result1.length);
17435 this.result = result;
17436 return this;
17437 }
17438 var cfb_aes_encrypt_prototype = cfb_aes_encrypt_constructor.prototype;
17439 cfb_aes_encrypt_prototype.reset = cfb_aes_reset;
17440 cfb_aes_encrypt_prototype.process = cfb_aes_encrypt_process;
17441 cfb_aes_encrypt_prototype.finish = cfb_aes_encrypt_finish;
17442 var cfb_aes_decrypt_prototype = cfb_aes_decrypt_constructor.prototype;
17443 cfb_aes_decrypt_prototype.reset = cfb_aes_reset;
17444 cfb_aes_decrypt_prototype.process = cfb_aes_decrypt_process;
17445 cfb_aes_decrypt_prototype.finish = cfb_aes_decrypt_finish;
17446 var cfb_aes_prototype = cfb_aes_constructor.prototype;
17447 cfb_aes_prototype.reset = cfb_aes_reset;
17448 cfb_aes_prototype.encrypt = cfb_aes_encrypt;
17449 cfb_aes_prototype.decrypt = cfb_aes_decrypt;
17450 function sha256_asm(stdlib, foreign, buffer) {
17451 // Closure Compiler warning - commented out
17452 //"use asm";
17453 var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0, TOTAL = 0;
17454 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;
17455 var HEAP = new stdlib.Uint8Array(buffer);
17456 function _core(w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15) {
17457 w0 = w0 | 0;
17458 w1 = w1 | 0;
17459 w2 = w2 | 0;
17460 w3 = w3 | 0;
17461 w4 = w4 | 0;
17462 w5 = w5 | 0;
17463 w6 = w6 | 0;
17464 w7 = w7 | 0;
17465 w8 = w8 | 0;
17466 w9 = w9 | 0;
17467 w10 = w10 | 0;
17468 w11 = w11 | 0;
17469 w12 = w12 | 0;
17470 w13 = w13 | 0;
17471 w14 = w14 | 0;
17472 w15 = w15 | 0;
17473 var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, t = 0;
17474 a = H0;
17475 b = H1;
17476 c = H2;
17477 d = H3;
17478 e = H4;
17479 f = H5;
17480 g = H6;
17481 h = H7;
17482 t = w0 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1116352408 | 0;
17483 h = g;
17484 g = f;
17485 f = e;
17486 e = d + t | 0;
17487 d = c;
17488 c = b;
17489 b = a;
17490 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17491 t = w1 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1899447441 | 0;
17492 h = g;
17493 g = f;
17494 f = e;
17495 e = d + t | 0;
17496 d = c;
17497 c = b;
17498 b = a;
17499 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17500 t = w2 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3049323471 | 0;
17501 h = g;
17502 g = f;
17503 f = e;
17504 e = d + t | 0;
17505 d = c;
17506 c = b;
17507 b = a;
17508 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17509 t = w3 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3921009573 | 0;
17510 h = g;
17511 g = f;
17512 f = e;
17513 e = d + t | 0;
17514 d = c;
17515 c = b;
17516 b = a;
17517 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17518 t = w4 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 961987163 | 0;
17519 h = g;
17520 g = f;
17521 f = e;
17522 e = d + t | 0;
17523 d = c;
17524 c = b;
17525 b = a;
17526 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17527 t = w5 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1508970993 | 0;
17528 h = g;
17529 g = f;
17530 f = e;
17531 e = d + t | 0;
17532 d = c;
17533 c = b;
17534 b = a;
17535 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17536 t = w6 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2453635748 | 0;
17537 h = g;
17538 g = f;
17539 f = e;
17540 e = d + t | 0;
17541 d = c;
17542 c = b;
17543 b = a;
17544 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17545 t = w7 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2870763221 | 0;
17546 h = g;
17547 g = f;
17548 f = e;
17549 e = d + t | 0;
17550 d = c;
17551 c = b;
17552 b = a;
17553 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17554 t = w8 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3624381080 | 0;
17555 h = g;
17556 g = f;
17557 f = e;
17558 e = d + t | 0;
17559 d = c;
17560 c = b;
17561 b = a;
17562 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17563 t = w9 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 310598401 | 0;
17564 h = g;
17565 g = f;
17566 f = e;
17567 e = d + t | 0;
17568 d = c;
17569 c = b;
17570 b = a;
17571 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17572 t = w10 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 607225278 | 0;
17573 h = g;
17574 g = f;
17575 f = e;
17576 e = d + t | 0;
17577 d = c;
17578 c = b;
17579 b = a;
17580 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17581 t = w11 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1426881987 | 0;
17582 h = g;
17583 g = f;
17584 f = e;
17585 e = d + t | 0;
17586 d = c;
17587 c = b;
17588 b = a;
17589 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17590 t = w12 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1925078388 | 0;
17591 h = g;
17592 g = f;
17593 f = e;
17594 e = d + t | 0;
17595 d = c;
17596 c = b;
17597 b = a;
17598 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17599 t = w13 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2162078206 | 0;
17600 h = g;
17601 g = f;
17602 f = e;
17603 e = d + t | 0;
17604 d = c;
17605 c = b;
17606 b = a;
17607 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17608 t = w14 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2614888103 | 0;
17609 h = g;
17610 g = f;
17611 f = e;
17612 e = d + t | 0;
17613 d = c;
17614 c = b;
17615 b = a;
17616 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17617 t = w15 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3248222580 | 0;
17618 h = g;
17619 g = f;
17620 f = e;
17621 e = d + t | 0;
17622 d = c;
17623 c = b;
17624 b = a;
17625 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17626 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;
17627 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3835390401 | 0;
17628 h = g;
17629 g = f;
17630 f = e;
17631 e = d + t | 0;
17632 d = c;
17633 c = b;
17634 b = a;
17635 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17636 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;
17637 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4022224774 | 0;
17638 h = g;
17639 g = f;
17640 f = e;
17641 e = d + t | 0;
17642 d = c;
17643 c = b;
17644 b = a;
17645 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17646 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;
17647 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 264347078 | 0;
17648 h = g;
17649 g = f;
17650 f = e;
17651 e = d + t | 0;
17652 d = c;
17653 c = b;
17654 b = a;
17655 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17656 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;
17657 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 604807628 | 0;
17658 h = g;
17659 g = f;
17660 f = e;
17661 e = d + t | 0;
17662 d = c;
17663 c = b;
17664 b = a;
17665 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17666 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;
17667 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 770255983 | 0;
17668 h = g;
17669 g = f;
17670 f = e;
17671 e = d + t | 0;
17672 d = c;
17673 c = b;
17674 b = a;
17675 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17676 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;
17677 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1249150122 | 0;
17678 h = g;
17679 g = f;
17680 f = e;
17681 e = d + t | 0;
17682 d = c;
17683 c = b;
17684 b = a;
17685 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17686 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;
17687 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1555081692 | 0;
17688 h = g;
17689 g = f;
17690 f = e;
17691 e = d + t | 0;
17692 d = c;
17693 c = b;
17694 b = a;
17695 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17696 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;
17697 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1996064986 | 0;
17698 h = g;
17699 g = f;
17700 f = e;
17701 e = d + t | 0;
17702 d = c;
17703 c = b;
17704 b = a;
17705 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17706 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;
17707 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2554220882 | 0;
17708 h = g;
17709 g = f;
17710 f = e;
17711 e = d + t | 0;
17712 d = c;
17713 c = b;
17714 b = a;
17715 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17716 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;
17717 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2821834349 | 0;
17718 h = g;
17719 g = f;
17720 f = e;
17721 e = d + t | 0;
17722 d = c;
17723 c = b;
17724 b = a;
17725 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17726 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;
17727 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2952996808 | 0;
17728 h = g;
17729 g = f;
17730 f = e;
17731 e = d + t | 0;
17732 d = c;
17733 c = b;
17734 b = a;
17735 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17736 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;
17737 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3210313671 | 0;
17738 h = g;
17739 g = f;
17740 f = e;
17741 e = d + t | 0;
17742 d = c;
17743 c = b;
17744 b = a;
17745 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17746 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;
17747 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3336571891 | 0;
17748 h = g;
17749 g = f;
17750 f = e;
17751 e = d + t | 0;
17752 d = c;
17753 c = b;
17754 b = a;
17755 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17756 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;
17757 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3584528711 | 0;
17758 h = g;
17759 g = f;
17760 f = e;
17761 e = d + t | 0;
17762 d = c;
17763 c = b;
17764 b = a;
17765 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17766 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;
17767 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 113926993 | 0;
17768 h = g;
17769 g = f;
17770 f = e;
17771 e = d + t | 0;
17772 d = c;
17773 c = b;
17774 b = a;
17775 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17776 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;
17777 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 338241895 | 0;
17778 h = g;
17779 g = f;
17780 f = e;
17781 e = d + t | 0;
17782 d = c;
17783 c = b;
17784 b = a;
17785 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17786 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;
17787 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 666307205 | 0;
17788 h = g;
17789 g = f;
17790 f = e;
17791 e = d + t | 0;
17792 d = c;
17793 c = b;
17794 b = a;
17795 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17796 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;
17797 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 773529912 | 0;
17798 h = g;
17799 g = f;
17800 f = e;
17801 e = d + t | 0;
17802 d = c;
17803 c = b;
17804 b = a;
17805 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17806 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;
17807 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1294757372 | 0;
17808 h = g;
17809 g = f;
17810 f = e;
17811 e = d + t | 0;
17812 d = c;
17813 c = b;
17814 b = a;
17815 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17816 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;
17817 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1396182291 | 0;
17818 h = g;
17819 g = f;
17820 f = e;
17821 e = d + t | 0;
17822 d = c;
17823 c = b;
17824 b = a;
17825 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17826 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;
17827 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1695183700 | 0;
17828 h = g;
17829 g = f;
17830 f = e;
17831 e = d + t | 0;
17832 d = c;
17833 c = b;
17834 b = a;
17835 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17836 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;
17837 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1986661051 | 0;
17838 h = g;
17839 g = f;
17840 f = e;
17841 e = d + t | 0;
17842 d = c;
17843 c = b;
17844 b = a;
17845 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17846 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;
17847 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2177026350 | 0;
17848 h = g;
17849 g = f;
17850 f = e;
17851 e = d + t | 0;
17852 d = c;
17853 c = b;
17854 b = a;
17855 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17856 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;
17857 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2456956037 | 0;
17858 h = g;
17859 g = f;
17860 f = e;
17861 e = d + t | 0;
17862 d = c;
17863 c = b;
17864 b = a;
17865 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17866 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;
17867 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2730485921 | 0;
17868 h = g;
17869 g = f;
17870 f = e;
17871 e = d + t | 0;
17872 d = c;
17873 c = b;
17874 b = a;
17875 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17876 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;
17877 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2820302411 | 0;
17878 h = g;
17879 g = f;
17880 f = e;
17881 e = d + t | 0;
17882 d = c;
17883 c = b;
17884 b = a;
17885 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17886 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;
17887 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3259730800 | 0;
17888 h = g;
17889 g = f;
17890 f = e;
17891 e = d + t | 0;
17892 d = c;
17893 c = b;
17894 b = a;
17895 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17896 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;
17897 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3345764771 | 0;
17898 h = g;
17899 g = f;
17900 f = e;
17901 e = d + t | 0;
17902 d = c;
17903 c = b;
17904 b = a;
17905 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17906 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;
17907 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3516065817 | 0;
17908 h = g;
17909 g = f;
17910 f = e;
17911 e = d + t | 0;
17912 d = c;
17913 c = b;
17914 b = a;
17915 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17916 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;
17917 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3600352804 | 0;
17918 h = g;
17919 g = f;
17920 f = e;
17921 e = d + t | 0;
17922 d = c;
17923 c = b;
17924 b = a;
17925 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17926 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;
17927 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4094571909 | 0;
17928 h = g;
17929 g = f;
17930 f = e;
17931 e = d + t | 0;
17932 d = c;
17933 c = b;
17934 b = a;
17935 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17936 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;
17937 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 275423344 | 0;
17938 h = g;
17939 g = f;
17940 f = e;
17941 e = d + t | 0;
17942 d = c;
17943 c = b;
17944 b = a;
17945 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17946 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;
17947 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 430227734 | 0;
17948 h = g;
17949 g = f;
17950 f = e;
17951 e = d + t | 0;
17952 d = c;
17953 c = b;
17954 b = a;
17955 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17956 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;
17957 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 506948616 | 0;
17958 h = g;
17959 g = f;
17960 f = e;
17961 e = d + t | 0;
17962 d = c;
17963 c = b;
17964 b = a;
17965 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17966 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;
17967 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 659060556 | 0;
17968 h = g;
17969 g = f;
17970 f = e;
17971 e = d + t | 0;
17972 d = c;
17973 c = b;
17974 b = a;
17975 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17976 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;
17977 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 883997877 | 0;
17978 h = g;
17979 g = f;
17980 f = e;
17981 e = d + t | 0;
17982 d = c;
17983 c = b;
17984 b = a;
17985 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17986 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;
17987 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 958139571 | 0;
17988 h = g;
17989 g = f;
17990 f = e;
17991 e = d + t | 0;
17992 d = c;
17993 c = b;
17994 b = a;
17995 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17996 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;
17997 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1322822218 | 0;
17998 h = g;
17999 g = f;
18000 f = e;
18001 e = d + t | 0;
18002 d = c;
18003 c = b;
18004 b = a;
18005 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18006 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;
18007 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1537002063 | 0;
18008 h = g;
18009 g = f;
18010 f = e;
18011 e = d + t | 0;
18012 d = c;
18013 c = b;
18014 b = a;
18015 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18016 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;
18017 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1747873779 | 0;
18018 h = g;
18019 g = f;
18020 f = e;
18021 e = d + t | 0;
18022 d = c;
18023 c = b;
18024 b = a;
18025 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18026 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;
18027 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1955562222 | 0;
18028 h = g;
18029 g = f;
18030 f = e;
18031 e = d + t | 0;
18032 d = c;
18033 c = b;
18034 b = a;
18035 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18036 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;
18037 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2024104815 | 0;
18038 h = g;
18039 g = f;
18040 f = e;
18041 e = d + t | 0;
18042 d = c;
18043 c = b;
18044 b = a;
18045 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18046 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;
18047 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2227730452 | 0;
18048 h = g;
18049 g = f;
18050 f = e;
18051 e = d + t | 0;
18052 d = c;
18053 c = b;
18054 b = a;
18055 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18056 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;
18057 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2361852424 | 0;
18058 h = g;
18059 g = f;
18060 f = e;
18061 e = d + t | 0;
18062 d = c;
18063 c = b;
18064 b = a;
18065 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18066 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;
18067 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2428436474 | 0;
18068 h = g;
18069 g = f;
18070 f = e;
18071 e = d + t | 0;
18072 d = c;
18073 c = b;
18074 b = a;
18075 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18076 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;
18077 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2756734187 | 0;
18078 h = g;
18079 g = f;
18080 f = e;
18081 e = d + t | 0;
18082 d = c;
18083 c = b;
18084 b = a;
18085 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18086 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;
18087 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3204031479 | 0;
18088 h = g;
18089 g = f;
18090 f = e;
18091 e = d + t | 0;
18092 d = c;
18093 c = b;
18094 b = a;
18095 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18096 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;
18097 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3329325298 | 0;
18098 h = g;
18099 g = f;
18100 f = e;
18101 e = d + t | 0;
18102 d = c;
18103 c = b;
18104 b = a;
18105 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18106 H0 = H0 + a | 0;
18107 H1 = H1 + b | 0;
18108 H2 = H2 + c | 0;
18109 H3 = H3 + d | 0;
18110 H4 = H4 + e | 0;
18111 H5 = H5 + f | 0;
18112 H6 = H6 + g | 0;
18113 H7 = H7 + h | 0;
18114 }
18115 function _core_heap(offset) {
18116 offset = offset | 0;
18117 _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]);
18118 }
18119 function _state_to_heap(output) {
18120 output = output | 0;
18121 HEAP[output | 0] = H0 >>> 24;
18122 HEAP[output | 1] = H0 >>> 16 & 255;
18123 HEAP[output | 2] = H0 >>> 8 & 255;
18124 HEAP[output | 3] = H0 & 255;
18125 HEAP[output | 4] = H1 >>> 24;
18126 HEAP[output | 5] = H1 >>> 16 & 255;
18127 HEAP[output | 6] = H1 >>> 8 & 255;
18128 HEAP[output | 7] = H1 & 255;
18129 HEAP[output | 8] = H2 >>> 24;
18130 HEAP[output | 9] = H2 >>> 16 & 255;
18131 HEAP[output | 10] = H2 >>> 8 & 255;
18132 HEAP[output | 11] = H2 & 255;
18133 HEAP[output | 12] = H3 >>> 24;
18134 HEAP[output | 13] = H3 >>> 16 & 255;
18135 HEAP[output | 14] = H3 >>> 8 & 255;
18136 HEAP[output | 15] = H3 & 255;
18137 HEAP[output | 16] = H4 >>> 24;
18138 HEAP[output | 17] = H4 >>> 16 & 255;
18139 HEAP[output | 18] = H4 >>> 8 & 255;
18140 HEAP[output | 19] = H4 & 255;
18141 HEAP[output | 20] = H5 >>> 24;
18142 HEAP[output | 21] = H5 >>> 16 & 255;
18143 HEAP[output | 22] = H5 >>> 8 & 255;
18144 HEAP[output | 23] = H5 & 255;
18145 HEAP[output | 24] = H6 >>> 24;
18146 HEAP[output | 25] = H6 >>> 16 & 255;
18147 HEAP[output | 26] = H6 >>> 8 & 255;
18148 HEAP[output | 27] = H6 & 255;
18149 HEAP[output | 28] = H7 >>> 24;
18150 HEAP[output | 29] = H7 >>> 16 & 255;
18151 HEAP[output | 30] = H7 >>> 8 & 255;
18152 HEAP[output | 31] = H7 & 255;
18153 }
18154 function reset() {
18155 H0 = 1779033703;
18156 H1 = 3144134277;
18157 H2 = 1013904242;
18158 H3 = 2773480762;
18159 H4 = 1359893119;
18160 H5 = 2600822924;
18161 H6 = 528734635;
18162 H7 = 1541459225;
18163 TOTAL = 0;
18164 }
18165 function init(h0, h1, h2, h3, h4, h5, h6, h7, total) {
18166 h0 = h0 | 0;
18167 h1 = h1 | 0;
18168 h2 = h2 | 0;
18169 h3 = h3 | 0;
18170 h4 = h4 | 0;
18171 h5 = h5 | 0;
18172 h6 = h6 | 0;
18173 h7 = h7 | 0;
18174 total = total | 0;
18175 H0 = h0;
18176 H1 = h1;
18177 H2 = h2;
18178 H3 = h3;
18179 H4 = h4;
18180 H5 = h5;
18181 H6 = h6;
18182 H7 = h7;
18183 TOTAL = total;
18184 }
18185 function process(offset, length) {
18186 offset = offset | 0;
18187 length = length | 0;
18188 var hashed = 0;
18189 if (offset & 63) return -1;
18190 while ((length | 0) >= 64) {
18191 _core_heap(offset);
18192 offset = offset + 64 | 0;
18193 length = length - 64 | 0;
18194 hashed = hashed + 64 | 0;
18195 }
18196 TOTAL = TOTAL + hashed | 0;
18197 return hashed | 0;
18198 }
18199 function finish(offset, length, output) {
18200 offset = offset | 0;
18201 length = length | 0;
18202 output = output | 0;
18203 var hashed = 0, i = 0;
18204 if (offset & 63) return -1;
18205 if (~output) if (output & 31) return -1;
18206 if ((length | 0) >= 64) {
18207 hashed = process(offset, length) | 0;
18208 if ((hashed | 0) == -1) return -1;
18209 offset = offset + hashed | 0;
18210 length = length - hashed | 0;
18211 }
18212 hashed = hashed + length | 0;
18213 TOTAL = TOTAL + length | 0;
18214 HEAP[offset | length] = 128;
18215 if ((length | 0) >= 56) {
18216 for (i = length + 1 | 0; (i | 0) < 64; i = i + 1 | 0) HEAP[offset | i] = 0;
18217 _core_heap(offset);
18218 length = 0;
18219 HEAP[offset | 0] = 0;
18220 }
18221 for (i = length + 1 | 0; (i | 0) < 59; i = i + 1 | 0) HEAP[offset | i] = 0;
18222 HEAP[offset | 59] = TOTAL >>> 29;
18223 HEAP[offset | 60] = TOTAL >>> 21 & 255;
18224 HEAP[offset | 61] = TOTAL >>> 13 & 255;
18225 HEAP[offset | 62] = TOTAL >>> 5 & 255;
18226 HEAP[offset | 63] = TOTAL << 3 & 255;
18227 _core_heap(offset);
18228 if (~output) _state_to_heap(output);
18229 return hashed | 0;
18230 }
18231 function hmac_reset() {
18232 H0 = I0;
18233 H1 = I1;
18234 H2 = I2;
18235 H3 = I3;
18236 H4 = I4;
18237 H5 = I5;
18238 H6 = I6;
18239 H7 = I7;
18240 TOTAL = 64;
18241 }
18242 function _hmac_opad() {
18243 H0 = O0;
18244 H1 = O1;
18245 H2 = O2;
18246 H3 = O3;
18247 H4 = O4;
18248 H5 = O5;
18249 H6 = O6;
18250 H7 = O7;
18251 TOTAL = 64;
18252 }
18253 function hmac_init(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) {
18254 p0 = p0 | 0;
18255 p1 = p1 | 0;
18256 p2 = p2 | 0;
18257 p3 = p3 | 0;
18258 p4 = p4 | 0;
18259 p5 = p5 | 0;
18260 p6 = p6 | 0;
18261 p7 = p7 | 0;
18262 p8 = p8 | 0;
18263 p9 = p9 | 0;
18264 p10 = p10 | 0;
18265 p11 = p11 | 0;
18266 p12 = p12 | 0;
18267 p13 = p13 | 0;
18268 p14 = p14 | 0;
18269 p15 = p15 | 0;
18270 reset();
18271 _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);
18272 O0 = H0;
18273 O1 = H1;
18274 O2 = H2;
18275 O3 = H3;
18276 O4 = H4;
18277 O5 = H5;
18278 O6 = H6;
18279 O7 = H7;
18280 reset();
18281 _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);
18282 I0 = H0;
18283 I1 = H1;
18284 I2 = H2;
18285 I3 = H3;
18286 I4 = H4;
18287 I5 = H5;
18288 I6 = H6;
18289 I7 = H7;
18290 TOTAL = 64;
18291 }
18292 function hmac_finish(offset, length, output) {
18293 offset = offset | 0;
18294 length = length | 0;
18295 output = output | 0;
18296 var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, hashed = 0;
18297 if (offset & 63) return -1;
18298 if (~output) if (output & 31) return -1;
18299 hashed = finish(offset, length, -1) | 0;
18300 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18301 _hmac_opad();
18302 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18303 if (~output) _state_to_heap(output);
18304 return hashed | 0;
18305 }
18306 function pbkdf2_generate_block(offset, length, block, count, output) {
18307 offset = offset | 0;
18308 length = length | 0;
18309 block = block | 0;
18310 count = count | 0;
18311 output = output | 0;
18312 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;
18313 if (offset & 63) return -1;
18314 if (~output) if (output & 31) return -1;
18315 HEAP[offset + length | 0] = block >>> 24;
18316 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
18317 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
18318 HEAP[offset + length + 3 | 0] = block & 255;
18319 // Closure compiler warning - The result of the 'bitor' operator is not being used
18320 //hmac_finish(offset, length + 4 | 0, -1) | 0;
18321 hmac_finish(offset, length + 4 | 0, -1);
18322 h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5,
18323 h6 = t6 = H6, h7 = t7 = H7;
18324 count = count - 1 | 0;
18325 while ((count | 0) > 0) {
18326 hmac_reset();
18327 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18328 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18329 _hmac_opad();
18330 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18331 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18332 h0 = h0 ^ H0;
18333 h1 = h1 ^ H1;
18334 h2 = h2 ^ H2;
18335 h3 = h3 ^ H3;
18336 h4 = h4 ^ H4;
18337 h5 = h5 ^ H5;
18338 h6 = h6 ^ H6;
18339 h7 = h7 ^ H7;
18340 count = count - 1 | 0;
18341 }
18342 H0 = h0;
18343 H1 = h1;
18344 H2 = h2;
18345 H3 = h3;
18346 H4 = h4;
18347 H5 = h5;
18348 H6 = h6;
18349 H7 = h7;
18350 if (~output) _state_to_heap(output);
18351 return 0;
18352 }
18353 return {
18354 reset: reset,
18355 init: init,
18356 process: process,
18357 finish: finish,
18358 hmac_reset: hmac_reset,
18359 hmac_init: hmac_init,
18360 hmac_finish: hmac_finish,
18361 pbkdf2_generate_block: pbkdf2_generate_block
18362 };
18363 }
18364 var _sha256_block_size = 64, _sha256_hash_size = 32;
18365 function sha256_constructor(options) {
18366 options = options || {};
18367 options.heapSize = options.heapSize || 4096;
18368 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
18369 this.heap = options.heap || new Uint8Array(options.heapSize);
18370 this.asm = options.asm || sha256_asm(global, null, this.heap.buffer);
18371 this.BLOCK_SIZE = _sha256_block_size;
18372 this.HASH_SIZE = _sha256_hash_size;
18373 this.reset();
18374 }
18375 function sha256_reset() {
18376 this.result = null;
18377 this.pos = 0;
18378 this.len = 0;
18379 this.asm.reset();
18380 return this;
18381 }
18382 function sha256_process(data) {
18383 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18384 var dpos = 0, dlen = 0, clen = 0;
18385 if (is_buffer(data) || is_bytes(data)) {
18386 dpos = data.byteOffset || 0;
18387 dlen = data.byteLength;
18388 } else if (is_string(data)) {
18389 dlen = data.length;
18390 } else {
18391 throw new TypeError("data isn't of expected type");
18392 }
18393 while (dlen > 0) {
18394 clen = this.heap.byteLength - this.pos - this.len;
18395 clen = clen < dlen ? clen : dlen;
18396 if (is_buffer(data) || is_bytes(data)) {
18397 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
18398 } else {
18399 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
18400 }
18401 this.len += clen;
18402 dpos += clen;
18403 dlen -= clen;
18404 clen = this.asm.process(this.pos, this.len);
18405 if (clen < this.len) {
18406 this.pos += clen;
18407 this.len -= clen;
18408 } else {
18409 this.pos = 0;
18410 this.len = 0;
18411 }
18412 }
18413 return this;
18414 }
18415 function sha256_finish() {
18416 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18417 this.asm.finish(this.pos, this.len, 0);
18418 this.result = new Uint8Array(_sha256_hash_size);
18419 this.result.set(this.heap.subarray(0, _sha256_hash_size));
18420 this.pos = 0;
18421 this.len = 0;
18422 return this;
18423 }
18424 sha256_constructor.BLOCK_SIZE = _sha256_block_size;
18425 sha256_constructor.HASH_SIZE = _sha256_hash_size;
18426 var sha256_prototype = sha256_constructor.prototype;
18427 sha256_prototype.reset = sha256_reset;
18428 sha256_prototype.process = sha256_process;
18429 sha256_prototype.finish = sha256_finish;
18430 function sha512_asm(stdlib, foreign, buffer) {
18431 // Closure Compiler warning - commented out
18432 //"use asm";
18433 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;
18434 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;
18435 var HEAP = new stdlib.Uint8Array(buffer);
18436 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) {
18437 w0h = w0h | 0;
18438 w0l = w0l | 0;
18439 w1h = w1h | 0;
18440 w1l = w1l | 0;
18441 w2h = w2h | 0;
18442 w2l = w2l | 0;
18443 w3h = w3h | 0;
18444 w3l = w3l | 0;
18445 w4h = w4h | 0;
18446 w4l = w4l | 0;
18447 w5h = w5h | 0;
18448 w5l = w5l | 0;
18449 w6h = w6h | 0;
18450 w6l = w6l | 0;
18451 w7h = w7h | 0;
18452 w7l = w7l | 0;
18453 w8h = w8h | 0;
18454 w8l = w8l | 0;
18455 w9h = w9h | 0;
18456 w9l = w9l | 0;
18457 w10h = w10h | 0;
18458 w10l = w10l | 0;
18459 w11h = w11h | 0;
18460 w11l = w11l | 0;
18461 w12h = w12h | 0;
18462 w12l = w12l | 0;
18463 w13h = w13h | 0;
18464 w13l = w13l | 0;
18465 w14h = w14h | 0;
18466 w14l = w14l | 0;
18467 w15h = w15h | 0;
18468 w15l = w15l | 0;
18469 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;
18470 ah = H0h;
18471 al = H0l;
18472 bh = H1h;
18473 bl = H1l;
18474 ch = H2h;
18475 cl = H2l;
18476 dh = H3h;
18477 dl = H3l;
18478 eh = H4h;
18479 el = H4l;
18480 fh = H5h;
18481 fl = H5l;
18482 gh = H6h;
18483 gl = H6l;
18484 hh = H7h;
18485 hl = H7l;
18486 tl = 3609767458 + w0l | 0;
18487 th = 1116352408 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18488 tl = tl + hl | 0;
18489 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18490 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18491 tl = tl + xl | 0;
18492 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18493 xl = gl ^ el & (fl ^ gl) | 0;
18494 tl = tl + xl | 0;
18495 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18496 hl = gl;
18497 hh = gh;
18498 gl = fl;
18499 gh = fh;
18500 fl = el;
18501 fh = eh;
18502 el = dl + tl | 0;
18503 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18504 dl = cl;
18505 dh = ch;
18506 cl = bl;
18507 ch = bh;
18508 bl = al;
18509 bh = ah;
18510 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18511 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18512 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18513 al = al + xl | 0;
18514 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18515 tl = 602891725 + w1l | 0;
18516 th = 1899447441 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18517 tl = tl + hl | 0;
18518 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18519 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18520 tl = tl + xl | 0;
18521 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18522 xl = gl ^ el & (fl ^ gl) | 0;
18523 tl = tl + xl | 0;
18524 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18525 hl = gl;
18526 hh = gh;
18527 gl = fl;
18528 gh = fh;
18529 fl = el;
18530 fh = eh;
18531 el = dl + tl | 0;
18532 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18533 dl = cl;
18534 dh = ch;
18535 cl = bl;
18536 ch = bh;
18537 bl = al;
18538 bh = ah;
18539 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18540 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18541 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18542 al = al + xl | 0;
18543 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18544 tl = 3964484399 + w2l | 0;
18545 th = 3049323471 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
18546 tl = tl + hl | 0;
18547 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18548 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18549 tl = tl + xl | 0;
18550 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18551 xl = gl ^ el & (fl ^ gl) | 0;
18552 tl = tl + xl | 0;
18553 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18554 hl = gl;
18555 hh = gh;
18556 gl = fl;
18557 gh = fh;
18558 fl = el;
18559 fh = eh;
18560 el = dl + tl | 0;
18561 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18562 dl = cl;
18563 dh = ch;
18564 cl = bl;
18565 ch = bh;
18566 bl = al;
18567 bh = ah;
18568 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18569 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18570 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18571 al = al + xl | 0;
18572 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18573 tl = 2173295548 + w3l | 0;
18574 th = 3921009573 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
18575 tl = tl + hl | 0;
18576 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18577 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18578 tl = tl + xl | 0;
18579 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18580 xl = gl ^ el & (fl ^ gl) | 0;
18581 tl = tl + xl | 0;
18582 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18583 hl = gl;
18584 hh = gh;
18585 gl = fl;
18586 gh = fh;
18587 fl = el;
18588 fh = eh;
18589 el = dl + tl | 0;
18590 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18591 dl = cl;
18592 dh = ch;
18593 cl = bl;
18594 ch = bh;
18595 bl = al;
18596 bh = ah;
18597 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18598 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18599 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18600 al = al + xl | 0;
18601 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18602 tl = 4081628472 + w4l | 0;
18603 th = 961987163 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
18604 tl = tl + hl | 0;
18605 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18606 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18607 tl = tl + xl | 0;
18608 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18609 xl = gl ^ el & (fl ^ gl) | 0;
18610 tl = tl + xl | 0;
18611 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18612 hl = gl;
18613 hh = gh;
18614 gl = fl;
18615 gh = fh;
18616 fl = el;
18617 fh = eh;
18618 el = dl + tl | 0;
18619 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18620 dl = cl;
18621 dh = ch;
18622 cl = bl;
18623 ch = bh;
18624 bl = al;
18625 bh = ah;
18626 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18627 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18628 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18629 al = al + xl | 0;
18630 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18631 tl = 3053834265 + w5l | 0;
18632 th = 1508970993 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
18633 tl = tl + hl | 0;
18634 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18635 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18636 tl = tl + xl | 0;
18637 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18638 xl = gl ^ el & (fl ^ gl) | 0;
18639 tl = tl + xl | 0;
18640 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18641 hl = gl;
18642 hh = gh;
18643 gl = fl;
18644 gh = fh;
18645 fl = el;
18646 fh = eh;
18647 el = dl + tl | 0;
18648 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18649 dl = cl;
18650 dh = ch;
18651 cl = bl;
18652 ch = bh;
18653 bl = al;
18654 bh = ah;
18655 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18656 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18657 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18658 al = al + xl | 0;
18659 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18660 tl = 2937671579 + w6l | 0;
18661 th = 2453635748 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
18662 tl = tl + hl | 0;
18663 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18664 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18665 tl = tl + xl | 0;
18666 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18667 xl = gl ^ el & (fl ^ gl) | 0;
18668 tl = tl + xl | 0;
18669 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18670 hl = gl;
18671 hh = gh;
18672 gl = fl;
18673 gh = fh;
18674 fl = el;
18675 fh = eh;
18676 el = dl + tl | 0;
18677 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18678 dl = cl;
18679 dh = ch;
18680 cl = bl;
18681 ch = bh;
18682 bl = al;
18683 bh = ah;
18684 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18685 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18686 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18687 al = al + xl | 0;
18688 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18689 tl = 3664609560 + w7l | 0;
18690 th = 2870763221 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
18691 tl = tl + hl | 0;
18692 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18693 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18694 tl = tl + xl | 0;
18695 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18696 xl = gl ^ el & (fl ^ gl) | 0;
18697 tl = tl + xl | 0;
18698 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18699 hl = gl;
18700 hh = gh;
18701 gl = fl;
18702 gh = fh;
18703 fl = el;
18704 fh = eh;
18705 el = dl + tl | 0;
18706 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18707 dl = cl;
18708 dh = ch;
18709 cl = bl;
18710 ch = bh;
18711 bl = al;
18712 bh = ah;
18713 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18714 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18715 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18716 al = al + xl | 0;
18717 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18718 tl = 2734883394 + w8l | 0;
18719 th = 3624381080 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
18720 tl = tl + hl | 0;
18721 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18722 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18723 tl = tl + xl | 0;
18724 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18725 xl = gl ^ el & (fl ^ gl) | 0;
18726 tl = tl + xl | 0;
18727 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18728 hl = gl;
18729 hh = gh;
18730 gl = fl;
18731 gh = fh;
18732 fl = el;
18733 fh = eh;
18734 el = dl + tl | 0;
18735 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18736 dl = cl;
18737 dh = ch;
18738 cl = bl;
18739 ch = bh;
18740 bl = al;
18741 bh = ah;
18742 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18743 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18744 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18745 al = al + xl | 0;
18746 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18747 tl = 1164996542 + w9l | 0;
18748 th = 310598401 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18749 tl = tl + hl | 0;
18750 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18751 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18752 tl = tl + xl | 0;
18753 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18754 xl = gl ^ el & (fl ^ gl) | 0;
18755 tl = tl + xl | 0;
18756 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18757 hl = gl;
18758 hh = gh;
18759 gl = fl;
18760 gh = fh;
18761 fl = el;
18762 fh = eh;
18763 el = dl + tl | 0;
18764 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18765 dl = cl;
18766 dh = ch;
18767 cl = bl;
18768 ch = bh;
18769 bl = al;
18770 bh = ah;
18771 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18772 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18773 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18774 al = al + xl | 0;
18775 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18776 tl = 1323610764 + w10l | 0;
18777 th = 607225278 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18778 tl = tl + hl | 0;
18779 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18780 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18781 tl = tl + xl | 0;
18782 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18783 xl = gl ^ el & (fl ^ gl) | 0;
18784 tl = tl + xl | 0;
18785 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18786 hl = gl;
18787 hh = gh;
18788 gl = fl;
18789 gh = fh;
18790 fl = el;
18791 fh = eh;
18792 el = dl + tl | 0;
18793 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18794 dl = cl;
18795 dh = ch;
18796 cl = bl;
18797 ch = bh;
18798 bl = al;
18799 bh = ah;
18800 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18801 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18802 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18803 al = al + xl | 0;
18804 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18805 tl = 3590304994 + w11l | 0;
18806 th = 1426881987 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
18807 tl = tl + hl | 0;
18808 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18809 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18810 tl = tl + xl | 0;
18811 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18812 xl = gl ^ el & (fl ^ gl) | 0;
18813 tl = tl + xl | 0;
18814 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18815 hl = gl;
18816 hh = gh;
18817 gl = fl;
18818 gh = fh;
18819 fl = el;
18820 fh = eh;
18821 el = dl + tl | 0;
18822 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18823 dl = cl;
18824 dh = ch;
18825 cl = bl;
18826 ch = bh;
18827 bl = al;
18828 bh = ah;
18829 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18830 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18831 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18832 al = al + xl | 0;
18833 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18834 tl = 4068182383 + w12l | 0;
18835 th = 1925078388 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
18836 tl = tl + hl | 0;
18837 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18838 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18839 tl = tl + xl | 0;
18840 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18841 xl = gl ^ el & (fl ^ gl) | 0;
18842 tl = tl + xl | 0;
18843 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18844 hl = gl;
18845 hh = gh;
18846 gl = fl;
18847 gh = fh;
18848 fl = el;
18849 fh = eh;
18850 el = dl + tl | 0;
18851 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18852 dl = cl;
18853 dh = ch;
18854 cl = bl;
18855 ch = bh;
18856 bl = al;
18857 bh = ah;
18858 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18859 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18860 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18861 al = al + xl | 0;
18862 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18863 tl = 991336113 + w13l | 0;
18864 th = 2162078206 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
18865 tl = tl + hl | 0;
18866 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18867 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18868 tl = tl + xl | 0;
18869 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18870 xl = gl ^ el & (fl ^ gl) | 0;
18871 tl = tl + xl | 0;
18872 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18873 hl = gl;
18874 hh = gh;
18875 gl = fl;
18876 gh = fh;
18877 fl = el;
18878 fh = eh;
18879 el = dl + tl | 0;
18880 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18881 dl = cl;
18882 dh = ch;
18883 cl = bl;
18884 ch = bh;
18885 bl = al;
18886 bh = ah;
18887 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18888 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18889 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18890 al = al + xl | 0;
18891 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18892 tl = 633803317 + w14l | 0;
18893 th = 2614888103 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
18894 tl = tl + hl | 0;
18895 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18896 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18897 tl = tl + xl | 0;
18898 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18899 xl = gl ^ el & (fl ^ gl) | 0;
18900 tl = tl + xl | 0;
18901 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18902 hl = gl;
18903 hh = gh;
18904 gl = fl;
18905 gh = fh;
18906 fl = el;
18907 fh = eh;
18908 el = dl + tl | 0;
18909 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18910 dl = cl;
18911 dh = ch;
18912 cl = bl;
18913 ch = bh;
18914 bl = al;
18915 bh = ah;
18916 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18917 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18918 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18919 al = al + xl | 0;
18920 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18921 tl = 3479774868 + w15l | 0;
18922 th = 3248222580 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
18923 tl = tl + hl | 0;
18924 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18925 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18926 tl = tl + xl | 0;
18927 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18928 xl = gl ^ el & (fl ^ gl) | 0;
18929 tl = tl + xl | 0;
18930 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18931 hl = gl;
18932 hh = gh;
18933 gl = fl;
18934 gh = fh;
18935 fl = el;
18936 fh = eh;
18937 el = dl + tl | 0;
18938 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18939 dl = cl;
18940 dh = ch;
18941 cl = bl;
18942 ch = bh;
18943 bl = al;
18944 bh = ah;
18945 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18946 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18947 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18948 al = al + xl | 0;
18949 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18950 w0l = w0l + w9l | 0;
18951 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18952 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
18953 w0l = w0l + xl | 0;
18954 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18955 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
18956 w0l = w0l + xl | 0;
18957 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18958 tl = 2666613458 + w0l | 0;
18959 th = 3835390401 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18960 tl = tl + hl | 0;
18961 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18962 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18963 tl = tl + xl | 0;
18964 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18965 xl = gl ^ el & (fl ^ gl) | 0;
18966 tl = tl + xl | 0;
18967 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18968 hl = gl;
18969 hh = gh;
18970 gl = fl;
18971 gh = fh;
18972 fl = el;
18973 fh = eh;
18974 el = dl + tl | 0;
18975 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18976 dl = cl;
18977 dh = ch;
18978 cl = bl;
18979 ch = bh;
18980 bl = al;
18981 bh = ah;
18982 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18983 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18984 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18985 al = al + xl | 0;
18986 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18987 w1l = w1l + w10l | 0;
18988 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18989 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
18990 w1l = w1l + xl | 0;
18991 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18992 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
18993 w1l = w1l + xl | 0;
18994 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18995 tl = 944711139 + w1l | 0;
18996 th = 4022224774 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18997 tl = tl + hl | 0;
18998 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18999 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19000 tl = tl + xl | 0;
19001 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19002 xl = gl ^ el & (fl ^ gl) | 0;
19003 tl = tl + xl | 0;
19004 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19005 hl = gl;
19006 hh = gh;
19007 gl = fl;
19008 gh = fh;
19009 fl = el;
19010 fh = eh;
19011 el = dl + tl | 0;
19012 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19013 dl = cl;
19014 dh = ch;
19015 cl = bl;
19016 ch = bh;
19017 bl = al;
19018 bh = ah;
19019 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19020 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19021 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19022 al = al + xl | 0;
19023 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19024 w2l = w2l + w11l | 0;
19025 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19026 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
19027 w2l = w2l + xl | 0;
19028 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19029 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
19030 w2l = w2l + xl | 0;
19031 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19032 tl = 2341262773 + w2l | 0;
19033 th = 264347078 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19034 tl = tl + hl | 0;
19035 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19036 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19037 tl = tl + xl | 0;
19038 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19039 xl = gl ^ el & (fl ^ gl) | 0;
19040 tl = tl + xl | 0;
19041 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19042 hl = gl;
19043 hh = gh;
19044 gl = fl;
19045 gh = fh;
19046 fl = el;
19047 fh = eh;
19048 el = dl + tl | 0;
19049 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19050 dl = cl;
19051 dh = ch;
19052 cl = bl;
19053 ch = bh;
19054 bl = al;
19055 bh = ah;
19056 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19057 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19058 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19059 al = al + xl | 0;
19060 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19061 w3l = w3l + w12l | 0;
19062 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19063 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
19064 w3l = w3l + xl | 0;
19065 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19066 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19067 w3l = w3l + xl | 0;
19068 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19069 tl = 2007800933 + w3l | 0;
19070 th = 604807628 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19071 tl = tl + hl | 0;
19072 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19073 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19074 tl = tl + xl | 0;
19075 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19076 xl = gl ^ el & (fl ^ gl) | 0;
19077 tl = tl + xl | 0;
19078 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19079 hl = gl;
19080 hh = gh;
19081 gl = fl;
19082 gh = fh;
19083 fl = el;
19084 fh = eh;
19085 el = dl + tl | 0;
19086 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19087 dl = cl;
19088 dh = ch;
19089 cl = bl;
19090 ch = bh;
19091 bl = al;
19092 bh = ah;
19093 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19094 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19095 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19096 al = al + xl | 0;
19097 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19098 w4l = w4l + w13l | 0;
19099 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19100 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19101 w4l = w4l + xl | 0;
19102 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19103 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19104 w4l = w4l + xl | 0;
19105 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19106 tl = 1495990901 + w4l | 0;
19107 th = 770255983 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19108 tl = tl + hl | 0;
19109 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19110 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19111 tl = tl + xl | 0;
19112 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19113 xl = gl ^ el & (fl ^ gl) | 0;
19114 tl = tl + xl | 0;
19115 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19116 hl = gl;
19117 hh = gh;
19118 gl = fl;
19119 gh = fh;
19120 fl = el;
19121 fh = eh;
19122 el = dl + tl | 0;
19123 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19124 dl = cl;
19125 dh = ch;
19126 cl = bl;
19127 ch = bh;
19128 bl = al;
19129 bh = ah;
19130 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19131 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19132 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19133 al = al + xl | 0;
19134 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19135 w5l = w5l + w14l | 0;
19136 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19137 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19138 w5l = w5l + xl | 0;
19139 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19140 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19141 w5l = w5l + xl | 0;
19142 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19143 tl = 1856431235 + w5l | 0;
19144 th = 1249150122 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19145 tl = tl + hl | 0;
19146 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19147 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19148 tl = tl + xl | 0;
19149 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19150 xl = gl ^ el & (fl ^ gl) | 0;
19151 tl = tl + xl | 0;
19152 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19153 hl = gl;
19154 hh = gh;
19155 gl = fl;
19156 gh = fh;
19157 fl = el;
19158 fh = eh;
19159 el = dl + tl | 0;
19160 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19161 dl = cl;
19162 dh = ch;
19163 cl = bl;
19164 ch = bh;
19165 bl = al;
19166 bh = ah;
19167 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19168 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19169 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19170 al = al + xl | 0;
19171 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19172 w6l = w6l + w15l | 0;
19173 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19174 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19175 w6l = w6l + xl | 0;
19176 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19177 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19178 w6l = w6l + xl | 0;
19179 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19180 tl = 3175218132 + w6l | 0;
19181 th = 1555081692 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19182 tl = tl + hl | 0;
19183 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19184 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19185 tl = tl + xl | 0;
19186 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19187 xl = gl ^ el & (fl ^ gl) | 0;
19188 tl = tl + xl | 0;
19189 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19190 hl = gl;
19191 hh = gh;
19192 gl = fl;
19193 gh = fh;
19194 fl = el;
19195 fh = eh;
19196 el = dl + tl | 0;
19197 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19198 dl = cl;
19199 dh = ch;
19200 cl = bl;
19201 ch = bh;
19202 bl = al;
19203 bh = ah;
19204 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19205 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19206 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19207 al = al + xl | 0;
19208 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19209 w7l = w7l + w0l | 0;
19210 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19211 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19212 w7l = w7l + xl | 0;
19213 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19214 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19215 w7l = w7l + xl | 0;
19216 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19217 tl = 2198950837 + w7l | 0;
19218 th = 1996064986 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19219 tl = tl + hl | 0;
19220 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19221 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19222 tl = tl + xl | 0;
19223 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19224 xl = gl ^ el & (fl ^ gl) | 0;
19225 tl = tl + xl | 0;
19226 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19227 hl = gl;
19228 hh = gh;
19229 gl = fl;
19230 gh = fh;
19231 fl = el;
19232 fh = eh;
19233 el = dl + tl | 0;
19234 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19235 dl = cl;
19236 dh = ch;
19237 cl = bl;
19238 ch = bh;
19239 bl = al;
19240 bh = ah;
19241 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19242 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19243 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19244 al = al + xl | 0;
19245 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19246 w8l = w8l + w1l | 0;
19247 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19248 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19249 w8l = w8l + xl | 0;
19250 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19251 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19252 w8l = w8l + xl | 0;
19253 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19254 tl = 3999719339 + w8l | 0;
19255 th = 2554220882 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19256 tl = tl + hl | 0;
19257 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19258 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19259 tl = tl + xl | 0;
19260 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19261 xl = gl ^ el & (fl ^ gl) | 0;
19262 tl = tl + xl | 0;
19263 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19264 hl = gl;
19265 hh = gh;
19266 gl = fl;
19267 gh = fh;
19268 fl = el;
19269 fh = eh;
19270 el = dl + tl | 0;
19271 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19272 dl = cl;
19273 dh = ch;
19274 cl = bl;
19275 ch = bh;
19276 bl = al;
19277 bh = ah;
19278 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19279 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19280 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19281 al = al + xl | 0;
19282 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19283 w9l = w9l + w2l | 0;
19284 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19285 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19286 w9l = w9l + xl | 0;
19287 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19288 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19289 w9l = w9l + xl | 0;
19290 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19291 tl = 766784016 + w9l | 0;
19292 th = 2821834349 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19293 tl = tl + hl | 0;
19294 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19295 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19296 tl = tl + xl | 0;
19297 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19298 xl = gl ^ el & (fl ^ gl) | 0;
19299 tl = tl + xl | 0;
19300 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19301 hl = gl;
19302 hh = gh;
19303 gl = fl;
19304 gh = fh;
19305 fl = el;
19306 fh = eh;
19307 el = dl + tl | 0;
19308 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19309 dl = cl;
19310 dh = ch;
19311 cl = bl;
19312 ch = bh;
19313 bl = al;
19314 bh = ah;
19315 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19316 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19317 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19318 al = al + xl | 0;
19319 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19320 w10l = w10l + w3l | 0;
19321 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19322 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19323 w10l = w10l + xl | 0;
19324 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19325 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19326 w10l = w10l + xl | 0;
19327 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19328 tl = 2566594879 + w10l | 0;
19329 th = 2952996808 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19330 tl = tl + hl | 0;
19331 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19332 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19333 tl = tl + xl | 0;
19334 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19335 xl = gl ^ el & (fl ^ gl) | 0;
19336 tl = tl + xl | 0;
19337 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19338 hl = gl;
19339 hh = gh;
19340 gl = fl;
19341 gh = fh;
19342 fl = el;
19343 fh = eh;
19344 el = dl + tl | 0;
19345 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19346 dl = cl;
19347 dh = ch;
19348 cl = bl;
19349 ch = bh;
19350 bl = al;
19351 bh = ah;
19352 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19353 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19354 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19355 al = al + xl | 0;
19356 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19357 w11l = w11l + w4l | 0;
19358 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19359 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19360 w11l = w11l + xl | 0;
19361 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19362 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19363 w11l = w11l + xl | 0;
19364 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19365 tl = 3203337956 + w11l | 0;
19366 th = 3210313671 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19367 tl = tl + hl | 0;
19368 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19369 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19370 tl = tl + xl | 0;
19371 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19372 xl = gl ^ el & (fl ^ gl) | 0;
19373 tl = tl + xl | 0;
19374 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19375 hl = gl;
19376 hh = gh;
19377 gl = fl;
19378 gh = fh;
19379 fl = el;
19380 fh = eh;
19381 el = dl + tl | 0;
19382 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19383 dl = cl;
19384 dh = ch;
19385 cl = bl;
19386 ch = bh;
19387 bl = al;
19388 bh = ah;
19389 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19390 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19391 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19392 al = al + xl | 0;
19393 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19394 w12l = w12l + w5l | 0;
19395 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19396 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19397 w12l = w12l + xl | 0;
19398 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19399 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19400 w12l = w12l + xl | 0;
19401 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19402 tl = 1034457026 + w12l | 0;
19403 th = 3336571891 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19404 tl = tl + hl | 0;
19405 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19406 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19407 tl = tl + xl | 0;
19408 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19409 xl = gl ^ el & (fl ^ gl) | 0;
19410 tl = tl + xl | 0;
19411 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19412 hl = gl;
19413 hh = gh;
19414 gl = fl;
19415 gh = fh;
19416 fl = el;
19417 fh = eh;
19418 el = dl + tl | 0;
19419 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19420 dl = cl;
19421 dh = ch;
19422 cl = bl;
19423 ch = bh;
19424 bl = al;
19425 bh = ah;
19426 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19427 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19428 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19429 al = al + xl | 0;
19430 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19431 w13l = w13l + w6l | 0;
19432 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19433 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
19434 w13l = w13l + xl | 0;
19435 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19436 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
19437 w13l = w13l + xl | 0;
19438 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19439 tl = 2466948901 + w13l | 0;
19440 th = 3584528711 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19441 tl = tl + hl | 0;
19442 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19443 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19444 tl = tl + xl | 0;
19445 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19446 xl = gl ^ el & (fl ^ gl) | 0;
19447 tl = tl + xl | 0;
19448 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19449 hl = gl;
19450 hh = gh;
19451 gl = fl;
19452 gh = fh;
19453 fl = el;
19454 fh = eh;
19455 el = dl + tl | 0;
19456 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19457 dl = cl;
19458 dh = ch;
19459 cl = bl;
19460 ch = bh;
19461 bl = al;
19462 bh = ah;
19463 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19464 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19465 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19466 al = al + xl | 0;
19467 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19468 w14l = w14l + w7l | 0;
19469 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19470 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
19471 w14l = w14l + xl | 0;
19472 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19473 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
19474 w14l = w14l + xl | 0;
19475 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19476 tl = 3758326383 + w14l | 0;
19477 th = 113926993 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19478 tl = tl + hl | 0;
19479 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19480 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19481 tl = tl + xl | 0;
19482 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19483 xl = gl ^ el & (fl ^ gl) | 0;
19484 tl = tl + xl | 0;
19485 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19486 hl = gl;
19487 hh = gh;
19488 gl = fl;
19489 gh = fh;
19490 fl = el;
19491 fh = eh;
19492 el = dl + tl | 0;
19493 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19494 dl = cl;
19495 dh = ch;
19496 cl = bl;
19497 ch = bh;
19498 bl = al;
19499 bh = ah;
19500 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19501 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19502 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19503 al = al + xl | 0;
19504 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19505 w15l = w15l + w8l | 0;
19506 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19507 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
19508 w15l = w15l + xl | 0;
19509 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19510 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
19511 w15l = w15l + xl | 0;
19512 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19513 tl = 168717936 + w15l | 0;
19514 th = 338241895 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19515 tl = tl + hl | 0;
19516 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19517 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19518 tl = tl + xl | 0;
19519 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19520 xl = gl ^ el & (fl ^ gl) | 0;
19521 tl = tl + xl | 0;
19522 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19523 hl = gl;
19524 hh = gh;
19525 gl = fl;
19526 gh = fh;
19527 fl = el;
19528 fh = eh;
19529 el = dl + tl | 0;
19530 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19531 dl = cl;
19532 dh = ch;
19533 cl = bl;
19534 ch = bh;
19535 bl = al;
19536 bh = ah;
19537 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19538 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19539 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19540 al = al + xl | 0;
19541 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19542 w0l = w0l + w9l | 0;
19543 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19544 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
19545 w0l = w0l + xl | 0;
19546 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19547 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
19548 w0l = w0l + xl | 0;
19549 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19550 tl = 1188179964 + w0l | 0;
19551 th = 666307205 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19552 tl = tl + hl | 0;
19553 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19554 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19555 tl = tl + xl | 0;
19556 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19557 xl = gl ^ el & (fl ^ gl) | 0;
19558 tl = tl + xl | 0;
19559 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19560 hl = gl;
19561 hh = gh;
19562 gl = fl;
19563 gh = fh;
19564 fl = el;
19565 fh = eh;
19566 el = dl + tl | 0;
19567 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19568 dl = cl;
19569 dh = ch;
19570 cl = bl;
19571 ch = bh;
19572 bl = al;
19573 bh = ah;
19574 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19575 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19576 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19577 al = al + xl | 0;
19578 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19579 w1l = w1l + w10l | 0;
19580 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19581 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
19582 w1l = w1l + xl | 0;
19583 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19584 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
19585 w1l = w1l + xl | 0;
19586 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19587 tl = 1546045734 + w1l | 0;
19588 th = 773529912 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19589 tl = tl + hl | 0;
19590 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19591 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19592 tl = tl + xl | 0;
19593 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19594 xl = gl ^ el & (fl ^ gl) | 0;
19595 tl = tl + xl | 0;
19596 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19597 hl = gl;
19598 hh = gh;
19599 gl = fl;
19600 gh = fh;
19601 fl = el;
19602 fh = eh;
19603 el = dl + tl | 0;
19604 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19605 dl = cl;
19606 dh = ch;
19607 cl = bl;
19608 ch = bh;
19609 bl = al;
19610 bh = ah;
19611 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19612 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19613 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19614 al = al + xl | 0;
19615 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19616 w2l = w2l + w11l | 0;
19617 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19618 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
19619 w2l = w2l + xl | 0;
19620 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19621 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
19622 w2l = w2l + xl | 0;
19623 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19624 tl = 1522805485 + w2l | 0;
19625 th = 1294757372 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19626 tl = tl + hl | 0;
19627 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19628 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19629 tl = tl + xl | 0;
19630 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19631 xl = gl ^ el & (fl ^ gl) | 0;
19632 tl = tl + xl | 0;
19633 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19634 hl = gl;
19635 hh = gh;
19636 gl = fl;
19637 gh = fh;
19638 fl = el;
19639 fh = eh;
19640 el = dl + tl | 0;
19641 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19642 dl = cl;
19643 dh = ch;
19644 cl = bl;
19645 ch = bh;
19646 bl = al;
19647 bh = ah;
19648 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19649 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19650 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19651 al = al + xl | 0;
19652 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19653 w3l = w3l + w12l | 0;
19654 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19655 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
19656 w3l = w3l + xl | 0;
19657 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19658 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19659 w3l = w3l + xl | 0;
19660 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19661 tl = 2643833823 + w3l | 0;
19662 th = 1396182291 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19663 tl = tl + hl | 0;
19664 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19665 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19666 tl = tl + xl | 0;
19667 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19668 xl = gl ^ el & (fl ^ gl) | 0;
19669 tl = tl + xl | 0;
19670 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19671 hl = gl;
19672 hh = gh;
19673 gl = fl;
19674 gh = fh;
19675 fl = el;
19676 fh = eh;
19677 el = dl + tl | 0;
19678 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19679 dl = cl;
19680 dh = ch;
19681 cl = bl;
19682 ch = bh;
19683 bl = al;
19684 bh = ah;
19685 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19686 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19687 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19688 al = al + xl | 0;
19689 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19690 w4l = w4l + w13l | 0;
19691 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19692 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19693 w4l = w4l + xl | 0;
19694 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19695 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19696 w4l = w4l + xl | 0;
19697 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19698 tl = 2343527390 + w4l | 0;
19699 th = 1695183700 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19700 tl = tl + hl | 0;
19701 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19702 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19703 tl = tl + xl | 0;
19704 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19705 xl = gl ^ el & (fl ^ gl) | 0;
19706 tl = tl + xl | 0;
19707 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19708 hl = gl;
19709 hh = gh;
19710 gl = fl;
19711 gh = fh;
19712 fl = el;
19713 fh = eh;
19714 el = dl + tl | 0;
19715 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19716 dl = cl;
19717 dh = ch;
19718 cl = bl;
19719 ch = bh;
19720 bl = al;
19721 bh = ah;
19722 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19723 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19724 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19725 al = al + xl | 0;
19726 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19727 w5l = w5l + w14l | 0;
19728 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19729 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19730 w5l = w5l + xl | 0;
19731 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19732 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19733 w5l = w5l + xl | 0;
19734 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19735 tl = 1014477480 + w5l | 0;
19736 th = 1986661051 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19737 tl = tl + hl | 0;
19738 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19739 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19740 tl = tl + xl | 0;
19741 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19742 xl = gl ^ el & (fl ^ gl) | 0;
19743 tl = tl + xl | 0;
19744 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19745 hl = gl;
19746 hh = gh;
19747 gl = fl;
19748 gh = fh;
19749 fl = el;
19750 fh = eh;
19751 el = dl + tl | 0;
19752 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19753 dl = cl;
19754 dh = ch;
19755 cl = bl;
19756 ch = bh;
19757 bl = al;
19758 bh = ah;
19759 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19760 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19761 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19762 al = al + xl | 0;
19763 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19764 w6l = w6l + w15l | 0;
19765 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19766 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19767 w6l = w6l + xl | 0;
19768 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19769 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19770 w6l = w6l + xl | 0;
19771 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19772 tl = 1206759142 + w6l | 0;
19773 th = 2177026350 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19774 tl = tl + hl | 0;
19775 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19776 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19777 tl = tl + xl | 0;
19778 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19779 xl = gl ^ el & (fl ^ gl) | 0;
19780 tl = tl + xl | 0;
19781 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19782 hl = gl;
19783 hh = gh;
19784 gl = fl;
19785 gh = fh;
19786 fl = el;
19787 fh = eh;
19788 el = dl + tl | 0;
19789 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19790 dl = cl;
19791 dh = ch;
19792 cl = bl;
19793 ch = bh;
19794 bl = al;
19795 bh = ah;
19796 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19797 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19798 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19799 al = al + xl | 0;
19800 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19801 w7l = w7l + w0l | 0;
19802 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19803 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19804 w7l = w7l + xl | 0;
19805 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19806 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19807 w7l = w7l + xl | 0;
19808 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19809 tl = 344077627 + w7l | 0;
19810 th = 2456956037 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19811 tl = tl + hl | 0;
19812 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19813 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19814 tl = tl + xl | 0;
19815 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19816 xl = gl ^ el & (fl ^ gl) | 0;
19817 tl = tl + xl | 0;
19818 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19819 hl = gl;
19820 hh = gh;
19821 gl = fl;
19822 gh = fh;
19823 fl = el;
19824 fh = eh;
19825 el = dl + tl | 0;
19826 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19827 dl = cl;
19828 dh = ch;
19829 cl = bl;
19830 ch = bh;
19831 bl = al;
19832 bh = ah;
19833 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19834 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19835 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19836 al = al + xl | 0;
19837 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19838 w8l = w8l + w1l | 0;
19839 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19840 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19841 w8l = w8l + xl | 0;
19842 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19843 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19844 w8l = w8l + xl | 0;
19845 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19846 tl = 1290863460 + w8l | 0;
19847 th = 2730485921 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19848 tl = tl + hl | 0;
19849 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19850 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19851 tl = tl + xl | 0;
19852 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19853 xl = gl ^ el & (fl ^ gl) | 0;
19854 tl = tl + xl | 0;
19855 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19856 hl = gl;
19857 hh = gh;
19858 gl = fl;
19859 gh = fh;
19860 fl = el;
19861 fh = eh;
19862 el = dl + tl | 0;
19863 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19864 dl = cl;
19865 dh = ch;
19866 cl = bl;
19867 ch = bh;
19868 bl = al;
19869 bh = ah;
19870 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19871 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19872 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19873 al = al + xl | 0;
19874 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19875 w9l = w9l + w2l | 0;
19876 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19877 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19878 w9l = w9l + xl | 0;
19879 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19880 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19881 w9l = w9l + xl | 0;
19882 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19883 tl = 3158454273 + w9l | 0;
19884 th = 2820302411 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19885 tl = tl + hl | 0;
19886 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19887 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19888 tl = tl + xl | 0;
19889 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19890 xl = gl ^ el & (fl ^ gl) | 0;
19891 tl = tl + xl | 0;
19892 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19893 hl = gl;
19894 hh = gh;
19895 gl = fl;
19896 gh = fh;
19897 fl = el;
19898 fh = eh;
19899 el = dl + tl | 0;
19900 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19901 dl = cl;
19902 dh = ch;
19903 cl = bl;
19904 ch = bh;
19905 bl = al;
19906 bh = ah;
19907 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19908 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19909 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19910 al = al + xl | 0;
19911 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19912 w10l = w10l + w3l | 0;
19913 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19914 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19915 w10l = w10l + xl | 0;
19916 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19917 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19918 w10l = w10l + xl | 0;
19919 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19920 tl = 3505952657 + w10l | 0;
19921 th = 3259730800 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19922 tl = tl + hl | 0;
19923 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19924 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19925 tl = tl + xl | 0;
19926 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19927 xl = gl ^ el & (fl ^ gl) | 0;
19928 tl = tl + xl | 0;
19929 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19930 hl = gl;
19931 hh = gh;
19932 gl = fl;
19933 gh = fh;
19934 fl = el;
19935 fh = eh;
19936 el = dl + tl | 0;
19937 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19938 dl = cl;
19939 dh = ch;
19940 cl = bl;
19941 ch = bh;
19942 bl = al;
19943 bh = ah;
19944 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19945 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19946 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19947 al = al + xl | 0;
19948 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19949 w11l = w11l + w4l | 0;
19950 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19951 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19952 w11l = w11l + xl | 0;
19953 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19954 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19955 w11l = w11l + xl | 0;
19956 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19957 tl = 106217008 + w11l | 0;
19958 th = 3345764771 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19959 tl = tl + hl | 0;
19960 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19961 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19962 tl = tl + xl | 0;
19963 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19964 xl = gl ^ el & (fl ^ gl) | 0;
19965 tl = tl + xl | 0;
19966 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19967 hl = gl;
19968 hh = gh;
19969 gl = fl;
19970 gh = fh;
19971 fl = el;
19972 fh = eh;
19973 el = dl + tl | 0;
19974 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19975 dl = cl;
19976 dh = ch;
19977 cl = bl;
19978 ch = bh;
19979 bl = al;
19980 bh = ah;
19981 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19982 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19983 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19984 al = al + xl | 0;
19985 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19986 w12l = w12l + w5l | 0;
19987 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19988 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19989 w12l = w12l + xl | 0;
19990 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19991 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19992 w12l = w12l + xl | 0;
19993 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19994 tl = 3606008344 + w12l | 0;
19995 th = 3516065817 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19996 tl = tl + hl | 0;
19997 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19998 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19999 tl = tl + xl | 0;
20000 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20001 xl = gl ^ el & (fl ^ gl) | 0;
20002 tl = tl + xl | 0;
20003 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20004 hl = gl;
20005 hh = gh;
20006 gl = fl;
20007 gh = fh;
20008 fl = el;
20009 fh = eh;
20010 el = dl + tl | 0;
20011 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20012 dl = cl;
20013 dh = ch;
20014 cl = bl;
20015 ch = bh;
20016 bl = al;
20017 bh = ah;
20018 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20019 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20020 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20021 al = al + xl | 0;
20022 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20023 w13l = w13l + w6l | 0;
20024 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20025 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
20026 w13l = w13l + xl | 0;
20027 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20028 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
20029 w13l = w13l + xl | 0;
20030 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20031 tl = 1432725776 + w13l | 0;
20032 th = 3600352804 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20033 tl = tl + hl | 0;
20034 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20035 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20036 tl = tl + xl | 0;
20037 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20038 xl = gl ^ el & (fl ^ gl) | 0;
20039 tl = tl + xl | 0;
20040 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20041 hl = gl;
20042 hh = gh;
20043 gl = fl;
20044 gh = fh;
20045 fl = el;
20046 fh = eh;
20047 el = dl + tl | 0;
20048 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20049 dl = cl;
20050 dh = ch;
20051 cl = bl;
20052 ch = bh;
20053 bl = al;
20054 bh = ah;
20055 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20056 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20057 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20058 al = al + xl | 0;
20059 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20060 w14l = w14l + w7l | 0;
20061 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20062 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
20063 w14l = w14l + xl | 0;
20064 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20065 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
20066 w14l = w14l + xl | 0;
20067 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20068 tl = 1467031594 + w14l | 0;
20069 th = 4094571909 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20070 tl = tl + hl | 0;
20071 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20072 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20073 tl = tl + xl | 0;
20074 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20075 xl = gl ^ el & (fl ^ gl) | 0;
20076 tl = tl + xl | 0;
20077 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20078 hl = gl;
20079 hh = gh;
20080 gl = fl;
20081 gh = fh;
20082 fl = el;
20083 fh = eh;
20084 el = dl + tl | 0;
20085 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20086 dl = cl;
20087 dh = ch;
20088 cl = bl;
20089 ch = bh;
20090 bl = al;
20091 bh = ah;
20092 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20093 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20094 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20095 al = al + xl | 0;
20096 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20097 w15l = w15l + w8l | 0;
20098 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20099 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20100 w15l = w15l + xl | 0;
20101 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20102 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20103 w15l = w15l + xl | 0;
20104 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20105 tl = 851169720 + w15l | 0;
20106 th = 275423344 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20107 tl = tl + hl | 0;
20108 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20109 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20110 tl = tl + xl | 0;
20111 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20112 xl = gl ^ el & (fl ^ gl) | 0;
20113 tl = tl + xl | 0;
20114 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20115 hl = gl;
20116 hh = gh;
20117 gl = fl;
20118 gh = fh;
20119 fl = el;
20120 fh = eh;
20121 el = dl + tl | 0;
20122 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20123 dl = cl;
20124 dh = ch;
20125 cl = bl;
20126 ch = bh;
20127 bl = al;
20128 bh = ah;
20129 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20130 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20131 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20132 al = al + xl | 0;
20133 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20134 w0l = w0l + w9l | 0;
20135 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20136 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20137 w0l = w0l + xl | 0;
20138 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20139 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20140 w0l = w0l + xl | 0;
20141 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20142 tl = 3100823752 + w0l | 0;
20143 th = 430227734 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20144 tl = tl + hl | 0;
20145 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20146 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20147 tl = tl + xl | 0;
20148 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20149 xl = gl ^ el & (fl ^ gl) | 0;
20150 tl = tl + xl | 0;
20151 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20152 hl = gl;
20153 hh = gh;
20154 gl = fl;
20155 gh = fh;
20156 fl = el;
20157 fh = eh;
20158 el = dl + tl | 0;
20159 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20160 dl = cl;
20161 dh = ch;
20162 cl = bl;
20163 ch = bh;
20164 bl = al;
20165 bh = ah;
20166 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20167 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20168 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20169 al = al + xl | 0;
20170 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20171 w1l = w1l + w10l | 0;
20172 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20173 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20174 w1l = w1l + xl | 0;
20175 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20176 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20177 w1l = w1l + xl | 0;
20178 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20179 tl = 1363258195 + w1l | 0;
20180 th = 506948616 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20181 tl = tl + hl | 0;
20182 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20183 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20184 tl = tl + xl | 0;
20185 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20186 xl = gl ^ el & (fl ^ gl) | 0;
20187 tl = tl + xl | 0;
20188 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20189 hl = gl;
20190 hh = gh;
20191 gl = fl;
20192 gh = fh;
20193 fl = el;
20194 fh = eh;
20195 el = dl + tl | 0;
20196 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20197 dl = cl;
20198 dh = ch;
20199 cl = bl;
20200 ch = bh;
20201 bl = al;
20202 bh = ah;
20203 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20204 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20205 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20206 al = al + xl | 0;
20207 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20208 w2l = w2l + w11l | 0;
20209 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20210 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20211 w2l = w2l + xl | 0;
20212 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20213 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20214 w2l = w2l + xl | 0;
20215 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20216 tl = 3750685593 + w2l | 0;
20217 th = 659060556 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20218 tl = tl + hl | 0;
20219 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20220 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20221 tl = tl + xl | 0;
20222 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20223 xl = gl ^ el & (fl ^ gl) | 0;
20224 tl = tl + xl | 0;
20225 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20226 hl = gl;
20227 hh = gh;
20228 gl = fl;
20229 gh = fh;
20230 fl = el;
20231 fh = eh;
20232 el = dl + tl | 0;
20233 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20234 dl = cl;
20235 dh = ch;
20236 cl = bl;
20237 ch = bh;
20238 bl = al;
20239 bh = ah;
20240 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20241 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20242 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20243 al = al + xl | 0;
20244 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20245 w3l = w3l + w12l | 0;
20246 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20247 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20248 w3l = w3l + xl | 0;
20249 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20250 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20251 w3l = w3l + xl | 0;
20252 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20253 tl = 3785050280 + w3l | 0;
20254 th = 883997877 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20255 tl = tl + hl | 0;
20256 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20257 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20258 tl = tl + xl | 0;
20259 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20260 xl = gl ^ el & (fl ^ gl) | 0;
20261 tl = tl + xl | 0;
20262 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20263 hl = gl;
20264 hh = gh;
20265 gl = fl;
20266 gh = fh;
20267 fl = el;
20268 fh = eh;
20269 el = dl + tl | 0;
20270 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20271 dl = cl;
20272 dh = ch;
20273 cl = bl;
20274 ch = bh;
20275 bl = al;
20276 bh = ah;
20277 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20278 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20279 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20280 al = al + xl | 0;
20281 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20282 w4l = w4l + w13l | 0;
20283 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20284 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20285 w4l = w4l + xl | 0;
20286 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20287 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20288 w4l = w4l + xl | 0;
20289 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20290 tl = 3318307427 + w4l | 0;
20291 th = 958139571 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20292 tl = tl + hl | 0;
20293 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20294 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20295 tl = tl + xl | 0;
20296 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20297 xl = gl ^ el & (fl ^ gl) | 0;
20298 tl = tl + xl | 0;
20299 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20300 hl = gl;
20301 hh = gh;
20302 gl = fl;
20303 gh = fh;
20304 fl = el;
20305 fh = eh;
20306 el = dl + tl | 0;
20307 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20308 dl = cl;
20309 dh = ch;
20310 cl = bl;
20311 ch = bh;
20312 bl = al;
20313 bh = ah;
20314 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20315 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20316 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20317 al = al + xl | 0;
20318 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20319 w5l = w5l + w14l | 0;
20320 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20321 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20322 w5l = w5l + xl | 0;
20323 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20324 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20325 w5l = w5l + xl | 0;
20326 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20327 tl = 3812723403 + w5l | 0;
20328 th = 1322822218 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20329 tl = tl + hl | 0;
20330 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20331 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20332 tl = tl + xl | 0;
20333 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20334 xl = gl ^ el & (fl ^ gl) | 0;
20335 tl = tl + xl | 0;
20336 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20337 hl = gl;
20338 hh = gh;
20339 gl = fl;
20340 gh = fh;
20341 fl = el;
20342 fh = eh;
20343 el = dl + tl | 0;
20344 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20345 dl = cl;
20346 dh = ch;
20347 cl = bl;
20348 ch = bh;
20349 bl = al;
20350 bh = ah;
20351 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20352 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20353 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20354 al = al + xl | 0;
20355 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20356 w6l = w6l + w15l | 0;
20357 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20358 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20359 w6l = w6l + xl | 0;
20360 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20361 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20362 w6l = w6l + xl | 0;
20363 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20364 tl = 2003034995 + w6l | 0;
20365 th = 1537002063 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20366 tl = tl + hl | 0;
20367 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20368 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20369 tl = tl + xl | 0;
20370 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20371 xl = gl ^ el & (fl ^ gl) | 0;
20372 tl = tl + xl | 0;
20373 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20374 hl = gl;
20375 hh = gh;
20376 gl = fl;
20377 gh = fh;
20378 fl = el;
20379 fh = eh;
20380 el = dl + tl | 0;
20381 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20382 dl = cl;
20383 dh = ch;
20384 cl = bl;
20385 ch = bh;
20386 bl = al;
20387 bh = ah;
20388 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20389 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20390 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20391 al = al + xl | 0;
20392 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20393 w7l = w7l + w0l | 0;
20394 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20395 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20396 w7l = w7l + xl | 0;
20397 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20398 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20399 w7l = w7l + xl | 0;
20400 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20401 tl = 3602036899 + w7l | 0;
20402 th = 1747873779 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20403 tl = tl + hl | 0;
20404 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20405 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20406 tl = tl + xl | 0;
20407 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20408 xl = gl ^ el & (fl ^ gl) | 0;
20409 tl = tl + xl | 0;
20410 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20411 hl = gl;
20412 hh = gh;
20413 gl = fl;
20414 gh = fh;
20415 fl = el;
20416 fh = eh;
20417 el = dl + tl | 0;
20418 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20419 dl = cl;
20420 dh = ch;
20421 cl = bl;
20422 ch = bh;
20423 bl = al;
20424 bh = ah;
20425 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20426 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20427 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20428 al = al + xl | 0;
20429 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20430 w8l = w8l + w1l | 0;
20431 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20432 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
20433 w8l = w8l + xl | 0;
20434 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20435 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
20436 w8l = w8l + xl | 0;
20437 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20438 tl = 1575990012 + w8l | 0;
20439 th = 1955562222 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20440 tl = tl + hl | 0;
20441 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20442 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20443 tl = tl + xl | 0;
20444 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20445 xl = gl ^ el & (fl ^ gl) | 0;
20446 tl = tl + xl | 0;
20447 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20448 hl = gl;
20449 hh = gh;
20450 gl = fl;
20451 gh = fh;
20452 fl = el;
20453 fh = eh;
20454 el = dl + tl | 0;
20455 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20456 dl = cl;
20457 dh = ch;
20458 cl = bl;
20459 ch = bh;
20460 bl = al;
20461 bh = ah;
20462 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20463 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20464 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20465 al = al + xl | 0;
20466 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20467 w9l = w9l + w2l | 0;
20468 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20469 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
20470 w9l = w9l + xl | 0;
20471 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20472 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
20473 w9l = w9l + xl | 0;
20474 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20475 tl = 1125592928 + w9l | 0;
20476 th = 2024104815 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20477 tl = tl + hl | 0;
20478 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20479 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20480 tl = tl + xl | 0;
20481 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20482 xl = gl ^ el & (fl ^ gl) | 0;
20483 tl = tl + xl | 0;
20484 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20485 hl = gl;
20486 hh = gh;
20487 gl = fl;
20488 gh = fh;
20489 fl = el;
20490 fh = eh;
20491 el = dl + tl | 0;
20492 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20493 dl = cl;
20494 dh = ch;
20495 cl = bl;
20496 ch = bh;
20497 bl = al;
20498 bh = ah;
20499 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20500 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20501 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20502 al = al + xl | 0;
20503 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20504 w10l = w10l + w3l | 0;
20505 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20506 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
20507 w10l = w10l + xl | 0;
20508 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20509 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
20510 w10l = w10l + xl | 0;
20511 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20512 tl = 2716904306 + w10l | 0;
20513 th = 2227730452 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20514 tl = tl + hl | 0;
20515 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20516 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20517 tl = tl + xl | 0;
20518 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20519 xl = gl ^ el & (fl ^ gl) | 0;
20520 tl = tl + xl | 0;
20521 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20522 hl = gl;
20523 hh = gh;
20524 gl = fl;
20525 gh = fh;
20526 fl = el;
20527 fh = eh;
20528 el = dl + tl | 0;
20529 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20530 dl = cl;
20531 dh = ch;
20532 cl = bl;
20533 ch = bh;
20534 bl = al;
20535 bh = ah;
20536 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20537 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20538 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20539 al = al + xl | 0;
20540 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20541 w11l = w11l + w4l | 0;
20542 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20543 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
20544 w11l = w11l + xl | 0;
20545 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20546 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
20547 w11l = w11l + xl | 0;
20548 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20549 tl = 442776044 + w11l | 0;
20550 th = 2361852424 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20551 tl = tl + hl | 0;
20552 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20553 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20554 tl = tl + xl | 0;
20555 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20556 xl = gl ^ el & (fl ^ gl) | 0;
20557 tl = tl + xl | 0;
20558 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20559 hl = gl;
20560 hh = gh;
20561 gl = fl;
20562 gh = fh;
20563 fl = el;
20564 fh = eh;
20565 el = dl + tl | 0;
20566 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20567 dl = cl;
20568 dh = ch;
20569 cl = bl;
20570 ch = bh;
20571 bl = al;
20572 bh = ah;
20573 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20574 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20575 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20576 al = al + xl | 0;
20577 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20578 w12l = w12l + w5l | 0;
20579 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20580 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
20581 w12l = w12l + xl | 0;
20582 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20583 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
20584 w12l = w12l + xl | 0;
20585 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20586 tl = 593698344 + w12l | 0;
20587 th = 2428436474 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20588 tl = tl + hl | 0;
20589 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20590 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20591 tl = tl + xl | 0;
20592 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20593 xl = gl ^ el & (fl ^ gl) | 0;
20594 tl = tl + xl | 0;
20595 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20596 hl = gl;
20597 hh = gh;
20598 gl = fl;
20599 gh = fh;
20600 fl = el;
20601 fh = eh;
20602 el = dl + tl | 0;
20603 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20604 dl = cl;
20605 dh = ch;
20606 cl = bl;
20607 ch = bh;
20608 bl = al;
20609 bh = ah;
20610 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20611 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20612 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20613 al = al + xl | 0;
20614 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20615 w13l = w13l + w6l | 0;
20616 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20617 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
20618 w13l = w13l + xl | 0;
20619 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20620 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
20621 w13l = w13l + xl | 0;
20622 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20623 tl = 3733110249 + w13l | 0;
20624 th = 2756734187 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20625 tl = tl + hl | 0;
20626 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20627 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20628 tl = tl + xl | 0;
20629 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20630 xl = gl ^ el & (fl ^ gl) | 0;
20631 tl = tl + xl | 0;
20632 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20633 hl = gl;
20634 hh = gh;
20635 gl = fl;
20636 gh = fh;
20637 fl = el;
20638 fh = eh;
20639 el = dl + tl | 0;
20640 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20641 dl = cl;
20642 dh = ch;
20643 cl = bl;
20644 ch = bh;
20645 bl = al;
20646 bh = ah;
20647 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20648 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20649 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20650 al = al + xl | 0;
20651 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20652 w14l = w14l + w7l | 0;
20653 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20654 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
20655 w14l = w14l + xl | 0;
20656 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20657 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
20658 w14l = w14l + xl | 0;
20659 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20660 tl = 2999351573 + w14l | 0;
20661 th = 3204031479 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20662 tl = tl + hl | 0;
20663 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20664 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20665 tl = tl + xl | 0;
20666 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20667 xl = gl ^ el & (fl ^ gl) | 0;
20668 tl = tl + xl | 0;
20669 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20670 hl = gl;
20671 hh = gh;
20672 gl = fl;
20673 gh = fh;
20674 fl = el;
20675 fh = eh;
20676 el = dl + tl | 0;
20677 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20678 dl = cl;
20679 dh = ch;
20680 cl = bl;
20681 ch = bh;
20682 bl = al;
20683 bh = ah;
20684 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20685 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20686 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20687 al = al + xl | 0;
20688 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20689 w15l = w15l + w8l | 0;
20690 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20691 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20692 w15l = w15l + xl | 0;
20693 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20694 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20695 w15l = w15l + xl | 0;
20696 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20697 tl = 3815920427 + w15l | 0;
20698 th = 3329325298 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20699 tl = tl + hl | 0;
20700 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20701 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20702 tl = tl + xl | 0;
20703 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20704 xl = gl ^ el & (fl ^ gl) | 0;
20705 tl = tl + xl | 0;
20706 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20707 hl = gl;
20708 hh = gh;
20709 gl = fl;
20710 gh = fh;
20711 fl = el;
20712 fh = eh;
20713 el = dl + tl | 0;
20714 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20715 dl = cl;
20716 dh = ch;
20717 cl = bl;
20718 ch = bh;
20719 bl = al;
20720 bh = ah;
20721 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20722 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20723 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20724 al = al + xl | 0;
20725 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20726 w0l = w0l + w9l | 0;
20727 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20728 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20729 w0l = w0l + xl | 0;
20730 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20731 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20732 w0l = w0l + xl | 0;
20733 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20734 tl = 3928383900 + w0l | 0;
20735 th = 3391569614 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20736 tl = tl + hl | 0;
20737 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20738 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20739 tl = tl + xl | 0;
20740 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20741 xl = gl ^ el & (fl ^ gl) | 0;
20742 tl = tl + xl | 0;
20743 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20744 hl = gl;
20745 hh = gh;
20746 gl = fl;
20747 gh = fh;
20748 fl = el;
20749 fh = eh;
20750 el = dl + tl | 0;
20751 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20752 dl = cl;
20753 dh = ch;
20754 cl = bl;
20755 ch = bh;
20756 bl = al;
20757 bh = ah;
20758 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20759 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20760 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20761 al = al + xl | 0;
20762 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20763 w1l = w1l + w10l | 0;
20764 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20765 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20766 w1l = w1l + xl | 0;
20767 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20768 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20769 w1l = w1l + xl | 0;
20770 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20771 tl = 566280711 + w1l | 0;
20772 th = 3515267271 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20773 tl = tl + hl | 0;
20774 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20775 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20776 tl = tl + xl | 0;
20777 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20778 xl = gl ^ el & (fl ^ gl) | 0;
20779 tl = tl + xl | 0;
20780 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20781 hl = gl;
20782 hh = gh;
20783 gl = fl;
20784 gh = fh;
20785 fl = el;
20786 fh = eh;
20787 el = dl + tl | 0;
20788 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20789 dl = cl;
20790 dh = ch;
20791 cl = bl;
20792 ch = bh;
20793 bl = al;
20794 bh = ah;
20795 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20796 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20797 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20798 al = al + xl | 0;
20799 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20800 w2l = w2l + w11l | 0;
20801 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20802 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20803 w2l = w2l + xl | 0;
20804 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20805 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20806 w2l = w2l + xl | 0;
20807 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20808 tl = 3454069534 + w2l | 0;
20809 th = 3940187606 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20810 tl = tl + hl | 0;
20811 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20812 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20813 tl = tl + xl | 0;
20814 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20815 xl = gl ^ el & (fl ^ gl) | 0;
20816 tl = tl + xl | 0;
20817 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20818 hl = gl;
20819 hh = gh;
20820 gl = fl;
20821 gh = fh;
20822 fl = el;
20823 fh = eh;
20824 el = dl + tl | 0;
20825 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20826 dl = cl;
20827 dh = ch;
20828 cl = bl;
20829 ch = bh;
20830 bl = al;
20831 bh = ah;
20832 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20833 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20834 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20835 al = al + xl | 0;
20836 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20837 w3l = w3l + w12l | 0;
20838 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20839 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20840 w3l = w3l + xl | 0;
20841 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20842 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20843 w3l = w3l + xl | 0;
20844 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20845 tl = 4000239992 + w3l | 0;
20846 th = 4118630271 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20847 tl = tl + hl | 0;
20848 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20849 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20850 tl = tl + xl | 0;
20851 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20852 xl = gl ^ el & (fl ^ gl) | 0;
20853 tl = tl + xl | 0;
20854 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20855 hl = gl;
20856 hh = gh;
20857 gl = fl;
20858 gh = fh;
20859 fl = el;
20860 fh = eh;
20861 el = dl + tl | 0;
20862 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20863 dl = cl;
20864 dh = ch;
20865 cl = bl;
20866 ch = bh;
20867 bl = al;
20868 bh = ah;
20869 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20870 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20871 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20872 al = al + xl | 0;
20873 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20874 w4l = w4l + w13l | 0;
20875 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20876 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20877 w4l = w4l + xl | 0;
20878 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20879 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20880 w4l = w4l + xl | 0;
20881 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20882 tl = 1914138554 + w4l | 0;
20883 th = 116418474 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20884 tl = tl + hl | 0;
20885 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20886 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20887 tl = tl + xl | 0;
20888 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20889 xl = gl ^ el & (fl ^ gl) | 0;
20890 tl = tl + xl | 0;
20891 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20892 hl = gl;
20893 hh = gh;
20894 gl = fl;
20895 gh = fh;
20896 fl = el;
20897 fh = eh;
20898 el = dl + tl | 0;
20899 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20900 dl = cl;
20901 dh = ch;
20902 cl = bl;
20903 ch = bh;
20904 bl = al;
20905 bh = ah;
20906 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20907 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20908 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20909 al = al + xl | 0;
20910 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20911 w5l = w5l + w14l | 0;
20912 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20913 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20914 w5l = w5l + xl | 0;
20915 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20916 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20917 w5l = w5l + xl | 0;
20918 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20919 tl = 2731055270 + w5l | 0;
20920 th = 174292421 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20921 tl = tl + hl | 0;
20922 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20923 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20924 tl = tl + xl | 0;
20925 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20926 xl = gl ^ el & (fl ^ gl) | 0;
20927 tl = tl + xl | 0;
20928 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20929 hl = gl;
20930 hh = gh;
20931 gl = fl;
20932 gh = fh;
20933 fl = el;
20934 fh = eh;
20935 el = dl + tl | 0;
20936 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20937 dl = cl;
20938 dh = ch;
20939 cl = bl;
20940 ch = bh;
20941 bl = al;
20942 bh = ah;
20943 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20944 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20945 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20946 al = al + xl | 0;
20947 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20948 w6l = w6l + w15l | 0;
20949 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20950 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20951 w6l = w6l + xl | 0;
20952 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20953 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20954 w6l = w6l + xl | 0;
20955 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20956 tl = 3203993006 + w6l | 0;
20957 th = 289380356 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20958 tl = tl + hl | 0;
20959 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20960 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20961 tl = tl + xl | 0;
20962 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20963 xl = gl ^ el & (fl ^ gl) | 0;
20964 tl = tl + xl | 0;
20965 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20966 hl = gl;
20967 hh = gh;
20968 gl = fl;
20969 gh = fh;
20970 fl = el;
20971 fh = eh;
20972 el = dl + tl | 0;
20973 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20974 dl = cl;
20975 dh = ch;
20976 cl = bl;
20977 ch = bh;
20978 bl = al;
20979 bh = ah;
20980 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20981 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20982 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20983 al = al + xl | 0;
20984 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20985 w7l = w7l + w0l | 0;
20986 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20987 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20988 w7l = w7l + xl | 0;
20989 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20990 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20991 w7l = w7l + xl | 0;
20992 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20993 tl = 320620315 + w7l | 0;
20994 th = 460393269 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20995 tl = tl + hl | 0;
20996 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20997 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20998 tl = tl + xl | 0;
20999 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21000 xl = gl ^ el & (fl ^ gl) | 0;
21001 tl = tl + xl | 0;
21002 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21003 hl = gl;
21004 hh = gh;
21005 gl = fl;
21006 gh = fh;
21007 fl = el;
21008 fh = eh;
21009 el = dl + tl | 0;
21010 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21011 dl = cl;
21012 dh = ch;
21013 cl = bl;
21014 ch = bh;
21015 bl = al;
21016 bh = ah;
21017 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21018 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21019 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21020 al = al + xl | 0;
21021 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21022 w8l = w8l + w1l | 0;
21023 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
21024 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
21025 w8l = w8l + xl | 0;
21026 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21027 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
21028 w8l = w8l + xl | 0;
21029 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21030 tl = 587496836 + w8l | 0;
21031 th = 685471733 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
21032 tl = tl + hl | 0;
21033 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21034 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21035 tl = tl + xl | 0;
21036 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21037 xl = gl ^ el & (fl ^ gl) | 0;
21038 tl = tl + xl | 0;
21039 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21040 hl = gl;
21041 hh = gh;
21042 gl = fl;
21043 gh = fh;
21044 fl = el;
21045 fh = eh;
21046 el = dl + tl | 0;
21047 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21048 dl = cl;
21049 dh = ch;
21050 cl = bl;
21051 ch = bh;
21052 bl = al;
21053 bh = ah;
21054 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21055 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21056 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21057 al = al + xl | 0;
21058 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21059 w9l = w9l + w2l | 0;
21060 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
21061 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
21062 w9l = w9l + xl | 0;
21063 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21064 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
21065 w9l = w9l + xl | 0;
21066 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21067 tl = 1086792851 + w9l | 0;
21068 th = 852142971 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
21069 tl = tl + hl | 0;
21070 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21071 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21072 tl = tl + xl | 0;
21073 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21074 xl = gl ^ el & (fl ^ gl) | 0;
21075 tl = tl + xl | 0;
21076 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21077 hl = gl;
21078 hh = gh;
21079 gl = fl;
21080 gh = fh;
21081 fl = el;
21082 fh = eh;
21083 el = dl + tl | 0;
21084 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21085 dl = cl;
21086 dh = ch;
21087 cl = bl;
21088 ch = bh;
21089 bl = al;
21090 bh = ah;
21091 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21092 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21093 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21094 al = al + xl | 0;
21095 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21096 w10l = w10l + w3l | 0;
21097 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
21098 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
21099 w10l = w10l + xl | 0;
21100 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21101 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
21102 w10l = w10l + xl | 0;
21103 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21104 tl = 365543100 + w10l | 0;
21105 th = 1017036298 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
21106 tl = tl + hl | 0;
21107 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21108 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21109 tl = tl + xl | 0;
21110 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21111 xl = gl ^ el & (fl ^ gl) | 0;
21112 tl = tl + xl | 0;
21113 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21114 hl = gl;
21115 hh = gh;
21116 gl = fl;
21117 gh = fh;
21118 fl = el;
21119 fh = eh;
21120 el = dl + tl | 0;
21121 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21122 dl = cl;
21123 dh = ch;
21124 cl = bl;
21125 ch = bh;
21126 bl = al;
21127 bh = ah;
21128 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21129 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21130 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21131 al = al + xl | 0;
21132 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21133 w11l = w11l + w4l | 0;
21134 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
21135 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
21136 w11l = w11l + xl | 0;
21137 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21138 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
21139 w11l = w11l + xl | 0;
21140 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21141 tl = 2618297676 + w11l | 0;
21142 th = 1126000580 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
21143 tl = tl + hl | 0;
21144 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21145 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21146 tl = tl + xl | 0;
21147 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21148 xl = gl ^ el & (fl ^ gl) | 0;
21149 tl = tl + xl | 0;
21150 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21151 hl = gl;
21152 hh = gh;
21153 gl = fl;
21154 gh = fh;
21155 fl = el;
21156 fh = eh;
21157 el = dl + tl | 0;
21158 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21159 dl = cl;
21160 dh = ch;
21161 cl = bl;
21162 ch = bh;
21163 bl = al;
21164 bh = ah;
21165 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21166 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21167 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21168 al = al + xl | 0;
21169 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21170 w12l = w12l + w5l | 0;
21171 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
21172 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
21173 w12l = w12l + xl | 0;
21174 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21175 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
21176 w12l = w12l + xl | 0;
21177 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21178 tl = 3409855158 + w12l | 0;
21179 th = 1288033470 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
21180 tl = tl + hl | 0;
21181 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21182 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21183 tl = tl + xl | 0;
21184 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21185 xl = gl ^ el & (fl ^ gl) | 0;
21186 tl = tl + xl | 0;
21187 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21188 hl = gl;
21189 hh = gh;
21190 gl = fl;
21191 gh = fh;
21192 fl = el;
21193 fh = eh;
21194 el = dl + tl | 0;
21195 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21196 dl = cl;
21197 dh = ch;
21198 cl = bl;
21199 ch = bh;
21200 bl = al;
21201 bh = ah;
21202 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21203 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21204 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21205 al = al + xl | 0;
21206 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21207 w13l = w13l + w6l | 0;
21208 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
21209 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
21210 w13l = w13l + xl | 0;
21211 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21212 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
21213 w13l = w13l + xl | 0;
21214 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21215 tl = 4234509866 + w13l | 0;
21216 th = 1501505948 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
21217 tl = tl + hl | 0;
21218 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21219 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21220 tl = tl + xl | 0;
21221 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21222 xl = gl ^ el & (fl ^ gl) | 0;
21223 tl = tl + xl | 0;
21224 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21225 hl = gl;
21226 hh = gh;
21227 gl = fl;
21228 gh = fh;
21229 fl = el;
21230 fh = eh;
21231 el = dl + tl | 0;
21232 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21233 dl = cl;
21234 dh = ch;
21235 cl = bl;
21236 ch = bh;
21237 bl = al;
21238 bh = ah;
21239 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21240 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21241 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21242 al = al + xl | 0;
21243 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21244 w14l = w14l + w7l | 0;
21245 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
21246 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
21247 w14l = w14l + xl | 0;
21248 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21249 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
21250 w14l = w14l + xl | 0;
21251 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21252 tl = 987167468 + w14l | 0;
21253 th = 1607167915 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
21254 tl = tl + hl | 0;
21255 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21256 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21257 tl = tl + xl | 0;
21258 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21259 xl = gl ^ el & (fl ^ gl) | 0;
21260 tl = tl + xl | 0;
21261 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21262 hl = gl;
21263 hh = gh;
21264 gl = fl;
21265 gh = fh;
21266 fl = el;
21267 fh = eh;
21268 el = dl + tl | 0;
21269 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21270 dl = cl;
21271 dh = ch;
21272 cl = bl;
21273 ch = bh;
21274 bl = al;
21275 bh = ah;
21276 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21277 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21278 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21279 al = al + xl | 0;
21280 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21281 w15l = w15l + w8l | 0;
21282 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
21283 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
21284 w15l = w15l + xl | 0;
21285 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21286 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
21287 w15l = w15l + xl | 0;
21288 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21289 tl = 1246189591 + w15l | 0;
21290 th = 1816402316 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
21291 tl = tl + hl | 0;
21292 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21293 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21294 tl = tl + xl | 0;
21295 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21296 xl = gl ^ el & (fl ^ gl) | 0;
21297 tl = tl + xl | 0;
21298 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21299 hl = gl;
21300 hh = gh;
21301 gl = fl;
21302 gh = fh;
21303 fl = el;
21304 fh = eh;
21305 el = dl + tl | 0;
21306 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21307 dl = cl;
21308 dh = ch;
21309 cl = bl;
21310 ch = bh;
21311 bl = al;
21312 bh = ah;
21313 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21314 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21315 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21316 al = al + xl | 0;
21317 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21318 H0l = H0l + al | 0;
21319 H0h = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0) | 0;
21320 H1l = H1l + bl | 0;
21321 H1h = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0) | 0;
21322 H2l = H2l + cl | 0;
21323 H2h = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0) | 0;
21324 H3l = H3l + dl | 0;
21325 H3h = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21326 H4l = H4l + el | 0;
21327 H4h = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0) | 0;
21328 H5l = H5l + fl | 0;
21329 H5h = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0) | 0;
21330 H6l = H6l + gl | 0;
21331 H6h = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0) | 0;
21332 H7l = H7l + hl | 0;
21333 H7h = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21334 }
21335 function _core_heap(offset) {
21336 offset = offset | 0;
21337 _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]);
21338 }
21339 function _state_to_heap(output) {
21340 output = output | 0;
21341 HEAP[output | 0] = H0h >>> 24;
21342 HEAP[output | 1] = H0h >>> 16 & 255;
21343 HEAP[output | 2] = H0h >>> 8 & 255;
21344 HEAP[output | 3] = H0h & 255;
21345 HEAP[output | 4] = H0l >>> 24;
21346 HEAP[output | 5] = H0l >>> 16 & 255;
21347 HEAP[output | 6] = H0l >>> 8 & 255;
21348 HEAP[output | 7] = H0l & 255;
21349 HEAP[output | 8] = H1h >>> 24;
21350 HEAP[output | 9] = H1h >>> 16 & 255;
21351 HEAP[output | 10] = H1h >>> 8 & 255;
21352 HEAP[output | 11] = H1h & 255;
21353 HEAP[output | 12] = H1l >>> 24;
21354 HEAP[output | 13] = H1l >>> 16 & 255;
21355 HEAP[output | 14] = H1l >>> 8 & 255;
21356 HEAP[output | 15] = H1l & 255;
21357 HEAP[output | 16] = H2h >>> 24;
21358 HEAP[output | 17] = H2h >>> 16 & 255;
21359 HEAP[output | 18] = H2h >>> 8 & 255;
21360 HEAP[output | 19] = H2h & 255;
21361 HEAP[output | 20] = H2l >>> 24;
21362 HEAP[output | 21] = H2l >>> 16 & 255;
21363 HEAP[output | 22] = H2l >>> 8 & 255;
21364 HEAP[output | 23] = H2l & 255;
21365 HEAP[output | 24] = H3h >>> 24;
21366 HEAP[output | 25] = H3h >>> 16 & 255;
21367 HEAP[output | 26] = H3h >>> 8 & 255;
21368 HEAP[output | 27] = H3h & 255;
21369 HEAP[output | 28] = H3l >>> 24;
21370 HEAP[output | 29] = H3l >>> 16 & 255;
21371 HEAP[output | 30] = H3l >>> 8 & 255;
21372 HEAP[output | 31] = H3l & 255;
21373 HEAP[output | 32] = H4h >>> 24;
21374 HEAP[output | 33] = H4h >>> 16 & 255;
21375 HEAP[output | 34] = H4h >>> 8 & 255;
21376 HEAP[output | 35] = H4h & 255;
21377 HEAP[output | 36] = H4l >>> 24;
21378 HEAP[output | 37] = H4l >>> 16 & 255;
21379 HEAP[output | 38] = H4l >>> 8 & 255;
21380 HEAP[output | 39] = H4l & 255;
21381 HEAP[output | 40] = H5h >>> 24;
21382 HEAP[output | 41] = H5h >>> 16 & 255;
21383 HEAP[output | 42] = H5h >>> 8 & 255;
21384 HEAP[output | 43] = H5h & 255;
21385 HEAP[output | 44] = H5l >>> 24;
21386 HEAP[output | 45] = H5l >>> 16 & 255;
21387 HEAP[output | 46] = H5l >>> 8 & 255;
21388 HEAP[output | 47] = H5l & 255;
21389 HEAP[output | 48] = H6h >>> 24;
21390 HEAP[output | 49] = H6h >>> 16 & 255;
21391 HEAP[output | 50] = H6h >>> 8 & 255;
21392 HEAP[output | 51] = H6h & 255;
21393 HEAP[output | 52] = H6l >>> 24;
21394 HEAP[output | 53] = H6l >>> 16 & 255;
21395 HEAP[output | 54] = H6l >>> 8 & 255;
21396 HEAP[output | 55] = H6l & 255;
21397 HEAP[output | 56] = H7h >>> 24;
21398 HEAP[output | 57] = H7h >>> 16 & 255;
21399 HEAP[output | 58] = H7h >>> 8 & 255;
21400 HEAP[output | 59] = H7h & 255;
21401 HEAP[output | 60] = H7l >>> 24;
21402 HEAP[output | 61] = H7l >>> 16 & 255;
21403 HEAP[output | 62] = H7l >>> 8 & 255;
21404 HEAP[output | 63] = H7l & 255;
21405 }
21406 function reset() {
21407 H0h = 1779033703;
21408 H0l = 4089235720;
21409 H1h = 3144134277;
21410 H1l = 2227873595;
21411 H2h = 1013904242;
21412 H2l = 4271175723;
21413 H3h = 2773480762;
21414 H3l = 1595750129;
21415 H4h = 1359893119;
21416 H4l = 2917565137;
21417 H5h = 2600822924;
21418 H5l = 725511199;
21419 H6h = 528734635;
21420 H6l = 4215389547;
21421 H7h = 1541459225;
21422 H7l = 327033209;
21423 TOTAL = 0;
21424 }
21425 function init(h0h, h0l, h1h, h1l, h2h, h2l, h3h, h3l, h4h, h4l, h5h, h5l, h6h, h6l, h7h, h7l, total) {
21426 h0h = h0h | 0;
21427 h0l = h0l | 0;
21428 h1h = h1h | 0;
21429 h1l = h1l | 0;
21430 h2h = h2h | 0;
21431 h2l = h2l | 0;
21432 h3h = h3h | 0;
21433 h3l = h3l | 0;
21434 h4h = h4h | 0;
21435 h4l = h4l | 0;
21436 h5h = h5h | 0;
21437 h5l = h5l | 0;
21438 h6h = h6h | 0;
21439 h6l = h6l | 0;
21440 h7h = h7h | 0;
21441 h7l = h7l | 0;
21442 total = total | 0;
21443 H0h = h0h;
21444 H0l = h0l;
21445 H1h = h1h;
21446 H1l = h1l;
21447 H2h = h2h;
21448 H2l = h2l;
21449 H3h = h3h;
21450 H3l = h3l;
21451 H4h = h4h;
21452 H4l = h4l;
21453 H5h = h5h;
21454 H5l = h5l;
21455 H6h = h6h;
21456 H6l = h6l;
21457 H7h = h7h;
21458 H7l = h7l;
21459 TOTAL = total;
21460 }
21461 function process(offset, length) {
21462 offset = offset | 0;
21463 length = length | 0;
21464 var hashed = 0;
21465 if (offset & 127) return -1;
21466 while ((length | 0) >= 128) {
21467 _core_heap(offset);
21468 offset = offset + 128 | 0;
21469 length = length - 128 | 0;
21470 hashed = hashed + 128 | 0;
21471 }
21472 TOTAL = TOTAL + hashed | 0;
21473 return hashed | 0;
21474 }
21475 function finish(offset, length, output) {
21476 offset = offset | 0;
21477 length = length | 0;
21478 output = output | 0;
21479 var hashed = 0, i = 0;
21480 if (offset & 127) return -1;
21481 if (~output) if (output & 63) return -1;
21482 if ((length | 0) >= 128) {
21483 hashed = process(offset, length) | 0;
21484 if ((hashed | 0) == -1) return -1;
21485 offset = offset + hashed | 0;
21486 length = length - hashed | 0;
21487 }
21488 hashed = hashed + length | 0;
21489 TOTAL = TOTAL + length | 0;
21490 HEAP[offset | length] = 128;
21491 if ((length | 0) >= 112) {
21492 for (i = length + 1 | 0; (i | 0) < 128; i = i + 1 | 0) HEAP[offset | i] = 0;
21493 _core_heap(offset);
21494 length = 0;
21495 HEAP[offset | 0] = 0;
21496 }
21497 for (i = length + 1 | 0; (i | 0) < 123; i = i + 1 | 0) HEAP[offset | i] = 0;
21498 HEAP[offset | 123] = TOTAL >>> 29;
21499 HEAP[offset | 124] = TOTAL >>> 21 & 255;
21500 HEAP[offset | 125] = TOTAL >>> 13 & 255;
21501 HEAP[offset | 126] = TOTAL >>> 5 & 255;
21502 HEAP[offset | 127] = TOTAL << 3 & 255;
21503 _core_heap(offset);
21504 if (~output) _state_to_heap(output);
21505 return hashed | 0;
21506 }
21507 function hmac_reset() {
21508 H0h = I0h;
21509 H0l = I0l;
21510 H1h = I1h;
21511 H1l = I1l;
21512 H2h = I2h;
21513 H2l = I2l;
21514 H3h = I3h;
21515 H3l = I3l;
21516 H4h = I4h;
21517 H4l = I4l;
21518 H5h = I5h;
21519 H5l = I5l;
21520 H6h = I6h;
21521 H6l = I6l;
21522 H7h = I7h;
21523 H7l = I7l;
21524 TOTAL = 128;
21525 }
21526 function _hmac_opad() {
21527 H0h = O0h;
21528 H0l = O0l;
21529 H1h = O1h;
21530 H1l = O1l;
21531 H2h = O2h;
21532 H2l = O2l;
21533 H3h = O3h;
21534 H3l = O3l;
21535 H4h = O4h;
21536 H4l = O4l;
21537 H5h = O5h;
21538 H5l = O5l;
21539 H6h = O6h;
21540 H6l = O6l;
21541 H7h = O7h;
21542 H7l = O7l;
21543 TOTAL = 128;
21544 }
21545 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) {
21546 p0h = p0h | 0;
21547 p0l = p0l | 0;
21548 p1h = p1h | 0;
21549 p1l = p1l | 0;
21550 p2h = p2h | 0;
21551 p2l = p2l | 0;
21552 p3h = p3h | 0;
21553 p3l = p3l | 0;
21554 p4h = p4h | 0;
21555 p4l = p4l | 0;
21556 p5h = p5h | 0;
21557 p5l = p5l | 0;
21558 p6h = p6h | 0;
21559 p6l = p6l | 0;
21560 p7h = p7h | 0;
21561 p7l = p7l | 0;
21562 p8h = p8h | 0;
21563 p8l = p8l | 0;
21564 p9h = p9h | 0;
21565 p9l = p9l | 0;
21566 p10h = p10h | 0;
21567 p10l = p10l | 0;
21568 p11h = p11h | 0;
21569 p11l = p11l | 0;
21570 p12h = p12h | 0;
21571 p12l = p12l | 0;
21572 p13h = p13h | 0;
21573 p13l = p13l | 0;
21574 p14h = p14h | 0;
21575 p14l = p14l | 0;
21576 p15h = p15h | 0;
21577 p15l = p15l | 0;
21578 reset();
21579 _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);
21580 O0h = H0h;
21581 O0l = H0l;
21582 O1h = H1h;
21583 O1l = H1l;
21584 O2h = H2h;
21585 O2l = H2l;
21586 O3h = H3h;
21587 O3l = H3l;
21588 O4h = H4h;
21589 O4l = H4l;
21590 O5h = H5h;
21591 O5l = H5l;
21592 O6h = H6h;
21593 O6l = H6l;
21594 O7h = H7h;
21595 O7l = H7l;
21596 reset();
21597 _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);
21598 I0h = H0h;
21599 I0l = H0l;
21600 I1h = H1h;
21601 I1l = H1l;
21602 I2h = H2h;
21603 I2l = H2l;
21604 I3h = H3h;
21605 I3l = H3l;
21606 I4h = H4h;
21607 I4l = H4l;
21608 I5h = H5h;
21609 I5l = H5l;
21610 I6h = H6h;
21611 I6l = H6l;
21612 I7h = H7h;
21613 I7l = H7l;
21614 TOTAL = 128;
21615 }
21616 function hmac_finish(offset, length, output) {
21617 offset = offset | 0;
21618 length = length | 0;
21619 output = output | 0;
21620 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;
21621 if (offset & 127) return -1;
21622 if (~output) if (output & 63) return -1;
21623 hashed = finish(offset, length, -1) | 0;
21624 t0h = H0h;
21625 t0l = H0l;
21626 t1h = H1h;
21627 t1l = H1l;
21628 t2h = H2h;
21629 t2l = H2l;
21630 t3h = H3h;
21631 t3l = H3l;
21632 t4h = H4h;
21633 t4l = H4l;
21634 t5h = H5h;
21635 t5l = H5l;
21636 t6h = H6h;
21637 t6l = H6l;
21638 t7h = H7h;
21639 t7l = H7l;
21640 _hmac_opad();
21641 _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);
21642 if (~output) _state_to_heap(output);
21643 return hashed | 0;
21644 }
21645 function pbkdf2_generate_block(offset, length, block, count, output) {
21646 offset = offset | 0;
21647 length = length | 0;
21648 block = block | 0;
21649 count = count | 0;
21650 output = output | 0;
21651 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;
21652 if (offset & 127) return -1;
21653 if (~output) if (output & 63) return -1;
21654 HEAP[offset + length | 0] = block >>> 24;
21655 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
21656 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
21657 HEAP[offset + length + 3 | 0] = block & 255;
21658 // Closure compiler warning - The result of the 'bitor' operator is not being used
21659 //hmac_finish(offset, length + 4 | 0, -1) | 0;
21660 hmac_finish(offset, length + 4 | 0, -1);
21661 h0h = t0h = H0h;
21662 h0l = t0l = H0l;
21663 h1h = t1h = H1h;
21664 h1l = t1l = H1l;
21665 h2h = t2h = H2h;
21666 h2l = t2l = H2l;
21667 h3h = t3h = H3h;
21668 h3l = t3l = H3l;
21669 h4h = t4h = H4h;
21670 h4l = t4l = H4l;
21671 h5h = t5h = H5h;
21672 h5l = t5l = H5l;
21673 h6h = t6h = H6h;
21674 h6l = t6l = H6l;
21675 h7h = t7h = H7h;
21676 h7l = t7l = H7l;
21677 count = count - 1 | 0;
21678 while ((count | 0) > 0) {
21679 hmac_reset();
21680 _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);
21681 t0h = H0h;
21682 t0l = H0l;
21683 t1h = H1h;
21684 t1l = H1l;
21685 t2h = H2h;
21686 t2l = H2l;
21687 t3h = H3h;
21688 t3l = H3l;
21689 t4h = H4h;
21690 t4l = H4l;
21691 t5h = H5h;
21692 t5l = H5l;
21693 t6h = H6h;
21694 t6l = H6l;
21695 t7h = H7h;
21696 t7l = H7l;
21697 _hmac_opad();
21698 _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);
21699 t0h = H0h;
21700 t0l = H0l;
21701 t1h = H1h;
21702 t1l = H1l;
21703 t2h = H2h;
21704 t2l = H2l;
21705 t3h = H3h;
21706 t3l = H3l;
21707 t4h = H4h;
21708 t4l = H4l;
21709 t5h = H5h;
21710 t5l = H5l;
21711 t6h = H6h;
21712 t6l = H6l;
21713 t7h = H7h;
21714 t7l = H7l;
21715 h0h = h0h ^ H0h;
21716 h0l = h0l ^ H0l;
21717 h1h = h1h ^ H1h;
21718 h1l = h1l ^ H1l;
21719 h2h = h2h ^ H2h;
21720 h2l = h2l ^ H2l;
21721 h3h = h3h ^ H3h;
21722 h3l = h3l ^ H3l;
21723 h4h = h4h ^ H4h;
21724 h4l = h4l ^ H4l;
21725 h5h = h5h ^ H5h;
21726 h5l = h5l ^ H5l;
21727 h6h = h6h ^ H6h;
21728 h6l = h6l ^ H6l;
21729 h7h = h7h ^ H7h;
21730 h7l = h7l ^ H7l;
21731 count = count - 1 | 0;
21732 }
21733 H0h = h0h;
21734 H0l = h0l;
21735 H1h = h1h;
21736 H1l = h1l;
21737 H2h = h2h;
21738 H2l = h2l;
21739 H3h = h3h;
21740 H3l = h3l;
21741 H4h = h4h;
21742 H4l = h4l;
21743 H5h = h5h;
21744 H5l = h5l;
21745 H6h = h6h;
21746 H6l = h6l;
21747 H7h = h7h;
21748 H7l = h7l;
21749 if (~output) _state_to_heap(output);
21750 return 0;
21751 }
21752 return {
21753 reset: reset,
21754 init: init,
21755 process: process,
21756 finish: finish,
21757 hmac_reset: hmac_reset,
21758 hmac_init: hmac_init,
21759 hmac_finish: hmac_finish,
21760 pbkdf2_generate_block: pbkdf2_generate_block
21761 };
21762 }
21763 var _sha512_block_size = 128, _sha512_hash_size = 64;
21764 function sha512_constructor(options) {
21765 options = options || {};
21766 options.heapSize = options.heapSize || 4096;
21767 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
21768 this.heap = options.heap || new Uint8Array(options.heapSize);
21769 this.asm = options.asm || sha512_asm(global, null, this.heap.buffer);
21770 this.BLOCK_SIZE = _sha512_block_size;
21771 this.HASH_SIZE = _sha512_hash_size;
21772 this.reset();
21773 }
21774 function sha512_reset() {
21775 this.result = null;
21776 this.pos = 0;
21777 this.len = 0;
21778 this.asm.reset();
21779 return this;
21780 }
21781 function sha512_process(data) {
21782 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21783 var dpos = 0, dlen = 0, clen = 0;
21784 if (is_buffer(data) || is_bytes(data)) {
21785 dpos = data.byteOffset || 0;
21786 dlen = data.byteLength;
21787 } else if (is_string(data)) {
21788 dlen = data.length;
21789 } else {
21790 throw new TypeError("data isn't of expected type");
21791 }
21792 while (dlen > 0) {
21793 clen = this.heap.byteLength - this.pos - this.len;
21794 clen = clen < dlen ? clen : dlen;
21795 if (is_buffer(data) || is_bytes(data)) {
21796 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
21797 } else {
21798 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
21799 }
21800 this.len += clen;
21801 dpos += clen;
21802 dlen -= clen;
21803 clen = this.asm.process(this.pos, this.len);
21804 if (clen < this.len) {
21805 this.pos += clen;
21806 this.len -= clen;
21807 } else {
21808 this.pos = 0;
21809 this.len = 0;
21810 }
21811 }
21812 return this;
21813 }
21814 function sha512_finish() {
21815 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21816 this.asm.finish(this.pos, this.len, 0);
21817 this.result = new Uint8Array(_sha512_hash_size);
21818 this.result.set(this.heap.subarray(0, _sha512_hash_size));
21819 this.pos = 0;
21820 this.len = 0;
21821 return this;
21822 }
21823 sha512_constructor.BLOCK_SIZE = _sha512_block_size;
21824 sha512_constructor.HASH_SIZE = _sha512_hash_size;
21825 var sha512_prototype = sha512_constructor.prototype;
21826 sha512_prototype.reset = sha512_reset;
21827 sha512_prototype.process = sha512_process;
21828 sha512_prototype.finish = sha512_finish;
21829 function hmac_constructor(options) {
21830 options = options || {};
21831 if (!options.hash) throw new SyntaxError("option 'hash' is required");
21832 if (!options.hash.HASH_SIZE) throw new SyntaxError("option 'hash' supplied doesn't seem to be a valid hash function");
21833 this.hash = options.hash;
21834 this.BLOCK_SIZE = this.hash.BLOCK_SIZE;
21835 this.HMAC_SIZE = this.hash.HASH_SIZE;
21836 this.key = null;
21837 this.verify = null;
21838 this.result = null;
21839 if (options.password !== undefined || options.verify !== undefined) this.reset(options);
21840 return this;
21841 }
21842 function hmac_sha256_constructor(options) {
21843 options = options || {};
21844 if (!(options.hash instanceof sha256_constructor)) options.hash = new sha256_constructor(options);
21845 hmac_constructor.call(this, options);
21846 return this;
21847 }
21848 function hmac_sha512_constructor(options) {
21849 options = options || {};
21850 if (!(options.hash instanceof sha512_constructor)) options.hash = new sha512_constructor(options);
21851 hmac_constructor.call(this, options);
21852 return this;
21853 }
21854 function _hmac_key(hash, password) {
21855 var key;
21856 if (is_buffer(password) || is_bytes(password)) {
21857 key = new Uint8Array(hash.BLOCK_SIZE);
21858 if (password.byteLength > hash.BLOCK_SIZE) {
21859 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21860 } else if (is_buffer(password)) {
21861 key.set(new Uint8Array(password));
21862 } else {
21863 key.set(password);
21864 }
21865 } else if (is_string(password)) {
21866 key = new Uint8Array(hash.BLOCK_SIZE);
21867 if (password.length > hash.BLOCK_SIZE) {
21868 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21869 } else {
21870 for (var i = 0; i < password.length; ++i) key[i] = password.charCodeAt(i);
21871 }
21872 } else {
21873 throw new TypeError("password isn't of expected type");
21874 }
21875 return key;
21876 }
21877 function _hmac_init_verify(verify) {
21878 if (is_buffer(verify) || is_bytes(verify)) {
21879 verify = new Uint8Array(verify);
21880 } else if (is_string(verify)) {
21881 verify = string_to_bytes(verify);
21882 } else {
21883 throw new TypeError("verify tag isn't of expected type");
21884 }
21885 if (verify.length !== this.HMAC_SIZE) throw new IllegalArgumentError("illegal verification tag size");
21886 this.verify = verify;
21887 }
21888 function hmac_reset(options) {
21889 options = options || {};
21890 var password = options.password;
21891 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21892 this.result = null;
21893 this.hash.reset();
21894 if (password || is_string(password)) this.key = _hmac_key(this.hash, password);
21895 var ipad = new Uint8Array(this.key);
21896 for (var i = 0; i < ipad.length; ++i) ipad[i] ^= 54;
21897 this.hash.process(ipad);
21898 var verify = options.verify;
21899 if (verify !== undefined) {
21900 _hmac_init_verify.call(this, verify);
21901 } else {
21902 this.verify = null;
21903 }
21904 return this;
21905 }
21906 function hmac_sha256_reset(options) {
21907 options = options || {};
21908 var password = options.password;
21909 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21910 this.result = null;
21911 this.hash.reset();
21912 if (password || is_string(password)) {
21913 this.key = _hmac_key(this.hash, password);
21914 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]);
21915 } else {
21916 this.hash.asm.hmac_reset();
21917 }
21918 var verify = options.verify;
21919 if (verify !== undefined) {
21920 _hmac_init_verify.call(this, verify);
21921 } else {
21922 this.verify = null;
21923 }
21924 return this;
21925 }
21926 function hmac_sha512_reset(options) {
21927 options = options || {};
21928 var password = options.password;
21929 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21930 this.result = null;
21931 this.hash.reset();
21932 if (password || is_string(password)) {
21933 this.key = _hmac_key(this.hash, password);
21934 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]);
21935 } else {
21936 this.hash.asm.hmac_reset();
21937 }
21938 var verify = options.verify;
21939 if (verify !== undefined) {
21940 _hmac_init_verify.call(this, verify);
21941 } else {
21942 this.verify = null;
21943 }
21944 return this;
21945 }
21946 function hmac_process(data) {
21947 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21948 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21949 this.hash.process(data);
21950 return this;
21951 }
21952 function hmac_finish() {
21953 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21954 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21955 var inner_result = this.hash.finish().result;
21956 var opad = new Uint8Array(this.key);
21957 for (var i = 0; i < opad.length; ++i) opad[i] ^= 92;
21958 var verify = this.verify;
21959 var result = this.hash.reset().process(opad).process(inner_result).finish().result;
21960 if (verify) {
21961 if (verify.length === result.length) {
21962 var diff = 0;
21963 for (var i = 0; i < verify.length; i++) {
21964 diff |= verify[i] ^ result[i];
21965 }
21966 this.result = !diff;
21967 } else {
21968 this.result = false;
21969 }
21970 } else {
21971 this.result = result;
21972 }
21973 return this;
21974 }
21975 function hmac_sha256_finish() {
21976 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21977 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21978 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
21979 asm.hmac_finish(hash.pos, hash.len, 0);
21980 var verify = this.verify;
21981 var result = new Uint8Array(_sha256_hash_size);
21982 result.set(heap.subarray(0, _sha256_hash_size));
21983 if (verify) {
21984 if (verify.length === result.length) {
21985 var diff = 0;
21986 for (var i = 0; i < verify.length; i++) {
21987 diff |= verify[i] ^ result[i];
21988 }
21989 this.result = !diff;
21990 } else {
21991 this.result = false;
21992 }
21993 } else {
21994 this.result = result;
21995 }
21996 return this;
21997 }
21998 function hmac_sha512_finish() {
21999 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
22000 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22001 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
22002 asm.hmac_finish(hash.pos, hash.len, 0);
22003 var verify = this.verify;
22004 var result = new Uint8Array(_sha512_hash_size);
22005 result.set(heap.subarray(0, _sha512_hash_size));
22006 if (verify) {
22007 if (verify.length === result.length) {
22008 var diff = 0;
22009 for (var i = 0; i < verify.length; i++) {
22010 diff |= verify[i] ^ result[i];
22011 }
22012 this.result = !diff;
22013 } else {
22014 this.result = false;
22015 }
22016 } else {
22017 this.result = result;
22018 }
22019 return this;
22020 }
22021 var hmac_prototype = hmac_constructor.prototype;
22022 hmac_prototype.reset = hmac_reset;
22023 hmac_prototype.process = hmac_process;
22024 hmac_prototype.finish = hmac_finish;
22025 hmac_sha256_constructor.BLOCK_SIZE = sha256_constructor.BLOCK_SIZE;
22026 hmac_sha256_constructor.HMAC_SIZE = sha256_constructor.HASH_SIZE;
22027 var hmac_sha256_prototype = hmac_sha256_constructor.prototype;
22028 hmac_sha256_prototype.reset = hmac_sha256_reset;
22029 hmac_sha256_prototype.process = hmac_process;
22030 hmac_sha256_prototype.finish = hmac_sha256_finish;
22031 hmac_sha512_constructor.BLOCK_SIZE = sha512_constructor.BLOCK_SIZE;
22032 hmac_sha512_constructor.HMAC_SIZE = sha512_constructor.HASH_SIZE;
22033 var hmac_sha512_prototype = hmac_sha512_constructor.prototype;
22034 hmac_sha512_prototype.reset = hmac_sha512_reset;
22035 hmac_sha512_prototype.process = hmac_process;
22036 hmac_sha512_prototype.finish = hmac_sha512_finish;
22037 function pbkdf2_constructor(options) {
22038 options = options || {};
22039 if (!options.hmac) throw new SyntaxError("option 'hmac' is required");
22040 if (!options.hmac.HMAC_SIZE) throw new SyntaxError("option 'hmac' supplied doesn't seem to be a valid HMAC function");
22041 this.hmac = options.hmac;
22042 this.count = options.count || 4096;
22043 this.length = options.length || this.hmac.HMAC_SIZE;
22044 this.result = null;
22045 var password = options.password;
22046 if (password || is_string(password)) this.reset(options);
22047 return this;
22048 }
22049 function pbkdf2_hmac_sha256_constructor(options) {
22050 options = options || {};
22051 if (!(options.hmac instanceof hmac_sha256_constructor)) options.hmac = new hmac_sha256_constructor(options);
22052 pbkdf2_constructor.call(this, options);
22053 return this;
22054 }
22055 function pbkdf2_hmac_sha512_constructor(options) {
22056 options = options || {};
22057 if (!(options.hmac instanceof hmac_sha512_constructor)) options.hmac = new hmac_sha512_constructor(options);
22058 pbkdf2_constructor.call(this, options);
22059 return this;
22060 }
22061 function pbkdf2_reset(options) {
22062 this.result = null;
22063 this.hmac.reset(options);
22064 return this;
22065 }
22066 function pbkdf2_generate(salt, count, length) {
22067 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22068 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22069 count = count || this.count;
22070 length = length || this.length;
22071 this.result = new Uint8Array(length);
22072 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22073 for (var i = 1; i <= blocks; ++i) {
22074 var j = (i - 1) * this.hmac.HMAC_SIZE;
22075 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22076 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);
22077 this.result.set(tmp.subarray(0, l), j);
22078 for (var k = 1; k < count; ++k) {
22079 tmp = new Uint8Array(this.hmac.reset().process(tmp).finish().result);
22080 for (var r = 0; r < l; ++r) this.result[j + r] ^= tmp[r];
22081 }
22082 }
22083 return this;
22084 }
22085 function pbkdf2_hmac_sha256_generate(salt, count, length) {
22086 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22087 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22088 count = count || this.count;
22089 length = length || this.length;
22090 this.result = new Uint8Array(length);
22091 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22092 for (var i = 1; i <= blocks; ++i) {
22093 var j = (i - 1) * this.hmac.HMAC_SIZE;
22094 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22095 this.hmac.reset().process(salt);
22096 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22097 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22098 }
22099 return this;
22100 }
22101 function pbkdf2_hmac_sha512_generate(salt, count, length) {
22102 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22103 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22104 count = count || this.count;
22105 length = length || this.length;
22106 this.result = new Uint8Array(length);
22107 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22108 for (var i = 1; i <= blocks; ++i) {
22109 var j = (i - 1) * this.hmac.HMAC_SIZE;
22110 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22111 this.hmac.reset().process(salt);
22112 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22113 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22114 }
22115 return this;
22116 }
22117 var pbkdf2_prototype = pbkdf2_constructor.prototype;
22118 pbkdf2_prototype.reset = pbkdf2_reset;
22119 pbkdf2_prototype.generate = pbkdf2_generate;
22120 var pbkdf2_hmac_sha256_prototype = pbkdf2_hmac_sha256_constructor.prototype;
22121 pbkdf2_hmac_sha256_prototype.reset = pbkdf2_reset;
22122 pbkdf2_hmac_sha256_prototype.generate = pbkdf2_hmac_sha256_generate;
22123 var pbkdf2_hmac_sha512_prototype = pbkdf2_hmac_sha512_constructor.prototype;
22124 pbkdf2_hmac_sha512_prototype.reset = pbkdf2_reset;
22125 pbkdf2_hmac_sha512_prototype.generate = pbkdf2_hmac_sha512_generate;
22126 global.IllegalStateError = IllegalStateError;
22127 global.IllegalArgumentError = IllegalArgumentError;
22128 global.SecurityError = SecurityError;
22129 exports.string_to_bytes = string_to_bytes;
22130 exports.hex_to_bytes = hex_to_bytes;
22131 exports.base64_to_bytes = base64_to_bytes;
22132 exports.bytes_to_string = bytes_to_string;
22133 exports.bytes_to_hex = bytes_to_hex;
22134 exports.bytes_to_base64 = bytes_to_base64;
22135 var SHA256_instance = new sha256_constructor({
22136 heapSize: 1048576
22137 });
22138 function sha256_bytes(data) {
22139 if (data === undefined) throw new SyntaxError("data required");
22140 return SHA256_instance.reset().process(data).finish().result;
22141 }
22142 function sha256_hex(data) {
22143 var result = sha256_bytes(data);
22144 return bytes_to_hex(result);
22145 }
22146 function sha256_base64(data) {
22147 var result = sha256_bytes(data);
22148 return bytes_to_base64(result);
22149 }
22150 exports.SHA256 = {
22151 bytes: sha256_bytes,
22152 hex: sha256_hex,
22153 base64: sha256_base64
22154 };
22155 var SHA512_instance = new sha512_constructor({
22156 heapSize: 1048576
22157 });
22158 function sha512_bytes(data) {
22159 if (data === undefined) throw new SyntaxError("data required");
22160 return SHA512_instance.reset().process(data).finish().result;
22161 }
22162 function sha512_hex(data) {
22163 var result = sha512_bytes(data);
22164 return bytes_to_hex(result);
22165 }
22166 function sha512_base64(data) {
22167 var result = sha512_bytes(data);
22168 return bytes_to_base64(result);
22169 }
22170 exports.SHA512 = {
22171 bytes: sha512_bytes,
22172 hex: sha512_hex,
22173 base64: sha512_base64
22174 };
22175 var hmac_sha256_instance = new hmac_sha256_constructor({
22176 hash: SHA256_instance
22177 });
22178 function hmac_sha256_bytes(data, password) {
22179 if (data === undefined) throw new SyntaxError("data required");
22180 if (password === undefined) throw new SyntaxError("password required");
22181 return hmac_sha256_instance.reset({
22182 password: password
22183 }).process(data).finish().result;
22184 }
22185 function hmac_sha256_hex(data, password) {
22186 var result = hmac_sha256_bytes(data, password);
22187 return bytes_to_hex(result);
22188 }
22189 function hmac_sha256_base64(data, password) {
22190 var result = hmac_sha256_bytes(data, password);
22191 return bytes_to_base64(result);
22192 }
22193 exports.HMAC = exports.HMAC_SHA256 = {
22194 bytes: hmac_sha256_bytes,
22195 hex: hmac_sha256_hex,
22196 base64: hmac_sha256_base64
22197 };
22198 var hmac_sha512_instance = new hmac_sha512_constructor({
22199 hash: SHA512_instance
22200 });
22201 function hmac_sha512_bytes(data, password) {
22202 if (data === undefined) throw new SyntaxError("data required");
22203 if (password === undefined) throw new SyntaxError("password required");
22204 return hmac_sha512_instance.reset({
22205 password: password
22206 }).process(data).finish().result;
22207 }
22208 function hmac_sha512_hex(data, password) {
22209 var result = hmac_sha512_bytes(data, password);
22210 return bytes_to_hex(result);
22211 }
22212 function hmac_sha512_base64(data, password) {
22213 var result = hmac_sha512_bytes(data, password);
22214 return bytes_to_base64(result);
22215 }
22216 exports.HMAC_SHA512 = {
22217 bytes: hmac_sha512_bytes,
22218 hex: hmac_sha512_hex,
22219 base64: hmac_sha512_base64
22220 };
22221 var pbkdf2_hmac_sha256_instance = new pbkdf2_hmac_sha256_constructor({
22222 hmac: hmac_sha256_instance
22223 });
22224 function pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen) {
22225 if (password === undefined) throw new SyntaxError("password required");
22226 if (salt === undefined) throw new SyntaxError("salt required");
22227 return pbkdf2_hmac_sha256_instance.reset({
22228 password: password
22229 }).generate(salt, iterations, dklen).result;
22230 }
22231 function pbkdf2_hmac_sha256_hex(password, salt, iterations, dklen) {
22232 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22233 return bytes_to_hex(result);
22234 }
22235 function pbkdf2_hmac_sha256_base64(password, salt, iterations, dklen) {
22236 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22237 return bytes_to_base64(result);
22238 }
22239 exports.PBKDF2 = exports.PBKDF2_HMAC_SHA256 = {
22240 bytes: pbkdf2_hmac_sha256_bytes,
22241 hex: pbkdf2_hmac_sha256_hex,
22242 base64: pbkdf2_hmac_sha256_base64
22243 };
22244 var pbkdf2_hmac_sha512_instance = new pbkdf2_hmac_sha512_constructor({
22245 hmac: hmac_sha512_instance
22246 });
22247 function pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen) {
22248 if (password === undefined) throw new SyntaxError("password required");
22249 if (salt === undefined) throw new SyntaxError("salt required");
22250 return pbkdf2_hmac_sha512_instance.reset({
22251 password: password
22252 }).generate(salt, iterations, dklen).result;
22253 }
22254 function pbkdf2_hmac_sha512_hex(password, salt, iterations, dklen) {
22255 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22256 return bytes_to_hex(result);
22257 }
22258 function pbkdf2_hmac_sha512_base64(password, salt, iterations, dklen) {
22259 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22260 return bytes_to_base64(result);
22261 }
22262 exports.PBKDF2_HMAC_SHA512 = {
22263 bytes: pbkdf2_hmac_sha512_bytes,
22264 hex: pbkdf2_hmac_sha512_hex,
22265 base64: pbkdf2_hmac_sha512_base64
22266 };
22267 var cbc_aes_instance = new cbc_aes_constructor({
22268 heapSize: 1048576
22269 });
22270 function cbc_aes_encrypt_bytes(data, key, padding, iv) {
22271 if (data === undefined) throw new SyntaxError("data required");
22272 if (key === undefined) throw new SyntaxError("key required");
22273 return cbc_aes_instance.reset({
22274 key: key,
22275 padding: padding,
22276 iv: iv
22277 }).encrypt(data).result;
22278 }
22279 function cbc_aes_decrypt_bytes(data, key, padding, iv) {
22280 if (data === undefined) throw new SyntaxError("data required");
22281 if (key === undefined) throw new SyntaxError("key required");
22282 return cbc_aes_instance.reset({
22283 key: key,
22284 padding: padding,
22285 iv: iv
22286 }).decrypt(data).result;
22287 }
22288 exports.AES = exports.AES_CBC = {
22289 encrypt: cbc_aes_encrypt_bytes,
22290 decrypt: cbc_aes_decrypt_bytes
22291 };
22292 var ccm_aes_instance = new ccm_aes_constructor({
22293 heap: cbc_aes_instance.heap,
22294 asm: cbc_aes_instance.asm
22295 });
22296 function ccm_aes_encrypt_bytes(data, key, nonce, adata, tagSize) {
22297 if (data === undefined) throw new SyntaxError("data required");
22298 if (key === undefined) throw new SyntaxError("key required");
22299 if (nonce === undefined) throw new SyntaxError("nonce required");
22300 var dataLength = data.byteLength || data.length || 0;
22301 return ccm_aes_instance.reset({
22302 key: key,
22303 nonce: nonce,
22304 adata: adata,
22305 tagSize: tagSize,
22306 dataLength: dataLength
22307 }).encrypt(data).result;
22308 }
22309 function ccm_aes_decrypt_bytes(data, key, nonce, adata, tagSize) {
22310 if (data === undefined) throw new SyntaxError("data required");
22311 if (key === undefined) throw new SyntaxError("key required");
22312 if (nonce === undefined) throw new SyntaxError("nonce required");
22313 var dataLength = data.byteLength || data.length || 0;
22314 tagSize = tagSize || _aes_block_size;
22315 return ccm_aes_instance.reset({
22316 key: key,
22317 nonce: nonce,
22318 adata: adata,
22319 tagSize: tagSize,
22320 dataLength: dataLength - tagSize
22321 }).decrypt(data).result;
22322 }
22323 exports.AES_CCM = {
22324 encrypt: ccm_aes_encrypt_bytes,
22325 decrypt: ccm_aes_decrypt_bytes
22326 };
22327 var cfb_aes_instance = new cfb_aes_constructor({
22328 heap: cbc_aes_instance.heap,
22329 asm: cbc_aes_instance.asm
22330 });
22331 function cfb_aes_encrypt_bytes(data, key, padding, iv) {
22332 if (data === undefined) throw new SyntaxError("data required");
22333 if (key === undefined) throw new SyntaxError("key required");
22334 return cfb_aes_instance.reset({
22335 key: key,
22336 padding: padding,
22337 iv: iv
22338 }).encrypt(data).result;
22339 }
22340 function cfb_aes_decrypt_bytes(data, key, padding, iv) {
22341 if (data === undefined) throw new SyntaxError("data required");
22342 if (key === undefined) throw new SyntaxError("key required");
22343 return cfb_aes_instance.reset({
22344 key: key,
22345 padding: padding,
22346 iv: iv
22347 }).decrypt(data).result;
22348 }
22349 exports.AES_CFB = {
22350 encrypt: cfb_aes_encrypt_bytes,
22351 decrypt: cfb_aes_decrypt_bytes
22352 };
22353 var cfb_aes_decrypt_instance = new cfb_aes_decrypt_constructor({
22354 heap: cbc_aes_instance.heap,
22355 asm: cbc_aes_instance.asm
22356 });
22357 function cfb_aes_decrypt_init(key, padding, iv) {
22358 if (key === undefined) throw new SyntaxError("key required");
22359 return cfb_aes_decrypt_instance.reset({
22360 key: key,
22361 padding: padding,
22362 iv: iv
22363 });
22364 }
22365 exports.AES_CFB = exports.AES_CFB || {};
22366 exports.AES_CFB.decryptor = {
22367 init: cfb_aes_decrypt_init
22368 };
22369 })({}, function() {
22370 return this;
22371 }());
22372 </script>
22373
22374 <!--<script src="/js/jsbip39.js"></script>-->
22375 <script>
22376 /*
22377 * Copyright (c) 2013 Pavol Rusnak
22378 *
22379 * Permission is hereby granted, free of charge, to any person obtaining a copy of
22380 * this software and associated documentation files (the "Software"), to deal in
22381 * the Software without restriction, including without limitation the rights to
22382 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22383 * of the Software, and to permit persons to whom the Software is furnished to do
22384 * so, subject to the following conditions:
22385 *
22386 * The above copyright notice and this permission notice shall be included in all
22387 * copies or substantial portions of the Software.
22388 *
22389 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22390 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22391 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22392 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22393 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22394 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22395 */
22396
22397 /*
22398 * Javascript port from python by Ian Coleman
22399 *
22400 * Includes code from asmCrypto
22401 * https://github.com/tresorit/asmcrypto.js
22402 */
22403
22404 var Mnemonic = function(language) {
22405
22406 var PBKDF2_ROUNDS = 2048;
22407 var RADIX = 2048;
22408
22409 var self = this;
22410 var wordlist = [];
22411
22412 function init() {
22413 wordlist = WORDLISTS[language];
22414 if (wordlist.length != RADIX) {
22415 err = 'Wordlist should contain ' + RADIX + ' words, but it contains ' + wordlist.length + ' words.';
22416 throw err;
22417 }
22418 }
22419
22420 self.generate = function(strength) {
22421 strength = strength || 128;
22422 var r = strength % 32;
22423 if (r > 0) {
22424 throw 'Strength should be divisible by 32, but it is not (' + r + ').';
22425 }
22426 var hasStrongCrypto = 'crypto' in window && window['crypto'] !== null;
22427 if (!hasStrongCrypto) {
22428 throw 'Mnemonic should be generated with strong randomness, but crypto.getRandomValues is unavailable';
22429 }
22430 var buffer = new Uint8Array(strength / 8);
22431 var data = crypto.getRandomValues(buffer);
22432 return self.toMnemonic(data);
22433 }
22434
22435 self.toMnemonic = function(data) {
22436 if (data.length % 4 > 0) {
22437 throw 'Data length in bits should be divisible by 32, but it is not (' + data.length + ' bytes = ' + data.length*8 + ' bits).'
22438 }
22439
22440 //h = hashlib.sha256(data).hexdigest()
22441 var uintArray = new Uint8Array(data);
22442 var h = asmCrypto.SHA256.bytes(uintArray);
22443
22444 // b is a binary string, eg '00111010101100...'
22445 //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \
22446 // bin(int(h, 16))[2:].zfill(256)[:len(data) * 8 / 32]
22447 //
22448 // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8)
22449 // c = bin(int(h, 16))[2:].zfill(256)
22450 // d = c[:len(data) * 8 / 32]
22451 var a = byteArrayToBinaryString(data);
22452 var c = byteArrayToBinaryString(h);
22453 var d = c.substring(0, data.length * 8 / 32);
22454 // b = line1 + line2
22455 var b = a + d;
22456
22457 var result = [];
22458 var blen = b.length / 11;
22459 for (var i=0; i<blen; i++) {
22460 var idx = parseInt(b.substring(i * 11, (i + 1) * 11), 2);
22461 result.push(wordlist[idx]);
22462 }
22463 return result.join(' ');
22464 }
22465
22466 self.check = function(mnemonic) {
22467 var mnemonic = mnemonic.split(' ')
22468 if (mnemonic.length % 3 > 0) {
22469 return false
22470 }
22471 // idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
22472 var idx = [];
22473 for (var i=0; i<mnemonic.length; i++) {
22474 var word = mnemonic[i];
22475 var wordIndex = wordlist.indexOf(word);
22476 if (wordIndex == -1) {
22477 return false;
22478 }
22479 var binaryIndex = zfill(wordIndex.toString(2), 11);
22480 idx.push(binaryIndex);
22481 }
22482 var b = idx.join('');
22483 var l = b.length;
22484 //d = b[:l / 33 * 32]
22485 //h = b[-l / 33:]
22486 var d = b.substring(0, l / 33 * 32);
22487 var h = b.substring(l - l / 33, l);
22488 //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8))
22489 //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33]
22490 var nd = binaryStringToByteArray(d);
22491 var ndHash = asmCrypto.SHA256.bytes(nd);
22492 var ndBstr = zfill(byteArrayToBinaryString(ndHash), 256);
22493 var nh = ndBstr.substring(0,l/33);
22494 return h == nh;
22495 }
22496
22497 self.toSeed = function(mnemonic, passphrase) {
22498 passphrase = passphrase || '';
22499 mnemonic = normalizeString(mnemonic)
22500 passphrase = normalizeString(passphrase)
22501 passphrase = "mnemonic" + passphrase;
22502 //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64)
22503 return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8);
22504 }
22505
22506 function normalizeString(str) {
22507 if (typeof str.normalize == "function") {
22508 return str.normalize("NFKD");
22509 }
22510 else {
22511 // TODO find a library to do this
22512 // Not supported on firefox mobile
22513 console.warn("NFKD Normalization is unavailable");
22514 return str;
22515 }
22516 }
22517
22518 function byteArrayToBinaryString(data) {
22519 var bin = "";
22520 for (var i=0; i<data.length; i++) {
22521 bin += zfill(data[i].toString(2), 8);
22522 }
22523 return bin;
22524 }
22525
22526 function binaryStringToByteArray(str) {
22527 var arrayLen = str.length / 8;
22528 var array = new Uint8Array(arrayLen);
22529 for (var i=0; i<arrayLen; i++) {
22530 var valueStr = str.substring(0,8);
22531 var value = parseInt(valueStr, 2);
22532 array[i] = value;
22533 str = str.slice(8);
22534 }
22535 return array;
22536 }
22537
22538 // Pad a numeric string on the left with zero digits until the given width
22539 // is reached.
22540 // Note this differs to the python implementation because it does not
22541 // handle numbers starting with a sign.
22542 function zfill(source, length) {
22543 source = source.toString();
22544 while (source.length < length) {
22545 source = '0' + source;
22546 }
22547 return source;
22548 }
22549
22550 init();
22551
22552 }
22553
22554 WORDLISTS = {
22555 "english": [
22556 "abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
22557 "access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
22558 "action","actor","actress","actual","adapt","add","addict","address","adjust","admit",
22559 "adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent",
22560 "agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert",
22561 "alien","all","alley","allow","almost","alone","alpha","already","also","alter",
22562 "always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger",
22563 "angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique",
22564 "anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic",
22565 "area","arena","argue","arm","armed","armor","army","around","arrange","arrest",
22566 "arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset",
22567 "assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction",
22568 "audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake",
22569 "aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge",
22570 "bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain",
22571 "barrel","base","basic","basket","battle","beach","bean","beauty","because","become",
22572 "beef","before","begin","behave","behind","believe","below","belt","bench","benefit",
22573 "best","betray","better","between","beyond","bicycle","bid","bike","bind","biology",
22574 "bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless",
22575 "blind","blood","blossom","blouse","blue","blur","blush","board","boat","body",
22576 "boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss",
22577 "bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread",
22578 "breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze",
22579 "broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb",
22580 "bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy",
22581 "butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call",
22582 "calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas",
22583 "canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry",
22584 "cart","case","cash","casino","castle","casual","cat","catalog","catch","category",
22585 "cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century",
22586 "cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase",
22587 "chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child",
22588 "chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle",
22589 "citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk",
22590 "clever","click","client","cliff","climb","clinic","clip","clock","clog","close",
22591 "cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut",
22592 "code","coffee","coil","coin","collect","color","column","combine","come","comfort",
22593 "comic","common","company","concert","conduct","confirm","congress","connect","consider","control",
22594 "convince","cook","cool","copper","copy","coral","core","corn","correct","cost",
22595 "cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle",
22596 "craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek",
22597 "crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial",
22598 "cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup",
22599 "cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad",
22600 "damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal",
22601 "debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense",
22602 "define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny",
22603 "depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk",
22604 "despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond",
22605 "diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur",
22606 "direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance",
22607 "divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain",
22608 "donate","donkey","donor","door","dose","double","dove","draft","dragon","drama",
22609 "drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop",
22610 "drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf",
22611 "dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo",
22612 "ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow",
22613 "elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody",
22614 "embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless",
22615 "endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough",
22616 "enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip",
22617 "era","erase","erode","erosion","error","erupt","escape","essay","essence","estate",
22618 "eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange",
22619 "excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit",
22620 "exotic","expand","expect","expire","explain","expose","express","extend","extra","eye",
22621 "eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame",
22622 "family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father",
22623 "fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female",
22624 "fence","festival","fetch","fever","few","fiber","fiction","field","figure","file",
22625 "film","filter","final","find","fine","finger","finish","fire","firm","first",
22626 "fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor",
22627 "flee","flight","flip","float","flock","floor","flower","fluid","flush","fly",
22628 "foam","focus","fog","foil","fold","follow","food","foot","force","forest",
22629 "forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile",
22630 "frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen",
22631 "fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy",
22632 "gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp",
22633 "gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture",
22634 "ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance",
22635 "glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue",
22636 "goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown",
22637 "grab","grace","grain","grant","grape","grass","gravity","great","green","grid",
22638 "grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt",
22639 "guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy",
22640 "harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health",
22641 "heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden",
22642 "high","hill","hint","hip","hire","history","hobby","hockey","hold","hole",
22643 "holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital",
22644 "host","hotel","hour","hover","hub","huge","human","humble","humor","hundred",
22645 "hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea",
22646 "identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune",
22647 "impact","impose","improve","impulse","inch","include","income","increase","index","indicate",
22648 "indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury",
22649 "inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install",
22650 "intact","interest","into","invest","invite","involve","iron","island","isolate","issue",
22651 "item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel",
22652 "job","join","joke","journey","joy","judge","juice","jump","jungle","junior",
22653 "junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney",
22654 "kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife",
22655 "knock","know","lab","label","labor","ladder","lady","lake","lamp","language",
22656 "laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit",
22657 "layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal",
22658 "legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level",
22659 "liar","liberty","library","license","life","lift","light","like","limb","limit",
22660 "link","lion","liquid","list","little","live","lizard","load","loan","lobster",
22661 "local","lock","logic","lonely","long","loop","lottery","loud","lounge","love",
22662 "loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad",
22663 "magic","magnet","maid","mail","main","major","make","mammal","man","manage",
22664 "mandate","mango","mansion","manual","maple","marble","march","margin","marine","market",
22665 "marriage","mask","mass","master","match","material","math","matrix","matter","maximum",
22666 "maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt",
22667 "member","memory","mention","menu","mercy","merge","merit","merry","mesh","message",
22668 "metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor",
22669 "minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile",
22670 "model","modify","mom","moment","monitor","monkey","monster","month","moon","moral",
22671 "more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie",
22672 "much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual",
22673 "myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature",
22674 "near","neck","need","negative","neglect","neither","nephew","nerve","nest","net",
22675 "network","neutral","never","news","next","nice","night","noble","noise","nominee",
22676 "noodle","normal","north","nose","notable","note","nothing","notice","novel","now",
22677 "nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe",
22678 "obtain","obvious","occur","ocean","october","odor","off","offer","office","often",
22679 "oil","okay","old","olive","olympic","omit","once","one","onion","online",
22680 "only","open","opera","opinion","oppose","option","orange","orbit","orchard","order",
22681 "ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output",
22682 "outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact",
22683 "paddle","page","pair","palace","palm","panda","panel","panic","panther","paper",
22684 "parade","parent","park","parrot","party","pass","patch","path","patient","patrol",
22685 "pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen",
22686 "penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo",
22687 "phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot",
22688 "pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate",
22689 "play","please","pledge","pluck","plug","plunge","poem","poet","point","polar",
22690 "pole","police","pond","pony","pool","popular","portion","position","possible","post",
22691 "potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare",
22692 "present","pretty","prevent","price","pride","primary","print","priority","prison","private",
22693 "prize","problem","process","produce","profit","program","project","promote","proof","property",
22694 "prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin",
22695 "punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle",
22696 "pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit",
22697 "raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp",
22698 "ranch","random","range","rapid","rare","rate","rather","raven","raw","razor",
22699 "ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle",
22700 "reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release",
22701 "relief","rely","remain","remember","remind","remove","render","renew","rent","reopen",
22702 "repair","repeat","replace","report","require","rescue","resemble","resist","resource","response",
22703 "result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib",
22704 "ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot",
22705 "ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket",
22706 "romance","roof","rookie","room","rose","rotate","rough","round","route","royal",
22707 "rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness",
22708 "safe","sail","salad","salmon","salon","salt","salute","same","sample","sand",
22709 "satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter",
22710 "scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script",
22711 "scrub","sea","search","season","seat","second","secret","section","security","seed",
22712 "seek","segment","select","sell","seminar","senior","sense","sentence","series","service",
22713 "session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell",
22714 "sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop",
22715 "short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side",
22716 "siege","sight","sign","silent","silk","silly","silver","similar","simple","since",
22717 "sing","siren","sister","situate","six","size","skate","sketch","ski","skill",
22718 "skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight",
22719 "slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth",
22720 "snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda",
22721 "soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry",
22722 "sort","soul","sound","soup","source","south","space","spare","spatial","spawn",
22723 "speak","special","speed","spell","spend","sphere","spice","spider","spike","spin",
22724 "spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring",
22725 "spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp",
22726 "stand","start","state","stay","steak","steel","stem","step","stereo","stick",
22727 "still","sting","stock","stomach","stone","stool","story","stove","strategy","street",
22728 "strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway",
22729 "success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny",
22730 "sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey",
22731 "suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim",
22732 "swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag",
22733 "tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi",
22734 "teach","team","tell","ten","tenant","tennis","tent","term","test","text",
22735 "thank","that","theme","then","theory","there","they","thing","this","thought",
22736 "three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber",
22737 "time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler",
22738 "toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool",
22739 "tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist",
22740 "toward","tower","town","toy","track","trade","traffic","tragic","train","transfer",
22741 "trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick",
22742 "trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust",
22743 "truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle",
22744 "twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella",
22745 "unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform",
22746 "unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade",
22747 "uphold","upon","upper","upset","urban","urge","usage","use","used","useful",
22748 "useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van",
22749 "vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue",
22750 "verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory",
22751 "video","view","village","vintage","violin","virtual","virus","visa","visit","visual",
22752 "vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage",
22753 "wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash",
22754 "wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather",
22755 "web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat",
22756 "wheel","when","where","whip","whisper","wide","width","wife","wild","will",
22757 "win","window","wine","wing","wink","winner","winter","wire","wisdom","wise",
22758 "wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
22759 "worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
22760 "yellow","you","young","youth","zebra","zero","zone","zoo"]
22761 };
22762 </script>
22763
22764 <!--<script src="/js/index.js"></script>-->
22765 <script>
22766 (function() {
22767
22768 var mnemonic = new Mnemonic("english");
22769 var bip32RootKey = null;
22770 var bip32ExtendedKey = null;
22771 var network = Bitcoin.networks.bitcoin;
22772 var addressRowTemplate = $("#address-row-template");
22773
22774 var phraseChangeTimeoutEvent = null;
22775
22776 var DOM = {};
22777 DOM.phrase = $(".phrase");
22778 DOM.generate = $(".generate");
22779 DOM.rootKey = $(".root-key");
22780 DOM.extendedPrivKey = $(".extended-priv-key");
22781 DOM.extendedPubKey = $(".extended-pub-key");
22782 DOM.bip32path = $("#bip32-path");
22783 DOM.bip44path = $("#bip44-path");
22784 DOM.bip44purpose = $("#bip44 .purpose");
22785 DOM.bip44coin = $("#bip44 .coin");
22786 DOM.bip44account = $("#bip44 .account");
22787 DOM.bip44change = $("#bip44 .change");
22788 DOM.strength = $(".strength");
22789 DOM.addresses = $(".addresses");
22790 DOM.rowsToAdd = $(".rows-to-add");
22791 DOM.more = $(".more");
22792 DOM.feedback = $(".feedback");
22793 DOM.tab = $(".derivation-type a");
22794 DOM.indexToggle = $(".index-toggle");
22795 DOM.addressToggle = $(".address-toggle");
22796 DOM.privateKeyToggle = $(".private-key-toggle");
22797
22798 var derivationPath = DOM.bip44path.val();
22799
22800 function init() {
22801 // Events
22802 DOM.phrase.on("keyup", delayedPhraseChanged);
22803 DOM.generate.on("click", generateClicked);
22804 DOM.more.on("click", showMore);
22805 DOM.bip32path.on("keyup", bip32Changed);
22806 DOM.bip44purpose.on("keyup", bip44Changed);
22807 DOM.bip44coin.on("keyup", bip44Changed);
22808 DOM.bip44account.on("keyup", bip44Changed);
22809 DOM.bip44change.on("keyup", bip44Changed);
22810 DOM.tab.on("click", tabClicked);
22811 DOM.indexToggle.on("click", toggleIndexes);
22812 DOM.addressToggle.on("click", toggleAddresses);
22813 DOM.privateKeyToggle.on("click", togglePrivateKeys);
22814 disableForms();
22815 hidePending();
22816 hideValidationError();
22817 }
22818
22819 // Event handlers
22820
22821 function delayedPhraseChanged() {
22822 hideValidationError();
22823 showPending();
22824 if (phraseChangeTimeoutEvent != null) {
22825 clearTimeout(phraseChangeTimeoutEvent);
22826 }
22827 phraseChangeTimeoutEvent = setTimeout(phraseChanged, 400);
22828 }
22829
22830 function phraseChanged() {
22831 showPending();
22832 hideValidationError();
22833 // Get the mnemonic phrase
22834 var phrase = DOM.phrase.val();
22835 var errorText = findPhraseErrors(phrase);
22836 if (errorText) {
22837 showValidationError(errorText);
22838 return;
22839 }
22840 // Get the derivation path
22841 var errorText = findDerivationPathErrors();
22842 if (errorText) {
22843 showValidationError(errorText);
22844 return;
22845 }
22846 // Calculate and display
22847 calcBip32Seed(phrase, derivationPath);
22848 displayBip32Info();
22849 hidePending();
22850 }
22851
22852 function generateClicked() {
22853 clearDisplay();
22854 showPending();
22855 setTimeout(function() {
22856 var phrase = generateRandomPhrase();
22857 if (!phrase) {
22858 return;
22859 }
22860 phraseChanged();
22861 }, 50);
22862 }
22863
22864 function tabClicked(e) {
22865 var activePath = $(e.target.getAttribute("href") + " .path");
22866 derivationPath = activePath.val();
22867 derivationChanged();
22868 }
22869
22870 function derivationChanged() {
22871 delayedPhraseChanged();
22872 }
22873
22874 function bip32Changed() {
22875 derivationPath = DOM.bip32path.val();
22876 derivationChanged();
22877 }
22878
22879 function bip44Changed() {
22880 setBip44DerivationPath();
22881 derivationPath = DOM.bip44path.val();
22882 derivationChanged();
22883 }
22884
22885 function toggleIndexes() {
22886 $("td.index span").toggleClass("invisible");
22887 }
22888
22889 function toggleAddresses() {
22890 $("td.address span").toggleClass("invisible");
22891 }
22892
22893 function togglePrivateKeys() {
22894 $("td.privkey span").toggleClass("invisible");
22895 }
22896
22897 // Private methods
22898
22899 function generateRandomPhrase() {
22900 if (!hasStrongRandom()) {
22901 var errorText = "This browser does not support strong randomness";
22902 showValidationError(errorText);
22903 return;
22904 }
22905 var numWords = parseInt(DOM.strength.val());
22906 // Check strength is an integer
22907 if (isNaN(numWords)) {
22908 DOM.strength.val("12");
22909 numWords = 12;
22910 }
22911 // Check strength is a multiple of 32, if not round it down
22912 if (numWords % 3 != 0) {
22913 numWords = Math.floor(numWords / 3) * 3;
22914 DOM.strength.val(numWords);
22915 }
22916 // Check strength is at least 32
22917 if (numWords == 0) {
22918 numWords = 3;
22919 DOM.strength.val(numWords);
22920 }
22921 var strength = numWords / 3 * 32;
22922 var words = mnemonic.generate(strength);
22923 DOM.phrase.val(words);
22924 return words;
22925 }
22926
22927 function calcBip32Seed(phrase, path) {
22928 var seed = mnemonic.toSeed(phrase);
22929 var seedHash = Bitcoin.crypto.sha256(seed).toString("hex");
22930 bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network);
22931 bip32ExtendedKey = bip32RootKey;
22932 // Derive the key from the path
22933 var pathBits = path.split("/");
22934 for (var i=0; i<pathBits.length; i++) {
22935 var bit = pathBits[i];
22936 var index = parseInt(bit);
22937 if (isNaN(index)) {
22938 continue;
22939 }
22940 var hardened = bit[bit.length-1] == "'";
22941 if (hardened) {
22942 bip32ExtendedKey = bip32ExtendedKey.deriveHardened(index);
22943 }
22944 else {
22945 bip32ExtendedKey = bip32ExtendedKey.derive(index);
22946 }
22947 }
22948 }
22949
22950 function showValidationError(errorText) {
22951 DOM.feedback
22952 .text(errorText)
22953 .show();
22954 }
22955
22956 function hideValidationError() {
22957 DOM.feedback
22958 .text("")
22959 .hide();
22960 }
22961
22962 function findPhraseErrors(phrase) {
22963 // TODO make this right
22964 // Preprocess the words
22965 var parts = phrase.split(" ");
22966 var proper = [];
22967 for (var i=0; i<parts.length; i++) {
22968 var part = parts[i];
22969 if (part.length > 0) {
22970 // TODO check that lowercasing is always valid to do
22971 proper.push(part.toLowerCase());
22972 }
22973 }
22974 // TODO some levenstein on the words
22975 var properPhrase = proper.join(' ');
22976 // Check the words are valid
22977 var isValid = mnemonic.check(properPhrase);
22978 if (!isValid) {
22979 return "Invalid mnemonic";
22980 }
22981 return false;
22982 }
22983
22984 function findDerivationPathErrors(path) {
22985 // TODO
22986 return false;
22987 }
22988
22989 function displayBip32Info() {
22990 // Display the key
22991 var rootKey = bip32RootKey.toBase58();
22992 DOM.rootKey.val(rootKey);
22993 var extendedPrivKey = bip32ExtendedKey.toBase58();
22994 DOM.extendedPrivKey.val(extendedPrivKey);
22995 var extendedPubKey = bip32ExtendedKey.toBase58(false);
22996 DOM.extendedPubKey.val(extendedPubKey);
22997 // Display the addresses and privkeys
22998 clearAddressesList();
22999 displayAddresses(0, 20);
23000 }
23001
23002 function displayAddresses(start, total) {
23003 for (var i=0; i<total; i++) {
23004 var index = i+ start;
23005 var key = bip32ExtendedKey.derive(index);
23006 var address = key.getAddress().toString();
23007 var privkey = key.privKey.toWIF();
23008 addAddressToList(index, address, privkey);
23009 }
23010 }
23011
23012 function showMore() {
23013 var start = DOM.addresses.children().length;
23014 var rowsToAdd = parseInt(DOM.rowsToAdd.val());
23015 if (isNaN(rowsToAdd)) {
23016 rowsToAdd = 20;
23017 DOM.rowsToAdd.val("20");
23018 }
23019 if (rowsToAdd > 200) {
23020 var msg = "Generating " + rowsToAdd + " rows could take a while. ";
23021 msg += "Do you want to continue?";
23022 if (!confirm(msg)) {
23023 return;
23024 }
23025 }
23026 showPending();
23027 setTimeout(function() {
23028 displayAddresses(start, rowsToAdd);
23029 hidePending();
23030 }, 50);
23031 }
23032
23033 function clearDisplay() {
23034 clearAddressesList();
23035 clearKey();
23036 hideValidationError();
23037 }
23038
23039 function clearAddressesList() {
23040 DOM.addresses.empty();
23041 }
23042
23043 function clearKey() {
23044 DOM.rootKey.val("");
23045 DOM.extendedPrivKey.val("");
23046 DOM.extendedPubKey.val("");
23047 }
23048
23049 function addAddressToList(index, address, privkey) {
23050 var row = $(addressRowTemplate.html());
23051 row.find(".index span").text(index);
23052 row.find(".address span").text(address);
23053 row.find(".privkey span").text(privkey);
23054 DOM.addresses.append(row);
23055 }
23056
23057 function hasStrongRandom() {
23058 return 'crypto' in window && window['crypto'] !== null;
23059 }
23060
23061 function disableForms() {
23062 $("form").on("submit", function(e) {
23063 e.preventDefault();
23064 });
23065 }
23066
23067 function setBip44DerivationPath() {
23068 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
23069 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
23070 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
23071 var change = parseIntNoNaN(DOM.bip44change.val(), 0);
23072 var path = "m/";
23073 path += purpose + "'/";
23074 path += coin + "'/";
23075 path += account + "'/";
23076 path += change;
23077 DOM.bip44path.val(path);
23078 }
23079
23080 function parseIntNoNaN(val, defaultVal) {
23081 var v = parseInt(val);
23082 if (isNaN(v)) {
23083 return defaultVal;
23084 }
23085 return v;
23086 }
23087
23088 function showPending() {
23089 DOM.feedback
23090 .text("Calculating...")
23091 .show();
23092 }
23093
23094 function hidePending() {
23095 DOM.feedback
23096 .text("")
23097 .hide();
23098 }
23099
23100 init();
23101
23102 })();
23103 </script>
23104 </body>
23105 </html>