]> git.immae.eu Git - perso/Immae/Projets/Cryptomonnaies/BIP39.git/blame - bip39-standalone.html
Duplicate address table removed
[perso/Immae/Projets/Cryptomonnaies/BIP39.git] / bip39-standalone.html
CommitLineData
ebd8d4e8
IC
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>
212b1b46
IC
21 body {
22 padding-bottom: 32px;
23 }
ebd8d4e8
IC
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">
d922d691 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>
ebd8d4e8
IC
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>
721b7284
IC
76 <div class="form-group">
77 <label for="passphrase" class="col-sm-2 control-label">BIP39 Passphrase (optional)</label>
78 <div class="col-sm-10">
79 <textarea id="passphrase" class="passphrase form-control"></textarea>
80 </div>
81 </div>
ebd8d4e8
IC
82 <div class="form-group">
83 <label for="root-key" class="col-sm-2 control-label">BIP32 Root Key</label>
84 <div class="col-sm-10">
85 <textarea id="root-key" class="root-key form-control" disabled="disabled"></textarea>
86 </div>
87 </div>
88 </form>
89 </div>
90 </div>
91
92 <hr>
93
94 <div class="row">
95 <div class="col-md-12">
96 <h2>Derivation Path</h2>
97 <ul class="derivation-type nav nav-tabs" role="tablist">
98 <li class="active">
99 <a href="#bip44" role="tab" data-toggle="tab">BIP44</a></li>
100 <li><a href="#bip32" role="tab" data-toggle="tab">BIP32</a></li>
101 </ul>
102 <div class="derivation-type tab-content">
103 <div id="bip44" class="tab-pane active">
104 <form class="form-horizontal" role="form">
105 <br>
106 <div class="col-sm-2"></div>
107 <div class="col-sm-10">
108 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">BIP44 spec</a></p>
109 </div>
110 <div class="form-group">
111 <label for="purpose" class="col-sm-2 control-label">
112 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose" target="_blank">Purpose</a>
113 </label>
114 <div class="col-sm-10">
115 <input id="purpose" type="text" class="purpose form-control" value="44">
116 </div>
117 </div>
118 <div class="form-group">
119 <label for="coin" class="col-sm-2 control-label">
120 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#registered-coin-types" target="_blank">Coin</a>
121 </label>
122 <div class="col-sm-10">
123 <input id="coin" type="text" class="coin form-control" value="0">
124 </div>
125 </div>
126 <div class="form-group">
127 <label for="account" class="col-sm-2 control-label">
128 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#account" target="_blank">Account</a>
129 </label>
130 <div class="col-sm-10">
131 <input id="account" type="text" class="account form-control" value="0">
132 </div>
133 </div>
134 <div class="form-group">
135 <label for="change" class="col-sm-2 control-label">
136 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#change" target="_blank">External / Internal</a>
137 </label>
138 <div class="col-sm-10">
139 <input id="change" type="text" class="change form-control" value="0">
140 </div>
141 </div>
142 <div class="form-group">
143 <label for="bip44-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
144 <div class="col-sm-10">
145 <input id="bip44-path" type="text" class="path form-control" value="m/44'/0'/0'/0" disabled="disabled">
146 </div>
147 </div>
148 </form>
149 </div>
150 <div id="bip32" class="tab-pane">
151 <form class="form-horizontal" role="form">
152 <br>
153 <div class="col-sm-2"></div>
154 <div class="col-sm-10">
155 <p>For more info see the <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">BIP32 spec</a></p>
156 </div>
157 <div class="form-group">
158 <label for="bip32-path" class="col-sm-2 control-label">BIP32 Derivation Path</label>
159 <div class="col-sm-10">
160 <input id="bip32-path" type="text" class="path form-control" value="m/0">
161 </div>
162 </div>
163 </form>
164 </div>
165 </div>
166 <form class="form-horizontal" role="form">
167 <div class="form-group">
168 <label for="extended-priv-key" class="col-sm-2 control-label">BIP32 Extended Key</label>
169 <div class="col-sm-10">
170 <textarea id="extended-priv-key" class="extended-priv-key form-control" disabled="disabled"></textarea>
171 </div>
172 </div>
173 <div class="form-group">
174 <label for="extended-pub-key" class="col-sm-2 control-label">BIP32 Extended Key (addresses only)</label>
175 <div class="col-sm-10">
176 <textarea id="extended-pub-key" class="extended-pub-key form-control" disabled="disabled"></textarea>
177 </div>
178 </div>
179 </form>
180 </div>
181 </div>
182
183 <hr>
184
185 <div class="row">
186 <div class="col-md-12">
212b1b46
IC
187 <h2>Derived Addresses</h2>
188 <p>Note these addreses are derived from the <strong>BIP32 Extended Key</strong></p>
189 <table class="table table-striped">
190 <thead>
191 <th>
192 <div class="input-group">
193 Index&nbsp;&nbsp;
194 <button class="index-toggle">Toggle</button>
195 </div>
196 </th>
197 <th>
198 <div class="input-group">
199 Address&nbsp;&nbsp;
200 <button class="address-toggle">Toggle</button>
201 </div>
202 </th>
203 <th>
204 <div class="input-group">
205 Private Key&nbsp;&nbsp;
206 <button class="private-key-toggle">Toggle</button>
207 </div>
208 </th>
209 </thead>
210 <tbody class="addresses">
211 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
212 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
213 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
214 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
215 <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>
216 </tbody>
217 </table>
218 </div>
219 </div>
220 <span>Show next </button>
221 <input type="number" class="rows-to-add" value="20">
222 <button class="more">Show</button>
223
224 <hr>
225
226 <div class="row">
227 <div class="col-md-12">
228 <h2>More info</h2>
229 <h3>BIP39 <span class="small">Mnemonic code for generating deterministic keys</span></h3>
230 <p>
231 Read more at the
232 <a href="https://github.com/bitcoin/bips/blob/master/bip-0039.mediawiki">official BIP39 spec</a>
233 </p>
234 <h3>BIP32 <span class="small">Hierarchical Deterministic Wallets</span></h3>
235 <p>
236 Read more at the
237 <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" target="_blank">official BIP32 spec</a>
238 and see the demo at
239 <a href="http://bip32.org/" target="_blank">bip32.org</a>
240 </p>
241 <h3>BIP44 <span class="small">Multi-Account Hierarchy for Deterministic Wallets</span></h3>
242 <p>
243 Read more at the
244 <a href="https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki" target="_blank">official BIP44 spec</a>
245 </p>
246 <h3>Private Keys</h3>
247 <p>
248 Use private keys at
249 <a href="https://brainwallet.github.io/" target="_blank">brainwallet.org</a>,
250 but be careful - it can be easy to make mistakes if you
251 don't know what you're doing
252 </p>
253 </div>
254 </div>
255
256 <hr>
257
258 <div class="row">
259 <div class="col-md-12">
260
261 <h2>Offline Usage</h2>
262
263 <p>
264 You can use this tool without having to be online.
265 </p>
266 <p>
267 In your browser, select file save-as, and save this page
268 as a file.
269 </p>
270 <p>
271 Double-click that file to open it in a browser
272 on any offline computer.
273 </p>
274 <p>
275 Alternatively, download it from
276 <a href="https://github.com/dcpos/bip39">
277 https://github.com/dcpos/bip39
278 </a>
279
280 </div>
281 </div>
282
283 <hr>
284
285 <div class="row">
286 <div class="col-md-12">
287
288 <h2>This project is 100% open-source code</h2>
289
290 <p>
291 <span>Get the source code at - </span>
292 <a href="https://github.com/dcpos/bip39" target="_blank">
293 https://github.com/dcpos/bip39
294 </a>
295 </p>
296
297 <h3>Libraries</h3>
298
299 <p>
300 <span>BitcoinJS - </span>
301 <a href="https://github.com/bitcoinjs/bitcoinjs-lib" target="_blank">
302 https://github.com/bitcoinjs/bitcoinjs-lib
303 </a>
304 </p>
305
306 <p>
307 <span>jsBIP39 - </span>
308 <a href="https://github.com/iancoleman/jsbip39" target="_blank">
309 https://github.com/iancoleman/jsbip39
310 </a>
311 </p>
312
313 <p>
314 <span>asmCrypto - </span>
315 <a href="https://github.com/vibornoff/asmcrypto.js" target="_blank">
316 https://github.com/vibornoff/asmcrypto.js
317 </a>
318 </p>
319
320 <p>
321 <span>jQuery - </span>
322 <a href="https://jquery.com/" target="_blank">
323 https://jquery.com/
324 </a>
325 </p>
326
327 <p>
328 <span>Twitter Bootstrap - </span>
329 <a href="http://getbootstrap.com/" target="_blank">
330 http://getbootstrap.com/
331 </a>
332 </p>
333
334 </div>
335 </div>
336
ebd8d4e8
IC
337 </div>
338
339 <div class="feedback-container">
340 <div class="feedback"></div>
341 </div>
342
343 <script type="text/template" id="address-row-template">
344 <tr>
345 <td class="index"><span></span></td>
346 <td class="address"><span></span></td>
347 <td class="privkey"><span></span></td>
348 </tr>
349 </script>
350
351 <!--<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>-->
352 <script>
353/*! jQuery v2.1.1 | (c) 2005, 2014 jQuery Foundation, Inc. | jquery.org/license */
354!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)
355},_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))
356},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});
357 </script>
358
359 <!--<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>-->
360 <script>
361/*!
362 * Bootstrap v3.2.0 (http://getbootstrap.com)
363 * Copyright 2011-2014 Twitter, Inc.
364 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
365 */
366if("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);
367 </script>
368
369 <!--<script src="/js/bitcoinjs-1-0-0.js"></script>-->
370 <script>
371(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){
372var assert = _dereq_('assert')
373
374module.exports = BigInteger
375
376// JavaScript engine analysis
377var canary = 0xdeadbeefcafe;
378var j_lm = ((canary&0xffffff)==0xefcafe);
379
380// (public) Constructor
381function BigInteger(a,b,c) {
382 if (!(this instanceof BigInteger)) {
383 return new BigInteger(a, b, c);
384 }
385
386 if(a != null) {
387 if("number" == typeof a) this.fromNumber(a,b,c);
388 else if(b == null && "string" != typeof a) this.fromString(a,256);
389 else this.fromString(a,b);
390 }
391}
392
393var proto = BigInteger.prototype;
394
395// return new, unset BigInteger
396function nbi() { return new BigInteger(null); }
397
398// Bits per digit
399var dbits;
400
401// am: Compute w_j += (x*this_i), propagate carries,
402// c is initial carry, returns final carry.
403// c < 3*dvalue, x < 2*dvalue, this_i < dvalue
404// We need to select the fastest one that works in this environment.
405
406// am1: use a single mult and divide to get the high bits,
407// max digit bits should be 26 because
408// max internal value = 2*dvalue^2-2*dvalue (< 2^53)
409function am1(i,x,w,j,c,n) {
410 while(--n >= 0) {
411 var v = x*this[i++]+w[j]+c;
412 c = Math.floor(v/0x4000000);
413 w[j++] = v&0x3ffffff;
414 }
415 return c;
416}
417// am2 avoids a big mult-and-extract completely.
418// Max digit bits should be <= 30 because we do bitwise ops
419// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)
420function am2(i,x,w,j,c,n) {
421 var xl = x&0x7fff, xh = x>>15;
422 while(--n >= 0) {
423 var l = this[i]&0x7fff;
424 var h = this[i++]>>15;
425 var m = xh*l+h*xl;
426 l = xl*l+((m&0x7fff)<<15)+w[j]+(c&0x3fffffff);
427 c = (l>>>30)+(m>>>15)+xh*h+(c>>>30);
428 w[j++] = l&0x3fffffff;
429 }
430 return c;
431}
432// Alternately, set max digit bits to 28 since some
433// browsers slow down when dealing with 32-bit numbers.
434function am3(i,x,w,j,c,n) {
435 var xl = x&0x3fff, xh = x>>14;
436 while(--n >= 0) {
437 var l = this[i]&0x3fff;
438 var h = this[i++]>>14;
439 var m = xh*l+h*xl;
440 l = xl*l+((m&0x3fff)<<14)+w[j]+c;
441 c = (l>>28)+(m>>14)+xh*h;
442 w[j++] = l&0xfffffff;
443 }
444 return c;
445}
446
447// wtf?
448BigInteger.prototype.am = am1;
449dbits = 26;
450
451/*
452if(j_lm && (navigator.appName == "Microsoft Internet Explorer")) {
453 BigInteger.prototype.am = am2;
454 dbits = 30;
455}
456else if(j_lm && (navigator.appName != "Netscape")) {
457 BigInteger.prototype.am = am1;
458 dbits = 26;
459}
460else { // Mozilla/Netscape seems to prefer am3
461 BigInteger.prototype.am = am3;
462 dbits = 28;
463}
464*/
465
466BigInteger.prototype.DB = dbits;
467BigInteger.prototype.DM = ((1<<dbits)-1);
468var DV = BigInteger.prototype.DV = (1<<dbits);
469
470var BI_FP = 52;
471BigInteger.prototype.FV = Math.pow(2,BI_FP);
472BigInteger.prototype.F1 = BI_FP-dbits;
473BigInteger.prototype.F2 = 2*dbits-BI_FP;
474
475// Digit conversions
476var BI_RM = "0123456789abcdefghijklmnopqrstuvwxyz";
477var BI_RC = new Array();
478var rr,vv;
479rr = "0".charCodeAt(0);
480for(vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;
481rr = "a".charCodeAt(0);
482for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
483rr = "A".charCodeAt(0);
484for(vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;
485
486function int2char(n) { return BI_RM.charAt(n); }
487function intAt(s,i) {
488 var c = BI_RC[s.charCodeAt(i)];
489 return (c==null)?-1:c;
490}
491
492// (protected) copy this to r
493function bnpCopyTo(r) {
494 for(var i = this.t-1; i >= 0; --i) r[i] = this[i];
495 r.t = this.t;
496 r.s = this.s;
497}
498
499// (protected) set from integer value x, -DV <= x < DV
500function bnpFromInt(x) {
501 this.t = 1;
502 this.s = (x<0)?-1:0;
503 if(x > 0) this[0] = x;
504 else if(x < -1) this[0] = x+DV;
505 else this.t = 0;
506}
507
508// return bigint initialized to value
509function nbv(i) { var r = nbi(); r.fromInt(i); return r; }
510
511// (protected) set from string and radix
512function bnpFromString(s,b) {
513 var self = this;
514
515 var k;
516 if(b == 16) k = 4;
517 else if(b == 8) k = 3;
518 else if(b == 256) k = 8; // byte array
519 else if(b == 2) k = 1;
520 else if(b == 32) k = 5;
521 else if(b == 4) k = 2;
522 else { self.fromRadix(s,b); return; }
523 self.t = 0;
524 self.s = 0;
525 var i = s.length, mi = false, sh = 0;
526 while(--i >= 0) {
527 var x = (k==8)?s[i]&0xff:intAt(s,i);
528 if(x < 0) {
529 if(s.charAt(i) == "-") mi = true;
530 continue;
531 }
532 mi = false;
533 if(sh == 0)
534 self[self.t++] = x;
535 else if(sh+k > self.DB) {
536 self[self.t-1] |= (x&((1<<(self.DB-sh))-1))<<sh;
537 self[self.t++] = (x>>(self.DB-sh));
538 }
539 else
540 self[self.t-1] |= x<<sh;
541 sh += k;
542 if(sh >= self.DB) sh -= self.DB;
543 }
544 if(k == 8 && (s[0]&0x80) != 0) {
545 self.s = -1;
546 if(sh > 0) self[self.t-1] |= ((1<<(self.DB-sh))-1)<<sh;
547 }
548 self.clamp();
549 if(mi) BigInteger.ZERO.subTo(self,self);
550}
551
552// (protected) clamp off excess high words
553function bnpClamp() {
554 var c = this.s&this.DM;
555 while(this.t > 0 && this[this.t-1] == c) --this.t;
556}
557
558// (public) return string representation in given radix
559function bnToString(b) {
560 var self = this;
561 if(self.s < 0) return "-"+self.negate().toString(b);
562 var k;
563 if(b == 16) k = 4;
564 else if(b == 8) k = 3;
565 else if(b == 2) k = 1;
566 else if(b == 32) k = 5;
567 else if(b == 4) k = 2;
568 else return self.toRadix(b);
569 var km = (1<<k)-1, d, m = false, r = "", i = self.t;
570 var p = self.DB-(i*self.DB)%k;
571 if(i-- > 0) {
572 if(p < self.DB && (d = self[i]>>p) > 0) { m = true; r = int2char(d); }
573 while(i >= 0) {
574 if(p < k) {
575 d = (self[i]&((1<<p)-1))<<(k-p);
576 d |= self[--i]>>(p+=self.DB-k);
577 }
578 else {
579 d = (self[i]>>(p-=k))&km;
580 if(p <= 0) { p += self.DB; --i; }
581 }
582 if(d > 0) m = true;
583 if(m) r += int2char(d);
584 }
585 }
586 return m?r:"0";
587}
588
589// (public) -this
590function bnNegate() { var r = nbi(); BigInteger.ZERO.subTo(this,r); return r; }
591
592// (public) |this|
593function bnAbs() { return (this.s<0)?this.negate():this; }
594
595// (public) return + if this > a, - if this < a, 0 if equal
596function bnCompareTo(a) {
597 var r = this.s-a.s;
598 if(r != 0) return r;
599 var i = this.t;
600 r = i-a.t;
601 if(r != 0) return (this.s<0)?-r:r;
602 while(--i >= 0) if((r=this[i]-a[i]) != 0) return r;
603 return 0;
604}
605
606// returns bit length of the integer x
607function nbits(x) {
608 var r = 1, t;
609 if((t=x>>>16) != 0) { x = t; r += 16; }
610 if((t=x>>8) != 0) { x = t; r += 8; }
611 if((t=x>>4) != 0) { x = t; r += 4; }
612 if((t=x>>2) != 0) { x = t; r += 2; }
613 if((t=x>>1) != 0) { x = t; r += 1; }
614 return r;
615}
616
617// (public) return the number of bits in "this"
618function bnBitLength() {
619 if(this.t <= 0) return 0;
620 return this.DB*(this.t-1)+nbits(this[this.t-1]^(this.s&this.DM));
621}
622
623// (protected) r = this << n*DB
624function bnpDLShiftTo(n,r) {
625 var i;
626 for(i = this.t-1; i >= 0; --i) r[i+n] = this[i];
627 for(i = n-1; i >= 0; --i) r[i] = 0;
628 r.t = this.t+n;
629 r.s = this.s;
630}
631
632// (protected) r = this >> n*DB
633function bnpDRShiftTo(n,r) {
634 for(var i = n; i < this.t; ++i) r[i-n] = this[i];
635 r.t = Math.max(this.t-n,0);
636 r.s = this.s;
637}
638
639// (protected) r = this << n
640function bnpLShiftTo(n,r) {
641 var self = this;
642 var bs = n%self.DB;
643 var cbs = self.DB-bs;
644 var bm = (1<<cbs)-1;
645 var ds = Math.floor(n/self.DB), c = (self.s<<bs)&self.DM, i;
646 for(i = self.t-1; i >= 0; --i) {
647 r[i+ds+1] = (self[i]>>cbs)|c;
648 c = (self[i]&bm)<<bs;
649 }
650 for(i = ds-1; i >= 0; --i) r[i] = 0;
651 r[ds] = c;
652 r.t = self.t+ds+1;
653 r.s = self.s;
654 r.clamp();
655}
656
657// (protected) r = this >> n
658function bnpRShiftTo(n,r) {
659 var self = this;
660 r.s = self.s;
661 var ds = Math.floor(n/self.DB);
662 if(ds >= self.t) { r.t = 0; return; }
663 var bs = n%self.DB;
664 var cbs = self.DB-bs;
665 var bm = (1<<bs)-1;
666 r[0] = self[ds]>>bs;
667 for(var i = ds+1; i < self.t; ++i) {
668 r[i-ds-1] |= (self[i]&bm)<<cbs;
669 r[i-ds] = self[i]>>bs;
670 }
671 if(bs > 0) r[self.t-ds-1] |= (self.s&bm)<<cbs;
672 r.t = self.t-ds;
673 r.clamp();
674}
675
676// (protected) r = this - a
677function bnpSubTo(a,r) {
678 var self = this;
679 var i = 0, c = 0, m = Math.min(a.t,self.t);
680 while(i < m) {
681 c += self[i]-a[i];
682 r[i++] = c&self.DM;
683 c >>= self.DB;
684 }
685 if(a.t < self.t) {
686 c -= a.s;
687 while(i < self.t) {
688 c += self[i];
689 r[i++] = c&self.DM;
690 c >>= self.DB;
691 }
692 c += self.s;
693 }
694 else {
695 c += self.s;
696 while(i < a.t) {
697 c -= a[i];
698 r[i++] = c&self.DM;
699 c >>= self.DB;
700 }
701 c -= a.s;
702 }
703 r.s = (c<0)?-1:0;
704 if(c < -1) r[i++] = self.DV+c;
705 else if(c > 0) r[i++] = c;
706 r.t = i;
707 r.clamp();
708}
709
710// (protected) r = this * a, r != this,a (HAC 14.12)
711// "this" should be the larger one if appropriate.
712function bnpMultiplyTo(a,r) {
713 var x = this.abs(), y = a.abs();
714 var i = x.t;
715 r.t = i+y.t;
716 while(--i >= 0) r[i] = 0;
717 for(i = 0; i < y.t; ++i) r[i+x.t] = x.am(0,y[i],r,i,0,x.t);
718 r.s = 0;
719 r.clamp();
720 if(this.s != a.s) BigInteger.ZERO.subTo(r,r);
721}
722
723// (protected) r = this^2, r != this (HAC 14.16)
724function bnpSquareTo(r) {
725 var x = this.abs();
726 var i = r.t = 2*x.t;
727 while(--i >= 0) r[i] = 0;
728 for(i = 0; i < x.t-1; ++i) {
729 var c = x.am(i,x[i],r,2*i,0,1);
730 if((r[i+x.t]+=x.am(i+1,2*x[i],r,2*i+1,c,x.t-i-1)) >= x.DV) {
731 r[i+x.t] -= x.DV;
732 r[i+x.t+1] = 1;
733 }
734 }
735 if(r.t > 0) r[r.t-1] += x.am(i,x[i],r,2*i,0,1);
736 r.s = 0;
737 r.clamp();
738}
739
740// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)
741// r != q, this != m. q or r may be null.
742function bnpDivRemTo(m,q,r) {
743 var self = this;
744 var pm = m.abs();
745 if(pm.t <= 0) return;
746 var pt = self.abs();
747 if(pt.t < pm.t) {
748 if(q != null) q.fromInt(0);
749 if(r != null) self.copyTo(r);
750 return;
751 }
752 if(r == null) r = nbi();
753 var y = nbi(), ts = self.s, ms = m.s;
754 var nsh = self.DB-nbits(pm[pm.t-1]); // normalize modulus
755 if(nsh > 0) { pm.lShiftTo(nsh,y); pt.lShiftTo(nsh,r); }
756 else { pm.copyTo(y); pt.copyTo(r); }
757 var ys = y.t;
758 var y0 = y[ys-1];
759 if(y0 == 0) return;
760 var yt = y0*(1<<self.F1)+((ys>1)?y[ys-2]>>self.F2:0);
761 var d1 = self.FV/yt, d2 = (1<<self.F1)/yt, e = 1<<self.F2;
762 var i = r.t, j = i-ys, t = (q==null)?nbi():q;
763 y.dlShiftTo(j,t);
764 if(r.compareTo(t) >= 0) {
765 r[r.t++] = 1;
766 r.subTo(t,r);
767 }
768 BigInteger.ONE.dlShiftTo(ys,t);
769 t.subTo(y,y); // "negative" y so we can replace sub with am later
770 while(y.t < ys) y[y.t++] = 0;
771 while(--j >= 0) {
772 // Estimate quotient digit
773 var qd = (r[--i]==y0)?self.DM:Math.floor(r[i]*d1+(r[i-1]+e)*d2);
774 if((r[i]+=y.am(0,qd,r,j,0,ys)) < qd) { // Try it out
775 y.dlShiftTo(j,t);
776 r.subTo(t,r);
777 while(r[i] < --qd) r.subTo(t,r);
778 }
779 }
780 if(q != null) {
781 r.drShiftTo(ys,q);
782 if(ts != ms) BigInteger.ZERO.subTo(q,q);
783 }
784 r.t = ys;
785 r.clamp();
786 if(nsh > 0) r.rShiftTo(nsh,r); // Denormalize remainder
787 if(ts < 0) BigInteger.ZERO.subTo(r,r);
788}
789
790// (public) this mod a
791function bnMod(a) {
792 var r = nbi();
793 this.abs().divRemTo(a,null,r);
794 if(this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r,r);
795 return r;
796}
797
798// Modular reduction using "classic" algorithm
799function Classic(m) { this.m = m; }
800function cConvert(x) {
801 if(x.s < 0 || x.compareTo(this.m) >= 0) return x.mod(this.m);
802 else return x;
803}
804function cRevert(x) { return x; }
805function cReduce(x) { x.divRemTo(this.m,null,x); }
806function cMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
807function cSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
808
809Classic.prototype.convert = cConvert;
810Classic.prototype.revert = cRevert;
811Classic.prototype.reduce = cReduce;
812Classic.prototype.mulTo = cMulTo;
813Classic.prototype.sqrTo = cSqrTo;
814
815// (protected) return "-1/this % 2^DB"; useful for Mont. reduction
816// justification:
817// xy == 1 (mod m)
818// xy = 1+km
819// xy(2-xy) = (1+km)(1-km)
820// x[y(2-xy)] = 1-k^2m^2
821// x[y(2-xy)] == 1 (mod m^2)
822// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2
823// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.
824// JS multiply "overflows" differently from C/C++, so care is needed here.
825function bnpInvDigit() {
826 if(this.t < 1) return 0;
827 var x = this[0];
828 if((x&1) == 0) return 0;
829 var y = x&3; // y == 1/x mod 2^2
830 y = (y*(2-(x&0xf)*y))&0xf; // y == 1/x mod 2^4
831 y = (y*(2-(x&0xff)*y))&0xff; // y == 1/x mod 2^8
832 y = (y*(2-(((x&0xffff)*y)&0xffff)))&0xffff; // y == 1/x mod 2^16
833 // last step - calculate inverse mod DV directly;
834 // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints
835 y = (y*(2-x*y%this.DV))%this.DV; // y == 1/x mod 2^dbits
836 // we really want the negative inverse, and -DV < y < DV
837 return (y>0)?this.DV-y:-y;
838}
839
840// Montgomery reduction
841function Montgomery(m) {
842 this.m = m;
843 this.mp = m.invDigit();
844 this.mpl = this.mp&0x7fff;
845 this.mph = this.mp>>15;
846 this.um = (1<<(m.DB-15))-1;
847 this.mt2 = 2*m.t;
848}
849
850// xR mod m
851function montConvert(x) {
852 var r = nbi();
853 x.abs().dlShiftTo(this.m.t,r);
854 r.divRemTo(this.m,null,r);
855 if(x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r,r);
856 return r;
857}
858
859// x/R mod m
860function montRevert(x) {
861 var r = nbi();
862 x.copyTo(r);
863 this.reduce(r);
864 return r;
865}
866
867// x = x/R mod m (HAC 14.32)
868function montReduce(x) {
869 while(x.t <= this.mt2) // pad x so am has enough room later
870 x[x.t++] = 0;
871 for(var i = 0; i < this.m.t; ++i) {
872 // faster way of calculating u0 = x[i]*mp mod DV
873 var j = x[i]&0x7fff;
874 var u0 = (j*this.mpl+(((j*this.mph+(x[i]>>15)*this.mpl)&this.um)<<15))&x.DM;
875 // use am to combine the multiply-shift-add into one call
876 j = i+this.m.t;
877 x[j] += this.m.am(0,u0,x,i,0,this.m.t);
878 // propagate carry
879 while(x[j] >= x.DV) { x[j] -= x.DV; x[++j]++; }
880 }
881 x.clamp();
882 x.drShiftTo(this.m.t,x);
883 if(x.compareTo(this.m) >= 0) x.subTo(this.m,x);
884}
885
886// r = "x^2/R mod m"; x != r
887function montSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
888
889// r = "xy/R mod m"; x,y != r
890function montMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
891
892Montgomery.prototype.convert = montConvert;
893Montgomery.prototype.revert = montRevert;
894Montgomery.prototype.reduce = montReduce;
895Montgomery.prototype.mulTo = montMulTo;
896Montgomery.prototype.sqrTo = montSqrTo;
897
898// (protected) true iff this is even
899function bnpIsEven() { return ((this.t>0)?(this[0]&1):this.s) == 0; }
900
901// (protected) this^e, e < 2^32, doing sqr and mul with "r" (HAC 14.79)
902function bnpExp(e,z) {
903 if(e > 0xffffffff || e < 1) return BigInteger.ONE;
904 var r = nbi(), r2 = nbi(), g = z.convert(this), i = nbits(e)-1;
905 g.copyTo(r);
906 while(--i >= 0) {
907 z.sqrTo(r,r2);
908 if((e&(1<<i)) > 0) z.mulTo(r2,g,r);
909 else { var t = r; r = r2; r2 = t; }
910 }
911 return z.revert(r);
912}
913
914// (public) this^e % m, 0 <= e < 2^32
915function bnModPowInt(e,m) {
916 var z;
917 if(e < 256 || m.isEven()) z = new Classic(m); else z = new Montgomery(m);
918 return this.exp(e,z);
919}
920
921// protected
922proto.copyTo = bnpCopyTo;
923proto.fromInt = bnpFromInt;
924proto.fromString = bnpFromString;
925proto.clamp = bnpClamp;
926proto.dlShiftTo = bnpDLShiftTo;
927proto.drShiftTo = bnpDRShiftTo;
928proto.lShiftTo = bnpLShiftTo;
929proto.rShiftTo = bnpRShiftTo;
930proto.subTo = bnpSubTo;
931proto.multiplyTo = bnpMultiplyTo;
932proto.squareTo = bnpSquareTo;
933proto.divRemTo = bnpDivRemTo;
934proto.invDigit = bnpInvDigit;
935proto.isEven = bnpIsEven;
936proto.exp = bnpExp;
937
938// public
939proto.toString = bnToString;
940proto.negate = bnNegate;
941proto.abs = bnAbs;
942proto.compareTo = bnCompareTo;
943proto.bitLength = bnBitLength;
944proto.mod = bnMod;
945proto.modPowInt = bnModPowInt;
946
947//// jsbn2
948
949function nbi() { return new BigInteger(null); }
950
951// (public)
952function bnClone() { var r = nbi(); this.copyTo(r); return r; }
953
954// (public) return value as integer
955function bnIntValue() {
956 if(this.s < 0) {
957 if(this.t == 1) return this[0]-this.DV;
958 else if(this.t == 0) return -1;
959 }
960 else if(this.t == 1) return this[0];
961 else if(this.t == 0) return 0;
962 // assumes 16 < DB < 32
963 return ((this[1]&((1<<(32-this.DB))-1))<<this.DB)|this[0];
964}
965
966// (public) return value as byte
967function bnByteValue() { return (this.t==0)?this.s:(this[0]<<24)>>24; }
968
969// (public) return value as short (assumes DB>=16)
970function bnShortValue() { return (this.t==0)?this.s:(this[0]<<16)>>16; }
971
972// (protected) return x s.t. r^x < DV
973function bnpChunkSize(r) { return Math.floor(Math.LN2*this.DB/Math.log(r)); }
974
975// (public) 0 if this == 0, 1 if this > 0
976function bnSigNum() {
977 if(this.s < 0) return -1;
978 else if(this.t <= 0 || (this.t == 1 && this[0] <= 0)) return 0;
979 else return 1;
980}
981
982// (protected) convert to radix string
983function bnpToRadix(b) {
984 if(b == null) b = 10;
985 if(this.signum() == 0 || b < 2 || b > 36) return "0";
986 var cs = this.chunkSize(b);
987 var a = Math.pow(b,cs);
988 var d = nbv(a), y = nbi(), z = nbi(), r = "";
989 this.divRemTo(d,y,z);
990 while(y.signum() > 0) {
991 r = (a+z.intValue()).toString(b).substr(1) + r;
992 y.divRemTo(d,y,z);
993 }
994 return z.intValue().toString(b) + r;
995}
996
997// (protected) convert from radix string
998function bnpFromRadix(s,b) {
999 var self = this;
1000 self.fromInt(0);
1001 if(b == null) b = 10;
1002 var cs = self.chunkSize(b);
1003 var d = Math.pow(b,cs), mi = false, j = 0, w = 0;
1004 for(var i = 0; i < s.length; ++i) {
1005 var x = intAt(s,i);
1006 if(x < 0) {
1007 if(s.charAt(i) == "-" && self.signum() == 0) mi = true;
1008 continue;
1009 }
1010 w = b*w+x;
1011 if(++j >= cs) {
1012 self.dMultiply(d);
1013 self.dAddOffset(w,0);
1014 j = 0;
1015 w = 0;
1016 }
1017 }
1018 if(j > 0) {
1019 self.dMultiply(Math.pow(b,j));
1020 self.dAddOffset(w,0);
1021 }
1022 if(mi) BigInteger.ZERO.subTo(self,self);
1023}
1024
1025// (protected) alternate constructor
1026function bnpFromNumber(a,b,c) {
1027 var self = this;
1028 if("number" == typeof b) {
1029 // new BigInteger(int,int,RNG)
1030 if(a < 2) self.fromInt(1);
1031 else {
1032 self.fromNumber(a,c);
1033 if(!self.testBit(a-1)) // force MSB set
1034 self.bitwiseTo(BigInteger.ONE.shiftLeft(a-1),op_or,self);
1035 if(self.isEven()) self.dAddOffset(1,0); // force odd
1036 while(!self.isProbablePrime(b)) {
1037 self.dAddOffset(2,0);
1038 if(self.bitLength() > a) self.subTo(BigInteger.ONE.shiftLeft(a-1),self);
1039 }
1040 }
1041 }
1042 else {
1043 // new BigInteger(int,RNG)
1044 var x = new Array(), t = a&7;
1045 x.length = (a>>3)+1;
1046 b.nextBytes(x);
1047 if(t > 0) x[0] &= ((1<<t)-1); else x[0] = 0;
1048 self.fromString(x,256);
1049 }
1050}
1051
1052// (public) convert to bigendian byte array
1053function bnToByteArray() {
1054 var self = this;
1055 var i = self.t, r = new Array();
1056 r[0] = self.s;
1057 var p = self.DB-(i*self.DB)%8, d, k = 0;
1058 if(i-- > 0) {
1059 if(p < self.DB && (d = self[i]>>p) != (self.s&self.DM)>>p)
1060 r[k++] = d|(self.s<<(self.DB-p));
1061 while(i >= 0) {
1062 if(p < 8) {
1063 d = (self[i]&((1<<p)-1))<<(8-p);
1064 d |= self[--i]>>(p+=self.DB-8);
1065 }
1066 else {
1067 d = (self[i]>>(p-=8))&0xff;
1068 if(p <= 0) { p += self.DB; --i; }
1069 }
1070 if((d&0x80) != 0) d |= -256;
1071 if(k === 0 && (self.s&0x80) != (d&0x80)) ++k;
1072 if(k > 0 || d != self.s) r[k++] = d;
1073 }
1074 }
1075 return r;
1076}
1077
1078function bnEquals(a) { return(this.compareTo(a)==0); }
1079function bnMin(a) { return(this.compareTo(a)<0)?this:a; }
1080function bnMax(a) { return(this.compareTo(a)>0)?this:a; }
1081
1082// (protected) r = this op a (bitwise)
1083function bnpBitwiseTo(a,op,r) {
1084 var self = this;
1085 var i, f, m = Math.min(a.t,self.t);
1086 for(i = 0; i < m; ++i) r[i] = op(self[i],a[i]);
1087 if(a.t < self.t) {
1088 f = a.s&self.DM;
1089 for(i = m; i < self.t; ++i) r[i] = op(self[i],f);
1090 r.t = self.t;
1091 }
1092 else {
1093 f = self.s&self.DM;
1094 for(i = m; i < a.t; ++i) r[i] = op(f,a[i]);
1095 r.t = a.t;
1096 }
1097 r.s = op(self.s,a.s);
1098 r.clamp();
1099}
1100
1101// (public) this & a
1102function op_and(x,y) { return x&y; }
1103function bnAnd(a) { var r = nbi(); this.bitwiseTo(a,op_and,r); return r; }
1104
1105// (public) this | a
1106function op_or(x,y) { return x|y; }
1107function bnOr(a) { var r = nbi(); this.bitwiseTo(a,op_or,r); return r; }
1108
1109// (public) this ^ a
1110function op_xor(x,y) { return x^y; }
1111function bnXor(a) { var r = nbi(); this.bitwiseTo(a,op_xor,r); return r; }
1112
1113// (public) this & ~a
1114function op_andnot(x,y) { return x&~y; }
1115function bnAndNot(a) { var r = nbi(); this.bitwiseTo(a,op_andnot,r); return r; }
1116
1117// (public) ~this
1118function bnNot() {
1119 var r = nbi();
1120 for(var i = 0; i < this.t; ++i) r[i] = this.DM&~this[i];
1121 r.t = this.t;
1122 r.s = ~this.s;
1123 return r;
1124}
1125
1126// (public) this << n
1127function bnShiftLeft(n) {
1128 var r = nbi();
1129 if(n < 0) this.rShiftTo(-n,r); else this.lShiftTo(n,r);
1130 return r;
1131}
1132
1133// (public) this >> n
1134function bnShiftRight(n) {
1135 var r = nbi();
1136 if(n < 0) this.lShiftTo(-n,r); else this.rShiftTo(n,r);
1137 return r;
1138}
1139
1140// return index of lowest 1-bit in x, x < 2^31
1141function lbit(x) {
1142 if(x == 0) return -1;
1143 var r = 0;
1144 if((x&0xffff) == 0) { x >>= 16; r += 16; }
1145 if((x&0xff) == 0) { x >>= 8; r += 8; }
1146 if((x&0xf) == 0) { x >>= 4; r += 4; }
1147 if((x&3) == 0) { x >>= 2; r += 2; }
1148 if((x&1) == 0) ++r;
1149 return r;
1150}
1151
1152// (public) returns index of lowest 1-bit (or -1 if none)
1153function bnGetLowestSetBit() {
1154 for(var i = 0; i < this.t; ++i)
1155 if(this[i] != 0) return i*this.DB+lbit(this[i]);
1156 if(this.s < 0) return this.t*this.DB;
1157 return -1;
1158}
1159
1160// return number of 1 bits in x
1161function cbit(x) {
1162 var r = 0;
1163 while(x != 0) { x &= x-1; ++r; }
1164 return r;
1165}
1166
1167// (public) return number of set bits
1168function bnBitCount() {
1169 var r = 0, x = this.s&this.DM;
1170 for(var i = 0; i < this.t; ++i) r += cbit(this[i]^x);
1171 return r;
1172}
1173
1174// (public) true iff nth bit is set
1175function bnTestBit(n) {
1176 var j = Math.floor(n/this.DB);
1177 if(j >= this.t) return(this.s!=0);
1178 return((this[j]&(1<<(n%this.DB)))!=0);
1179}
1180
1181// (protected) this op (1<<n)
1182function bnpChangeBit(n,op) {
1183 var r = BigInteger.ONE.shiftLeft(n);
1184 this.bitwiseTo(r,op,r);
1185 return r;
1186}
1187
1188// (public) this | (1<<n)
1189function bnSetBit(n) { return this.changeBit(n,op_or); }
1190
1191// (public) this & ~(1<<n)
1192function bnClearBit(n) { return this.changeBit(n,op_andnot); }
1193
1194// (public) this ^ (1<<n)
1195function bnFlipBit(n) { return this.changeBit(n,op_xor); }
1196
1197// (protected) r = this + a
1198function bnpAddTo(a,r) {
1199 var self = this;
1200
1201 var i = 0, c = 0, m = Math.min(a.t,self.t);
1202 while(i < m) {
1203 c += self[i]+a[i];
1204 r[i++] = c&self.DM;
1205 c >>= self.DB;
1206 }
1207 if(a.t < self.t) {
1208 c += a.s;
1209 while(i < self.t) {
1210 c += self[i];
1211 r[i++] = c&self.DM;
1212 c >>= self.DB;
1213 }
1214 c += self.s;
1215 }
1216 else {
1217 c += self.s;
1218 while(i < a.t) {
1219 c += a[i];
1220 r[i++] = c&self.DM;
1221 c >>= self.DB;
1222 }
1223 c += a.s;
1224 }
1225 r.s = (c<0)?-1:0;
1226 if(c > 0) r[i++] = c;
1227 else if(c < -1) r[i++] = self.DV+c;
1228 r.t = i;
1229 r.clamp();
1230}
1231
1232// (public) this + a
1233function bnAdd(a) { var r = nbi(); this.addTo(a,r); return r; }
1234
1235// (public) this - a
1236function bnSubtract(a) { var r = nbi(); this.subTo(a,r); return r; }
1237
1238// (public) this * a
1239function bnMultiply(a) { var r = nbi(); this.multiplyTo(a,r); return r; }
1240
1241// (public) this^2
1242function bnSquare() { var r = nbi(); this.squareTo(r); return r; }
1243
1244// (public) this / a
1245function bnDivide(a) { var r = nbi(); this.divRemTo(a,r,null); return r; }
1246
1247// (public) this % a
1248function bnRemainder(a) { var r = nbi(); this.divRemTo(a,null,r); return r; }
1249
1250// (public) [this/a,this%a]
1251function bnDivideAndRemainder(a) {
1252 var q = nbi(), r = nbi();
1253 this.divRemTo(a,q,r);
1254 return new Array(q,r);
1255}
1256
1257// (protected) this *= n, this >= 0, 1 < n < DV
1258function bnpDMultiply(n) {
1259 this[this.t] = this.am(0,n-1,this,0,0,this.t);
1260 ++this.t;
1261 this.clamp();
1262}
1263
1264// (protected) this += n << w words, this >= 0
1265function bnpDAddOffset(n,w) {
1266 if(n == 0) return;
1267 while(this.t <= w) this[this.t++] = 0;
1268 this[w] += n;
1269 while(this[w] >= this.DV) {
1270 this[w] -= this.DV;
1271 if(++w >= this.t) this[this.t++] = 0;
1272 ++this[w];
1273 }
1274}
1275
1276// A "null" reducer
1277function NullExp() {}
1278function nNop(x) { return x; }
1279function nMulTo(x,y,r) { x.multiplyTo(y,r); }
1280function nSqrTo(x,r) { x.squareTo(r); }
1281
1282NullExp.prototype.convert = nNop;
1283NullExp.prototype.revert = nNop;
1284NullExp.prototype.mulTo = nMulTo;
1285NullExp.prototype.sqrTo = nSqrTo;
1286
1287// (public) this^e
1288function bnPow(e) { return this.exp(e,new NullExp()); }
1289
1290// (protected) r = lower n words of "this * a", a.t <= n
1291// "this" should be the larger one if appropriate.
1292function bnpMultiplyLowerTo(a,n,r) {
1293 var i = Math.min(this.t+a.t,n);
1294 r.s = 0; // assumes a,this >= 0
1295 r.t = i;
1296 while(i > 0) r[--i] = 0;
1297 var j;
1298 for(j = r.t-this.t; i < j; ++i) r[i+this.t] = this.am(0,a[i],r,i,0,this.t);
1299 for(j = Math.min(a.t,n); i < j; ++i) this.am(0,a[i],r,i,0,n-i);
1300 r.clamp();
1301}
1302
1303// (protected) r = "this * a" without lower n words, n > 0
1304// "this" should be the larger one if appropriate.
1305function bnpMultiplyUpperTo(a,n,r) {
1306 --n;
1307 var i = r.t = this.t+a.t-n;
1308 r.s = 0; // assumes a,this >= 0
1309 while(--i >= 0) r[i] = 0;
1310 for(i = Math.max(n-this.t,0); i < a.t; ++i)
1311 r[this.t+i-n] = this.am(n-i,a[i],r,0,0,this.t+i-n);
1312 r.clamp();
1313 r.drShiftTo(1,r);
1314}
1315
1316// Barrett modular reduction
1317function Barrett(m) {
1318 // setup Barrett
1319 this.r2 = nbi();
1320 this.q3 = nbi();
1321 BigInteger.ONE.dlShiftTo(2*m.t,this.r2);
1322 this.mu = this.r2.divide(m);
1323 this.m = m;
1324}
1325
1326function barrettConvert(x) {
1327 if(x.s < 0 || x.t > 2*this.m.t) return x.mod(this.m);
1328 else if(x.compareTo(this.m) < 0) return x;
1329 else { var r = nbi(); x.copyTo(r); this.reduce(r); return r; }
1330}
1331
1332function barrettRevert(x) { return x; }
1333
1334// x = x mod m (HAC 14.42)
1335function barrettReduce(x) {
1336 var self = this;
1337 x.drShiftTo(self.m.t-1,self.r2);
1338 if(x.t > self.m.t+1) { x.t = self.m.t+1; x.clamp(); }
1339 self.mu.multiplyUpperTo(self.r2,self.m.t+1,self.q3);
1340 self.m.multiplyLowerTo(self.q3,self.m.t+1,self.r2);
1341 while(x.compareTo(self.r2) < 0) x.dAddOffset(1,self.m.t+1);
1342 x.subTo(self.r2,x);
1343 while(x.compareTo(self.m) >= 0) x.subTo(self.m,x);
1344}
1345
1346// r = x^2 mod m; x != r
1347function barrettSqrTo(x,r) { x.squareTo(r); this.reduce(r); }
1348
1349// r = x*y mod m; x,y != r
1350function barrettMulTo(x,y,r) { x.multiplyTo(y,r); this.reduce(r); }
1351
1352Barrett.prototype.convert = barrettConvert;
1353Barrett.prototype.revert = barrettRevert;
1354Barrett.prototype.reduce = barrettReduce;
1355Barrett.prototype.mulTo = barrettMulTo;
1356Barrett.prototype.sqrTo = barrettSqrTo;
1357
1358// (public) this^e % m (HAC 14.85)
1359function bnModPow(e,m) {
1360 var i = e.bitLength(), k, r = nbv(1), z;
1361 if(i <= 0) return r;
1362 else if(i < 18) k = 1;
1363 else if(i < 48) k = 3;
1364 else if(i < 144) k = 4;
1365 else if(i < 768) k = 5;
1366 else k = 6;
1367 if(i < 8)
1368 z = new Classic(m);
1369 else if(m.isEven())
1370 z = new Barrett(m);
1371 else
1372 z = new Montgomery(m);
1373
1374 // precomputation
1375 var g = new Array(), n = 3, k1 = k-1, km = (1<<k)-1;
1376 g[1] = z.convert(this);
1377 if(k > 1) {
1378 var g2 = nbi();
1379 z.sqrTo(g[1],g2);
1380 while(n <= km) {
1381 g[n] = nbi();
1382 z.mulTo(g2,g[n-2],g[n]);
1383 n += 2;
1384 }
1385 }
1386
1387 var j = e.t-1, w, is1 = true, r2 = nbi(), t;
1388 i = nbits(e[j])-1;
1389 while(j >= 0) {
1390 if(i >= k1) w = (e[j]>>(i-k1))&km;
1391 else {
1392 w = (e[j]&((1<<(i+1))-1))<<(k1-i);
1393 if(j > 0) w |= e[j-1]>>(this.DB+i-k1);
1394 }
1395
1396 n = k;
1397 while((w&1) == 0) { w >>= 1; --n; }
1398 if((i -= n) < 0) { i += this.DB; --j; }
1399 if(is1) { // ret == 1, don't bother squaring or multiplying it
1400 g[w].copyTo(r);
1401 is1 = false;
1402 }
1403 else {
1404 while(n > 1) { z.sqrTo(r,r2); z.sqrTo(r2,r); n -= 2; }
1405 if(n > 0) z.sqrTo(r,r2); else { t = r; r = r2; r2 = t; }
1406 z.mulTo(r2,g[w],r);
1407 }
1408
1409 while(j >= 0 && (e[j]&(1<<i)) == 0) {
1410 z.sqrTo(r,r2); t = r; r = r2; r2 = t;
1411 if(--i < 0) { i = this.DB-1; --j; }
1412 }
1413 }
1414 return z.revert(r);
1415}
1416
1417// (public) gcd(this,a) (HAC 14.54)
1418function bnGCD(a) {
1419 var x = (this.s<0)?this.negate():this.clone();
1420 var y = (a.s<0)?a.negate():a.clone();
1421 if(x.compareTo(y) < 0) { var t = x; x = y; y = t; }
1422 var i = x.getLowestSetBit(), g = y.getLowestSetBit();
1423 if(g < 0) return x;
1424 if(i < g) g = i;
1425 if(g > 0) {
1426 x.rShiftTo(g,x);
1427 y.rShiftTo(g,y);
1428 }
1429 while(x.signum() > 0) {
1430 if((i = x.getLowestSetBit()) > 0) x.rShiftTo(i,x);
1431 if((i = y.getLowestSetBit()) > 0) y.rShiftTo(i,y);
1432 if(x.compareTo(y) >= 0) {
1433 x.subTo(y,x);
1434 x.rShiftTo(1,x);
1435 }
1436 else {
1437 y.subTo(x,y);
1438 y.rShiftTo(1,y);
1439 }
1440 }
1441 if(g > 0) y.lShiftTo(g,y);
1442 return y;
1443}
1444
1445// (protected) this % n, n < 2^26
1446function bnpModInt(n) {
1447 if(n <= 0) return 0;
1448 var d = this.DV%n, r = (this.s<0)?n-1:0;
1449 if(this.t > 0)
1450 if(d == 0) r = this[0]%n;
1451 else for(var i = this.t-1; i >= 0; --i) r = (d*r+this[i])%n;
1452 return r;
1453}
1454
1455// (public) 1/this % m (HAC 14.61)
1456function bnModInverse(m) {
1457 var ac = m.isEven();
1458 if((this.isEven() && ac) || m.signum() == 0) return BigInteger.ZERO;
1459 var u = m.clone(), v = this.clone();
1460 var a = nbv(1), b = nbv(0), c = nbv(0), d = nbv(1);
1461 while(u.signum() != 0) {
1462 while(u.isEven()) {
1463 u.rShiftTo(1,u);
1464 if(ac) {
1465 if(!a.isEven() || !b.isEven()) { a.addTo(this,a); b.subTo(m,b); }
1466 a.rShiftTo(1,a);
1467 }
1468 else if(!b.isEven()) b.subTo(m,b);
1469 b.rShiftTo(1,b);
1470 }
1471 while(v.isEven()) {
1472 v.rShiftTo(1,v);
1473 if(ac) {
1474 if(!c.isEven() || !d.isEven()) { c.addTo(this,c); d.subTo(m,d); }
1475 c.rShiftTo(1,c);
1476 }
1477 else if(!d.isEven()) d.subTo(m,d);
1478 d.rShiftTo(1,d);
1479 }
1480 if(u.compareTo(v) >= 0) {
1481 u.subTo(v,u);
1482 if(ac) a.subTo(c,a);
1483 b.subTo(d,b);
1484 }
1485 else {
1486 v.subTo(u,v);
1487 if(ac) c.subTo(a,c);
1488 d.subTo(b,d);
1489 }
1490 }
1491 if(v.compareTo(BigInteger.ONE) != 0) return BigInteger.ZERO;
1492 if(d.compareTo(m) >= 0) return d.subtract(m);
1493 if(d.signum() < 0) d.addTo(m,d); else return d;
1494 if(d.signum() < 0) return d.add(m); else return d;
1495}
1496
1497// protected
1498proto.chunkSize = bnpChunkSize;
1499proto.toRadix = bnpToRadix;
1500proto.fromRadix = bnpFromRadix;
1501proto.fromNumber = bnpFromNumber;
1502proto.bitwiseTo = bnpBitwiseTo;
1503proto.changeBit = bnpChangeBit;
1504proto.addTo = bnpAddTo;
1505proto.dMultiply = bnpDMultiply;
1506proto.dAddOffset = bnpDAddOffset;
1507proto.multiplyLowerTo = bnpMultiplyLowerTo;
1508proto.multiplyUpperTo = bnpMultiplyUpperTo;
1509proto.modInt = bnpModInt;
1510
1511// public
1512proto.clone = bnClone;
1513proto.intValue = bnIntValue;
1514proto.byteValue = bnByteValue;
1515proto.shortValue = bnShortValue;
1516proto.signum = bnSigNum;
1517proto.toByteArray = bnToByteArray;
1518proto.equals = bnEquals;
1519proto.min = bnMin;
1520proto.max = bnMax;
1521proto.and = bnAnd;
1522proto.or = bnOr;
1523proto.xor = bnXor;
1524proto.andNot = bnAndNot;
1525proto.not = bnNot;
1526proto.shiftLeft = bnShiftLeft;
1527proto.shiftRight = bnShiftRight;
1528proto.getLowestSetBit = bnGetLowestSetBit;
1529proto.bitCount = bnBitCount;
1530proto.testBit = bnTestBit;
1531proto.setBit = bnSetBit;
1532proto.clearBit = bnClearBit;
1533proto.flipBit = bnFlipBit;
1534proto.add = bnAdd;
1535proto.subtract = bnSubtract;
1536proto.multiply = bnMultiply;
1537proto.divide = bnDivide;
1538proto.remainder = bnRemainder;
1539proto.divideAndRemainder = bnDivideAndRemainder;
1540proto.modPow = bnModPow;
1541proto.modInverse = bnModInverse;
1542proto.pow = bnPow;
1543proto.gcd = bnGCD;
1544
1545// JSBN-specific extension
1546proto.square = bnSquare;
1547
1548// BigInteger interfaces not implemented in jsbn:
1549
1550// BigInteger(int signum, byte[] magnitude)
1551// double doubleValue()
1552// float floatValue()
1553// int hashCode()
1554// long longValue()
1555// static BigInteger valueOf(long val)
1556
1557// "constants"
1558BigInteger.ZERO = nbv(0);
1559BigInteger.ONE = nbv(1);
1560BigInteger.valueOf = nbv;
1561
1562},{"assert":4}],2:[function(_dereq_,module,exports){
1563(function (Buffer){
1564// FIXME: Kind of a weird way to throw exceptions, consider removing
1565var assert = _dereq_('assert')
1566var BigInteger = _dereq_('./bigi')
1567
1568/**
1569 * Turns a byte array into a big integer.
1570 *
1571 * This function will interpret a byte array as a big integer in big
1572 * endian notation.
1573 */
1574BigInteger.fromByteArrayUnsigned = function(byteArray) {
1575 // BigInteger expects a DER integer conformant byte array
1576 if (byteArray[0] & 0x80) {
1577 return new BigInteger([0].concat(byteArray))
1578 }
1579
1580 return new BigInteger(byteArray)
1581}
1582
1583/**
1584 * Returns a byte array representation of the big integer.
1585 *
1586 * This returns the absolute of the contained value in big endian
1587 * form. A value of zero results in an empty array.
1588 */
1589BigInteger.prototype.toByteArrayUnsigned = function() {
1590 var byteArray = this.toByteArray()
1591 return byteArray[0] === 0 ? byteArray.slice(1) : byteArray
1592}
1593
1594BigInteger.fromDERInteger = function(byteArray) {
1595 return new BigInteger(byteArray)
1596}
1597
1598/*
1599 * Converts BigInteger to a DER integer representation.
1600 *
1601 * The format for this value uses the most significant bit as a sign
1602 * bit. If the most significant bit is already set and the integer is
1603 * positive, a 0x00 is prepended.
1604 *
1605 * Examples:
1606 *
1607 * 0 => 0x00
1608 * 1 => 0x01
1609 * -1 => 0x81
1610 * 127 => 0x7f
1611 * -127 => 0xff
1612 * 128 => 0x0080
1613 * -128 => 0x80
1614 * 255 => 0x00ff
1615 * -255 => 0xff
1616 * 16300 => 0x3fac
1617 * -16300 => 0xbfac
1618 * 62300 => 0x00f35c
1619 * -62300 => 0xf35c
1620*/
1621BigInteger.prototype.toDERInteger = BigInteger.prototype.toByteArray
1622
1623BigInteger.fromBuffer = function(buffer) {
1624 // BigInteger expects a DER integer conformant byte array
1625 if (buffer[0] & 0x80) {
1626 var byteArray = Array.prototype.slice.call(buffer)
1627
1628 return new BigInteger([0].concat(byteArray))
1629 }
1630
1631 return new BigInteger(buffer)
1632}
1633
1634BigInteger.fromHex = function(hex) {
1635 if (hex === '') return BigInteger.ZERO
1636
1637 assert.equal(hex, hex.match(/^[A-Fa-f0-9]+/), 'Invalid hex string')
1638 assert.equal(hex.length % 2, 0, 'Incomplete hex')
1639 return new BigInteger(hex, 16)
1640}
1641
1642BigInteger.prototype.toBuffer = function(size) {
1643 var byteArray = this.toByteArrayUnsigned()
1644 var zeros = []
1645
1646 var padding = size - byteArray.length
1647 while (zeros.length < padding) zeros.push(0)
1648
1649 return new Buffer(zeros.concat(byteArray))
1650}
1651
1652BigInteger.prototype.toHex = function(size) {
1653 return this.toBuffer(size).toString('hex')
1654}
1655
1656}).call(this,_dereq_("buffer").Buffer)
1657},{"./bigi":1,"assert":4,"buffer":8}],3:[function(_dereq_,module,exports){
1658var BigInteger = _dereq_('./bigi')
1659
1660//addons
1661_dereq_('./convert')
1662
1663module.exports = BigInteger
1664},{"./bigi":1,"./convert":2}],4:[function(_dereq_,module,exports){
1665// http://wiki.commonjs.org/wiki/Unit_Testing/1.0
1666//
1667// THIS IS NOT TESTED NOR LIKELY TO WORK OUTSIDE V8!
1668//
1669// Originally from narwhal.js (http://narwhaljs.org)
1670// Copyright (c) 2009 Thomas Robinson <280north.com>
1671//
1672// Permission is hereby granted, free of charge, to any person obtaining a copy
1673// of this software and associated documentation files (the 'Software'), to
1674// deal in the Software without restriction, including without limitation the
1675// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
1676// sell copies of the Software, and to permit persons to whom the Software is
1677// furnished to do so, subject to the following conditions:
1678//
1679// The above copyright notice and this permission notice shall be included in
1680// all copies or substantial portions of the Software.
1681//
1682// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1683// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1684// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1685// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
1686// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
1687// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
1688
1689// when used in node, this will actually load the util module we depend on
1690// versus loading the builtin util module as happens otherwise
1691// this is a bug in node module loading as far as I am concerned
1692var util = _dereq_('util/');
1693
1694var pSlice = Array.prototype.slice;
1695var hasOwn = Object.prototype.hasOwnProperty;
1696
1697// 1. The assert module provides functions that throw
1698// AssertionError's when particular conditions are not met. The
1699// assert module must conform to the following interface.
1700
1701var assert = module.exports = ok;
1702
1703// 2. The AssertionError is defined in assert.
1704// new assert.AssertionError({ message: message,
1705// actual: actual,
1706// expected: expected })
1707
1708assert.AssertionError = function AssertionError(options) {
1709 this.name = 'AssertionError';
1710 this.actual = options.actual;
1711 this.expected = options.expected;
1712 this.operator = options.operator;
1713 if (options.message) {
1714 this.message = options.message;
1715 this.generatedMessage = false;
1716 } else {
1717 this.message = getMessage(this);
1718 this.generatedMessage = true;
1719 }
1720 var stackStartFunction = options.stackStartFunction || fail;
1721
1722 if (Error.captureStackTrace) {
1723 Error.captureStackTrace(this, stackStartFunction);
1724 }
1725 else {
1726 // non v8 browsers so we can have a stacktrace
1727 var err = new Error();
1728 if (err.stack) {
1729 var out = err.stack;
1730
1731 // try to strip useless frames
1732 var fn_name = stackStartFunction.name;
1733 var idx = out.indexOf('\n' + fn_name);
1734 if (idx >= 0) {
1735 // once we have located the function frame
1736 // we need to strip out everything before it (and its line)
1737 var next_line = out.indexOf('\n', idx + 1);
1738 out = out.substring(next_line + 1);
1739 }
1740
1741 this.stack = out;
1742 }
1743 }
1744};
1745
1746// assert.AssertionError instanceof Error
1747util.inherits(assert.AssertionError, Error);
1748
1749function replacer(key, value) {
1750 if (util.isUndefined(value)) {
1751 return '' + value;
1752 }
1753 if (util.isNumber(value) && (isNaN(value) || !isFinite(value))) {
1754 return value.toString();
1755 }
1756 if (util.isFunction(value) || util.isRegExp(value)) {
1757 return value.toString();
1758 }
1759 return value;
1760}
1761
1762function truncate(s, n) {
1763 if (util.isString(s)) {
1764 return s.length < n ? s : s.slice(0, n);
1765 } else {
1766 return s;
1767 }
1768}
1769
1770function getMessage(self) {
1771 return truncate(JSON.stringify(self.actual, replacer), 128) + ' ' +
1772 self.operator + ' ' +
1773 truncate(JSON.stringify(self.expected, replacer), 128);
1774}
1775
1776// At present only the three keys mentioned above are used and
1777// understood by the spec. Implementations or sub modules can pass
1778// other keys to the AssertionError's constructor - they will be
1779// ignored.
1780
1781// 3. All of the following functions must throw an AssertionError
1782// when a corresponding condition is not met, with a message that
1783// may be undefined if not provided. All assertion methods provide
1784// both the actual and expected values to the assertion error for
1785// display purposes.
1786
1787function fail(actual, expected, message, operator, stackStartFunction) {
1788 throw new assert.AssertionError({
1789 message: message,
1790 actual: actual,
1791 expected: expected,
1792 operator: operator,
1793 stackStartFunction: stackStartFunction
1794 });
1795}
1796
1797// EXTENSION! allows for well behaved errors defined elsewhere.
1798assert.fail = fail;
1799
1800// 4. Pure assertion tests whether a value is truthy, as determined
1801// by !!guard.
1802// assert.ok(guard, message_opt);
1803// This statement is equivalent to assert.equal(true, !!guard,
1804// message_opt);. To test strictly for the value true, use
1805// assert.strictEqual(true, guard, message_opt);.
1806
1807function ok(value, message) {
1808 if (!value) fail(value, true, message, '==', assert.ok);
1809}
1810assert.ok = ok;
1811
1812// 5. The equality assertion tests shallow, coercive equality with
1813// ==.
1814// assert.equal(actual, expected, message_opt);
1815
1816assert.equal = function equal(actual, expected, message) {
1817 if (actual != expected) fail(actual, expected, message, '==', assert.equal);
1818};
1819
1820// 6. The non-equality assertion tests for whether two objects are not equal
1821// with != assert.notEqual(actual, expected, message_opt);
1822
1823assert.notEqual = function notEqual(actual, expected, message) {
1824 if (actual == expected) {
1825 fail(actual, expected, message, '!=', assert.notEqual);
1826 }
1827};
1828
1829// 7. The equivalence assertion tests a deep equality relation.
1830// assert.deepEqual(actual, expected, message_opt);
1831
1832assert.deepEqual = function deepEqual(actual, expected, message) {
1833 if (!_deepEqual(actual, expected)) {
1834 fail(actual, expected, message, 'deepEqual', assert.deepEqual);
1835 }
1836};
1837
1838function _deepEqual(actual, expected) {
1839 // 7.1. All identical values are equivalent, as determined by ===.
1840 if (actual === expected) {
1841 return true;
1842
1843 } else if (util.isBuffer(actual) && util.isBuffer(expected)) {
1844 if (actual.length != expected.length) return false;
1845
1846 for (var i = 0; i < actual.length; i++) {
1847 if (actual[i] !== expected[i]) return false;
1848 }
1849
1850 return true;
1851
1852 // 7.2. If the expected value is a Date object, the actual value is
1853 // equivalent if it is also a Date object that refers to the same time.
1854 } else if (util.isDate(actual) && util.isDate(expected)) {
1855 return actual.getTime() === expected.getTime();
1856
1857 // 7.3 If the expected value is a RegExp object, the actual value is
1858 // equivalent if it is also a RegExp object with the same source and
1859 // properties (`global`, `multiline`, `lastIndex`, `ignoreCase`).
1860 } else if (util.isRegExp(actual) && util.isRegExp(expected)) {
1861 return actual.source === expected.source &&
1862 actual.global === expected.global &&
1863 actual.multiline === expected.multiline &&
1864 actual.lastIndex === expected.lastIndex &&
1865 actual.ignoreCase === expected.ignoreCase;
1866
1867 // 7.4. Other pairs that do not both pass typeof value == 'object',
1868 // equivalence is determined by ==.
1869 } else if (!util.isObject(actual) && !util.isObject(expected)) {
1870 return actual == expected;
1871
1872 // 7.5 For all other Object pairs, including Array objects, equivalence is
1873 // determined by having the same number of owned properties (as verified
1874 // with Object.prototype.hasOwnProperty.call), the same set of keys
1875 // (although not necessarily the same order), equivalent values for every
1876 // corresponding key, and an identical 'prototype' property. Note: this
1877 // accounts for both named and indexed properties on Arrays.
1878 } else {
1879 return objEquiv(actual, expected);
1880 }
1881}
1882
1883function isArguments(object) {
1884 return Object.prototype.toString.call(object) == '[object Arguments]';
1885}
1886
1887function objEquiv(a, b) {
1888 if (util.isNullOrUndefined(a) || util.isNullOrUndefined(b))
1889 return false;
1890 // an identical 'prototype' property.
1891 if (a.prototype !== b.prototype) return false;
1892 //~~~I've managed to break Object.keys through screwy arguments passing.
1893 // Converting to array solves the problem.
1894 if (isArguments(a)) {
1895 if (!isArguments(b)) {
1896 return false;
1897 }
1898 a = pSlice.call(a);
1899 b = pSlice.call(b);
1900 return _deepEqual(a, b);
1901 }
1902 try {
1903 var ka = objectKeys(a),
1904 kb = objectKeys(b),
1905 key, i;
1906 } catch (e) {//happens when one is a string literal and the other isn't
1907 return false;
1908 }
1909 // having the same number of owned properties (keys incorporates
1910 // hasOwnProperty)
1911 if (ka.length != kb.length)
1912 return false;
1913 //the same set of keys (although not necessarily the same order),
1914 ka.sort();
1915 kb.sort();
1916 //~~~cheap key test
1917 for (i = ka.length - 1; i >= 0; i--) {
1918 if (ka[i] != kb[i])
1919 return false;
1920 }
1921 //equivalent values for every corresponding key, and
1922 //~~~possibly expensive deep test
1923 for (i = ka.length - 1; i >= 0; i--) {
1924 key = ka[i];
1925 if (!_deepEqual(a[key], b[key])) return false;
1926 }
1927 return true;
1928}
1929
1930// 8. The non-equivalence assertion tests for any deep inequality.
1931// assert.notDeepEqual(actual, expected, message_opt);
1932
1933assert.notDeepEqual = function notDeepEqual(actual, expected, message) {
1934 if (_deepEqual(actual, expected)) {
1935 fail(actual, expected, message, 'notDeepEqual', assert.notDeepEqual);
1936 }
1937};
1938
1939// 9. The strict equality assertion tests strict equality, as determined by ===.
1940// assert.strictEqual(actual, expected, message_opt);
1941
1942assert.strictEqual = function strictEqual(actual, expected, message) {
1943 if (actual !== expected) {
1944 fail(actual, expected, message, '===', assert.strictEqual);
1945 }
1946};
1947
1948// 10. The strict non-equality assertion tests for strict inequality, as
1949// determined by !==. assert.notStrictEqual(actual, expected, message_opt);
1950
1951assert.notStrictEqual = function notStrictEqual(actual, expected, message) {
1952 if (actual === expected) {
1953 fail(actual, expected, message, '!==', assert.notStrictEqual);
1954 }
1955};
1956
1957function expectedException(actual, expected) {
1958 if (!actual || !expected) {
1959 return false;
1960 }
1961
1962 if (Object.prototype.toString.call(expected) == '[object RegExp]') {
1963 return expected.test(actual);
1964 } else if (actual instanceof expected) {
1965 return true;
1966 } else if (expected.call({}, actual) === true) {
1967 return true;
1968 }
1969
1970 return false;
1971}
1972
1973function _throws(shouldThrow, block, expected, message) {
1974 var actual;
1975
1976 if (util.isString(expected)) {
1977 message = expected;
1978 expected = null;
1979 }
1980
1981 try {
1982 block();
1983 } catch (e) {
1984 actual = e;
1985 }
1986
1987 message = (expected && expected.name ? ' (' + expected.name + ').' : '.') +
1988 (message ? ' ' + message : '.');
1989
1990 if (shouldThrow && !actual) {
1991 fail(actual, expected, 'Missing expected exception' + message);
1992 }
1993
1994 if (!shouldThrow && expectedException(actual, expected)) {
1995 fail(actual, expected, 'Got unwanted exception' + message);
1996 }
1997
1998 if ((shouldThrow && actual && expected &&
1999 !expectedException(actual, expected)) || (!shouldThrow && actual)) {
2000 throw actual;
2001 }
2002}
2003
2004// 11. Expected to throw an error:
2005// assert.throws(block, Error_opt, message_opt);
2006
2007assert.throws = function(block, /*optional*/error, /*optional*/message) {
2008 _throws.apply(this, [true].concat(pSlice.call(arguments)));
2009};
2010
2011// EXTENSION! This is annoying to write outside this module.
2012assert.doesNotThrow = function(block, /*optional*/message) {
2013 _throws.apply(this, [false].concat(pSlice.call(arguments)));
2014};
2015
2016assert.ifError = function(err) { if (err) {throw err;}};
2017
2018var objectKeys = Object.keys || function (obj) {
2019 var keys = [];
2020 for (var key in obj) {
2021 if (hasOwn.call(obj, key)) keys.push(key);
2022 }
2023 return keys;
2024};
2025
2026},{"util/":6}],5:[function(_dereq_,module,exports){
2027module.exports = function isBuffer(arg) {
2028 return arg && typeof arg === 'object'
2029 && typeof arg.copy === 'function'
2030 && typeof arg.fill === 'function'
2031 && typeof arg.readUInt8 === 'function';
2032}
2033},{}],6:[function(_dereq_,module,exports){
2034(function (process,global){
2035// Copyright Joyent, Inc. and other Node contributors.
2036//
2037// Permission is hereby granted, free of charge, to any person obtaining a
2038// copy of this software and associated documentation files (the
2039// "Software"), to deal in the Software without restriction, including
2040// without limitation the rights to use, copy, modify, merge, publish,
2041// distribute, sublicense, and/or sell copies of the Software, and to permit
2042// persons to whom the Software is furnished to do so, subject to the
2043// following conditions:
2044//
2045// The above copyright notice and this permission notice shall be included
2046// in all copies or substantial portions of the Software.
2047//
2048// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
2049// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
2050// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
2051// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
2052// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
2053// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
2054// USE OR OTHER DEALINGS IN THE SOFTWARE.
2055
2056var formatRegExp = /%[sdj%]/g;
2057exports.format = function(f) {
2058 if (!isString(f)) {
2059 var objects = [];
2060 for (var i = 0; i < arguments.length; i++) {
2061 objects.push(inspect(arguments[i]));
2062 }
2063 return objects.join(' ');
2064 }
2065
2066 var i = 1;
2067 var args = arguments;
2068 var len = args.length;
2069 var str = String(f).replace(formatRegExp, function(x) {
2070 if (x === '%%') return '%';
2071 if (i >= len) return x;
2072 switch (x) {
2073 case '%s': return String(args[i++]);
2074 case '%d': return Number(args[i++]);
2075 case '%j':
2076 try {
2077 return JSON.stringify(args[i++]);
2078 } catch (_) {
2079 return '[Circular]';
2080 }
2081 default:
2082 return x;
2083 }
2084 });
2085 for (var x = args[i]; i < len; x = args[++i]) {
2086 if (isNull(x) || !isObject(x)) {
2087 str += ' ' + x;
2088 } else {
2089 str += ' ' + inspect(x);
2090 }
2091 }
2092 return str;
2093};
2094
2095
2096// Mark that a method should not be used.
2097// Returns a modified function which warns once by default.
2098// If --no-deprecation is set, then it is a no-op.
2099exports.deprecate = function(fn, msg) {
2100 // Allow for deprecating things in the process of starting up.
2101 if (isUndefined(global.process)) {
2102 return function() {
2103 return exports.deprecate(fn, msg).apply(this, arguments);
2104 };
2105 }
2106
2107 if (process.noDeprecation === true) {
2108 return fn;
2109 }
2110
2111 var warned = false;
2112 function deprecated() {
2113 if (!warned) {
2114 if (process.throwDeprecation) {
2115 throw new Error(msg);
2116 } else if (process.traceDeprecation) {
2117 console.trace(msg);
2118 } else {
2119 console.error(msg);
2120 }
2121 warned = true;
2122 }
2123 return fn.apply(this, arguments);
2124 }
2125
2126 return deprecated;
2127};
2128
2129
2130var debugs = {};
2131var debugEnviron;
2132exports.debuglog = function(set) {
2133 if (isUndefined(debugEnviron))
2134 debugEnviron = process.env.NODE_DEBUG || '';
2135 set = set.toUpperCase();
2136 if (!debugs[set]) {
2137 if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
2138 var pid = process.pid;
2139 debugs[set] = function() {
2140 var msg = exports.format.apply(exports, arguments);
2141 console.error('%s %d: %s', set, pid, msg);
2142 };
2143 } else {
2144 debugs[set] = function() {};
2145 }
2146 }
2147 return debugs[set];
2148};
2149
2150
2151/**
2152 * Echos the value of a value. Trys to print the value out
2153 * in the best way possible given the different types.
2154 *
2155 * @param {Object} obj The object to print out.
2156 * @param {Object} opts Optional options object that alters the output.
2157 */
2158/* legacy: obj, showHidden, depth, colors*/
2159function inspect(obj, opts) {
2160 // default options
2161 var ctx = {
2162 seen: [],
2163 stylize: stylizeNoColor
2164 };
2165 // legacy...
2166 if (arguments.length >= 3) ctx.depth = arguments[2];
2167 if (arguments.length >= 4) ctx.colors = arguments[3];
2168 if (isBoolean(opts)) {
2169 // legacy...
2170 ctx.showHidden = opts;
2171 } else if (opts) {
2172 // got an "options" object
2173 exports._extend(ctx, opts);
2174 }
2175 // set default options
2176 if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
2177 if (isUndefined(ctx.depth)) ctx.depth = 2;
2178 if (isUndefined(ctx.colors)) ctx.colors = false;
2179 if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
2180 if (ctx.colors) ctx.stylize = stylizeWithColor;
2181 return formatValue(ctx, obj, ctx.depth);
2182}
2183exports.inspect = inspect;
2184
2185
2186// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
2187inspect.colors = {
2188 'bold' : [1, 22],
2189 'italic' : [3, 23],
2190 'underline' : [4, 24],
2191 'inverse' : [7, 27],
2192 'white' : [37, 39],
2193 'grey' : [90, 39],
2194 'black' : [30, 39],
2195 'blue' : [34, 39],
2196 'cyan' : [36, 39],
2197 'green' : [32, 39],
2198 'magenta' : [35, 39],
2199 'red' : [31, 39],
2200 'yellow' : [33, 39]
2201};
2202
2203// Don't use 'blue' not visible on cmd.exe
2204inspect.styles = {
2205 'special': 'cyan',
2206 'number': 'yellow',
2207 'boolean': 'yellow',
2208 'undefined': 'grey',
2209 'null': 'bold',
2210 'string': 'green',
2211 'date': 'magenta',
2212 // "name": intentionally not styling
2213 'regexp': 'red'
2214};
2215
2216
2217function stylizeWithColor(str, styleType) {
2218 var style = inspect.styles[styleType];
2219
2220 if (style) {
2221 return '\u001b[' + inspect.colors[style][0] + 'm' + str +
2222 '\u001b[' + inspect.colors[style][1] + 'm';
2223 } else {
2224 return str;
2225 }
2226}
2227
2228
2229function stylizeNoColor(str, styleType) {
2230 return str;
2231}
2232
2233
2234function arrayToHash(array) {
2235 var hash = {};
2236
2237 array.forEach(function(val, idx) {
2238 hash[val] = true;
2239 });
2240
2241 return hash;
2242}
2243
2244
2245function formatValue(ctx, value, recurseTimes) {
2246 // Provide a hook for user-specified inspect functions.
2247 // Check that value is an object with an inspect function on it
2248 if (ctx.customInspect &&
2249 value &&
2250 isFunction(value.inspect) &&
2251 // Filter out the util module, it's inspect function is special
2252 value.inspect !== exports.inspect &&
2253 // Also filter out any prototype objects using the circular check.
2254 !(value.constructor && value.constructor.prototype === value)) {
2255 var ret = value.inspect(recurseTimes, ctx);
2256 if (!isString(ret)) {
2257 ret = formatValue(ctx, ret, recurseTimes);
2258 }
2259 return ret;
2260 }
2261
2262 // Primitive types cannot have properties
2263 var primitive = formatPrimitive(ctx, value);
2264 if (primitive) {
2265 return primitive;
2266 }
2267
2268 // Look up the keys of the object.
2269 var keys = Object.keys(value);
2270 var visibleKeys = arrayToHash(keys);
2271
2272 if (ctx.showHidden) {
2273 keys = Object.getOwnPropertyNames(value);
2274 }
2275
2276 // IE doesn't make error fields non-enumerable
2277 // http://msdn.microsoft.com/en-us/library/ie/dww52sbt(v=vs.94).aspx
2278 if (isError(value)
2279 && (keys.indexOf('message') >= 0 || keys.indexOf('description') >= 0)) {
2280 return formatError(value);
2281 }
2282
2283 // Some type of object without properties can be shortcutted.
2284 if (keys.length === 0) {
2285 if (isFunction(value)) {
2286 var name = value.name ? ': ' + value.name : '';
2287 return ctx.stylize('[Function' + name + ']', 'special');
2288 }
2289 if (isRegExp(value)) {
2290 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2291 }
2292 if (isDate(value)) {
2293 return ctx.stylize(Date.prototype.toString.call(value), 'date');
2294 }
2295 if (isError(value)) {
2296 return formatError(value);
2297 }
2298 }
2299
2300 var base = '', array = false, braces = ['{', '}'];
2301
2302 // Make Array say that they are Array
2303 if (isArray(value)) {
2304 array = true;
2305 braces = ['[', ']'];
2306 }
2307
2308 // Make functions say that they are functions
2309 if (isFunction(value)) {
2310 var n = value.name ? ': ' + value.name : '';
2311 base = ' [Function' + n + ']';
2312 }
2313
2314 // Make RegExps say that they are RegExps
2315 if (isRegExp(value)) {
2316 base = ' ' + RegExp.prototype.toString.call(value);
2317 }
2318
2319 // Make dates with properties first say the date
2320 if (isDate(value)) {
2321 base = ' ' + Date.prototype.toUTCString.call(value);
2322 }
2323
2324 // Make error with message first say the error
2325 if (isError(value)) {
2326 base = ' ' + formatError(value);
2327 }
2328
2329 if (keys.length === 0 && (!array || value.length == 0)) {
2330 return braces[0] + base + braces[1];
2331 }
2332
2333 if (recurseTimes < 0) {
2334 if (isRegExp(value)) {
2335 return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
2336 } else {
2337 return ctx.stylize('[Object]', 'special');
2338 }
2339 }
2340
2341 ctx.seen.push(value);
2342
2343 var output;
2344 if (array) {
2345 output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
2346 } else {
2347 output = keys.map(function(key) {
2348 return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
2349 });
2350 }
2351
2352 ctx.seen.pop();
2353
2354 return reduceToSingleString(output, base, braces);
2355}
2356
2357
2358function formatPrimitive(ctx, value) {
2359 if (isUndefined(value))
2360 return ctx.stylize('undefined', 'undefined');
2361 if (isString(value)) {
2362 var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
2363 .replace(/'/g, "\\'")
2364 .replace(/\\"/g, '"') + '\'';
2365 return ctx.stylize(simple, 'string');
2366 }
2367 if (isNumber(value))
2368 return ctx.stylize('' + value, 'number');
2369 if (isBoolean(value))
2370 return ctx.stylize('' + value, 'boolean');
2371 // For some reason typeof null is "object", so special case here.
2372 if (isNull(value))
2373 return ctx.stylize('null', 'null');
2374}
2375
2376
2377function formatError(value) {
2378 return '[' + Error.prototype.toString.call(value) + ']';
2379}
2380
2381
2382function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
2383 var output = [];
2384 for (var i = 0, l = value.length; i < l; ++i) {
2385 if (hasOwnProperty(value, String(i))) {
2386 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2387 String(i), true));
2388 } else {
2389 output.push('');
2390 }
2391 }
2392 keys.forEach(function(key) {
2393 if (!key.match(/^\d+$/)) {
2394 output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
2395 key, true));
2396 }
2397 });
2398 return output;
2399}
2400
2401
2402function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
2403 var name, str, desc;
2404 desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
2405 if (desc.get) {
2406 if (desc.set) {
2407 str = ctx.stylize('[Getter/Setter]', 'special');
2408 } else {
2409 str = ctx.stylize('[Getter]', 'special');
2410 }
2411 } else {
2412 if (desc.set) {
2413 str = ctx.stylize('[Setter]', 'special');
2414 }
2415 }
2416 if (!hasOwnProperty(visibleKeys, key)) {
2417 name = '[' + key + ']';
2418 }
2419 if (!str) {
2420 if (ctx.seen.indexOf(desc.value) < 0) {
2421 if (isNull(recurseTimes)) {
2422 str = formatValue(ctx, desc.value, null);
2423 } else {
2424 str = formatValue(ctx, desc.value, recurseTimes - 1);
2425 }
2426 if (str.indexOf('\n') > -1) {
2427 if (array) {
2428 str = str.split('\n').map(function(line) {
2429 return ' ' + line;
2430 }).join('\n').substr(2);
2431 } else {
2432 str = '\n' + str.split('\n').map(function(line) {
2433 return ' ' + line;
2434 }).join('\n');
2435 }
2436 }
2437 } else {
2438 str = ctx.stylize('[Circular]', 'special');
2439 }
2440 }
2441 if (isUndefined(name)) {
2442 if (array && key.match(/^\d+$/)) {
2443 return str;
2444 }
2445 name = JSON.stringify('' + key);
2446 if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
2447 name = name.substr(1, name.length - 2);
2448 name = ctx.stylize(name, 'name');
2449 } else {
2450 name = name.replace(/'/g, "\\'")
2451 .replace(/\\"/g, '"')
2452 .replace(/(^"|"$)/g, "'");
2453 name = ctx.stylize(name, 'string');
2454 }
2455 }
2456
2457 return name + ': ' + str;
2458}
2459
2460
2461function reduceToSingleString(output, base, braces) {
2462 var numLinesEst = 0;
2463 var length = output.reduce(function(prev, cur) {
2464 numLinesEst++;
2465 if (cur.indexOf('\n') >= 0) numLinesEst++;
2466 return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
2467 }, 0);
2468
2469 if (length > 60) {
2470 return braces[0] +
2471 (base === '' ? '' : base + '\n ') +
2472 ' ' +
2473 output.join(',\n ') +
2474 ' ' +
2475 braces[1];
2476 }
2477
2478 return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
2479}
2480
2481
2482// NOTE: These type checking functions intentionally don't use `instanceof`
2483// because it is fragile and can be easily faked with `Object.create()`.
2484function isArray(ar) {
2485 return Array.isArray(ar);
2486}
2487exports.isArray = isArray;
2488
2489function isBoolean(arg) {
2490 return typeof arg === 'boolean';
2491}
2492exports.isBoolean = isBoolean;
2493
2494function isNull(arg) {
2495 return arg === null;
2496}
2497exports.isNull = isNull;
2498
2499function isNullOrUndefined(arg) {
2500 return arg == null;
2501}
2502exports.isNullOrUndefined = isNullOrUndefined;
2503
2504function isNumber(arg) {
2505 return typeof arg === 'number';
2506}
2507exports.isNumber = isNumber;
2508
2509function isString(arg) {
2510 return typeof arg === 'string';
2511}
2512exports.isString = isString;
2513
2514function isSymbol(arg) {
2515 return typeof arg === 'symbol';
2516}
2517exports.isSymbol = isSymbol;
2518
2519function isUndefined(arg) {
2520 return arg === void 0;
2521}
2522exports.isUndefined = isUndefined;
2523
2524function isRegExp(re) {
2525 return isObject(re) && objectToString(re) === '[object RegExp]';
2526}
2527exports.isRegExp = isRegExp;
2528
2529function isObject(arg) {
2530 return typeof arg === 'object' && arg !== null;
2531}
2532exports.isObject = isObject;
2533
2534function isDate(d) {
2535 return isObject(d) && objectToString(d) === '[object Date]';
2536}
2537exports.isDate = isDate;
2538
2539function isError(e) {
2540 return isObject(e) &&
2541 (objectToString(e) === '[object Error]' || e instanceof Error);
2542}
2543exports.isError = isError;
2544
2545function isFunction(arg) {
2546 return typeof arg === 'function';
2547}
2548exports.isFunction = isFunction;
2549
2550function isPrimitive(arg) {
2551 return arg === null ||
2552 typeof arg === 'boolean' ||
2553 typeof arg === 'number' ||
2554 typeof arg === 'string' ||
2555 typeof arg === 'symbol' || // ES6 symbol
2556 typeof arg === 'undefined';
2557}
2558exports.isPrimitive = isPrimitive;
2559
2560exports.isBuffer = _dereq_('./support/isBuffer');
2561
2562function objectToString(o) {
2563 return Object.prototype.toString.call(o);
2564}
2565
2566
2567function pad(n) {
2568 return n < 10 ? '0' + n.toString(10) : n.toString(10);
2569}
2570
2571
2572var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
2573 'Oct', 'Nov', 'Dec'];
2574
2575// 26 Feb 16:19:34
2576function timestamp() {
2577 var d = new Date();
2578 var time = [pad(d.getHours()),
2579 pad(d.getMinutes()),
2580 pad(d.getSeconds())].join(':');
2581 return [d.getDate(), months[d.getMonth()], time].join(' ');
2582}
2583
2584
2585// log is just a thin wrapper to console.log that prepends a timestamp
2586exports.log = function() {
2587 console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
2588};
2589
2590
2591/**
2592 * Inherit the prototype methods from one constructor into another.
2593 *
2594 * The Function.prototype.inherits from lang.js rewritten as a standalone
2595 * function (not on Function.prototype). NOTE: If this file is to be loaded
2596 * during bootstrapping this function needs to be rewritten using some native
2597 * functions as prototype setup using normal JavaScript does not work as
2598 * expected during bootstrapping (see mirror.js in r114903).
2599 *
2600 * @param {function} ctor Constructor function which needs to inherit the
2601 * prototype.
2602 * @param {function} superCtor Constructor function to inherit prototype from.
2603 */
2604exports.inherits = _dereq_('inherits');
2605
2606exports._extend = function(origin, add) {
2607 // Don't do anything if add isn't an object
2608 if (!add || !isObject(add)) return origin;
2609
2610 var keys = Object.keys(add);
2611 var i = keys.length;
2612 while (i--) {
2613 origin[keys[i]] = add[keys[i]];
2614 }
2615 return origin;
2616};
2617
2618function hasOwnProperty(obj, prop) {
2619 return Object.prototype.hasOwnProperty.call(obj, prop);
2620}
2621
2622}).call(this,_dereq_("FWaASH"),typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : {})
2623},{"./support/isBuffer":5,"FWaASH":12,"inherits":11}],7:[function(_dereq_,module,exports){
2624
2625},{}],8:[function(_dereq_,module,exports){
2626/*!
2627 * The buffer module from node.js, for the browser.
2628 *
2629 * at author Feross Aboukhadijeh <feross@feross.org> <http://feross.org>
2630 * at license MIT
2631 */
2632
2633var base64 = _dereq_('base64-js')
2634var ieee754 = _dereq_('ieee754')
2635
2636exports.Buffer = Buffer
2637exports.SlowBuffer = Buffer
2638exports.INSPECT_MAX_BYTES = 50
2639Buffer.poolSize = 8192
2640
2641/**
2642 * If `Buffer._useTypedArrays`:
2643 * === true Use Uint8Array implementation (fastest)
2644 * === false Use Object implementation (compatible down to IE6)
2645 */
2646Buffer._useTypedArrays = (function () {
2647 // Detect if browser supports Typed Arrays. Supported browsers are IE 10+, Firefox 4+,
2648 // Chrome 7+, Safari 5.1+, Opera 11.6+, iOS 4.2+. If the browser does not support adding
2649 // properties to `Uint8Array` instances, then that's the same as no `Uint8Array` support
2650 // because we need to be able to add all the node Buffer API methods. This is an issue
2651 // in Firefox 4-29. Now fixed: https://bugzilla.mozilla.org/show_bug.cgi?id=695438
2652 try {
2653 var buf = new ArrayBuffer(0)
2654 var arr = new Uint8Array(buf)
2655 arr.foo = function () { return 42 }
2656 return 42 === arr.foo() &&
2657 typeof arr.subarray === 'function' // Chrome 9-10 lack `subarray`
2658 } catch (e) {
2659 return false
2660 }
2661})()
2662
2663/**
2664 * Class: Buffer
2665 * =============
2666 *
2667 * The Buffer constructor returns instances of `Uint8Array` that are augmented
2668 * with function properties for all the node `Buffer` API functions. We use
2669 * `Uint8Array` so that square bracket notation works as expected -- it returns
2670 * a single octet.
2671 *
2672 * By augmenting the instances, we can avoid modifying the `Uint8Array`
2673 * prototype.
2674 */
2675function Buffer (subject, encoding, noZero) {
2676 if (!(this instanceof Buffer))
2677 return new Buffer(subject, encoding, noZero)
2678
2679 var type = typeof subject
2680
2681 if (encoding === 'base64' && type === 'string') {
2682 subject = base64clean(subject)
2683 }
2684
2685 // Find the length
2686 var length
2687 if (type === 'number')
2688 length = coerce(subject)
2689 else if (type === 'string')
2690 length = Buffer.byteLength(subject, encoding)
2691 else if (type === 'object')
2692 length = coerce(subject.length) // assume that object is array-like
2693 else
2694 throw new Error('First argument needs to be a number, array or string.')
2695
2696 var buf
2697 if (Buffer._useTypedArrays) {
2698 // Preferred: Return an augmented `Uint8Array` instance for best performance
2699 buf = Buffer._augment(new Uint8Array(length))
2700 } else {
2701 // Fallback: Return THIS instance of Buffer (created by `new`)
2702 buf = this
2703 buf.length = length
2704 buf._isBuffer = true
2705 }
2706
2707 var i
2708 if (Buffer._useTypedArrays && typeof subject.byteLength === 'number') {
2709 // Speed optimization -- use set if we're copying from a typed array
2710 buf._set(subject)
2711 } else if (isArrayish(subject)) {
2712 // Treat array-ish objects as a byte array
2713 if (Buffer.isBuffer(subject)) {
2714 for (i = 0; i < length; i++)
2715 buf[i] = subject.readUInt8(i)
2716 } else {
2717 for (i = 0; i < length; i++)
2718 buf[i] = ((subject[i] % 256) + 256) % 256
2719 }
2720 } else if (type === 'string') {
2721 buf.write(subject, 0, encoding)
2722 } else if (type === 'number' && !Buffer._useTypedArrays && !noZero) {
2723 for (i = 0; i < length; i++) {
2724 buf[i] = 0
2725 }
2726 }
2727
2728 return buf
2729}
2730
2731// STATIC METHODS
2732// ==============
2733
2734Buffer.isEncoding = function (encoding) {
2735 switch (String(encoding).toLowerCase()) {
2736 case 'hex':
2737 case 'utf8':
2738 case 'utf-8':
2739 case 'ascii':
2740 case 'binary':
2741 case 'base64':
2742 case 'raw':
2743 case 'ucs2':
2744 case 'ucs-2':
2745 case 'utf16le':
2746 case 'utf-16le':
2747 return true
2748 default:
2749 return false
2750 }
2751}
2752
2753Buffer.isBuffer = function (b) {
2754 return !!(b !== null && b !== undefined && b._isBuffer)
2755}
2756
2757Buffer.byteLength = function (str, encoding) {
2758 var ret
2759 str = str.toString()
2760 switch (encoding || 'utf8') {
2761 case 'hex':
2762 ret = str.length / 2
2763 break
2764 case 'utf8':
2765 case 'utf-8':
2766 ret = utf8ToBytes(str).length
2767 break
2768 case 'ascii':
2769 case 'binary':
2770 case 'raw':
2771 ret = str.length
2772 break
2773 case 'base64':
2774 ret = base64ToBytes(str).length
2775 break
2776 case 'ucs2':
2777 case 'ucs-2':
2778 case 'utf16le':
2779 case 'utf-16le':
2780 ret = str.length * 2
2781 break
2782 default:
2783 throw new Error('Unknown encoding')
2784 }
2785 return ret
2786}
2787
2788Buffer.concat = function (list, totalLength) {
2789 assert(isArray(list), 'Usage: Buffer.concat(list[, length])')
2790
2791 if (list.length === 0) {
2792 return new Buffer(0)
2793 } else if (list.length === 1) {
2794 return list[0]
2795 }
2796
2797 var i
2798 if (totalLength === undefined) {
2799 totalLength = 0
2800 for (i = 0; i < list.length; i++) {
2801 totalLength += list[i].length
2802 }
2803 }
2804
2805 var buf = new Buffer(totalLength)
2806 var pos = 0
2807 for (i = 0; i < list.length; i++) {
2808 var item = list[i]
2809 item.copy(buf, pos)
2810 pos += item.length
2811 }
2812 return buf
2813}
2814
2815Buffer.compare = function (a, b) {
2816 assert(Buffer.isBuffer(a) && Buffer.isBuffer(b), 'Arguments must be Buffers')
2817 var x = a.length
2818 var y = b.length
2819 for (var i = 0, len = Math.min(x, y); i < len && a[i] === b[i]; i++) {}
2820 if (i !== len) {
2821 x = a[i]
2822 y = b[i]
2823 }
2824 if (x < y) {
2825 return -1
2826 }
2827 if (y < x) {
2828 return 1
2829 }
2830 return 0
2831}
2832
2833// BUFFER INSTANCE METHODS
2834// =======================
2835
2836function hexWrite (buf, string, offset, length) {
2837 offset = Number(offset) || 0
2838 var remaining = buf.length - offset
2839 if (!length) {
2840 length = remaining
2841 } else {
2842 length = Number(length)
2843 if (length > remaining) {
2844 length = remaining
2845 }
2846 }
2847
2848 // must be an even number of digits
2849 var strLen = string.length
2850 assert(strLen % 2 === 0, 'Invalid hex string')
2851
2852 if (length > strLen / 2) {
2853 length = strLen / 2
2854 }
2855 for (var i = 0; i < length; i++) {
2856 var byte = parseInt(string.substr(i * 2, 2), 16)
2857 assert(!isNaN(byte), 'Invalid hex string')
2858 buf[offset + i] = byte
2859 }
2860 return i
2861}
2862
2863function utf8Write (buf, string, offset, length) {
2864 var charsWritten = blitBuffer(utf8ToBytes(string), buf, offset, length)
2865 return charsWritten
2866}
2867
2868function asciiWrite (buf, string, offset, length) {
2869 var charsWritten = blitBuffer(asciiToBytes(string), buf, offset, length)
2870 return charsWritten
2871}
2872
2873function binaryWrite (buf, string, offset, length) {
2874 return asciiWrite(buf, string, offset, length)
2875}
2876
2877function base64Write (buf, string, offset, length) {
2878 var charsWritten = blitBuffer(base64ToBytes(string), buf, offset, length)
2879 return charsWritten
2880}
2881
2882function utf16leWrite (buf, string, offset, length) {
2883 var charsWritten = blitBuffer(utf16leToBytes(string), buf, offset, length)
2884 return charsWritten
2885}
2886
2887Buffer.prototype.write = function (string, offset, length, encoding) {
2888 // Support both (string, offset, length, encoding)
2889 // and the legacy (string, encoding, offset, length)
2890 if (isFinite(offset)) {
2891 if (!isFinite(length)) {
2892 encoding = length
2893 length = undefined
2894 }
2895 } else { // legacy
2896 var swap = encoding
2897 encoding = offset
2898 offset = length
2899 length = swap
2900 }
2901
2902 offset = Number(offset) || 0
2903 var remaining = this.length - offset
2904 if (!length) {
2905 length = remaining
2906 } else {
2907 length = Number(length)
2908 if (length > remaining) {
2909 length = remaining
2910 }
2911 }
2912 encoding = String(encoding || 'utf8').toLowerCase()
2913
2914 var ret
2915 switch (encoding) {
2916 case 'hex':
2917 ret = hexWrite(this, string, offset, length)
2918 break
2919 case 'utf8':
2920 case 'utf-8':
2921 ret = utf8Write(this, string, offset, length)
2922 break
2923 case 'ascii':
2924 ret = asciiWrite(this, string, offset, length)
2925 break
2926 case 'binary':
2927 ret = binaryWrite(this, string, offset, length)
2928 break
2929 case 'base64':
2930 ret = base64Write(this, string, offset, length)
2931 break
2932 case 'ucs2':
2933 case 'ucs-2':
2934 case 'utf16le':
2935 case 'utf-16le':
2936 ret = utf16leWrite(this, string, offset, length)
2937 break
2938 default:
2939 throw new Error('Unknown encoding')
2940 }
2941 return ret
2942}
2943
2944Buffer.prototype.toString = function (encoding, start, end) {
2945 var self = this
2946
2947 encoding = String(encoding || 'utf8').toLowerCase()
2948 start = Number(start) || 0
2949 end = (end === undefined) ? self.length : Number(end)
2950
2951 // Fastpath empty strings
2952 if (end === start)
2953 return ''
2954
2955 var ret
2956 switch (encoding) {
2957 case 'hex':
2958 ret = hexSlice(self, start, end)
2959 break
2960 case 'utf8':
2961 case 'utf-8':
2962 ret = utf8Slice(self, start, end)
2963 break
2964 case 'ascii':
2965 ret = asciiSlice(self, start, end)
2966 break
2967 case 'binary':
2968 ret = binarySlice(self, start, end)
2969 break
2970 case 'base64':
2971 ret = base64Slice(self, start, end)
2972 break
2973 case 'ucs2':
2974 case 'ucs-2':
2975 case 'utf16le':
2976 case 'utf-16le':
2977 ret = utf16leSlice(self, start, end)
2978 break
2979 default:
2980 throw new Error('Unknown encoding')
2981 }
2982 return ret
2983}
2984
2985Buffer.prototype.toJSON = function () {
2986 return {
2987 type: 'Buffer',
2988 data: Array.prototype.slice.call(this._arr || this, 0)
2989 }
2990}
2991
2992Buffer.prototype.equals = function (b) {
2993 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
2994 return Buffer.compare(this, b) === 0
2995}
2996
2997Buffer.prototype.compare = function (b) {
2998 assert(Buffer.isBuffer(b), 'Argument must be a Buffer')
2999 return Buffer.compare(this, b)
3000}
3001
3002// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)
3003Buffer.prototype.copy = function (target, target_start, start, end) {
3004 var source = this
3005
3006 if (!start) start = 0
3007 if (!end && end !== 0) end = this.length
3008 if (!target_start) target_start = 0
3009
3010 // Copy 0 bytes; we're done
3011 if (end === start) return
3012 if (target.length === 0 || source.length === 0) return
3013
3014 // Fatal error conditions
3015 assert(end >= start, 'sourceEnd < sourceStart')
3016 assert(target_start >= 0 && target_start < target.length,
3017 'targetStart out of bounds')
3018 assert(start >= 0 && start < source.length, 'sourceStart out of bounds')
3019 assert(end >= 0 && end <= source.length, 'sourceEnd out of bounds')
3020
3021 // Are we oob?
3022 if (end > this.length)
3023 end = this.length
3024 if (target.length - target_start < end - start)
3025 end = target.length - target_start + start
3026
3027 var len = end - start
3028
3029 if (len < 100 || !Buffer._useTypedArrays) {
3030 for (var i = 0; i < len; i++) {
3031 target[i + target_start] = this[i + start]
3032 }
3033 } else {
3034 target._set(this.subarray(start, start + len), target_start)
3035 }
3036}
3037
3038function base64Slice (buf, start, end) {
3039 if (start === 0 && end === buf.length) {
3040 return base64.fromByteArray(buf)
3041 } else {
3042 return base64.fromByteArray(buf.slice(start, end))
3043 }
3044}
3045
3046function utf8Slice (buf, start, end) {
3047 var res = ''
3048 var tmp = ''
3049 end = Math.min(buf.length, end)
3050
3051 for (var i = start; i < end; i++) {
3052 if (buf[i] <= 0x7F) {
3053 res += decodeUtf8Char(tmp) + String.fromCharCode(buf[i])
3054 tmp = ''
3055 } else {
3056 tmp += '%' + buf[i].toString(16)
3057 }
3058 }
3059
3060 return res + decodeUtf8Char(tmp)
3061}
3062
3063function asciiSlice (buf, start, end) {
3064 var ret = ''
3065 end = Math.min(buf.length, end)
3066
3067 for (var i = start; i < end; i++) {
3068 ret += String.fromCharCode(buf[i])
3069 }
3070 return ret
3071}
3072
3073function binarySlice (buf, start, end) {
3074 return asciiSlice(buf, start, end)
3075}
3076
3077function hexSlice (buf, start, end) {
3078 var len = buf.length
3079
3080 if (!start || start < 0) start = 0
3081 if (!end || end < 0 || end > len) end = len
3082
3083 var out = ''
3084 for (var i = start; i < end; i++) {
3085 out += toHex(buf[i])
3086 }
3087 return out
3088}
3089
3090function utf16leSlice (buf, start, end) {
3091 var bytes = buf.slice(start, end)
3092 var res = ''
3093 for (var i = 0; i < bytes.length; i += 2) {
3094 res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)
3095 }
3096 return res
3097}
3098
3099Buffer.prototype.slice = function (start, end) {
3100 var len = this.length
3101 start = clamp(start, len, 0)
3102 end = clamp(end, len, len)
3103
3104 if (Buffer._useTypedArrays) {
3105 return Buffer._augment(this.subarray(start, end))
3106 } else {
3107 var sliceLen = end - start
3108 var newBuf = new Buffer(sliceLen, undefined, true)
3109 for (var i = 0; i < sliceLen; i++) {
3110 newBuf[i] = this[i + start]
3111 }
3112 return newBuf
3113 }
3114}
3115
3116// `get` will be removed in Node 0.13+
3117Buffer.prototype.get = function (offset) {
3118 console.log('.get() is deprecated. Access using array indexes instead.')
3119 return this.readUInt8(offset)
3120}
3121
3122// `set` will be removed in Node 0.13+
3123Buffer.prototype.set = function (v, offset) {
3124 console.log('.set() is deprecated. Access using array indexes instead.')
3125 return this.writeUInt8(v, offset)
3126}
3127
3128Buffer.prototype.readUInt8 = function (offset, noAssert) {
3129 if (!noAssert) {
3130 assert(offset !== undefined && offset !== null, 'missing offset')
3131 assert(offset < this.length, 'Trying to read beyond buffer length')
3132 }
3133
3134 if (offset >= this.length)
3135 return
3136
3137 return this[offset]
3138}
3139
3140function readUInt16 (buf, offset, littleEndian, noAssert) {
3141 if (!noAssert) {
3142 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3143 assert(offset !== undefined && offset !== null, 'missing offset')
3144 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3145 }
3146
3147 var len = buf.length
3148 if (offset >= len)
3149 return
3150
3151 var val
3152 if (littleEndian) {
3153 val = buf[offset]
3154 if (offset + 1 < len)
3155 val |= buf[offset + 1] << 8
3156 } else {
3157 val = buf[offset] << 8
3158 if (offset + 1 < len)
3159 val |= buf[offset + 1]
3160 }
3161 return val
3162}
3163
3164Buffer.prototype.readUInt16LE = function (offset, noAssert) {
3165 return readUInt16(this, offset, true, noAssert)
3166}
3167
3168Buffer.prototype.readUInt16BE = function (offset, noAssert) {
3169 return readUInt16(this, offset, false, noAssert)
3170}
3171
3172function readUInt32 (buf, offset, littleEndian, noAssert) {
3173 if (!noAssert) {
3174 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3175 assert(offset !== undefined && offset !== null, 'missing offset')
3176 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3177 }
3178
3179 var len = buf.length
3180 if (offset >= len)
3181 return
3182
3183 var val
3184 if (littleEndian) {
3185 if (offset + 2 < len)
3186 val = buf[offset + 2] << 16
3187 if (offset + 1 < len)
3188 val |= buf[offset + 1] << 8
3189 val |= buf[offset]
3190 if (offset + 3 < len)
3191 val = val + (buf[offset + 3] << 24 >>> 0)
3192 } else {
3193 if (offset + 1 < len)
3194 val = buf[offset + 1] << 16
3195 if (offset + 2 < len)
3196 val |= buf[offset + 2] << 8
3197 if (offset + 3 < len)
3198 val |= buf[offset + 3]
3199 val = val + (buf[offset] << 24 >>> 0)
3200 }
3201 return val
3202}
3203
3204Buffer.prototype.readUInt32LE = function (offset, noAssert) {
3205 return readUInt32(this, offset, true, noAssert)
3206}
3207
3208Buffer.prototype.readUInt32BE = function (offset, noAssert) {
3209 return readUInt32(this, offset, false, noAssert)
3210}
3211
3212Buffer.prototype.readInt8 = function (offset, noAssert) {
3213 if (!noAssert) {
3214 assert(offset !== undefined && offset !== null,
3215 'missing offset')
3216 assert(offset < this.length, 'Trying to read beyond buffer length')
3217 }
3218
3219 if (offset >= this.length)
3220 return
3221
3222 var neg = this[offset] & 0x80
3223 if (neg)
3224 return (0xff - this[offset] + 1) * -1
3225 else
3226 return this[offset]
3227}
3228
3229function readInt16 (buf, offset, littleEndian, noAssert) {
3230 if (!noAssert) {
3231 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3232 assert(offset !== undefined && offset !== null, 'missing offset')
3233 assert(offset + 1 < buf.length, 'Trying to read beyond buffer length')
3234 }
3235
3236 var len = buf.length
3237 if (offset >= len)
3238 return
3239
3240 var val = readUInt16(buf, offset, littleEndian, true)
3241 var neg = val & 0x8000
3242 if (neg)
3243 return (0xffff - val + 1) * -1
3244 else
3245 return val
3246}
3247
3248Buffer.prototype.readInt16LE = function (offset, noAssert) {
3249 return readInt16(this, offset, true, noAssert)
3250}
3251
3252Buffer.prototype.readInt16BE = function (offset, noAssert) {
3253 return readInt16(this, offset, false, noAssert)
3254}
3255
3256function readInt32 (buf, offset, littleEndian, noAssert) {
3257 if (!noAssert) {
3258 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3259 assert(offset !== undefined && offset !== null, 'missing offset')
3260 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3261 }
3262
3263 var len = buf.length
3264 if (offset >= len)
3265 return
3266
3267 var val = readUInt32(buf, offset, littleEndian, true)
3268 var neg = val & 0x80000000
3269 if (neg)
3270 return (0xffffffff - val + 1) * -1
3271 else
3272 return val
3273}
3274
3275Buffer.prototype.readInt32LE = function (offset, noAssert) {
3276 return readInt32(this, offset, true, noAssert)
3277}
3278
3279Buffer.prototype.readInt32BE = function (offset, noAssert) {
3280 return readInt32(this, offset, false, noAssert)
3281}
3282
3283function readFloat (buf, offset, littleEndian, noAssert) {
3284 if (!noAssert) {
3285 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3286 assert(offset + 3 < buf.length, 'Trying to read beyond buffer length')
3287 }
3288
3289 return ieee754.read(buf, offset, littleEndian, 23, 4)
3290}
3291
3292Buffer.prototype.readFloatLE = function (offset, noAssert) {
3293 return readFloat(this, offset, true, noAssert)
3294}
3295
3296Buffer.prototype.readFloatBE = function (offset, noAssert) {
3297 return readFloat(this, offset, false, noAssert)
3298}
3299
3300function readDouble (buf, offset, littleEndian, noAssert) {
3301 if (!noAssert) {
3302 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3303 assert(offset + 7 < buf.length, 'Trying to read beyond buffer length')
3304 }
3305
3306 return ieee754.read(buf, offset, littleEndian, 52, 8)
3307}
3308
3309Buffer.prototype.readDoubleLE = function (offset, noAssert) {
3310 return readDouble(this, offset, true, noAssert)
3311}
3312
3313Buffer.prototype.readDoubleBE = function (offset, noAssert) {
3314 return readDouble(this, offset, false, noAssert)
3315}
3316
3317Buffer.prototype.writeUInt8 = function (value, offset, noAssert) {
3318 if (!noAssert) {
3319 assert(value !== undefined && value !== null, 'missing value')
3320 assert(offset !== undefined && offset !== null, 'missing offset')
3321 assert(offset < this.length, 'trying to write beyond buffer length')
3322 verifuint(value, 0xff)
3323 }
3324
3325 if (offset >= this.length) return
3326
3327 this[offset] = value
3328 return offset + 1
3329}
3330
3331function writeUInt16 (buf, value, offset, littleEndian, noAssert) {
3332 if (!noAssert) {
3333 assert(value !== undefined && value !== null, 'missing value')
3334 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3335 assert(offset !== undefined && offset !== null, 'missing offset')
3336 assert(offset + 1 < buf.length, 'trying to write beyond buffer length')
3337 verifuint(value, 0xffff)
3338 }
3339
3340 var len = buf.length
3341 if (offset >= len)
3342 return
3343
3344 for (var i = 0, j = Math.min(len - offset, 2); i < j; i++) {
3345 buf[offset + i] =
3346 (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>
3347 (littleEndian ? i : 1 - i) * 8
3348 }
3349 return offset + 2
3350}
3351
3352Buffer.prototype.writeUInt16LE = function (value, offset, noAssert) {
3353 return writeUInt16(this, value, offset, true, noAssert)
3354}
3355
3356Buffer.prototype.writeUInt16BE = function (value, offset, noAssert) {
3357 return writeUInt16(this, value, offset, false, noAssert)
3358}
3359
3360function writeUInt32 (buf, value, offset, littleEndian, noAssert) {
3361 if (!noAssert) {
3362 assert(value !== undefined && value !== null, 'missing value')
3363 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3364 assert(offset !== undefined && offset !== null, 'missing offset')
3365 assert(offset + 3 < buf.length, 'trying to write beyond buffer length')
3366 verifuint(value, 0xffffffff)
3367 }
3368
3369 var len = buf.length
3370 if (offset >= len)
3371 return
3372
3373 for (var i = 0, j = Math.min(len - offset, 4); i < j; i++) {
3374 buf[offset + i] =
3375 (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff
3376 }
3377 return offset + 4
3378}
3379
3380Buffer.prototype.writeUInt32LE = function (value, offset, noAssert) {
3381 return writeUInt32(this, value, offset, true, noAssert)
3382}
3383
3384Buffer.prototype.writeUInt32BE = function (value, offset, noAssert) {
3385 return writeUInt32(this, value, offset, false, noAssert)
3386}
3387
3388Buffer.prototype.writeInt8 = function (value, offset, noAssert) {
3389 if (!noAssert) {
3390 assert(value !== undefined && value !== null, 'missing value')
3391 assert(offset !== undefined && offset !== null, 'missing offset')
3392 assert(offset < this.length, 'Trying to write beyond buffer length')
3393 verifsint(value, 0x7f, -0x80)
3394 }
3395
3396 if (offset >= this.length)
3397 return
3398
3399 if (value >= 0)
3400 this.writeUInt8(value, offset, noAssert)
3401 else
3402 this.writeUInt8(0xff + value + 1, offset, noAssert)
3403 return offset + 1
3404}
3405
3406function writeInt16 (buf, value, offset, littleEndian, noAssert) {
3407 if (!noAssert) {
3408 assert(value !== undefined && value !== null, 'missing value')
3409 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3410 assert(offset !== undefined && offset !== null, 'missing offset')
3411 assert(offset + 1 < buf.length, 'Trying to write beyond buffer length')
3412 verifsint(value, 0x7fff, -0x8000)
3413 }
3414
3415 var len = buf.length
3416 if (offset >= len)
3417 return
3418
3419 if (value >= 0)
3420 writeUInt16(buf, value, offset, littleEndian, noAssert)
3421 else
3422 writeUInt16(buf, 0xffff + value + 1, offset, littleEndian, noAssert)
3423 return offset + 2
3424}
3425
3426Buffer.prototype.writeInt16LE = function (value, offset, noAssert) {
3427 return writeInt16(this, value, offset, true, noAssert)
3428}
3429
3430Buffer.prototype.writeInt16BE = function (value, offset, noAssert) {
3431 return writeInt16(this, value, offset, false, noAssert)
3432}
3433
3434function writeInt32 (buf, value, offset, littleEndian, noAssert) {
3435 if (!noAssert) {
3436 assert(value !== undefined && value !== null, 'missing value')
3437 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3438 assert(offset !== undefined && offset !== null, 'missing offset')
3439 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3440 verifsint(value, 0x7fffffff, -0x80000000)
3441 }
3442
3443 var len = buf.length
3444 if (offset >= len)
3445 return
3446
3447 if (value >= 0)
3448 writeUInt32(buf, value, offset, littleEndian, noAssert)
3449 else
3450 writeUInt32(buf, 0xffffffff + value + 1, offset, littleEndian, noAssert)
3451 return offset + 4
3452}
3453
3454Buffer.prototype.writeInt32LE = function (value, offset, noAssert) {
3455 return writeInt32(this, value, offset, true, noAssert)
3456}
3457
3458Buffer.prototype.writeInt32BE = function (value, offset, noAssert) {
3459 return writeInt32(this, value, offset, false, noAssert)
3460}
3461
3462function writeFloat (buf, value, offset, littleEndian, noAssert) {
3463 if (!noAssert) {
3464 assert(value !== undefined && value !== null, 'missing value')
3465 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3466 assert(offset !== undefined && offset !== null, 'missing offset')
3467 assert(offset + 3 < buf.length, 'Trying to write beyond buffer length')
3468 verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38)
3469 }
3470
3471 var len = buf.length
3472 if (offset >= len)
3473 return
3474
3475 ieee754.write(buf, value, offset, littleEndian, 23, 4)
3476 return offset + 4
3477}
3478
3479Buffer.prototype.writeFloatLE = function (value, offset, noAssert) {
3480 return writeFloat(this, value, offset, true, noAssert)
3481}
3482
3483Buffer.prototype.writeFloatBE = function (value, offset, noAssert) {
3484 return writeFloat(this, value, offset, false, noAssert)
3485}
3486
3487function writeDouble (buf, value, offset, littleEndian, noAssert) {
3488 if (!noAssert) {
3489 assert(value !== undefined && value !== null, 'missing value')
3490 assert(typeof littleEndian === 'boolean', 'missing or invalid endian')
3491 assert(offset !== undefined && offset !== null, 'missing offset')
3492 assert(offset + 7 < buf.length,
3493 'Trying to write beyond buffer length')
3494 verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308)
3495 }
3496
3497 var len = buf.length
3498 if (offset >= len)
3499 return
3500
3501 ieee754.write(buf, value, offset, littleEndian, 52, 8)
3502 return offset + 8
3503}
3504
3505Buffer.prototype.writeDoubleLE = function (value, offset, noAssert) {
3506 return writeDouble(this, value, offset, true, noAssert)
3507}
3508
3509Buffer.prototype.writeDoubleBE = function (value, offset, noAssert) {
3510 return writeDouble(this, value, offset, false, noAssert)
3511}
3512
3513// fill(value, start=0, end=buffer.length)
3514Buffer.prototype.fill = function (value, start, end) {
3515 if (!value) value = 0
3516 if (!start) start = 0
3517 if (!end) end = this.length
3518
3519 assert(end >= start, 'end < start')
3520
3521 // Fill 0 bytes; we're done
3522 if (end === start) return
3523 if (this.length === 0) return
3524
3525 assert(start >= 0 && start < this.length, 'start out of bounds')
3526 assert(end >= 0 && end <= this.length, 'end out of bounds')
3527
3528 var i
3529 if (typeof value === 'number') {
3530 for (i = start; i < end; i++) {
3531 this[i] = value
3532 }
3533 } else {
3534 var bytes = utf8ToBytes(value.toString())
3535 var len = bytes.length
3536 for (i = start; i < end; i++) {
3537 this[i] = bytes[i % len]
3538 }
3539 }
3540
3541 return this
3542}
3543
3544Buffer.prototype.inspect = function () {
3545 var out = []
3546 var len = this.length
3547 for (var i = 0; i < len; i++) {
3548 out[i] = toHex(this[i])
3549 if (i === exports.INSPECT_MAX_BYTES) {
3550 out[i + 1] = '...'
3551 break
3552 }
3553 }
3554 return '<Buffer ' + out.join(' ') + '>'
3555}
3556
3557/**
3558 * Creates a new `ArrayBuffer` with the *copied* memory of the buffer instance.
3559 * Added in Node 0.12. Only available in browsers that support ArrayBuffer.
3560 */
3561Buffer.prototype.toArrayBuffer = function () {
3562 if (typeof Uint8Array !== 'undefined') {
3563 if (Buffer._useTypedArrays) {
3564 return (new Buffer(this)).buffer
3565 } else {
3566 var buf = new Uint8Array(this.length)
3567 for (var i = 0, len = buf.length; i < len; i += 1) {
3568 buf[i] = this[i]
3569 }
3570 return buf.buffer
3571 }
3572 } else {
3573 throw new Error('Buffer.toArrayBuffer not supported in this browser')
3574 }
3575}
3576
3577// HELPER FUNCTIONS
3578// ================
3579
3580var BP = Buffer.prototype
3581
3582/**
3583 * Augment a Uint8Array *instance* (not the Uint8Array class!) with Buffer methods
3584 */
3585Buffer._augment = function (arr) {
3586 arr._isBuffer = true
3587
3588 // save reference to original Uint8Array get/set methods before overwriting
3589 arr._get = arr.get
3590 arr._set = arr.set
3591
3592 // deprecated, will be removed in node 0.13+
3593 arr.get = BP.get
3594 arr.set = BP.set
3595
3596 arr.write = BP.write
3597 arr.toString = BP.toString
3598 arr.toLocaleString = BP.toString
3599 arr.toJSON = BP.toJSON
3600 arr.equals = BP.equals
3601 arr.compare = BP.compare
3602 arr.copy = BP.copy
3603 arr.slice = BP.slice
3604 arr.readUInt8 = BP.readUInt8
3605 arr.readUInt16LE = BP.readUInt16LE
3606 arr.readUInt16BE = BP.readUInt16BE
3607 arr.readUInt32LE = BP.readUInt32LE
3608 arr.readUInt32BE = BP.readUInt32BE
3609 arr.readInt8 = BP.readInt8
3610 arr.readInt16LE = BP.readInt16LE
3611 arr.readInt16BE = BP.readInt16BE
3612 arr.readInt32LE = BP.readInt32LE
3613 arr.readInt32BE = BP.readInt32BE
3614 arr.readFloatLE = BP.readFloatLE
3615 arr.readFloatBE = BP.readFloatBE
3616 arr.readDoubleLE = BP.readDoubleLE
3617 arr.readDoubleBE = BP.readDoubleBE
3618 arr.writeUInt8 = BP.writeUInt8
3619 arr.writeUInt16LE = BP.writeUInt16LE
3620 arr.writeUInt16BE = BP.writeUInt16BE
3621 arr.writeUInt32LE = BP.writeUInt32LE
3622 arr.writeUInt32BE = BP.writeUInt32BE
3623 arr.writeInt8 = BP.writeInt8
3624 arr.writeInt16LE = BP.writeInt16LE
3625 arr.writeInt16BE = BP.writeInt16BE
3626 arr.writeInt32LE = BP.writeInt32LE
3627 arr.writeInt32BE = BP.writeInt32BE
3628 arr.writeFloatLE = BP.writeFloatLE
3629 arr.writeFloatBE = BP.writeFloatBE
3630 arr.writeDoubleLE = BP.writeDoubleLE
3631 arr.writeDoubleBE = BP.writeDoubleBE
3632 arr.fill = BP.fill
3633 arr.inspect = BP.inspect
3634 arr.toArrayBuffer = BP.toArrayBuffer
3635
3636 return arr
3637}
3638
3639var INVALID_BASE64_RE = /[^+\/0-9A-z]/g
3640
3641function base64clean (str) {
3642 // Node strips out invalid characters like \n and \t from the string, base64-js does not
3643 str = stringtrim(str).replace(INVALID_BASE64_RE, '')
3644 // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not
3645 while (str.length % 4 !== 0) {
3646 str = str + '='
3647 }
3648 return str
3649}
3650
3651function stringtrim (str) {
3652 if (str.trim) return str.trim()
3653 return str.replace(/^\s+|\s+$/g, '')
3654}
3655
3656// slice(start, end)
3657function clamp (index, len, defaultValue) {
3658 if (typeof index !== 'number') return defaultValue
3659 index = ~~index; // Coerce to integer.
3660 if (index >= len) return len
3661 if (index >= 0) return index
3662 index += len
3663 if (index >= 0) return index
3664 return 0
3665}
3666
3667function coerce (length) {
3668 // Coerce length to a number (possibly NaN), round up
3669 // in case it's fractional (e.g. 123.456) then do a
3670 // double negate to coerce a NaN to 0. Easy, right?
3671 length = ~~Math.ceil(+length)
3672 return length < 0 ? 0 : length
3673}
3674
3675function isArray (subject) {
3676 return (Array.isArray || function (subject) {
3677 return Object.prototype.toString.call(subject) === '[object Array]'
3678 })(subject)
3679}
3680
3681function isArrayish (subject) {
3682 return isArray(subject) || Buffer.isBuffer(subject) ||
3683 subject && typeof subject === 'object' &&
3684 typeof subject.length === 'number'
3685}
3686
3687function toHex (n) {
3688 if (n < 16) return '0' + n.toString(16)
3689 return n.toString(16)
3690}
3691
3692function utf8ToBytes (str) {
3693 var byteArray = []
3694 for (var i = 0; i < str.length; i++) {
3695 var b = str.charCodeAt(i)
3696 if (b <= 0x7F) {
3697 byteArray.push(b)
3698 } else {
3699 var start = i
3700 if (b >= 0xD800 && b <= 0xDFFF) i++
3701 var h = encodeURIComponent(str.slice(start, i+1)).substr(1).split('%')
3702 for (var j = 0; j < h.length; j++) {
3703 byteArray.push(parseInt(h[j], 16))
3704 }
3705 }
3706 }
3707 return byteArray
3708}
3709
3710function asciiToBytes (str) {
3711 var byteArray = []
3712 for (var i = 0; i < str.length; i++) {
3713 // Node's code seems to be doing this and not & 0x7F..
3714 byteArray.push(str.charCodeAt(i) & 0xFF)
3715 }
3716 return byteArray
3717}
3718
3719function utf16leToBytes (str) {
3720 var c, hi, lo
3721 var byteArray = []
3722 for (var i = 0; i < str.length; i++) {
3723 c = str.charCodeAt(i)
3724 hi = c >> 8
3725 lo = c % 256
3726 byteArray.push(lo)
3727 byteArray.push(hi)
3728 }
3729
3730 return byteArray
3731}
3732
3733function base64ToBytes (str) {
3734 return base64.toByteArray(str)
3735}
3736
3737function blitBuffer (src, dst, offset, length) {
3738 for (var i = 0; i < length; i++) {
3739 if ((i + offset >= dst.length) || (i >= src.length))
3740 break
3741 dst[i + offset] = src[i]
3742 }
3743 return i
3744}
3745
3746function decodeUtf8Char (str) {
3747 try {
3748 return decodeURIComponent(str)
3749 } catch (err) {
3750 return String.fromCharCode(0xFFFD) // UTF 8 invalid char
3751 }
3752}
3753
3754/*
3755 * We have to make sure that the value is a valid integer. This means that it
3756 * is non-negative. It has no fractional component and that it does not
3757 * exceed the maximum allowed value.
3758 */
3759function verifuint (value, max) {
3760 assert(typeof value === 'number', 'cannot write a non-number as a number')
3761 assert(value >= 0, 'specified a negative value for writing an unsigned value')
3762 assert(value <= max, 'value is larger than maximum value for type')
3763 assert(Math.floor(value) === value, 'value has a fractional component')
3764}
3765
3766function verifsint (value, max, min) {
3767 assert(typeof value === 'number', 'cannot write a non-number as a number')
3768 assert(value <= max, 'value larger than maximum allowed value')
3769 assert(value >= min, 'value smaller than minimum allowed value')
3770 assert(Math.floor(value) === value, 'value has a fractional component')
3771}
3772
3773function verifIEEE754 (value, max, min) {
3774 assert(typeof value === 'number', 'cannot write a non-number as a number')
3775 assert(value <= max, 'value larger than maximum allowed value')
3776 assert(value >= min, 'value smaller than minimum allowed value')
3777}
3778
3779function assert (test, message) {
3780 if (!test) throw new Error(message || 'Failed assertion')
3781}
3782
3783},{"base64-js":9,"ieee754":10}],9:[function(_dereq_,module,exports){
3784var lookup = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/';
3785
3786;(function (exports) {
3787 'use strict';
3788
3789 var Arr = (typeof Uint8Array !== 'undefined')
3790 ? Uint8Array
3791 : Array
3792
3793 var PLUS = '+'.charCodeAt(0)
3794 var SLASH = '/'.charCodeAt(0)
3795 var NUMBER = '0'.charCodeAt(0)
3796 var LOWER = 'a'.charCodeAt(0)
3797 var UPPER = 'A'.charCodeAt(0)
3798
3799 function decode (elt) {
3800 var code = elt.charCodeAt(0)
3801 if (code === PLUS)
3802 return 62 // '+'
3803 if (code === SLASH)
3804 return 63 // '/'
3805 if (code < NUMBER)
3806 return -1 //no match
3807 if (code < NUMBER + 10)
3808 return code - NUMBER + 26 + 26
3809 if (code < UPPER + 26)
3810 return code - UPPER
3811 if (code < LOWER + 26)
3812 return code - LOWER + 26
3813 }
3814
3815 function b64ToByteArray (b64) {
3816 var i, j, l, tmp, placeHolders, arr
3817
3818 if (b64.length % 4 > 0) {
3819 throw new Error('Invalid string. Length must be a multiple of 4')
3820 }
3821
3822 // the number of equal signs (place holders)
3823 // if there are two placeholders, than the two characters before it
3824 // represent one byte
3825 // if there is only one, then the three characters before it represent 2 bytes
3826 // this is just a cheap hack to not do indexOf twice
3827 var len = b64.length
3828 placeHolders = '=' === b64.charAt(len - 2) ? 2 : '=' === b64.charAt(len - 1) ? 1 : 0
3829
3830 // base64 is 4/3 + up to two characters of the original data
3831 arr = new Arr(b64.length * 3 / 4 - placeHolders)
3832
3833 // if there are placeholders, only get up to the last complete 4 chars
3834 l = placeHolders > 0 ? b64.length - 4 : b64.length
3835
3836 var L = 0
3837
3838 function push (v) {
3839 arr[L++] = v
3840 }
3841
3842 for (i = 0, j = 0; i < l; i += 4, j += 3) {
3843 tmp = (decode(b64.charAt(i)) << 18) | (decode(b64.charAt(i + 1)) << 12) | (decode(b64.charAt(i + 2)) << 6) | decode(b64.charAt(i + 3))
3844 push((tmp & 0xFF0000) >> 16)
3845 push((tmp & 0xFF00) >> 8)
3846 push(tmp & 0xFF)
3847 }
3848
3849 if (placeHolders === 2) {
3850 tmp = (decode(b64.charAt(i)) << 2) | (decode(b64.charAt(i + 1)) >> 4)
3851 push(tmp & 0xFF)
3852 } else if (placeHolders === 1) {
3853 tmp = (decode(b64.charAt(i)) << 10) | (decode(b64.charAt(i + 1)) << 4) | (decode(b64.charAt(i + 2)) >> 2)
3854 push((tmp >> 8) & 0xFF)
3855 push(tmp & 0xFF)
3856 }
3857
3858 return arr
3859 }
3860
3861 function uint8ToBase64 (uint8) {
3862 var i,
3863 extraBytes = uint8.length % 3, // if we have 1 byte left, pad 2 bytes
3864 output = "",
3865 temp, length
3866
3867 function encode (num) {
3868 return lookup.charAt(num)
3869 }
3870
3871 function tripletToBase64 (num) {
3872 return encode(num >> 18 & 0x3F) + encode(num >> 12 & 0x3F) + encode(num >> 6 & 0x3F) + encode(num & 0x3F)
3873 }
3874
3875 // go through the array every three bytes, we'll deal with trailing stuff later
3876 for (i = 0, length = uint8.length - extraBytes; i < length; i += 3) {
3877 temp = (uint8[i] << 16) + (uint8[i + 1] << 8) + (uint8[i + 2])
3878 output += tripletToBase64(temp)
3879 }
3880
3881 // pad the end with zeros, but make sure to not forget the extra bytes
3882 switch (extraBytes) {
3883 case 1:
3884 temp = uint8[uint8.length - 1]
3885 output += encode(temp >> 2)
3886 output += encode((temp << 4) & 0x3F)
3887 output += '=='
3888 break
3889 case 2:
3890 temp = (uint8[uint8.length - 2] << 8) + (uint8[uint8.length - 1])
3891 output += encode(temp >> 10)
3892 output += encode((temp >> 4) & 0x3F)
3893 output += encode((temp << 2) & 0x3F)
3894 output += '='
3895 break
3896 }
3897
3898 return output
3899 }
3900
3901 exports.toByteArray = b64ToByteArray
3902 exports.fromByteArray = uint8ToBase64
3903}(typeof exports === 'undefined' ? (this.base64js = {}) : exports))
3904
3905},{}],10:[function(_dereq_,module,exports){
3906exports.read = function(buffer, offset, isLE, mLen, nBytes) {
3907 var e, m,
3908 eLen = nBytes * 8 - mLen - 1,
3909 eMax = (1 << eLen) - 1,
3910 eBias = eMax >> 1,
3911 nBits = -7,
3912 i = isLE ? (nBytes - 1) : 0,
3913 d = isLE ? -1 : 1,
3914 s = buffer[offset + i];
3915
3916 i += d;
3917
3918 e = s & ((1 << (-nBits)) - 1);
3919 s >>= (-nBits);
3920 nBits += eLen;
3921 for (; nBits > 0; e = e * 256 + buffer[offset + i], i += d, nBits -= 8){};
3922
3923 m = e & ((1 << (-nBits)) - 1);
3924 e >>= (-nBits);
3925 nBits += mLen;
3926 for (; nBits > 0; m = m * 256 + buffer[offset + i], i += d, nBits -= 8){};
3927
3928 if (e === 0) {
3929 e = 1 - eBias;
3930 } else if (e === eMax) {
3931 return m ? NaN : ((s ? -1 : 1) * Infinity);
3932 } else {
3933 m = m + Math.pow(2, mLen);
3934 e = e - eBias;
3935 }
3936 return (s ? -1 : 1) * m * Math.pow(2, e - mLen);
3937};
3938
3939exports.write = function(buffer, value, offset, isLE, mLen, nBytes) {
3940 var e, m, c,
3941 eLen = nBytes * 8 - mLen - 1,
3942 eMax = (1 << eLen) - 1,
3943 eBias = eMax >> 1,
3944 rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0),
3945 i = isLE ? 0 : (nBytes - 1),
3946 d = isLE ? 1 : -1,
3947 s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0;
3948
3949 value = Math.abs(value);
3950
3951 if (isNaN(value) || value === Infinity) {
3952 m = isNaN(value) ? 1 : 0;
3953 e = eMax;
3954 } else {
3955 e = Math.floor(Math.log(value) / Math.LN2);
3956 if (value * (c = Math.pow(2, -e)) < 1) {
3957 e--;
3958 c *= 2;
3959 }
3960 if (e + eBias >= 1) {
3961 value += rt / c;
3962 } else {
3963 value += rt * Math.pow(2, 1 - eBias);
3964 }
3965 if (value * c >= 2) {
3966 e++;
3967 c /= 2;
3968 }
3969
3970 if (e + eBias >= eMax) {
3971 m = 0;
3972 e = eMax;
3973 } else if (e + eBias >= 1) {
3974 m = (value * c - 1) * Math.pow(2, mLen);
3975 e = e + eBias;
3976 } else {
3977 m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen);
3978 e = 0;
3979 }
3980 }
3981
3982 for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8){};
3983
3984 e = (e << mLen) | m;
3985 eLen += mLen;
3986 for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8){};
3987
3988 buffer[offset + i - d] |= s * 128;
3989};
3990
3991},{}],11:[function(_dereq_,module,exports){
3992if (typeof Object.create === 'function') {
3993 // implementation from standard node.js 'util' module
3994 module.exports = function inherits(ctor, superCtor) {
3995 ctor.super_ = superCtor
3996 ctor.prototype = Object.create(superCtor.prototype, {
3997 constructor: {
3998 value: ctor,
3999 enumerable: false,
4000 writable: true,
4001 configurable: true
4002 }
4003 });
4004 };
4005} else {
4006 // old school shim for old browsers
4007 module.exports = function inherits(ctor, superCtor) {
4008 ctor.super_ = superCtor
4009 var TempCtor = function () {}
4010 TempCtor.prototype = superCtor.prototype
4011 ctor.prototype = new TempCtor()
4012 ctor.prototype.constructor = ctor
4013 }
4014}
4015
4016},{}],12:[function(_dereq_,module,exports){
4017// shim for using process in browser
4018
4019var process = module.exports = {};
4020
4021process.nextTick = (function () {
4022 var canSetImmediate = typeof window !== 'undefined'
4023 && window.setImmediate;
4024 var canPost = typeof window !== 'undefined'
4025 && window.postMessage && window.addEventListener
4026 ;
4027
4028 if (canSetImmediate) {
4029 return function (f) { return window.setImmediate(f) };
4030 }
4031
4032 if (canPost) {
4033 var queue = [];
4034 window.addEventListener('message', function (ev) {
4035 var source = ev.source;
4036 if ((source === window || source === null) && ev.data === 'process-tick') {
4037 ev.stopPropagation();
4038 if (queue.length > 0) {
4039 var fn = queue.shift();
4040 fn();
4041 }
4042 }
4043 }, true);
4044
4045 return function nextTick(fn) {
4046 queue.push(fn);
4047 window.postMessage('process-tick', '*');
4048 };
4049 }
4050
4051 return function nextTick(fn) {
4052 setTimeout(fn, 0);
4053 };
4054})();
4055
4056process.title = 'browser';
4057process.browser = true;
4058process.env = {};
4059process.argv = [];
4060
4061function noop() {}
4062
4063process.on = noop;
4064process.addListener = noop;
4065process.once = noop;
4066process.off = noop;
4067process.removeListener = noop;
4068process.removeAllListeners = noop;
4069process.emit = noop;
4070
4071process.binding = function (name) {
4072 throw new Error('process.binding is not supported');
4073}
4074
4075// TODO(shtylman)
4076process.cwd = function () { return '/' };
4077process.chdir = function (dir) {
4078 throw new Error('process.chdir is not supported');
4079};
4080
4081},{}],13:[function(_dereq_,module,exports){
4082module.exports=_dereq_(5)
4083},{}],14:[function(_dereq_,module,exports){
4084module.exports=_dereq_(6)
4085},{"./support/isBuffer":13,"FWaASH":12,"inherits":11}],15:[function(_dereq_,module,exports){
4086(function (Buffer){
4087// Base58 encoding/decoding
4088// Originally written by Mike Hearn for BitcoinJ
4089// Copyright (c) 2011 Google Inc
4090// Ported to JavaScript by Stefan Thomas
4091// Merged Buffer refactorings from base58-native by Stephen Pair
4092// Copyright (c) 2013 BitPay Inc
4093
4094var assert = _dereq_('assert')
4095var BigInteger = _dereq_('bigi')
4096
4097var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
4098var ALPHABET_BUF = new Buffer(ALPHABET, 'ascii')
4099var ALPHABET_MAP = {}
4100for(var i = 0; i < ALPHABET.length; i++) {
4101 ALPHABET_MAP[ALPHABET.charAt(i)] = BigInteger.valueOf(i)
4102}
4103var BASE = new BigInteger('58')
4104
4105function encode(buffer) {
4106 var bi = BigInteger.fromBuffer(buffer)
4107 var result = new Buffer(buffer.length << 1)
4108
4109 var i = result.length - 1
4110 while (bi.signum() > 0) {
4111 var remainder = bi.mod(BASE)
4112 bi = bi.divide(BASE)
4113
4114 result[i] = ALPHABET_BUF[remainder.intValue()]
4115 i--
4116 }
4117
4118 // deal with leading zeros
4119 var j = 0
4120 while (buffer[j] === 0) {
4121 result[i] = ALPHABET_BUF[0]
4122 j++
4123 i--
4124 }
4125
4126 return result.slice(i + 1, result.length).toString('ascii')
4127}
4128
4129function decode(string) {
4130 if (string.length === 0) return new Buffer(0)
4131
4132 var num = BigInteger.ZERO
4133
4134 for (var i = 0; i < string.length; i++) {
4135 num = num.multiply(BASE)
4136
4137 var figure = ALPHABET_MAP[string.charAt(i)]
4138 assert.notEqual(figure, undefined, 'Non-base58 character')
4139
4140 num = num.add(figure)
4141 }
4142
4143 // deal with leading zeros
4144 var j = 0
4145 while ((j < string.length) && (string[j] === ALPHABET[0])) {
4146 j++
4147 }
4148
4149 var buffer = num.toBuffer()
4150 var leadingZeros = new Buffer(j)
4151 leadingZeros.fill(0)
4152
4153 return Buffer.concat([leadingZeros, buffer])
4154}
4155
4156module.exports = {
4157 encode: encode,
4158 decode: decode
4159}
4160
4161}).call(this,_dereq_("buffer").Buffer)
4162},{"assert":4,"bigi":3,"buffer":8}],16:[function(_dereq_,module,exports){
4163(function (Buffer){
4164var createHash = _dereq_('sha.js')
4165
4166var md5 = toConstructor(_dereq_('./md5'))
4167var rmd160 = toConstructor(_dereq_('ripemd160'))
4168
4169function toConstructor (fn) {
4170 return function () {
4171 var buffers = []
4172 var m= {
4173 update: function (data, enc) {
4174 if(!Buffer.isBuffer(data)) data = new Buffer(data, enc)
4175 buffers.push(data)
4176 return this
4177 },
4178 digest: function (enc) {
4179 var buf = Buffer.concat(buffers)
4180 var r = fn(buf)
4181 buffers = null
4182 return enc ? r.toString(enc) : r
4183 }
4184 }
4185 return m
4186 }
4187}
4188
4189module.exports = function (alg) {
4190 if('md5' === alg) return new md5()
4191 if('rmd160' === alg) return new rmd160()
4192 return createHash(alg)
4193}
4194
4195}).call(this,_dereq_("buffer").Buffer)
4196},{"./md5":20,"buffer":8,"ripemd160":21,"sha.js":23}],17:[function(_dereq_,module,exports){
4197(function (Buffer){
4198var createHash = _dereq_('./create-hash')
4199
4200var blocksize = 64
4201var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
4202
4203module.exports = Hmac
4204
4205function Hmac (alg, key) {
4206 if(!(this instanceof Hmac)) return new Hmac(alg, key)
4207 this._opad = opad
4208 this._alg = alg
4209
4210 key = this._key = !Buffer.isBuffer(key) ? new Buffer(key) : key
4211
4212 if(key.length > blocksize) {
4213 key = createHash(alg).update(key).digest()
4214 } else if(key.length < blocksize) {
4215 key = Buffer.concat([key, zeroBuffer], blocksize)
4216 }
4217
4218 var ipad = this._ipad = new Buffer(blocksize)
4219 var opad = this._opad = new Buffer(blocksize)
4220
4221 for(var i = 0; i < blocksize; i++) {
4222 ipad[i] = key[i] ^ 0x36
4223 opad[i] = key[i] ^ 0x5C
4224 }
4225
4226 this._hash = createHash(alg).update(ipad)
4227}
4228
4229Hmac.prototype.update = function (data, enc) {
4230 this._hash.update(data, enc)
4231 return this
4232}
4233
4234Hmac.prototype.digest = function (enc) {
4235 var h = this._hash.digest()
4236 return createHash(this._alg).update(this._opad).update(h).digest(enc)
4237}
4238
4239
4240}).call(this,_dereq_("buffer").Buffer)
4241},{"./create-hash":16,"buffer":8}],18:[function(_dereq_,module,exports){
4242(function (Buffer){
4243var intSize = 4;
4244var zeroBuffer = new Buffer(intSize); zeroBuffer.fill(0);
4245var chrsz = 8;
4246
4247function toArray(buf, bigEndian) {
4248 if ((buf.length % intSize) !== 0) {
4249 var len = buf.length + (intSize - (buf.length % intSize));
4250 buf = Buffer.concat([buf, zeroBuffer], len);
4251 }
4252
4253 var arr = [];
4254 var fn = bigEndian ? buf.readInt32BE : buf.readInt32LE;
4255 for (var i = 0; i < buf.length; i += intSize) {
4256 arr.push(fn.call(buf, i));
4257 }
4258 return arr;
4259}
4260
4261function toBuffer(arr, size, bigEndian) {
4262 var buf = new Buffer(size);
4263 var fn = bigEndian ? buf.writeInt32BE : buf.writeInt32LE;
4264 for (var i = 0; i < arr.length; i++) {
4265 fn.call(buf, arr[i], i * 4, true);
4266 }
4267 return buf;
4268}
4269
4270function hash(buf, fn, hashSize, bigEndian) {
4271 if (!Buffer.isBuffer(buf)) buf = new Buffer(buf);
4272 var arr = fn(toArray(buf, bigEndian), buf.length * chrsz);
4273 return toBuffer(arr, hashSize, bigEndian);
4274}
4275
4276module.exports = { hash: hash };
4277
4278}).call(this,_dereq_("buffer").Buffer)
4279},{"buffer":8}],19:[function(_dereq_,module,exports){
4280(function (Buffer){
4281var rng = _dereq_('./rng')
4282
4283function error () {
4284 var m = [].slice.call(arguments).join(' ')
4285 throw new Error([
4286 m,
4287 'we accept pull requests',
4288 'http://github.com/dominictarr/crypto-browserify'
4289 ].join('\n'))
4290}
4291
4292exports.createHash = _dereq_('./create-hash')
4293
4294exports.createHmac = _dereq_('./create-hmac')
4295
4296exports.randomBytes = function(size, callback) {
4297 if (callback && callback.call) {
4298 try {
4299 callback.call(this, undefined, new Buffer(rng(size)))
4300 } catch (err) { callback(err) }
4301 } else {
4302 return new Buffer(rng(size))
4303 }
4304}
4305
4306function each(a, f) {
4307 for(var i in a)
4308 f(a[i], i)
4309}
4310
4311exports.getHashes = function () {
4312 return ['sha1', 'sha256', 'md5', 'rmd160']
4313
4314}
4315
4316var p = _dereq_('./pbkdf2')(exports.createHmac)
4317exports.pbkdf2 = p.pbkdf2
4318exports.pbkdf2Sync = p.pbkdf2Sync
4319
4320
4321// the least I can do is make error messages for the rest of the node.js/crypto api.
4322each(['createCredentials'
4323, 'createCipher'
4324, 'createCipheriv'
4325, 'createDecipher'
4326, 'createDecipheriv'
4327, 'createSign'
4328, 'createVerify'
4329, 'createDiffieHellman'
4330], function (name) {
4331 exports[name] = function () {
4332 error('sorry,', name, 'is not implemented yet')
4333 }
4334})
4335
4336}).call(this,_dereq_("buffer").Buffer)
4337},{"./create-hash":16,"./create-hmac":17,"./pbkdf2":27,"./rng":28,"buffer":8}],20:[function(_dereq_,module,exports){
4338/*
4339 * A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
4340 * Digest Algorithm, as defined in RFC 1321.
4341 * Version 2.1 Copyright (C) Paul Johnston 1999 - 2002.
4342 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4343 * Distributed under the BSD License
4344 * See http://pajhome.org.uk/crypt/md5 for more info.
4345 */
4346
4347var helpers = _dereq_('./helpers');
4348
4349/*
4350 * Calculate the MD5 of an array of little-endian words, and a bit length
4351 */
4352function core_md5(x, len)
4353{
4354 /* append padding */
4355 x[len >> 5] |= 0x80 << ((len) % 32);
4356 x[(((len + 64) >>> 9) << 4) + 14] = len;
4357
4358 var a = 1732584193;
4359 var b = -271733879;
4360 var c = -1732584194;
4361 var d = 271733878;
4362
4363 for(var i = 0; i < x.length; i += 16)
4364 {
4365 var olda = a;
4366 var oldb = b;
4367 var oldc = c;
4368 var oldd = d;
4369
4370 a = md5_ff(a, b, c, d, x[i+ 0], 7 , -680876936);
4371 d = md5_ff(d, a, b, c, x[i+ 1], 12, -389564586);
4372 c = md5_ff(c, d, a, b, x[i+ 2], 17, 606105819);
4373 b = md5_ff(b, c, d, a, x[i+ 3], 22, -1044525330);
4374 a = md5_ff(a, b, c, d, x[i+ 4], 7 , -176418897);
4375 d = md5_ff(d, a, b, c, x[i+ 5], 12, 1200080426);
4376 c = md5_ff(c, d, a, b, x[i+ 6], 17, -1473231341);
4377 b = md5_ff(b, c, d, a, x[i+ 7], 22, -45705983);
4378 a = md5_ff(a, b, c, d, x[i+ 8], 7 , 1770035416);
4379 d = md5_ff(d, a, b, c, x[i+ 9], 12, -1958414417);
4380 c = md5_ff(c, d, a, b, x[i+10], 17, -42063);
4381 b = md5_ff(b, c, d, a, x[i+11], 22, -1990404162);
4382 a = md5_ff(a, b, c, d, x[i+12], 7 , 1804603682);
4383 d = md5_ff(d, a, b, c, x[i+13], 12, -40341101);
4384 c = md5_ff(c, d, a, b, x[i+14], 17, -1502002290);
4385 b = md5_ff(b, c, d, a, x[i+15], 22, 1236535329);
4386
4387 a = md5_gg(a, b, c, d, x[i+ 1], 5 , -165796510);
4388 d = md5_gg(d, a, b, c, x[i+ 6], 9 , -1069501632);
4389 c = md5_gg(c, d, a, b, x[i+11], 14, 643717713);
4390 b = md5_gg(b, c, d, a, x[i+ 0], 20, -373897302);
4391 a = md5_gg(a, b, c, d, x[i+ 5], 5 , -701558691);
4392 d = md5_gg(d, a, b, c, x[i+10], 9 , 38016083);
4393 c = md5_gg(c, d, a, b, x[i+15], 14, -660478335);
4394 b = md5_gg(b, c, d, a, x[i+ 4], 20, -405537848);
4395 a = md5_gg(a, b, c, d, x[i+ 9], 5 , 568446438);
4396 d = md5_gg(d, a, b, c, x[i+14], 9 , -1019803690);
4397 c = md5_gg(c, d, a, b, x[i+ 3], 14, -187363961);
4398 b = md5_gg(b, c, d, a, x[i+ 8], 20, 1163531501);
4399 a = md5_gg(a, b, c, d, x[i+13], 5 , -1444681467);
4400 d = md5_gg(d, a, b, c, x[i+ 2], 9 , -51403784);
4401 c = md5_gg(c, d, a, b, x[i+ 7], 14, 1735328473);
4402 b = md5_gg(b, c, d, a, x[i+12], 20, -1926607734);
4403
4404 a = md5_hh(a, b, c, d, x[i+ 5], 4 , -378558);
4405 d = md5_hh(d, a, b, c, x[i+ 8], 11, -2022574463);
4406 c = md5_hh(c, d, a, b, x[i+11], 16, 1839030562);
4407 b = md5_hh(b, c, d, a, x[i+14], 23, -35309556);
4408 a = md5_hh(a, b, c, d, x[i+ 1], 4 , -1530992060);
4409 d = md5_hh(d, a, b, c, x[i+ 4], 11, 1272893353);
4410 c = md5_hh(c, d, a, b, x[i+ 7], 16, -155497632);
4411 b = md5_hh(b, c, d, a, x[i+10], 23, -1094730640);
4412 a = md5_hh(a, b, c, d, x[i+13], 4 , 681279174);
4413 d = md5_hh(d, a, b, c, x[i+ 0], 11, -358537222);
4414 c = md5_hh(c, d, a, b, x[i+ 3], 16, -722521979);
4415 b = md5_hh(b, c, d, a, x[i+ 6], 23, 76029189);
4416 a = md5_hh(a, b, c, d, x[i+ 9], 4 , -640364487);
4417 d = md5_hh(d, a, b, c, x[i+12], 11, -421815835);
4418 c = md5_hh(c, d, a, b, x[i+15], 16, 530742520);
4419 b = md5_hh(b, c, d, a, x[i+ 2], 23, -995338651);
4420
4421 a = md5_ii(a, b, c, d, x[i+ 0], 6 , -198630844);
4422 d = md5_ii(d, a, b, c, x[i+ 7], 10, 1126891415);
4423 c = md5_ii(c, d, a, b, x[i+14], 15, -1416354905);
4424 b = md5_ii(b, c, d, a, x[i+ 5], 21, -57434055);
4425 a = md5_ii(a, b, c, d, x[i+12], 6 , 1700485571);
4426 d = md5_ii(d, a, b, c, x[i+ 3], 10, -1894986606);
4427 c = md5_ii(c, d, a, b, x[i+10], 15, -1051523);
4428 b = md5_ii(b, c, d, a, x[i+ 1], 21, -2054922799);
4429 a = md5_ii(a, b, c, d, x[i+ 8], 6 , 1873313359);
4430 d = md5_ii(d, a, b, c, x[i+15], 10, -30611744);
4431 c = md5_ii(c, d, a, b, x[i+ 6], 15, -1560198380);
4432 b = md5_ii(b, c, d, a, x[i+13], 21, 1309151649);
4433 a = md5_ii(a, b, c, d, x[i+ 4], 6 , -145523070);
4434 d = md5_ii(d, a, b, c, x[i+11], 10, -1120210379);
4435 c = md5_ii(c, d, a, b, x[i+ 2], 15, 718787259);
4436 b = md5_ii(b, c, d, a, x[i+ 9], 21, -343485551);
4437
4438 a = safe_add(a, olda);
4439 b = safe_add(b, oldb);
4440 c = safe_add(c, oldc);
4441 d = safe_add(d, oldd);
4442 }
4443 return Array(a, b, c, d);
4444
4445}
4446
4447/*
4448 * These functions implement the four basic operations the algorithm uses.
4449 */
4450function md5_cmn(q, a, b, x, s, t)
4451{
4452 return safe_add(bit_rol(safe_add(safe_add(a, q), safe_add(x, t)), s),b);
4453}
4454function md5_ff(a, b, c, d, x, s, t)
4455{
4456 return md5_cmn((b & c) | ((~b) & d), a, b, x, s, t);
4457}
4458function md5_gg(a, b, c, d, x, s, t)
4459{
4460 return md5_cmn((b & d) | (c & (~d)), a, b, x, s, t);
4461}
4462function md5_hh(a, b, c, d, x, s, t)
4463{
4464 return md5_cmn(b ^ c ^ d, a, b, x, s, t);
4465}
4466function md5_ii(a, b, c, d, x, s, t)
4467{
4468 return md5_cmn(c ^ (b | (~d)), a, b, x, s, t);
4469}
4470
4471/*
4472 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
4473 * to work around bugs in some JS interpreters.
4474 */
4475function safe_add(x, y)
4476{
4477 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
4478 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
4479 return (msw << 16) | (lsw & 0xFFFF);
4480}
4481
4482/*
4483 * Bitwise rotate a 32-bit number to the left.
4484 */
4485function bit_rol(num, cnt)
4486{
4487 return (num << cnt) | (num >>> (32 - cnt));
4488}
4489
4490module.exports = function md5(buf) {
4491 return helpers.hash(buf, core_md5, 16);
4492};
4493
4494},{"./helpers":18}],21:[function(_dereq_,module,exports){
4495(function (Buffer){
4496
4497module.exports = ripemd160
4498
4499
4500
4501/*
4502CryptoJS v3.1.2
4503code.google.com/p/crypto-js
4504(c) 2009-2013 by Jeff Mott. All rights reserved.
4505code.google.com/p/crypto-js/wiki/License
4506*/
4507/** @preserve
4508(c) 2012 by Cédric Mesnil. All rights reserved.
4509
4510Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
4511
4512 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
4513 - 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.
4514
4515THIS 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.
4516*/
4517
4518// Constants table
4519var zl = [
4520 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
4521 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
4522 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
4523 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
4524 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13];
4525var zr = [
4526 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
4527 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
4528 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
4529 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
4530 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11];
4531var sl = [
4532 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
4533 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
4534 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
4535 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
4536 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ];
4537var sr = [
4538 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
4539 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
4540 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
4541 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
4542 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ];
4543
4544var hl = [ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E];
4545var hr = [ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000];
4546
4547var bytesToWords = function (bytes) {
4548 var words = [];
4549 for (var i = 0, b = 0; i < bytes.length; i++, b += 8) {
4550 words[b >>> 5] |= bytes[i] << (24 - b % 32);
4551 }
4552 return words;
4553};
4554
4555var wordsToBytes = function (words) {
4556 var bytes = [];
4557 for (var b = 0; b < words.length * 32; b += 8) {
4558 bytes.push((words[b >>> 5] >>> (24 - b % 32)) & 0xFF);
4559 }
4560 return bytes;
4561};
4562
4563var processBlock = function (H, M, offset) {
4564
4565 // Swap endian
4566 for (var i = 0; i < 16; i++) {
4567 var offset_i = offset + i;
4568 var M_offset_i = M[offset_i];
4569
4570 // Swap
4571 M[offset_i] = (
4572 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
4573 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
4574 );
4575 }
4576
4577 // Working variables
4578 var al, bl, cl, dl, el;
4579 var ar, br, cr, dr, er;
4580
4581 ar = al = H[0];
4582 br = bl = H[1];
4583 cr = cl = H[2];
4584 dr = dl = H[3];
4585 er = el = H[4];
4586 // Computation
4587 var t;
4588 for (var i = 0; i < 80; i += 1) {
4589 t = (al + M[offset+zl[i]])|0;
4590 if (i<16){
4591 t += f1(bl,cl,dl) + hl[0];
4592 } else if (i<32) {
4593 t += f2(bl,cl,dl) + hl[1];
4594 } else if (i<48) {
4595 t += f3(bl,cl,dl) + hl[2];
4596 } else if (i<64) {
4597 t += f4(bl,cl,dl) + hl[3];
4598 } else {// if (i<80) {
4599 t += f5(bl,cl,dl) + hl[4];
4600 }
4601 t = t|0;
4602 t = rotl(t,sl[i]);
4603 t = (t+el)|0;
4604 al = el;
4605 el = dl;
4606 dl = rotl(cl, 10);
4607 cl = bl;
4608 bl = t;
4609
4610 t = (ar + M[offset+zr[i]])|0;
4611 if (i<16){
4612 t += f5(br,cr,dr) + hr[0];
4613 } else if (i<32) {
4614 t += f4(br,cr,dr) + hr[1];
4615 } else if (i<48) {
4616 t += f3(br,cr,dr) + hr[2];
4617 } else if (i<64) {
4618 t += f2(br,cr,dr) + hr[3];
4619 } else {// if (i<80) {
4620 t += f1(br,cr,dr) + hr[4];
4621 }
4622 t = t|0;
4623 t = rotl(t,sr[i]) ;
4624 t = (t+er)|0;
4625 ar = er;
4626 er = dr;
4627 dr = rotl(cr, 10);
4628 cr = br;
4629 br = t;
4630 }
4631 // Intermediate hash value
4632 t = (H[1] + cl + dr)|0;
4633 H[1] = (H[2] + dl + er)|0;
4634 H[2] = (H[3] + el + ar)|0;
4635 H[3] = (H[4] + al + br)|0;
4636 H[4] = (H[0] + bl + cr)|0;
4637 H[0] = t;
4638};
4639
4640function f1(x, y, z) {
4641 return ((x) ^ (y) ^ (z));
4642}
4643
4644function f2(x, y, z) {
4645 return (((x)&(y)) | ((~x)&(z)));
4646}
4647
4648function f3(x, y, z) {
4649 return (((x) | (~(y))) ^ (z));
4650}
4651
4652function f4(x, y, z) {
4653 return (((x) & (z)) | ((y)&(~(z))));
4654}
4655
4656function f5(x, y, z) {
4657 return ((x) ^ ((y) |(~(z))));
4658}
4659
4660function rotl(x,n) {
4661 return (x<<n) | (x>>>(32-n));
4662}
4663
4664function ripemd160(message) {
4665 var H = [0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0];
4666
4667 if (typeof message == 'string')
4668 message = new Buffer(message, 'utf8');
4669
4670 var m = bytesToWords(message);
4671
4672 var nBitsLeft = message.length * 8;
4673 var nBitsTotal = message.length * 8;
4674
4675 // Add padding
4676 m[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
4677 m[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
4678 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
4679 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
4680 );
4681
4682 for (var i=0 ; i<m.length; i += 16) {
4683 processBlock(H, m, i);
4684 }
4685
4686 // Swap endian
4687 for (var i = 0; i < 5; i++) {
4688 // Shortcut
4689 var H_i = H[i];
4690
4691 // Swap
4692 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
4693 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
4694 }
4695
4696 var digestbytes = wordsToBytes(H);
4697 return new Buffer(digestbytes);
4698}
4699
4700
4701
4702}).call(this,_dereq_("buffer").Buffer)
4703},{"buffer":8}],22:[function(_dereq_,module,exports){
4704var u = _dereq_('./util')
4705var write = u.write
4706var fill = u.zeroFill
4707
4708module.exports = function (Buffer) {
4709
4710 //prototype class for hash functions
4711 function Hash (blockSize, finalSize) {
4712 this._block = new Buffer(blockSize) //new Uint32Array(blockSize/4)
4713 this._finalSize = finalSize
4714 this._blockSize = blockSize
4715 this._len = 0
4716 this._s = 0
4717 }
4718
4719 Hash.prototype.init = function () {
4720 this._s = 0
4721 this._len = 0
4722 }
4723
4724 function lengthOf(data, enc) {
4725 if(enc == null) return data.byteLength || data.length
4726 if(enc == 'ascii' || enc == 'binary') return data.length
4727 if(enc == 'hex') return data.length/2
4728 if(enc == 'base64') return data.length/3
4729 }
4730
4731 Hash.prototype.update = function (data, enc) {
4732 var bl = this._blockSize
4733
4734 //I'd rather do this with a streaming encoder, like the opposite of
4735 //http://nodejs.org/api/string_decoder.html
4736 var length
4737 if(!enc && 'string' === typeof data)
4738 enc = 'utf8'
4739
4740 if(enc) {
4741 if(enc === 'utf-8')
4742 enc = 'utf8'
4743
4744 if(enc === 'base64' || enc === 'utf8')
4745 data = new Buffer(data, enc), enc = null
4746
4747 length = lengthOf(data, enc)
4748 } else
4749 length = data.byteLength || data.length
4750
4751 var l = this._len += length
4752 var s = this._s = (this._s || 0)
4753 var f = 0
4754 var buffer = this._block
4755 while(s < l) {
4756 var t = Math.min(length, f + bl)
4757 write(buffer, data, enc, s%bl, f, t)
4758 var ch = (t - f);
4759 s += ch; f += ch
4760
4761 if(!(s%bl))
4762 this._update(buffer)
4763 }
4764 this._s = s
4765
4766 return this
4767
4768 }
4769
4770 Hash.prototype.digest = function (enc) {
4771 var bl = this._blockSize
4772 var fl = this._finalSize
4773 var len = this._len*8
4774
4775 var x = this._block
4776
4777 var bits = len % (bl*8)
4778
4779 //add end marker, so that appending 0's creats a different hash.
4780 x[this._len % bl] = 0x80
4781 fill(this._block, this._len % bl + 1)
4782
4783 if(bits >= fl*8) {
4784 this._update(this._block)
4785 u.zeroFill(this._block, 0)
4786 }
4787
4788 //TODO: handle case where the bit length is > Math.pow(2, 29)
4789 x.writeInt32BE(len, fl + 4) //big endian
4790
4791 var hash = this._update(this._block) || this._hash()
4792 if(enc == null) return hash
4793 return hash.toString(enc)
4794 }
4795
4796 Hash.prototype._update = function () {
4797 throw new Error('_update must be implemented by subclass')
4798 }
4799
4800 return Hash
4801}
4802
4803},{"./util":26}],23:[function(_dereq_,module,exports){
4804var exports = module.exports = function (alg) {
4805 var Alg = exports[alg]
4806 if(!Alg) throw new Error(alg + ' is not supported (we accept pull requests)')
4807 return new Alg()
4808}
4809
4810var Buffer = _dereq_('buffer').Buffer
4811var Hash = _dereq_('./hash')(Buffer)
4812
4813exports.sha =
4814exports.sha1 = _dereq_('./sha1')(Buffer, Hash)
4815exports.sha256 = _dereq_('./sha256')(Buffer, Hash)
4816
4817},{"./hash":22,"./sha1":24,"./sha256":25,"buffer":8}],24:[function(_dereq_,module,exports){
4818/*
4819 * A JavaScript implementation of the Secure Hash Algorithm, SHA-1, as defined
4820 * in FIPS PUB 180-1
4821 * Version 2.1a Copyright Paul Johnston 2000 - 2002.
4822 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4823 * Distributed under the BSD License
4824 * See http://pajhome.org.uk/crypt/md5 for details.
4825 */
4826module.exports = function (Buffer, Hash) {
4827
4828 var inherits = _dereq_('util').inherits
4829
4830 inherits(Sha1, Hash)
4831
4832 var A = 0|0
4833 var B = 4|0
4834 var C = 8|0
4835 var D = 12|0
4836 var E = 16|0
4837
4838 var BE = false
4839 var LE = true
4840
4841 var W = new Int32Array(80)
4842
4843 var POOL = []
4844
4845 function Sha1 () {
4846 if(POOL.length)
4847 return POOL.pop().init()
4848
4849 if(!(this instanceof Sha1)) return new Sha1()
4850 this._w = W
4851 Hash.call(this, 16*4, 14*4)
4852
4853 this._h = null
4854 this.init()
4855 }
4856
4857 Sha1.prototype.init = function () {
4858 this._a = 0x67452301
4859 this._b = 0xefcdab89
4860 this._c = 0x98badcfe
4861 this._d = 0x10325476
4862 this._e = 0xc3d2e1f0
4863
4864 Hash.prototype.init.call(this)
4865 return this
4866 }
4867
4868 Sha1.prototype._POOL = POOL
4869
4870 // assume that array is a Uint32Array with length=16,
4871 // and that if it is the last block, it already has the length and the 1 bit appended.
4872
4873
4874 var isDV = new Buffer(1) instanceof DataView
4875 function readInt32BE (X, i) {
4876 return isDV
4877 ? X.getInt32(i, false)
4878 : X.readInt32BE(i)
4879 }
4880
4881 Sha1.prototype._update = function (array) {
4882
4883 var X = this._block
4884 var h = this._h
4885 var a, b, c, d, e, _a, _b, _c, _d, _e
4886
4887 a = _a = this._a
4888 b = _b = this._b
4889 c = _c = this._c
4890 d = _d = this._d
4891 e = _e = this._e
4892
4893 var w = this._w
4894
4895 for(var j = 0; j < 80; j++) {
4896 var W = w[j]
4897 = j < 16
4898 //? X.getInt32(j*4, false)
4899 //? readInt32BE(X, j*4) //*/ X.readInt32BE(j*4) //*/
4900 ? X.readInt32BE(j*4)
4901 : rol(w[j - 3] ^ w[j - 8] ^ w[j - 14] ^ w[j - 16], 1)
4902
4903 var t =
4904 add(
4905 add(rol(a, 5), sha1_ft(j, b, c, d)),
4906 add(add(e, W), sha1_kt(j))
4907 );
4908
4909 e = d
4910 d = c
4911 c = rol(b, 30)
4912 b = a
4913 a = t
4914 }
4915
4916 this._a = add(a, _a)
4917 this._b = add(b, _b)
4918 this._c = add(c, _c)
4919 this._d = add(d, _d)
4920 this._e = add(e, _e)
4921 }
4922
4923 Sha1.prototype._hash = function () {
4924 if(POOL.length < 100) POOL.push(this)
4925 var H = new Buffer(20)
4926 //console.log(this._a|0, this._b|0, this._c|0, this._d|0, this._e|0)
4927 H.writeInt32BE(this._a|0, A)
4928 H.writeInt32BE(this._b|0, B)
4929 H.writeInt32BE(this._c|0, C)
4930 H.writeInt32BE(this._d|0, D)
4931 H.writeInt32BE(this._e|0, E)
4932 return H
4933 }
4934
4935 /*
4936 * Perform the appropriate triplet combination function for the current
4937 * iteration
4938 */
4939 function sha1_ft(t, b, c, d) {
4940 if(t < 20) return (b & c) | ((~b) & d);
4941 if(t < 40) return b ^ c ^ d;
4942 if(t < 60) return (b & c) | (b & d) | (c & d);
4943 return b ^ c ^ d;
4944 }
4945
4946 /*
4947 * Determine the appropriate additive constant for the current iteration
4948 */
4949 function sha1_kt(t) {
4950 return (t < 20) ? 1518500249 : (t < 40) ? 1859775393 :
4951 (t < 60) ? -1894007588 : -899497514;
4952 }
4953
4954 /*
4955 * Add integers, wrapping at 2^32. This uses 16-bit operations internally
4956 * to work around bugs in some JS interpreters.
4957 * //dominictarr: this is 10 years old, so maybe this can be dropped?)
4958 *
4959 */
4960 function add(x, y) {
4961 return (x + y ) | 0
4962 //lets see how this goes on testling.
4963 // var lsw = (x & 0xFFFF) + (y & 0xFFFF);
4964 // var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
4965 // return (msw << 16) | (lsw & 0xFFFF);
4966 }
4967
4968 /*
4969 * Bitwise rotate a 32-bit number to the left.
4970 */
4971 function rol(num, cnt) {
4972 return (num << cnt) | (num >>> (32 - cnt));
4973 }
4974
4975 return Sha1
4976}
4977
4978},{"util":14}],25:[function(_dereq_,module,exports){
4979
4980/**
4981 * A JavaScript implementation of the Secure Hash Algorithm, SHA-256, as defined
4982 * in FIPS 180-2
4983 * Version 2.2-beta Copyright Angel Marin, Paul Johnston 2000 - 2009.
4984 * Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
4985 *
4986 */
4987
4988var inherits = _dereq_('util').inherits
4989var BE = false
4990var LE = true
4991var u = _dereq_('./util')
4992
4993module.exports = function (Buffer, Hash) {
4994
4995 var K = [
4996 0x428A2F98, 0x71374491, 0xB5C0FBCF, 0xE9B5DBA5,
4997 0x3956C25B, 0x59F111F1, 0x923F82A4, 0xAB1C5ED5,
4998 0xD807AA98, 0x12835B01, 0x243185BE, 0x550C7DC3,
4999 0x72BE5D74, 0x80DEB1FE, 0x9BDC06A7, 0xC19BF174,
5000 0xE49B69C1, 0xEFBE4786, 0x0FC19DC6, 0x240CA1CC,
5001 0x2DE92C6F, 0x4A7484AA, 0x5CB0A9DC, 0x76F988DA,
5002 0x983E5152, 0xA831C66D, 0xB00327C8, 0xBF597FC7,
5003 0xC6E00BF3, 0xD5A79147, 0x06CA6351, 0x14292967,
5004 0x27B70A85, 0x2E1B2138, 0x4D2C6DFC, 0x53380D13,
5005 0x650A7354, 0x766A0ABB, 0x81C2C92E, 0x92722C85,
5006 0xA2BFE8A1, 0xA81A664B, 0xC24B8B70, 0xC76C51A3,
5007 0xD192E819, 0xD6990624, 0xF40E3585, 0x106AA070,
5008 0x19A4C116, 0x1E376C08, 0x2748774C, 0x34B0BCB5,
5009 0x391C0CB3, 0x4ED8AA4A, 0x5B9CCA4F, 0x682E6FF3,
5010 0x748F82EE, 0x78A5636F, 0x84C87814, 0x8CC70208,
5011 0x90BEFFFA, 0xA4506CEB, 0xBEF9A3F7, 0xC67178F2
5012 ]
5013
5014 inherits(Sha256, Hash)
5015 var W = new Array(64)
5016 var POOL = []
5017 function Sha256() {
5018 // Closure compiler warning - this code lacks side effects - thus commented out
5019 // if(POOL.length) {
5020 // return POOL.shift().init()
5021 // }
5022 //this._data = new Buffer(32)
5023
5024 this.init()
5025
5026 this._w = W //new Array(64)
5027
5028 Hash.call(this, 16*4, 14*4)
5029 };
5030
5031 Sha256.prototype.init = function () {
5032
5033 this._a = 0x6a09e667|0
5034 this._b = 0xbb67ae85|0
5035 this._c = 0x3c6ef372|0
5036 this._d = 0xa54ff53a|0
5037 this._e = 0x510e527f|0
5038 this._f = 0x9b05688c|0
5039 this._g = 0x1f83d9ab|0
5040 this._h = 0x5be0cd19|0
5041
5042 this._len = this._s = 0
5043
5044 return this
5045 }
5046
5047 var safe_add = function(x, y) {
5048 var lsw = (x & 0xFFFF) + (y & 0xFFFF);
5049 var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
5050 return (msw << 16) | (lsw & 0xFFFF);
5051 }
5052
5053 function S (X, n) {
5054 return (X >>> n) | (X << (32 - n));
5055 }
5056
5057 function R (X, n) {
5058 return (X >>> n);
5059 }
5060
5061 function Ch (x, y, z) {
5062 return ((x & y) ^ ((~x) & z));
5063 }
5064
5065 function Maj (x, y, z) {
5066 return ((x & y) ^ (x & z) ^ (y & z));
5067 }
5068
5069 function Sigma0256 (x) {
5070 return (S(x, 2) ^ S(x, 13) ^ S(x, 22));
5071 }
5072
5073 function Sigma1256 (x) {
5074 return (S(x, 6) ^ S(x, 11) ^ S(x, 25));
5075 }
5076
5077 function Gamma0256 (x) {
5078 return (S(x, 7) ^ S(x, 18) ^ R(x, 3));
5079 }
5080
5081 function Gamma1256 (x) {
5082 return (S(x, 17) ^ S(x, 19) ^ R(x, 10));
5083 }
5084
5085 Sha256.prototype._update = function(m) {
5086 var M = this._block
5087 var W = this._w
5088 var a, b, c, d, e, f, g, h
5089 var T1, T2
5090
5091 a = this._a | 0
5092 b = this._b | 0
5093 c = this._c | 0
5094 d = this._d | 0
5095 e = this._e | 0
5096 f = this._f | 0
5097 g = this._g | 0
5098 h = this._h | 0
5099
5100 for (var j = 0; j < 64; j++) {
5101 var w = W[j] = j < 16
5102 ? M.readInt32BE(j * 4)
5103 : Gamma1256(W[j - 2]) + W[j - 7] + Gamma0256(W[j - 15]) + W[j - 16]
5104
5105 T1 = h + Sigma1256(e) + Ch(e, f, g) + K[j] + w
5106
5107 T2 = Sigma0256(a) + Maj(a, b, c);
5108 h = g; g = f; f = e; e = d + T1; d = c; c = b; b = a; a = T1 + T2;
5109 }
5110
5111 this._a = (a + this._a) | 0
5112 this._b = (b + this._b) | 0
5113 this._c = (c + this._c) | 0
5114 this._d = (d + this._d) | 0
5115 this._e = (e + this._e) | 0
5116 this._f = (f + this._f) | 0
5117 this._g = (g + this._g) | 0
5118 this._h = (h + this._h) | 0
5119
5120 };
5121
5122 Sha256.prototype._hash = function () {
5123 if(POOL.length < 10)
5124 POOL.push(this)
5125
5126 var H = new Buffer(32)
5127
5128 H.writeInt32BE(this._a, 0)
5129 H.writeInt32BE(this._b, 4)
5130 H.writeInt32BE(this._c, 8)
5131 H.writeInt32BE(this._d, 12)
5132 H.writeInt32BE(this._e, 16)
5133 H.writeInt32BE(this._f, 20)
5134 H.writeInt32BE(this._g, 24)
5135 H.writeInt32BE(this._h, 28)
5136
5137 return H
5138 }
5139
5140 return Sha256
5141
5142}
5143
5144},{"./util":26,"util":14}],26:[function(_dereq_,module,exports){
5145exports.write = write
5146exports.zeroFill = zeroFill
5147
5148exports.toString = toString
5149
5150function write (buffer, string, enc, start, from, to, LE) {
5151 var l = (to - from)
5152 if(enc === 'ascii' || enc === 'binary') {
5153 for( var i = 0; i < l; i++) {
5154 buffer[start + i] = string.charCodeAt(i + from)
5155 }
5156 }
5157 else if(enc == null) {
5158 for( var i = 0; i < l; i++) {
5159 buffer[start + i] = string[i + from]
5160 }
5161 }
5162 else if(enc === 'hex') {
5163 for(var i = 0; i < l; i++) {
5164 var j = from + i
5165 buffer[start + i] = parseInt(string[j*2] + string[(j*2)+1], 16)
5166 }
5167 }
5168 else if(enc === 'base64') {
5169 throw new Error('base64 encoding not yet supported')
5170 }
5171 else
5172 throw new Error(enc +' encoding not yet supported')
5173}
5174
5175//always fill to the end!
5176function zeroFill(buf, from) {
5177 for(var i = from; i < buf.length; i++)
5178 buf[i] = 0
5179}
5180
5181
5182},{}],27:[function(_dereq_,module,exports){
5183(function (Buffer){
5184// JavaScript PBKDF2 Implementation
5185// Based on http://git.io/qsv2zw
5186// Licensed under LGPL v3
5187// Copyright (c) 2013 jduncanator
5188
5189var blocksize = 64
5190var zeroBuffer = new Buffer(blocksize); zeroBuffer.fill(0)
5191
5192module.exports = function (createHmac, exports) {
5193 exports = exports || {}
5194
5195 exports.pbkdf2 = function(password, salt, iterations, keylen, cb) {
5196 if('function' !== typeof cb)
5197 throw new Error('No callback provided to pbkdf2');
5198 setTimeout(function () {
5199 cb(null, exports.pbkdf2Sync(password, salt, iterations, keylen))
5200 })
5201 }
5202
5203 exports.pbkdf2Sync = function(key, salt, iterations, keylen) {
5204 if('number' !== typeof iterations)
5205 throw new TypeError('Iterations not a number')
5206 if(iterations < 0)
5207 throw new TypeError('Bad iterations')
5208 if('number' !== typeof keylen)
5209 throw new TypeError('Key length not a number')
5210 if(keylen < 0)
5211 throw new TypeError('Bad key length')
5212
5213 //stretch key to the correct length that hmac wants it,
5214 //otherwise this will happen every time hmac is called
5215 //twice per iteration.
5216 var key = !Buffer.isBuffer(key) ? new Buffer(key) : key
5217
5218 if(key.length > blocksize) {
5219 key = createHash(alg).update(key).digest()
5220 } else if(key.length < blocksize) {
5221 key = Buffer.concat([key, zeroBuffer], blocksize)
5222 }
5223
5224 var HMAC;
5225 var cplen, p = 0, i = 1, itmp = new Buffer(4), digtmp;
5226 var out = new Buffer(keylen);
5227 out.fill(0);
5228 while(keylen) {
5229 if(keylen > 20)
5230 cplen = 20;
5231 else
5232 cplen = keylen;
5233
5234 /* We are unlikely to ever use more than 256 blocks (5120 bits!)
5235 * but just in case...
5236 */
5237 itmp[0] = (i >> 24) & 0xff;
5238 itmp[1] = (i >> 16) & 0xff;
5239 itmp[2] = (i >> 8) & 0xff;
5240 itmp[3] = i & 0xff;
5241
5242 HMAC = createHmac('sha1', key);
5243 HMAC.update(salt)
5244 HMAC.update(itmp);
5245 digtmp = HMAC.digest();
5246 digtmp.copy(out, p, 0, cplen);
5247
5248 for(var j = 1; j < iterations; j++) {
5249 HMAC = createHmac('sha1', key);
5250 HMAC.update(digtmp);
5251 digtmp = HMAC.digest();
5252 for(var k = 0; k < cplen; k++) {
5253 out[k] ^= digtmp[k];
5254 }
5255 }
5256 keylen -= cplen;
5257 i++;
5258 p += cplen;
5259 }
5260
5261 return out;
5262 }
5263
5264 return exports
5265}
5266
5267}).call(this,_dereq_("buffer").Buffer)
5268},{"buffer":8}],28:[function(_dereq_,module,exports){
5269(function (Buffer){
5270// Original code adapted from Robert Kieffer.
5271// details at https://github.com/broofa/node-uuid
5272
5273
5274(function() {
5275 var _global = this;
5276
5277 var mathRNG, whatwgRNG;
5278
5279 // NOTE: Math.random() does not guarantee "cryptographic quality"
5280 mathRNG = function(size) {
5281 var bytes = new Buffer(size);
5282 var r;
5283
5284 for (var i = 0, r; i < size; i++) {
5285 if ((i & 0x03) == 0) r = Math.random() * 0x100000000;
5286 bytes[i] = r >>> ((i & 0x03) << 3) & 0xff;
5287 }
5288
5289 return bytes;
5290 }
5291
5292 if (_global.crypto && crypto.getRandomValues) {
5293 whatwgRNG = function(size) {
5294 var bytes = new Buffer(size); //in browserify, this is an extended Uint8Array
5295 crypto.getRandomValues(bytes);
5296 return bytes;
5297 }
5298 }
5299
5300 module.exports = whatwgRNG || mathRNG;
5301
5302}())
5303
5304}).call(this,_dereq_("buffer").Buffer)
5305},{"buffer":8}],29:[function(_dereq_,module,exports){
5306;(function (root, factory, undef) {
5307 if (typeof exports === "object") {
5308 // CommonJS
5309 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
5310 }
5311 else if (typeof define === "function" && define.amd) {
5312 // AMD
5313 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
5314 }
5315 else {
5316 // Global (browser)
5317 factory(root.CryptoJS);
5318 }
5319}(this, function (CryptoJS) {
5320
5321 (function () {
5322 // Shortcuts
5323 var C = CryptoJS;
5324 var C_lib = C.lib;
5325 var BlockCipher = C_lib.BlockCipher;
5326 var C_algo = C.algo;
5327
5328 // Lookup tables
5329 var SBOX = [];
5330 var INV_SBOX = [];
5331 var SUB_MIX_0 = [];
5332 var SUB_MIX_1 = [];
5333 var SUB_MIX_2 = [];
5334 var SUB_MIX_3 = [];
5335 var INV_SUB_MIX_0 = [];
5336 var INV_SUB_MIX_1 = [];
5337 var INV_SUB_MIX_2 = [];
5338 var INV_SUB_MIX_3 = [];
5339
5340 // Compute lookup tables
5341 (function () {
5342 // Compute double table
5343 var d = [];
5344 for (var i = 0; i < 256; i++) {
5345 if (i < 128) {
5346 d[i] = i << 1;
5347 } else {
5348 d[i] = (i << 1) ^ 0x11b;
5349 }
5350 }
5351
5352 // Walk GF(2^8)
5353 var x = 0;
5354 var xi = 0;
5355 for (var i = 0; i < 256; i++) {
5356 // Compute sbox
5357 var sx = xi ^ (xi << 1) ^ (xi << 2) ^ (xi << 3) ^ (xi << 4);
5358 sx = (sx >>> 8) ^ (sx & 0xff) ^ 0x63;
5359 SBOX[x] = sx;
5360 INV_SBOX[sx] = x;
5361
5362 // Compute multiplication
5363 var x2 = d[x];
5364 var x4 = d[x2];
5365 var x8 = d[x4];
5366
5367 // Compute sub bytes, mix columns tables
5368 var t = (d[sx] * 0x101) ^ (sx * 0x1010100);
5369 SUB_MIX_0[x] = (t << 24) | (t >>> 8);
5370 SUB_MIX_1[x] = (t << 16) | (t >>> 16);
5371 SUB_MIX_2[x] = (t << 8) | (t >>> 24);
5372 SUB_MIX_3[x] = t;
5373
5374 // Compute inv sub bytes, inv mix columns tables
5375 var t = (x8 * 0x1010101) ^ (x4 * 0x10001) ^ (x2 * 0x101) ^ (x * 0x1010100);
5376 INV_SUB_MIX_0[sx] = (t << 24) | (t >>> 8);
5377 INV_SUB_MIX_1[sx] = (t << 16) | (t >>> 16);
5378 INV_SUB_MIX_2[sx] = (t << 8) | (t >>> 24);
5379 INV_SUB_MIX_3[sx] = t;
5380
5381 // Compute next counter
5382 if (!x) {
5383 x = xi = 1;
5384 } else {
5385 x = x2 ^ d[d[d[x8 ^ x2]]];
5386 xi ^= d[d[xi]];
5387 }
5388 }
5389 }());
5390
5391 // Precomputed Rcon lookup
5392 var RCON = [0x00, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36];
5393
5394 /**
5395 * AES block cipher algorithm.
5396 */
5397 var AES = C_algo.AES = BlockCipher.extend({
5398 _doReset: function () {
5399 // Shortcuts
5400 var key = this._key;
5401 var keyWords = key.words;
5402 var keySize = key.sigBytes / 4;
5403
5404 // Compute number of rounds
5405 var nRounds = this._nRounds = keySize + 6
5406
5407 // Compute number of key schedule rows
5408 var ksRows = (nRounds + 1) * 4;
5409
5410 // Compute key schedule
5411 var keySchedule = this._keySchedule = [];
5412 for (var ksRow = 0; ksRow < ksRows; ksRow++) {
5413 if (ksRow < keySize) {
5414 keySchedule[ksRow] = keyWords[ksRow];
5415 } else {
5416 var t = keySchedule[ksRow - 1];
5417
5418 if (!(ksRow % keySize)) {
5419 // Rot word
5420 t = (t << 8) | (t >>> 24);
5421
5422 // Sub word
5423 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5424
5425 // Mix Rcon
5426 t ^= RCON[(ksRow / keySize) | 0] << 24;
5427 } else if (keySize > 6 && ksRow % keySize == 4) {
5428 // Sub word
5429 t = (SBOX[t >>> 24] << 24) | (SBOX[(t >>> 16) & 0xff] << 16) | (SBOX[(t >>> 8) & 0xff] << 8) | SBOX[t & 0xff];
5430 }
5431
5432 keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
5433 }
5434 }
5435
5436 // Compute inv key schedule
5437 var invKeySchedule = this._invKeySchedule = [];
5438 for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
5439 var ksRow = ksRows - invKsRow;
5440
5441 if (invKsRow % 4) {
5442 var t = keySchedule[ksRow];
5443 } else {
5444 var t = keySchedule[ksRow - 4];
5445 }
5446
5447 if (invKsRow < 4 || ksRow <= 4) {
5448 invKeySchedule[invKsRow] = t;
5449 } else {
5450 invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[(t >>> 16) & 0xff]] ^
5451 INV_SUB_MIX_2[SBOX[(t >>> 8) & 0xff]] ^ INV_SUB_MIX_3[SBOX[t & 0xff]];
5452 }
5453 }
5454 },
5455
5456 encryptBlock: function (M, offset) {
5457 this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
5458 },
5459
5460 decryptBlock: function (M, offset) {
5461 // Swap 2nd and 4th rows
5462 var t = M[offset + 1];
5463 M[offset + 1] = M[offset + 3];
5464 M[offset + 3] = t;
5465
5466 this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
5467
5468 // Inv swap 2nd and 4th rows
5469 var t = M[offset + 1];
5470 M[offset + 1] = M[offset + 3];
5471 M[offset + 3] = t;
5472 },
5473
5474 _doCryptBlock: function (M, offset, keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX) {
5475 // Shortcut
5476 var nRounds = this._nRounds;
5477
5478 // Get input, add round key
5479 var s0 = M[offset] ^ keySchedule[0];
5480 var s1 = M[offset + 1] ^ keySchedule[1];
5481 var s2 = M[offset + 2] ^ keySchedule[2];
5482 var s3 = M[offset + 3] ^ keySchedule[3];
5483
5484 // Key schedule row counter
5485 var ksRow = 4;
5486
5487 // Rounds
5488 for (var round = 1; round < nRounds; round++) {
5489 // Shift rows, sub bytes, mix columns, add round key
5490 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++];
5491 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++];
5492 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++];
5493 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++];
5494
5495 // Update state
5496 s0 = t0;
5497 s1 = t1;
5498 s2 = t2;
5499 s3 = t3;
5500 }
5501
5502 // Shift rows, sub bytes, add round key
5503 var t0 = ((SBOX[s0 >>> 24] << 24) | (SBOX[(s1 >>> 16) & 0xff] << 16) | (SBOX[(s2 >>> 8) & 0xff] << 8) | SBOX[s3 & 0xff]) ^ keySchedule[ksRow++];
5504 var t1 = ((SBOX[s1 >>> 24] << 24) | (SBOX[(s2 >>> 16) & 0xff] << 16) | (SBOX[(s3 >>> 8) & 0xff] << 8) | SBOX[s0 & 0xff]) ^ keySchedule[ksRow++];
5505 var t2 = ((SBOX[s2 >>> 24] << 24) | (SBOX[(s3 >>> 16) & 0xff] << 16) | (SBOX[(s0 >>> 8) & 0xff] << 8) | SBOX[s1 & 0xff]) ^ keySchedule[ksRow++];
5506 var t3 = ((SBOX[s3 >>> 24] << 24) | (SBOX[(s0 >>> 16) & 0xff] << 16) | (SBOX[(s1 >>> 8) & 0xff] << 8) | SBOX[s2 & 0xff]) ^ keySchedule[ksRow++];
5507
5508 // Set output
5509 M[offset] = t0;
5510 M[offset + 1] = t1;
5511 M[offset + 2] = t2;
5512 M[offset + 3] = t3;
5513 },
5514
5515 keySize: 256/32
5516 });
5517
5518 /**
5519 * Shortcut functions to the cipher's object interface.
5520 *
5521 * @example
5522 *
5523 * var ciphertext = CryptoJS.AES.encrypt(message, key, cfg);
5524 * var plaintext = CryptoJS.AES.decrypt(ciphertext, key, cfg);
5525 */
5526 C.AES = BlockCipher._createHelper(AES);
5527 }());
5528
5529
5530 return CryptoJS.AES;
5531
5532}));
5533},{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],30:[function(_dereq_,module,exports){
5534;(function (root, factory) {
5535 if (typeof exports === "object") {
5536 // CommonJS
5537 module.exports = exports = factory(_dereq_("./core"));
5538 }
5539 else if (typeof define === "function" && define.amd) {
5540 // AMD
5541 define(["./core"], factory);
5542 }
5543 else {
5544 // Global (browser)
5545 factory(root.CryptoJS);
5546 }
5547}(this, function (CryptoJS) {
5548
5549 /**
5550 * Cipher core components.
5551 */
5552 CryptoJS.lib.Cipher || (function (undefined) {
5553 // Shortcuts
5554 var C = CryptoJS;
5555 var C_lib = C.lib;
5556 var Base = C_lib.Base;
5557 var WordArray = C_lib.WordArray;
5558 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm;
5559 var C_enc = C.enc;
5560 var Utf8 = C_enc.Utf8;
5561 var Base64 = C_enc.Base64;
5562 var C_algo = C.algo;
5563 var EvpKDF = C_algo.EvpKDF;
5564
5565 /**
5566 * Abstract base cipher template.
5567 *
5568 * @property {number} keySize This cipher's key size. Default: 4 (128 bits)
5569 * @property {number} ivSize This cipher's IV size. Default: 4 (128 bits)
5570 * @property {number} _ENC_XFORM_MODE A constant representing encryption mode.
5571 * @property {number} _DEC_XFORM_MODE A constant representing decryption mode.
5572 */
5573 var Cipher = C_lib.Cipher = BufferedBlockAlgorithm.extend({
5574 /**
5575 * Configuration options.
5576 *
5577 * @property {WordArray} iv The IV to use for this operation.
5578 */
5579 cfg: Base.extend(),
5580
5581 /**
5582 * Creates this cipher in encryption mode.
5583 *
5584 * @param {WordArray} key The key.
5585 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5586 *
5587 * @return {Cipher} A cipher instance.
5588 *
5589 * @static
5590 *
5591 * @example
5592 *
5593 * var cipher = CryptoJS.algo.AES.createEncryptor(keyWordArray, { iv: ivWordArray });
5594 */
5595 createEncryptor: function (key, cfg) {
5596 return this.create(this._ENC_XFORM_MODE, key, cfg);
5597 },
5598
5599 /**
5600 * Creates this cipher in decryption mode.
5601 *
5602 * @param {WordArray} key The key.
5603 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5604 *
5605 * @return {Cipher} A cipher instance.
5606 *
5607 * @static
5608 *
5609 * @example
5610 *
5611 * var cipher = CryptoJS.algo.AES.createDecryptor(keyWordArray, { iv: ivWordArray });
5612 */
5613 createDecryptor: function (key, cfg) {
5614 return this.create(this._DEC_XFORM_MODE, key, cfg);
5615 },
5616
5617 /**
5618 * Initializes a newly created cipher.
5619 *
5620 * @param {number} xformMode Either the encryption or decryption transormation mode constant.
5621 * @param {WordArray} key The key.
5622 * @param {Object} cfg (Optional) The configuration options to use for this operation.
5623 *
5624 * @example
5625 *
5626 * var cipher = CryptoJS.algo.AES.create(CryptoJS.algo.AES._ENC_XFORM_MODE, keyWordArray, { iv: ivWordArray });
5627 */
5628 init: function (xformMode, key, cfg) {
5629 // Apply config defaults
5630 this.cfg = this.cfg.extend(cfg);
5631
5632 // Store transform mode and key
5633 this._xformMode = xformMode;
5634 this._key = key;
5635
5636 // Set initial values
5637 this.reset();
5638 },
5639
5640 /**
5641 * Resets this cipher to its initial state.
5642 *
5643 * @example
5644 *
5645 * cipher.reset();
5646 */
5647 reset: function () {
5648 // Reset data buffer
5649 BufferedBlockAlgorithm.reset.call(this);
5650
5651 // Perform concrete-cipher logic
5652 this._doReset();
5653 },
5654
5655 /**
5656 * Adds data to be encrypted or decrypted.
5657 *
5658 * @param {WordArray|string} dataUpdate The data to encrypt or decrypt.
5659 *
5660 * @return {WordArray} The data after processing.
5661 *
5662 * @example
5663 *
5664 * var encrypted = cipher.process('data');
5665 * var encrypted = cipher.process(wordArray);
5666 */
5667 process: function (dataUpdate) {
5668 // Append
5669 this._append(dataUpdate);
5670
5671 // Process available blocks
5672 return this._process();
5673 },
5674
5675 /**
5676 * Finalizes the encryption or decryption process.
5677 * Note that the finalize operation is effectively a destructive, read-once operation.
5678 *
5679 * @param {WordArray|string} dataUpdate The final data to encrypt or decrypt.
5680 *
5681 * @return {WordArray} The data after final processing.
5682 *
5683 * @example
5684 *
5685 * var encrypted = cipher.finalize();
5686 * var encrypted = cipher.finalize('data');
5687 * var encrypted = cipher.finalize(wordArray);
5688 */
5689 finalize: function (dataUpdate) {
5690 // Final data update
5691 if (dataUpdate) {
5692 this._append(dataUpdate);
5693 }
5694
5695 // Perform concrete-cipher logic
5696 var finalProcessedData = this._doFinalize();
5697
5698 return finalProcessedData;
5699 },
5700
5701 keySize: 128/32,
5702
5703 ivSize: 128/32,
5704
5705 _ENC_XFORM_MODE: 1,
5706
5707 _DEC_XFORM_MODE: 2,
5708
5709 /**
5710 * Creates shortcut functions to a cipher's object interface.
5711 *
5712 * @param {Cipher} cipher The cipher to create a helper for.
5713 *
5714 * @return {Object} An object with encrypt and decrypt shortcut functions.
5715 *
5716 * @static
5717 *
5718 * @example
5719 *
5720 * var AES = CryptoJS.lib.Cipher._createHelper(CryptoJS.algo.AES);
5721 */
5722 _createHelper: (function () {
5723 function selectCipherStrategy(key) {
5724 if (typeof key == 'string') {
5725 return PasswordBasedCipher;
5726 } else {
5727 return SerializableCipher;
5728 }
5729 }
5730
5731 return function (cipher) {
5732 return {
5733 encrypt: function (message, key, cfg) {
5734 return selectCipherStrategy(key).encrypt(cipher, message, key, cfg);
5735 },
5736
5737 decrypt: function (ciphertext, key, cfg) {
5738 return selectCipherStrategy(key).decrypt(cipher, ciphertext, key, cfg);
5739 }
5740 };
5741 };
5742 }())
5743 });
5744
5745 /**
5746 * Abstract base stream cipher template.
5747 *
5748 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 1 (32 bits)
5749 */
5750 var StreamCipher = C_lib.StreamCipher = Cipher.extend({
5751 _doFinalize: function () {
5752 // Process partial blocks
5753 var finalProcessedBlocks = this._process(!!'flush');
5754
5755 return finalProcessedBlocks;
5756 },
5757
5758 blockSize: 1
5759 });
5760
5761 /**
5762 * Mode namespace.
5763 */
5764 var C_mode = C.mode = {};
5765
5766 /**
5767 * Abstract base block cipher mode template.
5768 */
5769 var BlockCipherMode = C_lib.BlockCipherMode = Base.extend({
5770 /**
5771 * Creates this mode for encryption.
5772 *
5773 * @param {Cipher} cipher A block cipher instance.
5774 * @param {Array} iv The IV words.
5775 *
5776 * @static
5777 *
5778 * @example
5779 *
5780 * var mode = CryptoJS.mode.CBC.createEncryptor(cipher, iv.words);
5781 */
5782 createEncryptor: function (cipher, iv) {
5783 return this.Encryptor.create(cipher, iv);
5784 },
5785
5786 /**
5787 * Creates this mode for decryption.
5788 *
5789 * @param {Cipher} cipher A block cipher instance.
5790 * @param {Array} iv The IV words.
5791 *
5792 * @static
5793 *
5794 * @example
5795 *
5796 * var mode = CryptoJS.mode.CBC.createDecryptor(cipher, iv.words);
5797 */
5798 createDecryptor: function (cipher, iv) {
5799 return this.Decryptor.create(cipher, iv);
5800 },
5801
5802 /**
5803 * Initializes a newly created mode.
5804 *
5805 * @param {Cipher} cipher A block cipher instance.
5806 * @param {Array} iv The IV words.
5807 *
5808 * @example
5809 *
5810 * var mode = CryptoJS.mode.CBC.Encryptor.create(cipher, iv.words);
5811 */
5812 init: function (cipher, iv) {
5813 this._cipher = cipher;
5814 this._iv = iv;
5815 }
5816 });
5817
5818 /**
5819 * Cipher Block Chaining mode.
5820 */
5821 var CBC = C_mode.CBC = (function () {
5822 /**
5823 * Abstract base CBC mode.
5824 */
5825 var CBC = BlockCipherMode.extend();
5826
5827 /**
5828 * CBC encryptor.
5829 */
5830 CBC.Encryptor = CBC.extend({
5831 /**
5832 * Processes the data block at offset.
5833 *
5834 * @param {Array} words The data words to operate on.
5835 * @param {number} offset The offset where the block starts.
5836 *
5837 * @example
5838 *
5839 * mode.processBlock(data.words, offset);
5840 */
5841 processBlock: function (words, offset) {
5842 // Shortcuts
5843 var cipher = this._cipher;
5844 var blockSize = cipher.blockSize;
5845
5846 // XOR and encrypt
5847 xorBlock.call(this, words, offset, blockSize);
5848 cipher.encryptBlock(words, offset);
5849
5850 // Remember this block to use with next block
5851 this._prevBlock = words.slice(offset, offset + blockSize);
5852 }
5853 });
5854
5855 /**
5856 * CBC decryptor.
5857 */
5858 CBC.Decryptor = CBC.extend({
5859 /**
5860 * Processes the data block at offset.
5861 *
5862 * @param {Array} words The data words to operate on.
5863 * @param {number} offset The offset where the block starts.
5864 *
5865 * @example
5866 *
5867 * mode.processBlock(data.words, offset);
5868 */
5869 processBlock: function (words, offset) {
5870 // Shortcuts
5871 var cipher = this._cipher;
5872 var blockSize = cipher.blockSize;
5873
5874 // Remember this block to use with next block
5875 var thisBlock = words.slice(offset, offset + blockSize);
5876
5877 // Decrypt and XOR
5878 cipher.decryptBlock(words, offset);
5879 xorBlock.call(this, words, offset, blockSize);
5880
5881 // This block becomes the previous block
5882 this._prevBlock = thisBlock;
5883 }
5884 });
5885
5886 function xorBlock(words, offset, blockSize) {
5887 // Shortcut
5888 var iv = this._iv;
5889
5890 // Choose mixing block
5891 if (iv) {
5892 var block = iv;
5893
5894 // Remove IV for subsequent blocks
5895 this._iv = undefined;
5896 } else {
5897 var block = this._prevBlock;
5898 }
5899
5900 // XOR blocks
5901 for (var i = 0; i < blockSize; i++) {
5902 words[offset + i] ^= block[i];
5903 }
5904 }
5905
5906 return CBC;
5907 }());
5908
5909 /**
5910 * Padding namespace.
5911 */
5912 var C_pad = C.pad = {};
5913
5914 /**
5915 * PKCS #5/7 padding strategy.
5916 */
5917 var Pkcs7 = C_pad.Pkcs7 = {
5918 /**
5919 * Pads data using the algorithm defined in PKCS #5/7.
5920 *
5921 * @param {WordArray} data The data to pad.
5922 * @param {number} blockSize The multiple that the data should be padded to.
5923 *
5924 * @static
5925 *
5926 * @example
5927 *
5928 * CryptoJS.pad.Pkcs7.pad(wordArray, 4);
5929 */
5930 pad: function (data, blockSize) {
5931 // Shortcut
5932 var blockSizeBytes = blockSize * 4;
5933
5934 // Count padding bytes
5935 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
5936
5937 // Create padding word
5938 var paddingWord = (nPaddingBytes << 24) | (nPaddingBytes << 16) | (nPaddingBytes << 8) | nPaddingBytes;
5939
5940 // Create padding
5941 var paddingWords = [];
5942 for (var i = 0; i < nPaddingBytes; i += 4) {
5943 paddingWords.push(paddingWord);
5944 }
5945 var padding = WordArray.create(paddingWords, nPaddingBytes);
5946
5947 // Add padding
5948 data.concat(padding);
5949 },
5950
5951 /**
5952 * Unpads data that had been padded using the algorithm defined in PKCS #5/7.
5953 *
5954 * @param {WordArray} data The data to unpad.
5955 *
5956 * @static
5957 *
5958 * @example
5959 *
5960 * CryptoJS.pad.Pkcs7.unpad(wordArray);
5961 */
5962 unpad: function (data) {
5963 // Get number of padding bytes from last byte
5964 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
5965
5966 // Remove padding
5967 data.sigBytes -= nPaddingBytes;
5968 }
5969 };
5970
5971 /**
5972 * Abstract base block cipher template.
5973 *
5974 * @property {number} blockSize The number of 32-bit words this cipher operates on. Default: 4 (128 bits)
5975 */
5976 var BlockCipher = C_lib.BlockCipher = Cipher.extend({
5977 /**
5978 * Configuration options.
5979 *
5980 * @property {Mode} mode The block mode to use. Default: CBC
5981 * @property {Padding} padding The padding strategy to use. Default: Pkcs7
5982 */
5983 cfg: Cipher.cfg.extend({
5984 mode: CBC,
5985 padding: Pkcs7
5986 }),
5987
5988 reset: function () {
5989 // Reset cipher
5990 Cipher.reset.call(this);
5991
5992 // Shortcuts
5993 var cfg = this.cfg;
5994 var iv = cfg.iv;
5995 var mode = cfg.mode;
5996
5997 // Reset block mode
5998 if (this._xformMode == this._ENC_XFORM_MODE) {
5999 var modeCreator = mode.createEncryptor;
6000 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6001 var modeCreator = mode.createDecryptor;
6002
6003 // Keep at least one block in the buffer for unpadding
6004 this._minBufferSize = 1;
6005 }
6006 this._mode = modeCreator.call(mode, this, iv && iv.words);
6007 },
6008
6009 _doProcessBlock: function (words, offset) {
6010 this._mode.processBlock(words, offset);
6011 },
6012
6013 _doFinalize: function () {
6014 // Shortcut
6015 var padding = this.cfg.padding;
6016
6017 // Finalize
6018 if (this._xformMode == this._ENC_XFORM_MODE) {
6019 // Pad data
6020 padding.pad(this._data, this.blockSize);
6021
6022 // Process final blocks
6023 var finalProcessedBlocks = this._process(!!'flush');
6024 } else /* if (this._xformMode == this._DEC_XFORM_MODE) */ {
6025 // Process final blocks
6026 var finalProcessedBlocks = this._process(!!'flush');
6027
6028 // Unpad data
6029 padding.unpad(finalProcessedBlocks);
6030 }
6031
6032 return finalProcessedBlocks;
6033 },
6034
6035 blockSize: 128/32
6036 });
6037
6038 /**
6039 * A collection of cipher parameters.
6040 *
6041 * @property {WordArray} ciphertext The raw ciphertext.
6042 * @property {WordArray} key The key to this ciphertext.
6043 * @property {WordArray} iv The IV used in the ciphering operation.
6044 * @property {WordArray} salt The salt used with a key derivation function.
6045 * @property {Cipher} algorithm The cipher algorithm.
6046 * @property {Mode} mode The block mode used in the ciphering operation.
6047 * @property {Padding} padding The padding scheme used in the ciphering operation.
6048 * @property {number} blockSize The block size of the cipher.
6049 * @property {Format} formatter The default formatting strategy to convert this cipher params object to a string.
6050 */
6051 var CipherParams = C_lib.CipherParams = Base.extend({
6052 /**
6053 * Initializes a newly created cipher params object.
6054 *
6055 * @param {Object} cipherParams An object with any of the possible cipher parameters.
6056 *
6057 * @example
6058 *
6059 * var cipherParams = CryptoJS.lib.CipherParams.create({
6060 * ciphertext: ciphertextWordArray,
6061 * key: keyWordArray,
6062 * iv: ivWordArray,
6063 * salt: saltWordArray,
6064 * algorithm: CryptoJS.algo.AES,
6065 * mode: CryptoJS.mode.CBC,
6066 * padding: CryptoJS.pad.PKCS7,
6067 * blockSize: 4,
6068 * formatter: CryptoJS.format.OpenSSL
6069 * });
6070 */
6071 init: function (cipherParams) {
6072 this.mixIn(cipherParams);
6073 },
6074
6075 /**
6076 * Converts this cipher params object to a string.
6077 *
6078 * @param {Format} formatter (Optional) The formatting strategy to use.
6079 *
6080 * @return {string} The stringified cipher params.
6081 *
6082 * @throws Error If neither the formatter nor the default formatter is set.
6083 *
6084 * @example
6085 *
6086 * var string = cipherParams + '';
6087 * var string = cipherParams.toString();
6088 * var string = cipherParams.toString(CryptoJS.format.OpenSSL);
6089 */
6090 toString: function (formatter) {
6091 return (formatter || this.formatter).stringify(this);
6092 }
6093 });
6094
6095 /**
6096 * Format namespace.
6097 */
6098 var C_format = C.format = {};
6099
6100 /**
6101 * OpenSSL formatting strategy.
6102 */
6103 var OpenSSLFormatter = C_format.OpenSSL = {
6104 /**
6105 * Converts a cipher params object to an OpenSSL-compatible string.
6106 *
6107 * @param {CipherParams} cipherParams The cipher params object.
6108 *
6109 * @return {string} The OpenSSL-compatible string.
6110 *
6111 * @static
6112 *
6113 * @example
6114 *
6115 * var openSSLString = CryptoJS.format.OpenSSL.stringify(cipherParams);
6116 */
6117 stringify: function (cipherParams) {
6118 // Shortcuts
6119 var ciphertext = cipherParams.ciphertext;
6120 var salt = cipherParams.salt;
6121
6122 // Format
6123 if (salt) {
6124 var wordArray = WordArray.create([0x53616c74, 0x65645f5f]).concat(salt).concat(ciphertext);
6125 } else {
6126 var wordArray = ciphertext;
6127 }
6128
6129 return wordArray.toString(Base64);
6130 },
6131
6132 /**
6133 * Converts an OpenSSL-compatible string to a cipher params object.
6134 *
6135 * @param {string} openSSLStr The OpenSSL-compatible string.
6136 *
6137 * @return {CipherParams} The cipher params object.
6138 *
6139 * @static
6140 *
6141 * @example
6142 *
6143 * var cipherParams = CryptoJS.format.OpenSSL.parse(openSSLString);
6144 */
6145 parse: function (openSSLStr) {
6146 // Parse base64
6147 var ciphertext = Base64.parse(openSSLStr);
6148
6149 // Shortcut
6150 var ciphertextWords = ciphertext.words;
6151
6152 // Test for salt
6153 if (ciphertextWords[0] == 0x53616c74 && ciphertextWords[1] == 0x65645f5f) {
6154 // Extract salt
6155 var salt = WordArray.create(ciphertextWords.slice(2, 4));
6156
6157 // Remove salt from ciphertext
6158 ciphertextWords.splice(0, 4);
6159 ciphertext.sigBytes -= 16;
6160 }
6161
6162 return CipherParams.create({ ciphertext: ciphertext, salt: salt });
6163 }
6164 };
6165
6166 /**
6167 * A cipher wrapper that returns ciphertext as a serializable cipher params object.
6168 */
6169 var SerializableCipher = C_lib.SerializableCipher = Base.extend({
6170 /**
6171 * Configuration options.
6172 *
6173 * @property {Formatter} format The formatting strategy to convert cipher param objects to and from a string. Default: OpenSSL
6174 */
6175 cfg: Base.extend({
6176 format: OpenSSLFormatter
6177 }),
6178
6179 /**
6180 * Encrypts a message.
6181 *
6182 * @param {Cipher} cipher The cipher algorithm to use.
6183 * @param {WordArray|string} message The message to encrypt.
6184 * @param {WordArray} key The key.
6185 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6186 *
6187 * @return {CipherParams} A cipher params object.
6188 *
6189 * @static
6190 *
6191 * @example
6192 *
6193 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key);
6194 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv });
6195 * var ciphertextParams = CryptoJS.lib.SerializableCipher.encrypt(CryptoJS.algo.AES, message, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6196 */
6197 encrypt: function (cipher, message, key, cfg) {
6198 // Apply config defaults
6199 cfg = this.cfg.extend(cfg);
6200
6201 // Encrypt
6202 var encryptor = cipher.createEncryptor(key, cfg);
6203 var ciphertext = encryptor.finalize(message);
6204
6205 // Shortcut
6206 var cipherCfg = encryptor.cfg;
6207
6208 // Create and return serializable cipher params
6209 return CipherParams.create({
6210 ciphertext: ciphertext,
6211 key: key,
6212 iv: cipherCfg.iv,
6213 algorithm: cipher,
6214 mode: cipherCfg.mode,
6215 padding: cipherCfg.padding,
6216 blockSize: cipher.blockSize,
6217 formatter: cfg.format
6218 });
6219 },
6220
6221 /**
6222 * Decrypts serialized ciphertext.
6223 *
6224 * @param {Cipher} cipher The cipher algorithm to use.
6225 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6226 * @param {WordArray} key The key.
6227 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6228 *
6229 * @return {WordArray} The plaintext.
6230 *
6231 * @static
6232 *
6233 * @example
6234 *
6235 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6236 * var plaintext = CryptoJS.lib.SerializableCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, key, { iv: iv, format: CryptoJS.format.OpenSSL });
6237 */
6238 decrypt: function (cipher, ciphertext, key, cfg) {
6239 // Apply config defaults
6240 cfg = this.cfg.extend(cfg);
6241
6242 // Convert string to CipherParams
6243 ciphertext = this._parse(ciphertext, cfg.format);
6244
6245 // Decrypt
6246 var plaintext = cipher.createDecryptor(key, cfg).finalize(ciphertext.ciphertext);
6247
6248 return plaintext;
6249 },
6250
6251 /**
6252 * Converts serialized ciphertext to CipherParams,
6253 * else assumed CipherParams already and returns ciphertext unchanged.
6254 *
6255 * @param {CipherParams|string} ciphertext The ciphertext.
6256 * @param {Formatter} format The formatting strategy to use to parse serialized ciphertext.
6257 *
6258 * @return {CipherParams} The unserialized ciphertext.
6259 *
6260 * @static
6261 *
6262 * @example
6263 *
6264 * var ciphertextParams = CryptoJS.lib.SerializableCipher._parse(ciphertextStringOrParams, format);
6265 */
6266 _parse: function (ciphertext, format) {
6267 if (typeof ciphertext == 'string') {
6268 return format.parse(ciphertext, this);
6269 } else {
6270 return ciphertext;
6271 }
6272 }
6273 });
6274
6275 /**
6276 * Key derivation function namespace.
6277 */
6278 var C_kdf = C.kdf = {};
6279
6280 /**
6281 * OpenSSL key derivation function.
6282 */
6283 var OpenSSLKdf = C_kdf.OpenSSL = {
6284 /**
6285 * Derives a key and IV from a password.
6286 *
6287 * @param {string} password The password to derive from.
6288 * @param {number} keySize The size in words of the key to generate.
6289 * @param {number} ivSize The size in words of the IV to generate.
6290 * @param {WordArray|string} salt (Optional) A 64-bit salt to use. If omitted, a salt will be generated randomly.
6291 *
6292 * @return {CipherParams} A cipher params object with the key, IV, and salt.
6293 *
6294 * @static
6295 *
6296 * @example
6297 *
6298 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32);
6299 * var derivedParams = CryptoJS.kdf.OpenSSL.execute('Password', 256/32, 128/32, 'saltsalt');
6300 */
6301 execute: function (password, keySize, ivSize, salt) {
6302 // Generate random salt
6303 if (!salt) {
6304 salt = WordArray.random(64/8);
6305 }
6306
6307 // Derive key and IV
6308 var key = EvpKDF.create({ keySize: keySize + ivSize }).compute(password, salt);
6309
6310 // Separate key and IV
6311 var iv = WordArray.create(key.words.slice(keySize), ivSize * 4);
6312 key.sigBytes = keySize * 4;
6313
6314 // Return params
6315 return CipherParams.create({ key: key, iv: iv, salt: salt });
6316 }
6317 };
6318
6319 /**
6320 * A serializable cipher wrapper that derives the key from a password,
6321 * and returns ciphertext as a serializable cipher params object.
6322 */
6323 var PasswordBasedCipher = C_lib.PasswordBasedCipher = SerializableCipher.extend({
6324 /**
6325 * Configuration options.
6326 *
6327 * @property {KDF} kdf The key derivation function to use to generate a key and IV from a password. Default: OpenSSL
6328 */
6329 cfg: SerializableCipher.cfg.extend({
6330 kdf: OpenSSLKdf
6331 }),
6332
6333 /**
6334 * Encrypts a message using a password.
6335 *
6336 * @param {Cipher} cipher The cipher algorithm to use.
6337 * @param {WordArray|string} message The message to encrypt.
6338 * @param {string} password The password.
6339 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6340 *
6341 * @return {CipherParams} A cipher params object.
6342 *
6343 * @static
6344 *
6345 * @example
6346 *
6347 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password');
6348 * var ciphertextParams = CryptoJS.lib.PasswordBasedCipher.encrypt(CryptoJS.algo.AES, message, 'password', { format: CryptoJS.format.OpenSSL });
6349 */
6350 encrypt: function (cipher, message, password, cfg) {
6351 // Apply config defaults
6352 cfg = this.cfg.extend(cfg);
6353
6354 // Derive key and other params
6355 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize);
6356
6357 // Add IV to config
6358 cfg.iv = derivedParams.iv;
6359
6360 // Encrypt
6361 var ciphertext = SerializableCipher.encrypt.call(this, cipher, message, derivedParams.key, cfg);
6362
6363 // Mix in derived params
6364 ciphertext.mixIn(derivedParams);
6365
6366 return ciphertext;
6367 },
6368
6369 /**
6370 * Decrypts serialized ciphertext using a password.
6371 *
6372 * @param {Cipher} cipher The cipher algorithm to use.
6373 * @param {CipherParams|string} ciphertext The ciphertext to decrypt.
6374 * @param {string} password The password.
6375 * @param {Object} cfg (Optional) The configuration options to use for this operation.
6376 *
6377 * @return {WordArray} The plaintext.
6378 *
6379 * @static
6380 *
6381 * @example
6382 *
6383 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, formattedCiphertext, 'password', { format: CryptoJS.format.OpenSSL });
6384 * var plaintext = CryptoJS.lib.PasswordBasedCipher.decrypt(CryptoJS.algo.AES, ciphertextParams, 'password', { format: CryptoJS.format.OpenSSL });
6385 */
6386 decrypt: function (cipher, ciphertext, password, cfg) {
6387 // Apply config defaults
6388 cfg = this.cfg.extend(cfg);
6389
6390 // Convert string to CipherParams
6391 ciphertext = this._parse(ciphertext, cfg.format);
6392
6393 // Derive key and other params
6394 var derivedParams = cfg.kdf.execute(password, cipher.keySize, cipher.ivSize, ciphertext.salt);
6395
6396 // Add IV to config
6397 cfg.iv = derivedParams.iv;
6398
6399 // Decrypt
6400 var plaintext = SerializableCipher.decrypt.call(this, cipher, ciphertext, derivedParams.key, cfg);
6401
6402 return plaintext;
6403 }
6404 });
6405 }());
6406
6407
6408}));
6409},{"./core":31}],31:[function(_dereq_,module,exports){
6410;(function (root, factory) {
6411 if (typeof exports === "object") {
6412 // CommonJS
6413 module.exports = exports = factory();
6414 }
6415 else if (typeof define === "function" && define.amd) {
6416 // AMD
6417 define([], factory);
6418 }
6419 else {
6420 // Global (browser)
6421 root.CryptoJS = factory();
6422 }
6423}(this, function () {
6424
6425 /**
6426 * CryptoJS core components.
6427 */
6428 var CryptoJS = CryptoJS || (function (Math, undefined) {
6429 /**
6430 * CryptoJS namespace.
6431 */
6432 var C = {};
6433
6434 /**
6435 * Library namespace.
6436 */
6437 var C_lib = C.lib = {};
6438
6439 /**
6440 * Base object for prototypal inheritance.
6441 */
6442 var Base = C_lib.Base = (function () {
6443 function F() {}
6444
6445 return {
6446 /**
6447 * Creates a new object that inherits from this object.
6448 *
6449 * @param {Object} overrides Properties to copy into the new object.
6450 *
6451 * @return {Object} The new object.
6452 *
6453 * @static
6454 *
6455 * @example
6456 *
6457 * var MyType = CryptoJS.lib.Base.extend({
6458 * field: 'value',
6459 *
6460 * method: function () {
6461 * }
6462 * });
6463 */
6464 extend: function (overrides) {
6465 // Spawn
6466 F.prototype = this;
6467 var subtype = new F();
6468
6469 // Augment
6470 if (overrides) {
6471 subtype.mixIn(overrides);
6472 }
6473
6474 // Create default initializer
6475 if (!subtype.hasOwnProperty('init')) {
6476 subtype.init = function () {
6477 subtype.$super.init.apply(this, arguments);
6478 };
6479 }
6480
6481 // Initializer's prototype is the subtype object
6482 subtype.init.prototype = subtype;
6483
6484 // Reference supertype
6485 subtype.$super = this;
6486
6487 return subtype;
6488 },
6489
6490 /**
6491 * Extends this object and runs the init method.
6492 * Arguments to create() will be passed to init().
6493 *
6494 * @return {Object} The new object.
6495 *
6496 * @static
6497 *
6498 * @example
6499 *
6500 * var instance = MyType.create();
6501 */
6502 create: function () {
6503 var instance = this.extend();
6504 instance.init.apply(instance, arguments);
6505
6506 return instance;
6507 },
6508
6509 /**
6510 * Initializes a newly created object.
6511 * Override this method to add some logic when your objects are created.
6512 *
6513 * @example
6514 *
6515 * var MyType = CryptoJS.lib.Base.extend({
6516 * init: function () {
6517 * // ...
6518 * }
6519 * });
6520 */
6521 init: function () {
6522 },
6523
6524 /**
6525 * Copies properties into this object.
6526 *
6527 * @param {Object} properties The properties to mix in.
6528 *
6529 * @example
6530 *
6531 * MyType.mixIn({
6532 * field: 'value'
6533 * });
6534 */
6535 mixIn: function (properties) {
6536 for (var propertyName in properties) {
6537 if (properties.hasOwnProperty(propertyName)) {
6538 this[propertyName] = properties[propertyName];
6539 }
6540 }
6541
6542 // IE won't copy toString using the loop above
6543 if (properties.hasOwnProperty('toString')) {
6544 this.toString = properties.toString;
6545 }
6546 },
6547
6548 /**
6549 * Creates a copy of this object.
6550 *
6551 * @return {Object} The clone.
6552 *
6553 * @example
6554 *
6555 * var clone = instance.clone();
6556 */
6557 clone: function () {
6558 return this.init.prototype.extend(this);
6559 }
6560 };
6561 }());
6562
6563 /**
6564 * An array of 32-bit words.
6565 *
6566 * @property {Array} words The array of 32-bit words.
6567 * @property {number} sigBytes The number of significant bytes in this word array.
6568 */
6569 var WordArray = C_lib.WordArray = Base.extend({
6570 /**
6571 * Initializes a newly created word array.
6572 *
6573 * @param {Array} words (Optional) An array of 32-bit words.
6574 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
6575 *
6576 * @example
6577 *
6578 * var wordArray = CryptoJS.lib.WordArray.create();
6579 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607]);
6580 * var wordArray = CryptoJS.lib.WordArray.create([0x00010203, 0x04050607], 6);
6581 */
6582 init: function (words, sigBytes) {
6583 words = this.words = words || [];
6584
6585 if (sigBytes != undefined) {
6586 this.sigBytes = sigBytes;
6587 } else {
6588 this.sigBytes = words.length * 4;
6589 }
6590 },
6591
6592 /**
6593 * Converts this word array to a string.
6594 *
6595 * @param {Encoder} encoder (Optional) The encoding strategy to use. Default: CryptoJS.enc.Hex
6596 *
6597 * @return {string} The stringified word array.
6598 *
6599 * @example
6600 *
6601 * var string = wordArray + '';
6602 * var string = wordArray.toString();
6603 * var string = wordArray.toString(CryptoJS.enc.Utf8);
6604 */
6605 toString: function (encoder) {
6606 return (encoder || Hex).stringify(this);
6607 },
6608
6609 /**
6610 * Concatenates a word array to this word array.
6611 *
6612 * @param {WordArray} wordArray The word array to append.
6613 *
6614 * @return {WordArray} This word array.
6615 *
6616 * @example
6617 *
6618 * wordArray1.concat(wordArray2);
6619 */
6620 concat: function (wordArray) {
6621 // Shortcuts
6622 var thisWords = this.words;
6623 var thatWords = wordArray.words;
6624 var thisSigBytes = this.sigBytes;
6625 var thatSigBytes = wordArray.sigBytes;
6626
6627 // Clamp excess bits
6628 this.clamp();
6629
6630 // Concat
6631 if (thisSigBytes % 4) {
6632 // Copy one byte at a time
6633 for (var i = 0; i < thatSigBytes; i++) {
6634 var thatByte = (thatWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6635 thisWords[(thisSigBytes + i) >>> 2] |= thatByte << (24 - ((thisSigBytes + i) % 4) * 8);
6636 }
6637 } else if (thatWords.length > 0xffff) {
6638 // Copy one word at a time
6639 for (var i = 0; i < thatSigBytes; i += 4) {
6640 thisWords[(thisSigBytes + i) >>> 2] = thatWords[i >>> 2];
6641 }
6642 } else {
6643 // Copy all words at once
6644 thisWords.push.apply(thisWords, thatWords);
6645 }
6646 this.sigBytes += thatSigBytes;
6647
6648 // Chainable
6649 return this;
6650 },
6651
6652 /**
6653 * Removes insignificant bits.
6654 *
6655 * @example
6656 *
6657 * wordArray.clamp();
6658 */
6659 clamp: function () {
6660 // Shortcuts
6661 var words = this.words;
6662 var sigBytes = this.sigBytes;
6663
6664 // Clamp
6665 words[sigBytes >>> 2] &= 0xffffffff << (32 - (sigBytes % 4) * 8);
6666 words.length = Math.ceil(sigBytes / 4);
6667 },
6668
6669 /**
6670 * Creates a copy of this word array.
6671 *
6672 * @return {WordArray} The clone.
6673 *
6674 * @example
6675 *
6676 * var clone = wordArray.clone();
6677 */
6678 clone: function () {
6679 var clone = Base.clone.call(this);
6680 clone.words = this.words.slice(0);
6681
6682 return clone;
6683 },
6684
6685 /**
6686 * Creates a word array filled with random bytes.
6687 *
6688 * @param {number} nBytes The number of random bytes to generate.
6689 *
6690 * @return {WordArray} The random word array.
6691 *
6692 * @static
6693 *
6694 * @example
6695 *
6696 * var wordArray = CryptoJS.lib.WordArray.random(16);
6697 */
6698 random: function (nBytes) {
6699 var words = [];
6700 for (var i = 0; i < nBytes; i += 4) {
6701 words.push((Math.random() * 0x100000000) | 0);
6702 }
6703
6704 return new WordArray.init(words, nBytes);
6705 }
6706 });
6707
6708 /**
6709 * Encoder namespace.
6710 */
6711 var C_enc = C.enc = {};
6712
6713 /**
6714 * Hex encoding strategy.
6715 */
6716 var Hex = C_enc.Hex = {
6717 /**
6718 * Converts a word array to a hex string.
6719 *
6720 * @param {WordArray} wordArray The word array.
6721 *
6722 * @return {string} The hex string.
6723 *
6724 * @static
6725 *
6726 * @example
6727 *
6728 * var hexString = CryptoJS.enc.Hex.stringify(wordArray);
6729 */
6730 stringify: function (wordArray) {
6731 // Shortcuts
6732 var words = wordArray.words;
6733 var sigBytes = wordArray.sigBytes;
6734
6735 // Convert
6736 var hexChars = [];
6737 for (var i = 0; i < sigBytes; i++) {
6738 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6739 hexChars.push((bite >>> 4).toString(16));
6740 hexChars.push((bite & 0x0f).toString(16));
6741 }
6742
6743 return hexChars.join('');
6744 },
6745
6746 /**
6747 * Converts a hex string to a word array.
6748 *
6749 * @param {string} hexStr The hex string.
6750 *
6751 * @return {WordArray} The word array.
6752 *
6753 * @static
6754 *
6755 * @example
6756 *
6757 * var wordArray = CryptoJS.enc.Hex.parse(hexString);
6758 */
6759 parse: function (hexStr) {
6760 // Shortcut
6761 var hexStrLength = hexStr.length;
6762
6763 // Convert
6764 var words = [];
6765 for (var i = 0; i < hexStrLength; i += 2) {
6766 words[i >>> 3] |= parseInt(hexStr.substr(i, 2), 16) << (24 - (i % 8) * 4);
6767 }
6768
6769 return new WordArray.init(words, hexStrLength / 2);
6770 }
6771 };
6772
6773 /**
6774 * Latin1 encoding strategy.
6775 */
6776 var Latin1 = C_enc.Latin1 = {
6777 /**
6778 * Converts a word array to a Latin1 string.
6779 *
6780 * @param {WordArray} wordArray The word array.
6781 *
6782 * @return {string} The Latin1 string.
6783 *
6784 * @static
6785 *
6786 * @example
6787 *
6788 * var latin1String = CryptoJS.enc.Latin1.stringify(wordArray);
6789 */
6790 stringify: function (wordArray) {
6791 // Shortcuts
6792 var words = wordArray.words;
6793 var sigBytes = wordArray.sigBytes;
6794
6795 // Convert
6796 var latin1Chars = [];
6797 for (var i = 0; i < sigBytes; i++) {
6798 var bite = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
6799 latin1Chars.push(String.fromCharCode(bite));
6800 }
6801
6802 return latin1Chars.join('');
6803 },
6804
6805 /**
6806 * Converts a Latin1 string to a word array.
6807 *
6808 * @param {string} latin1Str The Latin1 string.
6809 *
6810 * @return {WordArray} The word array.
6811 *
6812 * @static
6813 *
6814 * @example
6815 *
6816 * var wordArray = CryptoJS.enc.Latin1.parse(latin1String);
6817 */
6818 parse: function (latin1Str) {
6819 // Shortcut
6820 var latin1StrLength = latin1Str.length;
6821
6822 // Convert
6823 var words = [];
6824 for (var i = 0; i < latin1StrLength; i++) {
6825 words[i >>> 2] |= (latin1Str.charCodeAt(i) & 0xff) << (24 - (i % 4) * 8);
6826 }
6827
6828 return new WordArray.init(words, latin1StrLength);
6829 }
6830 };
6831
6832 /**
6833 * UTF-8 encoding strategy.
6834 */
6835 var Utf8 = C_enc.Utf8 = {
6836 /**
6837 * Converts a word array to a UTF-8 string.
6838 *
6839 * @param {WordArray} wordArray The word array.
6840 *
6841 * @return {string} The UTF-8 string.
6842 *
6843 * @static
6844 *
6845 * @example
6846 *
6847 * var utf8String = CryptoJS.enc.Utf8.stringify(wordArray);
6848 */
6849 stringify: function (wordArray) {
6850 try {
6851 return decodeURIComponent(escape(Latin1.stringify(wordArray)));
6852 } catch (e) {
6853 throw new Error('Malformed UTF-8 data');
6854 }
6855 },
6856
6857 /**
6858 * Converts a UTF-8 string to a word array.
6859 *
6860 * @param {string} utf8Str The UTF-8 string.
6861 *
6862 * @return {WordArray} The word array.
6863 *
6864 * @static
6865 *
6866 * @example
6867 *
6868 * var wordArray = CryptoJS.enc.Utf8.parse(utf8String);
6869 */
6870 parse: function (utf8Str) {
6871 return Latin1.parse(unescape(encodeURIComponent(utf8Str)));
6872 }
6873 };
6874
6875 /**
6876 * Abstract buffered block algorithm template.
6877 *
6878 * The property blockSize must be implemented in a concrete subtype.
6879 *
6880 * @property {number} _minBufferSize The number of blocks that should be kept unprocessed in the buffer. Default: 0
6881 */
6882 var BufferedBlockAlgorithm = C_lib.BufferedBlockAlgorithm = Base.extend({
6883 /**
6884 * Resets this block algorithm's data buffer to its initial state.
6885 *
6886 * @example
6887 *
6888 * bufferedBlockAlgorithm.reset();
6889 */
6890 reset: function () {
6891 // Initial values
6892 this._data = new WordArray.init();
6893 this._nDataBytes = 0;
6894 },
6895
6896 /**
6897 * Adds new data to this block algorithm's buffer.
6898 *
6899 * @param {WordArray|string} data The data to append. Strings are converted to a WordArray using UTF-8.
6900 *
6901 * @example
6902 *
6903 * bufferedBlockAlgorithm._append('data');
6904 * bufferedBlockAlgorithm._append(wordArray);
6905 */
6906 _append: function (data) {
6907 // Convert string to WordArray, else assume WordArray already
6908 if (typeof data == 'string') {
6909 data = Utf8.parse(data);
6910 }
6911
6912 // Append
6913 this._data.concat(data);
6914 this._nDataBytes += data.sigBytes;
6915 },
6916
6917 /**
6918 * Processes available data blocks.
6919 *
6920 * This method invokes _doProcessBlock(offset), which must be implemented by a concrete subtype.
6921 *
6922 * @param {boolean} doFlush Whether all blocks and partial blocks should be processed.
6923 *
6924 * @return {WordArray} The processed data.
6925 *
6926 * @example
6927 *
6928 * var processedData = bufferedBlockAlgorithm._process();
6929 * var processedData = bufferedBlockAlgorithm._process(!!'flush');
6930 */
6931 _process: function (doFlush) {
6932 // Shortcuts
6933 var data = this._data;
6934 var dataWords = data.words;
6935 var dataSigBytes = data.sigBytes;
6936 var blockSize = this.blockSize;
6937 var blockSizeBytes = blockSize * 4;
6938
6939 // Count blocks ready
6940 var nBlocksReady = dataSigBytes / blockSizeBytes;
6941 if (doFlush) {
6942 // Round up to include partial blocks
6943 nBlocksReady = Math.ceil(nBlocksReady);
6944 } else {
6945 // Round down to include only full blocks,
6946 // less the number of blocks that must remain in the buffer
6947 nBlocksReady = Math.max((nBlocksReady | 0) - this._minBufferSize, 0);
6948 }
6949
6950 // Count words ready
6951 var nWordsReady = nBlocksReady * blockSize;
6952
6953 // Count bytes ready
6954 var nBytesReady = Math.min(nWordsReady * 4, dataSigBytes);
6955
6956 // Process blocks
6957 if (nWordsReady) {
6958 for (var offset = 0; offset < nWordsReady; offset += blockSize) {
6959 // Perform concrete-algorithm logic
6960 this._doProcessBlock(dataWords, offset);
6961 }
6962
6963 // Remove processed words
6964 var processedWords = dataWords.splice(0, nWordsReady);
6965 data.sigBytes -= nBytesReady;
6966 }
6967
6968 // Return processed words
6969 return new WordArray.init(processedWords, nBytesReady);
6970 },
6971
6972 /**
6973 * Creates a copy of this object.
6974 *
6975 * @return {Object} The clone.
6976 *
6977 * @example
6978 *
6979 * var clone = bufferedBlockAlgorithm.clone();
6980 */
6981 clone: function () {
6982 var clone = Base.clone.call(this);
6983 clone._data = this._data.clone();
6984
6985 return clone;
6986 },
6987
6988 _minBufferSize: 0
6989 });
6990
6991 /**
6992 * Abstract hasher template.
6993 *
6994 * @property {number} blockSize The number of 32-bit words this hasher operates on. Default: 16 (512 bits)
6995 */
6996 var Hasher = C_lib.Hasher = BufferedBlockAlgorithm.extend({
6997 /**
6998 * Configuration options.
6999 */
7000 cfg: Base.extend(),
7001
7002 /**
7003 * Initializes a newly created hasher.
7004 *
7005 * @param {Object} cfg (Optional) The configuration options to use for this hash computation.
7006 *
7007 * @example
7008 *
7009 * var hasher = CryptoJS.algo.SHA256.create();
7010 */
7011 init: function (cfg) {
7012 // Apply config defaults
7013 this.cfg = this.cfg.extend(cfg);
7014
7015 // Set initial values
7016 this.reset();
7017 },
7018
7019 /**
7020 * Resets this hasher to its initial state.
7021 *
7022 * @example
7023 *
7024 * hasher.reset();
7025 */
7026 reset: function () {
7027 // Reset data buffer
7028 BufferedBlockAlgorithm.reset.call(this);
7029
7030 // Perform concrete-hasher logic
7031 this._doReset();
7032 },
7033
7034 /**
7035 * Updates this hasher with a message.
7036 *
7037 * @param {WordArray|string} messageUpdate The message to append.
7038 *
7039 * @return {Hasher} This hasher.
7040 *
7041 * @example
7042 *
7043 * hasher.update('message');
7044 * hasher.update(wordArray);
7045 */
7046 update: function (messageUpdate) {
7047 // Append
7048 this._append(messageUpdate);
7049
7050 // Update the hash
7051 this._process();
7052
7053 // Chainable
7054 return this;
7055 },
7056
7057 /**
7058 * Finalizes the hash computation.
7059 * Note that the finalize operation is effectively a destructive, read-once operation.
7060 *
7061 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7062 *
7063 * @return {WordArray} The hash.
7064 *
7065 * @example
7066 *
7067 * var hash = hasher.finalize();
7068 * var hash = hasher.finalize('message');
7069 * var hash = hasher.finalize(wordArray);
7070 */
7071 finalize: function (messageUpdate) {
7072 // Final message update
7073 if (messageUpdate) {
7074 this._append(messageUpdate);
7075 }
7076
7077 // Perform concrete-hasher logic
7078 var hash = this._doFinalize();
7079
7080 return hash;
7081 },
7082
7083 blockSize: 512/32,
7084
7085 /**
7086 * Creates a shortcut function to a hasher's object interface.
7087 *
7088 * @param {Hasher} hasher The hasher to create a helper for.
7089 *
7090 * @return {Function} The shortcut function.
7091 *
7092 * @static
7093 *
7094 * @example
7095 *
7096 * var SHA256 = CryptoJS.lib.Hasher._createHelper(CryptoJS.algo.SHA256);
7097 */
7098 _createHelper: function (hasher) {
7099 return function (message, cfg) {
7100 return new hasher.init(cfg).finalize(message);
7101 };
7102 },
7103
7104 /**
7105 * Creates a shortcut function to the HMAC's object interface.
7106 *
7107 * @param {Hasher} hasher The hasher to use in this HMAC helper.
7108 *
7109 * @return {Function} The shortcut function.
7110 *
7111 * @static
7112 *
7113 * @example
7114 *
7115 * var HmacSHA256 = CryptoJS.lib.Hasher._createHmacHelper(CryptoJS.algo.SHA256);
7116 */
7117 _createHmacHelper: function (hasher) {
7118 return function (message, key) {
7119 return new C_algo.HMAC.init(hasher, key).finalize(message);
7120 };
7121 }
7122 });
7123
7124 /**
7125 * Algorithm namespace.
7126 */
7127 var C_algo = C.algo = {};
7128
7129 return C;
7130 }(Math));
7131
7132
7133 return CryptoJS;
7134
7135}));
7136},{}],32:[function(_dereq_,module,exports){
7137;(function (root, factory) {
7138 if (typeof exports === "object") {
7139 // CommonJS
7140 module.exports = exports = factory(_dereq_("./core"));
7141 }
7142 else if (typeof define === "function" && define.amd) {
7143 // AMD
7144 define(["./core"], factory);
7145 }
7146 else {
7147 // Global (browser)
7148 factory(root.CryptoJS);
7149 }
7150}(this, function (CryptoJS) {
7151
7152 (function () {
7153 // Shortcuts
7154 var C = CryptoJS;
7155 var C_lib = C.lib;
7156 var WordArray = C_lib.WordArray;
7157 var C_enc = C.enc;
7158
7159 /**
7160 * Base64 encoding strategy.
7161 */
7162 var Base64 = C_enc.Base64 = {
7163 /**
7164 * Converts a word array to a Base64 string.
7165 *
7166 * @param {WordArray} wordArray The word array.
7167 *
7168 * @return {string} The Base64 string.
7169 *
7170 * @static
7171 *
7172 * @example
7173 *
7174 * var base64String = CryptoJS.enc.Base64.stringify(wordArray);
7175 */
7176 stringify: function (wordArray) {
7177 // Shortcuts
7178 var words = wordArray.words;
7179 var sigBytes = wordArray.sigBytes;
7180 var map = this._map;
7181
7182 // Clamp excess bits
7183 wordArray.clamp();
7184
7185 // Convert
7186 var base64Chars = [];
7187 for (var i = 0; i < sigBytes; i += 3) {
7188 var byte1 = (words[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff;
7189 var byte2 = (words[(i + 1) >>> 2] >>> (24 - ((i + 1) % 4) * 8)) & 0xff;
7190 var byte3 = (words[(i + 2) >>> 2] >>> (24 - ((i + 2) % 4) * 8)) & 0xff;
7191
7192 var triplet = (byte1 << 16) | (byte2 << 8) | byte3;
7193
7194 for (var j = 0; (j < 4) && (i + j * 0.75 < sigBytes); j++) {
7195 base64Chars.push(map.charAt((triplet >>> (6 * (3 - j))) & 0x3f));
7196 }
7197 }
7198
7199 // Add padding
7200 var paddingChar = map.charAt(64);
7201 if (paddingChar) {
7202 while (base64Chars.length % 4) {
7203 base64Chars.push(paddingChar);
7204 }
7205 }
7206
7207 return base64Chars.join('');
7208 },
7209
7210 /**
7211 * Converts a Base64 string to a word array.
7212 *
7213 * @param {string} base64Str The Base64 string.
7214 *
7215 * @return {WordArray} The word array.
7216 *
7217 * @static
7218 *
7219 * @example
7220 *
7221 * var wordArray = CryptoJS.enc.Base64.parse(base64String);
7222 */
7223 parse: function (base64Str) {
7224 // Shortcuts
7225 var base64StrLength = base64Str.length;
7226 var map = this._map;
7227
7228 // Ignore padding
7229 var paddingChar = map.charAt(64);
7230 if (paddingChar) {
7231 var paddingIndex = base64Str.indexOf(paddingChar);
7232 if (paddingIndex != -1) {
7233 base64StrLength = paddingIndex;
7234 }
7235 }
7236
7237 // Convert
7238 var words = [];
7239 var nBytes = 0;
7240 for (var i = 0; i < base64StrLength; i++) {
7241 if (i % 4) {
7242 var bits1 = map.indexOf(base64Str.charAt(i - 1)) << ((i % 4) * 2);
7243 var bits2 = map.indexOf(base64Str.charAt(i)) >>> (6 - (i % 4) * 2);
7244 words[nBytes >>> 2] |= (bits1 | bits2) << (24 - (nBytes % 4) * 8);
7245 nBytes++;
7246 }
7247 }
7248
7249 return WordArray.create(words, nBytes);
7250 },
7251
7252 _map: 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='
7253 };
7254 }());
7255
7256
7257 return CryptoJS.enc.Base64;
7258
7259}));
7260},{"./core":31}],33:[function(_dereq_,module,exports){
7261;(function (root, factory) {
7262 if (typeof exports === "object") {
7263 // CommonJS
7264 module.exports = exports = factory(_dereq_("./core"));
7265 }
7266 else if (typeof define === "function" && define.amd) {
7267 // AMD
7268 define(["./core"], factory);
7269 }
7270 else {
7271 // Global (browser)
7272 factory(root.CryptoJS);
7273 }
7274}(this, function (CryptoJS) {
7275
7276 (function () {
7277 // Shortcuts
7278 var C = CryptoJS;
7279 var C_lib = C.lib;
7280 var WordArray = C_lib.WordArray;
7281 var C_enc = C.enc;
7282
7283 /**
7284 * UTF-16 BE encoding strategy.
7285 */
7286 var Utf16BE = C_enc.Utf16 = C_enc.Utf16BE = {
7287 /**
7288 * Converts a word array to a UTF-16 BE string.
7289 *
7290 * @param {WordArray} wordArray The word array.
7291 *
7292 * @return {string} The UTF-16 BE string.
7293 *
7294 * @static
7295 *
7296 * @example
7297 *
7298 * var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
7299 */
7300 stringify: function (wordArray) {
7301 // Shortcuts
7302 var words = wordArray.words;
7303 var sigBytes = wordArray.sigBytes;
7304
7305 // Convert
7306 var utf16Chars = [];
7307 for (var i = 0; i < sigBytes; i += 2) {
7308 var codePoint = (words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff;
7309 utf16Chars.push(String.fromCharCode(codePoint));
7310 }
7311
7312 return utf16Chars.join('');
7313 },
7314
7315 /**
7316 * Converts a UTF-16 BE string to a word array.
7317 *
7318 * @param {string} utf16Str The UTF-16 BE string.
7319 *
7320 * @return {WordArray} The word array.
7321 *
7322 * @static
7323 *
7324 * @example
7325 *
7326 * var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
7327 */
7328 parse: function (utf16Str) {
7329 // Shortcut
7330 var utf16StrLength = utf16Str.length;
7331
7332 // Convert
7333 var words = [];
7334 for (var i = 0; i < utf16StrLength; i++) {
7335 words[i >>> 1] |= utf16Str.charCodeAt(i) << (16 - (i % 2) * 16);
7336 }
7337
7338 return WordArray.create(words, utf16StrLength * 2);
7339 }
7340 };
7341
7342 /**
7343 * UTF-16 LE encoding strategy.
7344 */
7345 C_enc.Utf16LE = {
7346 /**
7347 * Converts a word array to a UTF-16 LE string.
7348 *
7349 * @param {WordArray} wordArray The word array.
7350 *
7351 * @return {string} The UTF-16 LE string.
7352 *
7353 * @static
7354 *
7355 * @example
7356 *
7357 * var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
7358 */
7359 stringify: function (wordArray) {
7360 // Shortcuts
7361 var words = wordArray.words;
7362 var sigBytes = wordArray.sigBytes;
7363
7364 // Convert
7365 var utf16Chars = [];
7366 for (var i = 0; i < sigBytes; i += 2) {
7367 var codePoint = swapEndian((words[i >>> 2] >>> (16 - (i % 4) * 8)) & 0xffff);
7368 utf16Chars.push(String.fromCharCode(codePoint));
7369 }
7370
7371 return utf16Chars.join('');
7372 },
7373
7374 /**
7375 * Converts a UTF-16 LE string to a word array.
7376 *
7377 * @param {string} utf16Str The UTF-16 LE string.
7378 *
7379 * @return {WordArray} The word array.
7380 *
7381 * @static
7382 *
7383 * @example
7384 *
7385 * var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
7386 */
7387 parse: function (utf16Str) {
7388 // Shortcut
7389 var utf16StrLength = utf16Str.length;
7390
7391 // Convert
7392 var words = [];
7393 for (var i = 0; i < utf16StrLength; i++) {
7394 words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << (16 - (i % 2) * 16));
7395 }
7396
7397 return WordArray.create(words, utf16StrLength * 2);
7398 }
7399 };
7400
7401 function swapEndian(word) {
7402 return ((word << 8) & 0xff00ff00) | ((word >>> 8) & 0x00ff00ff);
7403 }
7404 }());
7405
7406
7407 return CryptoJS.enc.Utf16;
7408
7409}));
7410},{"./core":31}],34:[function(_dereq_,module,exports){
7411;(function (root, factory, undef) {
7412 if (typeof exports === "object") {
7413 // CommonJS
7414 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
7415 }
7416 else if (typeof define === "function" && define.amd) {
7417 // AMD
7418 define(["./core", "./sha1", "./hmac"], factory);
7419 }
7420 else {
7421 // Global (browser)
7422 factory(root.CryptoJS);
7423 }
7424}(this, function (CryptoJS) {
7425
7426 (function () {
7427 // Shortcuts
7428 var C = CryptoJS;
7429 var C_lib = C.lib;
7430 var Base = C_lib.Base;
7431 var WordArray = C_lib.WordArray;
7432 var C_algo = C.algo;
7433 var MD5 = C_algo.MD5;
7434
7435 /**
7436 * This key derivation function is meant to conform with EVP_BytesToKey.
7437 * www.openssl.org/docs/crypto/EVP_BytesToKey.html
7438 */
7439 var EvpKDF = C_algo.EvpKDF = Base.extend({
7440 /**
7441 * Configuration options.
7442 *
7443 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
7444 * @property {Hasher} hasher The hash algorithm to use. Default: MD5
7445 * @property {number} iterations The number of iterations to perform. Default: 1
7446 */
7447 cfg: Base.extend({
7448 keySize: 128/32,
7449 hasher: MD5,
7450 iterations: 1
7451 }),
7452
7453 /**
7454 * Initializes a newly created key derivation function.
7455 *
7456 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
7457 *
7458 * @example
7459 *
7460 * var kdf = CryptoJS.algo.EvpKDF.create();
7461 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8 });
7462 * var kdf = CryptoJS.algo.EvpKDF.create({ keySize: 8, iterations: 1000 });
7463 */
7464 init: function (cfg) {
7465 this.cfg = this.cfg.extend(cfg);
7466 },
7467
7468 /**
7469 * Derives a key from a password.
7470 *
7471 * @param {WordArray|string} password The password.
7472 * @param {WordArray|string} salt A salt.
7473 *
7474 * @return {WordArray} The derived key.
7475 *
7476 * @example
7477 *
7478 * var key = kdf.compute(password, salt);
7479 */
7480 compute: function (password, salt) {
7481 // Shortcut
7482 var cfg = this.cfg;
7483
7484 // Init hasher
7485 var hasher = cfg.hasher.create();
7486
7487 // Initial values
7488 var derivedKey = WordArray.create();
7489
7490 // Shortcuts
7491 var derivedKeyWords = derivedKey.words;
7492 var keySize = cfg.keySize;
7493 var iterations = cfg.iterations;
7494
7495 // Generate key
7496 while (derivedKeyWords.length < keySize) {
7497 if (block) {
7498 hasher.update(block);
7499 }
7500 var block = hasher.update(password).finalize(salt);
7501 hasher.reset();
7502
7503 // Iterations
7504 for (var i = 1; i < iterations; i++) {
7505 block = hasher.finalize(block);
7506 hasher.reset();
7507 }
7508
7509 derivedKey.concat(block);
7510 }
7511 derivedKey.sigBytes = keySize * 4;
7512
7513 return derivedKey;
7514 }
7515 });
7516
7517 /**
7518 * Derives a key from a password.
7519 *
7520 * @param {WordArray|string} password The password.
7521 * @param {WordArray|string} salt A salt.
7522 * @param {Object} cfg (Optional) The configuration options to use for this computation.
7523 *
7524 * @return {WordArray} The derived key.
7525 *
7526 * @static
7527 *
7528 * @example
7529 *
7530 * var key = CryptoJS.EvpKDF(password, salt);
7531 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8 });
7532 * var key = CryptoJS.EvpKDF(password, salt, { keySize: 8, iterations: 1000 });
7533 */
7534 C.EvpKDF = function (password, salt, cfg) {
7535 return EvpKDF.create(cfg).compute(password, salt);
7536 };
7537 }());
7538
7539
7540 return CryptoJS.EvpKDF;
7541
7542}));
7543},{"./core":31,"./hmac":36,"./sha1":55}],35:[function(_dereq_,module,exports){
7544;(function (root, factory, undef) {
7545 if (typeof exports === "object") {
7546 // CommonJS
7547 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
7548 }
7549 else if (typeof define === "function" && define.amd) {
7550 // AMD
7551 define(["./core", "./cipher-core"], factory);
7552 }
7553 else {
7554 // Global (browser)
7555 factory(root.CryptoJS);
7556 }
7557}(this, function (CryptoJS) {
7558
7559 (function (undefined) {
7560 // Shortcuts
7561 var C = CryptoJS;
7562 var C_lib = C.lib;
7563 var CipherParams = C_lib.CipherParams;
7564 var C_enc = C.enc;
7565 var Hex = C_enc.Hex;
7566 var C_format = C.format;
7567
7568 var HexFormatter = C_format.Hex = {
7569 /**
7570 * Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
7571 *
7572 * @param {CipherParams} cipherParams The cipher params object.
7573 *
7574 * @return {string} The hexadecimally encoded string.
7575 *
7576 * @static
7577 *
7578 * @example
7579 *
7580 * var hexString = CryptoJS.format.Hex.stringify(cipherParams);
7581 */
7582 stringify: function (cipherParams) {
7583 return cipherParams.ciphertext.toString(Hex);
7584 },
7585
7586 /**
7587 * Converts a hexadecimally encoded ciphertext string to a cipher params object.
7588 *
7589 * @param {string} input The hexadecimally encoded string.
7590 *
7591 * @return {CipherParams} The cipher params object.
7592 *
7593 * @static
7594 *
7595 * @example
7596 *
7597 * var cipherParams = CryptoJS.format.Hex.parse(hexString);
7598 */
7599 parse: function (input) {
7600 var ciphertext = Hex.parse(input);
7601 return CipherParams.create({ ciphertext: ciphertext });
7602 }
7603 };
7604 }());
7605
7606
7607 return CryptoJS.format.Hex;
7608
7609}));
7610},{"./cipher-core":30,"./core":31}],36:[function(_dereq_,module,exports){
7611;(function (root, factory) {
7612 if (typeof exports === "object") {
7613 // CommonJS
7614 module.exports = exports = factory(_dereq_("./core"));
7615 }
7616 else if (typeof define === "function" && define.amd) {
7617 // AMD
7618 define(["./core"], factory);
7619 }
7620 else {
7621 // Global (browser)
7622 factory(root.CryptoJS);
7623 }
7624}(this, function (CryptoJS) {
7625
7626 (function () {
7627 // Shortcuts
7628 var C = CryptoJS;
7629 var C_lib = C.lib;
7630 var Base = C_lib.Base;
7631 var C_enc = C.enc;
7632 var Utf8 = C_enc.Utf8;
7633 var C_algo = C.algo;
7634
7635 /**
7636 * HMAC algorithm.
7637 */
7638 var HMAC = C_algo.HMAC = Base.extend({
7639 /**
7640 * Initializes a newly created HMAC.
7641 *
7642 * @param {Hasher} hasher The hash algorithm to use.
7643 * @param {WordArray|string} key The secret key.
7644 *
7645 * @example
7646 *
7647 * var hmacHasher = CryptoJS.algo.HMAC.create(CryptoJS.algo.SHA256, key);
7648 */
7649 init: function (hasher, key) {
7650 // Init hasher
7651 hasher = this._hasher = new hasher.init();
7652
7653 // Convert string to WordArray, else assume WordArray already
7654 if (typeof key == 'string') {
7655 key = Utf8.parse(key);
7656 }
7657
7658 // Shortcuts
7659 var hasherBlockSize = hasher.blockSize;
7660 var hasherBlockSizeBytes = hasherBlockSize * 4;
7661
7662 // Allow arbitrary length keys
7663 if (key.sigBytes > hasherBlockSizeBytes) {
7664 key = hasher.finalize(key);
7665 }
7666
7667 // Clamp excess bits
7668 key.clamp();
7669
7670 // Clone key for inner and outer pads
7671 var oKey = this._oKey = key.clone();
7672 var iKey = this._iKey = key.clone();
7673
7674 // Shortcuts
7675 var oKeyWords = oKey.words;
7676 var iKeyWords = iKey.words;
7677
7678 // XOR keys with pad constants
7679 for (var i = 0; i < hasherBlockSize; i++) {
7680 oKeyWords[i] ^= 0x5c5c5c5c;
7681 iKeyWords[i] ^= 0x36363636;
7682 }
7683 oKey.sigBytes = iKey.sigBytes = hasherBlockSizeBytes;
7684
7685 // Set initial values
7686 this.reset();
7687 },
7688
7689 /**
7690 * Resets this HMAC to its initial state.
7691 *
7692 * @example
7693 *
7694 * hmacHasher.reset();
7695 */
7696 reset: function () {
7697 // Shortcut
7698 var hasher = this._hasher;
7699
7700 // Reset
7701 hasher.reset();
7702 hasher.update(this._iKey);
7703 },
7704
7705 /**
7706 * Updates this HMAC with a message.
7707 *
7708 * @param {WordArray|string} messageUpdate The message to append.
7709 *
7710 * @return {HMAC} This HMAC instance.
7711 *
7712 * @example
7713 *
7714 * hmacHasher.update('message');
7715 * hmacHasher.update(wordArray);
7716 */
7717 update: function (messageUpdate) {
7718 this._hasher.update(messageUpdate);
7719
7720 // Chainable
7721 return this;
7722 },
7723
7724 /**
7725 * Finalizes the HMAC computation.
7726 * Note that the finalize operation is effectively a destructive, read-once operation.
7727 *
7728 * @param {WordArray|string} messageUpdate (Optional) A final message update.
7729 *
7730 * @return {WordArray} The HMAC.
7731 *
7732 * @example
7733 *
7734 * var hmac = hmacHasher.finalize();
7735 * var hmac = hmacHasher.finalize('message');
7736 * var hmac = hmacHasher.finalize(wordArray);
7737 */
7738 finalize: function (messageUpdate) {
7739 // Shortcut
7740 var hasher = this._hasher;
7741
7742 // Compute HMAC
7743 var innerHash = hasher.finalize(messageUpdate);
7744 hasher.reset();
7745 var hmac = hasher.finalize(this._oKey.clone().concat(innerHash));
7746
7747 return hmac;
7748 }
7749 });
7750 }());
7751
7752
7753}));
7754},{"./core":31}],37:[function(_dereq_,module,exports){
7755;(function (root, factory, undef) {
7756 if (typeof exports === "object") {
7757 // CommonJS
7758 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"));
7759 }
7760 else if (typeof define === "function" && define.amd) {
7761 // AMD
7762 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);
7763 }
7764 else {
7765 // Global (browser)
7766 factory(root.CryptoJS);
7767 }
7768}(this, function (CryptoJS) {
7769
7770 return CryptoJS;
7771
7772}));
7773},{"./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){
7774;(function (root, factory) {
7775 if (typeof exports === "object") {
7776 // CommonJS
7777 module.exports = exports = factory(_dereq_("./core"));
7778 }
7779 else if (typeof define === "function" && define.amd) {
7780 // AMD
7781 define(["./core"], factory);
7782 }
7783 else {
7784 // Global (browser)
7785 factory(root.CryptoJS);
7786 }
7787}(this, function (CryptoJS) {
7788
7789 (function () {
7790 // Check if typed arrays are supported
7791 if (typeof ArrayBuffer != 'function') {
7792 return;
7793 }
7794
7795 // Shortcuts
7796 var C = CryptoJS;
7797 var C_lib = C.lib;
7798 var WordArray = C_lib.WordArray;
7799
7800 // Reference original init
7801 var superInit = WordArray.init;
7802
7803 // Augment WordArray.init to handle typed arrays
7804 var subInit = WordArray.init = function (typedArray) {
7805 // Convert buffers to uint8
7806 if (typedArray instanceof ArrayBuffer) {
7807 typedArray = new Uint8Array(typedArray);
7808 }
7809
7810 // Convert other array views to uint8
7811 if (
7812 typedArray instanceof Int8Array ||
7813 typedArray instanceof Uint8ClampedArray ||
7814 typedArray instanceof Int16Array ||
7815 typedArray instanceof Uint16Array ||
7816 typedArray instanceof Int32Array ||
7817 typedArray instanceof Uint32Array ||
7818 typedArray instanceof Float32Array ||
7819 typedArray instanceof Float64Array
7820 ) {
7821 typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
7822 }
7823
7824 // Handle Uint8Array
7825 if (typedArray instanceof Uint8Array) {
7826 // Shortcut
7827 var typedArrayByteLength = typedArray.byteLength;
7828
7829 // Extract bytes
7830 var words = [];
7831 for (var i = 0; i < typedArrayByteLength; i++) {
7832 words[i >>> 2] |= typedArray[i] << (24 - (i % 4) * 8);
7833 }
7834
7835 // Initialize this word array
7836 superInit.call(this, words, typedArrayByteLength);
7837 } else {
7838 // Else call normal init
7839 superInit.apply(this, arguments);
7840 }
7841 };
7842
7843 subInit.prototype = WordArray;
7844 }());
7845
7846
7847 return CryptoJS.lib.WordArray;
7848
7849}));
7850},{"./core":31}],39:[function(_dereq_,module,exports){
7851;(function (root, factory) {
7852 if (typeof exports === "object") {
7853 // CommonJS
7854 module.exports = exports = factory(_dereq_("./core"));
7855 }
7856 else if (typeof define === "function" && define.amd) {
7857 // AMD
7858 define(["./core"], factory);
7859 }
7860 else {
7861 // Global (browser)
7862 factory(root.CryptoJS);
7863 }
7864}(this, function (CryptoJS) {
7865
7866 (function (Math) {
7867 // Shortcuts
7868 var C = CryptoJS;
7869 var C_lib = C.lib;
7870 var WordArray = C_lib.WordArray;
7871 var Hasher = C_lib.Hasher;
7872 var C_algo = C.algo;
7873
7874 // Constants table
7875 var T = [];
7876
7877 // Compute constants
7878 (function () {
7879 for (var i = 0; i < 64; i++) {
7880 T[i] = (Math.abs(Math.sin(i + 1)) * 0x100000000) | 0;
7881 }
7882 }());
7883
7884 /**
7885 * MD5 hash algorithm.
7886 */
7887 var MD5 = C_algo.MD5 = Hasher.extend({
7888 _doReset: function () {
7889 this._hash = new WordArray.init([
7890 0x67452301, 0xefcdab89,
7891 0x98badcfe, 0x10325476
7892 ]);
7893 },
7894
7895 _doProcessBlock: function (M, offset) {
7896 // Swap endian
7897 for (var i = 0; i < 16; i++) {
7898 // Shortcuts
7899 var offset_i = offset + i;
7900 var M_offset_i = M[offset_i];
7901
7902 M[offset_i] = (
7903 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
7904 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
7905 );
7906 }
7907
7908 // Shortcuts
7909 var H = this._hash.words;
7910
7911 var M_offset_0 = M[offset + 0];
7912 var M_offset_1 = M[offset + 1];
7913 var M_offset_2 = M[offset + 2];
7914 var M_offset_3 = M[offset + 3];
7915 var M_offset_4 = M[offset + 4];
7916 var M_offset_5 = M[offset + 5];
7917 var M_offset_6 = M[offset + 6];
7918 var M_offset_7 = M[offset + 7];
7919 var M_offset_8 = M[offset + 8];
7920 var M_offset_9 = M[offset + 9];
7921 var M_offset_10 = M[offset + 10];
7922 var M_offset_11 = M[offset + 11];
7923 var M_offset_12 = M[offset + 12];
7924 var M_offset_13 = M[offset + 13];
7925 var M_offset_14 = M[offset + 14];
7926 var M_offset_15 = M[offset + 15];
7927
7928 // Working varialbes
7929 var a = H[0];
7930 var b = H[1];
7931 var c = H[2];
7932 var d = H[3];
7933
7934 // Computation
7935 a = FF(a, b, c, d, M_offset_0, 7, T[0]);
7936 d = FF(d, a, b, c, M_offset_1, 12, T[1]);
7937 c = FF(c, d, a, b, M_offset_2, 17, T[2]);
7938 b = FF(b, c, d, a, M_offset_3, 22, T[3]);
7939 a = FF(a, b, c, d, M_offset_4, 7, T[4]);
7940 d = FF(d, a, b, c, M_offset_5, 12, T[5]);
7941 c = FF(c, d, a, b, M_offset_6, 17, T[6]);
7942 b = FF(b, c, d, a, M_offset_7, 22, T[7]);
7943 a = FF(a, b, c, d, M_offset_8, 7, T[8]);
7944 d = FF(d, a, b, c, M_offset_9, 12, T[9]);
7945 c = FF(c, d, a, b, M_offset_10, 17, T[10]);
7946 b = FF(b, c, d, a, M_offset_11, 22, T[11]);
7947 a = FF(a, b, c, d, M_offset_12, 7, T[12]);
7948 d = FF(d, a, b, c, M_offset_13, 12, T[13]);
7949 c = FF(c, d, a, b, M_offset_14, 17, T[14]);
7950 b = FF(b, c, d, a, M_offset_15, 22, T[15]);
7951
7952 a = GG(a, b, c, d, M_offset_1, 5, T[16]);
7953 d = GG(d, a, b, c, M_offset_6, 9, T[17]);
7954 c = GG(c, d, a, b, M_offset_11, 14, T[18]);
7955 b = GG(b, c, d, a, M_offset_0, 20, T[19]);
7956 a = GG(a, b, c, d, M_offset_5, 5, T[20]);
7957 d = GG(d, a, b, c, M_offset_10, 9, T[21]);
7958 c = GG(c, d, a, b, M_offset_15, 14, T[22]);
7959 b = GG(b, c, d, a, M_offset_4, 20, T[23]);
7960 a = GG(a, b, c, d, M_offset_9, 5, T[24]);
7961 d = GG(d, a, b, c, M_offset_14, 9, T[25]);
7962 c = GG(c, d, a, b, M_offset_3, 14, T[26]);
7963 b = GG(b, c, d, a, M_offset_8, 20, T[27]);
7964 a = GG(a, b, c, d, M_offset_13, 5, T[28]);
7965 d = GG(d, a, b, c, M_offset_2, 9, T[29]);
7966 c = GG(c, d, a, b, M_offset_7, 14, T[30]);
7967 b = GG(b, c, d, a, M_offset_12, 20, T[31]);
7968
7969 a = HH(a, b, c, d, M_offset_5, 4, T[32]);
7970 d = HH(d, a, b, c, M_offset_8, 11, T[33]);
7971 c = HH(c, d, a, b, M_offset_11, 16, T[34]);
7972 b = HH(b, c, d, a, M_offset_14, 23, T[35]);
7973 a = HH(a, b, c, d, M_offset_1, 4, T[36]);
7974 d = HH(d, a, b, c, M_offset_4, 11, T[37]);
7975 c = HH(c, d, a, b, M_offset_7, 16, T[38]);
7976 b = HH(b, c, d, a, M_offset_10, 23, T[39]);
7977 a = HH(a, b, c, d, M_offset_13, 4, T[40]);
7978 d = HH(d, a, b, c, M_offset_0, 11, T[41]);
7979 c = HH(c, d, a, b, M_offset_3, 16, T[42]);
7980 b = HH(b, c, d, a, M_offset_6, 23, T[43]);
7981 a = HH(a, b, c, d, M_offset_9, 4, T[44]);
7982 d = HH(d, a, b, c, M_offset_12, 11, T[45]);
7983 c = HH(c, d, a, b, M_offset_15, 16, T[46]);
7984 b = HH(b, c, d, a, M_offset_2, 23, T[47]);
7985
7986 a = II(a, b, c, d, M_offset_0, 6, T[48]);
7987 d = II(d, a, b, c, M_offset_7, 10, T[49]);
7988 c = II(c, d, a, b, M_offset_14, 15, T[50]);
7989 b = II(b, c, d, a, M_offset_5, 21, T[51]);
7990 a = II(a, b, c, d, M_offset_12, 6, T[52]);
7991 d = II(d, a, b, c, M_offset_3, 10, T[53]);
7992 c = II(c, d, a, b, M_offset_10, 15, T[54]);
7993 b = II(b, c, d, a, M_offset_1, 21, T[55]);
7994 a = II(a, b, c, d, M_offset_8, 6, T[56]);
7995 d = II(d, a, b, c, M_offset_15, 10, T[57]);
7996 c = II(c, d, a, b, M_offset_6, 15, T[58]);
7997 b = II(b, c, d, a, M_offset_13, 21, T[59]);
7998 a = II(a, b, c, d, M_offset_4, 6, T[60]);
7999 d = II(d, a, b, c, M_offset_11, 10, T[61]);
8000 c = II(c, d, a, b, M_offset_2, 15, T[62]);
8001 b = II(b, c, d, a, M_offset_9, 21, T[63]);
8002
8003 // Intermediate hash value
8004 H[0] = (H[0] + a) | 0;
8005 H[1] = (H[1] + b) | 0;
8006 H[2] = (H[2] + c) | 0;
8007 H[3] = (H[3] + d) | 0;
8008 },
8009
8010 _doFinalize: function () {
8011 // Shortcuts
8012 var data = this._data;
8013 var dataWords = data.words;
8014
8015 var nBitsTotal = this._nDataBytes * 8;
8016 var nBitsLeft = data.sigBytes * 8;
8017
8018 // Add padding
8019 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
8020
8021 var nBitsTotalH = Math.floor(nBitsTotal / 0x100000000);
8022 var nBitsTotalL = nBitsTotal;
8023 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = (
8024 (((nBitsTotalH << 8) | (nBitsTotalH >>> 24)) & 0x00ff00ff) |
8025 (((nBitsTotalH << 24) | (nBitsTotalH >>> 8)) & 0xff00ff00)
8026 );
8027 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
8028 (((nBitsTotalL << 8) | (nBitsTotalL >>> 24)) & 0x00ff00ff) |
8029 (((nBitsTotalL << 24) | (nBitsTotalL >>> 8)) & 0xff00ff00)
8030 );
8031
8032 data.sigBytes = (dataWords.length + 1) * 4;
8033
8034 // Hash final blocks
8035 this._process();
8036
8037 // Shortcuts
8038 var hash = this._hash;
8039 var H = hash.words;
8040
8041 // Swap endian
8042 for (var i = 0; i < 4; i++) {
8043 // Shortcut
8044 var H_i = H[i];
8045
8046 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
8047 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
8048 }
8049
8050 // Return final computed hash
8051 return hash;
8052 },
8053
8054 clone: function () {
8055 var clone = Hasher.clone.call(this);
8056 clone._hash = this._hash.clone();
8057
8058 return clone;
8059 }
8060 });
8061
8062 function FF(a, b, c, d, x, s, t) {
8063 var n = a + ((b & c) | (~b & d)) + x + t;
8064 return ((n << s) | (n >>> (32 - s))) + b;
8065 }
8066
8067 function GG(a, b, c, d, x, s, t) {
8068 var n = a + ((b & d) | (c & ~d)) + x + t;
8069 return ((n << s) | (n >>> (32 - s))) + b;
8070 }
8071
8072 function HH(a, b, c, d, x, s, t) {
8073 var n = a + (b ^ c ^ d) + x + t;
8074 return ((n << s) | (n >>> (32 - s))) + b;
8075 }
8076
8077 function II(a, b, c, d, x, s, t) {
8078 var n = a + (c ^ (b | ~d)) + x + t;
8079 return ((n << s) | (n >>> (32 - s))) + b;
8080 }
8081
8082 /**
8083 * Shortcut function to the hasher's object interface.
8084 *
8085 * @param {WordArray|string} message The message to hash.
8086 *
8087 * @return {WordArray} The hash.
8088 *
8089 * @static
8090 *
8091 * @example
8092 *
8093 * var hash = CryptoJS.MD5('message');
8094 * var hash = CryptoJS.MD5(wordArray);
8095 */
8096 C.MD5 = Hasher._createHelper(MD5);
8097
8098 /**
8099 * Shortcut function to the HMAC's object interface.
8100 *
8101 * @param {WordArray|string} message The message to hash.
8102 * @param {WordArray|string} key The secret key.
8103 *
8104 * @return {WordArray} The HMAC.
8105 *
8106 * @static
8107 *
8108 * @example
8109 *
8110 * var hmac = CryptoJS.HmacMD5(message, key);
8111 */
8112 C.HmacMD5 = Hasher._createHmacHelper(MD5);
8113 }(Math));
8114
8115
8116 return CryptoJS.MD5;
8117
8118}));
8119},{"./core":31}],40:[function(_dereq_,module,exports){
8120;(function (root, factory, undef) {
8121 if (typeof exports === "object") {
8122 // CommonJS
8123 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8124 }
8125 else if (typeof define === "function" && define.amd) {
8126 // AMD
8127 define(["./core", "./cipher-core"], factory);
8128 }
8129 else {
8130 // Global (browser)
8131 factory(root.CryptoJS);
8132 }
8133}(this, function (CryptoJS) {
8134
8135 /**
8136 * Cipher Feedback block mode.
8137 */
8138 CryptoJS.mode.CFB = (function () {
8139 var CFB = CryptoJS.lib.BlockCipherMode.extend();
8140
8141 CFB.Encryptor = CFB.extend({
8142 processBlock: function (words, offset) {
8143 // Shortcuts
8144 var cipher = this._cipher;
8145 var blockSize = cipher.blockSize;
8146
8147 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8148
8149 // Remember this block to use with next block
8150 this._prevBlock = words.slice(offset, offset + blockSize);
8151 }
8152 });
8153
8154 CFB.Decryptor = CFB.extend({
8155 processBlock: function (words, offset) {
8156 // Shortcuts
8157 var cipher = this._cipher;
8158 var blockSize = cipher.blockSize;
8159
8160 // Remember this block to use with next block
8161 var thisBlock = words.slice(offset, offset + blockSize);
8162
8163 generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
8164
8165 // This block becomes the previous block
8166 this._prevBlock = thisBlock;
8167 }
8168 });
8169
8170 function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
8171 // Shortcut
8172 var iv = this._iv;
8173
8174 // Generate keystream
8175 if (iv) {
8176 var keystream = iv.slice(0);
8177
8178 // Remove IV for subsequent blocks
8179 this._iv = undefined;
8180 } else {
8181 var keystream = this._prevBlock;
8182 }
8183 cipher.encryptBlock(keystream, 0);
8184
8185 // Encrypt
8186 for (var i = 0; i < blockSize; i++) {
8187 words[offset + i] ^= keystream[i];
8188 }
8189 }
8190
8191 return CFB;
8192 }());
8193
8194
8195 return CryptoJS.mode.CFB;
8196
8197}));
8198},{"./cipher-core":30,"./core":31}],41:[function(_dereq_,module,exports){
8199;(function (root, factory, undef) {
8200 if (typeof exports === "object") {
8201 // CommonJS
8202 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8203 }
8204 else if (typeof define === "function" && define.amd) {
8205 // AMD
8206 define(["./core", "./cipher-core"], factory);
8207 }
8208 else {
8209 // Global (browser)
8210 factory(root.CryptoJS);
8211 }
8212}(this, function (CryptoJS) {
8213
8214 /** @preserve
8215 * Counter block mode compatible with Dr Brian Gladman fileenc.c
8216 * derived from CryptoJS.mode.CTR
8217 * Jan Hruby jhruby.web@gmail.com
8218 */
8219 CryptoJS.mode.CTRGladman = (function () {
8220 var CTRGladman = CryptoJS.lib.BlockCipherMode.extend();
8221
8222 function incWord(word)
8223 {
8224 if (((word >> 24) & 0xff) === 0xff) { //overflow
8225 var b1 = (word >> 16)&0xff;
8226 var b2 = (word >> 8)&0xff;
8227 var b3 = word & 0xff;
8228
8229 if (b1 === 0xff) // overflow b1
8230 {
8231 b1 = 0;
8232 if (b2 === 0xff)
8233 {
8234 b2 = 0;
8235 if (b3 === 0xff)
8236 {
8237 b3 = 0;
8238 }
8239 else
8240 {
8241 ++b3;
8242 }
8243 }
8244 else
8245 {
8246 ++b2;
8247 }
8248 }
8249 else
8250 {
8251 ++b1;
8252 }
8253
8254 word = 0;
8255 word += (b1 << 16);
8256 word += (b2 << 8);
8257 word += b3;
8258 }
8259 else
8260 {
8261 word += (0x01 << 24);
8262 }
8263 return word;
8264 }
8265
8266 function incCounter(counter)
8267 {
8268 if ((counter[0] = incWord(counter[0])) === 0)
8269 {
8270 // encr_data in fileenc.c from Dr Brian Gladman's counts only with DWORD j < 8
8271 counter[1] = incWord(counter[1]);
8272 }
8273 return counter;
8274 }
8275
8276 var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
8277 processBlock: function (words, offset) {
8278 // Shortcuts
8279 var cipher = this._cipher
8280 var blockSize = cipher.blockSize;
8281 var iv = this._iv;
8282 var counter = this._counter;
8283
8284 // Generate keystream
8285 if (iv) {
8286 counter = this._counter = iv.slice(0);
8287
8288 // Remove IV for subsequent blocks
8289 this._iv = undefined;
8290 }
8291
8292 incCounter(counter);
8293
8294 var keystream = counter.slice(0);
8295 cipher.encryptBlock(keystream, 0);
8296
8297 // Encrypt
8298 for (var i = 0; i < blockSize; i++) {
8299 words[offset + i] ^= keystream[i];
8300 }
8301 }
8302 });
8303
8304 CTRGladman.Decryptor = Encryptor;
8305
8306 return CTRGladman;
8307 }());
8308
8309
8310
8311
8312 return CryptoJS.mode.CTRGladman;
8313
8314}));
8315},{"./cipher-core":30,"./core":31}],42:[function(_dereq_,module,exports){
8316;(function (root, factory, undef) {
8317 if (typeof exports === "object") {
8318 // CommonJS
8319 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8320 }
8321 else if (typeof define === "function" && define.amd) {
8322 // AMD
8323 define(["./core", "./cipher-core"], factory);
8324 }
8325 else {
8326 // Global (browser)
8327 factory(root.CryptoJS);
8328 }
8329}(this, function (CryptoJS) {
8330
8331 /**
8332 * Counter block mode.
8333 */
8334 CryptoJS.mode.CTR = (function () {
8335 var CTR = CryptoJS.lib.BlockCipherMode.extend();
8336
8337 var Encryptor = CTR.Encryptor = CTR.extend({
8338 processBlock: function (words, offset) {
8339 // Shortcuts
8340 var cipher = this._cipher
8341 var blockSize = cipher.blockSize;
8342 var iv = this._iv;
8343 var counter = this._counter;
8344
8345 // Generate keystream
8346 if (iv) {
8347 counter = this._counter = iv.slice(0);
8348
8349 // Remove IV for subsequent blocks
8350 this._iv = undefined;
8351 }
8352 var keystream = counter.slice(0);
8353 cipher.encryptBlock(keystream, 0);
8354
8355 // Increment counter
8356 counter[blockSize - 1] = (counter[blockSize - 1] + 1) | 0
8357
8358 // Encrypt
8359 for (var i = 0; i < blockSize; i++) {
8360 words[offset + i] ^= keystream[i];
8361 }
8362 }
8363 });
8364
8365 CTR.Decryptor = Encryptor;
8366
8367 return CTR;
8368 }());
8369
8370
8371 return CryptoJS.mode.CTR;
8372
8373}));
8374},{"./cipher-core":30,"./core":31}],43:[function(_dereq_,module,exports){
8375;(function (root, factory, undef) {
8376 if (typeof exports === "object") {
8377 // CommonJS
8378 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8379 }
8380 else if (typeof define === "function" && define.amd) {
8381 // AMD
8382 define(["./core", "./cipher-core"], factory);
8383 }
8384 else {
8385 // Global (browser)
8386 factory(root.CryptoJS);
8387 }
8388}(this, function (CryptoJS) {
8389
8390 /**
8391 * Electronic Codebook block mode.
8392 */
8393 CryptoJS.mode.ECB = (function () {
8394 var ECB = CryptoJS.lib.BlockCipherMode.extend();
8395
8396 ECB.Encryptor = ECB.extend({
8397 processBlock: function (words, offset) {
8398 this._cipher.encryptBlock(words, offset);
8399 }
8400 });
8401
8402 ECB.Decryptor = ECB.extend({
8403 processBlock: function (words, offset) {
8404 this._cipher.decryptBlock(words, offset);
8405 }
8406 });
8407
8408 return ECB;
8409 }());
8410
8411
8412 return CryptoJS.mode.ECB;
8413
8414}));
8415},{"./cipher-core":30,"./core":31}],44:[function(_dereq_,module,exports){
8416;(function (root, factory, undef) {
8417 if (typeof exports === "object") {
8418 // CommonJS
8419 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8420 }
8421 else if (typeof define === "function" && define.amd) {
8422 // AMD
8423 define(["./core", "./cipher-core"], factory);
8424 }
8425 else {
8426 // Global (browser)
8427 factory(root.CryptoJS);
8428 }
8429}(this, function (CryptoJS) {
8430
8431 /**
8432 * Output Feedback block mode.
8433 */
8434 CryptoJS.mode.OFB = (function () {
8435 var OFB = CryptoJS.lib.BlockCipherMode.extend();
8436
8437 var Encryptor = OFB.Encryptor = OFB.extend({
8438 processBlock: function (words, offset) {
8439 // Shortcuts
8440 var cipher = this._cipher
8441 var blockSize = cipher.blockSize;
8442 var iv = this._iv;
8443 var keystream = this._keystream;
8444
8445 // Generate keystream
8446 if (iv) {
8447 keystream = this._keystream = iv.slice(0);
8448
8449 // Remove IV for subsequent blocks
8450 this._iv = undefined;
8451 }
8452 cipher.encryptBlock(keystream, 0);
8453
8454 // Encrypt
8455 for (var i = 0; i < blockSize; i++) {
8456 words[offset + i] ^= keystream[i];
8457 }
8458 }
8459 });
8460
8461 OFB.Decryptor = Encryptor;
8462
8463 return OFB;
8464 }());
8465
8466
8467 return CryptoJS.mode.OFB;
8468
8469}));
8470},{"./cipher-core":30,"./core":31}],45:[function(_dereq_,module,exports){
8471;(function (root, factory, undef) {
8472 if (typeof exports === "object") {
8473 // CommonJS
8474 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8475 }
8476 else if (typeof define === "function" && define.amd) {
8477 // AMD
8478 define(["./core", "./cipher-core"], factory);
8479 }
8480 else {
8481 // Global (browser)
8482 factory(root.CryptoJS);
8483 }
8484}(this, function (CryptoJS) {
8485
8486 /**
8487 * ANSI X.923 padding strategy.
8488 */
8489 CryptoJS.pad.AnsiX923 = {
8490 pad: function (data, blockSize) {
8491 // Shortcuts
8492 var dataSigBytes = data.sigBytes;
8493 var blockSizeBytes = blockSize * 4;
8494
8495 // Count padding bytes
8496 var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
8497
8498 // Compute last byte position
8499 var lastBytePos = dataSigBytes + nPaddingBytes - 1;
8500
8501 // Pad
8502 data.clamp();
8503 data.words[lastBytePos >>> 2] |= nPaddingBytes << (24 - (lastBytePos % 4) * 8);
8504 data.sigBytes += nPaddingBytes;
8505 },
8506
8507 unpad: function (data) {
8508 // Get number of padding bytes from last byte
8509 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8510
8511 // Remove padding
8512 data.sigBytes -= nPaddingBytes;
8513 }
8514 };
8515
8516
8517 return CryptoJS.pad.Ansix923;
8518
8519}));
8520},{"./cipher-core":30,"./core":31}],46:[function(_dereq_,module,exports){
8521;(function (root, factory, undef) {
8522 if (typeof exports === "object") {
8523 // CommonJS
8524 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8525 }
8526 else if (typeof define === "function" && define.amd) {
8527 // AMD
8528 define(["./core", "./cipher-core"], factory);
8529 }
8530 else {
8531 // Global (browser)
8532 factory(root.CryptoJS);
8533 }
8534}(this, function (CryptoJS) {
8535
8536 /**
8537 * ISO 10126 padding strategy.
8538 */
8539 CryptoJS.pad.Iso10126 = {
8540 pad: function (data, blockSize) {
8541 // Shortcut
8542 var blockSizeBytes = blockSize * 4;
8543
8544 // Count padding bytes
8545 var nPaddingBytes = blockSizeBytes - data.sigBytes % blockSizeBytes;
8546
8547 // Pad
8548 data.concat(CryptoJS.lib.WordArray.random(nPaddingBytes - 1)).
8549 concat(CryptoJS.lib.WordArray.create([nPaddingBytes << 24], 1));
8550 },
8551
8552 unpad: function (data) {
8553 // Get number of padding bytes from last byte
8554 var nPaddingBytes = data.words[(data.sigBytes - 1) >>> 2] & 0xff;
8555
8556 // Remove padding
8557 data.sigBytes -= nPaddingBytes;
8558 }
8559 };
8560
8561
8562 return CryptoJS.pad.Iso10126;
8563
8564}));
8565},{"./cipher-core":30,"./core":31}],47:[function(_dereq_,module,exports){
8566;(function (root, factory, undef) {
8567 if (typeof exports === "object") {
8568 // CommonJS
8569 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8570 }
8571 else if (typeof define === "function" && define.amd) {
8572 // AMD
8573 define(["./core", "./cipher-core"], factory);
8574 }
8575 else {
8576 // Global (browser)
8577 factory(root.CryptoJS);
8578 }
8579}(this, function (CryptoJS) {
8580
8581 /**
8582 * ISO/IEC 9797-1 Padding Method 2.
8583 */
8584 CryptoJS.pad.Iso97971 = {
8585 pad: function (data, blockSize) {
8586 // Add 0x80 byte
8587 data.concat(CryptoJS.lib.WordArray.create([0x80000000], 1));
8588
8589 // Zero pad the rest
8590 CryptoJS.pad.ZeroPadding.pad(data, blockSize);
8591 },
8592
8593 unpad: function (data) {
8594 // Remove zero padding
8595 CryptoJS.pad.ZeroPadding.unpad(data);
8596
8597 // Remove one more byte -- the 0x80 byte
8598 data.sigBytes--;
8599 }
8600 };
8601
8602
8603 return CryptoJS.pad.Iso97971;
8604
8605}));
8606},{"./cipher-core":30,"./core":31}],48:[function(_dereq_,module,exports){
8607;(function (root, factory, undef) {
8608 if (typeof exports === "object") {
8609 // CommonJS
8610 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8611 }
8612 else if (typeof define === "function" && define.amd) {
8613 // AMD
8614 define(["./core", "./cipher-core"], factory);
8615 }
8616 else {
8617 // Global (browser)
8618 factory(root.CryptoJS);
8619 }
8620}(this, function (CryptoJS) {
8621
8622 /**
8623 * A noop padding strategy.
8624 */
8625 CryptoJS.pad.NoPadding = {
8626 pad: function () {
8627 },
8628
8629 unpad: function () {
8630 }
8631 };
8632
8633
8634 return CryptoJS.pad.NoPadding;
8635
8636}));
8637},{"./cipher-core":30,"./core":31}],49:[function(_dereq_,module,exports){
8638;(function (root, factory, undef) {
8639 if (typeof exports === "object") {
8640 // CommonJS
8641 module.exports = exports = factory(_dereq_("./core"), _dereq_("./cipher-core"));
8642 }
8643 else if (typeof define === "function" && define.amd) {
8644 // AMD
8645 define(["./core", "./cipher-core"], factory);
8646 }
8647 else {
8648 // Global (browser)
8649 factory(root.CryptoJS);
8650 }
8651}(this, function (CryptoJS) {
8652
8653 /**
8654 * Zero padding strategy.
8655 */
8656 CryptoJS.pad.ZeroPadding = {
8657 pad: function (data, blockSize) {
8658 // Shortcut
8659 var blockSizeBytes = blockSize * 4;
8660
8661 // Pad
8662 data.clamp();
8663 data.sigBytes += blockSizeBytes - ((data.sigBytes % blockSizeBytes) || blockSizeBytes);
8664 },
8665
8666 unpad: function (data) {
8667 // Shortcut
8668 var dataWords = data.words;
8669
8670 // Unpad
8671 var i = data.sigBytes - 1;
8672 while (!((dataWords[i >>> 2] >>> (24 - (i % 4) * 8)) & 0xff)) {
8673 i--;
8674 }
8675 data.sigBytes = i + 1;
8676 }
8677 };
8678
8679
8680 return CryptoJS.pad.ZeroPadding;
8681
8682}));
8683},{"./cipher-core":30,"./core":31}],50:[function(_dereq_,module,exports){
8684;(function (root, factory, undef) {
8685 if (typeof exports === "object") {
8686 // CommonJS
8687 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha1"), _dereq_("./hmac"));
8688 }
8689 else if (typeof define === "function" && define.amd) {
8690 // AMD
8691 define(["./core", "./sha1", "./hmac"], factory);
8692 }
8693 else {
8694 // Global (browser)
8695 factory(root.CryptoJS);
8696 }
8697}(this, function (CryptoJS) {
8698
8699 (function () {
8700 // Shortcuts
8701 var C = CryptoJS;
8702 var C_lib = C.lib;
8703 var Base = C_lib.Base;
8704 var WordArray = C_lib.WordArray;
8705 var C_algo = C.algo;
8706 var SHA1 = C_algo.SHA1;
8707 var HMAC = C_algo.HMAC;
8708
8709 /**
8710 * Password-Based Key Derivation Function 2 algorithm.
8711 */
8712 var PBKDF2 = C_algo.PBKDF2 = Base.extend({
8713 /**
8714 * Configuration options.
8715 *
8716 * @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
8717 * @property {Hasher} hasher The hasher to use. Default: SHA1
8718 * @property {number} iterations The number of iterations to perform. Default: 1
8719 */
8720 cfg: Base.extend({
8721 keySize: 128/32,
8722 hasher: SHA1,
8723 iterations: 1
8724 }),
8725
8726 /**
8727 * Initializes a newly created key derivation function.
8728 *
8729 * @param {Object} cfg (Optional) The configuration options to use for the derivation.
8730 *
8731 * @example
8732 *
8733 * var kdf = CryptoJS.algo.PBKDF2.create();
8734 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
8735 * var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
8736 */
8737 init: function (cfg) {
8738 this.cfg = this.cfg.extend(cfg);
8739 },
8740
8741 /**
8742 * Computes the Password-Based Key Derivation Function 2.
8743 *
8744 * @param {WordArray|string} password The password.
8745 * @param {WordArray|string} salt A salt.
8746 *
8747 * @return {WordArray} The derived key.
8748 *
8749 * @example
8750 *
8751 * var key = kdf.compute(password, salt);
8752 */
8753 compute: function (password, salt) {
8754 // Shortcut
8755 var cfg = this.cfg;
8756
8757 // Init HMAC
8758 var hmac = HMAC.create(cfg.hasher, password);
8759
8760 // Initial values
8761 var derivedKey = WordArray.create();
8762 var blockIndex = WordArray.create([0x00000001]);
8763
8764 // Shortcuts
8765 var derivedKeyWords = derivedKey.words;
8766 var blockIndexWords = blockIndex.words;
8767 var keySize = cfg.keySize;
8768 var iterations = cfg.iterations;
8769
8770 // Generate key
8771 while (derivedKeyWords.length < keySize) {
8772 var block = hmac.update(salt).finalize(blockIndex);
8773 hmac.reset();
8774
8775 // Shortcuts
8776 var blockWords = block.words;
8777 var blockWordsLength = blockWords.length;
8778
8779 // Iterations
8780 var intermediate = block;
8781 for (var i = 1; i < iterations; i++) {
8782 intermediate = hmac.finalize(intermediate);
8783 hmac.reset();
8784
8785 // Shortcut
8786 var intermediateWords = intermediate.words;
8787
8788 // XOR intermediate with block
8789 for (var j = 0; j < blockWordsLength; j++) {
8790 blockWords[j] ^= intermediateWords[j];
8791 }
8792 }
8793
8794 derivedKey.concat(block);
8795 blockIndexWords[0]++;
8796 }
8797 derivedKey.sigBytes = keySize * 4;
8798
8799 return derivedKey;
8800 }
8801 });
8802
8803 /**
8804 * Computes the Password-Based Key Derivation Function 2.
8805 *
8806 * @param {WordArray|string} password The password.
8807 * @param {WordArray|string} salt A salt.
8808 * @param {Object} cfg (Optional) The configuration options to use for this computation.
8809 *
8810 * @return {WordArray} The derived key.
8811 *
8812 * @static
8813 *
8814 * @example
8815 *
8816 * var key = CryptoJS.PBKDF2(password, salt);
8817 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8 });
8818 * var key = CryptoJS.PBKDF2(password, salt, { keySize: 8, iterations: 1000 });
8819 */
8820 C.PBKDF2 = function (password, salt, cfg) {
8821 return PBKDF2.create(cfg).compute(password, salt);
8822 };
8823 }());
8824
8825
8826 return CryptoJS.PBKDF2;
8827
8828}));
8829},{"./core":31,"./hmac":36,"./sha1":55}],51:[function(_dereq_,module,exports){
8830;(function (root, factory, undef) {
8831 if (typeof exports === "object") {
8832 // CommonJS
8833 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
8834 }
8835 else if (typeof define === "function" && define.amd) {
8836 // AMD
8837 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
8838 }
8839 else {
8840 // Global (browser)
8841 factory(root.CryptoJS);
8842 }
8843}(this, function (CryptoJS) {
8844
8845 (function () {
8846 // Shortcuts
8847 var C = CryptoJS;
8848 var C_lib = C.lib;
8849 var StreamCipher = C_lib.StreamCipher;
8850 var C_algo = C.algo;
8851
8852 // Reusable objects
8853 var S = [];
8854 var C_ = [];
8855 var G = [];
8856
8857 /**
8858 * Rabbit stream cipher algorithm.
8859 *
8860 * This is a legacy version that neglected to convert the key to little-endian.
8861 * This error doesn't affect the cipher's security,
8862 * but it does affect its compatibility with other implementations.
8863 */
8864 var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
8865 _doReset: function () {
8866 // Shortcuts
8867 var K = this._key.words;
8868 var iv = this.cfg.iv;
8869
8870 // Generate initial state values
8871 var X = this._X = [
8872 K[0], (K[3] << 16) | (K[2] >>> 16),
8873 K[1], (K[0] << 16) | (K[3] >>> 16),
8874 K[2], (K[1] << 16) | (K[0] >>> 16),
8875 K[3], (K[2] << 16) | (K[1] >>> 16)
8876 ];
8877
8878 // Generate initial counter values
8879 var C = this._C = [
8880 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
8881 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
8882 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
8883 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
8884 ];
8885
8886 // Carry bit
8887 this._b = 0;
8888
8889 // Iterate the system four times
8890 for (var i = 0; i < 4; i++) {
8891 nextState.call(this);
8892 }
8893
8894 // Modify the counters
8895 for (var i = 0; i < 8; i++) {
8896 C[i] ^= X[(i + 4) & 7];
8897 }
8898
8899 // IV setup
8900 if (iv) {
8901 // Shortcuts
8902 var IV = iv.words;
8903 var IV_0 = IV[0];
8904 var IV_1 = IV[1];
8905
8906 // Generate four subvectors
8907 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
8908 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
8909 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
8910 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
8911
8912 // Modify counter values
8913 C[0] ^= i0;
8914 C[1] ^= i1;
8915 C[2] ^= i2;
8916 C[3] ^= i3;
8917 C[4] ^= i0;
8918 C[5] ^= i1;
8919 C[6] ^= i2;
8920 C[7] ^= i3;
8921
8922 // Iterate the system four times
8923 for (var i = 0; i < 4; i++) {
8924 nextState.call(this);
8925 }
8926 }
8927 },
8928
8929 _doProcessBlock: function (M, offset) {
8930 // Shortcut
8931 var X = this._X;
8932
8933 // Iterate the system
8934 nextState.call(this);
8935
8936 // Generate four keystream words
8937 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
8938 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
8939 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
8940 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
8941
8942 for (var i = 0; i < 4; i++) {
8943 // Swap endian
8944 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
8945 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
8946
8947 // Encrypt
8948 M[offset + i] ^= S[i];
8949 }
8950 },
8951
8952 blockSize: 128/32,
8953
8954 ivSize: 64/32
8955 });
8956
8957 function nextState() {
8958 // Shortcuts
8959 var X = this._X;
8960 var C = this._C;
8961
8962 // Save old counter values
8963 for (var i = 0; i < 8; i++) {
8964 C_[i] = C[i];
8965 }
8966
8967 // Calculate new counter values
8968 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
8969 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
8970 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
8971 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
8972 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
8973 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
8974 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
8975 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
8976 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
8977
8978 // Calculate the g-values
8979 for (var i = 0; i < 8; i++) {
8980 var gx = X[i] + C[i];
8981
8982 // Construct high and low argument for squaring
8983 var ga = gx & 0xffff;
8984 var gb = gx >>> 16;
8985
8986 // Calculate high and low result of squaring
8987 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
8988 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
8989
8990 // High XOR low
8991 G[i] = gh ^ gl;
8992 }
8993
8994 // Calculate new state values
8995 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
8996 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
8997 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
8998 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
8999 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9000 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9001 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9002 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9003 }
9004
9005 /**
9006 * Shortcut functions to the cipher's object interface.
9007 *
9008 * @example
9009 *
9010 * var ciphertext = CryptoJS.RabbitLegacy.encrypt(message, key, cfg);
9011 * var plaintext = CryptoJS.RabbitLegacy.decrypt(ciphertext, key, cfg);
9012 */
9013 C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
9014 }());
9015
9016
9017 return CryptoJS.RabbitLegacy;
9018
9019}));
9020},{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],52:[function(_dereq_,module,exports){
9021;(function (root, factory, undef) {
9022 if (typeof exports === "object") {
9023 // CommonJS
9024 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9025 }
9026 else if (typeof define === "function" && define.amd) {
9027 // AMD
9028 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9029 }
9030 else {
9031 // Global (browser)
9032 factory(root.CryptoJS);
9033 }
9034}(this, function (CryptoJS) {
9035
9036 (function () {
9037 // Shortcuts
9038 var C = CryptoJS;
9039 var C_lib = C.lib;
9040 var StreamCipher = C_lib.StreamCipher;
9041 var C_algo = C.algo;
9042
9043 // Reusable objects
9044 var S = [];
9045 var C_ = [];
9046 var G = [];
9047
9048 /**
9049 * Rabbit stream cipher algorithm
9050 */
9051 var Rabbit = C_algo.Rabbit = StreamCipher.extend({
9052 _doReset: function () {
9053 // Shortcuts
9054 var K = this._key.words;
9055 var iv = this.cfg.iv;
9056
9057 // Swap endian
9058 for (var i = 0; i < 4; i++) {
9059 K[i] = (((K[i] << 8) | (K[i] >>> 24)) & 0x00ff00ff) |
9060 (((K[i] << 24) | (K[i] >>> 8)) & 0xff00ff00);
9061 }
9062
9063 // Generate initial state values
9064 var X = this._X = [
9065 K[0], (K[3] << 16) | (K[2] >>> 16),
9066 K[1], (K[0] << 16) | (K[3] >>> 16),
9067 K[2], (K[1] << 16) | (K[0] >>> 16),
9068 K[3], (K[2] << 16) | (K[1] >>> 16)
9069 ];
9070
9071 // Generate initial counter values
9072 var C = this._C = [
9073 (K[2] << 16) | (K[2] >>> 16), (K[0] & 0xffff0000) | (K[1] & 0x0000ffff),
9074 (K[3] << 16) | (K[3] >>> 16), (K[1] & 0xffff0000) | (K[2] & 0x0000ffff),
9075 (K[0] << 16) | (K[0] >>> 16), (K[2] & 0xffff0000) | (K[3] & 0x0000ffff),
9076 (K[1] << 16) | (K[1] >>> 16), (K[3] & 0xffff0000) | (K[0] & 0x0000ffff)
9077 ];
9078
9079 // Carry bit
9080 this._b = 0;
9081
9082 // Iterate the system four times
9083 for (var i = 0; i < 4; i++) {
9084 nextState.call(this);
9085 }
9086
9087 // Modify the counters
9088 for (var i = 0; i < 8; i++) {
9089 C[i] ^= X[(i + 4) & 7];
9090 }
9091
9092 // IV setup
9093 if (iv) {
9094 // Shortcuts
9095 var IV = iv.words;
9096 var IV_0 = IV[0];
9097 var IV_1 = IV[1];
9098
9099 // Generate four subvectors
9100 var i0 = (((IV_0 << 8) | (IV_0 >>> 24)) & 0x00ff00ff) | (((IV_0 << 24) | (IV_0 >>> 8)) & 0xff00ff00);
9101 var i2 = (((IV_1 << 8) | (IV_1 >>> 24)) & 0x00ff00ff) | (((IV_1 << 24) | (IV_1 >>> 8)) & 0xff00ff00);
9102 var i1 = (i0 >>> 16) | (i2 & 0xffff0000);
9103 var i3 = (i2 << 16) | (i0 & 0x0000ffff);
9104
9105 // Modify counter values
9106 C[0] ^= i0;
9107 C[1] ^= i1;
9108 C[2] ^= i2;
9109 C[3] ^= i3;
9110 C[4] ^= i0;
9111 C[5] ^= i1;
9112 C[6] ^= i2;
9113 C[7] ^= i3;
9114
9115 // Iterate the system four times
9116 for (var i = 0; i < 4; i++) {
9117 nextState.call(this);
9118 }
9119 }
9120 },
9121
9122 _doProcessBlock: function (M, offset) {
9123 // Shortcut
9124 var X = this._X;
9125
9126 // Iterate the system
9127 nextState.call(this);
9128
9129 // Generate four keystream words
9130 S[0] = X[0] ^ (X[5] >>> 16) ^ (X[3] << 16);
9131 S[1] = X[2] ^ (X[7] >>> 16) ^ (X[5] << 16);
9132 S[2] = X[4] ^ (X[1] >>> 16) ^ (X[7] << 16);
9133 S[3] = X[6] ^ (X[3] >>> 16) ^ (X[1] << 16);
9134
9135 for (var i = 0; i < 4; i++) {
9136 // Swap endian
9137 S[i] = (((S[i] << 8) | (S[i] >>> 24)) & 0x00ff00ff) |
9138 (((S[i] << 24) | (S[i] >>> 8)) & 0xff00ff00);
9139
9140 // Encrypt
9141 M[offset + i] ^= S[i];
9142 }
9143 },
9144
9145 blockSize: 128/32,
9146
9147 ivSize: 64/32
9148 });
9149
9150 function nextState() {
9151 // Shortcuts
9152 var X = this._X;
9153 var C = this._C;
9154
9155 // Save old counter values
9156 for (var i = 0; i < 8; i++) {
9157 C_[i] = C[i];
9158 }
9159
9160 // Calculate new counter values
9161 C[0] = (C[0] + 0x4d34d34d + this._b) | 0;
9162 C[1] = (C[1] + 0xd34d34d3 + ((C[0] >>> 0) < (C_[0] >>> 0) ? 1 : 0)) | 0;
9163 C[2] = (C[2] + 0x34d34d34 + ((C[1] >>> 0) < (C_[1] >>> 0) ? 1 : 0)) | 0;
9164 C[3] = (C[3] + 0x4d34d34d + ((C[2] >>> 0) < (C_[2] >>> 0) ? 1 : 0)) | 0;
9165 C[4] = (C[4] + 0xd34d34d3 + ((C[3] >>> 0) < (C_[3] >>> 0) ? 1 : 0)) | 0;
9166 C[5] = (C[5] + 0x34d34d34 + ((C[4] >>> 0) < (C_[4] >>> 0) ? 1 : 0)) | 0;
9167 C[6] = (C[6] + 0x4d34d34d + ((C[5] >>> 0) < (C_[5] >>> 0) ? 1 : 0)) | 0;
9168 C[7] = (C[7] + 0xd34d34d3 + ((C[6] >>> 0) < (C_[6] >>> 0) ? 1 : 0)) | 0;
9169 this._b = (C[7] >>> 0) < (C_[7] >>> 0) ? 1 : 0;
9170
9171 // Calculate the g-values
9172 for (var i = 0; i < 8; i++) {
9173 var gx = X[i] + C[i];
9174
9175 // Construct high and low argument for squaring
9176 var ga = gx & 0xffff;
9177 var gb = gx >>> 16;
9178
9179 // Calculate high and low result of squaring
9180 var gh = ((((ga * ga) >>> 17) + ga * gb) >>> 15) + gb * gb;
9181 var gl = (((gx & 0xffff0000) * gx) | 0) + (((gx & 0x0000ffff) * gx) | 0);
9182
9183 // High XOR low
9184 G[i] = gh ^ gl;
9185 }
9186
9187 // Calculate new state values
9188 X[0] = (G[0] + ((G[7] << 16) | (G[7] >>> 16)) + ((G[6] << 16) | (G[6] >>> 16))) | 0;
9189 X[1] = (G[1] + ((G[0] << 8) | (G[0] >>> 24)) + G[7]) | 0;
9190 X[2] = (G[2] + ((G[1] << 16) | (G[1] >>> 16)) + ((G[0] << 16) | (G[0] >>> 16))) | 0;
9191 X[3] = (G[3] + ((G[2] << 8) | (G[2] >>> 24)) + G[1]) | 0;
9192 X[4] = (G[4] + ((G[3] << 16) | (G[3] >>> 16)) + ((G[2] << 16) | (G[2] >>> 16))) | 0;
9193 X[5] = (G[5] + ((G[4] << 8) | (G[4] >>> 24)) + G[3]) | 0;
9194 X[6] = (G[6] + ((G[5] << 16) | (G[5] >>> 16)) + ((G[4] << 16) | (G[4] >>> 16))) | 0;
9195 X[7] = (G[7] + ((G[6] << 8) | (G[6] >>> 24)) + G[5]) | 0;
9196 }
9197
9198 /**
9199 * Shortcut functions to the cipher's object interface.
9200 *
9201 * @example
9202 *
9203 * var ciphertext = CryptoJS.Rabbit.encrypt(message, key, cfg);
9204 * var plaintext = CryptoJS.Rabbit.decrypt(ciphertext, key, cfg);
9205 */
9206 C.Rabbit = StreamCipher._createHelper(Rabbit);
9207 }());
9208
9209
9210 return CryptoJS.Rabbit;
9211
9212}));
9213},{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],53:[function(_dereq_,module,exports){
9214;(function (root, factory, undef) {
9215 if (typeof exports === "object") {
9216 // CommonJS
9217 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
9218 }
9219 else if (typeof define === "function" && define.amd) {
9220 // AMD
9221 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
9222 }
9223 else {
9224 // Global (browser)
9225 factory(root.CryptoJS);
9226 }
9227}(this, function (CryptoJS) {
9228
9229 (function () {
9230 // Shortcuts
9231 var C = CryptoJS;
9232 var C_lib = C.lib;
9233 var StreamCipher = C_lib.StreamCipher;
9234 var C_algo = C.algo;
9235
9236 /**
9237 * RC4 stream cipher algorithm.
9238 */
9239 var RC4 = C_algo.RC4 = StreamCipher.extend({
9240 _doReset: function () {
9241 // Shortcuts
9242 var key = this._key;
9243 var keyWords = key.words;
9244 var keySigBytes = key.sigBytes;
9245
9246 // Init sbox
9247 var S = this._S = [];
9248 for (var i = 0; i < 256; i++) {
9249 S[i] = i;
9250 }
9251
9252 // Key setup
9253 for (var i = 0, j = 0; i < 256; i++) {
9254 var keyByteIndex = i % keySigBytes;
9255 var keyByte = (keyWords[keyByteIndex >>> 2] >>> (24 - (keyByteIndex % 4) * 8)) & 0xff;
9256
9257 j = (j + S[i] + keyByte) % 256;
9258
9259 // Swap
9260 var t = S[i];
9261 S[i] = S[j];
9262 S[j] = t;
9263 }
9264
9265 // Counters
9266 this._i = this._j = 0;
9267 },
9268
9269 _doProcessBlock: function (M, offset) {
9270 M[offset] ^= generateKeystreamWord.call(this);
9271 },
9272
9273 keySize: 256/32,
9274
9275 ivSize: 0
9276 });
9277
9278 function generateKeystreamWord() {
9279 // Shortcuts
9280 var S = this._S;
9281 var i = this._i;
9282 var j = this._j;
9283
9284 // Generate keystream word
9285 var keystreamWord = 0;
9286 for (var n = 0; n < 4; n++) {
9287 i = (i + 1) % 256;
9288 j = (j + S[i]) % 256;
9289
9290 // Swap
9291 var t = S[i];
9292 S[i] = S[j];
9293 S[j] = t;
9294
9295 keystreamWord |= S[(S[i] + S[j]) % 256] << (24 - n * 8);
9296 }
9297
9298 // Update counters
9299 this._i = i;
9300 this._j = j;
9301
9302 return keystreamWord;
9303 }
9304
9305 /**
9306 * Shortcut functions to the cipher's object interface.
9307 *
9308 * @example
9309 *
9310 * var ciphertext = CryptoJS.RC4.encrypt(message, key, cfg);
9311 * var plaintext = CryptoJS.RC4.decrypt(ciphertext, key, cfg);
9312 */
9313 C.RC4 = StreamCipher._createHelper(RC4);
9314
9315 /**
9316 * Modified RC4 stream cipher algorithm.
9317 */
9318 var RC4Drop = C_algo.RC4Drop = RC4.extend({
9319 /**
9320 * Configuration options.
9321 *
9322 * @property {number} drop The number of keystream words to drop. Default 192
9323 */
9324 cfg: RC4.cfg.extend({
9325 drop: 192
9326 }),
9327
9328 _doReset: function () {
9329 RC4._doReset.call(this);
9330
9331 // Drop
9332 for (var i = this.cfg.drop; i > 0; i--) {
9333 generateKeystreamWord.call(this);
9334 }
9335 }
9336 });
9337
9338 /**
9339 * Shortcut functions to the cipher's object interface.
9340 *
9341 * @example
9342 *
9343 * var ciphertext = CryptoJS.RC4Drop.encrypt(message, key, cfg);
9344 * var plaintext = CryptoJS.RC4Drop.decrypt(ciphertext, key, cfg);
9345 */
9346 C.RC4Drop = StreamCipher._createHelper(RC4Drop);
9347 }());
9348
9349
9350 return CryptoJS.RC4;
9351
9352}));
9353},{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],54:[function(_dereq_,module,exports){
9354;(function (root, factory) {
9355 if (typeof exports === "object") {
9356 // CommonJS
9357 module.exports = exports = factory(_dereq_("./core"));
9358 }
9359 else if (typeof define === "function" && define.amd) {
9360 // AMD
9361 define(["./core"], factory);
9362 }
9363 else {
9364 // Global (browser)
9365 factory(root.CryptoJS);
9366 }
9367}(this, function (CryptoJS) {
9368
9369 /** @preserve
9370 (c) 2012 by Cédric Mesnil. All rights reserved.
9371
9372 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
9373
9374 - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
9375 - 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.
9376
9377 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.
9378 */
9379
9380 (function (Math) {
9381 // Shortcuts
9382 var C = CryptoJS;
9383 var C_lib = C.lib;
9384 var WordArray = C_lib.WordArray;
9385 var Hasher = C_lib.Hasher;
9386 var C_algo = C.algo;
9387
9388 // Constants table
9389 var _zl = WordArray.create([
9390 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
9391 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
9392 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
9393 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
9394 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]);
9395 var _zr = WordArray.create([
9396 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
9397 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
9398 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
9399 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
9400 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]);
9401 var _sl = WordArray.create([
9402 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
9403 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
9404 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
9405 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
9406 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]);
9407 var _sr = WordArray.create([
9408 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
9409 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
9410 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
9411 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
9412 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]);
9413
9414 var _hl = WordArray.create([ 0x00000000, 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xA953FD4E]);
9415 var _hr = WordArray.create([ 0x50A28BE6, 0x5C4DD124, 0x6D703EF3, 0x7A6D76E9, 0x00000000]);
9416
9417 /**
9418 * RIPEMD160 hash algorithm.
9419 */
9420 var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
9421 _doReset: function () {
9422 this._hash = WordArray.create([0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0]);
9423 },
9424
9425 _doProcessBlock: function (M, offset) {
9426
9427 // Swap endian
9428 for (var i = 0; i < 16; i++) {
9429 // Shortcuts
9430 var offset_i = offset + i;
9431 var M_offset_i = M[offset_i];
9432
9433 // Swap
9434 M[offset_i] = (
9435 (((M_offset_i << 8) | (M_offset_i >>> 24)) & 0x00ff00ff) |
9436 (((M_offset_i << 24) | (M_offset_i >>> 8)) & 0xff00ff00)
9437 );
9438 }
9439 // Shortcut
9440 var H = this._hash.words;
9441 var hl = _hl.words;
9442 var hr = _hr.words;
9443 var zl = _zl.words;
9444 var zr = _zr.words;
9445 var sl = _sl.words;
9446 var sr = _sr.words;
9447
9448 // Working variables
9449 var al, bl, cl, dl, el;
9450 var ar, br, cr, dr, er;
9451
9452 ar = al = H[0];
9453 br = bl = H[1];
9454 cr = cl = H[2];
9455 dr = dl = H[3];
9456 er = el = H[4];
9457 // Computation
9458 var t;
9459 for (var i = 0; i < 80; i += 1) {
9460 t = (al + M[offset+zl[i]])|0;
9461 if (i<16){
9462 t += f1(bl,cl,dl) + hl[0];
9463 } else if (i<32) {
9464 t += f2(bl,cl,dl) + hl[1];
9465 } else if (i<48) {
9466 t += f3(bl,cl,dl) + hl[2];
9467 } else if (i<64) {
9468 t += f4(bl,cl,dl) + hl[3];
9469 } else {// if (i<80) {
9470 t += f5(bl,cl,dl) + hl[4];
9471 }
9472 t = t|0;
9473 t = rotl(t,sl[i]);
9474 t = (t+el)|0;
9475 al = el;
9476 el = dl;
9477 dl = rotl(cl, 10);
9478 cl = bl;
9479 bl = t;
9480
9481 t = (ar + M[offset+zr[i]])|0;
9482 if (i<16){
9483 t += f5(br,cr,dr) + hr[0];
9484 } else if (i<32) {
9485 t += f4(br,cr,dr) + hr[1];
9486 } else if (i<48) {
9487 t += f3(br,cr,dr) + hr[2];
9488 } else if (i<64) {
9489 t += f2(br,cr,dr) + hr[3];
9490 } else {// if (i<80) {
9491 t += f1(br,cr,dr) + hr[4];
9492 }
9493 t = t|0;
9494 t = rotl(t,sr[i]) ;
9495 t = (t+er)|0;
9496 ar = er;
9497 er = dr;
9498 dr = rotl(cr, 10);
9499 cr = br;
9500 br = t;
9501 }
9502 // Intermediate hash value
9503 t = (H[1] + cl + dr)|0;
9504 H[1] = (H[2] + dl + er)|0;
9505 H[2] = (H[3] + el + ar)|0;
9506 H[3] = (H[4] + al + br)|0;
9507 H[4] = (H[0] + bl + cr)|0;
9508 H[0] = t;
9509 },
9510
9511 _doFinalize: function () {
9512 // Shortcuts
9513 var data = this._data;
9514 var dataWords = data.words;
9515
9516 var nBitsTotal = this._nDataBytes * 8;
9517 var nBitsLeft = data.sigBytes * 8;
9518
9519 // Add padding
9520 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9521 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = (
9522 (((nBitsTotal << 8) | (nBitsTotal >>> 24)) & 0x00ff00ff) |
9523 (((nBitsTotal << 24) | (nBitsTotal >>> 8)) & 0xff00ff00)
9524 );
9525 data.sigBytes = (dataWords.length + 1) * 4;
9526
9527 // Hash final blocks
9528 this._process();
9529
9530 // Shortcuts
9531 var hash = this._hash;
9532 var H = hash.words;
9533
9534 // Swap endian
9535 for (var i = 0; i < 5; i++) {
9536 // Shortcut
9537 var H_i = H[i];
9538
9539 // Swap
9540 H[i] = (((H_i << 8) | (H_i >>> 24)) & 0x00ff00ff) |
9541 (((H_i << 24) | (H_i >>> 8)) & 0xff00ff00);
9542 }
9543
9544 // Return final computed hash
9545 return hash;
9546 },
9547
9548 clone: function () {
9549 var clone = Hasher.clone.call(this);
9550 clone._hash = this._hash.clone();
9551
9552 return clone;
9553 }
9554 });
9555
9556
9557 function f1(x, y, z) {
9558 return ((x) ^ (y) ^ (z));
9559
9560 }
9561
9562 function f2(x, y, z) {
9563 return (((x)&(y)) | ((~x)&(z)));
9564 }
9565
9566 function f3(x, y, z) {
9567 return (((x) | (~(y))) ^ (z));
9568 }
9569
9570 function f4(x, y, z) {
9571 return (((x) & (z)) | ((y)&(~(z))));
9572 }
9573
9574 function f5(x, y, z) {
9575 return ((x) ^ ((y) |(~(z))));
9576
9577 }
9578
9579 function rotl(x,n) {
9580 return (x<<n) | (x>>>(32-n));
9581 }
9582
9583
9584 /**
9585 * Shortcut function to the hasher's object interface.
9586 *
9587 * @param {WordArray|string} message The message to hash.
9588 *
9589 * @return {WordArray} The hash.
9590 *
9591 * @static
9592 *
9593 * @example
9594 *
9595 * var hash = CryptoJS.RIPEMD160('message');
9596 * var hash = CryptoJS.RIPEMD160(wordArray);
9597 */
9598 C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
9599
9600 /**
9601 * Shortcut function to the HMAC's object interface.
9602 *
9603 * @param {WordArray|string} message The message to hash.
9604 * @param {WordArray|string} key The secret key.
9605 *
9606 * @return {WordArray} The HMAC.
9607 *
9608 * @static
9609 *
9610 * @example
9611 *
9612 * var hmac = CryptoJS.HmacRIPEMD160(message, key);
9613 */
9614 C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
9615 }(Math));
9616
9617
9618 return CryptoJS.RIPEMD160;
9619
9620}));
9621},{"./core":31}],55:[function(_dereq_,module,exports){
9622;(function (root, factory) {
9623 if (typeof exports === "object") {
9624 // CommonJS
9625 module.exports = exports = factory(_dereq_("./core"));
9626 }
9627 else if (typeof define === "function" && define.amd) {
9628 // AMD
9629 define(["./core"], factory);
9630 }
9631 else {
9632 // Global (browser)
9633 factory(root.CryptoJS);
9634 }
9635}(this, function (CryptoJS) {
9636
9637 (function () {
9638 // Shortcuts
9639 var C = CryptoJS;
9640 var C_lib = C.lib;
9641 var WordArray = C_lib.WordArray;
9642 var Hasher = C_lib.Hasher;
9643 var C_algo = C.algo;
9644
9645 // Reusable object
9646 var W = [];
9647
9648 /**
9649 * SHA-1 hash algorithm.
9650 */
9651 var SHA1 = C_algo.SHA1 = Hasher.extend({
9652 _doReset: function () {
9653 this._hash = new WordArray.init([
9654 0x67452301, 0xefcdab89,
9655 0x98badcfe, 0x10325476,
9656 0xc3d2e1f0
9657 ]);
9658 },
9659
9660 _doProcessBlock: function (M, offset) {
9661 // Shortcut
9662 var H = this._hash.words;
9663
9664 // Working variables
9665 var a = H[0];
9666 var b = H[1];
9667 var c = H[2];
9668 var d = H[3];
9669 var e = H[4];
9670
9671 // Computation
9672 for (var i = 0; i < 80; i++) {
9673 if (i < 16) {
9674 W[i] = M[offset + i] | 0;
9675 } else {
9676 var n = W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16];
9677 W[i] = (n << 1) | (n >>> 31);
9678 }
9679
9680 var t = ((a << 5) | (a >>> 27)) + e + W[i];
9681 if (i < 20) {
9682 t += ((b & c) | (~b & d)) + 0x5a827999;
9683 } else if (i < 40) {
9684 t += (b ^ c ^ d) + 0x6ed9eba1;
9685 } else if (i < 60) {
9686 t += ((b & c) | (b & d) | (c & d)) - 0x70e44324;
9687 } else /* if (i < 80) */ {
9688 t += (b ^ c ^ d) - 0x359d3e2a;
9689 }
9690
9691 e = d;
9692 d = c;
9693 c = (b << 30) | (b >>> 2);
9694 b = a;
9695 a = t;
9696 }
9697
9698 // Intermediate hash value
9699 H[0] = (H[0] + a) | 0;
9700 H[1] = (H[1] + b) | 0;
9701 H[2] = (H[2] + c) | 0;
9702 H[3] = (H[3] + d) | 0;
9703 H[4] = (H[4] + e) | 0;
9704 },
9705
9706 _doFinalize: function () {
9707 // Shortcuts
9708 var data = this._data;
9709 var dataWords = data.words;
9710
9711 var nBitsTotal = this._nDataBytes * 8;
9712 var nBitsLeft = data.sigBytes * 8;
9713
9714 // Add padding
9715 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9716 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
9717 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
9718 data.sigBytes = dataWords.length * 4;
9719
9720 // Hash final blocks
9721 this._process();
9722
9723 // Return final computed hash
9724 return this._hash;
9725 },
9726
9727 clone: function () {
9728 var clone = Hasher.clone.call(this);
9729 clone._hash = this._hash.clone();
9730
9731 return clone;
9732 }
9733 });
9734
9735 /**
9736 * Shortcut function to the hasher's object interface.
9737 *
9738 * @param {WordArray|string} message The message to hash.
9739 *
9740 * @return {WordArray} The hash.
9741 *
9742 * @static
9743 *
9744 * @example
9745 *
9746 * var hash = CryptoJS.SHA1('message');
9747 * var hash = CryptoJS.SHA1(wordArray);
9748 */
9749 C.SHA1 = Hasher._createHelper(SHA1);
9750
9751 /**
9752 * Shortcut function to the HMAC's object interface.
9753 *
9754 * @param {WordArray|string} message The message to hash.
9755 * @param {WordArray|string} key The secret key.
9756 *
9757 * @return {WordArray} The HMAC.
9758 *
9759 * @static
9760 *
9761 * @example
9762 *
9763 * var hmac = CryptoJS.HmacSHA1(message, key);
9764 */
9765 C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
9766 }());
9767
9768
9769 return CryptoJS.SHA1;
9770
9771}));
9772},{"./core":31}],56:[function(_dereq_,module,exports){
9773;(function (root, factory, undef) {
9774 if (typeof exports === "object") {
9775 // CommonJS
9776 module.exports = exports = factory(_dereq_("./core"), _dereq_("./sha256"));
9777 }
9778 else if (typeof define === "function" && define.amd) {
9779 // AMD
9780 define(["./core", "./sha256"], factory);
9781 }
9782 else {
9783 // Global (browser)
9784 factory(root.CryptoJS);
9785 }
9786}(this, function (CryptoJS) {
9787
9788 (function () {
9789 // Shortcuts
9790 var C = CryptoJS;
9791 var C_lib = C.lib;
9792 var WordArray = C_lib.WordArray;
9793 var C_algo = C.algo;
9794 var SHA256 = C_algo.SHA256;
9795
9796 /**
9797 * SHA-224 hash algorithm.
9798 */
9799 var SHA224 = C_algo.SHA224 = SHA256.extend({
9800 _doReset: function () {
9801 this._hash = new WordArray.init([
9802 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
9803 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4
9804 ]);
9805 },
9806
9807 _doFinalize: function () {
9808 var hash = SHA256._doFinalize.call(this);
9809
9810 hash.sigBytes -= 4;
9811
9812 return hash;
9813 }
9814 });
9815
9816 /**
9817 * Shortcut function to the hasher's object interface.
9818 *
9819 * @param {WordArray|string} message The message to hash.
9820 *
9821 * @return {WordArray} The hash.
9822 *
9823 * @static
9824 *
9825 * @example
9826 *
9827 * var hash = CryptoJS.SHA224('message');
9828 * var hash = CryptoJS.SHA224(wordArray);
9829 */
9830 C.SHA224 = SHA256._createHelper(SHA224);
9831
9832 /**
9833 * Shortcut function to the HMAC's object interface.
9834 *
9835 * @param {WordArray|string} message The message to hash.
9836 * @param {WordArray|string} key The secret key.
9837 *
9838 * @return {WordArray} The HMAC.
9839 *
9840 * @static
9841 *
9842 * @example
9843 *
9844 * var hmac = CryptoJS.HmacSHA224(message, key);
9845 */
9846 C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
9847 }());
9848
9849
9850 return CryptoJS.SHA224;
9851
9852}));
9853},{"./core":31,"./sha256":57}],57:[function(_dereq_,module,exports){
9854;(function (root, factory) {
9855 if (typeof exports === "object") {
9856 // CommonJS
9857 module.exports = exports = factory(_dereq_("./core"));
9858 }
9859 else if (typeof define === "function" && define.amd) {
9860 // AMD
9861 define(["./core"], factory);
9862 }
9863 else {
9864 // Global (browser)
9865 factory(root.CryptoJS);
9866 }
9867}(this, function (CryptoJS) {
9868
9869 (function (Math) {
9870 // Shortcuts
9871 var C = CryptoJS;
9872 var C_lib = C.lib;
9873 var WordArray = C_lib.WordArray;
9874 var Hasher = C_lib.Hasher;
9875 var C_algo = C.algo;
9876
9877 // Initialization and round constants tables
9878 var H = [];
9879 var K = [];
9880
9881 // Compute constants
9882 (function () {
9883 function isPrime(n) {
9884 var sqrtN = Math.sqrt(n);
9885 for (var factor = 2; factor <= sqrtN; factor++) {
9886 if (!(n % factor)) {
9887 return false;
9888 }
9889 }
9890
9891 return true;
9892 }
9893
9894 function getFractionalBits(n) {
9895 return ((n - (n | 0)) * 0x100000000) | 0;
9896 }
9897
9898 var n = 2;
9899 var nPrime = 0;
9900 while (nPrime < 64) {
9901 if (isPrime(n)) {
9902 if (nPrime < 8) {
9903 H[nPrime] = getFractionalBits(Math.pow(n, 1 / 2));
9904 }
9905 K[nPrime] = getFractionalBits(Math.pow(n, 1 / 3));
9906
9907 nPrime++;
9908 }
9909
9910 n++;
9911 }
9912 }());
9913
9914 // Reusable object
9915 var W = [];
9916
9917 /**
9918 * SHA-256 hash algorithm.
9919 */
9920 var SHA256 = C_algo.SHA256 = Hasher.extend({
9921 _doReset: function () {
9922 this._hash = new WordArray.init(H.slice(0));
9923 },
9924
9925 _doProcessBlock: function (M, offset) {
9926 // Shortcut
9927 var H = this._hash.words;
9928
9929 // Working variables
9930 var a = H[0];
9931 var b = H[1];
9932 var c = H[2];
9933 var d = H[3];
9934 var e = H[4];
9935 var f = H[5];
9936 var g = H[6];
9937 var h = H[7];
9938
9939 // Computation
9940 for (var i = 0; i < 64; i++) {
9941 if (i < 16) {
9942 W[i] = M[offset + i] | 0;
9943 } else {
9944 var gamma0x = W[i - 15];
9945 var gamma0 = ((gamma0x << 25) | (gamma0x >>> 7)) ^
9946 ((gamma0x << 14) | (gamma0x >>> 18)) ^
9947 (gamma0x >>> 3);
9948
9949 var gamma1x = W[i - 2];
9950 var gamma1 = ((gamma1x << 15) | (gamma1x >>> 17)) ^
9951 ((gamma1x << 13) | (gamma1x >>> 19)) ^
9952 (gamma1x >>> 10);
9953
9954 W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
9955 }
9956
9957 var ch = (e & f) ^ (~e & g);
9958 var maj = (a & b) ^ (a & c) ^ (b & c);
9959
9960 var sigma0 = ((a << 30) | (a >>> 2)) ^ ((a << 19) | (a >>> 13)) ^ ((a << 10) | (a >>> 22));
9961 var sigma1 = ((e << 26) | (e >>> 6)) ^ ((e << 21) | (e >>> 11)) ^ ((e << 7) | (e >>> 25));
9962
9963 var t1 = h + sigma1 + ch + K[i] + W[i];
9964 var t2 = sigma0 + maj;
9965
9966 h = g;
9967 g = f;
9968 f = e;
9969 e = (d + t1) | 0;
9970 d = c;
9971 c = b;
9972 b = a;
9973 a = (t1 + t2) | 0;
9974 }
9975
9976 // Intermediate hash value
9977 H[0] = (H[0] + a) | 0;
9978 H[1] = (H[1] + b) | 0;
9979 H[2] = (H[2] + c) | 0;
9980 H[3] = (H[3] + d) | 0;
9981 H[4] = (H[4] + e) | 0;
9982 H[5] = (H[5] + f) | 0;
9983 H[6] = (H[6] + g) | 0;
9984 H[7] = (H[7] + h) | 0;
9985 },
9986
9987 _doFinalize: function () {
9988 // Shortcuts
9989 var data = this._data;
9990 var dataWords = data.words;
9991
9992 var nBitsTotal = this._nDataBytes * 8;
9993 var nBitsLeft = data.sigBytes * 8;
9994
9995 // Add padding
9996 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
9997 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 14] = Math.floor(nBitsTotal / 0x100000000);
9998 dataWords[(((nBitsLeft + 64) >>> 9) << 4) + 15] = nBitsTotal;
9999 data.sigBytes = dataWords.length * 4;
10000
10001 // Hash final blocks
10002 this._process();
10003
10004 // Return final computed hash
10005 return this._hash;
10006 },
10007
10008 clone: function () {
10009 var clone = Hasher.clone.call(this);
10010 clone._hash = this._hash.clone();
10011
10012 return clone;
10013 }
10014 });
10015
10016 /**
10017 * Shortcut function to the hasher's object interface.
10018 *
10019 * @param {WordArray|string} message The message to hash.
10020 *
10021 * @return {WordArray} The hash.
10022 *
10023 * @static
10024 *
10025 * @example
10026 *
10027 * var hash = CryptoJS.SHA256('message');
10028 * var hash = CryptoJS.SHA256(wordArray);
10029 */
10030 C.SHA256 = Hasher._createHelper(SHA256);
10031
10032 /**
10033 * Shortcut function to the HMAC's object interface.
10034 *
10035 * @param {WordArray|string} message The message to hash.
10036 * @param {WordArray|string} key The secret key.
10037 *
10038 * @return {WordArray} The HMAC.
10039 *
10040 * @static
10041 *
10042 * @example
10043 *
10044 * var hmac = CryptoJS.HmacSHA256(message, key);
10045 */
10046 C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
10047 }(Math));
10048
10049
10050 return CryptoJS.SHA256;
10051
10052}));
10053},{"./core":31}],58:[function(_dereq_,module,exports){
10054;(function (root, factory, undef) {
10055 if (typeof exports === "object") {
10056 // CommonJS
10057 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10058 }
10059 else if (typeof define === "function" && define.amd) {
10060 // AMD
10061 define(["./core", "./x64-core"], factory);
10062 }
10063 else {
10064 // Global (browser)
10065 factory(root.CryptoJS);
10066 }
10067}(this, function (CryptoJS) {
10068
10069 (function (Math) {
10070 // Shortcuts
10071 var C = CryptoJS;
10072 var C_lib = C.lib;
10073 var WordArray = C_lib.WordArray;
10074 var Hasher = C_lib.Hasher;
10075 var C_x64 = C.x64;
10076 var X64Word = C_x64.Word;
10077 var C_algo = C.algo;
10078
10079 // Constants tables
10080 var RHO_OFFSETS = [];
10081 var PI_INDEXES = [];
10082 var ROUND_CONSTANTS = [];
10083
10084 // Compute Constants
10085 (function () {
10086 // Compute rho offset constants
10087 var x = 1, y = 0;
10088 for (var t = 0; t < 24; t++) {
10089 RHO_OFFSETS[x + 5 * y] = ((t + 1) * (t + 2) / 2) % 64;
10090
10091 var newX = y % 5;
10092 var newY = (2 * x + 3 * y) % 5;
10093 x = newX;
10094 y = newY;
10095 }
10096
10097 // Compute pi index constants
10098 for (var x = 0; x < 5; x++) {
10099 for (var y = 0; y < 5; y++) {
10100 PI_INDEXES[x + 5 * y] = y + ((2 * x + 3 * y) % 5) * 5;
10101 }
10102 }
10103
10104 // Compute round constants
10105 var LFSR = 0x01;
10106 for (var i = 0; i < 24; i++) {
10107 var roundConstantMsw = 0;
10108 var roundConstantLsw = 0;
10109
10110 for (var j = 0; j < 7; j++) {
10111 if (LFSR & 0x01) {
10112 var bitPosition = (1 << j) - 1;
10113 if (bitPosition < 32) {
10114 roundConstantLsw ^= 1 << bitPosition;
10115 } else /* if (bitPosition >= 32) */ {
10116 roundConstantMsw ^= 1 << (bitPosition - 32);
10117 }
10118 }
10119
10120 // Compute next LFSR
10121 if (LFSR & 0x80) {
10122 // Primitive polynomial over GF(2): x^8 + x^6 + x^5 + x^4 + 1
10123 LFSR = (LFSR << 1) ^ 0x71;
10124 } else {
10125 LFSR <<= 1;
10126 }
10127 }
10128
10129 ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
10130 }
10131 }());
10132
10133 // Reusable objects for temporary values
10134 var T = [];
10135 (function () {
10136 for (var i = 0; i < 25; i++) {
10137 T[i] = X64Word.create();
10138 }
10139 }());
10140
10141 /**
10142 * SHA-3 hash algorithm.
10143 */
10144 var SHA3 = C_algo.SHA3 = Hasher.extend({
10145 /**
10146 * Configuration options.
10147 *
10148 * @property {number} outputLength
10149 * The desired number of bits in the output hash.
10150 * Only values permitted are: 224, 256, 384, 512.
10151 * Default: 512
10152 */
10153 cfg: Hasher.cfg.extend({
10154 outputLength: 512
10155 }),
10156
10157 _doReset: function () {
10158 var state = this._state = []
10159 for (var i = 0; i < 25; i++) {
10160 state[i] = new X64Word.init();
10161 }
10162
10163 this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
10164 },
10165
10166 _doProcessBlock: function (M, offset) {
10167 // Shortcuts
10168 var state = this._state;
10169 var nBlockSizeLanes = this.blockSize / 2;
10170
10171 // Absorb
10172 for (var i = 0; i < nBlockSizeLanes; i++) {
10173 // Shortcuts
10174 var M2i = M[offset + 2 * i];
10175 var M2i1 = M[offset + 2 * i + 1];
10176
10177 // Swap endian
10178 M2i = (
10179 (((M2i << 8) | (M2i >>> 24)) & 0x00ff00ff) |
10180 (((M2i << 24) | (M2i >>> 8)) & 0xff00ff00)
10181 );
10182 M2i1 = (
10183 (((M2i1 << 8) | (M2i1 >>> 24)) & 0x00ff00ff) |
10184 (((M2i1 << 24) | (M2i1 >>> 8)) & 0xff00ff00)
10185 );
10186
10187 // Absorb message into state
10188 var lane = state[i];
10189 lane.high ^= M2i1;
10190 lane.low ^= M2i;
10191 }
10192
10193 // Rounds
10194 for (var round = 0; round < 24; round++) {
10195 // Theta
10196 for (var x = 0; x < 5; x++) {
10197 // Mix column lanes
10198 var tMsw = 0, tLsw = 0;
10199 for (var y = 0; y < 5; y++) {
10200 var lane = state[x + 5 * y];
10201 tMsw ^= lane.high;
10202 tLsw ^= lane.low;
10203 }
10204
10205 // Temporary values
10206 var Tx = T[x];
10207 Tx.high = tMsw;
10208 Tx.low = tLsw;
10209 }
10210 for (var x = 0; x < 5; x++) {
10211 // Shortcuts
10212 var Tx4 = T[(x + 4) % 5];
10213 var Tx1 = T[(x + 1) % 5];
10214 var Tx1Msw = Tx1.high;
10215 var Tx1Lsw = Tx1.low;
10216
10217 // Mix surrounding columns
10218 var tMsw = Tx4.high ^ ((Tx1Msw << 1) | (Tx1Lsw >>> 31));
10219 var tLsw = Tx4.low ^ ((Tx1Lsw << 1) | (Tx1Msw >>> 31));
10220 for (var y = 0; y < 5; y++) {
10221 var lane = state[x + 5 * y];
10222 lane.high ^= tMsw;
10223 lane.low ^= tLsw;
10224 }
10225 }
10226
10227 // Rho Pi
10228 for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
10229 // Shortcuts
10230 var lane = state[laneIndex];
10231 var laneMsw = lane.high;
10232 var laneLsw = lane.low;
10233 var rhoOffset = RHO_OFFSETS[laneIndex];
10234
10235 // Rotate lanes
10236 if (rhoOffset < 32) {
10237 var tMsw = (laneMsw << rhoOffset) | (laneLsw >>> (32 - rhoOffset));
10238 var tLsw = (laneLsw << rhoOffset) | (laneMsw >>> (32 - rhoOffset));
10239 } else /* if (rhoOffset >= 32) */ {
10240 var tMsw = (laneLsw << (rhoOffset - 32)) | (laneMsw >>> (64 - rhoOffset));
10241 var tLsw = (laneMsw << (rhoOffset - 32)) | (laneLsw >>> (64 - rhoOffset));
10242 }
10243
10244 // Transpose lanes
10245 var TPiLane = T[PI_INDEXES[laneIndex]];
10246 TPiLane.high = tMsw;
10247 TPiLane.low = tLsw;
10248 }
10249
10250 // Rho pi at x = y = 0
10251 var T0 = T[0];
10252 var state0 = state[0];
10253 T0.high = state0.high;
10254 T0.low = state0.low;
10255
10256 // Chi
10257 for (var x = 0; x < 5; x++) {
10258 for (var y = 0; y < 5; y++) {
10259 // Shortcuts
10260 var laneIndex = x + 5 * y;
10261 var lane = state[laneIndex];
10262 var TLane = T[laneIndex];
10263 var Tx1Lane = T[((x + 1) % 5) + 5 * y];
10264 var Tx2Lane = T[((x + 2) % 5) + 5 * y];
10265
10266 // Mix rows
10267 lane.high = TLane.high ^ (~Tx1Lane.high & Tx2Lane.high);
10268 lane.low = TLane.low ^ (~Tx1Lane.low & Tx2Lane.low);
10269 }
10270 }
10271
10272 // Iota
10273 var lane = state[0];
10274 var roundConstant = ROUND_CONSTANTS[round];
10275 lane.high ^= roundConstant.high;
10276 lane.low ^= roundConstant.low;;
10277 }
10278 },
10279
10280 _doFinalize: function () {
10281 // Shortcuts
10282 var data = this._data;
10283 var dataWords = data.words;
10284 var nBitsTotal = this._nDataBytes * 8;
10285 var nBitsLeft = data.sigBytes * 8;
10286 var blockSizeBits = this.blockSize * 32;
10287
10288 // Add padding
10289 dataWords[nBitsLeft >>> 5] |= 0x1 << (24 - nBitsLeft % 32);
10290 dataWords[((Math.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits) >>> 5) - 1] |= 0x80;
10291 data.sigBytes = dataWords.length * 4;
10292
10293 // Hash final blocks
10294 this._process();
10295
10296 // Shortcuts
10297 var state = this._state;
10298 var outputLengthBytes = this.cfg.outputLength / 8;
10299 var outputLengthLanes = outputLengthBytes / 8;
10300
10301 // Squeeze
10302 var hashWords = [];
10303 for (var i = 0; i < outputLengthLanes; i++) {
10304 // Shortcuts
10305 var lane = state[i];
10306 var laneMsw = lane.high;
10307 var laneLsw = lane.low;
10308
10309 // Swap endian
10310 laneMsw = (
10311 (((laneMsw << 8) | (laneMsw >>> 24)) & 0x00ff00ff) |
10312 (((laneMsw << 24) | (laneMsw >>> 8)) & 0xff00ff00)
10313 );
10314 laneLsw = (
10315 (((laneLsw << 8) | (laneLsw >>> 24)) & 0x00ff00ff) |
10316 (((laneLsw << 24) | (laneLsw >>> 8)) & 0xff00ff00)
10317 );
10318
10319 // Squeeze state to retrieve hash
10320 hashWords.push(laneLsw);
10321 hashWords.push(laneMsw);
10322 }
10323
10324 // Return final computed hash
10325 return new WordArray.init(hashWords, outputLengthBytes);
10326 },
10327
10328 clone: function () {
10329 var clone = Hasher.clone.call(this);
10330
10331 var state = clone._state = this._state.slice(0);
10332 for (var i = 0; i < 25; i++) {
10333 state[i] = state[i].clone();
10334 }
10335
10336 return clone;
10337 }
10338 });
10339
10340 /**
10341 * Shortcut function to the hasher's object interface.
10342 *
10343 * @param {WordArray|string} message The message to hash.
10344 *
10345 * @return {WordArray} The hash.
10346 *
10347 * @static
10348 *
10349 * @example
10350 *
10351 * var hash = CryptoJS.SHA3('message');
10352 * var hash = CryptoJS.SHA3(wordArray);
10353 */
10354 C.SHA3 = Hasher._createHelper(SHA3);
10355
10356 /**
10357 * Shortcut function to the HMAC's object interface.
10358 *
10359 * @param {WordArray|string} message The message to hash.
10360 * @param {WordArray|string} key The secret key.
10361 *
10362 * @return {WordArray} The HMAC.
10363 *
10364 * @static
10365 *
10366 * @example
10367 *
10368 * var hmac = CryptoJS.HmacSHA3(message, key);
10369 */
10370 C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
10371 }(Math));
10372
10373
10374 return CryptoJS.SHA3;
10375
10376}));
10377},{"./core":31,"./x64-core":62}],59:[function(_dereq_,module,exports){
10378;(function (root, factory, undef) {
10379 if (typeof exports === "object") {
10380 // CommonJS
10381 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"), _dereq_("./sha512"));
10382 }
10383 else if (typeof define === "function" && define.amd) {
10384 // AMD
10385 define(["./core", "./x64-core", "./sha512"], factory);
10386 }
10387 else {
10388 // Global (browser)
10389 factory(root.CryptoJS);
10390 }
10391}(this, function (CryptoJS) {
10392
10393 (function () {
10394 // Shortcuts
10395 var C = CryptoJS;
10396 var C_x64 = C.x64;
10397 var X64Word = C_x64.Word;
10398 var X64WordArray = C_x64.WordArray;
10399 var C_algo = C.algo;
10400 var SHA512 = C_algo.SHA512;
10401
10402 /**
10403 * SHA-384 hash algorithm.
10404 */
10405 var SHA384 = C_algo.SHA384 = SHA512.extend({
10406 _doReset: function () {
10407 this._hash = new X64WordArray.init([
10408 new X64Word.init(0xcbbb9d5d, 0xc1059ed8), new X64Word.init(0x629a292a, 0x367cd507),
10409 new X64Word.init(0x9159015a, 0x3070dd17), new X64Word.init(0x152fecd8, 0xf70e5939),
10410 new X64Word.init(0x67332667, 0xffc00b31), new X64Word.init(0x8eb44a87, 0x68581511),
10411 new X64Word.init(0xdb0c2e0d, 0x64f98fa7), new X64Word.init(0x47b5481d, 0xbefa4fa4)
10412 ]);
10413 },
10414
10415 _doFinalize: function () {
10416 var hash = SHA512._doFinalize.call(this);
10417
10418 hash.sigBytes -= 16;
10419
10420 return hash;
10421 }
10422 });
10423
10424 /**
10425 * Shortcut function to the hasher's object interface.
10426 *
10427 * @param {WordArray|string} message The message to hash.
10428 *
10429 * @return {WordArray} The hash.
10430 *
10431 * @static
10432 *
10433 * @example
10434 *
10435 * var hash = CryptoJS.SHA384('message');
10436 * var hash = CryptoJS.SHA384(wordArray);
10437 */
10438 C.SHA384 = SHA512._createHelper(SHA384);
10439
10440 /**
10441 * Shortcut function to the HMAC's object interface.
10442 *
10443 * @param {WordArray|string} message The message to hash.
10444 * @param {WordArray|string} key The secret key.
10445 *
10446 * @return {WordArray} The HMAC.
10447 *
10448 * @static
10449 *
10450 * @example
10451 *
10452 * var hmac = CryptoJS.HmacSHA384(message, key);
10453 */
10454 C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
10455 }());
10456
10457
10458 return CryptoJS.SHA384;
10459
10460}));
10461},{"./core":31,"./sha512":60,"./x64-core":62}],60:[function(_dereq_,module,exports){
10462;(function (root, factory, undef) {
10463 if (typeof exports === "object") {
10464 // CommonJS
10465 module.exports = exports = factory(_dereq_("./core"), _dereq_("./x64-core"));
10466 }
10467 else if (typeof define === "function" && define.amd) {
10468 // AMD
10469 define(["./core", "./x64-core"], factory);
10470 }
10471 else {
10472 // Global (browser)
10473 factory(root.CryptoJS);
10474 }
10475}(this, function (CryptoJS) {
10476
10477 (function () {
10478 // Shortcuts
10479 var C = CryptoJS;
10480 var C_lib = C.lib;
10481 var Hasher = C_lib.Hasher;
10482 var C_x64 = C.x64;
10483 var X64Word = C_x64.Word;
10484 var X64WordArray = C_x64.WordArray;
10485 var C_algo = C.algo;
10486
10487 function X64Word_create() {
10488 return X64Word.create.apply(X64Word, arguments);
10489 }
10490
10491 // Constants
10492 var K = [
10493 X64Word_create(0x428a2f98, 0xd728ae22), X64Word_create(0x71374491, 0x23ef65cd),
10494 X64Word_create(0xb5c0fbcf, 0xec4d3b2f), X64Word_create(0xe9b5dba5, 0x8189dbbc),
10495 X64Word_create(0x3956c25b, 0xf348b538), X64Word_create(0x59f111f1, 0xb605d019),
10496 X64Word_create(0x923f82a4, 0xaf194f9b), X64Word_create(0xab1c5ed5, 0xda6d8118),
10497 X64Word_create(0xd807aa98, 0xa3030242), X64Word_create(0x12835b01, 0x45706fbe),
10498 X64Word_create(0x243185be, 0x4ee4b28c), X64Word_create(0x550c7dc3, 0xd5ffb4e2),
10499 X64Word_create(0x72be5d74, 0xf27b896f), X64Word_create(0x80deb1fe, 0x3b1696b1),
10500 X64Word_create(0x9bdc06a7, 0x25c71235), X64Word_create(0xc19bf174, 0xcf692694),
10501 X64Word_create(0xe49b69c1, 0x9ef14ad2), X64Word_create(0xefbe4786, 0x384f25e3),
10502 X64Word_create(0x0fc19dc6, 0x8b8cd5b5), X64Word_create(0x240ca1cc, 0x77ac9c65),
10503 X64Word_create(0x2de92c6f, 0x592b0275), X64Word_create(0x4a7484aa, 0x6ea6e483),
10504 X64Word_create(0x5cb0a9dc, 0xbd41fbd4), X64Word_create(0x76f988da, 0x831153b5),
10505 X64Word_create(0x983e5152, 0xee66dfab), X64Word_create(0xa831c66d, 0x2db43210),
10506 X64Word_create(0xb00327c8, 0x98fb213f), X64Word_create(0xbf597fc7, 0xbeef0ee4),
10507 X64Word_create(0xc6e00bf3, 0x3da88fc2), X64Word_create(0xd5a79147, 0x930aa725),
10508 X64Word_create(0x06ca6351, 0xe003826f), X64Word_create(0x14292967, 0x0a0e6e70),
10509 X64Word_create(0x27b70a85, 0x46d22ffc), X64Word_create(0x2e1b2138, 0x5c26c926),
10510 X64Word_create(0x4d2c6dfc, 0x5ac42aed), X64Word_create(0x53380d13, 0x9d95b3df),
10511 X64Word_create(0x650a7354, 0x8baf63de), X64Word_create(0x766a0abb, 0x3c77b2a8),
10512 X64Word_create(0x81c2c92e, 0x47edaee6), X64Word_create(0x92722c85, 0x1482353b),
10513 X64Word_create(0xa2bfe8a1, 0x4cf10364), X64Word_create(0xa81a664b, 0xbc423001),
10514 X64Word_create(0xc24b8b70, 0xd0f89791), X64Word_create(0xc76c51a3, 0x0654be30),
10515 X64Word_create(0xd192e819, 0xd6ef5218), X64Word_create(0xd6990624, 0x5565a910),
10516 X64Word_create(0xf40e3585, 0x5771202a), X64Word_create(0x106aa070, 0x32bbd1b8),
10517 X64Word_create(0x19a4c116, 0xb8d2d0c8), X64Word_create(0x1e376c08, 0x5141ab53),
10518 X64Word_create(0x2748774c, 0xdf8eeb99), X64Word_create(0x34b0bcb5, 0xe19b48a8),
10519 X64Word_create(0x391c0cb3, 0xc5c95a63), X64Word_create(0x4ed8aa4a, 0xe3418acb),
10520 X64Word_create(0x5b9cca4f, 0x7763e373), X64Word_create(0x682e6ff3, 0xd6b2b8a3),
10521 X64Word_create(0x748f82ee, 0x5defb2fc), X64Word_create(0x78a5636f, 0x43172f60),
10522 X64Word_create(0x84c87814, 0xa1f0ab72), X64Word_create(0x8cc70208, 0x1a6439ec),
10523 X64Word_create(0x90befffa, 0x23631e28), X64Word_create(0xa4506ceb, 0xde82bde9),
10524 X64Word_create(0xbef9a3f7, 0xb2c67915), X64Word_create(0xc67178f2, 0xe372532b),
10525 X64Word_create(0xca273ece, 0xea26619c), X64Word_create(0xd186b8c7, 0x21c0c207),
10526 X64Word_create(0xeada7dd6, 0xcde0eb1e), X64Word_create(0xf57d4f7f, 0xee6ed178),
10527 X64Word_create(0x06f067aa, 0x72176fba), X64Word_create(0x0a637dc5, 0xa2c898a6),
10528 X64Word_create(0x113f9804, 0xbef90dae), X64Word_create(0x1b710b35, 0x131c471b),
10529 X64Word_create(0x28db77f5, 0x23047d84), X64Word_create(0x32caab7b, 0x40c72493),
10530 X64Word_create(0x3c9ebe0a, 0x15c9bebc), X64Word_create(0x431d67c4, 0x9c100d4c),
10531 X64Word_create(0x4cc5d4be, 0xcb3e42b6), X64Word_create(0x597f299c, 0xfc657e2a),
10532 X64Word_create(0x5fcb6fab, 0x3ad6faec), X64Word_create(0x6c44198c, 0x4a475817)
10533 ];
10534
10535 // Reusable objects
10536 var W = [];
10537 (function () {
10538 for (var i = 0; i < 80; i++) {
10539 W[i] = X64Word_create();
10540 }
10541 }());
10542
10543 /**
10544 * SHA-512 hash algorithm.
10545 */
10546 var SHA512 = C_algo.SHA512 = Hasher.extend({
10547 _doReset: function () {
10548 this._hash = new X64WordArray.init([
10549 new X64Word.init(0x6a09e667, 0xf3bcc908), new X64Word.init(0xbb67ae85, 0x84caa73b),
10550 new X64Word.init(0x3c6ef372, 0xfe94f82b), new X64Word.init(0xa54ff53a, 0x5f1d36f1),
10551 new X64Word.init(0x510e527f, 0xade682d1), new X64Word.init(0x9b05688c, 0x2b3e6c1f),
10552 new X64Word.init(0x1f83d9ab, 0xfb41bd6b), new X64Word.init(0x5be0cd19, 0x137e2179)
10553 ]);
10554 },
10555
10556 _doProcessBlock: function (M, offset) {
10557 // Shortcuts
10558 var H = this._hash.words;
10559
10560 var H0 = H[0];
10561 var H1 = H[1];
10562 var H2 = H[2];
10563 var H3 = H[3];
10564 var H4 = H[4];
10565 var H5 = H[5];
10566 var H6 = H[6];
10567 var H7 = H[7];
10568
10569 var H0h = H0.high;
10570 var H0l = H0.low;
10571 var H1h = H1.high;
10572 var H1l = H1.low;
10573 var H2h = H2.high;
10574 var H2l = H2.low;
10575 var H3h = H3.high;
10576 var H3l = H3.low;
10577 var H4h = H4.high;
10578 var H4l = H4.low;
10579 var H5h = H5.high;
10580 var H5l = H5.low;
10581 var H6h = H6.high;
10582 var H6l = H6.low;
10583 var H7h = H7.high;
10584 var H7l = H7.low;
10585
10586 // Working variables
10587 var ah = H0h;
10588 var al = H0l;
10589 var bh = H1h;
10590 var bl = H1l;
10591 var ch = H2h;
10592 var cl = H2l;
10593 var dh = H3h;
10594 var dl = H3l;
10595 var eh = H4h;
10596 var el = H4l;
10597 var fh = H5h;
10598 var fl = H5l;
10599 var gh = H6h;
10600 var gl = H6l;
10601 var hh = H7h;
10602 var hl = H7l;
10603
10604 // Rounds
10605 for (var i = 0; i < 80; i++) {
10606 // Shortcut
10607 var Wi = W[i];
10608
10609 // Extend message
10610 if (i < 16) {
10611 var Wih = Wi.high = M[offset + i * 2] | 0;
10612 var Wil = Wi.low = M[offset + i * 2 + 1] | 0;
10613 } else {
10614 // Gamma0
10615 var gamma0x = W[i - 15];
10616 var gamma0xh = gamma0x.high;
10617 var gamma0xl = gamma0x.low;
10618 var gamma0h = ((gamma0xh >>> 1) | (gamma0xl << 31)) ^ ((gamma0xh >>> 8) | (gamma0xl << 24)) ^ (gamma0xh >>> 7);
10619 var gamma0l = ((gamma0xl >>> 1) | (gamma0xh << 31)) ^ ((gamma0xl >>> 8) | (gamma0xh << 24)) ^ ((gamma0xl >>> 7) | (gamma0xh << 25));
10620
10621 // Gamma1
10622 var gamma1x = W[i - 2];
10623 var gamma1xh = gamma1x.high;
10624 var gamma1xl = gamma1x.low;
10625 var gamma1h = ((gamma1xh >>> 19) | (gamma1xl << 13)) ^ ((gamma1xh << 3) | (gamma1xl >>> 29)) ^ (gamma1xh >>> 6);
10626 var gamma1l = ((gamma1xl >>> 19) | (gamma1xh << 13)) ^ ((gamma1xl << 3) | (gamma1xh >>> 29)) ^ ((gamma1xl >>> 6) | (gamma1xh << 26));
10627
10628 // W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16]
10629 var Wi7 = W[i - 7];
10630 var Wi7h = Wi7.high;
10631 var Wi7l = Wi7.low;
10632
10633 var Wi16 = W[i - 16];
10634 var Wi16h = Wi16.high;
10635 var Wi16l = Wi16.low;
10636
10637 var Wil = gamma0l + Wi7l;
10638 var Wih = gamma0h + Wi7h + ((Wil >>> 0) < (gamma0l >>> 0) ? 1 : 0);
10639 var Wil = Wil + gamma1l;
10640 var Wih = Wih + gamma1h + ((Wil >>> 0) < (gamma1l >>> 0) ? 1 : 0);
10641 var Wil = Wil + Wi16l;
10642 var Wih = Wih + Wi16h + ((Wil >>> 0) < (Wi16l >>> 0) ? 1 : 0);
10643
10644 Wi.high = Wih;
10645 Wi.low = Wil;
10646 }
10647
10648 var chh = (eh & fh) ^ (~eh & gh);
10649 var chl = (el & fl) ^ (~el & gl);
10650 var majh = (ah & bh) ^ (ah & ch) ^ (bh & ch);
10651 var majl = (al & bl) ^ (al & cl) ^ (bl & cl);
10652
10653 var sigma0h = ((ah >>> 28) | (al << 4)) ^ ((ah << 30) | (al >>> 2)) ^ ((ah << 25) | (al >>> 7));
10654 var sigma0l = ((al >>> 28) | (ah << 4)) ^ ((al << 30) | (ah >>> 2)) ^ ((al << 25) | (ah >>> 7));
10655 var sigma1h = ((eh >>> 14) | (el << 18)) ^ ((eh >>> 18) | (el << 14)) ^ ((eh << 23) | (el >>> 9));
10656 var sigma1l = ((el >>> 14) | (eh << 18)) ^ ((el >>> 18) | (eh << 14)) ^ ((el << 23) | (eh >>> 9));
10657
10658 // t1 = h + sigma1 + ch + K[i] + W[i]
10659 var Ki = K[i];
10660 var Kih = Ki.high;
10661 var Kil = Ki.low;
10662
10663 var t1l = hl + sigma1l;
10664 var t1h = hh + sigma1h + ((t1l >>> 0) < (hl >>> 0) ? 1 : 0);
10665 var t1l = t1l + chl;
10666 var t1h = t1h + chh + ((t1l >>> 0) < (chl >>> 0) ? 1 : 0);
10667 var t1l = t1l + Kil;
10668 var t1h = t1h + Kih + ((t1l >>> 0) < (Kil >>> 0) ? 1 : 0);
10669 var t1l = t1l + Wil;
10670 var t1h = t1h + Wih + ((t1l >>> 0) < (Wil >>> 0) ? 1 : 0);
10671
10672 // t2 = sigma0 + maj
10673 var t2l = sigma0l + majl;
10674 var t2h = sigma0h + majh + ((t2l >>> 0) < (sigma0l >>> 0) ? 1 : 0);
10675
10676 // Update working variables
10677 hh = gh;
10678 hl = gl;
10679 gh = fh;
10680 gl = fl;
10681 fh = eh;
10682 fl = el;
10683 el = (dl + t1l) | 0;
10684 eh = (dh + t1h + ((el >>> 0) < (dl >>> 0) ? 1 : 0)) | 0;
10685 dh = ch;
10686 dl = cl;
10687 ch = bh;
10688 cl = bl;
10689 bh = ah;
10690 bl = al;
10691 al = (t1l + t2l) | 0;
10692 ah = (t1h + t2h + ((al >>> 0) < (t1l >>> 0) ? 1 : 0)) | 0;
10693 }
10694
10695 // Intermediate hash value
10696 H0l = H0.low = (H0l + al);
10697 H0.high = (H0h + ah + ((H0l >>> 0) < (al >>> 0) ? 1 : 0));
10698 H1l = H1.low = (H1l + bl);
10699 H1.high = (H1h + bh + ((H1l >>> 0) < (bl >>> 0) ? 1 : 0));
10700 H2l = H2.low = (H2l + cl);
10701 H2.high = (H2h + ch + ((H2l >>> 0) < (cl >>> 0) ? 1 : 0));
10702 H3l = H3.low = (H3l + dl);
10703 H3.high = (H3h + dh + ((H3l >>> 0) < (dl >>> 0) ? 1 : 0));
10704 H4l = H4.low = (H4l + el);
10705 H4.high = (H4h + eh + ((H4l >>> 0) < (el >>> 0) ? 1 : 0));
10706 H5l = H5.low = (H5l + fl);
10707 H5.high = (H5h + fh + ((H5l >>> 0) < (fl >>> 0) ? 1 : 0));
10708 H6l = H6.low = (H6l + gl);
10709 H6.high = (H6h + gh + ((H6l >>> 0) < (gl >>> 0) ? 1 : 0));
10710 H7l = H7.low = (H7l + hl);
10711 H7.high = (H7h + hh + ((H7l >>> 0) < (hl >>> 0) ? 1 : 0));
10712 },
10713
10714 _doFinalize: function () {
10715 // Shortcuts
10716 var data = this._data;
10717 var dataWords = data.words;
10718
10719 var nBitsTotal = this._nDataBytes * 8;
10720 var nBitsLeft = data.sigBytes * 8;
10721
10722 // Add padding
10723 dataWords[nBitsLeft >>> 5] |= 0x80 << (24 - nBitsLeft % 32);
10724 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 30] = Math.floor(nBitsTotal / 0x100000000);
10725 dataWords[(((nBitsLeft + 128) >>> 10) << 5) + 31] = nBitsTotal;
10726 data.sigBytes = dataWords.length * 4;
10727
10728 // Hash final blocks
10729 this._process();
10730
10731 // Convert hash to 32-bit word array before returning
10732 var hash = this._hash.toX32();
10733
10734 // Return final computed hash
10735 return hash;
10736 },
10737
10738 clone: function () {
10739 var clone = Hasher.clone.call(this);
10740 clone._hash = this._hash.clone();
10741
10742 return clone;
10743 },
10744
10745 blockSize: 1024/32
10746 });
10747
10748 /**
10749 * Shortcut function to the hasher's object interface.
10750 *
10751 * @param {WordArray|string} message The message to hash.
10752 *
10753 * @return {WordArray} The hash.
10754 *
10755 * @static
10756 *
10757 * @example
10758 *
10759 * var hash = CryptoJS.SHA512('message');
10760 * var hash = CryptoJS.SHA512(wordArray);
10761 */
10762 C.SHA512 = Hasher._createHelper(SHA512);
10763
10764 /**
10765 * Shortcut function to the HMAC's object interface.
10766 *
10767 * @param {WordArray|string} message The message to hash.
10768 * @param {WordArray|string} key The secret key.
10769 *
10770 * @return {WordArray} The HMAC.
10771 *
10772 * @static
10773 *
10774 * @example
10775 *
10776 * var hmac = CryptoJS.HmacSHA512(message, key);
10777 */
10778 C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
10779 }());
10780
10781
10782 return CryptoJS.SHA512;
10783
10784}));
10785},{"./core":31,"./x64-core":62}],61:[function(_dereq_,module,exports){
10786;(function (root, factory, undef) {
10787 if (typeof exports === "object") {
10788 // CommonJS
10789 module.exports = exports = factory(_dereq_("./core"), _dereq_("./enc-base64"), _dereq_("./md5"), _dereq_("./evpkdf"), _dereq_("./cipher-core"));
10790 }
10791 else if (typeof define === "function" && define.amd) {
10792 // AMD
10793 define(["./core", "./enc-base64", "./md5", "./evpkdf", "./cipher-core"], factory);
10794 }
10795 else {
10796 // Global (browser)
10797 factory(root.CryptoJS);
10798 }
10799}(this, function (CryptoJS) {
10800
10801 (function () {
10802 // Shortcuts
10803 var C = CryptoJS;
10804 var C_lib = C.lib;
10805 var WordArray = C_lib.WordArray;
10806 var BlockCipher = C_lib.BlockCipher;
10807 var C_algo = C.algo;
10808
10809 // Permuted Choice 1 constants
10810 var PC1 = [
10811 57, 49, 41, 33, 25, 17, 9, 1,
10812 58, 50, 42, 34, 26, 18, 10, 2,
10813 59, 51, 43, 35, 27, 19, 11, 3,
10814 60, 52, 44, 36, 63, 55, 47, 39,
10815 31, 23, 15, 7, 62, 54, 46, 38,
10816 30, 22, 14, 6, 61, 53, 45, 37,
10817 29, 21, 13, 5, 28, 20, 12, 4
10818 ];
10819
10820 // Permuted Choice 2 constants
10821 var PC2 = [
10822 14, 17, 11, 24, 1, 5,
10823 3, 28, 15, 6, 21, 10,
10824 23, 19, 12, 4, 26, 8,
10825 16, 7, 27, 20, 13, 2,
10826 41, 52, 31, 37, 47, 55,
10827 30, 40, 51, 45, 33, 48,
10828 44, 49, 39, 56, 34, 53,
10829 46, 42, 50, 36, 29, 32
10830 ];
10831
10832 // Cumulative bit shift constants
10833 var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
10834
10835 // SBOXes and round permutation constants
10836 var SBOX_P = [
10837 {
10838 0x0: 0x808200,
10839 0x10000000: 0x8000,
10840 0x20000000: 0x808002,
10841 0x30000000: 0x2,
10842 0x40000000: 0x200,
10843 0x50000000: 0x808202,
10844 0x60000000: 0x800202,
10845 0x70000000: 0x800000,
10846 0x80000000: 0x202,
10847 0x90000000: 0x800200,
10848 0xa0000000: 0x8200,
10849 0xb0000000: 0x808000,
10850 0xc0000000: 0x8002,
10851 0xd0000000: 0x800002,
10852 0xe0000000: 0x0,
10853 0xf0000000: 0x8202,
10854 0x8000000: 0x0,
10855 0x18000000: 0x808202,
10856 0x28000000: 0x8202,
10857 0x38000000: 0x8000,
10858 0x48000000: 0x808200,
10859 0x58000000: 0x200,
10860 0x68000000: 0x808002,
10861 0x78000000: 0x2,
10862 0x88000000: 0x800200,
10863 0x98000000: 0x8200,
10864 0xa8000000: 0x808000,
10865 0xb8000000: 0x800202,
10866 0xc8000000: 0x800002,
10867 0xd8000000: 0x8002,
10868 0xe8000000: 0x202,
10869 0xf8000000: 0x800000,
10870 0x1: 0x8000,
10871 0x10000001: 0x2,
10872 0x20000001: 0x808200,
10873 0x30000001: 0x800000,
10874 0x40000001: 0x808002,
10875 0x50000001: 0x8200,
10876 0x60000001: 0x200,
10877 0x70000001: 0x800202,
10878 0x80000001: 0x808202,
10879 0x90000001: 0x808000,
10880 0xa0000001: 0x800002,
10881 0xb0000001: 0x8202,
10882 0xc0000001: 0x202,
10883 0xd0000001: 0x800200,
10884 0xe0000001: 0x8002,
10885 0xf0000001: 0x0,
10886 0x8000001: 0x808202,
10887 0x18000001: 0x808000,
10888 0x28000001: 0x800000,
10889 0x38000001: 0x200,
10890 0x48000001: 0x8000,
10891 0x58000001: 0x800002,
10892 0x68000001: 0x2,
10893 0x78000001: 0x8202,
10894 0x88000001: 0x8002,
10895 0x98000001: 0x800202,
10896 0xa8000001: 0x202,
10897 0xb8000001: 0x808200,
10898 0xc8000001: 0x800200,
10899 0xd8000001: 0x0,
10900 0xe8000001: 0x8200,
10901 0xf8000001: 0x808002
10902 },
10903 {
10904 0x0: 0x40084010,
10905 0x1000000: 0x4000,
10906 0x2000000: 0x80000,
10907 0x3000000: 0x40080010,
10908 0x4000000: 0x40000010,
10909 0x5000000: 0x40084000,
10910 0x6000000: 0x40004000,
10911 0x7000000: 0x10,
10912 0x8000000: 0x84000,
10913 0x9000000: 0x40004010,
10914 0xa000000: 0x40000000,
10915 0xb000000: 0x84010,
10916 0xc000000: 0x80010,
10917 0xd000000: 0x0,
10918 0xe000000: 0x4010,
10919 0xf000000: 0x40080000,
10920 0x800000: 0x40004000,
10921 0x1800000: 0x84010,
10922 0x2800000: 0x10,
10923 0x3800000: 0x40004010,
10924 0x4800000: 0x40084010,
10925 0x5800000: 0x40000000,
10926 0x6800000: 0x80000,
10927 0x7800000: 0x40080010,
10928 0x8800000: 0x80010,
10929 0x9800000: 0x0,
10930 0xa800000: 0x4000,
10931 0xb800000: 0x40080000,
10932 0xc800000: 0x40000010,
10933 0xd800000: 0x84000,
10934 0xe800000: 0x40084000,
10935 0xf800000: 0x4010,
10936 0x10000000: 0x0,
10937 0x11000000: 0x40080010,
10938 0x12000000: 0x40004010,
10939 0x13000000: 0x40084000,
10940 0x14000000: 0x40080000,
10941 0x15000000: 0x10,
10942 0x16000000: 0x84010,
10943 0x17000000: 0x4000,
10944 0x18000000: 0x4010,
10945 0x19000000: 0x80000,
10946 0x1a000000: 0x80010,
10947 0x1b000000: 0x40000010,
10948 0x1c000000: 0x84000,
10949 0x1d000000: 0x40004000,
10950 0x1e000000: 0x40000000,
10951 0x1f000000: 0x40084010,
10952 0x10800000: 0x84010,
10953 0x11800000: 0x80000,
10954 0x12800000: 0x40080000,
10955 0x13800000: 0x4000,
10956 0x14800000: 0x40004000,
10957 0x15800000: 0x40084010,
10958 0x16800000: 0x10,
10959 0x17800000: 0x40000000,
10960 0x18800000: 0x40084000,
10961 0x19800000: 0x40000010,
10962 0x1a800000: 0x40004010,
10963 0x1b800000: 0x80010,
10964 0x1c800000: 0x0,
10965 0x1d800000: 0x4010,
10966 0x1e800000: 0x40080010,
10967 0x1f800000: 0x84000
10968 },
10969 {
10970 0x0: 0x104,
10971 0x100000: 0x0,
10972 0x200000: 0x4000100,
10973 0x300000: 0x10104,
10974 0x400000: 0x10004,
10975 0x500000: 0x4000004,
10976 0x600000: 0x4010104,
10977 0x700000: 0x4010000,
10978 0x800000: 0x4000000,
10979 0x900000: 0x4010100,
10980 0xa00000: 0x10100,
10981 0xb00000: 0x4010004,
10982 0xc00000: 0x4000104,
10983 0xd00000: 0x10000,
10984 0xe00000: 0x4,
10985 0xf00000: 0x100,
10986 0x80000: 0x4010100,
10987 0x180000: 0x4010004,
10988 0x280000: 0x0,
10989 0x380000: 0x4000100,
10990 0x480000: 0x4000004,
10991 0x580000: 0x10000,
10992 0x680000: 0x10004,
10993 0x780000: 0x104,
10994 0x880000: 0x4,
10995 0x980000: 0x100,
10996 0xa80000: 0x4010000,
10997 0xb80000: 0x10104,
10998 0xc80000: 0x10100,
10999 0xd80000: 0x4000104,
11000 0xe80000: 0x4010104,
11001 0xf80000: 0x4000000,
11002 0x1000000: 0x4010100,
11003 0x1100000: 0x10004,
11004 0x1200000: 0x10000,
11005 0x1300000: 0x4000100,
11006 0x1400000: 0x100,
11007 0x1500000: 0x4010104,
11008 0x1600000: 0x4000004,
11009 0x1700000: 0x0,
11010 0x1800000: 0x4000104,
11011 0x1900000: 0x4000000,
11012 0x1a00000: 0x4,
11013 0x1b00000: 0x10100,
11014 0x1c00000: 0x4010000,
11015 0x1d00000: 0x104,
11016 0x1e00000: 0x10104,
11017 0x1f00000: 0x4010004,
11018 0x1080000: 0x4000000,
11019 0x1180000: 0x104,
11020 0x1280000: 0x4010100,
11021 0x1380000: 0x0,
11022 0x1480000: 0x10004,
11023 0x1580000: 0x4000100,
11024 0x1680000: 0x100,
11025 0x1780000: 0x4010004,
11026 0x1880000: 0x10000,
11027 0x1980000: 0x4010104,
11028 0x1a80000: 0x10104,
11029 0x1b80000: 0x4000004,
11030 0x1c80000: 0x4000104,
11031 0x1d80000: 0x4010000,
11032 0x1e80000: 0x4,
11033 0x1f80000: 0x10100
11034 },
11035 {
11036 0x0: 0x80401000,
11037 0x10000: 0x80001040,
11038 0x20000: 0x401040,
11039 0x30000: 0x80400000,
11040 0x40000: 0x0,
11041 0x50000: 0x401000,
11042 0x60000: 0x80000040,
11043 0x70000: 0x400040,
11044 0x80000: 0x80000000,
11045 0x90000: 0x400000,
11046 0xa0000: 0x40,
11047 0xb0000: 0x80001000,
11048 0xc0000: 0x80400040,
11049 0xd0000: 0x1040,
11050 0xe0000: 0x1000,
11051 0xf0000: 0x80401040,
11052 0x8000: 0x80001040,
11053 0x18000: 0x40,
11054 0x28000: 0x80400040,
11055 0x38000: 0x80001000,
11056 0x48000: 0x401000,
11057 0x58000: 0x80401040,
11058 0x68000: 0x0,
11059 0x78000: 0x80400000,
11060 0x88000: 0x1000,
11061 0x98000: 0x80401000,
11062 0xa8000: 0x400000,
11063 0xb8000: 0x1040,
11064 0xc8000: 0x80000000,
11065 0xd8000: 0x400040,
11066 0xe8000: 0x401040,
11067 0xf8000: 0x80000040,
11068 0x100000: 0x400040,
11069 0x110000: 0x401000,
11070 0x120000: 0x80000040,
11071 0x130000: 0x0,
11072 0x140000: 0x1040,
11073 0x150000: 0x80400040,
11074 0x160000: 0x80401000,
11075 0x170000: 0x80001040,
11076 0x180000: 0x80401040,
11077 0x190000: 0x80000000,
11078 0x1a0000: 0x80400000,
11079 0x1b0000: 0x401040,
11080 0x1c0000: 0x80001000,
11081 0x1d0000: 0x400000,
11082 0x1e0000: 0x40,
11083 0x1f0000: 0x1000,
11084 0x108000: 0x80400000,
11085 0x118000: 0x80401040,
11086 0x128000: 0x0,
11087 0x138000: 0x401000,
11088 0x148000: 0x400040,
11089 0x158000: 0x80000000,
11090 0x168000: 0x80001040,
11091 0x178000: 0x40,
11092 0x188000: 0x80000040,
11093 0x198000: 0x1000,
11094 0x1a8000: 0x80001000,
11095 0x1b8000: 0x80400040,
11096 0x1c8000: 0x1040,
11097 0x1d8000: 0x80401000,
11098 0x1e8000: 0x400000,
11099 0x1f8000: 0x401040
11100 },
11101 {
11102 0x0: 0x80,
11103 0x1000: 0x1040000,
11104 0x2000: 0x40000,
11105 0x3000: 0x20000000,
11106 0x4000: 0x20040080,
11107 0x5000: 0x1000080,
11108 0x6000: 0x21000080,
11109 0x7000: 0x40080,
11110 0x8000: 0x1000000,
11111 0x9000: 0x20040000,
11112 0xa000: 0x20000080,
11113 0xb000: 0x21040080,
11114 0xc000: 0x21040000,
11115 0xd000: 0x0,
11116 0xe000: 0x1040080,
11117 0xf000: 0x21000000,
11118 0x800: 0x1040080,
11119 0x1800: 0x21000080,
11120 0x2800: 0x80,
11121 0x3800: 0x1040000,
11122 0x4800: 0x40000,
11123 0x5800: 0x20040080,
11124 0x6800: 0x21040000,
11125 0x7800: 0x20000000,
11126 0x8800: 0x20040000,
11127 0x9800: 0x0,
11128 0xa800: 0x21040080,
11129 0xb800: 0x1000080,
11130 0xc800: 0x20000080,
11131 0xd800: 0x21000000,
11132 0xe800: 0x1000000,
11133 0xf800: 0x40080,
11134 0x10000: 0x40000,
11135 0x11000: 0x80,
11136 0x12000: 0x20000000,
11137 0x13000: 0x21000080,
11138 0x14000: 0x1000080,
11139 0x15000: 0x21040000,
11140 0x16000: 0x20040080,
11141 0x17000: 0x1000000,
11142 0x18000: 0x21040080,
11143 0x19000: 0x21000000,
11144 0x1a000: 0x1040000,
11145 0x1b000: 0x20040000,
11146 0x1c000: 0x40080,
11147 0x1d000: 0x20000080,
11148 0x1e000: 0x0,
11149 0x1f000: 0x1040080,
11150 0x10800: 0x21000080,
11151 0x11800: 0x1000000,
11152 0x12800: 0x1040000,
11153 0x13800: 0x20040080,
11154 0x14800: 0x20000000,
11155 0x15800: 0x1040080,
11156 0x16800: 0x80,
11157 0x17800: 0x21040000,
11158 0x18800: 0x40080,
11159 0x19800: 0x21040080,
11160 0x1a800: 0x0,
11161 0x1b800: 0x21000000,
11162 0x1c800: 0x1000080,
11163 0x1d800: 0x40000,
11164 0x1e800: 0x20040000,
11165 0x1f800: 0x20000080
11166 },
11167 {
11168 0x0: 0x10000008,
11169 0x100: 0x2000,
11170 0x200: 0x10200000,
11171 0x300: 0x10202008,
11172 0x400: 0x10002000,
11173 0x500: 0x200000,
11174 0x600: 0x200008,
11175 0x700: 0x10000000,
11176 0x800: 0x0,
11177 0x900: 0x10002008,
11178 0xa00: 0x202000,
11179 0xb00: 0x8,
11180 0xc00: 0x10200008,
11181 0xd00: 0x202008,
11182 0xe00: 0x2008,
11183 0xf00: 0x10202000,
11184 0x80: 0x10200000,
11185 0x180: 0x10202008,
11186 0x280: 0x8,
11187 0x380: 0x200000,
11188 0x480: 0x202008,
11189 0x580: 0x10000008,
11190 0x680: 0x10002000,
11191 0x780: 0x2008,
11192 0x880: 0x200008,
11193 0x980: 0x2000,
11194 0xa80: 0x10002008,
11195 0xb80: 0x10200008,
11196 0xc80: 0x0,
11197 0xd80: 0x10202000,
11198 0xe80: 0x202000,
11199 0xf80: 0x10000000,
11200 0x1000: 0x10002000,
11201 0x1100: 0x10200008,
11202 0x1200: 0x10202008,
11203 0x1300: 0x2008,
11204 0x1400: 0x200000,
11205 0x1500: 0x10000000,
11206 0x1600: 0x10000008,
11207 0x1700: 0x202000,
11208 0x1800: 0x202008,
11209 0x1900: 0x0,
11210 0x1a00: 0x8,
11211 0x1b00: 0x10200000,
11212 0x1c00: 0x2000,
11213 0x1d00: 0x10002008,
11214 0x1e00: 0x10202000,
11215 0x1f00: 0x200008,
11216 0x1080: 0x8,
11217 0x1180: 0x202000,
11218 0x1280: 0x200000,
11219 0x1380: 0x10000008,
11220 0x1480: 0x10002000,
11221 0x1580: 0x2008,
11222 0x1680: 0x10202008,
11223 0x1780: 0x10200000,
11224 0x1880: 0x10202000,
11225 0x1980: 0x10200008,
11226 0x1a80: 0x2000,
11227 0x1b80: 0x202008,
11228 0x1c80: 0x200008,
11229 0x1d80: 0x0,
11230 0x1e80: 0x10000000,
11231 0x1f80: 0x10002008
11232 },
11233 {
11234 0x0: 0x100000,
11235 0x10: 0x2000401,
11236 0x20: 0x400,
11237 0x30: 0x100401,
11238 0x40: 0x2100401,
11239 0x50: 0x0,
11240 0x60: 0x1,
11241 0x70: 0x2100001,
11242 0x80: 0x2000400,
11243 0x90: 0x100001,
11244 0xa0: 0x2000001,
11245 0xb0: 0x2100400,
11246 0xc0: 0x2100000,
11247 0xd0: 0x401,
11248 0xe0: 0x100400,
11249 0xf0: 0x2000000,
11250 0x8: 0x2100001,
11251 0x18: 0x0,
11252 0x28: 0x2000401,
11253 0x38: 0x2100400,
11254 0x48: 0x100000,
11255 0x58: 0x2000001,
11256 0x68: 0x2000000,
11257 0x78: 0x401,
11258 0x88: 0x100401,
11259 0x98: 0x2000400,
11260 0xa8: 0x2100000,
11261 0xb8: 0x100001,
11262 0xc8: 0x400,
11263 0xd8: 0x2100401,
11264 0xe8: 0x1,
11265 0xf8: 0x100400,
11266 0x100: 0x2000000,
11267 0x110: 0x100000,
11268 0x120: 0x2000401,
11269 0x130: 0x2100001,
11270 0x140: 0x100001,
11271 0x150: 0x2000400,
11272 0x160: 0x2100400,
11273 0x170: 0x100401,
11274 0x180: 0x401,
11275 0x190: 0x2100401,
11276 0x1a0: 0x100400,
11277 0x1b0: 0x1,
11278 0x1c0: 0x0,
11279 0x1d0: 0x2100000,
11280 0x1e0: 0x2000001,
11281 0x1f0: 0x400,
11282 0x108: 0x100400,
11283 0x118: 0x2000401,
11284 0x128: 0x2100001,
11285 0x138: 0x1,
11286 0x148: 0x2000000,
11287 0x158: 0x100000,
11288 0x168: 0x401,
11289 0x178: 0x2100400,
11290 0x188: 0x2000001,
11291 0x198: 0x2100000,
11292 0x1a8: 0x0,
11293 0x1b8: 0x2100401,
11294 0x1c8: 0x100401,
11295 0x1d8: 0x400,
11296 0x1e8: 0x2000400,
11297 0x1f8: 0x100001
11298 },
11299 {
11300 0x0: 0x8000820,
11301 0x1: 0x20000,
11302 0x2: 0x8000000,
11303 0x3: 0x20,
11304 0x4: 0x20020,
11305 0x5: 0x8020820,
11306 0x6: 0x8020800,
11307 0x7: 0x800,
11308 0x8: 0x8020000,
11309 0x9: 0x8000800,
11310 0xa: 0x20800,
11311 0xb: 0x8020020,
11312 0xc: 0x820,
11313 0xd: 0x0,
11314 0xe: 0x8000020,
11315 0xf: 0x20820,
11316 0x80000000: 0x800,
11317 0x80000001: 0x8020820,
11318 0x80000002: 0x8000820,
11319 0x80000003: 0x8000000,
11320 0x80000004: 0x8020000,
11321 0x80000005: 0x20800,
11322 0x80000006: 0x20820,
11323 0x80000007: 0x20,
11324 0x80000008: 0x8000020,
11325 0x80000009: 0x820,
11326 0x8000000a: 0x20020,
11327 0x8000000b: 0x8020800,
11328 0x8000000c: 0x0,
11329 0x8000000d: 0x8020020,
11330 0x8000000e: 0x8000800,
11331 0x8000000f: 0x20000,
11332 0x10: 0x20820,
11333 0x11: 0x8020800,
11334 0x12: 0x20,
11335 0x13: 0x800,
11336 0x14: 0x8000800,
11337 0x15: 0x8000020,
11338 0x16: 0x8020020,
11339 0x17: 0x20000,
11340 0x18: 0x0,
11341 0x19: 0x20020,
11342 0x1a: 0x8020000,
11343 0x1b: 0x8000820,
11344 0x1c: 0x8020820,
11345 0x1d: 0x20800,
11346 0x1e: 0x820,
11347 0x1f: 0x8000000,
11348 0x80000010: 0x20000,
11349 0x80000011: 0x800,
11350 0x80000012: 0x8020020,
11351 0x80000013: 0x20820,
11352 0x80000014: 0x20,
11353 0x80000015: 0x8020000,
11354 0x80000016: 0x8000000,
11355 0x80000017: 0x8000820,
11356 0x80000018: 0x8020820,
11357 0x80000019: 0x8000020,
11358 0x8000001a: 0x8000800,
11359 0x8000001b: 0x0,
11360 0x8000001c: 0x20800,
11361 0x8000001d: 0x820,
11362 0x8000001e: 0x20020,
11363 0x8000001f: 0x8020800
11364 }
11365 ];
11366
11367 // Masks that select the SBOX input
11368 var SBOX_MASK = [
11369 0xf8000001, 0x1f800000, 0x01f80000, 0x001f8000,
11370 0x0001f800, 0x00001f80, 0x000001f8, 0x8000001f
11371 ];
11372
11373 /**
11374 * DES block cipher algorithm.
11375 */
11376 var DES = C_algo.DES = BlockCipher.extend({
11377 _doReset: function () {
11378 // Shortcuts
11379 var key = this._key;
11380 var keyWords = key.words;
11381
11382 // Select 56 bits according to PC1
11383 var keyBits = [];
11384 for (var i = 0; i < 56; i++) {
11385 var keyBitPos = PC1[i] - 1;
11386 keyBits[i] = (keyWords[keyBitPos >>> 5] >>> (31 - keyBitPos % 32)) & 1;
11387 }
11388
11389 // Assemble 16 subkeys
11390 var subKeys = this._subKeys = [];
11391 for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
11392 // Create subkey
11393 var subKey = subKeys[nSubKey] = [];
11394
11395 // Shortcut
11396 var bitShift = BIT_SHIFTS[nSubKey];
11397
11398 // Select 48 bits according to PC2
11399 for (var i = 0; i < 24; i++) {
11400 // Select from the left 28 key bits
11401 subKey[(i / 6) | 0] |= keyBits[((PC2[i] - 1) + bitShift) % 28] << (31 - i % 6);
11402
11403 // Select from the right 28 key bits
11404 subKey[4 + ((i / 6) | 0)] |= keyBits[28 + (((PC2[i + 24] - 1) + bitShift) % 28)] << (31 - i % 6);
11405 }
11406
11407 // Since each subkey is applied to an expanded 32-bit input,
11408 // the subkey can be broken into 8 values scaled to 32-bits,
11409 // which allows the key to be used without expansion
11410 subKey[0] = (subKey[0] << 1) | (subKey[0] >>> 31);
11411 for (var i = 1; i < 7; i++) {
11412 subKey[i] = subKey[i] >>> ((i - 1) * 4 + 3);
11413 }
11414 subKey[7] = (subKey[7] << 5) | (subKey[7] >>> 27);
11415 }
11416
11417 // Compute inverse subkeys
11418 var invSubKeys = this._invSubKeys = [];
11419 for (var i = 0; i < 16; i++) {
11420 invSubKeys[i] = subKeys[15 - i];
11421 }
11422 },
11423
11424 encryptBlock: function (M, offset) {
11425 this._doCryptBlock(M, offset, this._subKeys);
11426 },
11427
11428 decryptBlock: function (M, offset) {
11429 this._doCryptBlock(M, offset, this._invSubKeys);
11430 },
11431
11432 _doCryptBlock: function (M, offset, subKeys) {
11433 // Get input
11434 this._lBlock = M[offset];
11435 this._rBlock = M[offset + 1];
11436
11437 // Initial permutation
11438 exchangeLR.call(this, 4, 0x0f0f0f0f);
11439 exchangeLR.call(this, 16, 0x0000ffff);
11440 exchangeRL.call(this, 2, 0x33333333);
11441 exchangeRL.call(this, 8, 0x00ff00ff);
11442 exchangeLR.call(this, 1, 0x55555555);
11443
11444 // Rounds
11445 for (var round = 0; round < 16; round++) {
11446 // Shortcuts
11447 var subKey = subKeys[round];
11448 var lBlock = this._lBlock;
11449 var rBlock = this._rBlock;
11450
11451 // Feistel function
11452 var f = 0;
11453 for (var i = 0; i < 8; i++) {
11454 f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
11455 }
11456 this._lBlock = rBlock;
11457 this._rBlock = lBlock ^ f;
11458 }
11459
11460 // Undo swap from last round
11461 var t = this._lBlock;
11462 this._lBlock = this._rBlock;
11463 this._rBlock = t;
11464
11465 // Final permutation
11466 exchangeLR.call(this, 1, 0x55555555);
11467 exchangeRL.call(this, 8, 0x00ff00ff);
11468 exchangeRL.call(this, 2, 0x33333333);
11469 exchangeLR.call(this, 16, 0x0000ffff);
11470 exchangeLR.call(this, 4, 0x0f0f0f0f);
11471
11472 // Set output
11473 M[offset] = this._lBlock;
11474 M[offset + 1] = this._rBlock;
11475 },
11476
11477 keySize: 64/32,
11478
11479 ivSize: 64/32,
11480
11481 blockSize: 64/32
11482 });
11483
11484 // Swap bits across the left and right words
11485 function exchangeLR(offset, mask) {
11486 var t = ((this._lBlock >>> offset) ^ this._rBlock) & mask;
11487 this._rBlock ^= t;
11488 this._lBlock ^= t << offset;
11489 }
11490
11491 function exchangeRL(offset, mask) {
11492 var t = ((this._rBlock >>> offset) ^ this._lBlock) & mask;
11493 this._lBlock ^= t;
11494 this._rBlock ^= t << offset;
11495 }
11496
11497 /**
11498 * Shortcut functions to the cipher's object interface.
11499 *
11500 * @example
11501 *
11502 * var ciphertext = CryptoJS.DES.encrypt(message, key, cfg);
11503 * var plaintext = CryptoJS.DES.decrypt(ciphertext, key, cfg);
11504 */
11505 C.DES = BlockCipher._createHelper(DES);
11506
11507 /**
11508 * Triple-DES block cipher algorithm.
11509 */
11510 var TripleDES = C_algo.TripleDES = BlockCipher.extend({
11511 _doReset: function () {
11512 // Shortcuts
11513 var key = this._key;
11514 var keyWords = key.words;
11515
11516 // Create DES instances
11517 this._des1 = DES.createEncryptor(WordArray.create(keyWords.slice(0, 2)));
11518 this._des2 = DES.createEncryptor(WordArray.create(keyWords.slice(2, 4)));
11519 this._des3 = DES.createEncryptor(WordArray.create(keyWords.slice(4, 6)));
11520 },
11521
11522 encryptBlock: function (M, offset) {
11523 this._des1.encryptBlock(M, offset);
11524 this._des2.decryptBlock(M, offset);
11525 this._des3.encryptBlock(M, offset);
11526 },
11527
11528 decryptBlock: function (M, offset) {
11529 this._des3.decryptBlock(M, offset);
11530 this._des2.encryptBlock(M, offset);
11531 this._des1.decryptBlock(M, offset);
11532 },
11533
11534 keySize: 192/32,
11535
11536 ivSize: 64/32,
11537
11538 blockSize: 64/32
11539 });
11540
11541 /**
11542 * Shortcut functions to the cipher's object interface.
11543 *
11544 * @example
11545 *
11546 * var ciphertext = CryptoJS.TripleDES.encrypt(message, key, cfg);
11547 * var plaintext = CryptoJS.TripleDES.decrypt(ciphertext, key, cfg);
11548 */
11549 C.TripleDES = BlockCipher._createHelper(TripleDES);
11550 }());
11551
11552
11553 return CryptoJS.TripleDES;
11554
11555}));
11556},{"./cipher-core":30,"./core":31,"./enc-base64":32,"./evpkdf":34,"./md5":39}],62:[function(_dereq_,module,exports){
11557;(function (root, factory) {
11558 if (typeof exports === "object") {
11559 // CommonJS
11560 module.exports = exports = factory(_dereq_("./core"));
11561 }
11562 else if (typeof define === "function" && define.amd) {
11563 // AMD
11564 define(["./core"], factory);
11565 }
11566 else {
11567 // Global (browser)
11568 factory(root.CryptoJS);
11569 }
11570}(this, function (CryptoJS) {
11571
11572 (function (undefined) {
11573 // Shortcuts
11574 var C = CryptoJS;
11575 var C_lib = C.lib;
11576 var Base = C_lib.Base;
11577 var X32WordArray = C_lib.WordArray;
11578
11579 /**
11580 * x64 namespace.
11581 */
11582 var C_x64 = C.x64 = {};
11583
11584 /**
11585 * A 64-bit word.
11586 */
11587 var X64Word = C_x64.Word = Base.extend({
11588 /**
11589 * Initializes a newly created 64-bit word.
11590 *
11591 * @param {number} high The high 32 bits.
11592 * @param {number} low The low 32 bits.
11593 *
11594 * @example
11595 *
11596 * var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
11597 */
11598 init: function (high, low) {
11599 this.high = high;
11600 this.low = low;
11601 }
11602
11603 /**
11604 * Bitwise NOTs this word.
11605 *
11606 * @return {X64Word} A new x64-Word object after negating.
11607 *
11608 * @example
11609 *
11610 * var negated = x64Word.not();
11611 */
11612 // not: function () {
11613 // var high = ~this.high;
11614 // var low = ~this.low;
11615
11616 // return X64Word.create(high, low);
11617 // },
11618
11619 /**
11620 * Bitwise ANDs this word with the passed word.
11621 *
11622 * @param {X64Word} word The x64-Word to AND with this word.
11623 *
11624 * @return {X64Word} A new x64-Word object after ANDing.
11625 *
11626 * @example
11627 *
11628 * var anded = x64Word.and(anotherX64Word);
11629 */
11630 // and: function (word) {
11631 // var high = this.high & word.high;
11632 // var low = this.low & word.low;
11633
11634 // return X64Word.create(high, low);
11635 // },
11636
11637 /**
11638 * Bitwise ORs this word with the passed word.
11639 *
11640 * @param {X64Word} word The x64-Word to OR with this word.
11641 *
11642 * @return {X64Word} A new x64-Word object after ORing.
11643 *
11644 * @example
11645 *
11646 * var ored = x64Word.or(anotherX64Word);
11647 */
11648 // or: function (word) {
11649 // var high = this.high | word.high;
11650 // var low = this.low | word.low;
11651
11652 // return X64Word.create(high, low);
11653 // },
11654
11655 /**
11656 * Bitwise XORs this word with the passed word.
11657 *
11658 * @param {X64Word} word The x64-Word to XOR with this word.
11659 *
11660 * @return {X64Word} A new x64-Word object after XORing.
11661 *
11662 * @example
11663 *
11664 * var xored = x64Word.xor(anotherX64Word);
11665 */
11666 // xor: function (word) {
11667 // var high = this.high ^ word.high;
11668 // var low = this.low ^ word.low;
11669
11670 // return X64Word.create(high, low);
11671 // },
11672
11673 /**
11674 * Shifts this word n bits to the left.
11675 *
11676 * @param {number} n The number of bits to shift.
11677 *
11678 * @return {X64Word} A new x64-Word object after shifting.
11679 *
11680 * @example
11681 *
11682 * var shifted = x64Word.shiftL(25);
11683 */
11684 // shiftL: function (n) {
11685 // if (n < 32) {
11686 // var high = (this.high << n) | (this.low >>> (32 - n));
11687 // var low = this.low << n;
11688 // } else {
11689 // var high = this.low << (n - 32);
11690 // var low = 0;
11691 // }
11692
11693 // return X64Word.create(high, low);
11694 // },
11695
11696 /**
11697 * Shifts this word n bits to the right.
11698 *
11699 * @param {number} n The number of bits to shift.
11700 *
11701 * @return {X64Word} A new x64-Word object after shifting.
11702 *
11703 * @example
11704 *
11705 * var shifted = x64Word.shiftR(7);
11706 */
11707 // shiftR: function (n) {
11708 // if (n < 32) {
11709 // var low = (this.low >>> n) | (this.high << (32 - n));
11710 // var high = this.high >>> n;
11711 // } else {
11712 // var low = this.high >>> (n - 32);
11713 // var high = 0;
11714 // }
11715
11716 // return X64Word.create(high, low);
11717 // },
11718
11719 /**
11720 * Rotates this word n bits to the left.
11721 *
11722 * @param {number} n The number of bits to rotate.
11723 *
11724 * @return {X64Word} A new x64-Word object after rotating.
11725 *
11726 * @example
11727 *
11728 * var rotated = x64Word.rotL(25);
11729 */
11730 // rotL: function (n) {
11731 // return this.shiftL(n).or(this.shiftR(64 - n));
11732 // },
11733
11734 /**
11735 * Rotates this word n bits to the right.
11736 *
11737 * @param {number} n The number of bits to rotate.
11738 *
11739 * @return {X64Word} A new x64-Word object after rotating.
11740 *
11741 * @example
11742 *
11743 * var rotated = x64Word.rotR(7);
11744 */
11745 // rotR: function (n) {
11746 // return this.shiftR(n).or(this.shiftL(64 - n));
11747 // },
11748
11749 /**
11750 * Adds this word with the passed word.
11751 *
11752 * @param {X64Word} word The x64-Word to add with this word.
11753 *
11754 * @return {X64Word} A new x64-Word object after adding.
11755 *
11756 * @example
11757 *
11758 * var added = x64Word.add(anotherX64Word);
11759 */
11760 // add: function (word) {
11761 // var low = (this.low + word.low) | 0;
11762 // var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
11763 // var high = (this.high + word.high + carry) | 0;
11764
11765 // return X64Word.create(high, low);
11766 // }
11767 });
11768
11769 /**
11770 * An array of 64-bit words.
11771 *
11772 * @property {Array} words The array of CryptoJS.x64.Word objects.
11773 * @property {number} sigBytes The number of significant bytes in this word array.
11774 */
11775 var X64WordArray = C_x64.WordArray = Base.extend({
11776 /**
11777 * Initializes a newly created word array.
11778 *
11779 * @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
11780 * @param {number} sigBytes (Optional) The number of significant bytes in the words.
11781 *
11782 * @example
11783 *
11784 * var wordArray = CryptoJS.x64.WordArray.create();
11785 *
11786 * var wordArray = CryptoJS.x64.WordArray.create([
11787 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11788 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11789 * ]);
11790 *
11791 * var wordArray = CryptoJS.x64.WordArray.create([
11792 * CryptoJS.x64.Word.create(0x00010203, 0x04050607),
11793 * CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
11794 * ], 10);
11795 */
11796 init: function (words, sigBytes) {
11797 words = this.words = words || [];
11798
11799 if (sigBytes != undefined) {
11800 this.sigBytes = sigBytes;
11801 } else {
11802 this.sigBytes = words.length * 8;
11803 }
11804 },
11805
11806 /**
11807 * Converts this 64-bit word array to a 32-bit word array.
11808 *
11809 * @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
11810 *
11811 * @example
11812 *
11813 * var x32WordArray = x64WordArray.toX32();
11814 */
11815 toX32: function () {
11816 // Shortcuts
11817 var x64Words = this.words;
11818 var x64WordsLength = x64Words.length;
11819
11820 // Convert
11821 var x32Words = [];
11822 for (var i = 0; i < x64WordsLength; i++) {
11823 var x64Word = x64Words[i];
11824 x32Words.push(x64Word.high);
11825 x32Words.push(x64Word.low);
11826 }
11827
11828 return X32WordArray.create(x32Words, this.sigBytes);
11829 },
11830
11831 /**
11832 * Creates a copy of this word array.
11833 *
11834 * @return {X64WordArray} The clone.
11835 *
11836 * @example
11837 *
11838 * var clone = x64WordArray.clone();
11839 */
11840 clone: function () {
11841 var clone = Base.clone.call(this);
11842
11843 // Clone "words" array
11844 var words = clone.words = this.words.slice(0);
11845
11846 // Clone each X64Word object
11847 var wordsLength = words.length;
11848 for (var i = 0; i < wordsLength; i++) {
11849 words[i] = words[i].clone();
11850 }
11851
11852 return clone;
11853 }
11854 });
11855 }());
11856
11857
11858 return CryptoJS;
11859
11860}));
11861},{"./core":31}],63:[function(_dereq_,module,exports){
11862var assert = _dereq_('assert')
11863var BigInteger = _dereq_('bigi')
11864
11865var Point = _dereq_('./point')
11866
11867function Curve(p, a, b, Gx, Gy, n, h) {
11868 this.p = p
11869 this.a = a
11870 this.b = b
11871 this.G = Point.fromAffine(this, Gx, Gy)
11872 this.n = n
11873 this.h = h
11874
11875 this.infinity = new Point(this, null, null, BigInteger.ZERO)
11876
11877 // result caching
11878 this.pOverFour = p.add(BigInteger.ONE).shiftRight(2)
11879}
11880
11881Curve.prototype.pointFromX = function(isOdd, x) {
11882 var alpha = x.pow(3).add(this.a.multiply(x)).add(this.b).mod(this.p)
11883 var beta = alpha.modPow(this.pOverFour, this.p)
11884
11885 var y = beta
11886 if (beta.isEven() ^ !isOdd) {
11887 y = this.p.subtract(y) // -y % p
11888 }
11889
11890 return Point.fromAffine(this, x, y)
11891}
11892
11893Curve.prototype.isInfinity = function(Q) {
11894 if (Q === this.infinity) return true
11895
11896 return Q.z.signum() === 0 && Q.y.signum() !== 0
11897}
11898
11899Curve.prototype.isOnCurve = function(Q) {
11900 if (this.isInfinity(Q)) return true
11901
11902 var x = Q.affineX
11903 var y = Q.affineY
11904 var a = this.a
11905 var b = this.b
11906 var p = this.p
11907
11908 // Check that xQ and yQ are integers in the interval [0, p - 1]
11909 if (x.signum() < 0 || x.compareTo(p) >= 0) return false
11910 if (y.signum() < 0 || y.compareTo(p) >= 0) return false
11911
11912 // and check that y^2 = x^3 + ax + b (mod p)
11913 var lhs = y.square().mod(p)
11914 var rhs = x.pow(3).add(a.multiply(x)).add(b).mod(p)
11915 return lhs.equals(rhs)
11916}
11917
11918/**
11919 * Validate an elliptic curve point.
11920 *
11921 * See SEC 1, section 3.2.2.1: Elliptic Curve Public Key Validation Primitive
11922 */
11923Curve.prototype.validate = function(Q) {
11924 // Check Q != O
11925 assert(!this.isInfinity(Q), 'Point is at infinity')
11926 assert(this.isOnCurve(Q), 'Point is not on the curve')
11927
11928 // Check nQ = O (where Q is a scalar multiple of G)
11929 var nQ = Q.multiply(this.n)
11930 assert(this.isInfinity(nQ), 'Point is not a scalar multiple of G')
11931
11932 return true
11933}
11934
11935module.exports = Curve
11936
11937},{"./point":67,"assert":4,"bigi":3}],64:[function(_dereq_,module,exports){
11938module.exports={
11939 "secp128r1": {
11940 "p": "fffffffdffffffffffffffffffffffff",
11941 "a": "fffffffdfffffffffffffffffffffffc",
11942 "b": "e87579c11079f43dd824993c2cee5ed3",
11943 "n": "fffffffe0000000075a30d1b9038a115",
11944 "h": "01",
11945 "Gx": "161ff7528b899b2d0c28607ca52c5b86",
11946 "Gy": "cf5ac8395bafeb13c02da292dded7a83"
11947 },
11948 "secp160k1": {
11949 "p": "fffffffffffffffffffffffffffffffeffffac73",
11950 "a": "00",
11951 "b": "07",
11952 "n": "0100000000000000000001b8fa16dfab9aca16b6b3",
11953 "h": "01",
11954 "Gx": "3b4c382ce37aa192a4019e763036f4f5dd4d7ebb",
11955 "Gy": "938cf935318fdced6bc28286531733c3f03c4fee"
11956 },
11957 "secp160r1": {
11958 "p": "ffffffffffffffffffffffffffffffff7fffffff",
11959 "a": "ffffffffffffffffffffffffffffffff7ffffffc",
11960 "b": "1c97befc54bd7a8b65acf89f81d4d4adc565fa45",
11961 "n": "0100000000000000000001f4c8f927aed3ca752257",
11962 "h": "01",
11963 "Gx": "4a96b5688ef573284664698968c38bb913cbfc82",
11964 "Gy": "23a628553168947d59dcc912042351377ac5fb32"
11965 },
11966 "secp192k1": {
11967 "p": "fffffffffffffffffffffffffffffffffffffffeffffee37",
11968 "a": "00",
11969 "b": "03",
11970 "n": "fffffffffffffffffffffffe26f2fc170f69466a74defd8d",
11971 "h": "01",
11972 "Gx": "db4ff10ec057e9ae26b07d0280b7f4341da5d1b1eae06c7d",
11973 "Gy": "9b2f2f6d9c5628a7844163d015be86344082aa88d95e2f9d"
11974 },
11975 "secp192r1": {
11976 "p": "fffffffffffffffffffffffffffffffeffffffffffffffff",
11977 "a": "fffffffffffffffffffffffffffffffefffffffffffffffc",
11978 "b": "64210519e59c80e70fa7e9ab72243049feb8deecc146b9b1",
11979 "n": "ffffffffffffffffffffffff99def836146bc9b1b4d22831",
11980 "h": "01",
11981 "Gx": "188da80eb03090f67cbf20eb43a18800f4ff0afd82ff1012",
11982 "Gy": "07192b95ffc8da78631011ed6b24cdd573f977a11e794811"
11983 },
11984 "secp224r1": {
11985 "p": "ffffffffffffffffffffffffffffffff000000000000000000000001",
11986 "a": "fffffffffffffffffffffffffffffffefffffffffffffffffffffffe",
11987 "b": "b4050a850c04b3abf54132565044b0b7d7bfd8ba270b39432355ffb4",
11988 "n": "ffffffffffffffffffffffffffff16a2e0b8f03e13dd29455c5c2a3d",
11989 "h": "01",
11990 "Gx": "b70e0cbd6bb4bf7f321390b94a03c1d356c21122343280d6115c1d21",
11991 "Gy": "bd376388b5f723fb4c22dfe6cd4375a05a07476444d5819985007e34"
11992 },
11993 "secp256k1": {
11994 "p": "fffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f",
11995 "a": "00",
11996 "b": "07",
11997 "n": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141",
11998 "h": "01",
11999 "Gx": "79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
12000 "Gy": "483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8"
12001 },
12002 "secp256r1": {
12003 "p": "ffffffff00000001000000000000000000000000ffffffffffffffffffffffff",
12004 "a": "ffffffff00000001000000000000000000000000fffffffffffffffffffffffc",
12005 "b": "5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b",
12006 "n": "ffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551",
12007 "h": "01",
12008 "Gx": "6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296",
12009 "Gy": "4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"
12010 }
12011}
12012
12013},{}],65:[function(_dereq_,module,exports){
12014var Point = _dereq_('./point')
12015var Curve = _dereq_('./curve')
12016
12017var getCurveByName = _dereq_('./names')
12018
12019module.exports = {
12020 Curve: Curve,
12021 Point: Point,
12022 getCurveByName: getCurveByName
12023}
12024
12025},{"./curve":63,"./names":66,"./point":67}],66:[function(_dereq_,module,exports){
12026var BigInteger = _dereq_('bigi')
12027
12028var curves = _dereq_('./curves')
12029var Curve = _dereq_('./curve')
12030
12031function getCurveByName(name) {
12032 var curve = curves[name]
12033 if (!curve) return null
12034
12035 var p = new BigInteger(curve.p, 16)
12036 var a = new BigInteger(curve.a, 16)
12037 var b = new BigInteger(curve.b, 16)
12038 var n = new BigInteger(curve.n, 16)
12039 var h = new BigInteger(curve.h, 16)
12040 var Gx = new BigInteger(curve.Gx, 16)
12041 var Gy = new BigInteger(curve.Gy, 16)
12042
12043 return new Curve(p, a, b, Gx, Gy, n, h)
12044}
12045
12046module.exports = getCurveByName
12047
12048},{"./curve":63,"./curves":64,"bigi":3}],67:[function(_dereq_,module,exports){
12049(function (Buffer){
12050var assert = _dereq_('assert')
12051var BigInteger = _dereq_('bigi')
12052
12053var THREE = BigInteger.valueOf(3)
12054
12055function Point(curve, x, y, z) {
12056 assert.notStrictEqual(z, undefined, 'Missing Z coordinate')
12057
12058 this.curve = curve
12059 this.x = x
12060 this.y = y
12061 this.z = z
12062 this._zInv = null
12063
12064 this.compressed = true
12065}
12066
12067Object.defineProperty(Point.prototype, 'zInv', {
12068 get: function() {
12069 if (this._zInv === null) {
12070 this._zInv = this.z.modInverse(this.curve.p)
12071 }
12072
12073 return this._zInv
12074 }
12075})
12076
12077Object.defineProperty(Point.prototype, 'affineX', {
12078 get: function() {
12079 return this.x.multiply(this.zInv).mod(this.curve.p)
12080 }
12081})
12082
12083Object.defineProperty(Point.prototype, 'affineY', {
12084 get: function() {
12085 return this.y.multiply(this.zInv).mod(this.curve.p)
12086 }
12087})
12088
12089Point.fromAffine = function(curve, x, y) {
12090 return new Point(curve, x, y, BigInteger.ONE)
12091}
12092
12093Point.prototype.equals = function(other) {
12094 if (other === this) return true
12095 if (this.curve.isInfinity(this)) return this.curve.isInfinity(other)
12096 if (this.curve.isInfinity(other)) return this.curve.isInfinity(this)
12097
12098 // u = Y2 * Z1 - Y1 * Z2
12099 var u = other.y.multiply(this.z).subtract(this.y.multiply(other.z)).mod(this.curve.p)
12100
12101 if (u.signum() !== 0) return false
12102
12103 // v = X2 * Z1 - X1 * Z2
12104 var v = other.x.multiply(this.z).subtract(this.x.multiply(other.z)).mod(this.curve.p)
12105
12106 return v.signum() === 0
12107}
12108
12109Point.prototype.negate = function() {
12110 var y = this.curve.p.subtract(this.y)
12111
12112 return new Point(this.curve, this.x, y, this.z)
12113}
12114
12115Point.prototype.add = function(b) {
12116 if (this.curve.isInfinity(this)) return b
12117 if (this.curve.isInfinity(b)) return this
12118
12119 var x1 = this.x
12120 var y1 = this.y
12121 var x2 = b.x
12122 var y2 = b.y
12123
12124 // u = Y2 * Z1 - Y1 * Z2
12125 var u = y2.multiply(this.z).subtract(y1.multiply(b.z)).mod(this.curve.p)
12126 // v = X2 * Z1 - X1 * Z2
12127 var v = x2.multiply(this.z).subtract(x1.multiply(b.z)).mod(this.curve.p)
12128
12129 if (v.signum() === 0) {
12130 if (u.signum() === 0) {
12131 return this.twice() // this == b, so double
12132 }
12133
12134 return this.curve.infinity // this = -b, so infinity
12135 }
12136
12137 var v2 = v.square()
12138 var v3 = v2.multiply(v)
12139 var x1v2 = x1.multiply(v2)
12140 var zu2 = u.square().multiply(this.z)
12141
12142 // x3 = v * (z2 * (z1 * u^2 - 2 * x1 * v^2) - v^3)
12143 var x3 = zu2.subtract(x1v2.shiftLeft(1)).multiply(b.z).subtract(v3).multiply(v).mod(this.curve.p)
12144 // y3 = z2 * (3 * x1 * u * v^2 - y1 * v^3 - z1 * u^3) + u * v^3
12145 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)
12146 // z3 = v^3 * z1 * z2
12147 var z3 = v3.multiply(this.z).multiply(b.z).mod(this.curve.p)
12148
12149 return new Point(this.curve, x3, y3, z3)
12150}
12151
12152Point.prototype.twice = function() {
12153 if (this.curve.isInfinity(this)) return this
12154 if (this.y.signum() === 0) return this.curve.infinity
12155
12156 var x1 = this.x
12157 var y1 = this.y
12158
12159 var y1z1 = y1.multiply(this.z)
12160 var y1sqz1 = y1z1.multiply(y1).mod(this.curve.p)
12161 var a = this.curve.a
12162
12163 // w = 3 * x1^2 + a * z1^2
12164 var w = x1.square().multiply(THREE)
12165
12166 if (a.signum() !== 0) {
12167 w = w.add(this.z.square().multiply(a))
12168 }
12169
12170 w = w.mod(this.curve.p)
12171 // x3 = 2 * y1 * z1 * (w^2 - 8 * x1 * y1^2 * z1)
12172 var x3 = w.square().subtract(x1.shiftLeft(3).multiply(y1sqz1)).shiftLeft(1).multiply(y1z1).mod(this.curve.p)
12173 // y3 = 4 * y1^2 * z1 * (3 * w * x1 - 2 * y1^2 * z1) - w^3
12174 var y3 = w.multiply(THREE).multiply(x1).subtract(y1sqz1.shiftLeft(1)).shiftLeft(2).multiply(y1sqz1).subtract(w.pow(3)).mod(this.curve.p)
12175 // z3 = 8 * (y1 * z1)^3
12176 var z3 = y1z1.pow(3).shiftLeft(3).mod(this.curve.p)
12177
12178 return new Point(this.curve, x3, y3, z3)
12179}
12180
12181// Simple NAF (Non-Adjacent Form) multiplication algorithm
12182// TODO: modularize the multiplication algorithm
12183Point.prototype.multiply = function(k) {
12184 if (this.curve.isInfinity(this)) return this
12185 if (k.signum() === 0) return this.curve.infinity
12186
12187 var e = k
12188 var h = e.multiply(THREE)
12189
12190 var neg = this.negate()
12191 var R = this
12192
12193 for (var i = h.bitLength() - 2; i > 0; --i) {
12194 R = R.twice()
12195
12196 var hBit = h.testBit(i)
12197 var eBit = e.testBit(i)
12198
12199 if (hBit != eBit) {
12200 R = R.add(hBit ? this : neg)
12201 }
12202 }
12203
12204 return R
12205}
12206
12207// Compute this*j + x*k (simultaneous multiplication)
12208Point.prototype.multiplyTwo = function(j, x, k) {
12209 var i
12210
12211 if (j.bitLength() > k.bitLength())
12212 i = j.bitLength() - 1
12213 else
12214 i = k.bitLength() - 1
12215
12216 var R = this.curve.infinity
12217 var both = this.add(x)
12218
12219 while (i >= 0) {
12220 R = R.twice()
12221
12222 var jBit = j.testBit(i)
12223 var kBit = k.testBit(i)
12224
12225 if (jBit) {
12226 if (kBit) {
12227 R = R.add(both)
12228
12229 } else {
12230 R = R.add(this)
12231 }
12232
12233 } else {
12234 if (kBit) {
12235 R = R.add(x)
12236 }
12237 }
12238 --i
12239 }
12240
12241 return R
12242}
12243
12244Point.prototype.getEncoded = function(compressed) {
12245 if (compressed == undefined) compressed = this.compressed
12246 if (this.curve.isInfinity(this)) return new Buffer('00', 'hex') // Infinity point encoded is simply '00'
12247
12248 var x = this.affineX
12249 var y = this.affineY
12250
12251 var buffer
12252
12253 // Determine size of q in bytes
12254 var byteLength = Math.floor((this.curve.p.bitLength() + 7) / 8)
12255
12256 // 0x02/0x03 | X
12257 if (compressed) {
12258 buffer = new Buffer(1 + byteLength)
12259 buffer.writeUInt8(y.isEven() ? 0x02 : 0x03, 0)
12260
12261 // 0x04 | X | Y
12262 } else {
12263 buffer = new Buffer(1 + byteLength + byteLength)
12264 buffer.writeUInt8(0x04, 0)
12265
12266 y.toBuffer(byteLength).copy(buffer, 1 + byteLength)
12267 }
12268
12269 x.toBuffer(byteLength).copy(buffer, 1)
12270
12271 return buffer
12272}
12273
12274Point.decodeFrom = function(curve, buffer) {
12275 var type = buffer.readUInt8(0)
12276 var compressed = (type !== 4)
12277
12278 var x = BigInteger.fromBuffer(buffer.slice(1, 33))
12279 var byteLength = Math.floor((curve.p.bitLength() + 7) / 8)
12280
12281 var Q
12282 if (compressed) {
12283 assert.equal(buffer.length, byteLength + 1, 'Invalid sequence length')
12284 assert(type === 0x02 || type === 0x03, 'Invalid sequence tag')
12285
12286 var isOdd = (type === 0x03)
12287 Q = curve.pointFromX(isOdd, x)
12288
12289 } else {
12290 assert.equal(buffer.length, 1 + byteLength + byteLength, 'Invalid sequence length')
12291
12292 var y = BigInteger.fromBuffer(buffer.slice(1 + byteLength))
12293 Q = Point.fromAffine(curve, x, y)
12294 }
12295
12296 Q.compressed = compressed
12297 return Q
12298}
12299
12300Point.prototype.toString = function () {
12301 if (this.curve.isInfinity(this)) return '(INFINITY)'
12302
12303 return '(' + this.affineX.toString() + ',' + this.affineY.toString() + ')'
12304}
12305
12306module.exports = Point
12307
12308}).call(this,_dereq_("buffer").Buffer)
12309},{"assert":4,"bigi":3,"buffer":8}],68:[function(_dereq_,module,exports){
12310(function (process,Buffer){
12311// Closure compiler error - result of 'not' operator not being used
12312//!function(globals){
12313(function(globals){
12314'use strict'
12315
12316//*** UMD BEGIN
12317if (typeof define !== 'undefined' && define.amd) { //require.js / AMD
12318 define([], function() {
12319 return secureRandom
12320 })
12321} else if (typeof module !== 'undefined' && module.exports) { //CommonJS
12322 module.exports = secureRandom
12323} else { //script / browser
12324 globals.secureRandom = secureRandom
12325}
12326//*** UMD END
12327
12328//options.type is the only valid option
12329function secureRandom(count, options) {
12330 options = options || {type: 'Array'}
12331 //we check for process.pid to prevent browserify from tricking us
12332 if (typeof process != 'undefined' && typeof process.pid == 'number') {
12333 return nodeRandom(count, options)
12334 } else {
12335 var crypto = window.crypto || window.msCrypto
12336 if (!crypto) throw new Error("Your browser does not support window.crypto.")
12337 return browserRandom(count, options)
12338 }
12339}
12340
12341function nodeRandom(count, options) {
12342 var crypto = _dereq_('crypto')
12343 var buf = crypto.randomBytes(count)
12344
12345 switch (options.type) {
12346 case 'Array':
12347 return [].slice.call(buf)
12348 case 'Buffer':
12349 return buf
12350 case 'Uint8Array':
12351 var arr = new Uint8Array(count)
12352 for (var i = 0; i < count; ++i) { arr[i] = buf.readUInt8(i) }
12353 return arr
12354 default:
12355 throw new Error(options.type + " is unsupported.")
12356 }
12357}
12358
12359function browserRandom(count, options) {
12360 var nativeArr = new Uint8Array(count)
12361 var crypto = window.crypto || window.msCrypto
12362 crypto.getRandomValues(nativeArr)
12363
12364 switch (options.type) {
12365 case 'Array':
12366 return [].slice.call(nativeArr)
12367 case 'Buffer':
12368 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.')}
12369 return new Buffer(nativeArr)
12370 case 'Uint8Array':
12371 return nativeArr
12372 default:
12373 throw new Error(options.type + " is unsupported.")
12374 }
12375}
12376
12377secureRandom.randomArray = function(byteCount) {
12378 return secureRandom(byteCount, {type: 'Array'})
12379}
12380
12381secureRandom.randomUint8Array = function(byteCount) {
12382 return secureRandom(byteCount, {type: 'Uint8Array'})
12383}
12384
12385secureRandom.randomBuffer = function(byteCount) {
12386 return secureRandom(byteCount, {type: 'Buffer'})
12387}
12388
12389
12390})(this);
12391
12392}).call(this,_dereq_("FWaASH"),_dereq_("buffer").Buffer)
12393},{"FWaASH":12,"buffer":8,"crypto":7}],69:[function(_dereq_,module,exports){
12394(function (Buffer){
12395var assert = _dereq_('assert')
12396var base58check = _dereq_('./base58check')
12397var networks = _dereq_('./networks')
12398var scripts = _dereq_('./scripts')
12399
12400function findScriptTypeByVersion(version) {
12401 for (var networkName in networks) {
12402 var network = networks[networkName]
12403
12404 if (version === network.pubKeyHash) return 'pubkeyhash'
12405 if (version === network.scriptHash) return 'scripthash'
12406 }
12407}
12408
12409function Address(hash, version) {
12410 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
12411 assert.strictEqual(hash.length, 20, 'Invalid hash length')
12412 assert.strictEqual(version & 0xff, version, 'Invalid version byte')
12413
12414 this.hash = hash
12415 this.version = version
12416}
12417
12418// Import functions
12419Address.fromBase58Check = function(string) {
12420 var payload = base58check.decode(string)
12421 var version = payload.readUInt8(0)
12422 var hash = payload.slice(1)
12423
12424 return new Address(hash, version)
12425}
12426
12427Address.fromOutputScript = function(script, network) {
12428 network = network || networks.bitcoin
12429
12430 var type = scripts.classifyOutput(script)
12431
12432 if (type === 'pubkeyhash') return new Address(script.chunks[2], network.pubKeyHash)
12433 if (type === 'scripthash') return new Address(script.chunks[1], network.scriptHash)
12434
12435 assert(false, type + ' has no matching Address')
12436}
12437
12438// Export functions
12439Address.prototype.toBase58Check = function () {
12440 var payload = new Buffer(21)
12441 payload.writeUInt8(this.version, 0)
12442 this.hash.copy(payload, 1)
12443
12444 return base58check.encode(payload)
12445}
12446
12447Address.prototype.toOutputScript = function() {
12448 var scriptType = findScriptTypeByVersion(this.version)
12449
12450 if (scriptType === 'pubkeyhash') return scripts.pubKeyHashOutput(this.hash)
12451 if (scriptType === 'scripthash') return scripts.scriptHashOutput(this.hash)
12452
12453 assert(false, this.toString() + ' has no matching Script')
12454}
12455
12456Address.prototype.toString = Address.prototype.toBase58Check
12457
12458module.exports = Address
12459
12460}).call(this,_dereq_("buffer").Buffer)
12461},{"./base58check":70,"./networks":81,"./scripts":84,"assert":4,"buffer":8}],70:[function(_dereq_,module,exports){
12462(function (Buffer){
12463// https://en.bitcoin.it/wiki/Base58Check_encoding
12464var assert = _dereq_('assert')
12465var base58 = _dereq_('bs58')
12466var crypto = _dereq_('./crypto')
12467
12468// Encode a buffer as a base58-check-encoded string
12469function encode(payload) {
12470 var checksum = crypto.hash256(payload).slice(0, 4)
12471
12472 return base58.encode(Buffer.concat([
12473 payload,
12474 checksum
12475 ]))
12476}
12477
12478// Decode a base58-check-encoded string to a buffer
12479function decode(string) {
12480 var buffer = base58.decode(string)
12481
12482 var payload = buffer.slice(0, -4)
12483 var checksum = buffer.slice(-4)
12484 var newChecksum = crypto.hash256(payload).slice(0, 4)
12485
12486 assert.deepEqual(newChecksum, checksum, 'Invalid checksum')
12487
12488 return payload
12489}
12490
12491module.exports = {
12492 encode: encode,
12493 decode: decode
12494}
12495
12496}).call(this,_dereq_("buffer").Buffer)
12497},{"./crypto":73,"assert":4,"bs58":15,"buffer":8}],71:[function(_dereq_,module,exports){
12498var assert = _dereq_('assert')
12499var opcodes = _dereq_('./opcodes')
12500
12501// https://github.com/feross/buffer/blob/master/index.js#L1127
12502function verifuint(value, max) {
12503 assert(typeof value === 'number', 'cannot write a non-number as a number')
12504 assert(value >= 0, 'specified a negative value for writing an unsigned value')
12505 assert(value <= max, 'value is larger than maximum value for type')
12506 assert(Math.floor(value) === value, 'value has a fractional component')
12507}
12508
12509function pushDataSize(i) {
12510 return i < opcodes.OP_PUSHDATA1 ? 1
12511 : i < 0xff ? 2
12512 : i < 0xffff ? 3
12513 : 5
12514}
12515
12516function readPushDataInt(buffer, offset) {
12517 var opcode = buffer.readUInt8(offset)
12518 var number, size
12519
12520 // ~6 bit
12521 if (opcode < opcodes.OP_PUSHDATA1) {
12522 number = opcode
12523 size = 1
12524
12525 // 8 bit
12526 } else if (opcode === opcodes.OP_PUSHDATA1) {
12527 number = buffer.readUInt8(offset + 1)
12528 size = 2
12529
12530 // 16 bit
12531 } else if (opcode === opcodes.OP_PUSHDATA2) {
12532 number = buffer.readUInt16LE(offset + 1)
12533 size = 3
12534
12535 // 32 bit
12536 } else {
12537 assert.equal(opcode, opcodes.OP_PUSHDATA4, 'Unexpected opcode')
12538
12539 number = buffer.readUInt32LE(offset + 1)
12540 size = 5
12541
12542 }
12543
12544 return {
12545 opcode: opcode,
12546 number: number,
12547 size: size
12548 }
12549}
12550
12551function readUInt64LE(buffer, offset) {
12552 var a = buffer.readUInt32LE(offset)
12553 var b = buffer.readUInt32LE(offset + 4)
12554 b *= 0x100000000
12555
12556 verifuint(b + a, 0x001fffffffffffff)
12557
12558 return b + a
12559}
12560
12561function readVarInt(buffer, offset) {
12562 var t = buffer.readUInt8(offset)
12563 var number, size
12564
12565 // 8 bit
12566 if (t < 253) {
12567 number = t
12568 size = 1
12569
12570 // 16 bit
12571 } else if (t < 254) {
12572 number = buffer.readUInt16LE(offset + 1)
12573 size = 3
12574
12575 // 32 bit
12576 } else if (t < 255) {
12577 number = buffer.readUInt32LE(offset + 1)
12578 size = 5
12579
12580 // 64 bit
12581 } else {
12582 number = readUInt64LE(buffer, offset + 1)
12583 size = 9
12584 }
12585
12586 return {
12587 number: number,
12588 size: size
12589 }
12590}
12591
12592function writePushDataInt(buffer, number, offset) {
12593 var size = pushDataSize(number)
12594
12595 // ~6 bit
12596 if (size === 1) {
12597 buffer.writeUInt8(number, offset)
12598
12599 // 8 bit
12600 } else if (size === 2) {
12601 buffer.writeUInt8(opcodes.OP_PUSHDATA1, offset)
12602 buffer.writeUInt8(number, offset + 1)
12603
12604 // 16 bit
12605 } else if (size === 3) {
12606 buffer.writeUInt8(opcodes.OP_PUSHDATA2, offset)
12607 buffer.writeUInt16LE(number, offset + 1)
12608
12609 // 32 bit
12610 } else {
12611 buffer.writeUInt8(opcodes.OP_PUSHDATA4, offset)
12612 buffer.writeUInt32LE(number, offset + 1)
12613
12614 }
12615
12616 return size
12617}
12618
12619function writeUInt64LE(buffer, value, offset) {
12620 verifuint(value, 0x001fffffffffffff)
12621
12622 buffer.writeInt32LE(value & -1, offset)
12623 buffer.writeUInt32LE(Math.floor(value / 0x100000000), offset + 4)
12624}
12625
12626function varIntSize(i) {
12627 return i < 253 ? 1
12628 : i < 0x10000 ? 3
12629 : i < 0x100000000 ? 5
12630 : 9
12631}
12632
12633function writeVarInt(buffer, number, offset) {
12634 var size = varIntSize(number)
12635
12636 // 8 bit
12637 if (size === 1) {
12638 buffer.writeUInt8(number, offset)
12639
12640 // 16 bit
12641 } else if (size === 3) {
12642 buffer.writeUInt8(253, offset)
12643 buffer.writeUInt16LE(number, offset + 1)
12644
12645 // 32 bit
12646 } else if (size === 5) {
12647 buffer.writeUInt8(254, offset)
12648 buffer.writeUInt32LE(number, offset + 1)
12649
12650 // 64 bit
12651 } else {
12652 buffer.writeUInt8(255, offset)
12653 writeUInt64LE(buffer, number, offset + 1)
12654 }
12655
12656 return size
12657}
12658
12659module.exports = {
12660 pushDataSize: pushDataSize,
12661 readPushDataInt: readPushDataInt,
12662 readUInt64LE: readUInt64LE,
12663 readVarInt: readVarInt,
12664 varIntSize: varIntSize,
12665 writePushDataInt: writePushDataInt,
12666 writeUInt64LE: writeUInt64LE,
12667 writeVarInt: writeVarInt
12668}
12669
12670},{"./opcodes":82,"assert":4}],72:[function(_dereq_,module,exports){
12671(function (Buffer){
12672var assert = _dereq_('assert')
12673var Crypto = _dereq_('crypto-js')
12674var WordArray = Crypto.lib.WordArray
12675
12676function bufferToWordArray(buffer) {
12677 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got', buffer)
12678
12679 var words = []
12680 for (var i = 0, b = 0; i < buffer.length; i++, b += 8) {
12681 words[b >>> 5] |= buffer[i] << (24 - b % 32)
12682 }
12683
12684 return new WordArray.init(words, buffer.length)
12685}
12686
12687function wordArrayToBuffer(wordArray) {
12688 assert(Array.isArray(wordArray.words), 'Expected WordArray, got' + wordArray)
12689
12690 var words = wordArray.words
12691 var buffer = new Buffer(words.length * 4)
12692
12693 words.forEach(function(value, i) {
12694 buffer.writeInt32BE(value & -1, i * 4)
12695 })
12696
12697 return buffer
12698}
12699
12700module.exports = {
12701 bufferToWordArray: bufferToWordArray,
12702 wordArrayToBuffer: wordArrayToBuffer
12703}
12704
12705}).call(this,_dereq_("buffer").Buffer)
12706},{"assert":4,"buffer":8,"crypto-js":37}],73:[function(_dereq_,module,exports){
12707(function (Buffer){
12708// Crypto, crypto, where art thou crypto
12709var assert = _dereq_('assert')
12710var CryptoJS = _dereq_('crypto-js')
12711var crypto = _dereq_('crypto')
12712var convert = _dereq_('./convert')
12713
12714function hash160(buffer) {
12715 return ripemd160(sha256(buffer))
12716}
12717
12718function hash256(buffer) {
12719 return sha256(sha256(buffer))
12720}
12721
12722function ripemd160(buffer) {
12723 return crypto.createHash('rmd160').update(buffer).digest()
12724}
12725
12726function sha1(buffer) {
12727 return crypto.createHash('sha1').update(buffer).digest()
12728}
12729
12730function sha256(buffer) {
12731 return crypto.createHash('sha256').update(buffer).digest()
12732}
12733
12734// FIXME: Name not consistent with others
12735function HmacSHA256(buffer, secret) {
12736 return crypto.createHmac('sha256', secret).update(buffer).digest()
12737}
12738
12739function HmacSHA512(data, secret) {
12740 assert(Buffer.isBuffer(data), 'Expected Buffer for data, got ' + data)
12741 assert(Buffer.isBuffer(secret), 'Expected Buffer for secret, got ' + secret)
12742
12743 var dataWords = convert.bufferToWordArray(data)
12744 var secretWords = convert.bufferToWordArray(secret)
12745
12746 var hash = CryptoJS.HmacSHA512(dataWords, secretWords)
12747
12748 return convert.wordArrayToBuffer(hash)
12749}
12750
12751module.exports = {
12752 ripemd160: ripemd160,
12753 sha1: sha1,
12754 sha256: sha256,
12755 hash160: hash160,
12756 hash256: hash256,
12757 HmacSHA256: HmacSHA256,
12758 HmacSHA512: HmacSHA512
12759}
12760
12761}).call(this,_dereq_("buffer").Buffer)
12762},{"./convert":72,"assert":4,"buffer":8,"crypto":19,"crypto-js":37}],74:[function(_dereq_,module,exports){
12763(function (Buffer){
12764var assert = _dereq_('assert')
12765var crypto = _dereq_('./crypto')
12766
12767var BigInteger = _dereq_('bigi')
12768var ECSignature = _dereq_('./ecsignature')
12769var Point = _dereq_('ecurve').Point
12770
12771// https://tools.ietf.org/html/rfc6979#section-3.2
12772function deterministicGenerateK(curve, hash, d) {
12773 assert(Buffer.isBuffer(hash), 'Hash must be a Buffer, not ' + hash)
12774 assert.equal(hash.length, 32, 'Hash must be 256 bit')
12775 assert(d instanceof BigInteger, 'Private key must be a BigInteger')
12776
12777 var x = d.toBuffer(32)
12778 var k = new Buffer(32)
12779 var v = new Buffer(32)
12780
12781 // Step B
12782 v.fill(1)
12783
12784 // Step C
12785 k.fill(0)
12786
12787 // Step D
12788 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0]), x, hash]), k)
12789
12790 // Step E
12791 v = crypto.HmacSHA256(v, k)
12792
12793 // Step F
12794 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([1]), x, hash]), k)
12795
12796 // Step G
12797 v = crypto.HmacSHA256(v, k)
12798
12799 // Step H1/H2a, ignored as tlen === qlen (256 bit)
12800 // Step H2b
12801 v = crypto.HmacSHA256(v, k)
12802
12803 var T = BigInteger.fromBuffer(v)
12804
12805 // Step H3, repeat until T is within the interval [1, n - 1]
12806 while ((T.signum() <= 0) || (T.compareTo(curve.n) >= 0)) {
12807 k = crypto.HmacSHA256(Buffer.concat([v, new Buffer([0])]), k)
12808 v = crypto.HmacSHA256(v, k)
12809
12810 T = BigInteger.fromBuffer(v)
12811 }
12812
12813 return T
12814}
12815
12816function sign(curve, hash, d) {
12817 var k = deterministicGenerateK(curve, hash, d)
12818
12819 var n = curve.n
12820 var G = curve.G
12821 var Q = G.multiply(k)
12822 var e = BigInteger.fromBuffer(hash)
12823
12824 var r = Q.affineX.mod(n)
12825 assert.notEqual(r.signum(), 0, 'Invalid R value')
12826
12827 var s = k.modInverse(n).multiply(e.add(d.multiply(r))).mod(n)
12828 assert.notEqual(s.signum(), 0, 'Invalid S value')
12829
12830 var N_OVER_TWO = n.shiftRight(1)
12831
12832 // enforce low S values, see bip62: 'low s values in signatures'
12833 if (s.compareTo(N_OVER_TWO) > 0) {
12834 s = n.subtract(s)
12835 }
12836
12837 return new ECSignature(r, s)
12838}
12839
12840function verify(curve, hash, signature, Q) {
12841 var e = BigInteger.fromBuffer(hash)
12842
12843 return verifyRaw(curve, e, signature, Q)
12844}
12845
12846function verifyRaw(curve, e, signature, Q) {
12847 var n = curve.n
12848 var G = curve.G
12849
12850 var r = signature.r
12851 var s = signature.s
12852
12853 if (r.signum() === 0 || r.compareTo(n) >= 0) return false
12854 if (s.signum() === 0 || s.compareTo(n) >= 0) return false
12855
12856 var c = s.modInverse(n)
12857
12858 var u1 = e.multiply(c).mod(n)
12859 var u2 = r.multiply(c).mod(n)
12860
12861 var point = G.multiplyTwo(u1, Q, u2)
12862 var v = point.affineX.mod(n)
12863
12864 return v.equals(r)
12865}
12866
12867/**
12868 * Recover a public key from a signature.
12869 *
12870 * See SEC 1: Elliptic Curve Cryptography, section 4.1.6, "Public
12871 * Key Recovery Operation".
12872 *
12873 * http://www.secg.org/download/aid-780/sec1-v2.pdf
12874 */
12875function recoverPubKey(curve, e, signature, i) {
12876 assert.strictEqual(i & 3, i, 'Recovery param is more than two bits')
12877
12878 var r = signature.r
12879 var s = signature.s
12880
12881 // A set LSB signifies that the y-coordinate is odd
12882 var isYOdd = i & 1
12883
12884 // The more significant bit specifies whether we should use the
12885 // first or second candidate key.
12886 var isSecondKey = i >> 1
12887
12888 var n = curve.n
12889 var G = curve.G
12890
12891 // 1.1 Let x = r + jn
12892 var x = isSecondKey ? r.add(n) : r
12893 var R = curve.pointFromX(isYOdd, x)
12894
12895 // 1.4 Check that nR is at infinity
12896 var nR = R.multiply(n)
12897 assert(curve.isInfinity(nR), 'nR is not a valid curve point')
12898
12899 // Compute -e from e
12900 var eNeg = e.negate().mod(n)
12901
12902 // 1.6.1 Compute Q = r^-1 (sR - eG)
12903 // Q = r^-1 (sR + -eG)
12904 var rInv = r.modInverse(n)
12905
12906 var Q = R.multiplyTwo(s, G, eNeg).multiply(rInv)
12907 curve.validate(Q)
12908
12909 return Q
12910}
12911
12912/**
12913 * Calculate pubkey extraction parameter.
12914 *
12915 * When extracting a pubkey from a signature, we have to
12916 * distinguish four different cases. Rather than putting this
12917 * burden on the verifier, Bitcoin includes a 2-bit value with the
12918 * signature.
12919 *
12920 * This function simply tries all four cases and returns the value
12921 * that resulted in a successful pubkey recovery.
12922 */
12923function calcPubKeyRecoveryParam(curve, e, signature, Q) {
12924 for (var i = 0; i < 4; i++) {
12925 var Qprime = recoverPubKey(curve, e, signature, i)
12926
12927 // 1.6.2 Verify Q
12928 if (Qprime.equals(Q)) {
12929 return i
12930 }
12931 }
12932
12933 throw new Error('Unable to find valid recovery factor')
12934}
12935
12936module.exports = {
12937 calcPubKeyRecoveryParam: calcPubKeyRecoveryParam,
12938 deterministicGenerateK: deterministicGenerateK,
12939 recoverPubKey: recoverPubKey,
12940 sign: sign,
12941 verify: verify,
12942 verifyRaw: verifyRaw
12943}
12944
12945}).call(this,_dereq_("buffer").Buffer)
12946},{"./crypto":73,"./ecsignature":77,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],75:[function(_dereq_,module,exports){
12947(function (Buffer){
12948var assert = _dereq_('assert')
12949var base58check = _dereq_('./base58check')
12950var ecdsa = _dereq_('./ecdsa')
12951var networks = _dereq_('./networks')
12952var secureRandom = _dereq_('secure-random')
12953
12954var BigInteger = _dereq_('bigi')
12955var ECPubKey = _dereq_('./ecpubkey')
12956
12957var ecurve = _dereq_('ecurve')
12958var curve = ecurve.getCurveByName('secp256k1')
12959
12960function ECKey(d, compressed) {
12961 assert(d.signum() > 0, 'Private key must be greater than 0')
12962 assert(d.compareTo(curve.n) < 0, 'Private key must be less than the curve order')
12963
12964 var Q = curve.G.multiply(d)
12965
12966 this.d = d
12967 this.pub = new ECPubKey(Q, compressed)
12968}
12969
12970// Static constructors
12971ECKey.fromWIF = function(string) {
12972 var payload = base58check.decode(string)
12973 var compressed = false
12974
12975 // Ignore the version byte
12976 payload = payload.slice(1)
12977
12978 if (payload.length === 33) {
12979 assert.strictEqual(payload[32], 0x01, 'Invalid compression flag')
12980
12981 // Truncate the compression flag
12982 payload = payload.slice(0, -1)
12983 compressed = true
12984 }
12985
12986 assert.equal(payload.length, 32, 'Invalid WIF payload length')
12987
12988 var d = BigInteger.fromBuffer(payload)
12989 return new ECKey(d, compressed)
12990}
12991
12992ECKey.makeRandom = function(compressed, rng) {
12993 rng = rng || secureRandom.randomBuffer
12994
12995 var buffer = rng(32)
12996 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
12997
12998 var d = BigInteger.fromBuffer(buffer)
12999 d = d.mod(curve.n)
13000
13001 return new ECKey(d, compressed)
13002}
13003
13004// Export functions
13005ECKey.prototype.toWIF = function(network) {
13006 network = network || networks.bitcoin
13007
13008 var bufferLen = this.pub.compressed ? 34 : 33
13009 var buffer = new Buffer(bufferLen)
13010
13011 buffer.writeUInt8(network.wif, 0)
13012 this.d.toBuffer(32).copy(buffer, 1)
13013
13014 if (this.pub.compressed) {
13015 buffer.writeUInt8(0x01, 33)
13016 }
13017
13018 return base58check.encode(buffer)
13019}
13020
13021// Operations
13022ECKey.prototype.sign = function(hash) {
13023 return ecdsa.sign(curve, hash, this.d)
13024}
13025
13026module.exports = ECKey
13027
13028}).call(this,_dereq_("buffer").Buffer)
13029},{"./base58check":70,"./ecdsa":74,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65,"secure-random":68}],76:[function(_dereq_,module,exports){
13030(function (Buffer){
13031var assert = _dereq_('assert')
13032var crypto = _dereq_('./crypto')
13033var ecdsa = _dereq_('./ecdsa')
13034var networks = _dereq_('./networks')
13035
13036var Address = _dereq_('./address')
13037
13038var ecurve = _dereq_('ecurve')
13039var curve = ecurve.getCurveByName('secp256k1')
13040
13041function ECPubKey(Q, compressed) {
13042 assert(Q instanceof ecurve.Point, 'Expected Point, got ' + Q)
13043
13044 if (compressed == undefined) compressed = true
13045 assert.strictEqual(typeof compressed, 'boolean', 'Expected boolean, got ' + compressed)
13046
13047 this.compressed = compressed
13048 this.Q = Q
13049}
13050
13051// Static constructors
13052ECPubKey.fromBuffer = function(buffer) {
13053 var Q = ecurve.Point.decodeFrom(curve, buffer)
13054 return new ECPubKey(Q, Q.compressed)
13055}
13056
13057ECPubKey.fromHex = function(hex) {
13058 return ECPubKey.fromBuffer(new Buffer(hex, 'hex'))
13059}
13060
13061// Operations
13062ECPubKey.prototype.getAddress = function(network) {
13063 network = network || networks.bitcoin
13064
13065 return new Address(crypto.hash160(this.toBuffer()), network.pubKeyHash)
13066}
13067
13068ECPubKey.prototype.verify = function(hash, signature) {
13069 return ecdsa.verify(curve, hash, signature, this.Q)
13070}
13071
13072// Export functions
13073ECPubKey.prototype.toBuffer = function() {
13074 return this.Q.getEncoded(this.compressed)
13075}
13076
13077ECPubKey.prototype.toHex = function() {
13078 return this.toBuffer().toString('hex')
13079}
13080
13081module.exports = ECPubKey
13082
13083}).call(this,_dereq_("buffer").Buffer)
13084},{"./address":69,"./crypto":73,"./ecdsa":74,"./networks":81,"assert":4,"buffer":8,"ecurve":65}],77:[function(_dereq_,module,exports){
13085(function (Buffer){
13086var assert = _dereq_('assert')
13087var BigInteger = _dereq_('bigi')
13088
13089function ECSignature(r, s) {
13090 assert(r instanceof BigInteger, 'Expected BigInteger, got ' + r)
13091 assert(s instanceof BigInteger, 'Expected BigInteger, got ' + s)
13092 this.r = r
13093 this.s = s
13094}
13095
13096// Import operations
13097ECSignature.parseCompact = function(buffer) {
13098 assert.equal(buffer.length, 65, 'Invalid signature length')
13099 var i = buffer.readUInt8(0) - 27
13100
13101 // At most 3 bits
13102 assert.equal(i, i & 7, 'Invalid signature parameter')
13103 var compressed = !!(i & 4)
13104
13105 // Recovery param only
13106 i = i & 3
13107
13108 var r = BigInteger.fromBuffer(buffer.slice(1, 33))
13109 var s = BigInteger.fromBuffer(buffer.slice(33))
13110
13111 return {
13112 compressed: compressed,
13113 i: i,
13114 signature: new ECSignature(r, s)
13115 }
13116}
13117
13118ECSignature.fromDER = function(buffer) {
13119 assert.equal(buffer.readUInt8(0), 0x30, 'Not a DER sequence')
13120 assert.equal(buffer.readUInt8(1), buffer.length - 2, 'Invalid sequence length')
13121 assert.equal(buffer.readUInt8(2), 0x02, 'Expected a DER integer')
13122
13123 var rLen = buffer.readUInt8(3)
13124 assert(rLen > 0, 'R length is zero')
13125
13126 var offset = 4 + rLen
13127 assert.equal(buffer.readUInt8(offset), 0x02, 'Expected a DER integer (2)')
13128
13129 var sLen = buffer.readUInt8(offset + 1)
13130 assert(sLen > 0, 'S length is zero')
13131
13132 var rB = buffer.slice(4, offset)
13133 var sB = buffer.slice(offset + 2)
13134 offset += 2 + sLen
13135
13136 if (rLen > 1 && rB.readUInt8(0) === 0x00) {
13137 assert(rB.readUInt8(1) & 0x80, 'R value excessively padded')
13138 }
13139
13140 if (sLen > 1 && sB.readUInt8(0) === 0x00) {
13141 assert(sB.readUInt8(1) & 0x80, 'S value excessively padded')
13142 }
13143
13144 assert.equal(offset, buffer.length, 'Invalid DER encoding')
13145 var r = BigInteger.fromDERInteger(rB)
13146 var s = BigInteger.fromDERInteger(sB)
13147
13148 assert(r.signum() >= 0, 'R value is negative')
13149 assert(s.signum() >= 0, 'S value is negative')
13150
13151 return new ECSignature(r, s)
13152}
13153
13154// FIXME: 0x00, 0x04, 0x80 are SIGHASH_* boundary constants, importing Transaction causes a circular dependency
13155ECSignature.parseScriptSignature = function(buffer) {
13156 var hashType = buffer.readUInt8(buffer.length - 1)
13157 var hashTypeMod = hashType & ~0x80
13158
13159 assert(hashTypeMod > 0x00 && hashTypeMod < 0x04, 'Invalid hashType')
13160
13161 return {
13162 signature: ECSignature.fromDER(buffer.slice(0, -1)),
13163 hashType: hashType
13164 }
13165}
13166
13167// Export operations
13168ECSignature.prototype.toCompact = function(i, compressed) {
13169 if (compressed) i += 4
13170 i += 27
13171
13172 var buffer = new Buffer(65)
13173 buffer.writeUInt8(i, 0)
13174
13175 this.r.toBuffer(32).copy(buffer, 1)
13176 this.s.toBuffer(32).copy(buffer, 33)
13177
13178 return buffer
13179}
13180
13181ECSignature.prototype.toDER = function() {
13182 var rBa = this.r.toDERInteger()
13183 var sBa = this.s.toDERInteger()
13184
13185 var sequence = []
13186 sequence.push(0x02) // INTEGER
13187 sequence.push(rBa.length)
13188 sequence = sequence.concat(rBa)
13189
13190 sequence.push(0x02) // INTEGER
13191 sequence.push(sBa.length)
13192 sequence = sequence.concat(sBa)
13193
13194 sequence.unshift(sequence.length)
13195 sequence.unshift(0x30) // SEQUENCE
13196
13197 return new Buffer(sequence)
13198}
13199
13200ECSignature.prototype.toScriptSignature = function(hashType) {
13201 var hashTypeBuffer = new Buffer(1)
13202 hashTypeBuffer.writeUInt8(hashType, 0)
13203
13204 return Buffer.concat([this.toDER(), hashTypeBuffer])
13205}
13206
13207module.exports = ECSignature
13208
13209}).call(this,_dereq_("buffer").Buffer)
13210},{"assert":4,"bigi":3,"buffer":8}],78:[function(_dereq_,module,exports){
13211(function (Buffer){
13212var assert = _dereq_('assert')
13213var base58check = _dereq_('./base58check')
13214var crypto = _dereq_('./crypto')
13215var networks = _dereq_('./networks')
13216
13217var BigInteger = _dereq_('bigi')
13218var ECKey = _dereq_('./eckey')
13219var ECPubKey = _dereq_('./ecpubkey')
13220
13221var ecurve = _dereq_('ecurve')
13222var curve = ecurve.getCurveByName('secp256k1')
13223
13224function findBIP32ParamsByVersion(version) {
13225 for (var name in networks) {
13226 var network = networks[name]
13227
13228 for (var type in network.bip32) {
13229 if (version != network.bip32[type]) continue
13230
13231 return {
13232 isPrivate: (type === 'private'),
13233 network: network
13234 }
13235 }
13236 }
13237
13238 assert(false, 'Could not find version ' + version.toString(16))
13239}
13240
13241function HDNode(K, chainCode, network) {
13242 network = network || networks.bitcoin
13243
13244 assert(Buffer.isBuffer(chainCode), 'Expected Buffer, got ' + chainCode)
13245 assert(network.bip32, 'Unknown BIP32 constants for network')
13246
13247 this.chainCode = chainCode
13248 this.depth = 0
13249 this.index = 0
13250 this.network = network
13251
13252 if (K instanceof BigInteger) {
13253 this.privKey = new ECKey(K, true)
13254 this.pubKey = this.privKey.pub
13255 } else {
13256 this.pubKey = new ECPubKey(K, true)
13257 }
13258}
13259
13260HDNode.MASTER_SECRET = new Buffer('Bitcoin seed')
13261HDNode.HIGHEST_BIT = 0x80000000
13262HDNode.LENGTH = 78
13263
13264HDNode.fromSeedBuffer = function(seed, network) {
13265 var I = crypto.HmacSHA512(seed, HDNode.MASTER_SECRET)
13266 var IL = I.slice(0, 32)
13267 var IR = I.slice(32)
13268
13269 // In case IL is 0 or >= n, the master key is invalid
13270 // This is handled by `new ECKey` in the HDNode constructor
13271 var pIL = BigInteger.fromBuffer(IL)
13272
13273 return new HDNode(pIL, IR, network)
13274}
13275
13276HDNode.fromSeedHex = function(hex, network) {
13277 return HDNode.fromSeedBuffer(new Buffer(hex, 'hex'), network)
13278}
13279
13280HDNode.fromBase58 = function(string) {
13281 return HDNode.fromBuffer(base58check.decode(string))
13282}
13283
13284HDNode.fromBuffer = function(buffer) {
13285 assert.strictEqual(buffer.length, HDNode.LENGTH, 'Invalid buffer length')
13286
13287 // 4 byte: version bytes
13288 var version = buffer.readUInt32BE(0)
13289 var params = findBIP32ParamsByVersion(version)
13290
13291 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ...
13292 var depth = buffer.readUInt8(4)
13293
13294 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13295 var parentFingerprint = buffer.readUInt32BE(5)
13296 if (depth === 0) {
13297 assert.strictEqual(parentFingerprint, 0x00000000, 'Invalid parent fingerprint')
13298 }
13299
13300 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13301 // This is encoded in MSB order. (0x00000000 if master key)
13302 var index = buffer.readUInt32BE(9)
13303 assert(depth > 0 || index === 0, 'Invalid index')
13304
13305 // 32 bytes: the chain code
13306 var chainCode = buffer.slice(13, 45)
13307 var hd
13308
13309 // 33 bytes: private key data (0x00 + k)
13310 if (params.isPrivate) {
13311 assert.strictEqual(buffer.readUInt8(45), 0x00, 'Invalid private key')
13312 var data = buffer.slice(46, 78)
13313 var d = BigInteger.fromBuffer(data)
13314 hd = new HDNode(d, chainCode, params.network)
13315
13316 // 33 bytes: public key data (0x02 + X or 0x03 + X)
13317 } else {
13318 var data = buffer.slice(45, 78)
13319 var Q = ecurve.Point.decodeFrom(curve, data)
13320 assert.equal(Q.compressed, true, 'Invalid public key')
13321
13322 // Verify that the X coordinate in the public point corresponds to a point on the curve.
13323 // If not, the extended public key is invalid.
13324 curve.validate(Q)
13325
13326 hd = new HDNode(Q, chainCode, params.network)
13327 }
13328
13329 hd.depth = depth
13330 hd.index = index
13331 hd.parentFingerprint = parentFingerprint
13332
13333 return hd
13334}
13335
13336HDNode.fromHex = function(hex) {
13337 return HDNode.fromBuffer(new Buffer(hex, 'hex'))
13338}
13339
13340HDNode.prototype.getIdentifier = function() {
13341 return crypto.hash160(this.pubKey.toBuffer())
13342}
13343
13344HDNode.prototype.getFingerprint = function() {
13345 return this.getIdentifier().slice(0, 4)
13346}
13347
13348HDNode.prototype.getAddress = function() {
13349 return this.pubKey.getAddress(this.network)
13350}
13351
13352HDNode.prototype.toBase58 = function(isPrivate) {
13353 return base58check.encode(this.toBuffer(isPrivate))
13354}
13355
13356HDNode.prototype.toBuffer = function(isPrivate) {
13357 if (isPrivate == undefined) isPrivate = !!this.privKey
13358
13359 // Version
13360 var version = isPrivate ? this.network.bip32.private : this.network.bip32.public
13361 var buffer = new Buffer(HDNode.LENGTH)
13362
13363 // 4 bytes: version bytes
13364 buffer.writeUInt32BE(version, 0)
13365
13366 // Depth
13367 // 1 byte: depth: 0x00 for master nodes, 0x01 for level-1 descendants, ....
13368 buffer.writeUInt8(this.depth, 4)
13369
13370 // 4 bytes: the fingerprint of the parent's key (0x00000000 if master key)
13371 var fingerprint = (this.depth === 0) ? 0x00000000 : this.parentFingerprint
13372 buffer.writeUInt32BE(fingerprint, 5)
13373
13374 // 4 bytes: child number. This is the number i in xi = xpar/i, with xi the key being serialized.
13375 // This is encoded in Big endian. (0x00000000 if master key)
13376 buffer.writeUInt32BE(this.index, 9)
13377
13378 // 32 bytes: the chain code
13379 this.chainCode.copy(buffer, 13)
13380
13381 // 33 bytes: the public key or private key data
13382 if (isPrivate) {
13383 assert(this.privKey, 'Missing private key')
13384
13385 // 0x00 + k for private keys
13386 buffer.writeUInt8(0, 45)
13387 this.privKey.d.toBuffer(32).copy(buffer, 46)
13388 } else {
13389
13390 // X9.62 encoding for public keys
13391 this.pubKey.toBuffer().copy(buffer, 45)
13392 }
13393
13394 return buffer
13395}
13396
13397HDNode.prototype.toHex = function(isPrivate) {
13398 return this.toBuffer(isPrivate).toString('hex')
13399}
13400
13401// https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#child-key-derivation-ckd-functions
13402HDNode.prototype.derive = function(index) {
13403 var isHardened = index >= HDNode.HIGHEST_BIT
13404 var indexBuffer = new Buffer(4)
13405 indexBuffer.writeUInt32BE(index, 0)
13406
13407 var data
13408
13409 // Hardened child
13410 if (isHardened) {
13411 assert(this.privKey, 'Could not derive hardened child key')
13412
13413 // data = 0x00 || ser256(kpar) || ser32(index)
13414 data = Buffer.concat([
13415 this.privKey.d.toBuffer(33),
13416 indexBuffer
13417 ])
13418
13419 // Normal child
13420 } else {
13421 // data = serP(point(kpar)) || ser32(index)
13422 // = serP(Kpar) || ser32(index)
13423 data = Buffer.concat([
13424 this.pubKey.toBuffer(),
13425 indexBuffer
13426 ])
13427 }
13428
13429 var I = crypto.HmacSHA512(data, this.chainCode)
13430 var IL = I.slice(0, 32)
13431 var IR = I.slice(32)
13432
13433 var pIL = BigInteger.fromBuffer(IL)
13434
13435 // In case parse256(IL) >= n, proceed with the next value for i
13436 if (pIL.compareTo(curve.n) >= 0) {
13437 return this.derive(index + 1)
13438 }
13439
13440 // Private parent key -> private child key
13441 var hd
13442 if (this.privKey) {
13443 // ki = parse256(IL) + kpar (mod n)
13444 var ki = pIL.add(this.privKey.d).mod(curve.n)
13445
13446 // In case ki == 0, proceed with the next value for i
13447 if (ki.signum() === 0) {
13448 return this.derive(index + 1)
13449 }
13450
13451 hd = new HDNode(ki, IR, this.network)
13452
13453 // Public parent key -> public child key
13454 } else {
13455 // Ki = point(parse256(IL)) + Kpar
13456 // = G*IL + Kpar
13457 var Ki = curve.G.multiply(pIL).add(this.pubKey.Q)
13458
13459 // In case Ki is the point at infinity, proceed with the next value for i
13460 if (curve.isInfinity(Ki)) {
13461 return this.derive(index + 1)
13462 }
13463
13464 hd = new HDNode(Ki, IR, this.network)
13465 }
13466
13467 hd.depth = this.depth + 1
13468 hd.index = index
13469 hd.parentFingerprint = this.getFingerprint().readUInt32BE(0)
13470
13471 return hd
13472}
13473
13474HDNode.prototype.deriveHardened = function(index) {
13475 // Only derives hardened private keys by default
13476 return this.derive(index + HDNode.HIGHEST_BIT)
13477}
13478
13479HDNode.prototype.toString = HDNode.prototype.toBase58
13480
13481module.exports = HDNode
13482
13483}).call(this,_dereq_("buffer").Buffer)
13484},{"./base58check":70,"./crypto":73,"./eckey":75,"./ecpubkey":76,"./networks":81,"assert":4,"bigi":3,"buffer":8,"ecurve":65}],79:[function(_dereq_,module,exports){
13485module.exports = {
13486 Address: _dereq_('./address'),
13487 base58check: _dereq_('./base58check'),
13488 bufferutils: _dereq_('./bufferutils'),
13489 convert: _dereq_('./convert'),
13490 crypto: _dereq_('./crypto'),
13491 ecdsa: _dereq_('./ecdsa'),
13492 ECKey: _dereq_('./eckey'),
13493 ECPubKey: _dereq_('./ecpubkey'),
13494 ECSignature: _dereq_('./ecsignature'),
13495 Message: _dereq_('./message'),
13496 opcodes: _dereq_('./opcodes'),
13497 HDNode: _dereq_('./hdnode'),
13498 Script: _dereq_('./script'),
13499 scripts: _dereq_('./scripts'),
13500 Transaction: _dereq_('./transaction'),
13501 networks: _dereq_('./networks'),
13502 Wallet: _dereq_('./wallet')
13503}
13504
13505},{"./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){
13506(function (Buffer){
13507/// Implements Bitcoin's feature for signing arbitrary messages.
13508var Address = _dereq_('./address')
13509var BigInteger = _dereq_('bigi')
13510var bufferutils = _dereq_('./bufferutils')
13511var crypto = _dereq_('./crypto')
13512var ecdsa = _dereq_('./ecdsa')
13513var networks = _dereq_('./networks')
13514
13515var Address = _dereq_('./address')
13516var ECPubKey = _dereq_('./ecpubkey')
13517var ECSignature = _dereq_('./ecsignature')
13518
13519var ecurve = _dereq_('ecurve')
13520var ecparams = ecurve.getCurveByName('secp256k1')
13521
13522function magicHash(message, network) {
13523 var magicPrefix = new Buffer(network.magicPrefix)
13524 var messageBuffer = new Buffer(message)
13525 var lengthBuffer = new Buffer(bufferutils.varIntSize(messageBuffer.length))
13526 bufferutils.writeVarInt(lengthBuffer, messageBuffer.length, 0)
13527
13528 var buffer = Buffer.concat([magicPrefix, lengthBuffer, messageBuffer])
13529 return crypto.hash256(buffer)
13530}
13531
13532function sign(privKey, message, network) {
13533 network = network || networks.bitcoin
13534
13535 var hash = magicHash(message, network)
13536 var signature = privKey.sign(hash)
13537 var e = BigInteger.fromBuffer(hash)
13538 var i = ecdsa.calcPubKeyRecoveryParam(ecparams, e, signature, privKey.pub.Q)
13539
13540 return signature.toCompact(i, privKey.pub.compressed)
13541}
13542
13543// TODO: network could be implied from address
13544function verify(address, signatureBuffer, message, network) {
13545 if (address instanceof Address) {
13546 address = address.toString()
13547 }
13548 network = network || networks.bitcoin
13549
13550 var hash = magicHash(message, network)
13551 var parsed = ECSignature.parseCompact(signatureBuffer)
13552 var e = BigInteger.fromBuffer(hash)
13553 var Q = ecdsa.recoverPubKey(ecparams, e, parsed.signature, parsed.i)
13554
13555 var pubKey = new ECPubKey(Q, parsed.compressed)
13556 return pubKey.getAddress(network).toString() === address
13557}
13558
13559module.exports = {
13560 magicHash: magicHash,
13561 sign: sign,
13562 verify: verify
13563}
13564
13565}).call(this,_dereq_("buffer").Buffer)
13566},{"./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){
13567// https://en.bitcoin.it/wiki/List_of_address_prefixes
13568// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
13569
13570var networks = {
13571 bitcoin: {
13572 magicPrefix: '\x18Bitcoin Signed Message:\n',
13573 bip32: {
13574 public: 0x0488b21e,
13575 private: 0x0488ade4
13576 },
13577 pubKeyHash: 0x00,
13578 scriptHash: 0x05,
13579 wif: 0x80,
13580 dustThreshold: 546, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/core.h#L151-L162
13581 feePerKb: 10000, // https://github.com/bitcoin/bitcoin/blob/v0.9.2/src/main.cpp#L53
13582 estimateFee: estimateFee('bitcoin')
13583 },
13584 dogecoin: {
13585 magicPrefix: '\x19Dogecoin Signed Message:\n',
13586 bip32: {
13587 public: 0x02facafd,
13588 private: 0x02fac398
13589 },
13590 pubKeyHash: 0x1e,
13591 scriptHash: 0x16,
13592 wif: 0x9e,
13593 dustThreshold: 0, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/core.h#L155-L160
13594 dustSoftThreshold: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.h#L62
13595 feePerKb: 100000000, // https://github.com/dogecoin/dogecoin/blob/v1.7.1/src/main.cpp#L58
13596 estimateFee: estimateFee('dogecoin')
13597 },
13598 litecoin: {
13599 magicPrefix: '\x19Litecoin Signed Message:\n',
13600 bip32: {
13601 public: 0x019da462,
13602 private: 0x019d9cfe
13603 },
13604 pubKeyHash: 0x30,
13605 scriptHash: 0x05,
13606 wif: 0xb0,
13607 dustThreshold: 0, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L360-L365
13608 dustSoftThreshold: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.h#L53
13609 feePerKb: 100000, // https://github.com/litecoin-project/litecoin/blob/v0.8.7.2/src/main.cpp#L56
13610 estimateFee: estimateFee('litecoin')
13611 },
13612 testnet: {
13613 magicPrefix: '\x18Bitcoin Signed Message:\n',
13614 bip32: {
13615 public: 0x043587cf,
13616 private: 0x04358394
13617 },
13618 pubKeyHash: 0x6f,
13619 scriptHash: 0xc4,
13620 wif: 0xef,
13621 dustThreshold: 546,
13622 feePerKb: 10000,
13623 estimateFee: estimateFee('testnet')
13624 }
13625}
13626
13627function estimateFee(type) {
13628 return function(tx) {
13629 var network = networks[type]
13630 var baseFee = network.feePerKb
13631 var byteSize = tx.toBuffer().length
13632
13633 var fee = baseFee * Math.ceil(byteSize / 1000)
13634 if (network.dustSoftThreshold == undefined) return fee
13635
13636 tx.outs.forEach(function(e){
13637 if (e.value < network.dustSoftThreshold) {
13638 fee += baseFee
13639 }
13640 })
13641
13642 return fee
13643 }
13644}
13645
13646module.exports = networks
13647
13648},{}],82:[function(_dereq_,module,exports){
13649module.exports = {
13650 // push value
13651 OP_FALSE : 0,
13652 OP_0 : 0,
13653 OP_PUSHDATA1 : 76,
13654 OP_PUSHDATA2 : 77,
13655 OP_PUSHDATA4 : 78,
13656 OP_1NEGATE : 79,
13657 OP_RESERVED : 80,
13658 OP_1 : 81,
13659 OP_TRUE : 81,
13660 OP_2 : 82,
13661 OP_3 : 83,
13662 OP_4 : 84,
13663 OP_5 : 85,
13664 OP_6 : 86,
13665 OP_7 : 87,
13666 OP_8 : 88,
13667 OP_9 : 89,
13668 OP_10 : 90,
13669 OP_11 : 91,
13670 OP_12 : 92,
13671 OP_13 : 93,
13672 OP_14 : 94,
13673 OP_15 : 95,
13674 OP_16 : 96,
13675
13676 // control
13677 OP_NOP : 97,
13678 OP_VER : 98,
13679 OP_IF : 99,
13680 OP_NOTIF : 100,
13681 OP_VERIF : 101,
13682 OP_VERNOTIF : 102,
13683 OP_ELSE : 103,
13684 OP_ENDIF : 104,
13685 OP_VERIFY : 105,
13686 OP_RETURN : 106,
13687
13688 // stack ops
13689 OP_TOALTSTACK : 107,
13690 OP_FROMALTSTACK : 108,
13691 OP_2DROP : 109,
13692 OP_2DUP : 110,
13693 OP_3DUP : 111,
13694 OP_2OVER : 112,
13695 OP_2ROT : 113,
13696 OP_2SWAP : 114,
13697 OP_IFDUP : 115,
13698 OP_DEPTH : 116,
13699 OP_DROP : 117,
13700 OP_DUP : 118,
13701 OP_NIP : 119,
13702 OP_OVER : 120,
13703 OP_PICK : 121,
13704 OP_ROLL : 122,
13705 OP_ROT : 123,
13706 OP_SWAP : 124,
13707 OP_TUCK : 125,
13708
13709 // splice ops
13710 OP_CAT : 126,
13711 OP_SUBSTR : 127,
13712 OP_LEFT : 128,
13713 OP_RIGHT : 129,
13714 OP_SIZE : 130,
13715
13716 // bit logic
13717 OP_INVERT : 131,
13718 OP_AND : 132,
13719 OP_OR : 133,
13720 OP_XOR : 134,
13721 OP_EQUAL : 135,
13722 OP_EQUALVERIFY : 136,
13723 OP_RESERVED1 : 137,
13724 OP_RESERVED2 : 138,
13725
13726 // numeric
13727 OP_1ADD : 139,
13728 OP_1SUB : 140,
13729 OP_2MUL : 141,
13730 OP_2DIV : 142,
13731 OP_NEGATE : 143,
13732 OP_ABS : 144,
13733 OP_NOT : 145,
13734 OP_0NOTEQUAL : 146,
13735
13736 OP_ADD : 147,
13737 OP_SUB : 148,
13738 OP_MUL : 149,
13739 OP_DIV : 150,
13740 OP_MOD : 151,
13741 OP_LSHIFT : 152,
13742 OP_RSHIFT : 153,
13743
13744 OP_BOOLAND : 154,
13745 OP_BOOLOR : 155,
13746 OP_NUMEQUAL : 156,
13747 OP_NUMEQUALVERIFY : 157,
13748 OP_NUMNOTEQUAL : 158,
13749 OP_LESSTHAN : 159,
13750 OP_GREATERTHAN : 160,
13751 OP_LESSTHANOREQUAL : 161,
13752 OP_GREATERTHANOREQUAL : 162,
13753 OP_MIN : 163,
13754 OP_MAX : 164,
13755
13756 OP_WITHIN : 165,
13757
13758 // crypto
13759 OP_RIPEMD160 : 166,
13760 OP_SHA1 : 167,
13761 OP_SHA256 : 168,
13762 OP_HASH160 : 169,
13763 OP_HASH256 : 170,
13764 OP_CODESEPARATOR : 171,
13765 OP_CHECKSIG : 172,
13766 OP_CHECKSIGVERIFY : 173,
13767 OP_CHECKMULTISIG : 174,
13768 OP_CHECKMULTISIGVERIFY : 175,
13769
13770 // expansion
13771 OP_NOP1 : 176,
13772 OP_NOP2 : 177,
13773 OP_NOP3 : 178,
13774 OP_NOP4 : 179,
13775 OP_NOP5 : 180,
13776 OP_NOP6 : 181,
13777 OP_NOP7 : 182,
13778 OP_NOP8 : 183,
13779 OP_NOP9 : 184,
13780 OP_NOP10 : 185,
13781
13782 // template matching params
13783 OP_PUBKEYHASH : 253,
13784 OP_PUBKEY : 254,
13785 OP_INVALIDOPCODE : 255
13786}
13787
13788},{}],83:[function(_dereq_,module,exports){
13789(function (Buffer){
13790var assert = _dereq_('assert')
13791var bufferutils = _dereq_('./bufferutils')
13792var crypto = _dereq_('./crypto')
13793var opcodes = _dereq_('./opcodes')
13794
13795function Script(buffer, chunks) {
13796 assert(Buffer.isBuffer(buffer), 'Expected Buffer, got ' + buffer)
13797 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13798
13799 this.buffer = buffer
13800 this.chunks = chunks
13801}
13802
13803// Import operations
13804Script.fromASM = function(asm) {
13805 var strChunks = asm.split(' ')
13806
13807 var chunks = strChunks.map(function(strChunk) {
13808 if (strChunk in opcodes) {
13809 return opcodes[strChunk]
13810
13811 } else {
13812 return new Buffer(strChunk, 'hex')
13813 }
13814 })
13815
13816 return Script.fromChunks(chunks)
13817}
13818
13819Script.fromBuffer = function(buffer) {
13820 var chunks = []
13821
13822 var i = 0
13823
13824 while (i < buffer.length) {
13825 var opcode = buffer.readUInt8(i)
13826
13827 if ((opcode > opcodes.OP_0) && (opcode <= opcodes.OP_PUSHDATA4)) {
13828 var d = bufferutils.readPushDataInt(buffer, i)
13829 i += d.size
13830
13831 var data = buffer.slice(i, i + d.number)
13832 i += d.number
13833
13834 chunks.push(data)
13835
13836 } else {
13837 chunks.push(opcode)
13838
13839 i += 1
13840 }
13841 }
13842
13843 return new Script(buffer, chunks)
13844}
13845
13846Script.fromChunks = function(chunks) {
13847 assert(Array.isArray(chunks), 'Expected Array, got ' + chunks)
13848
13849 var bufferSize = chunks.reduce(function(accum, chunk) {
13850 if (Buffer.isBuffer(chunk)) {
13851 return accum + bufferutils.pushDataSize(chunk.length) + chunk.length
13852 }
13853
13854 return accum + 1
13855 }, 0.0)
13856
13857 var buffer = new Buffer(bufferSize)
13858 var offset = 0
13859
13860 chunks.forEach(function(chunk) {
13861 if (Buffer.isBuffer(chunk)) {
13862 offset += bufferutils.writePushDataInt(buffer, chunk.length, offset)
13863
13864 chunk.copy(buffer, offset)
13865 offset += chunk.length
13866
13867 } else {
13868 buffer.writeUInt8(chunk, offset)
13869 offset += 1
13870 }
13871 })
13872
13873 assert.equal(offset, buffer.length, 'Could not decode chunks')
13874 return new Script(buffer, chunks)
13875}
13876
13877Script.fromHex = function(hex) {
13878 return Script.fromBuffer(new Buffer(hex, 'hex'))
13879}
13880
13881// Constants
13882Script.EMPTY = Script.fromChunks([])
13883
13884// Operations
13885Script.prototype.getHash = function() {
13886 return crypto.hash160(this.buffer)
13887}
13888
13889// FIXME: doesn't work for data chunks, maybe time to use buffertools.compare...
13890Script.prototype.without = function(needle) {
13891 return Script.fromChunks(this.chunks.filter(function(op) {
13892 return op !== needle
13893 }))
13894}
13895
13896// Export operations
13897var reverseOps = []
13898for (var op in opcodes) {
13899 var code = opcodes[op]
13900 reverseOps[code] = op
13901}
13902
13903Script.prototype.toASM = function() {
13904 return this.chunks.map(function(chunk) {
13905 if (Buffer.isBuffer(chunk)) {
13906 return chunk.toString('hex')
13907
13908 } else {
13909 return reverseOps[chunk]
13910 }
13911 }).join(' ')
13912}
13913
13914Script.prototype.toBuffer = function() {
13915 return this.buffer
13916}
13917
13918Script.prototype.toHex = function() {
13919 return this.toBuffer().toString('hex')
13920}
13921
13922module.exports = Script
13923
13924}).call(this,_dereq_("buffer").Buffer)
13925},{"./bufferutils":71,"./crypto":73,"./opcodes":82,"assert":4,"buffer":8}],84:[function(_dereq_,module,exports){
13926(function (Buffer){
13927var assert = _dereq_('assert')
13928var opcodes = _dereq_('./opcodes')
13929
13930// FIXME: use ECPubKey, currently the circular dependency breaks everything.
13931//
13932// Solutions:
13933// * Remove ECPubKey.getAddress
13934// - Minimal change, but likely unpopular
13935// * Move all script related functionality out of Address
13936// - Means a lot of changes to Transaction/Wallet
13937// * Ignore it (existing solution)
13938// * Some form of hackery with commonjs
13939//
13940var ecurve = _dereq_('ecurve')
13941var curve = ecurve.getCurveByName('secp256k1')
13942
13943var ECSignature = _dereq_('./ecsignature')
13944var Script = _dereq_('./script')
13945
13946function classifyOutput(script) {
13947 assert(script instanceof Script, 'Expected Script, got ', script)
13948
13949 if (isPubKeyHashOutput.call(script)) {
13950 return 'pubkeyhash'
13951 } else if (isScriptHashOutput.call(script)) {
13952 return 'scripthash'
13953 } else if (isMultisigOutput.call(script)) {
13954 return 'multisig'
13955 } else if (isPubKeyOutput.call(script)) {
13956 return 'pubkey'
13957 } else if (isNulldataOutput.call(script)) {
13958 return 'nulldata'
13959 } else {
13960 return 'nonstandard'
13961 }
13962}
13963
13964function classifyInput(script) {
13965 assert(script instanceof Script, 'Expected Script, got ', script)
13966
13967 if (isPubKeyHashInput.call(script)) {
13968 return 'pubkeyhash'
13969 } else if (isScriptHashInput.call(script)) {
13970 return 'scripthash'
13971 } else if (isMultisigInput.call(script)) {
13972 return 'multisig'
13973 } else if (isPubKeyInput.call(script)) {
13974 return 'pubkey'
13975 } else {
13976 return 'nonstandard'
13977 }
13978}
13979
13980function isCanonicalPubKey(buffer) {
13981 if (!Buffer.isBuffer(buffer)) return false
13982
13983 try {
13984 // FIXME: boo
13985 ecurve.Point.decodeFrom(curve, buffer)
13986 } catch (e) {
13987 if (!(e.message.match(/Invalid sequence (length|tag)/))) throw e
13988
13989 return false
13990 }
13991
13992 return true
13993}
13994
13995function isCanonicalSignature(buffer) {
13996 if (!Buffer.isBuffer(buffer)) return false
13997
13998 try {
13999 ECSignature.parseScriptSignature(buffer)
14000 } catch(e) {
14001 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
14002
14003 return false
14004 }
14005
14006 return true
14007}
14008
14009function isPubKeyHashInput() {
14010 return this.chunks.length === 2 &&
14011 isCanonicalSignature(this.chunks[0]) &&
14012 isCanonicalPubKey(this.chunks[1])
14013}
14014
14015function isPubKeyHashOutput() {
14016 return this.chunks.length === 5 &&
14017 this.chunks[0] === opcodes.OP_DUP &&
14018 this.chunks[1] === opcodes.OP_HASH160 &&
14019 Buffer.isBuffer(this.chunks[2]) &&
14020 this.chunks[2].length === 20 &&
14021 this.chunks[3] === opcodes.OP_EQUALVERIFY &&
14022 this.chunks[4] === opcodes.OP_CHECKSIG
14023}
14024
14025function isPubKeyInput() {
14026 return this.chunks.length === 1 &&
14027 isCanonicalSignature(this.chunks[0])
14028}
14029
14030function isPubKeyOutput() {
14031 return this.chunks.length === 2 &&
14032 isCanonicalPubKey(this.chunks[0]) &&
14033 this.chunks[1] === opcodes.OP_CHECKSIG
14034}
14035
14036function isScriptHashInput() {
14037 if (this.chunks.length < 2) return false
14038 var lastChunk = this.chunks[this.chunks.length - 1]
14039
14040 if (!Buffer.isBuffer(lastChunk)) return false
14041
14042 var scriptSig = Script.fromChunks(this.chunks.slice(0, -1))
14043 var scriptPubKey = Script.fromBuffer(lastChunk)
14044
14045 return classifyInput(scriptSig) === classifyOutput(scriptPubKey)
14046}
14047
14048function isScriptHashOutput() {
14049 return this.chunks.length === 3 &&
14050 this.chunks[0] === opcodes.OP_HASH160 &&
14051 Buffer.isBuffer(this.chunks[1]) &&
14052 this.chunks[1].length === 20 &&
14053 this.chunks[2] === opcodes.OP_EQUAL
14054}
14055
14056function isMultisigInput() {
14057 return this.chunks[0] === opcodes.OP_0 &&
14058 this.chunks.slice(1).every(isCanonicalSignature)
14059}
14060
14061function isMultisigOutput() {
14062 if (this.chunks < 4) return false
14063 if (this.chunks[this.chunks.length - 1] !== opcodes.OP_CHECKMULTISIG) return false
14064
14065 var mOp = this.chunks[0]
14066 if (mOp === opcodes.OP_0) return false
14067 if (mOp < opcodes.OP_1) return false
14068 if (mOp > opcodes.OP_16) return false
14069
14070 var nOp = this.chunks[this.chunks.length - 2]
14071 if (nOp === opcodes.OP_0) return false
14072 if (nOp < opcodes.OP_1) return false
14073 if (nOp > opcodes.OP_16) return false
14074
14075 var m = mOp - (opcodes.OP_1 - 1)
14076 var n = nOp - (opcodes.OP_1 - 1)
14077 if (n < m) return false
14078
14079 var pubKeys = this.chunks.slice(1, -2)
14080 if (n < pubKeys.length) return false
14081
14082 return pubKeys.every(isCanonicalPubKey)
14083}
14084
14085function isNulldataOutput() {
14086 return this.chunks[0] === opcodes.OP_RETURN
14087}
14088
14089// Standard Script Templates
14090// {pubKey} OP_CHECKSIG
14091function pubKeyOutput(pubKey) {
14092 return Script.fromChunks([
14093 pubKey.toBuffer(),
14094 opcodes.OP_CHECKSIG
14095 ])
14096}
14097
14098// OP_DUP OP_HASH160 {pubKeyHash} OP_EQUALVERIFY OP_CHECKSIG
14099function pubKeyHashOutput(hash) {
14100 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14101
14102 return Script.fromChunks([
14103 opcodes.OP_DUP,
14104 opcodes.OP_HASH160,
14105 hash,
14106 opcodes.OP_EQUALVERIFY,
14107 opcodes.OP_CHECKSIG
14108 ])
14109}
14110
14111// OP_HASH160 {scriptHash} OP_EQUAL
14112function scriptHashOutput(hash) {
14113 assert(Buffer.isBuffer(hash), 'Expected Buffer, got ' + hash)
14114
14115 return Script.fromChunks([
14116 opcodes.OP_HASH160,
14117 hash,
14118 opcodes.OP_EQUAL
14119 ])
14120}
14121
14122// m [pubKeys ...] n OP_CHECKMULTISIG
14123function multisigOutput(m, pubKeys) {
14124 assert(Array.isArray(pubKeys), 'Expected Array, got ' + pubKeys)
14125 assert(pubKeys.length >= m, 'Not enough pubKeys provided')
14126
14127 var pubKeyBuffers = pubKeys.map(function(pubKey) {
14128 return pubKey.toBuffer()
14129 })
14130 var n = pubKeys.length
14131
14132 return Script.fromChunks([].concat(
14133 (opcodes.OP_1 - 1) + m,
14134 pubKeyBuffers,
14135 (opcodes.OP_1 - 1) + n,
14136 opcodes.OP_CHECKMULTISIG
14137 ))
14138}
14139
14140// {signature}
14141function pubKeyInput(signature) {
14142 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14143
14144 return Script.fromChunks([signature])
14145}
14146
14147// {signature} {pubKey}
14148function pubKeyHashInput(signature, pubKey) {
14149 assert(Buffer.isBuffer(signature), 'Expected Buffer, got ' + signature)
14150
14151 return Script.fromChunks([signature, pubKey.toBuffer()])
14152}
14153
14154// <scriptSig> {serialized scriptPubKey script}
14155function scriptHashInput(scriptSig, scriptPubKey) {
14156 return Script.fromChunks([].concat(
14157 scriptSig.chunks,
14158 scriptPubKey.toBuffer()
14159 ))
14160}
14161
14162// OP_0 [signatures ...]
14163function multisigInput(signatures, scriptPubKey) {
14164 if (scriptPubKey) {
14165 assert(isMultisigOutput.call(scriptPubKey))
14166
14167 var m = scriptPubKey.chunks[0]
14168 var k = m - (opcodes.OP_1 - 1)
14169 assert(k <= signatures.length, 'Not enough signatures provided')
14170 }
14171
14172 return Script.fromChunks([].concat(opcodes.OP_0, signatures))
14173}
14174
14175module.exports = {
14176 classifyInput: classifyInput,
14177 classifyOutput: classifyOutput,
14178 multisigInput: multisigInput,
14179 multisigOutput: multisigOutput,
14180 pubKeyHashInput: pubKeyHashInput,
14181 pubKeyHashOutput: pubKeyHashOutput,
14182 pubKeyInput: pubKeyInput,
14183 pubKeyOutput: pubKeyOutput,
14184 scriptHashInput: scriptHashInput,
14185 scriptHashOutput: scriptHashOutput
14186}
14187
14188}).call(this,_dereq_("buffer").Buffer)
14189},{"./ecsignature":77,"./opcodes":82,"./script":83,"assert":4,"buffer":8,"ecurve":65}],85:[function(_dereq_,module,exports){
14190(function (Buffer){
14191var assert = _dereq_('assert')
14192var bufferutils = _dereq_('./bufferutils')
14193var crypto = _dereq_('./crypto')
14194var opcodes = _dereq_('./opcodes')
14195var scripts = _dereq_('./scripts')
14196
14197var Address = _dereq_('./address')
14198var ECKey = _dereq_('./eckey')
14199var ECSignature = _dereq_('./ecsignature')
14200var Script = _dereq_('./script')
14201
14202Transaction.DEFAULT_SEQUENCE = 0xffffffff
14203Transaction.SIGHASH_ALL = 0x01
14204Transaction.SIGHASH_NONE = 0x02
14205Transaction.SIGHASH_SINGLE = 0x03
14206Transaction.SIGHASH_ANYONECANPAY = 0x80
14207
14208function Transaction() {
14209 this.version = 1
14210 this.locktime = 0
14211 this.ins = []
14212 this.outs = []
14213}
14214
14215/**
14216 * Create a new txin.
14217 *
14218 * Can be called with any of:
14219 *
14220 * - A transaction and an index
14221 * - A transaction hash and an index
14222 *
14223 * Note that this method does not sign the created input.
14224 */
14225Transaction.prototype.addInput = function(tx, index, sequence) {
14226 if (sequence == undefined) sequence = Transaction.DEFAULT_SEQUENCE
14227
14228 var hash
14229
14230 if (typeof tx === 'string') {
14231 hash = new Buffer(tx, 'hex')
14232
14233 // TxId hex is big-endian, we need little-endian
14234 Array.prototype.reverse.call(hash)
14235
14236 } else if (tx instanceof Transaction) {
14237 hash = tx.getHash()
14238
14239 } else {
14240 hash = tx
14241 }
14242
14243 assert(Buffer.isBuffer(hash), 'Expected Transaction, txId or txHash, got ' + tx)
14244 assert.equal(hash.length, 32, 'Expected hash length of 32, got ' + hash.length)
14245 assert.equal(typeof index, 'number', 'Expected number index, got ' + index)
14246
14247 return (this.ins.push({
14248 hash: hash,
14249 index: index,
14250 script: Script.EMPTY,
14251 sequence: sequence
14252 }) - 1)
14253}
14254
14255/**
14256 * Create a new txout.
14257 *
14258 * Can be called with:
14259 *
14260 * - A base58 address string and a value
14261 * - An Address object and a value
14262 * - A scriptPubKey Script and a value
14263 */
14264Transaction.prototype.addOutput = function(scriptPubKey, value) {
14265 // Attempt to get a valid address if it's a base58 address string
14266 if (typeof scriptPubKey === 'string') {
14267 scriptPubKey = Address.fromBase58Check(scriptPubKey)
14268 }
14269
14270 // Attempt to get a valid script if it's an Address object
14271 if (scriptPubKey instanceof Address) {
14272 var address = scriptPubKey
14273
14274 scriptPubKey = address.toOutputScript()
14275 }
14276
14277 return (this.outs.push({
14278 script: scriptPubKey,
14279 value: value,
14280 }) - 1)
14281}
14282
14283Transaction.prototype.toBuffer = function () {
14284 var txInSize = this.ins.reduce(function(a, x) {
14285 return a + (40 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14286 }, 0)
14287
14288 var txOutSize = this.outs.reduce(function(a, x) {
14289 return a + (8 + bufferutils.varIntSize(x.script.buffer.length) + x.script.buffer.length)
14290 }, 0)
14291
14292 var buffer = new Buffer(
14293 8 +
14294 bufferutils.varIntSize(this.ins.length) +
14295 bufferutils.varIntSize(this.outs.length) +
14296 txInSize +
14297 txOutSize
14298 )
14299
14300 var offset = 0
14301 function writeSlice(slice) {
14302 slice.copy(buffer, offset)
14303 offset += slice.length
14304 }
14305 function writeUInt32(i) {
14306 buffer.writeUInt32LE(i, offset)
14307 offset += 4
14308 }
14309 function writeUInt64(i) {
14310 bufferutils.writeUInt64LE(buffer, i, offset)
14311 offset += 8
14312 }
14313 function writeVarInt(i) {
14314 var n = bufferutils.writeVarInt(buffer, i, offset)
14315 offset += n
14316 }
14317
14318 writeUInt32(this.version)
14319 writeVarInt(this.ins.length)
14320
14321 this.ins.forEach(function(txin) {
14322 writeSlice(txin.hash)
14323 writeUInt32(txin.index)
14324 writeVarInt(txin.script.buffer.length)
14325 writeSlice(txin.script.buffer)
14326 writeUInt32(txin.sequence)
14327 })
14328
14329 writeVarInt(this.outs.length)
14330 this.outs.forEach(function(txout) {
14331 writeUInt64(txout.value)
14332 writeVarInt(txout.script.buffer.length)
14333 writeSlice(txout.script.buffer)
14334 })
14335
14336 writeUInt32(this.locktime)
14337
14338 return buffer
14339}
14340
14341Transaction.prototype.toHex = function() {
14342 return this.toBuffer().toString('hex')
14343}
14344
14345/**
14346 * Hash transaction for signing a specific input.
14347 *
14348 * Bitcoin uses a different hash for each signed transaction input. This
14349 * method copies the transaction, makes the necessary changes based on the
14350 * hashType, serializes and finally hashes the result. This hash can then be
14351 * used to sign the transaction input in question.
14352 */
14353Transaction.prototype.hashForSignature = function(prevOutScript, inIndex, hashType) {
14354 assert(inIndex >= 0, 'Invalid vin index')
14355 assert(inIndex < this.ins.length, 'Invalid vin index')
14356 assert(prevOutScript instanceof Script, 'Invalid Script object')
14357
14358 var txTmp = this.clone()
14359 var hashScript = prevOutScript.without(opcodes.OP_CODESEPARATOR)
14360
14361 // Blank out other inputs' signatures
14362 txTmp.ins.forEach(function(txin) {
14363 txin.script = Script.EMPTY
14364 })
14365 txTmp.ins[inIndex].script = hashScript
14366
14367 var hashTypeModifier = hashType & 0x1f
14368 if (hashTypeModifier === Transaction.SIGHASH_NONE) {
14369 assert(false, 'SIGHASH_NONE not yet supported')
14370
14371 } else if (hashTypeModifier === Transaction.SIGHASH_SINGLE) {
14372 assert(false, 'SIGHASH_SINGLE not yet supported')
14373
14374 }
14375
14376 if (hashType & Transaction.SIGHASH_ANYONECANPAY) {
14377 assert(false, 'SIGHASH_ANYONECANPAY not yet supported')
14378 }
14379
14380 var hashTypeBuffer = new Buffer(4)
14381 hashTypeBuffer.writeInt32LE(hashType, 0)
14382
14383 var buffer = Buffer.concat([txTmp.toBuffer(), hashTypeBuffer])
14384 return crypto.hash256(buffer)
14385}
14386
14387Transaction.prototype.getHash = function () {
14388 return crypto.hash256(this.toBuffer())
14389}
14390
14391Transaction.prototype.getId = function () {
14392 var buffer = this.getHash()
14393
14394 // Big-endian is used for TxHash
14395 Array.prototype.reverse.call(buffer)
14396
14397 return buffer.toString('hex')
14398}
14399
14400Transaction.prototype.clone = function () {
14401 var newTx = new Transaction()
14402 newTx.version = this.version
14403 newTx.locktime = this.locktime
14404
14405 newTx.ins = this.ins.map(function(txin) {
14406 return {
14407 hash: txin.hash,
14408 index: txin.index,
14409 script: txin.script,
14410 sequence: txin.sequence
14411 }
14412 })
14413
14414 newTx.outs = this.outs.map(function(txout) {
14415 return {
14416 script: txout.script,
14417 value: txout.value
14418 }
14419 })
14420
14421 return newTx
14422}
14423
14424Transaction.fromBuffer = function(buffer) {
14425 var offset = 0
14426 function readSlice(n) {
14427 offset += n
14428 return buffer.slice(offset - n, offset)
14429 }
14430 function readUInt32() {
14431 var i = buffer.readUInt32LE(offset)
14432 offset += 4
14433 return i
14434 }
14435 function readUInt64() {
14436 var i = bufferutils.readUInt64LE(buffer, offset)
14437 offset += 8
14438 return i
14439 }
14440 function readVarInt() {
14441 var vi = bufferutils.readVarInt(buffer, offset)
14442 offset += vi.size
14443 return vi.number
14444 }
14445
14446 var tx = new Transaction()
14447 tx.version = readUInt32()
14448
14449 var vinLen = readVarInt()
14450 for (var i = 0; i < vinLen; ++i) {
14451 var hash = readSlice(32)
14452 var vout = readUInt32()
14453 var scriptLen = readVarInt()
14454 var script = readSlice(scriptLen)
14455 var sequence = readUInt32()
14456
14457 tx.ins.push({
14458 hash: hash,
14459 index: vout,
14460 script: Script.fromBuffer(script),
14461 sequence: sequence
14462 })
14463 }
14464
14465 var voutLen = readVarInt()
14466 for (i = 0; i < voutLen; ++i) {
14467 var value = readUInt64()
14468 var scriptLen = readVarInt()
14469 var script = readSlice(scriptLen)
14470
14471 tx.outs.push({
14472 value: value,
14473 script: Script.fromBuffer(script)
14474 })
14475 }
14476
14477 tx.locktime = readUInt32()
14478 assert.equal(offset, buffer.length, 'Transaction has unexpected data')
14479
14480 return tx
14481}
14482
14483Transaction.fromHex = function(hex) {
14484 return Transaction.fromBuffer(new Buffer(hex, 'hex'))
14485}
14486
14487/**
14488 * Signs a pubKeyHash output at some index with the given key
14489 */
14490Transaction.prototype.sign = function(index, privKey, hashType) {
14491 var prevOutScript = privKey.pub.getAddress().toOutputScript()
14492 var signature = this.signInput(index, prevOutScript, privKey, hashType)
14493
14494 // FIXME: Assumed prior TX was pay-to-pubkey-hash
14495 var scriptSig = scripts.pubKeyHashInput(signature, privKey.pub)
14496 this.setInputScript(index, scriptSig)
14497}
14498
14499Transaction.prototype.signInput = function(index, prevOutScript, privKey, hashType) {
14500 hashType = hashType || Transaction.SIGHASH_ALL
14501
14502 var hash = this.hashForSignature(prevOutScript, index, hashType)
14503 var signature = privKey.sign(hash)
14504
14505 return signature.toScriptSignature(hashType)
14506}
14507
14508Transaction.prototype.setInputScript = function(index, script) {
14509 this.ins[index].script = script
14510}
14511
14512// FIXME: could be validateInput(index, prevTxOut, pub)
14513Transaction.prototype.validateInput = function(index, prevOutScript, pubKey, buffer) {
14514 var parsed = ECSignature.parseScriptSignature(buffer)
14515 var hash = this.hashForSignature(prevOutScript, index, parsed.hashType)
14516
14517 return pubKey.verify(hash, parsed.signature)
14518}
14519
14520module.exports = Transaction
14521
14522}).call(this,_dereq_("buffer").Buffer)
14523},{"./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){
14524(function (Buffer){
14525var assert = _dereq_('assert')
14526var networks = _dereq_('./networks')
14527var rng = _dereq_('secure-random')
14528
14529var Address = _dereq_('./address')
14530var HDNode = _dereq_('./hdnode')
14531var Transaction = _dereq_('./transaction')
14532
14533function Wallet(seed, network) {
14534 network = network || networks.bitcoin
14535
14536 // Stored in a closure to make accidental serialization less likely
14537 var masterkey = null
14538 var me = this
14539 var accountZero = null
14540 var internalAccount = null
14541 var externalAccount = null
14542
14543 // Addresses
14544 this.addresses = []
14545 this.changeAddresses = []
14546
14547 // Transaction output data
14548 this.outputs = {}
14549
14550 // Make a new master key
14551 this.newMasterKey = function(seed) {
14552 seed = seed || new Buffer(rng(32))
14553 masterkey = HDNode.fromSeedBuffer(seed, network)
14554
14555 // HD first-level child derivation method should be hardened
14556 // See https://bitcointalk.org/index.php?topic=405179.msg4415254#msg4415254
14557 accountZero = masterkey.deriveHardened(0)
14558 externalAccount = accountZero.derive(0)
14559 internalAccount = accountZero.derive(1)
14560
14561 me.addresses = []
14562 me.changeAddresses = []
14563
14564 me.outputs = {}
14565 }
14566
14567 this.newMasterKey(seed)
14568
14569 this.generateAddress = function() {
14570 var key = externalAccount.derive(this.addresses.length)
14571 this.addresses.push(key.getAddress().toString())
14572 return this.addresses[this.addresses.length - 1]
14573 }
14574
14575 this.generateChangeAddress = function() {
14576 var key = internalAccount.derive(this.changeAddresses.length)
14577 this.changeAddresses.push(key.getAddress().toString())
14578 return this.changeAddresses[this.changeAddresses.length - 1]
14579 }
14580
14581 this.getBalance = function() {
14582 return this.getUnspentOutputs().reduce(function(memo, output){
14583 return memo + output.value
14584 }, 0)
14585 }
14586
14587 this.getUnspentOutputs = function() {
14588 var utxo = []
14589
14590 for(var key in this.outputs){
14591 var output = this.outputs[key]
14592 if(!output.to) utxo.push(outputToUnspentOutput(output))
14593 }
14594
14595 return utxo
14596 }
14597
14598 this.setUnspentOutputs = function(utxo) {
14599 var outputs = {}
14600
14601 utxo.forEach(function(uo){
14602 validateUnspentOutput(uo)
14603 var o = unspentOutputToOutput(uo)
14604 outputs[o.from] = o
14605 })
14606
14607 this.outputs = outputs
14608 }
14609
14610 function outputToUnspentOutput(output){
14611 var hashAndIndex = output.from.split(":")
14612
14613 return {
14614 hash: hashAndIndex[0],
14615 outputIndex: parseInt(hashAndIndex[1]),
14616 address: output.address,
14617 value: output.value,
14618 pending: output.pending
14619 }
14620 }
14621
14622 function unspentOutputToOutput(o) {
14623 var hash = o.hash
14624 var key = hash + ":" + o.outputIndex
14625 return {
14626 from: key,
14627 address: o.address,
14628 value: o.value,
14629 pending: o.pending
14630 }
14631 }
14632
14633 function validateUnspentOutput(uo) {
14634 var missingField
14635
14636 if (isNullOrUndefined(uo.hash)) {
14637 missingField = "hash"
14638 }
14639
14640 var requiredKeys = ['outputIndex', 'address', 'value']
14641 requiredKeys.forEach(function (key) {
14642 if (isNullOrUndefined(uo[key])){
14643 missingField = key
14644 }
14645 })
14646
14647 if (missingField) {
14648 var message = [
14649 'Invalid unspent output: key', missingField, 'is missing.',
14650 'A valid unspent output must contain'
14651 ]
14652 message.push(requiredKeys.join(', '))
14653 message.push("and hash")
14654 throw new Error(message.join(' '))
14655 }
14656 }
14657
14658 function isNullOrUndefined(value) {
14659 return value == undefined
14660 }
14661
14662 this.processPendingTx = function(tx){
14663 processTx(tx, true)
14664 }
14665
14666 this.processConfirmedTx = function(tx){
14667 processTx(tx, false)
14668 }
14669
14670 function processTx(tx, isPending) {
14671 var txid = tx.getId()
14672
14673 tx.outs.forEach(function(txOut, i) {
14674 var address
14675
14676 try {
14677 address = Address.fromOutputScript(txOut.script, network).toString()
14678 } catch(e) {
14679 if (!(e.message.match(/has no matching Address/))) throw e
14680 }
14681
14682 if (isMyAddress(address)) {
14683 var output = txid + ':' + i
14684
14685 me.outputs[output] = {
14686 from: output,
14687 value: txOut.value,
14688 address: address,
14689 pending: isPending
14690 }
14691 }
14692 })
14693
14694 tx.ins.forEach(function(txIn, i) {
14695 // copy and convert to big-endian hex
14696 var txinId = new Buffer(txIn.hash)
14697 Array.prototype.reverse.call(txinId)
14698 txinId = txinId.toString('hex')
14699
14700 var output = txinId + ':' + txIn.index
14701
14702 if (!(output in me.outputs)) return
14703
14704 if (isPending) {
14705 me.outputs[output].to = txid + ':' + i
14706 me.outputs[output].pending = true
14707 } else {
14708 delete me.outputs[output]
14709 }
14710 })
14711 }
14712
14713 this.createTx = function(to, value, fixedFee, changeAddress) {
14714 assert(value > network.dustThreshold, value + ' must be above dust threshold (' + network.dustThreshold + ' Satoshis)')
14715
14716 var utxos = getCandidateOutputs(value)
14717 var accum = 0
14718 var subTotal = value
14719 var addresses = []
14720
14721 var tx = new Transaction()
14722 tx.addOutput(to, value)
14723
14724 for (var i = 0; i < utxos.length; ++i) {
14725 var utxo = utxos[i]
14726 addresses.push(utxo.address)
14727
14728 var outpoint = utxo.from.split(':')
14729 tx.addInput(outpoint[0], parseInt(outpoint[1]))
14730
14731 var fee = fixedFee == undefined ? estimateFeePadChangeOutput(tx) : fixedFee
14732
14733 accum += utxo.value
14734 subTotal = value + fee
14735 if (accum >= subTotal) {
14736 var change = accum - subTotal
14737
14738 if (change > network.dustThreshold) {
14739 tx.addOutput(changeAddress || getChangeAddress(), change)
14740 }
14741
14742 break
14743 }
14744 }
14745
14746 assert(accum >= subTotal, 'Not enough funds (incl. fee): ' + accum + ' < ' + subTotal)
14747
14748 this.signWith(tx, addresses)
14749 return tx
14750 }
14751
14752 function getCandidateOutputs() {
14753 var unspent = []
14754
14755 for (var key in me.outputs) {
14756 var output = me.outputs[key]
14757 if (!output.pending) unspent.push(output)
14758 }
14759
14760 var sortByValueDesc = unspent.sort(function(o1, o2){
14761 return o2.value - o1.value
14762 })
14763
14764 return sortByValueDesc
14765 }
14766
14767 function estimateFeePadChangeOutput(tx) {
14768 var tmpTx = tx.clone()
14769 tmpTx.addOutput(getChangeAddress(), network.dustSoftThreshold || 0)
14770
14771 return network.estimateFee(tmpTx)
14772 }
14773
14774 function getChangeAddress() {
14775 if(me.changeAddresses.length === 0) me.generateChangeAddress();
14776 return me.changeAddresses[me.changeAddresses.length - 1]
14777 }
14778
14779 this.signWith = function(tx, addresses) {
14780 assert.equal(tx.ins.length, addresses.length, 'Number of addresses must match number of transaction inputs')
14781
14782 addresses.forEach(function(address, i) {
14783 var key = me.getPrivateKeyForAddress(address)
14784
14785 tx.sign(i, key)
14786 })
14787
14788 return tx
14789 }
14790
14791 this.getMasterKey = function() { return masterkey }
14792 this.getAccountZero = function() { return accountZero }
14793 this.getInternalAccount = function() { return internalAccount }
14794 this.getExternalAccount = function() { return externalAccount }
14795
14796 this.getPrivateKey = function(index) {
14797 return externalAccount.derive(index).privKey
14798 }
14799
14800 this.getInternalPrivateKey = function(index) {
14801 return internalAccount.derive(index).privKey
14802 }
14803
14804 this.getPrivateKeyForAddress = function(address) {
14805 var index
14806 if((index = this.addresses.indexOf(address)) > -1) {
14807 return this.getPrivateKey(index)
14808 } else if((index = this.changeAddresses.indexOf(address)) > -1) {
14809 return this.getInternalPrivateKey(index)
14810 } else {
14811 throw new Error('Unknown address. Make sure the address is from the keychain and has been generated.')
14812 }
14813 }
14814
14815 function isReceiveAddress(address){
14816 return me.addresses.indexOf(address) > -1
14817 }
14818
14819 function isChangeAddress(address){
14820 return me.changeAddresses.indexOf(address) > -1
14821 }
14822
14823 function isMyAddress(address) {
14824 return isReceiveAddress(address) || isChangeAddress(address)
14825 }
14826}
14827
14828module.exports = Wallet
14829
14830}).call(this,_dereq_("buffer").Buffer)
14831},{"./address":69,"./hdnode":78,"./networks":81,"./transaction":85,"assert":4,"buffer":8,"secure-random":68}]},{},[79])
14832(79)
14833});
14834 </script>
14835
14836 <!--<script src="/js/asmcrypto.js"></script>-->
14837<script>
14838// INCLUDE ASMCRYPTO
14839// https://rawgit.com/tresorit/asmcrypto.js/598a1098504f1b2d0e615bc51dd8404afd2d338b/asmcrypto.js
14840// Provides PBKDF2 functionality
14841// It's faster than CryptoJS
14842// Couldn't get SJCL working as desired
14843
14844
14845(function(exports, global) {
14846 "use strict";
14847 global["asmCrypto"] = exports;
14848 function string_to_bytes(str) {
14849 var i, len = str.length, arr = new Uint8Array(len);
14850 for (i = 0; i < len; i += 1) {
14851 arr[i] = str.charCodeAt(i);
14852 }
14853 return arr;
14854 }
14855 function hex_to_bytes(str) {
14856 var arr = [], len = str.length, i;
14857 if (len & 1) {
14858 str = "0" + str;
14859 len++;
14860 }
14861 for (i = 0; i < len; i += 2) {
14862 arr.push(parseInt(str.substr(i, 2), 16));
14863 }
14864 return new Uint8Array(arr);
14865 }
14866 function base64_to_bytes(str) {
14867 return string_to_bytes(atob(str));
14868 }
14869 function bytes_to_string(arr) {
14870 var str = "";
14871 for (var i = 0; i < arr.length; i++) str += String.fromCharCode(arr[i]);
14872 return str;
14873 }
14874 function bytes_to_hex(arr) {
14875 var sz = (arr.byteLength || arr.length) / arr.length, str = "";
14876 for (var i = 0; i < arr.length; i++) {
14877 var h = arr[i].toString(16);
14878 if (h.length < 2 * sz) str += "00000000000000".substr(0, 2 * sz - h.length);
14879 str += h;
14880 }
14881 return str;
14882 }
14883 function bytes_to_base64(arr) {
14884 return btoa(bytes_to_string(arr));
14885 }
14886 function pow2_ceil(a) {
14887 a -= 1;
14888 a |= a >>> 1;
14889 a |= a >>> 2;
14890 a |= a >>> 4;
14891 a |= a >>> 8;
14892 a |= a >>> 16;
14893 a += 1;
14894 return a;
14895 }
14896 function is_number(a) {
14897 return typeof a === "number";
14898 }
14899 function is_string(a) {
14900 return typeof a === "string";
14901 }
14902 function is_buffer(a) {
14903 return a instanceof ArrayBuffer;
14904 }
14905 function is_bytes(a) {
14906 return a instanceof Uint8Array;
14907 }
14908 function is_typed_array(a) {
14909 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;
14910 }
14911 function IllegalStateError() {
14912 Error.apply(this, arguments);
14913 }
14914 IllegalStateError.prototype = new Error();
14915 function IllegalArgumentError() {
14916 Error.apply(this, arguments);
14917 }
14918 IllegalArgumentError.prototype = new Error();
14919 function SecurityError() {
14920 Error.apply(this, arguments);
14921 }
14922 IllegalArgumentError.prototype = new Error();
14923 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 ];
14924 var _aes_heap_start = 2048;
14925 function _aes_asm(stdlib, foreign, buffer) {
14926 // Closure Compiler warning - commented out
14927 //"use asm";
14928 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;
14929 var keySize = 0;
14930 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;
14931 var HEAP = new stdlib.Uint8Array(buffer);
14932 function _expand_key_128() {
14933 var sbox = 0;
14934 R10 = R00 ^ HEAP[sbox | R0D] ^ 1;
14935 R11 = R01 ^ HEAP[sbox | R0E];
14936 R12 = R02 ^ HEAP[sbox | R0F];
14937 R13 = R03 ^ HEAP[sbox | R0C];
14938 R14 = R04 ^ R10;
14939 R15 = R05 ^ R11;
14940 R16 = R06 ^ R12;
14941 R17 = R07 ^ R13;
14942 R18 = R08 ^ R14;
14943 R19 = R09 ^ R15;
14944 R1A = R0A ^ R16;
14945 R1B = R0B ^ R17;
14946 R1C = R0C ^ R18;
14947 R1D = R0D ^ R19;
14948 R1E = R0E ^ R1A;
14949 R1F = R0F ^ R1B;
14950 R20 = R10 ^ HEAP[sbox | R1D] ^ 2;
14951 R21 = R11 ^ HEAP[sbox | R1E];
14952 R22 = R12 ^ HEAP[sbox | R1F];
14953 R23 = R13 ^ HEAP[sbox | R1C];
14954 R24 = R14 ^ R20;
14955 R25 = R15 ^ R21;
14956 R26 = R16 ^ R22;
14957 R27 = R17 ^ R23;
14958 R28 = R18 ^ R24;
14959 R29 = R19 ^ R25;
14960 R2A = R1A ^ R26;
14961 R2B = R1B ^ R27;
14962 R2C = R1C ^ R28;
14963 R2D = R1D ^ R29;
14964 R2E = R1E ^ R2A;
14965 R2F = R1F ^ R2B;
14966 R30 = R20 ^ HEAP[sbox | R2D] ^ 4;
14967 R31 = R21 ^ HEAP[sbox | R2E];
14968 R32 = R22 ^ HEAP[sbox | R2F];
14969 R33 = R23 ^ HEAP[sbox | R2C];
14970 R34 = R24 ^ R30;
14971 R35 = R25 ^ R31;
14972 R36 = R26 ^ R32;
14973 R37 = R27 ^ R33;
14974 R38 = R28 ^ R34;
14975 R39 = R29 ^ R35;
14976 R3A = R2A ^ R36;
14977 R3B = R2B ^ R37;
14978 R3C = R2C ^ R38;
14979 R3D = R2D ^ R39;
14980 R3E = R2E ^ R3A;
14981 R3F = R2F ^ R3B;
14982 R40 = R30 ^ HEAP[sbox | R3D] ^ 8;
14983 R41 = R31 ^ HEAP[sbox | R3E];
14984 R42 = R32 ^ HEAP[sbox | R3F];
14985 R43 = R33 ^ HEAP[sbox | R3C];
14986 R44 = R34 ^ R40;
14987 R45 = R35 ^ R41;
14988 R46 = R36 ^ R42;
14989 R47 = R37 ^ R43;
14990 R48 = R38 ^ R44;
14991 R49 = R39 ^ R45;
14992 R4A = R3A ^ R46;
14993 R4B = R3B ^ R47;
14994 R4C = R3C ^ R48;
14995 R4D = R3D ^ R49;
14996 R4E = R3E ^ R4A;
14997 R4F = R3F ^ R4B;
14998 R50 = R40 ^ HEAP[sbox | R4D] ^ 16;
14999 R51 = R41 ^ HEAP[sbox | R4E];
15000 R52 = R42 ^ HEAP[sbox | R4F];
15001 R53 = R43 ^ HEAP[sbox | R4C];
15002 R54 = R44 ^ R50;
15003 R55 = R45 ^ R51;
15004 R56 = R46 ^ R52;
15005 R57 = R47 ^ R53;
15006 R58 = R48 ^ R54;
15007 R59 = R49 ^ R55;
15008 R5A = R4A ^ R56;
15009 R5B = R4B ^ R57;
15010 R5C = R4C ^ R58;
15011 R5D = R4D ^ R59;
15012 R5E = R4E ^ R5A;
15013 R5F = R4F ^ R5B;
15014 R60 = R50 ^ HEAP[sbox | R5D] ^ 32;
15015 R61 = R51 ^ HEAP[sbox | R5E];
15016 R62 = R52 ^ HEAP[sbox | R5F];
15017 R63 = R53 ^ HEAP[sbox | R5C];
15018 R64 = R54 ^ R60;
15019 R65 = R55 ^ R61;
15020 R66 = R56 ^ R62;
15021 R67 = R57 ^ R63;
15022 R68 = R58 ^ R64;
15023 R69 = R59 ^ R65;
15024 R6A = R5A ^ R66;
15025 R6B = R5B ^ R67;
15026 R6C = R5C ^ R68;
15027 R6D = R5D ^ R69;
15028 R6E = R5E ^ R6A;
15029 R6F = R5F ^ R6B;
15030 R70 = R60 ^ HEAP[sbox | R6D] ^ 64;
15031 R71 = R61 ^ HEAP[sbox | R6E];
15032 R72 = R62 ^ HEAP[sbox | R6F];
15033 R73 = R63 ^ HEAP[sbox | R6C];
15034 R74 = R64 ^ R70;
15035 R75 = R65 ^ R71;
15036 R76 = R66 ^ R72;
15037 R77 = R67 ^ R73;
15038 R78 = R68 ^ R74;
15039 R79 = R69 ^ R75;
15040 R7A = R6A ^ R76;
15041 R7B = R6B ^ R77;
15042 R7C = R6C ^ R78;
15043 R7D = R6D ^ R79;
15044 R7E = R6E ^ R7A;
15045 R7F = R6F ^ R7B;
15046 R80 = R70 ^ HEAP[sbox | R7D] ^ 128;
15047 R81 = R71 ^ HEAP[sbox | R7E];
15048 R82 = R72 ^ HEAP[sbox | R7F];
15049 R83 = R73 ^ HEAP[sbox | R7C];
15050 R84 = R74 ^ R80;
15051 R85 = R75 ^ R81;
15052 R86 = R76 ^ R82;
15053 R87 = R77 ^ R83;
15054 R88 = R78 ^ R84;
15055 R89 = R79 ^ R85;
15056 R8A = R7A ^ R86;
15057 R8B = R7B ^ R87;
15058 R8C = R7C ^ R88;
15059 R8D = R7D ^ R89;
15060 R8E = R7E ^ R8A;
15061 R8F = R7F ^ R8B;
15062 R90 = R80 ^ HEAP[sbox | R8D] ^ 27;
15063 R91 = R81 ^ HEAP[sbox | R8E];
15064 R92 = R82 ^ HEAP[sbox | R8F];
15065 R93 = R83 ^ HEAP[sbox | R8C];
15066 R94 = R84 ^ R90;
15067 R95 = R85 ^ R91;
15068 R96 = R86 ^ R92;
15069 R97 = R87 ^ R93;
15070 R98 = R88 ^ R94;
15071 R99 = R89 ^ R95;
15072 R9A = R8A ^ R96;
15073 R9B = R8B ^ R97;
15074 R9C = R8C ^ R98;
15075 R9D = R8D ^ R99;
15076 R9E = R8E ^ R9A;
15077 R9F = R8F ^ R9B;
15078 RA0 = R90 ^ HEAP[sbox | R9D] ^ 54;
15079 RA1 = R91 ^ HEAP[sbox | R9E];
15080 RA2 = R92 ^ HEAP[sbox | R9F];
15081 RA3 = R93 ^ HEAP[sbox | R9C];
15082 RA4 = R94 ^ RA0;
15083 RA5 = R95 ^ RA1;
15084 RA6 = R96 ^ RA2;
15085 RA7 = R97 ^ RA3;
15086 RA8 = R98 ^ RA4;
15087 RA9 = R99 ^ RA5;
15088 RAA = R9A ^ RA6;
15089 RAB = R9B ^ RA7;
15090 RAC = R9C ^ RA8;
15091 RAD = R9D ^ RA9;
15092 RAE = R9E ^ RAA;
15093 RAF = R9F ^ RAB;
15094 }
15095 function _expand_key_256() {
15096 var sbox = 0;
15097 R20 = R00 ^ HEAP[sbox | R1D] ^ 1;
15098 R21 = R01 ^ HEAP[sbox | R1E];
15099 R22 = R02 ^ HEAP[sbox | R1F];
15100 R23 = R03 ^ HEAP[sbox | R1C];
15101 R24 = R04 ^ R20;
15102 R25 = R05 ^ R21;
15103 R26 = R06 ^ R22;
15104 R27 = R07 ^ R23;
15105 R28 = R08 ^ R24;
15106 R29 = R09 ^ R25;
15107 R2A = R0A ^ R26;
15108 R2B = R0B ^ R27;
15109 R2C = R0C ^ R28;
15110 R2D = R0D ^ R29;
15111 R2E = R0E ^ R2A;
15112 R2F = R0F ^ R2B;
15113 R30 = R10 ^ HEAP[sbox | R2C];
15114 R31 = R11 ^ HEAP[sbox | R2D];
15115 R32 = R12 ^ HEAP[sbox | R2E];
15116 R33 = R13 ^ HEAP[sbox | R2F];
15117 R34 = R14 ^ R30;
15118 R35 = R15 ^ R31;
15119 R36 = R16 ^ R32;
15120 R37 = R17 ^ R33;
15121 R38 = R18 ^ R34;
15122 R39 = R19 ^ R35;
15123 R3A = R1A ^ R36;
15124 R3B = R1B ^ R37;
15125 R3C = R1C ^ R38;
15126 R3D = R1D ^ R39;
15127 R3E = R1E ^ R3A;
15128 R3F = R1F ^ R3B;
15129 R40 = R20 ^ HEAP[sbox | R3D] ^ 2;
15130 R41 = R21 ^ HEAP[sbox | R3E];
15131 R42 = R22 ^ HEAP[sbox | R3F];
15132 R43 = R23 ^ HEAP[sbox | R3C];
15133 R44 = R24 ^ R40;
15134 R45 = R25 ^ R41;
15135 R46 = R26 ^ R42;
15136 R47 = R27 ^ R43;
15137 R48 = R28 ^ R44;
15138 R49 = R29 ^ R45;
15139 R4A = R2A ^ R46;
15140 R4B = R2B ^ R47;
15141 R4C = R2C ^ R48;
15142 R4D = R2D ^ R49;
15143 R4E = R2E ^ R4A;
15144 R4F = R2F ^ R4B;
15145 R50 = R30 ^ HEAP[sbox | R4C];
15146 R51 = R31 ^ HEAP[sbox | R4D];
15147 R52 = R32 ^ HEAP[sbox | R4E];
15148 R53 = R33 ^ HEAP[sbox | R4F];
15149 R54 = R34 ^ R50;
15150 R55 = R35 ^ R51;
15151 R56 = R36 ^ R52;
15152 R57 = R37 ^ R53;
15153 R58 = R38 ^ R54;
15154 R59 = R39 ^ R55;
15155 R5A = R3A ^ R56;
15156 R5B = R3B ^ R57;
15157 R5C = R3C ^ R58;
15158 R5D = R3D ^ R59;
15159 R5E = R3E ^ R5A;
15160 R5F = R3F ^ R5B;
15161 R60 = R40 ^ HEAP[sbox | R5D] ^ 4;
15162 R61 = R41 ^ HEAP[sbox | R5E];
15163 R62 = R42 ^ HEAP[sbox | R5F];
15164 R63 = R43 ^ HEAP[sbox | R5C];
15165 R64 = R44 ^ R60;
15166 R65 = R45 ^ R61;
15167 R66 = R46 ^ R62;
15168 R67 = R47 ^ R63;
15169 R68 = R48 ^ R64;
15170 R69 = R49 ^ R65;
15171 R6A = R4A ^ R66;
15172 R6B = R4B ^ R67;
15173 R6C = R4C ^ R68;
15174 R6D = R4D ^ R69;
15175 R6E = R4E ^ R6A;
15176 R6F = R4F ^ R6B;
15177 R70 = R50 ^ HEAP[sbox | R6C];
15178 R71 = R51 ^ HEAP[sbox | R6D];
15179 R72 = R52 ^ HEAP[sbox | R6E];
15180 R73 = R53 ^ HEAP[sbox | R6F];
15181 R74 = R54 ^ R70;
15182 R75 = R55 ^ R71;
15183 R76 = R56 ^ R72;
15184 R77 = R57 ^ R73;
15185 R78 = R58 ^ R74;
15186 R79 = R59 ^ R75;
15187 R7A = R5A ^ R76;
15188 R7B = R5B ^ R77;
15189 R7C = R5C ^ R78;
15190 R7D = R5D ^ R79;
15191 R7E = R5E ^ R7A;
15192 R7F = R5F ^ R7B;
15193 R80 = R60 ^ HEAP[sbox | R7D] ^ 8;
15194 R81 = R61 ^ HEAP[sbox | R7E];
15195 R82 = R62 ^ HEAP[sbox | R7F];
15196 R83 = R63 ^ HEAP[sbox | R7C];
15197 R84 = R64 ^ R80;
15198 R85 = R65 ^ R81;
15199 R86 = R66 ^ R82;
15200 R87 = R67 ^ R83;
15201 R88 = R68 ^ R84;
15202 R89 = R69 ^ R85;
15203 R8A = R6A ^ R86;
15204 R8B = R6B ^ R87;
15205 R8C = R6C ^ R88;
15206 R8D = R6D ^ R89;
15207 R8E = R6E ^ R8A;
15208 R8F = R6F ^ R8B;
15209 R90 = R70 ^ HEAP[sbox | R8C];
15210 R91 = R71 ^ HEAP[sbox | R8D];
15211 R92 = R72 ^ HEAP[sbox | R8E];
15212 R93 = R73 ^ HEAP[sbox | R8F];
15213 R94 = R74 ^ R90;
15214 R95 = R75 ^ R91;
15215 R96 = R76 ^ R92;
15216 R97 = R77 ^ R93;
15217 R98 = R78 ^ R94;
15218 R99 = R79 ^ R95;
15219 R9A = R7A ^ R96;
15220 R9B = R7B ^ R97;
15221 R9C = R7C ^ R98;
15222 R9D = R7D ^ R99;
15223 R9E = R7E ^ R9A;
15224 R9F = R7F ^ R9B;
15225 RA0 = R80 ^ HEAP[sbox | R9D] ^ 16;
15226 RA1 = R81 ^ HEAP[sbox | R9E];
15227 RA2 = R82 ^ HEAP[sbox | R9F];
15228 RA3 = R83 ^ HEAP[sbox | R9C];
15229 RA4 = R84 ^ RA0;
15230 RA5 = R85 ^ RA1;
15231 RA6 = R86 ^ RA2;
15232 RA7 = R87 ^ RA3;
15233 RA8 = R88 ^ RA4;
15234 RA9 = R89 ^ RA5;
15235 RAA = R8A ^ RA6;
15236 RAB = R8B ^ RA7;
15237 RAC = R8C ^ RA8;
15238 RAD = R8D ^ RA9;
15239 RAE = R8E ^ RAA;
15240 RAF = R8F ^ RAB;
15241 RB0 = R90 ^ HEAP[sbox | RAC];
15242 RB1 = R91 ^ HEAP[sbox | RAD];
15243 RB2 = R92 ^ HEAP[sbox | RAE];
15244 RB3 = R93 ^ HEAP[sbox | RAF];
15245 RB4 = R94 ^ RB0;
15246 RB5 = R95 ^ RB1;
15247 RB6 = R96 ^ RB2;
15248 RB7 = R97 ^ RB3;
15249 RB8 = R98 ^ RB4;
15250 RB9 = R99 ^ RB5;
15251 RBA = R9A ^ RB6;
15252 RBB = R9B ^ RB7;
15253 RBC = R9C ^ RB8;
15254 RBD = R9D ^ RB9;
15255 RBE = R9E ^ RBA;
15256 RBF = R9F ^ RBB;
15257 RC0 = RA0 ^ HEAP[sbox | RBD] ^ 32;
15258 RC1 = RA1 ^ HEAP[sbox | RBE];
15259 RC2 = RA2 ^ HEAP[sbox | RBF];
15260 RC3 = RA3 ^ HEAP[sbox | RBC];
15261 RC4 = RA4 ^ RC0;
15262 RC5 = RA5 ^ RC1;
15263 RC6 = RA6 ^ RC2;
15264 RC7 = RA7 ^ RC3;
15265 RC8 = RA8 ^ RC4;
15266 RC9 = RA9 ^ RC5;
15267 RCA = RAA ^ RC6;
15268 RCB = RAB ^ RC7;
15269 RCC = RAC ^ RC8;
15270 RCD = RAD ^ RC9;
15271 RCE = RAE ^ RCA;
15272 RCF = RAF ^ RCB;
15273 RD0 = RB0 ^ HEAP[sbox | RCC];
15274 RD1 = RB1 ^ HEAP[sbox | RCD];
15275 RD2 = RB2 ^ HEAP[sbox | RCE];
15276 RD3 = RB3 ^ HEAP[sbox | RCF];
15277 RD4 = RB4 ^ RD0;
15278 RD5 = RB5 ^ RD1;
15279 RD6 = RB6 ^ RD2;
15280 RD7 = RB7 ^ RD3;
15281 RD8 = RB8 ^ RD4;
15282 RD9 = RB9 ^ RD5;
15283 RDA = RBA ^ RD6;
15284 RDB = RBB ^ RD7;
15285 RDC = RBC ^ RD8;
15286 RDD = RBD ^ RD9;
15287 RDE = RBE ^ RDA;
15288 RDF = RBF ^ RDB;
15289 RE0 = RC0 ^ HEAP[sbox | RDD] ^ 64;
15290 RE1 = RC1 ^ HEAP[sbox | RDE];
15291 RE2 = RC2 ^ HEAP[sbox | RDF];
15292 RE3 = RC3 ^ HEAP[sbox | RDC];
15293 RE4 = RC4 ^ RE0;
15294 RE5 = RC5 ^ RE1;
15295 RE6 = RC6 ^ RE2;
15296 RE7 = RC7 ^ RE3;
15297 RE8 = RC8 ^ RE4;
15298 RE9 = RC9 ^ RE5;
15299 REA = RCA ^ RE6;
15300 REB = RCB ^ RE7;
15301 REC = RCC ^ RE8;
15302 RED = RCD ^ RE9;
15303 REE = RCE ^ REA;
15304 REF = RCF ^ REB;
15305 }
15306 function _encrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15307 s0 = s0 | 0;
15308 s1 = s1 | 0;
15309 s2 = s2 | 0;
15310 s3 = s3 | 0;
15311 s4 = s4 | 0;
15312 s5 = s5 | 0;
15313 s6 = s6 | 0;
15314 s7 = s7 | 0;
15315 s8 = s8 | 0;
15316 s9 = s9 | 0;
15317 sA = sA | 0;
15318 sB = sB | 0;
15319 sC = sC | 0;
15320 sD = sD | 0;
15321 sE = sE | 0;
15322 sF = sF | 0;
15323 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;
15324 s0 = s0 ^ R00;
15325 s1 = s1 ^ R01;
15326 s2 = s2 ^ R02;
15327 s3 = s3 ^ R03;
15328 s4 = s4 ^ R04;
15329 s5 = s5 ^ R05;
15330 s6 = s6 ^ R06;
15331 s7 = s7 ^ R07;
15332 s8 = s8 ^ R08;
15333 s9 = s9 ^ R09;
15334 sA = sA ^ R0A;
15335 sB = sB ^ R0B;
15336 sC = sC ^ R0C;
15337 sD = sD ^ R0D;
15338 sE = sE ^ R0E;
15339 sF = sF ^ R0F;
15340 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R10;
15341 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R11;
15342 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R12;
15343 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R13;
15344 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R14;
15345 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R15;
15346 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R16;
15347 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R17;
15348 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R18;
15349 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R19;
15350 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R1A;
15351 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R1B;
15352 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R1C;
15353 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R1D;
15354 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R1E;
15355 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R1F;
15356 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R20;
15357 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R21;
15358 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R22;
15359 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R23;
15360 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R24;
15361 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R25;
15362 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R26;
15363 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R27;
15364 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R28;
15365 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R29;
15366 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R2A;
15367 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R2B;
15368 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R2C;
15369 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R2D;
15370 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R2E;
15371 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R2F;
15372 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R30;
15373 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R31;
15374 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R32;
15375 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R33;
15376 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R34;
15377 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R35;
15378 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R36;
15379 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R37;
15380 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R38;
15381 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R39;
15382 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R3A;
15383 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R3B;
15384 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R3C;
15385 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R3D;
15386 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R3E;
15387 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R3F;
15388 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R40;
15389 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R41;
15390 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R42;
15391 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R43;
15392 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R44;
15393 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R45;
15394 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R46;
15395 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R47;
15396 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R48;
15397 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R49;
15398 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R4A;
15399 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R4B;
15400 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R4C;
15401 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R4D;
15402 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R4E;
15403 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R4F;
15404 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R50;
15405 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R51;
15406 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R52;
15407 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R53;
15408 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R54;
15409 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R55;
15410 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R56;
15411 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R57;
15412 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R58;
15413 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R59;
15414 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R5A;
15415 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R5B;
15416 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R5C;
15417 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R5D;
15418 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R5E;
15419 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R5F;
15420 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R60;
15421 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R61;
15422 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R62;
15423 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R63;
15424 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R64;
15425 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R65;
15426 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R66;
15427 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R67;
15428 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R68;
15429 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R69;
15430 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R6A;
15431 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R6B;
15432 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R6C;
15433 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R6D;
15434 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R6E;
15435 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R6F;
15436 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R70;
15437 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R71;
15438 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R72;
15439 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R73;
15440 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R74;
15441 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R75;
15442 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R76;
15443 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R77;
15444 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R78;
15445 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R79;
15446 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R7A;
15447 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R7B;
15448 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R7C;
15449 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R7D;
15450 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R7E;
15451 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R7F;
15452 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ R80;
15453 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ R81;
15454 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ R82;
15455 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ R83;
15456 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ R84;
15457 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ R85;
15458 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ R86;
15459 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ R87;
15460 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ R88;
15461 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ R89;
15462 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ R8A;
15463 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ R8B;
15464 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ R8C;
15465 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ R8D;
15466 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ R8E;
15467 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ R8F;
15468 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ R90;
15469 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ R91;
15470 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ R92;
15471 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ R93;
15472 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ R94;
15473 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ R95;
15474 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ R96;
15475 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ R97;
15476 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ R98;
15477 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ R99;
15478 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ R9A;
15479 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ R9B;
15480 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ R9C;
15481 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ R9D;
15482 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ R9E;
15483 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ R9F;
15484 if ((keySize | 0) == 16) {
15485 S0 = HEAP[sbox | t0] ^ RA0;
15486 S1 = HEAP[sbox | t5] ^ RA1;
15487 S2 = HEAP[sbox | tA] ^ RA2;
15488 S3 = HEAP[sbox | tF] ^ RA3;
15489 S4 = HEAP[sbox | t4] ^ RA4;
15490 S5 = HEAP[sbox | t9] ^ RA5;
15491 S6 = HEAP[sbox | tE] ^ RA6;
15492 S7 = HEAP[sbox | t3] ^ RA7;
15493 S8 = HEAP[sbox | t8] ^ RA8;
15494 S9 = HEAP[sbox | tD] ^ RA9;
15495 SA = HEAP[sbox | t2] ^ RAA;
15496 SB = HEAP[sbox | t7] ^ RAB;
15497 SC = HEAP[sbox | tC] ^ RAC;
15498 SD = HEAP[sbox | t1] ^ RAD;
15499 SE = HEAP[sbox | t6] ^ RAE;
15500 SF = HEAP[sbox | tB] ^ RAF;
15501 return;
15502 }
15503 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RA0;
15504 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RA1;
15505 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RA2;
15506 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RA3;
15507 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RA4;
15508 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RA5;
15509 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RA6;
15510 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RA7;
15511 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RA8;
15512 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RA9;
15513 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RAA;
15514 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RAB;
15515 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RAC;
15516 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RAD;
15517 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RAE;
15518 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RAF;
15519 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RB0;
15520 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RB1;
15521 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RB2;
15522 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RB3;
15523 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RB4;
15524 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RB5;
15525 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RB6;
15526 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RB7;
15527 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RB8;
15528 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RB9;
15529 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RBA;
15530 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RBB;
15531 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RBC;
15532 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RBD;
15533 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RBE;
15534 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RBF;
15535 s0 = HEAP[x2_sbox | t0] ^ HEAP[x3_sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[sbox | tF] ^ RC0;
15536 s1 = HEAP[sbox | t0] ^ HEAP[x2_sbox | t5] ^ HEAP[x3_sbox | tA] ^ HEAP[sbox | tF] ^ RC1;
15537 s2 = HEAP[sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[x2_sbox | tA] ^ HEAP[x3_sbox | tF] ^ RC2;
15538 s3 = HEAP[x3_sbox | t0] ^ HEAP[sbox | t5] ^ HEAP[sbox | tA] ^ HEAP[x2_sbox | tF] ^ RC3;
15539 s4 = HEAP[x2_sbox | t4] ^ HEAP[x3_sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[sbox | t3] ^ RC4;
15540 s5 = HEAP[sbox | t4] ^ HEAP[x2_sbox | t9] ^ HEAP[x3_sbox | tE] ^ HEAP[sbox | t3] ^ RC5;
15541 s6 = HEAP[sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[x2_sbox | tE] ^ HEAP[x3_sbox | t3] ^ RC6;
15542 s7 = HEAP[x3_sbox | t4] ^ HEAP[sbox | t9] ^ HEAP[sbox | tE] ^ HEAP[x2_sbox | t3] ^ RC7;
15543 s8 = HEAP[x2_sbox | t8] ^ HEAP[x3_sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[sbox | t7] ^ RC8;
15544 s9 = HEAP[sbox | t8] ^ HEAP[x2_sbox | tD] ^ HEAP[x3_sbox | t2] ^ HEAP[sbox | t7] ^ RC9;
15545 sA = HEAP[sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[x2_sbox | t2] ^ HEAP[x3_sbox | t7] ^ RCA;
15546 sB = HEAP[x3_sbox | t8] ^ HEAP[sbox | tD] ^ HEAP[sbox | t2] ^ HEAP[x2_sbox | t7] ^ RCB;
15547 sC = HEAP[x2_sbox | tC] ^ HEAP[x3_sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[sbox | tB] ^ RCC;
15548 sD = HEAP[sbox | tC] ^ HEAP[x2_sbox | t1] ^ HEAP[x3_sbox | t6] ^ HEAP[sbox | tB] ^ RCD;
15549 sE = HEAP[sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[x2_sbox | t6] ^ HEAP[x3_sbox | tB] ^ RCE;
15550 sF = HEAP[x3_sbox | tC] ^ HEAP[sbox | t1] ^ HEAP[sbox | t6] ^ HEAP[x2_sbox | tB] ^ RCF;
15551 t0 = HEAP[x2_sbox | s0] ^ HEAP[x3_sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[sbox | sF] ^ RD0;
15552 t1 = HEAP[sbox | s0] ^ HEAP[x2_sbox | s5] ^ HEAP[x3_sbox | sA] ^ HEAP[sbox | sF] ^ RD1;
15553 t2 = HEAP[sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[x2_sbox | sA] ^ HEAP[x3_sbox | sF] ^ RD2;
15554 t3 = HEAP[x3_sbox | s0] ^ HEAP[sbox | s5] ^ HEAP[sbox | sA] ^ HEAP[x2_sbox | sF] ^ RD3;
15555 t4 = HEAP[x2_sbox | s4] ^ HEAP[x3_sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[sbox | s3] ^ RD4;
15556 t5 = HEAP[sbox | s4] ^ HEAP[x2_sbox | s9] ^ HEAP[x3_sbox | sE] ^ HEAP[sbox | s3] ^ RD5;
15557 t6 = HEAP[sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[x2_sbox | sE] ^ HEAP[x3_sbox | s3] ^ RD6;
15558 t7 = HEAP[x3_sbox | s4] ^ HEAP[sbox | s9] ^ HEAP[sbox | sE] ^ HEAP[x2_sbox | s3] ^ RD7;
15559 t8 = HEAP[x2_sbox | s8] ^ HEAP[x3_sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[sbox | s7] ^ RD8;
15560 t9 = HEAP[sbox | s8] ^ HEAP[x2_sbox | sD] ^ HEAP[x3_sbox | s2] ^ HEAP[sbox | s7] ^ RD9;
15561 tA = HEAP[sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[x2_sbox | s2] ^ HEAP[x3_sbox | s7] ^ RDA;
15562 tB = HEAP[x3_sbox | s8] ^ HEAP[sbox | sD] ^ HEAP[sbox | s2] ^ HEAP[x2_sbox | s7] ^ RDB;
15563 tC = HEAP[x2_sbox | sC] ^ HEAP[x3_sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[sbox | sB] ^ RDC;
15564 tD = HEAP[sbox | sC] ^ HEAP[x2_sbox | s1] ^ HEAP[x3_sbox | s6] ^ HEAP[sbox | sB] ^ RDD;
15565 tE = HEAP[sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[x2_sbox | s6] ^ HEAP[x3_sbox | sB] ^ RDE;
15566 tF = HEAP[x3_sbox | sC] ^ HEAP[sbox | s1] ^ HEAP[sbox | s6] ^ HEAP[x2_sbox | sB] ^ RDF;
15567 S0 = HEAP[sbox | t0] ^ RE0;
15568 S1 = HEAP[sbox | t5] ^ RE1;
15569 S2 = HEAP[sbox | tA] ^ RE2;
15570 S3 = HEAP[sbox | tF] ^ RE3;
15571 S4 = HEAP[sbox | t4] ^ RE4;
15572 S5 = HEAP[sbox | t9] ^ RE5;
15573 S6 = HEAP[sbox | tE] ^ RE6;
15574 S7 = HEAP[sbox | t3] ^ RE7;
15575 S8 = HEAP[sbox | t8] ^ RE8;
15576 S9 = HEAP[sbox | tD] ^ RE9;
15577 SA = HEAP[sbox | t2] ^ REA;
15578 SB = HEAP[sbox | t7] ^ REB;
15579 SC = HEAP[sbox | tC] ^ REC;
15580 SD = HEAP[sbox | t1] ^ RED;
15581 SE = HEAP[sbox | t6] ^ REE;
15582 SF = HEAP[sbox | tB] ^ REF;
15583 }
15584 function _decrypt(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
15585 s0 = s0 | 0;
15586 s1 = s1 | 0;
15587 s2 = s2 | 0;
15588 s3 = s3 | 0;
15589 s4 = s4 | 0;
15590 s5 = s5 | 0;
15591 s6 = s6 | 0;
15592 s7 = s7 | 0;
15593 s8 = s8 | 0;
15594 s9 = s9 | 0;
15595 sA = sA | 0;
15596 sB = sB | 0;
15597 sC = sC | 0;
15598 sD = sD | 0;
15599 sE = sE | 0;
15600 sF = sF | 0;
15601 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;
15602 if ((keySize | 0) == 32) {
15603 t0 = HEAP[inv_sbox | s0 ^ RE0] ^ RD0;
15604 t1 = HEAP[inv_sbox | sD ^ RED] ^ RD1;
15605 t2 = HEAP[inv_sbox | sA ^ REA] ^ RD2;
15606 t3 = HEAP[inv_sbox | s7 ^ RE7] ^ RD3;
15607 t4 = HEAP[inv_sbox | s4 ^ RE4] ^ RD4;
15608 t5 = HEAP[inv_sbox | s1 ^ RE1] ^ RD5;
15609 t6 = HEAP[inv_sbox | sE ^ REE] ^ RD6;
15610 t7 = HEAP[inv_sbox | sB ^ REB] ^ RD7;
15611 t8 = HEAP[inv_sbox | s8 ^ RE8] ^ RD8;
15612 t9 = HEAP[inv_sbox | s5 ^ RE5] ^ RD9;
15613 tA = HEAP[inv_sbox | s2 ^ RE2] ^ RDA;
15614 tB = HEAP[inv_sbox | sF ^ REF] ^ RDB;
15615 tC = HEAP[inv_sbox | sC ^ REC] ^ RDC;
15616 tD = HEAP[inv_sbox | s9 ^ RE9] ^ RDD;
15617 tE = HEAP[inv_sbox | s6 ^ RE6] ^ RDE;
15618 tF = HEAP[inv_sbox | s3 ^ RE3] ^ RDF;
15619 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15620 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15621 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15622 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15623 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15624 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15625 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15626 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15627 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15628 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15629 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15630 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15631 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15632 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15633 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15634 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15635 t0 = HEAP[inv_sbox | s0] ^ RC0;
15636 t1 = HEAP[inv_sbox | s1] ^ RC1;
15637 t2 = HEAP[inv_sbox | s2] ^ RC2;
15638 t3 = HEAP[inv_sbox | s3] ^ RC3;
15639 t4 = HEAP[inv_sbox | s4] ^ RC4;
15640 t5 = HEAP[inv_sbox | s5] ^ RC5;
15641 t6 = HEAP[inv_sbox | s6] ^ RC6;
15642 t7 = HEAP[inv_sbox | s7] ^ RC7;
15643 t8 = HEAP[inv_sbox | s8] ^ RC8;
15644 t9 = HEAP[inv_sbox | s9] ^ RC9;
15645 tA = HEAP[inv_sbox | sA] ^ RCA;
15646 tB = HEAP[inv_sbox | sB] ^ RCB;
15647 tC = HEAP[inv_sbox | sC] ^ RCC;
15648 tD = HEAP[inv_sbox | sD] ^ RCD;
15649 tE = HEAP[inv_sbox | sE] ^ RCE;
15650 tF = HEAP[inv_sbox | sF] ^ RCF;
15651 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15652 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15653 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15654 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15655 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15656 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15657 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15658 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15659 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15660 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15661 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15662 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15663 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15664 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15665 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15666 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15667 t0 = HEAP[inv_sbox | s0] ^ RB0;
15668 t1 = HEAP[inv_sbox | s1] ^ RB1;
15669 t2 = HEAP[inv_sbox | s2] ^ RB2;
15670 t3 = HEAP[inv_sbox | s3] ^ RB3;
15671 t4 = HEAP[inv_sbox | s4] ^ RB4;
15672 t5 = HEAP[inv_sbox | s5] ^ RB5;
15673 t6 = HEAP[inv_sbox | s6] ^ RB6;
15674 t7 = HEAP[inv_sbox | s7] ^ RB7;
15675 t8 = HEAP[inv_sbox | s8] ^ RB8;
15676 t9 = HEAP[inv_sbox | s9] ^ RB9;
15677 tA = HEAP[inv_sbox | sA] ^ RBA;
15678 tB = HEAP[inv_sbox | sB] ^ RBB;
15679 tC = HEAP[inv_sbox | sC] ^ RBC;
15680 tD = HEAP[inv_sbox | sD] ^ RBD;
15681 tE = HEAP[inv_sbox | sE] ^ RBE;
15682 tF = HEAP[inv_sbox | sF] ^ RBF;
15683 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15684 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15685 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15686 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15687 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15688 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15689 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15690 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15691 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15692 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15693 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15694 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15695 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15696 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15697 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15698 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15699 t0 = HEAP[inv_sbox | s0] ^ RA0;
15700 t1 = HEAP[inv_sbox | s1] ^ RA1;
15701 t2 = HEAP[inv_sbox | s2] ^ RA2;
15702 t3 = HEAP[inv_sbox | s3] ^ RA3;
15703 t4 = HEAP[inv_sbox | s4] ^ RA4;
15704 t5 = HEAP[inv_sbox | s5] ^ RA5;
15705 t6 = HEAP[inv_sbox | s6] ^ RA6;
15706 t7 = HEAP[inv_sbox | s7] ^ RA7;
15707 t8 = HEAP[inv_sbox | s8] ^ RA8;
15708 t9 = HEAP[inv_sbox | s9] ^ RA9;
15709 tA = HEAP[inv_sbox | sA] ^ RAA;
15710 tB = HEAP[inv_sbox | sB] ^ RAB;
15711 tC = HEAP[inv_sbox | sC] ^ RAC;
15712 tD = HEAP[inv_sbox | sD] ^ RAD;
15713 tE = HEAP[inv_sbox | sE] ^ RAE;
15714 tF = HEAP[inv_sbox | sF] ^ RAF;
15715 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15716 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15717 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15718 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15719 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15720 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15721 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15722 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15723 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15724 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15725 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15726 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15727 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15728 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15729 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15730 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15731 t0 = HEAP[inv_sbox | s0] ^ R90;
15732 t1 = HEAP[inv_sbox | s1] ^ R91;
15733 t2 = HEAP[inv_sbox | s2] ^ R92;
15734 t3 = HEAP[inv_sbox | s3] ^ R93;
15735 t4 = HEAP[inv_sbox | s4] ^ R94;
15736 t5 = HEAP[inv_sbox | s5] ^ R95;
15737 t6 = HEAP[inv_sbox | s6] ^ R96;
15738 t7 = HEAP[inv_sbox | s7] ^ R97;
15739 t8 = HEAP[inv_sbox | s8] ^ R98;
15740 t9 = HEAP[inv_sbox | s9] ^ R99;
15741 tA = HEAP[inv_sbox | sA] ^ R9A;
15742 tB = HEAP[inv_sbox | sB] ^ R9B;
15743 tC = HEAP[inv_sbox | sC] ^ R9C;
15744 tD = HEAP[inv_sbox | sD] ^ R9D;
15745 tE = HEAP[inv_sbox | sE] ^ R9E;
15746 tF = HEAP[inv_sbox | sF] ^ R9F;
15747 } else {
15748 t0 = HEAP[inv_sbox | s0 ^ RA0] ^ R90;
15749 t1 = HEAP[inv_sbox | sD ^ RAD] ^ R91;
15750 t2 = HEAP[inv_sbox | sA ^ RAA] ^ R92;
15751 t3 = HEAP[inv_sbox | s7 ^ RA7] ^ R93;
15752 t4 = HEAP[inv_sbox | s4 ^ RA4] ^ R94;
15753 t5 = HEAP[inv_sbox | s1 ^ RA1] ^ R95;
15754 t6 = HEAP[inv_sbox | sE ^ RAE] ^ R96;
15755 t7 = HEAP[inv_sbox | sB ^ RAB] ^ R97;
15756 t8 = HEAP[inv_sbox | s8 ^ RA8] ^ R98;
15757 t9 = HEAP[inv_sbox | s5 ^ RA5] ^ R99;
15758 tA = HEAP[inv_sbox | s2 ^ RA2] ^ R9A;
15759 tB = HEAP[inv_sbox | sF ^ RAF] ^ R9B;
15760 tC = HEAP[inv_sbox | sC ^ RAC] ^ R9C;
15761 tD = HEAP[inv_sbox | s9 ^ RA9] ^ R9D;
15762 tE = HEAP[inv_sbox | s6 ^ RA6] ^ R9E;
15763 tF = HEAP[inv_sbox | s3 ^ RA3] ^ R9F;
15764 }
15765 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15766 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15767 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15768 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15769 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15770 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15771 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15772 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15773 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15774 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15775 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15776 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15777 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15778 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15779 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15780 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15781 t0 = HEAP[inv_sbox | s0] ^ R80;
15782 t1 = HEAP[inv_sbox | s1] ^ R81;
15783 t2 = HEAP[inv_sbox | s2] ^ R82;
15784 t3 = HEAP[inv_sbox | s3] ^ R83;
15785 t4 = HEAP[inv_sbox | s4] ^ R84;
15786 t5 = HEAP[inv_sbox | s5] ^ R85;
15787 t6 = HEAP[inv_sbox | s6] ^ R86;
15788 t7 = HEAP[inv_sbox | s7] ^ R87;
15789 t8 = HEAP[inv_sbox | s8] ^ R88;
15790 t9 = HEAP[inv_sbox | s9] ^ R89;
15791 tA = HEAP[inv_sbox | sA] ^ R8A;
15792 tB = HEAP[inv_sbox | sB] ^ R8B;
15793 tC = HEAP[inv_sbox | sC] ^ R8C;
15794 tD = HEAP[inv_sbox | sD] ^ R8D;
15795 tE = HEAP[inv_sbox | sE] ^ R8E;
15796 tF = HEAP[inv_sbox | sF] ^ R8F;
15797 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15798 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15799 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15800 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15801 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15802 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15803 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15804 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15805 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15806 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15807 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15808 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15809 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15810 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15811 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15812 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15813 t0 = HEAP[inv_sbox | s0] ^ R70;
15814 t1 = HEAP[inv_sbox | s1] ^ R71;
15815 t2 = HEAP[inv_sbox | s2] ^ R72;
15816 t3 = HEAP[inv_sbox | s3] ^ R73;
15817 t4 = HEAP[inv_sbox | s4] ^ R74;
15818 t5 = HEAP[inv_sbox | s5] ^ R75;
15819 t6 = HEAP[inv_sbox | s6] ^ R76;
15820 t7 = HEAP[inv_sbox | s7] ^ R77;
15821 t8 = HEAP[inv_sbox | s8] ^ R78;
15822 t9 = HEAP[inv_sbox | s9] ^ R79;
15823 tA = HEAP[inv_sbox | sA] ^ R7A;
15824 tB = HEAP[inv_sbox | sB] ^ R7B;
15825 tC = HEAP[inv_sbox | sC] ^ R7C;
15826 tD = HEAP[inv_sbox | sD] ^ R7D;
15827 tE = HEAP[inv_sbox | sE] ^ R7E;
15828 tF = HEAP[inv_sbox | sF] ^ R7F;
15829 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15830 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15831 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15832 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15833 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15834 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15835 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15836 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15837 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15838 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15839 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15840 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15841 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15842 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15843 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15844 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15845 t0 = HEAP[inv_sbox | s0] ^ R60;
15846 t1 = HEAP[inv_sbox | s1] ^ R61;
15847 t2 = HEAP[inv_sbox | s2] ^ R62;
15848 t3 = HEAP[inv_sbox | s3] ^ R63;
15849 t4 = HEAP[inv_sbox | s4] ^ R64;
15850 t5 = HEAP[inv_sbox | s5] ^ R65;
15851 t6 = HEAP[inv_sbox | s6] ^ R66;
15852 t7 = HEAP[inv_sbox | s7] ^ R67;
15853 t8 = HEAP[inv_sbox | s8] ^ R68;
15854 t9 = HEAP[inv_sbox | s9] ^ R69;
15855 tA = HEAP[inv_sbox | sA] ^ R6A;
15856 tB = HEAP[inv_sbox | sB] ^ R6B;
15857 tC = HEAP[inv_sbox | sC] ^ R6C;
15858 tD = HEAP[inv_sbox | sD] ^ R6D;
15859 tE = HEAP[inv_sbox | sE] ^ R6E;
15860 tF = HEAP[inv_sbox | sF] ^ R6F;
15861 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15862 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15863 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15864 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15865 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15866 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15867 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15868 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15869 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15870 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15871 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15872 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15873 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15874 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15875 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15876 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15877 t0 = HEAP[inv_sbox | s0] ^ R50;
15878 t1 = HEAP[inv_sbox | s1] ^ R51;
15879 t2 = HEAP[inv_sbox | s2] ^ R52;
15880 t3 = HEAP[inv_sbox | s3] ^ R53;
15881 t4 = HEAP[inv_sbox | s4] ^ R54;
15882 t5 = HEAP[inv_sbox | s5] ^ R55;
15883 t6 = HEAP[inv_sbox | s6] ^ R56;
15884 t7 = HEAP[inv_sbox | s7] ^ R57;
15885 t8 = HEAP[inv_sbox | s8] ^ R58;
15886 t9 = HEAP[inv_sbox | s9] ^ R59;
15887 tA = HEAP[inv_sbox | sA] ^ R5A;
15888 tB = HEAP[inv_sbox | sB] ^ R5B;
15889 tC = HEAP[inv_sbox | sC] ^ R5C;
15890 tD = HEAP[inv_sbox | sD] ^ R5D;
15891 tE = HEAP[inv_sbox | sE] ^ R5E;
15892 tF = HEAP[inv_sbox | sF] ^ R5F;
15893 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15894 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15895 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15896 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15897 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15898 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15899 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15900 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15901 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15902 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15903 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15904 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15905 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15906 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15907 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15908 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15909 t0 = HEAP[inv_sbox | s0] ^ R40;
15910 t1 = HEAP[inv_sbox | s1] ^ R41;
15911 t2 = HEAP[inv_sbox | s2] ^ R42;
15912 t3 = HEAP[inv_sbox | s3] ^ R43;
15913 t4 = HEAP[inv_sbox | s4] ^ R44;
15914 t5 = HEAP[inv_sbox | s5] ^ R45;
15915 t6 = HEAP[inv_sbox | s6] ^ R46;
15916 t7 = HEAP[inv_sbox | s7] ^ R47;
15917 t8 = HEAP[inv_sbox | s8] ^ R48;
15918 t9 = HEAP[inv_sbox | s9] ^ R49;
15919 tA = HEAP[inv_sbox | sA] ^ R4A;
15920 tB = HEAP[inv_sbox | sB] ^ R4B;
15921 tC = HEAP[inv_sbox | sC] ^ R4C;
15922 tD = HEAP[inv_sbox | sD] ^ R4D;
15923 tE = HEAP[inv_sbox | sE] ^ R4E;
15924 tF = HEAP[inv_sbox | sF] ^ R4F;
15925 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15926 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15927 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15928 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15929 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15930 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15931 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15932 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15933 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15934 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15935 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15936 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15937 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15938 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15939 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15940 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15941 t0 = HEAP[inv_sbox | s0] ^ R30;
15942 t1 = HEAP[inv_sbox | s1] ^ R31;
15943 t2 = HEAP[inv_sbox | s2] ^ R32;
15944 t3 = HEAP[inv_sbox | s3] ^ R33;
15945 t4 = HEAP[inv_sbox | s4] ^ R34;
15946 t5 = HEAP[inv_sbox | s5] ^ R35;
15947 t6 = HEAP[inv_sbox | s6] ^ R36;
15948 t7 = HEAP[inv_sbox | s7] ^ R37;
15949 t8 = HEAP[inv_sbox | s8] ^ R38;
15950 t9 = HEAP[inv_sbox | s9] ^ R39;
15951 tA = HEAP[inv_sbox | sA] ^ R3A;
15952 tB = HEAP[inv_sbox | sB] ^ R3B;
15953 tC = HEAP[inv_sbox | sC] ^ R3C;
15954 tD = HEAP[inv_sbox | sD] ^ R3D;
15955 tE = HEAP[inv_sbox | sE] ^ R3E;
15956 tF = HEAP[inv_sbox | sF] ^ R3F;
15957 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15958 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15959 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15960 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15961 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15962 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15963 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15964 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15965 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15966 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15967 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
15968 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
15969 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
15970 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
15971 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
15972 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
15973 t0 = HEAP[inv_sbox | s0] ^ R20;
15974 t1 = HEAP[inv_sbox | s1] ^ R21;
15975 t2 = HEAP[inv_sbox | s2] ^ R22;
15976 t3 = HEAP[inv_sbox | s3] ^ R23;
15977 t4 = HEAP[inv_sbox | s4] ^ R24;
15978 t5 = HEAP[inv_sbox | s5] ^ R25;
15979 t6 = HEAP[inv_sbox | s6] ^ R26;
15980 t7 = HEAP[inv_sbox | s7] ^ R27;
15981 t8 = HEAP[inv_sbox | s8] ^ R28;
15982 t9 = HEAP[inv_sbox | s9] ^ R29;
15983 tA = HEAP[inv_sbox | sA] ^ R2A;
15984 tB = HEAP[inv_sbox | sB] ^ R2B;
15985 tC = HEAP[inv_sbox | sC] ^ R2C;
15986 tD = HEAP[inv_sbox | sD] ^ R2D;
15987 tE = HEAP[inv_sbox | sE] ^ R2E;
15988 tF = HEAP[inv_sbox | sF] ^ R2F;
15989 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
15990 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
15991 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
15992 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
15993 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
15994 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
15995 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
15996 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
15997 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
15998 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
15999 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16000 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16001 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16002 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16003 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16004 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16005 t0 = HEAP[inv_sbox | s0] ^ R10;
16006 t1 = HEAP[inv_sbox | s1] ^ R11;
16007 t2 = HEAP[inv_sbox | s2] ^ R12;
16008 t3 = HEAP[inv_sbox | s3] ^ R13;
16009 t4 = HEAP[inv_sbox | s4] ^ R14;
16010 t5 = HEAP[inv_sbox | s5] ^ R15;
16011 t6 = HEAP[inv_sbox | s6] ^ R16;
16012 t7 = HEAP[inv_sbox | s7] ^ R17;
16013 t8 = HEAP[inv_sbox | s8] ^ R18;
16014 t9 = HEAP[inv_sbox | s9] ^ R19;
16015 tA = HEAP[inv_sbox | sA] ^ R1A;
16016 tB = HEAP[inv_sbox | sB] ^ R1B;
16017 tC = HEAP[inv_sbox | sC] ^ R1C;
16018 tD = HEAP[inv_sbox | sD] ^ R1D;
16019 tE = HEAP[inv_sbox | sE] ^ R1E;
16020 tF = HEAP[inv_sbox | sF] ^ R1F;
16021 s0 = HEAP[xE | t0] ^ HEAP[xB | t1] ^ HEAP[xD | t2] ^ HEAP[x9 | t3];
16022 s1 = HEAP[x9 | tC] ^ HEAP[xE | tD] ^ HEAP[xB | tE] ^ HEAP[xD | tF];
16023 s2 = HEAP[xD | t8] ^ HEAP[x9 | t9] ^ HEAP[xE | tA] ^ HEAP[xB | tB];
16024 s3 = HEAP[xB | t4] ^ HEAP[xD | t5] ^ HEAP[x9 | t6] ^ HEAP[xE | t7];
16025 s4 = HEAP[xE | t4] ^ HEAP[xB | t5] ^ HEAP[xD | t6] ^ HEAP[x9 | t7];
16026 s5 = HEAP[x9 | t0] ^ HEAP[xE | t1] ^ HEAP[xB | t2] ^ HEAP[xD | t3];
16027 s6 = HEAP[xD | tC] ^ HEAP[x9 | tD] ^ HEAP[xE | tE] ^ HEAP[xB | tF];
16028 s7 = HEAP[xB | t8] ^ HEAP[xD | t9] ^ HEAP[x9 | tA] ^ HEAP[xE | tB];
16029 s8 = HEAP[xE | t8] ^ HEAP[xB | t9] ^ HEAP[xD | tA] ^ HEAP[x9 | tB];
16030 s9 = HEAP[x9 | t4] ^ HEAP[xE | t5] ^ HEAP[xB | t6] ^ HEAP[xD | t7];
16031 sA = HEAP[xD | t0] ^ HEAP[x9 | t1] ^ HEAP[xE | t2] ^ HEAP[xB | t3];
16032 sB = HEAP[xB | tC] ^ HEAP[xD | tD] ^ HEAP[x9 | tE] ^ HEAP[xE | tF];
16033 sC = HEAP[xE | tC] ^ HEAP[xB | tD] ^ HEAP[xD | tE] ^ HEAP[x9 | tF];
16034 sD = HEAP[x9 | t8] ^ HEAP[xE | t9] ^ HEAP[xB | tA] ^ HEAP[xD | tB];
16035 sE = HEAP[xD | t4] ^ HEAP[x9 | t5] ^ HEAP[xE | t6] ^ HEAP[xB | t7];
16036 sF = HEAP[xB | t0] ^ HEAP[xD | t1] ^ HEAP[x9 | t2] ^ HEAP[xE | t3];
16037 S0 = HEAP[inv_sbox | s0] ^ R00;
16038 S1 = HEAP[inv_sbox | s1] ^ R01;
16039 S2 = HEAP[inv_sbox | s2] ^ R02;
16040 S3 = HEAP[inv_sbox | s3] ^ R03;
16041 S4 = HEAP[inv_sbox | s4] ^ R04;
16042 S5 = HEAP[inv_sbox | s5] ^ R05;
16043 S6 = HEAP[inv_sbox | s6] ^ R06;
16044 S7 = HEAP[inv_sbox | s7] ^ R07;
16045 S8 = HEAP[inv_sbox | s8] ^ R08;
16046 S9 = HEAP[inv_sbox | s9] ^ R09;
16047 SA = HEAP[inv_sbox | sA] ^ R0A;
16048 SB = HEAP[inv_sbox | sB] ^ R0B;
16049 SC = HEAP[inv_sbox | sC] ^ R0C;
16050 SD = HEAP[inv_sbox | sD] ^ R0D;
16051 SE = HEAP[inv_sbox | sE] ^ R0E;
16052 SF = HEAP[inv_sbox | sF] ^ R0F;
16053 }
16054 function init_state(s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sA, sB, sC, sD, sE, sF) {
16055 s0 = s0 | 0;
16056 s1 = s1 | 0;
16057 s2 = s2 | 0;
16058 s3 = s3 | 0;
16059 s4 = s4 | 0;
16060 s5 = s5 | 0;
16061 s6 = s6 | 0;
16062 s7 = s7 | 0;
16063 s8 = s8 | 0;
16064 s9 = s9 | 0;
16065 sA = sA | 0;
16066 sB = sB | 0;
16067 sC = sC | 0;
16068 sD = sD | 0;
16069 sE = sE | 0;
16070 sF = sF | 0;
16071 S0 = s0;
16072 S1 = s1;
16073 S2 = s2;
16074 S3 = s3;
16075 S4 = s4;
16076 S5 = s5;
16077 S6 = s6;
16078 S7 = s7;
16079 S8 = s8;
16080 S9 = s9;
16081 SA = sA;
16082 SB = sB;
16083 SC = sC;
16084 SD = sD;
16085 SE = sE;
16086 SF = sF;
16087 }
16088 function save_state(offset) {
16089 offset = offset | 0;
16090 HEAP[offset] = S0;
16091 HEAP[offset | 1] = S1;
16092 HEAP[offset | 2] = S2;
16093 HEAP[offset | 3] = S3;
16094 HEAP[offset | 4] = S4;
16095 HEAP[offset | 5] = S5;
16096 HEAP[offset | 6] = S6;
16097 HEAP[offset | 7] = S7;
16098 HEAP[offset | 8] = S8;
16099 HEAP[offset | 9] = S9;
16100 HEAP[offset | 10] = SA;
16101 HEAP[offset | 11] = SB;
16102 HEAP[offset | 12] = SC;
16103 HEAP[offset | 13] = SD;
16104 HEAP[offset | 14] = SE;
16105 HEAP[offset | 15] = SF;
16106 }
16107 function init_key_128(k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, kA, kB, kC, kD, kE, kF) {
16108 k0 = k0 | 0;
16109 k1 = k1 | 0;
16110 k2 = k2 | 0;
16111 k3 = k3 | 0;
16112 k4 = k4 | 0;
16113 k5 = k5 | 0;
16114 k6 = k6 | 0;
16115 k7 = k7 | 0;
16116 k8 = k8 | 0;
16117 k9 = k9 | 0;
16118 kA = kA | 0;
16119 kB = kB | 0;
16120 kC = kC | 0;
16121 kD = kD | 0;
16122 kE = kE | 0;
16123 kF = kF | 0;
16124 R00 = k0;
16125 R01 = k1;
16126 R02 = k2;
16127 R03 = k3;
16128 R04 = k4;
16129 R05 = k5;
16130 R06 = k6;
16131 R07 = k7;
16132 R08 = k8;
16133 R09 = k9;
16134 R0A = kA;
16135 R0B = kB;
16136 R0C = kC;
16137 R0D = kD;
16138 R0E = kE;
16139 R0F = kF;
16140 keySize = 16;
16141 _expand_key_128();
16142 }
16143 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) {
16144 k00 = k00 | 0;
16145 k01 = k01 | 0;
16146 k02 = k02 | 0;
16147 k03 = k03 | 0;
16148 k04 = k04 | 0;
16149 k05 = k05 | 0;
16150 k06 = k06 | 0;
16151 k07 = k07 | 0;
16152 k08 = k08 | 0;
16153 k09 = k09 | 0;
16154 k0A = k0A | 0;
16155 k0B = k0B | 0;
16156 k0C = k0C | 0;
16157 k0D = k0D | 0;
16158 k0E = k0E | 0;
16159 k0F = k0F | 0;
16160 k10 = k10 | 0;
16161 k11 = k11 | 0;
16162 k12 = k12 | 0;
16163 k13 = k13 | 0;
16164 k14 = k14 | 0;
16165 k15 = k15 | 0;
16166 k16 = k16 | 0;
16167 k17 = k17 | 0;
16168 k18 = k18 | 0;
16169 k19 = k19 | 0;
16170 k1A = k1A | 0;
16171 k1B = k1B | 0;
16172 k1C = k1C | 0;
16173 k1D = k1D | 0;
16174 k1E = k1E | 0;
16175 k1F = k1F | 0;
16176 R00 = k00;
16177 R01 = k01;
16178 R02 = k02;
16179 R03 = k03;
16180 R04 = k04;
16181 R05 = k05;
16182 R06 = k06;
16183 R07 = k07;
16184 R08 = k08;
16185 R09 = k09;
16186 R0A = k0A;
16187 R0B = k0B;
16188 R0C = k0C;
16189 R0D = k0D;
16190 R0E = k0E;
16191 R0F = k0F;
16192 R10 = k10;
16193 R11 = k11;
16194 R12 = k12;
16195 R13 = k13;
16196 R14 = k14;
16197 R15 = k15;
16198 R16 = k16;
16199 R17 = k17;
16200 R18 = k18;
16201 R19 = k19;
16202 R1A = k1A;
16203 R1B = k1B;
16204 R1C = k1C;
16205 R1D = k1D;
16206 R1E = k1E;
16207 R1F = k1F;
16208 keySize = 32;
16209 _expand_key_256();
16210 }
16211 function cbc_encrypt(offset, length) {
16212 offset = offset | 0;
16213 length = length | 0;
16214 var encrypted = 0;
16215 if (offset & 15) return -1;
16216 while ((length | 0) >= 16) {
16217 _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]);
16218 HEAP[offset] = S0;
16219 HEAP[offset | 1] = S1;
16220 HEAP[offset | 2] = S2;
16221 HEAP[offset | 3] = S3;
16222 HEAP[offset | 4] = S4;
16223 HEAP[offset | 5] = S5;
16224 HEAP[offset | 6] = S6;
16225 HEAP[offset | 7] = S7;
16226 HEAP[offset | 8] = S8;
16227 HEAP[offset | 9] = S9;
16228 HEAP[offset | 10] = SA;
16229 HEAP[offset | 11] = SB;
16230 HEAP[offset | 12] = SC;
16231 HEAP[offset | 13] = SD;
16232 HEAP[offset | 14] = SE;
16233 HEAP[offset | 15] = SF;
16234 offset = offset + 16 | 0;
16235 length = length - 16 | 0;
16236 encrypted = encrypted + 16 | 0;
16237 }
16238 return encrypted | 0;
16239 }
16240 function cbc_decrypt(offset, length) {
16241 offset = offset | 0;
16242 length = length | 0;
16243 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;
16244 if (offset & 15) return -1;
16245 iv0 = S0;
16246 iv1 = S1;
16247 iv2 = S2;
16248 iv3 = S3;
16249 iv4 = S4;
16250 iv5 = S5;
16251 iv6 = S6;
16252 iv7 = S7;
16253 iv8 = S8;
16254 iv9 = S9;
16255 ivA = SA;
16256 ivB = SB;
16257 ivC = SC;
16258 ivD = SD;
16259 ivE = SE;
16260 ivF = SF;
16261 while ((length | 0) >= 16) {
16262 _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);
16263 S0 = S0 ^ iv0;
16264 iv0 = HEAP[offset] | 0;
16265 S1 = S1 ^ iv1;
16266 iv1 = HEAP[offset | 1] | 0;
16267 S2 = S2 ^ iv2;
16268 iv2 = HEAP[offset | 2] | 0;
16269 S3 = S3 ^ iv3;
16270 iv3 = HEAP[offset | 3] | 0;
16271 S4 = S4 ^ iv4;
16272 iv4 = HEAP[offset | 4] | 0;
16273 S5 = S5 ^ iv5;
16274 iv5 = HEAP[offset | 5] | 0;
16275 S6 = S6 ^ iv6;
16276 iv6 = HEAP[offset | 6] | 0;
16277 S7 = S7 ^ iv7;
16278 iv7 = HEAP[offset | 7] | 0;
16279 S8 = S8 ^ iv8;
16280 iv8 = HEAP[offset | 8] | 0;
16281 S9 = S9 ^ iv9;
16282 iv9 = HEAP[offset | 9] | 0;
16283 SA = SA ^ ivA;
16284 ivA = HEAP[offset | 10] | 0;
16285 SB = SB ^ ivB;
16286 ivB = HEAP[offset | 11] | 0;
16287 SC = SC ^ ivC;
16288 ivC = HEAP[offset | 12] | 0;
16289 SD = SD ^ ivD;
16290 ivD = HEAP[offset | 13] | 0;
16291 SE = SE ^ ivE;
16292 ivE = HEAP[offset | 14] | 0;
16293 SF = SF ^ ivF;
16294 ivF = HEAP[offset | 15] | 0;
16295 HEAP[offset] = S0;
16296 HEAP[offset | 1] = S1;
16297 HEAP[offset | 2] = S2;
16298 HEAP[offset | 3] = S3;
16299 HEAP[offset | 4] = S4;
16300 HEAP[offset | 5] = S5;
16301 HEAP[offset | 6] = S6;
16302 HEAP[offset | 7] = S7;
16303 HEAP[offset | 8] = S8;
16304 HEAP[offset | 9] = S9;
16305 HEAP[offset | 10] = SA;
16306 HEAP[offset | 11] = SB;
16307 HEAP[offset | 12] = SC;
16308 HEAP[offset | 13] = SD;
16309 HEAP[offset | 14] = SE;
16310 HEAP[offset | 15] = SF;
16311 offset = offset + 16 | 0;
16312 length = length - 16 | 0;
16313 decrypted = decrypted + 16 | 0;
16314 }
16315 S0 = iv0;
16316 S1 = iv1;
16317 S2 = iv2;
16318 S3 = iv3;
16319 S4 = iv4;
16320 S5 = iv5;
16321 S6 = iv6;
16322 S7 = iv7;
16323 S8 = iv8;
16324 S9 = iv9;
16325 SA = ivA;
16326 SB = ivB;
16327 SC = ivC;
16328 SD = ivD;
16329 SE = ivE;
16330 SF = ivF;
16331 return decrypted | 0;
16332 }
16333 function cbc_mac(offset, length, output) {
16334 offset = offset | 0;
16335 length = length | 0;
16336 output = output | 0;
16337 if (offset & 15) return -1;
16338 if (~output) if (output & 31) return -1;
16339 while ((length | 0) >= 16) {
16340 _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]);
16341 offset = offset + 16 | 0;
16342 length = length - 16 | 0;
16343 }
16344 if ((length | 0) > 0) {
16345 S0 = S0 ^ HEAP[offset];
16346 if ((length | 0) > 1) S1 = S1 ^ HEAP[offset | 1];
16347 if ((length | 0) > 2) S2 = S2 ^ HEAP[offset | 2];
16348 if ((length | 0) > 3) S3 = S3 ^ HEAP[offset | 3];
16349 if ((length | 0) > 4) S4 = S4 ^ HEAP[offset | 4];
16350 if ((length | 0) > 5) S5 = S5 ^ HEAP[offset | 5];
16351 if ((length | 0) > 6) S6 = S6 ^ HEAP[offset | 6];
16352 if ((length | 0) > 7) S7 = S7 ^ HEAP[offset | 7];
16353 if ((length | 0) > 8) S8 = S8 ^ HEAP[offset | 8];
16354 if ((length | 0) > 9) S9 = S9 ^ HEAP[offset | 9];
16355 if ((length | 0) > 10) SA = SA ^ HEAP[offset | 10];
16356 if ((length | 0) > 11) SB = SB ^ HEAP[offset | 11];
16357 if ((length | 0) > 12) SC = SC ^ HEAP[offset | 12];
16358 if ((length | 0) > 13) SD = SD ^ HEAP[offset | 13];
16359 if ((length | 0) > 14) SE = SE ^ HEAP[offset | 14];
16360 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16361 offset = offset + length | 0;
16362 length = 0;
16363 }
16364 if (~output) {
16365 HEAP[output | 0] = S0;
16366 HEAP[output | 1] = S1;
16367 HEAP[output | 2] = S2;
16368 HEAP[output | 3] = S3;
16369 HEAP[output | 4] = S4;
16370 HEAP[output | 5] = S5;
16371 HEAP[output | 6] = S6;
16372 HEAP[output | 7] = S7;
16373 HEAP[output | 8] = S8;
16374 HEAP[output | 9] = S9;
16375 HEAP[output | 10] = SA;
16376 HEAP[output | 11] = SB;
16377 HEAP[output | 12] = SC;
16378 HEAP[output | 13] = SD;
16379 HEAP[output | 14] = SE;
16380 HEAP[output | 15] = SF;
16381 }
16382 return 0;
16383 }
16384 function ccm_encrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16385 offset = offset | 0;
16386 length = length | 0;
16387 nonce0 = nonce0 | 0;
16388 nonce1 = nonce1 | 0;
16389 nonce2 = nonce2 | 0;
16390 nonce3 = nonce3 | 0;
16391 nonce4 = nonce4 | 0;
16392 nonce5 = nonce5 | 0;
16393 nonce6 = nonce6 | 0;
16394 nonce7 = nonce7 | 0;
16395 nonce8 = nonce8 | 0;
16396 nonce9 = nonce9 | 0;
16397 nonceA = nonceA | 0;
16398 nonceB = nonceB | 0;
16399 nonceC = nonceC | 0;
16400 nonceD = nonceD | 0;
16401 counter0 = counter0 | 0;
16402 counter1 = counter1 | 0;
16403 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;
16404 if (offset & 15) return -1;
16405 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16406 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16407 while ((length | 0) >= 16) {
16408 s0 = HEAP[offset] | 0;
16409 s1 = HEAP[offset | 1] | 0;
16410 s2 = HEAP[offset | 2] | 0;
16411 s3 = HEAP[offset | 3] | 0;
16412 s4 = HEAP[offset | 4] | 0;
16413 s5 = HEAP[offset | 5] | 0;
16414 s6 = HEAP[offset | 6] | 0;
16415 s7 = HEAP[offset | 7] | 0;
16416 s8 = HEAP[offset | 8] | 0;
16417 s9 = HEAP[offset | 9] | 0;
16418 sA = HEAP[offset | 10] | 0;
16419 sB = HEAP[offset | 11] | 0;
16420 sC = HEAP[offset | 12] | 0;
16421 sD = HEAP[offset | 13] | 0;
16422 sE = HEAP[offset | 14] | 0;
16423 sF = HEAP[offset | 15] | 0;
16424 _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);
16425 HEAP[offset] = s0 ^ S0;
16426 HEAP[offset | 1] = s1 ^ S1;
16427 HEAP[offset | 2] = s2 ^ S2;
16428 HEAP[offset | 3] = s3 ^ S3;
16429 HEAP[offset | 4] = s4 ^ S4;
16430 HEAP[offset | 5] = s5 ^ S5;
16431 HEAP[offset | 6] = s6 ^ S6;
16432 HEAP[offset | 7] = s7 ^ S7;
16433 HEAP[offset | 8] = s8 ^ S8;
16434 HEAP[offset | 9] = s9 ^ S9;
16435 HEAP[offset | 10] = sA ^ SA;
16436 HEAP[offset | 11] = sB ^ SB;
16437 HEAP[offset | 12] = sC ^ SC;
16438 HEAP[offset | 13] = sD ^ SD;
16439 HEAP[offset | 14] = sE ^ SE;
16440 HEAP[offset | 15] = sF ^ SF;
16441 _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);
16442 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16443 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16444 encrypted = encrypted + 16 | 0;
16445 offset = offset + 16 | 0;
16446 length = length - 16 | 0;
16447 counter1 = counter1 + 1 | 0;
16448 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16449 }
16450 if ((length | 0) > 0) {
16451 s0 = HEAP[offset] | 0;
16452 s1 = (length | 0) > 1 ? HEAP[offset | 1] | 0 : 0;
16453 s2 = (length | 0) > 2 ? HEAP[offset | 2] | 0 : 0;
16454 s3 = (length | 0) > 3 ? HEAP[offset | 3] | 0 : 0;
16455 s4 = (length | 0) > 4 ? HEAP[offset | 4] | 0 : 0;
16456 s5 = (length | 0) > 5 ? HEAP[offset | 5] | 0 : 0;
16457 s6 = (length | 0) > 6 ? HEAP[offset | 6] | 0 : 0;
16458 s7 = (length | 0) > 7 ? HEAP[offset | 7] | 0 : 0;
16459 s8 = (length | 0) > 8 ? HEAP[offset | 8] | 0 : 0;
16460 s9 = (length | 0) > 9 ? HEAP[offset | 9] | 0 : 0;
16461 sA = (length | 0) > 10 ? HEAP[offset | 10] | 0 : 0;
16462 sB = (length | 0) > 11 ? HEAP[offset | 11] | 0 : 0;
16463 sC = (length | 0) > 12 ? HEAP[offset | 12] | 0 : 0;
16464 sD = (length | 0) > 13 ? HEAP[offset | 13] | 0 : 0;
16465 sE = (length | 0) > 14 ? HEAP[offset | 14] | 0 : 0;
16466 _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);
16467 HEAP[offset] = s0 ^ S0;
16468 if ((length | 0) > 1) HEAP[offset | 1] = s1 ^ S1;
16469 if ((length | 0) > 2) HEAP[offset | 2] = s2 ^ S2;
16470 if ((length | 0) > 3) HEAP[offset | 3] = s3 ^ S3;
16471 if ((length | 0) > 4) HEAP[offset | 4] = s4 ^ S4;
16472 if ((length | 0) > 5) HEAP[offset | 5] = s5 ^ S5;
16473 if ((length | 0) > 6) HEAP[offset | 6] = s6 ^ S6;
16474 if ((length | 0) > 7) HEAP[offset | 7] = s7 ^ S7;
16475 if ((length | 0) > 8) HEAP[offset | 8] = s8 ^ S8;
16476 if ((length | 0) > 9) HEAP[offset | 9] = s9 ^ S9;
16477 if ((length | 0) > 10) HEAP[offset | 10] = sA ^ SA;
16478 if ((length | 0) > 11) HEAP[offset | 11] = sB ^ SB;
16479 if ((length | 0) > 12) HEAP[offset | 12] = sC ^ SC;
16480 if ((length | 0) > 13) HEAP[offset | 13] = sD ^ SD;
16481 if ((length | 0) > 14) HEAP[offset | 14] = sE ^ SE;
16482 _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);
16483 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16484 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16485 encrypted = encrypted + length | 0;
16486 offset = offset + length | 0;
16487 length = 0;
16488 counter1 = counter1 + 1 | 0;
16489 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16490 }
16491 return encrypted | 0;
16492 }
16493 function ccm_decrypt(offset, length, nonce0, nonce1, nonce2, nonce3, nonce4, nonce5, nonce6, nonce7, nonce8, nonce9, nonceA, nonceB, nonceC, nonceD, counter0, counter1) {
16494 offset = offset | 0;
16495 length = length | 0;
16496 nonce0 = nonce0 | 0;
16497 nonce1 = nonce1 | 0;
16498 nonce2 = nonce2 | 0;
16499 nonce3 = nonce3 | 0;
16500 nonce4 = nonce4 | 0;
16501 nonce5 = nonce5 | 0;
16502 nonce6 = nonce6 | 0;
16503 nonce7 = nonce7 | 0;
16504 nonce8 = nonce8 | 0;
16505 nonce9 = nonce9 | 0;
16506 nonceA = nonceA | 0;
16507 nonceB = nonceB | 0;
16508 nonceC = nonceC | 0;
16509 nonceD = nonceD | 0;
16510 counter0 = counter0 | 0;
16511 counter1 = counter1 | 0;
16512 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;
16513 if (offset & 15) return -1;
16514 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16515 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16516 while ((length | 0) >= 16) {
16517 _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);
16518 HEAP[offset] = s0 = HEAP[offset] ^ S0;
16519 HEAP[offset | 1] = s1 = HEAP[offset | 1] ^ S1;
16520 HEAP[offset | 2] = s2 = HEAP[offset | 2] ^ S2;
16521 HEAP[offset | 3] = s3 = HEAP[offset | 3] ^ S3;
16522 HEAP[offset | 4] = s4 = HEAP[offset | 4] ^ S4;
16523 HEAP[offset | 5] = s5 = HEAP[offset | 5] ^ S5;
16524 HEAP[offset | 6] = s6 = HEAP[offset | 6] ^ S6;
16525 HEAP[offset | 7] = s7 = HEAP[offset | 7] ^ S7;
16526 HEAP[offset | 8] = s8 = HEAP[offset | 8] ^ S8;
16527 HEAP[offset | 9] = s9 = HEAP[offset | 9] ^ S9;
16528 HEAP[offset | 10] = sA = HEAP[offset | 10] ^ SA;
16529 HEAP[offset | 11] = sB = HEAP[offset | 11] ^ SB;
16530 HEAP[offset | 12] = sC = HEAP[offset | 12] ^ SC;
16531 HEAP[offset | 13] = sD = HEAP[offset | 13] ^ SD;
16532 HEAP[offset | 14] = sE = HEAP[offset | 14] ^ SE;
16533 HEAP[offset | 15] = sF = HEAP[offset | 15] ^ SF;
16534 _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);
16535 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16536 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16537 decrypted = decrypted + 16 | 0;
16538 offset = offset + 16 | 0;
16539 length = length - 16 | 0;
16540 counter1 = counter1 + 1 | 0;
16541 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16542 }
16543 if ((length | 0) > 0) {
16544 _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);
16545 s0 = HEAP[offset] ^ S0;
16546 s1 = (length | 0) > 1 ? HEAP[offset | 1] ^ S1 : 0;
16547 s2 = (length | 0) > 2 ? HEAP[offset | 2] ^ S2 : 0;
16548 s3 = (length | 0) > 3 ? HEAP[offset | 3] ^ S3 : 0;
16549 s4 = (length | 0) > 4 ? HEAP[offset | 4] ^ S4 : 0;
16550 s5 = (length | 0) > 5 ? HEAP[offset | 5] ^ S5 : 0;
16551 s6 = (length | 0) > 6 ? HEAP[offset | 6] ^ S6 : 0;
16552 s7 = (length | 0) > 7 ? HEAP[offset | 7] ^ S7 : 0;
16553 s8 = (length | 0) > 8 ? HEAP[offset | 8] ^ S8 : 0;
16554 s9 = (length | 0) > 9 ? HEAP[offset | 9] ^ S9 : 0;
16555 sA = (length | 0) > 10 ? HEAP[offset | 10] ^ SA : 0;
16556 sB = (length | 0) > 11 ? HEAP[offset | 11] ^ SB : 0;
16557 sC = (length | 0) > 12 ? HEAP[offset | 12] ^ SC : 0;
16558 sD = (length | 0) > 13 ? HEAP[offset | 13] ^ SD : 0;
16559 sE = (length | 0) > 14 ? HEAP[offset | 14] ^ SE : 0;
16560 sF = (length | 0) > 15 ? HEAP[offset | 15] ^ SF : 0;
16561 HEAP[offset] = s0;
16562 if ((length | 0) > 1) HEAP[offset | 1] = s1;
16563 if ((length | 0) > 2) HEAP[offset | 2] = s2;
16564 if ((length | 0) > 3) HEAP[offset | 3] = s3;
16565 if ((length | 0) > 4) HEAP[offset | 4] = s4;
16566 if ((length | 0) > 5) HEAP[offset | 5] = s5;
16567 if ((length | 0) > 6) HEAP[offset | 6] = s6;
16568 if ((length | 0) > 7) HEAP[offset | 7] = s7;
16569 if ((length | 0) > 8) HEAP[offset | 8] = s8;
16570 if ((length | 0) > 9) HEAP[offset | 9] = s9;
16571 if ((length | 0) > 10) HEAP[offset | 10] = sA;
16572 if ((length | 0) > 11) HEAP[offset | 11] = sB;
16573 if ((length | 0) > 12) HEAP[offset | 12] = sC;
16574 if ((length | 0) > 13) HEAP[offset | 13] = sD;
16575 if ((length | 0) > 14) HEAP[offset | 14] = sE;
16576 _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);
16577 iv0 = S0, iv1 = S1, iv2 = S2, iv3 = S3, iv4 = S4, iv5 = S5, iv6 = S6, iv7 = S7,
16578 iv8 = S8, iv9 = S9, ivA = SA, ivB = SB, ivC = SC, ivD = SD, ivE = SE, ivF = SF;
16579 decrypted = decrypted + length | 0;
16580 offset = offset + length | 0;
16581 length = 0;
16582 counter1 = counter1 + 1 | 0;
16583 if ((counter1 | 0) == 0) counter0 = counter0 + 1 | 0;
16584 }
16585 return decrypted | 0;
16586 }
16587 function cfb_encrypt(offset, length) {
16588 offset = offset | 0;
16589 length = length | 0;
16590 var encrypted = 0;
16591 if (offset & 15) return -1;
16592 while ((length | 0) >= 16) {
16593 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16594 S0 = S0 ^ HEAP[offset];
16595 S1 = S1 ^ HEAP[offset | 1];
16596 S2 = S2 ^ HEAP[offset | 2];
16597 S3 = S3 ^ HEAP[offset | 3];
16598 S4 = S4 ^ HEAP[offset | 4];
16599 S5 = S5 ^ HEAP[offset | 5];
16600 S6 = S6 ^ HEAP[offset | 6];
16601 S7 = S7 ^ HEAP[offset | 7];
16602 S8 = S8 ^ HEAP[offset | 8];
16603 S9 = S9 ^ HEAP[offset | 9];
16604 SA = SA ^ HEAP[offset | 10];
16605 SB = SB ^ HEAP[offset | 11];
16606 SC = SC ^ HEAP[offset | 12];
16607 SD = SD ^ HEAP[offset | 13];
16608 SE = SE ^ HEAP[offset | 14];
16609 SF = SF ^ HEAP[offset | 15];
16610 HEAP[offset] = S0;
16611 HEAP[offset | 1] = S1;
16612 HEAP[offset | 2] = S2;
16613 HEAP[offset | 3] = S3;
16614 HEAP[offset | 4] = S4;
16615 HEAP[offset | 5] = S5;
16616 HEAP[offset | 6] = S6;
16617 HEAP[offset | 7] = S7;
16618 HEAP[offset | 8] = S8;
16619 HEAP[offset | 9] = S9;
16620 HEAP[offset | 10] = SA;
16621 HEAP[offset | 11] = SB;
16622 HEAP[offset | 12] = SC;
16623 HEAP[offset | 13] = SD;
16624 HEAP[offset | 14] = SE;
16625 HEAP[offset | 15] = SF;
16626 offset = offset + 16 | 0;
16627 length = length - 16 | 0;
16628 encrypted = encrypted + 16 | 0;
16629 }
16630 if ((length | 0) > 0) {
16631 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16632 HEAP[offset] = HEAP[offset] ^ S0;
16633 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16634 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16635 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16636 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16637 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16638 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16639 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16640 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16641 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16642 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16643 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16644 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16645 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16646 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16647 encrypted = encrypted + length | 0;
16648 offset = offset + length | 0;
16649 length = 0;
16650 }
16651 return encrypted | 0;
16652 }
16653 function cfb_decrypt(offset, length) {
16654 offset = offset | 0;
16655 length = length | 0;
16656 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;
16657 if (offset & 15) return -1;
16658 while ((length | 0) >= 16) {
16659 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16660 iv0 = HEAP[offset] | 0;
16661 iv1 = HEAP[offset | 1] | 0;
16662 iv2 = HEAP[offset | 2] | 0;
16663 iv3 = HEAP[offset | 3] | 0;
16664 iv4 = HEAP[offset | 4] | 0;
16665 iv5 = HEAP[offset | 5] | 0;
16666 iv6 = HEAP[offset | 6] | 0;
16667 iv7 = HEAP[offset | 7] | 0;
16668 iv8 = HEAP[offset | 8] | 0;
16669 iv9 = HEAP[offset | 9] | 0;
16670 ivA = HEAP[offset | 10] | 0;
16671 ivB = HEAP[offset | 11] | 0;
16672 ivC = HEAP[offset | 12] | 0;
16673 ivD = HEAP[offset | 13] | 0;
16674 ivE = HEAP[offset | 14] | 0;
16675 ivF = HEAP[offset | 15] | 0;
16676 HEAP[offset] = S0 ^ iv0;
16677 HEAP[offset | 1] = S1 ^ iv1;
16678 HEAP[offset | 2] = S2 ^ iv2;
16679 HEAP[offset | 3] = S3 ^ iv3;
16680 HEAP[offset | 4] = S4 ^ iv4;
16681 HEAP[offset | 5] = S5 ^ iv5;
16682 HEAP[offset | 6] = S6 ^ iv6;
16683 HEAP[offset | 7] = S7 ^ iv7;
16684 HEAP[offset | 8] = S8 ^ iv8;
16685 HEAP[offset | 9] = S9 ^ iv9;
16686 HEAP[offset | 10] = SA ^ ivA;
16687 HEAP[offset | 11] = SB ^ ivB;
16688 HEAP[offset | 12] = SC ^ ivC;
16689 HEAP[offset | 13] = SD ^ ivD;
16690 HEAP[offset | 14] = SE ^ ivE;
16691 HEAP[offset | 15] = SF ^ ivF;
16692 S0 = iv0;
16693 S1 = iv1;
16694 S2 = iv2;
16695 S3 = iv3;
16696 S4 = iv4;
16697 S5 = iv5;
16698 S6 = iv6;
16699 S7 = iv7;
16700 S8 = iv8;
16701 S9 = iv9;
16702 SA = ivA;
16703 SB = ivB;
16704 SC = ivC;
16705 SD = ivD;
16706 SE = ivE;
16707 SF = ivF;
16708 offset = offset + 16 | 0;
16709 length = length - 16 | 0;
16710 decrypted = decrypted + 16 | 0;
16711 }
16712 if ((length | 0) > 0) {
16713 _encrypt(S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, SA, SB, SC, SD, SE, SF);
16714 HEAP[offset] = HEAP[offset] ^ S0;
16715 if ((length | 0) > 1) HEAP[offset | 1] = HEAP[offset | 1] ^ S1;
16716 if ((length | 0) > 2) HEAP[offset | 2] = HEAP[offset | 2] ^ S2;
16717 if ((length | 0) > 3) HEAP[offset | 3] = HEAP[offset | 3] ^ S3;
16718 if ((length | 0) > 4) HEAP[offset | 4] = HEAP[offset | 4] ^ S4;
16719 if ((length | 0) > 5) HEAP[offset | 5] = HEAP[offset | 5] ^ S5;
16720 if ((length | 0) > 6) HEAP[offset | 6] = HEAP[offset | 6] ^ S6;
16721 if ((length | 0) > 7) HEAP[offset | 7] = HEAP[offset | 7] ^ S7;
16722 if ((length | 0) > 8) HEAP[offset | 8] = HEAP[offset | 8] ^ S8;
16723 if ((length | 0) > 9) HEAP[offset | 9] = HEAP[offset | 9] ^ S9;
16724 if ((length | 0) > 10) HEAP[offset | 10] = HEAP[offset | 10] ^ SA;
16725 if ((length | 0) > 11) HEAP[offset | 11] = HEAP[offset | 11] ^ SB;
16726 if ((length | 0) > 12) HEAP[offset | 12] = HEAP[offset | 12] ^ SC;
16727 if ((length | 0) > 13) HEAP[offset | 13] = HEAP[offset | 13] ^ SD;
16728 if ((length | 0) > 14) HEAP[offset | 14] = HEAP[offset | 14] ^ SE;
16729 decrypted = decrypted + length | 0;
16730 offset = offset + length | 0;
16731 length = 0;
16732 }
16733 return decrypted | 0;
16734 }
16735 return {
16736 init_state: init_state,
16737 save_state: save_state,
16738 init_key_128: init_key_128,
16739 init_key_256: init_key_256,
16740 cbc_encrypt: cbc_encrypt,
16741 cbc_decrypt: cbc_decrypt,
16742 cbc_mac: cbc_mac,
16743 ccm_encrypt: ccm_encrypt,
16744 ccm_decrypt: ccm_decrypt,
16745 cfb_encrypt: cfb_encrypt,
16746 cfb_decrypt: cfb_decrypt
16747 };
16748 }
16749 function aes_asm(stdlib, foreign, buffer) {
16750 var heap = new Uint8Array(buffer);
16751 heap.set(_aes_tables);
16752 return _aes_asm(stdlib, foreign, buffer);
16753 }
16754 var _aes_block_size = 16;
16755 function _aes_constructor(options) {
16756 options = options || {};
16757 options.heapSize = options.heapSize || 4096;
16758 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
16759 this.BLOCK_SIZE = _aes_block_size;
16760 this.heap = options.heap || new Uint8Array(options.heapSize);
16761 this.asm = options.asm || aes_asm(global, null, this.heap.buffer);
16762 this.pos = _aes_heap_start;
16763 this.len = 0;
16764 this.key = null;
16765 this.result = null;
16766 this.reset(options);
16767 }
16768 function _aes_reset(options) {
16769 options = options || {};
16770 this.result = null;
16771 this.pos = _aes_heap_start;
16772 this.len = 0;
16773 var asm = this.asm;
16774 var key = options.key;
16775 if (key !== undefined) {
16776 if (is_buffer(key) || is_bytes(key)) {
16777 key = new Uint8Array(key);
16778 } else if (is_string(key)) {
16779 var str = key;
16780 key = new Uint8Array(str.length);
16781 for (var i = 0; i < str.length; ++i) key[i] = str.charCodeAt(i);
16782 } else {
16783 throw new TypeError("unexpected key type");
16784 }
16785 if (key.length === 16) {
16786 this.key = key;
16787 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]);
16788 } else if (key.length === 24) {
16789 throw new IllegalArgumentError("illegal key size");
16790 } else if (key.length === 32) {
16791 this.key = key;
16792 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]);
16793 } else {
16794 throw new IllegalArgumentError("illegal key size");
16795 }
16796 }
16797 return this;
16798 }
16799 function _aes_init_iv(iv) {
16800 var asm = this.asm;
16801 if (iv !== undefined) {
16802 if (is_buffer(iv) || is_bytes(iv)) {
16803 iv = new Uint8Array(iv);
16804 } else if (is_string(iv)) {
16805 var str = iv;
16806 iv = new Uint8Array(str.length);
16807 for (var i = 0; i < str.length; ++i) iv[i] = str.charCodeAt(i);
16808 } else {
16809 throw new TypeError("unexpected iv type");
16810 }
16811 if (iv.length !== _aes_block_size) throw new IllegalArgumentError("illegal iv size");
16812 this.iv = iv;
16813 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]);
16814 } else {
16815 this.iv = null;
16816 asm.init_state.call(asm, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0);
16817 }
16818 }
16819 function _aes_heap_write(heap, hpos, data, dpos, dlen) {
16820 var hlen = heap.byteLength - hpos, wlen = hlen < dlen ? hlen : dlen;
16821 if (is_buffer(data) || is_bytes(data)) {
16822 heap.set(new Uint8Array(data.buffer || data, dpos, wlen), hpos);
16823 } else if (is_string(data)) {
16824 for (var i = 0; i < wlen; ++i) heap[hpos + i] = data.charCodeAt(dpos + i);
16825 } else {
16826 throw new TypeError("unexpected data type");
16827 }
16828 return wlen;
16829 }
16830 function cbc_aes_constructor(options) {
16831 this.padding = true;
16832 this.mode = "cbc";
16833 this.iv = null;
16834 _aes_constructor.call(this, options);
16835 }
16836 function cbc_aes_encrypt_constructor(options) {
16837 cbc_aes_constructor.call(this, options);
16838 }
16839 function cbc_aes_decrypt_constructor(options) {
16840 cbc_aes_constructor.call(this, options);
16841 }
16842 function cbc_aes_reset(options) {
16843 options = options || {};
16844 _aes_reset.call(this, options);
16845 var padding = options.padding;
16846 if (padding !== undefined) {
16847 this.padding = !!padding;
16848 } else {
16849 this.padding = true;
16850 }
16851 _aes_init_iv.call(this, options.iv);
16852 return this;
16853 }
16854 function cbc_aes_encrypt_process(data) {
16855 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16856 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;
16857 var result = new Uint8Array(rlen);
16858 while (dlen > 0) {
16859 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16860 len += wlen;
16861 dpos += wlen;
16862 dlen -= wlen;
16863 wlen = asm.cbc_encrypt(pos, len);
16864 result.set(heap.subarray(pos, pos + wlen), rpos);
16865 rpos += wlen;
16866 if (wlen < len) {
16867 pos += wlen;
16868 len -= wlen;
16869 } else {
16870 pos = _aes_heap_start;
16871 len = 0;
16872 }
16873 }
16874 this.result = result;
16875 this.pos = pos;
16876 this.len = len;
16877 return this;
16878 }
16879 function cbc_aes_encrypt_finish() {
16880 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16881 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);
16882 if (len % _aes_block_size === 0) {
16883 if (padding) rlen += _aes_block_size;
16884 } else if (!padding) {
16885 throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
16886 }
16887 var result = new Uint8Array(rlen);
16888 if (len < rlen) {
16889 var plen = _aes_block_size - len % _aes_block_size;
16890 for (var p = 0; p < plen; ++p) heap[pos + len + p] = plen;
16891 len += plen;
16892 }
16893 asm.cbc_encrypt(pos, len);
16894 result.set(heap.subarray(pos, pos + len));
16895 this.result = result;
16896 this.pos = _aes_heap_start;
16897 this.len = 0;
16898 return this;
16899 }
16900 function cbc_aes_encrypt(data) {
16901 var result1 = cbc_aes_encrypt_process.call(this, data).result, result2 = cbc_aes_encrypt_finish.call(this).result, result;
16902 result = new Uint8Array(result1.length + result2.length);
16903 result.set(result1);
16904 result.set(result2, result1.length);
16905 this.result = result;
16906 return this;
16907 }
16908 function cbc_aes_decrypt_process(data) {
16909 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16910 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;
16911 var result = new Uint8Array(rlen);
16912 while (dlen > 0) {
16913 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
16914 len += wlen;
16915 dpos += wlen;
16916 dlen -= wlen;
16917 wlen = asm.cbc_decrypt(pos, len - (padding && dlen === 0 && len % _aes_block_size === 0 ? _aes_block_size : 0));
16918 result.set(heap.subarray(pos, pos + wlen), rpos);
16919 rpos += wlen;
16920 if (wlen < len) {
16921 pos += wlen;
16922 len -= wlen;
16923 } else {
16924 pos = _aes_heap_start;
16925 len = 0;
16926 }
16927 }
16928 this.result = result.subarray(0, rpos);
16929 this.pos = pos;
16930 this.len = len;
16931 return this;
16932 }
16933 function cbc_aes_decrypt_finish() {
16934 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
16935 var asm = this.asm, heap = this.heap, padding = this.padding, pos = this.pos, len = this.len;
16936 if (len === 0) {
16937 if (!padding) {
16938 this.result = new Uint8Array(0);
16939 this.pos = _aes_heap_start;
16940 this.len = 0;
16941 return this;
16942 } else {
16943 throw new IllegalStateError("padding not found");
16944 }
16945 }
16946 if (len % _aes_block_size !== 0) throw new IllegalArgumentError("data length must be a multiple of " + _aes_block_size);
16947 var result = new Uint8Array(len);
16948 asm.cbc_decrypt(pos, len);
16949 result.set(heap.subarray(pos, pos + len));
16950 if (padding) {
16951 var pad = result[len - 1];
16952 result = result.subarray(0, len - pad);
16953 }
16954 this.result = result;
16955 this.pos = _aes_heap_start;
16956 this.len = 0;
16957 return this;
16958 }
16959 function cbc_aes_decrypt(data) {
16960 var result1 = cbc_aes_decrypt_process.call(this, data).result, result2 = cbc_aes_decrypt_finish.call(this).result, result;
16961 result = new Uint8Array(result1.length + result2.length);
16962 result.set(result1);
16963 result.set(result2, result1.length);
16964 this.result = result;
16965 return this;
16966 }
16967 var cbc_aes_encrypt_prototype = cbc_aes_encrypt_constructor.prototype;
16968 cbc_aes_encrypt_prototype.reset = cbc_aes_reset;
16969 cbc_aes_encrypt_prototype.process = cbc_aes_encrypt_process;
16970 cbc_aes_encrypt_prototype.finish = cbc_aes_encrypt_finish;
16971 var cbc_aes_decrypt_prototype = cbc_aes_decrypt_constructor.prototype;
16972 cbc_aes_decrypt_prototype.reset = cbc_aes_reset;
16973 cbc_aes_decrypt_prototype.process = cbc_aes_decrypt_process;
16974 cbc_aes_decrypt_prototype.finish = cbc_aes_decrypt_finish;
16975 var cbc_aes_prototype = cbc_aes_constructor.prototype;
16976 cbc_aes_prototype.reset = cbc_aes_reset;
16977 cbc_aes_prototype.encrypt = cbc_aes_encrypt;
16978 cbc_aes_prototype.decrypt = cbc_aes_decrypt;
16979 function _cbc_mac_process(data) {
16980 var dpos = data.byteOffset || 0, dlen = data.byteLength || data.length || 0, wlen = 0;
16981 while (dlen > 0) {
16982 wlen = _aes_heap_write(this.heap, _aes_heap_start, data, dpos, dlen);
16983 this.asm.cbc_mac(_aes_heap_start, wlen, -1);
16984 dpos += wlen;
16985 dlen -= wlen;
16986 }
16987 }
16988 var _ccm_adata_maxLength = 65279, _ccm_data_maxLength = 68719476720;
16989 function ccm_aes_constructor(options) {
16990 this.padding = false;
16991 this.mode = "ccm";
16992 this.tagSize = _aes_block_size;
16993 this.lengthSize = 4;
16994 this.nonce = null;
16995 this.adata = null;
16996 this.iv = null;
16997 this.dataLength = -1;
16998 this.dataLeft = -1;
16999 this.counter = 1;
17000 _aes_constructor.call(this, options);
17001 }
17002 function ccm_aes_encrypt_constructor(options) {
17003 ccm_aes_constructor.call(this, options);
17004 }
17005 function ccm_aes_decrypt_constructor(options) {
17006 ccm_aes_constructor.call(this, options);
17007 }
17008 function _ccm_calculate_iv() {
17009 var nonce = this.nonce, adata = this.adata, tagSize = this.tagSize, lengthSize = this.lengthSize, dataLength = this.dataLength;
17010 var data = new Uint8Array(_aes_block_size + (adata ? 2 + adata.byteLength : 0));
17011 data[0] = (adata ? 64 : 0) | tagSize - 2 << 2 | lengthSize - 1;
17012 data.set(nonce, 1);
17013 if (lengthSize > 4) data[11] = (dataLength - (dataLength >>> 0)) / 4294967296 & 15;
17014 if (lengthSize > 3) data[12] = dataLength >>> 24;
17015 if (lengthSize > 2) data[13] = dataLength >>> 16 & 255;
17016 data[14] = dataLength >>> 8 & 255;
17017 data[15] = dataLength & 255;
17018 if (adata) {
17019 data[16] = adata.byteLength >>> 8 & 255;
17020 data[17] = adata.byteLength & 255;
17021 data.set(adata, 18);
17022 }
17023 _cbc_mac_process.call(this, data);
17024 this.asm.save_state(_aes_heap_start);
17025 this.iv = new Uint8Array(this.heap.subarray(_aes_heap_start, _aes_heap_start + _aes_block_size));
17026 }
17027 function ccm_aes_reset(options) {
17028 options = options || {};
17029 _aes_reset.call(this, options);
17030 _aes_init_iv.call(this, options.iv);
17031 var tagSize = options.tagSize;
17032 if (tagSize !== undefined) {
17033 if (!is_number(tagSize)) throw new TypeError("tagSize must be a number");
17034 if (tagSize < 4 || tagSize > 16 || tagSize & 1) throw new IllegalArgumentError("illegal tagSize value");
17035 this.tagSize = tagSize;
17036 } else {
17037 this.tagSize = _aes_block_size;
17038 }
17039 var lengthSize = options.lengthSize, nonce = options.nonce;
17040 if (nonce !== undefined) {
17041 if (is_buffer(nonce) || is_bytes(nonce)) {
17042 nonce = new Uint8Array(nonce);
17043 } else if (is_string(nonce)) {
17044 var str = nonce;
17045 nonce = new Uint8Array(str.length);
17046 for (var i = 0; i < str.length; ++i) nonce[i] = str.charCodeAt(i);
17047 } else {
17048 throw new TypeError("unexpected nonce type");
17049 }
17050 if (nonce.length < 10 || nonce.length > 13) throw new IllegalArgumentError("illegal nonce length");
17051 lengthSize = lengthSize || 15 - nonce.length;
17052 this.nonce = nonce;
17053 } else {
17054 this.nonce = null;
17055 }
17056 if (lengthSize !== undefined) {
17057 if (!is_number(lengthSize)) throw new TypeError("lengthSize must be a number");
17058 if (lengthSize < 2 || lengthSize > 5 || nonce.length + lengthSize !== 15) throw new IllegalArgumentError("illegal lengthSize value");
17059 this.lengthSize = lengthSize;
17060 } else {
17061 this.lengthSize = lengthSize = 4;
17062 }
17063 var iv = this.iv;
17064 var counter = options.counter;
17065 if (counter !== undefined) {
17066 if (iv === null) throw new IllegalStateError("iv is also required");
17067 if (!is_number(counter)) throw new TypeError("counter must be a number");
17068 this.counter = counter;
17069 } else {
17070 this.counter = 1;
17071 }
17072 var dataLength = options.dataLength;
17073 if (dataLength !== undefined) {
17074 if (!is_number(dataLength)) throw new TypeError("dataLength must be a number");
17075 if (dataLength < 0 || dataLength > _ccm_data_maxLength || dataLength > Math.pow(2, 8 * lengthSize) - 1) throw new IllegalArgumentError("illegal dataLength value");
17076 this.dataLength = dataLength;
17077 var dataLeft = options.dataLeft || dataLength;
17078 if (!is_number(dataLeft)) throw new TypeError("dataLeft must be a number");
17079 if (dataLeft < 0 || dataLeft > dataLength) throw new IllegalArgumentError("illegal dataLeft value");
17080 this.dataLeft = dataLeft;
17081 } else {
17082 this.dataLength = dataLength = -1;
17083 this.dataLeft = dataLength;
17084 }
17085 var adata = options.adata;
17086 if (adata !== undefined) {
17087 if (iv !== null) throw new IllegalStateError("you must specify either adata or iv, not both");
17088 if (is_buffer(adata) || is_bytes(adata)) {
17089 adata = new Uint8Array(adata);
17090 } else if (is_string(adata)) {
17091 var str = adata;
17092 adata = new Uint8Array(str.length);
17093 for (var i = 0; i < str.length; ++i) adata[i] = str.charCodeAt(i);
17094 } else {
17095 throw new TypeError("unexpected adata type");
17096 }
17097 if (adata.byteLength === 0 || adata.byteLength > _ccm_adata_maxLength) throw new IllegalArgumentError("illegal adata length");
17098 this.adata = adata;
17099 this.counter = 1;
17100 } else {
17101 this.adata = adata = null;
17102 }
17103 if (dataLength !== -1) _ccm_calculate_iv.call(this);
17104 return this;
17105 }
17106 function ccm_aes_encrypt_process(data) {
17107 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17108 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;
17109 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17110 var result = new Uint8Array(rlen);
17111 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17112 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17113 while (dlen > 0) {
17114 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17115 len += wlen;
17116 dpos += wlen;
17117 dlen -= wlen;
17118 asm_args[0] = pos;
17119 asm_args[1] = len & ~15;
17120 asm_args[16] = counter / 4294967296 >>> 0;
17121 asm_args[17] = counter >>> 0;
17122 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17123 result.set(heap.subarray(pos, pos + wlen), rpos);
17124 counter += wlen >>> 4;
17125 rpos += wlen;
17126 if (wlen < len) {
17127 pos += wlen;
17128 len -= wlen;
17129 } else {
17130 pos = _aes_heap_start;
17131 len = 0;
17132 }
17133 }
17134 this.result = result;
17135 this.counter = counter;
17136 this.pos = pos;
17137 this.len = len;
17138 return this;
17139 }
17140 function ccm_aes_encrypt_finish() {
17141 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17142 var asm = this.asm, heap = this.heap, nonce = this.nonce, counter = this.counter, tagSize = this.tagSize, pos = this.pos, len = this.len, wlen = 0;
17143 var result = new Uint8Array(len + tagSize);
17144 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17145 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17146 asm_args[0] = pos;
17147 asm_args[1] = len;
17148 asm_args[16] = counter / 4294967296 >>> 0;
17149 asm_args[17] = counter >>> 0;
17150 wlen = asm.ccm_encrypt.apply(asm, asm_args);
17151 result.set(heap.subarray(pos, pos + wlen));
17152 counter = 1;
17153 pos = _aes_heap_start;
17154 len = 0;
17155 asm.save_state(_aes_heap_start);
17156 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17157 asm_args[17] = 0;
17158 asm.ccm_encrypt.apply(asm, asm_args);
17159 result.set(heap.subarray(_aes_heap_start, _aes_heap_start + tagSize), wlen);
17160 this.result = result;
17161 this.counter = counter;
17162 this.pos = pos;
17163 this.len = len;
17164 return this;
17165 }
17166 function ccm_aes_encrypt(data) {
17167 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17168 var result1 = ccm_aes_encrypt_process.call(this, data).result, result2 = ccm_aes_encrypt_finish.call(this).result, result;
17169 result = new Uint8Array(result1.length + result2.length);
17170 result.set(result1);
17171 result.set(result2, result1.length);
17172 this.result = result;
17173 return this;
17174 }
17175 function ccm_aes_decrypt_process(data) {
17176 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17177 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;
17178 if ((counter - 1 << 4) + len + dlen > _ccm_data_maxLength) throw new RangeError("counter overflow");
17179 var result = new Uint8Array(rlen);
17180 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17181 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17182 while (dlen > 0) {
17183 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17184 len += wlen;
17185 dpos += wlen;
17186 dlen -= wlen;
17187 asm_args[0] = pos;
17188 asm_args[1] = len + dlen - tagSize >= _aes_block_size ? dlen >= tagSize ? len & ~15 : len + dlen - tagSize & ~15 : 0;
17189 asm_args[16] = counter / 4294967296 >>> 0;
17190 asm_args[17] = counter >>> 0;
17191 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17192 result.set(heap.subarray(pos, pos + wlen), rpos);
17193 counter += wlen >>> 4;
17194 rpos += wlen;
17195 if (wlen < len) {
17196 pos += wlen;
17197 len -= wlen;
17198 } else {
17199 pos = _aes_heap_start;
17200 len = 0;
17201 }
17202 }
17203 this.result = result.subarray(0, rpos);
17204 this.counter = counter;
17205 this.pos = pos;
17206 this.len = len;
17207 return this;
17208 }
17209 function ccm_aes_decrypt_finish() {
17210 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17211 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;
17212 if (len < tagSize) throw new IllegalStateError("authentication tag not found");
17213 var result = new Uint8Array(rlen), atag = new Uint8Array(heap.subarray(pos + rlen, pos + len));
17214 var asm_args = [ 0, 0, this.lengthSize - 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ];
17215 for (var i = 0; i < nonce.length; i++) asm_args[3 + i] = nonce[i];
17216 asm_args[0] = pos;
17217 asm_args[1] = rlen;
17218 asm_args[16] = counter / 4294967296 >>> 0;
17219 asm_args[17] = counter >>> 0;
17220 wlen = asm.ccm_decrypt.apply(asm, asm_args);
17221 result.set(heap.subarray(pos, pos + wlen));
17222 counter = 1;
17223 pos = _aes_heap_start;
17224 len = 0;
17225 asm.save_state(_aes_heap_start);
17226 asm_args[0] = _aes_heap_start, asm_args[1] = _aes_block_size, asm_args[16] = 0;
17227 asm_args[17] = 0;
17228 asm.ccm_encrypt.apply(asm, asm_args);
17229 var acheck = 0;
17230 for (var i = 0; i < tagSize; ++i) acheck |= atag[i] ^ heap[_aes_heap_start + i];
17231 if (acheck) throw new SecurityError("data integrity check failed");
17232 this.result = result;
17233 this.counter = counter;
17234 this.pos = pos;
17235 this.len = len;
17236 return this;
17237 }
17238 function ccm_aes_decrypt(data) {
17239 this.dataLength = this.dataLeft = data.byteLength || data.length || 0;
17240 var result1 = ccm_aes_decrypt_process.call(this, data).result, result2 = ccm_aes_decrypt_finish.call(this).result, result;
17241 result = new Uint8Array(result1.length + result2.length);
17242 result.set(result1);
17243 result.set(result2, result1.length);
17244 this.result = result;
17245 return this;
17246 }
17247 var ccm_aes_prototype = ccm_aes_constructor.prototype;
17248 ccm_aes_prototype.reset = ccm_aes_reset;
17249 ccm_aes_prototype.encrypt = ccm_aes_encrypt;
17250 ccm_aes_prototype.decrypt = ccm_aes_decrypt;
17251 var ccm_aes_encrypt_prototype = ccm_aes_encrypt_constructor.prototype;
17252 ccm_aes_encrypt_prototype.reset = ccm_aes_reset;
17253 ccm_aes_encrypt_prototype.process = ccm_aes_encrypt_process;
17254 ccm_aes_encrypt_prototype.finish = ccm_aes_encrypt_finish;
17255 var ccm_aes_decrypt_prototype = ccm_aes_decrypt_constructor.prototype;
17256 ccm_aes_decrypt_prototype.reset = ccm_aes_reset;
17257 ccm_aes_decrypt_prototype.process = ccm_aes_decrypt_process;
17258 ccm_aes_decrypt_prototype.finish = ccm_aes_decrypt_finish;
17259 function cfb_aes_constructor(options) {
17260 this.padding = false;
17261 this.mode = "cfb";
17262 this.iv = null;
17263 _aes_constructor.call(this, options);
17264 }
17265 function cfb_aes_encrypt_constructor(options) {
17266 cfb_aes_constructor.call(this, options);
17267 }
17268 function cfb_aes_decrypt_constructor(options) {
17269 cfb_aes_constructor.call(this, options);
17270 }
17271 function cfb_aes_reset(options) {
17272 options = options || {};
17273 _aes_reset.call(this, options);
17274 _aes_init_iv.call(this, options.iv);
17275 return this;
17276 }
17277 function cfb_aes_encrypt_process(data) {
17278 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17279 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;
17280 var result = new Uint8Array(rlen);
17281 while (dlen > 0) {
17282 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17283 len += wlen;
17284 dpos += wlen;
17285 dlen -= wlen;
17286 wlen = asm.cfb_encrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17287 result.set(heap.subarray(pos, pos + wlen), rpos);
17288 rpos += wlen;
17289 if (wlen < len) {
17290 pos += wlen;
17291 len -= wlen;
17292 } else {
17293 pos = _aes_heap_start;
17294 len = 0;
17295 }
17296 }
17297 this.result = result;
17298 this.pos = pos;
17299 this.len = len;
17300 return this;
17301 }
17302 function cfb_aes_encrypt_finish() {
17303 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17304 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17305 var result = new Uint8Array(len);
17306 asm.cfb_encrypt(pos, len);
17307 result.set(heap.subarray(pos, pos + len));
17308 this.result = result;
17309 this.pos = _aes_heap_start;
17310 this.len = 0;
17311 return this;
17312 }
17313 function cfb_aes_encrypt(data) {
17314 var result1 = cfb_aes_encrypt_process.call(this, data).result, result2 = cfb_aes_encrypt_finish.call(this).result, result;
17315 result = new Uint8Array(result1.length + result2.length);
17316 result.set(result1);
17317 result.set(result2, result1.length);
17318 this.result = result;
17319 return this;
17320 }
17321 function cfb_aes_decrypt_process(data) {
17322 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17323 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;
17324 var result = new Uint8Array(rlen);
17325 while (dlen > 0) {
17326 wlen = _aes_heap_write(heap, pos + len, data, dpos, dlen);
17327 len += wlen;
17328 dpos += wlen;
17329 dlen -= wlen;
17330 wlen = asm.cfb_decrypt(pos, _aes_block_size * Math.floor(len / _aes_block_size));
17331 result.set(heap.subarray(pos, pos + wlen), rpos);
17332 rpos += wlen;
17333 if (wlen < len) {
17334 pos += wlen;
17335 len -= wlen;
17336 } else {
17337 pos = _aes_heap_start;
17338 len = 0;
17339 }
17340 }
17341 this.result = result.subarray(0, rpos);
17342 this.pos = pos;
17343 this.len = len;
17344 return this;
17345 }
17346 function cfb_aes_decrypt_finish() {
17347 if (!this.key) throw new IllegalStateError("no key is associated with the instance");
17348 var asm = this.asm, heap = this.heap, pos = this.pos, len = this.len;
17349 if (len === 0) {
17350 this.result = new Uint8Array(0);
17351 this.pos = _aes_heap_start;
17352 this.len = 0;
17353 return this;
17354 }
17355 var result = new Uint8Array(len);
17356 asm.cfb_decrypt(pos, len);
17357 result.set(heap.subarray(pos, pos + len));
17358 this.result = result;
17359 this.pos = _aes_heap_start;
17360 this.len = 0;
17361 return this;
17362 }
17363 function cfb_aes_decrypt(data) {
17364 var result1 = cfb_aes_decrypt_process.call(this, data).result, result2 = cfb_aes_decrypt_finish.call(this).result, result;
17365 result = new Uint8Array(result1.length + result2.length);
17366 result.set(result1);
17367 result.set(result2, result1.length);
17368 this.result = result;
17369 return this;
17370 }
17371 var cfb_aes_encrypt_prototype = cfb_aes_encrypt_constructor.prototype;
17372 cfb_aes_encrypt_prototype.reset = cfb_aes_reset;
17373 cfb_aes_encrypt_prototype.process = cfb_aes_encrypt_process;
17374 cfb_aes_encrypt_prototype.finish = cfb_aes_encrypt_finish;
17375 var cfb_aes_decrypt_prototype = cfb_aes_decrypt_constructor.prototype;
17376 cfb_aes_decrypt_prototype.reset = cfb_aes_reset;
17377 cfb_aes_decrypt_prototype.process = cfb_aes_decrypt_process;
17378 cfb_aes_decrypt_prototype.finish = cfb_aes_decrypt_finish;
17379 var cfb_aes_prototype = cfb_aes_constructor.prototype;
17380 cfb_aes_prototype.reset = cfb_aes_reset;
17381 cfb_aes_prototype.encrypt = cfb_aes_encrypt;
17382 cfb_aes_prototype.decrypt = cfb_aes_decrypt;
17383 function sha256_asm(stdlib, foreign, buffer) {
17384 // Closure Compiler warning - commented out
17385 //"use asm";
17386 var H0 = 0, H1 = 0, H2 = 0, H3 = 0, H4 = 0, H5 = 0, H6 = 0, H7 = 0, TOTAL = 0;
17387 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;
17388 var HEAP = new stdlib.Uint8Array(buffer);
17389 function _core(w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, w10, w11, w12, w13, w14, w15) {
17390 w0 = w0 | 0;
17391 w1 = w1 | 0;
17392 w2 = w2 | 0;
17393 w3 = w3 | 0;
17394 w4 = w4 | 0;
17395 w5 = w5 | 0;
17396 w6 = w6 | 0;
17397 w7 = w7 | 0;
17398 w8 = w8 | 0;
17399 w9 = w9 | 0;
17400 w10 = w10 | 0;
17401 w11 = w11 | 0;
17402 w12 = w12 | 0;
17403 w13 = w13 | 0;
17404 w14 = w14 | 0;
17405 w15 = w15 | 0;
17406 var a = 0, b = 0, c = 0, d = 0, e = 0, f = 0, g = 0, h = 0, t = 0;
17407 a = H0;
17408 b = H1;
17409 c = H2;
17410 d = H3;
17411 e = H4;
17412 f = H5;
17413 g = H6;
17414 h = H7;
17415 t = w0 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1116352408 | 0;
17416 h = g;
17417 g = f;
17418 f = e;
17419 e = d + t | 0;
17420 d = c;
17421 c = b;
17422 b = a;
17423 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17424 t = w1 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1899447441 | 0;
17425 h = g;
17426 g = f;
17427 f = e;
17428 e = d + t | 0;
17429 d = c;
17430 c = b;
17431 b = a;
17432 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17433 t = w2 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3049323471 | 0;
17434 h = g;
17435 g = f;
17436 f = e;
17437 e = d + t | 0;
17438 d = c;
17439 c = b;
17440 b = a;
17441 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17442 t = w3 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3921009573 | 0;
17443 h = g;
17444 g = f;
17445 f = e;
17446 e = d + t | 0;
17447 d = c;
17448 c = b;
17449 b = a;
17450 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17451 t = w4 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 961987163 | 0;
17452 h = g;
17453 g = f;
17454 f = e;
17455 e = d + t | 0;
17456 d = c;
17457 c = b;
17458 b = a;
17459 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17460 t = w5 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1508970993 | 0;
17461 h = g;
17462 g = f;
17463 f = e;
17464 e = d + t | 0;
17465 d = c;
17466 c = b;
17467 b = a;
17468 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17469 t = w6 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2453635748 | 0;
17470 h = g;
17471 g = f;
17472 f = e;
17473 e = d + t | 0;
17474 d = c;
17475 c = b;
17476 b = a;
17477 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17478 t = w7 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2870763221 | 0;
17479 h = g;
17480 g = f;
17481 f = e;
17482 e = d + t | 0;
17483 d = c;
17484 c = b;
17485 b = a;
17486 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17487 t = w8 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3624381080 | 0;
17488 h = g;
17489 g = f;
17490 f = e;
17491 e = d + t | 0;
17492 d = c;
17493 c = b;
17494 b = a;
17495 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17496 t = w9 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 310598401 | 0;
17497 h = g;
17498 g = f;
17499 f = e;
17500 e = d + t | 0;
17501 d = c;
17502 c = b;
17503 b = a;
17504 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17505 t = w10 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 607225278 | 0;
17506 h = g;
17507 g = f;
17508 f = e;
17509 e = d + t | 0;
17510 d = c;
17511 c = b;
17512 b = a;
17513 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17514 t = w11 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1426881987 | 0;
17515 h = g;
17516 g = f;
17517 f = e;
17518 e = d + t | 0;
17519 d = c;
17520 c = b;
17521 b = a;
17522 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17523 t = w12 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1925078388 | 0;
17524 h = g;
17525 g = f;
17526 f = e;
17527 e = d + t | 0;
17528 d = c;
17529 c = b;
17530 b = a;
17531 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17532 t = w13 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2162078206 | 0;
17533 h = g;
17534 g = f;
17535 f = e;
17536 e = d + t | 0;
17537 d = c;
17538 c = b;
17539 b = a;
17540 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17541 t = w14 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2614888103 | 0;
17542 h = g;
17543 g = f;
17544 f = e;
17545 e = d + t | 0;
17546 d = c;
17547 c = b;
17548 b = a;
17549 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17550 t = w15 + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3248222580 | 0;
17551 h = g;
17552 g = f;
17553 f = e;
17554 e = d + t | 0;
17555 d = c;
17556 c = b;
17557 b = a;
17558 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17559 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;
17560 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3835390401 | 0;
17561 h = g;
17562 g = f;
17563 f = e;
17564 e = d + t | 0;
17565 d = c;
17566 c = b;
17567 b = a;
17568 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17569 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;
17570 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4022224774 | 0;
17571 h = g;
17572 g = f;
17573 f = e;
17574 e = d + t | 0;
17575 d = c;
17576 c = b;
17577 b = a;
17578 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17579 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;
17580 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 264347078 | 0;
17581 h = g;
17582 g = f;
17583 f = e;
17584 e = d + t | 0;
17585 d = c;
17586 c = b;
17587 b = a;
17588 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17589 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;
17590 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 604807628 | 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 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;
17600 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 770255983 | 0;
17601 h = g;
17602 g = f;
17603 f = e;
17604 e = d + t | 0;
17605 d = c;
17606 c = b;
17607 b = a;
17608 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17609 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;
17610 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1249150122 | 0;
17611 h = g;
17612 g = f;
17613 f = e;
17614 e = d + t | 0;
17615 d = c;
17616 c = b;
17617 b = a;
17618 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17619 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;
17620 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1555081692 | 0;
17621 h = g;
17622 g = f;
17623 f = e;
17624 e = d + t | 0;
17625 d = c;
17626 c = b;
17627 b = a;
17628 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17629 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;
17630 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1996064986 | 0;
17631 h = g;
17632 g = f;
17633 f = e;
17634 e = d + t | 0;
17635 d = c;
17636 c = b;
17637 b = a;
17638 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17639 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;
17640 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2554220882 | 0;
17641 h = g;
17642 g = f;
17643 f = e;
17644 e = d + t | 0;
17645 d = c;
17646 c = b;
17647 b = a;
17648 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17649 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;
17650 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2821834349 | 0;
17651 h = g;
17652 g = f;
17653 f = e;
17654 e = d + t | 0;
17655 d = c;
17656 c = b;
17657 b = a;
17658 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17659 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;
17660 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2952996808 | 0;
17661 h = g;
17662 g = f;
17663 f = e;
17664 e = d + t | 0;
17665 d = c;
17666 c = b;
17667 b = a;
17668 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17669 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;
17670 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3210313671 | 0;
17671 h = g;
17672 g = f;
17673 f = e;
17674 e = d + t | 0;
17675 d = c;
17676 c = b;
17677 b = a;
17678 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17679 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;
17680 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3336571891 | 0;
17681 h = g;
17682 g = f;
17683 f = e;
17684 e = d + t | 0;
17685 d = c;
17686 c = b;
17687 b = a;
17688 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17689 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;
17690 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3584528711 | 0;
17691 h = g;
17692 g = f;
17693 f = e;
17694 e = d + t | 0;
17695 d = c;
17696 c = b;
17697 b = a;
17698 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17699 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;
17700 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 113926993 | 0;
17701 h = g;
17702 g = f;
17703 f = e;
17704 e = d + t | 0;
17705 d = c;
17706 c = b;
17707 b = a;
17708 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17709 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;
17710 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 338241895 | 0;
17711 h = g;
17712 g = f;
17713 f = e;
17714 e = d + t | 0;
17715 d = c;
17716 c = b;
17717 b = a;
17718 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17719 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;
17720 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 666307205 | 0;
17721 h = g;
17722 g = f;
17723 f = e;
17724 e = d + t | 0;
17725 d = c;
17726 c = b;
17727 b = a;
17728 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17729 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;
17730 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 773529912 | 0;
17731 h = g;
17732 g = f;
17733 f = e;
17734 e = d + t | 0;
17735 d = c;
17736 c = b;
17737 b = a;
17738 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17739 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;
17740 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1294757372 | 0;
17741 h = g;
17742 g = f;
17743 f = e;
17744 e = d + t | 0;
17745 d = c;
17746 c = b;
17747 b = a;
17748 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17749 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;
17750 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1396182291 | 0;
17751 h = g;
17752 g = f;
17753 f = e;
17754 e = d + t | 0;
17755 d = c;
17756 c = b;
17757 b = a;
17758 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17759 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;
17760 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1695183700 | 0;
17761 h = g;
17762 g = f;
17763 f = e;
17764 e = d + t | 0;
17765 d = c;
17766 c = b;
17767 b = a;
17768 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17769 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;
17770 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1986661051 | 0;
17771 h = g;
17772 g = f;
17773 f = e;
17774 e = d + t | 0;
17775 d = c;
17776 c = b;
17777 b = a;
17778 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17779 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;
17780 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2177026350 | 0;
17781 h = g;
17782 g = f;
17783 f = e;
17784 e = d + t | 0;
17785 d = c;
17786 c = b;
17787 b = a;
17788 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17789 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;
17790 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2456956037 | 0;
17791 h = g;
17792 g = f;
17793 f = e;
17794 e = d + t | 0;
17795 d = c;
17796 c = b;
17797 b = a;
17798 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17799 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;
17800 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2730485921 | 0;
17801 h = g;
17802 g = f;
17803 f = e;
17804 e = d + t | 0;
17805 d = c;
17806 c = b;
17807 b = a;
17808 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17809 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;
17810 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2820302411 | 0;
17811 h = g;
17812 g = f;
17813 f = e;
17814 e = d + t | 0;
17815 d = c;
17816 c = b;
17817 b = a;
17818 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17819 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;
17820 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3259730800 | 0;
17821 h = g;
17822 g = f;
17823 f = e;
17824 e = d + t | 0;
17825 d = c;
17826 c = b;
17827 b = a;
17828 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17829 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;
17830 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3345764771 | 0;
17831 h = g;
17832 g = f;
17833 f = e;
17834 e = d + t | 0;
17835 d = c;
17836 c = b;
17837 b = a;
17838 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17839 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;
17840 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3516065817 | 0;
17841 h = g;
17842 g = f;
17843 f = e;
17844 e = d + t | 0;
17845 d = c;
17846 c = b;
17847 b = a;
17848 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17849 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;
17850 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3600352804 | 0;
17851 h = g;
17852 g = f;
17853 f = e;
17854 e = d + t | 0;
17855 d = c;
17856 c = b;
17857 b = a;
17858 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17859 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;
17860 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 4094571909 | 0;
17861 h = g;
17862 g = f;
17863 f = e;
17864 e = d + t | 0;
17865 d = c;
17866 c = b;
17867 b = a;
17868 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17869 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;
17870 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 275423344 | 0;
17871 h = g;
17872 g = f;
17873 f = e;
17874 e = d + t | 0;
17875 d = c;
17876 c = b;
17877 b = a;
17878 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17879 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;
17880 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 430227734 | 0;
17881 h = g;
17882 g = f;
17883 f = e;
17884 e = d + t | 0;
17885 d = c;
17886 c = b;
17887 b = a;
17888 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17889 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;
17890 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 506948616 | 0;
17891 h = g;
17892 g = f;
17893 f = e;
17894 e = d + t | 0;
17895 d = c;
17896 c = b;
17897 b = a;
17898 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17899 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;
17900 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 659060556 | 0;
17901 h = g;
17902 g = f;
17903 f = e;
17904 e = d + t | 0;
17905 d = c;
17906 c = b;
17907 b = a;
17908 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17909 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;
17910 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 883997877 | 0;
17911 h = g;
17912 g = f;
17913 f = e;
17914 e = d + t | 0;
17915 d = c;
17916 c = b;
17917 b = a;
17918 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17919 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;
17920 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 958139571 | 0;
17921 h = g;
17922 g = f;
17923 f = e;
17924 e = d + t | 0;
17925 d = c;
17926 c = b;
17927 b = a;
17928 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17929 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;
17930 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1322822218 | 0;
17931 h = g;
17932 g = f;
17933 f = e;
17934 e = d + t | 0;
17935 d = c;
17936 c = b;
17937 b = a;
17938 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17939 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;
17940 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1537002063 | 0;
17941 h = g;
17942 g = f;
17943 f = e;
17944 e = d + t | 0;
17945 d = c;
17946 c = b;
17947 b = a;
17948 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17949 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;
17950 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1747873779 | 0;
17951 h = g;
17952 g = f;
17953 f = e;
17954 e = d + t | 0;
17955 d = c;
17956 c = b;
17957 b = a;
17958 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17959 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;
17960 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 1955562222 | 0;
17961 h = g;
17962 g = f;
17963 f = e;
17964 e = d + t | 0;
17965 d = c;
17966 c = b;
17967 b = a;
17968 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17969 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;
17970 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2024104815 | 0;
17971 h = g;
17972 g = f;
17973 f = e;
17974 e = d + t | 0;
17975 d = c;
17976 c = b;
17977 b = a;
17978 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17979 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;
17980 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2227730452 | 0;
17981 h = g;
17982 g = f;
17983 f = e;
17984 e = d + t | 0;
17985 d = c;
17986 c = b;
17987 b = a;
17988 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17989 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;
17990 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2361852424 | 0;
17991 h = g;
17992 g = f;
17993 f = e;
17994 e = d + t | 0;
17995 d = c;
17996 c = b;
17997 b = a;
17998 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
17999 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;
18000 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2428436474 | 0;
18001 h = g;
18002 g = f;
18003 f = e;
18004 e = d + t | 0;
18005 d = c;
18006 c = b;
18007 b = a;
18008 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18009 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;
18010 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 2756734187 | 0;
18011 h = g;
18012 g = f;
18013 f = e;
18014 e = d + t | 0;
18015 d = c;
18016 c = b;
18017 b = a;
18018 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18019 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;
18020 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3204031479 | 0;
18021 h = g;
18022 g = f;
18023 f = e;
18024 e = d + t | 0;
18025 d = c;
18026 c = b;
18027 b = a;
18028 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18029 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;
18030 t = t + h + (e >>> 6 ^ e >>> 11 ^ e >>> 25 ^ e << 26 ^ e << 21 ^ e << 7) + (g ^ e & (f ^ g)) + 3329325298 | 0;
18031 h = g;
18032 g = f;
18033 f = e;
18034 e = d + t | 0;
18035 d = c;
18036 c = b;
18037 b = a;
18038 a = t + (b & c ^ d & (b ^ c)) + (b >>> 2 ^ b >>> 13 ^ b >>> 22 ^ b << 30 ^ b << 19 ^ b << 10) | 0;
18039 H0 = H0 + a | 0;
18040 H1 = H1 + b | 0;
18041 H2 = H2 + c | 0;
18042 H3 = H3 + d | 0;
18043 H4 = H4 + e | 0;
18044 H5 = H5 + f | 0;
18045 H6 = H6 + g | 0;
18046 H7 = H7 + h | 0;
18047 }
18048 function _core_heap(offset) {
18049 offset = offset | 0;
18050 _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]);
18051 }
18052 function _state_to_heap(output) {
18053 output = output | 0;
18054 HEAP[output | 0] = H0 >>> 24;
18055 HEAP[output | 1] = H0 >>> 16 & 255;
18056 HEAP[output | 2] = H0 >>> 8 & 255;
18057 HEAP[output | 3] = H0 & 255;
18058 HEAP[output | 4] = H1 >>> 24;
18059 HEAP[output | 5] = H1 >>> 16 & 255;
18060 HEAP[output | 6] = H1 >>> 8 & 255;
18061 HEAP[output | 7] = H1 & 255;
18062 HEAP[output | 8] = H2 >>> 24;
18063 HEAP[output | 9] = H2 >>> 16 & 255;
18064 HEAP[output | 10] = H2 >>> 8 & 255;
18065 HEAP[output | 11] = H2 & 255;
18066 HEAP[output | 12] = H3 >>> 24;
18067 HEAP[output | 13] = H3 >>> 16 & 255;
18068 HEAP[output | 14] = H3 >>> 8 & 255;
18069 HEAP[output | 15] = H3 & 255;
18070 HEAP[output | 16] = H4 >>> 24;
18071 HEAP[output | 17] = H4 >>> 16 & 255;
18072 HEAP[output | 18] = H4 >>> 8 & 255;
18073 HEAP[output | 19] = H4 & 255;
18074 HEAP[output | 20] = H5 >>> 24;
18075 HEAP[output | 21] = H5 >>> 16 & 255;
18076 HEAP[output | 22] = H5 >>> 8 & 255;
18077 HEAP[output | 23] = H5 & 255;
18078 HEAP[output | 24] = H6 >>> 24;
18079 HEAP[output | 25] = H6 >>> 16 & 255;
18080 HEAP[output | 26] = H6 >>> 8 & 255;
18081 HEAP[output | 27] = H6 & 255;
18082 HEAP[output | 28] = H7 >>> 24;
18083 HEAP[output | 29] = H7 >>> 16 & 255;
18084 HEAP[output | 30] = H7 >>> 8 & 255;
18085 HEAP[output | 31] = H7 & 255;
18086 }
18087 function reset() {
18088 H0 = 1779033703;
18089 H1 = 3144134277;
18090 H2 = 1013904242;
18091 H3 = 2773480762;
18092 H4 = 1359893119;
18093 H5 = 2600822924;
18094 H6 = 528734635;
18095 H7 = 1541459225;
18096 TOTAL = 0;
18097 }
18098 function init(h0, h1, h2, h3, h4, h5, h6, h7, total) {
18099 h0 = h0 | 0;
18100 h1 = h1 | 0;
18101 h2 = h2 | 0;
18102 h3 = h3 | 0;
18103 h4 = h4 | 0;
18104 h5 = h5 | 0;
18105 h6 = h6 | 0;
18106 h7 = h7 | 0;
18107 total = total | 0;
18108 H0 = h0;
18109 H1 = h1;
18110 H2 = h2;
18111 H3 = h3;
18112 H4 = h4;
18113 H5 = h5;
18114 H6 = h6;
18115 H7 = h7;
18116 TOTAL = total;
18117 }
18118 function process(offset, length) {
18119 offset = offset | 0;
18120 length = length | 0;
18121 var hashed = 0;
18122 if (offset & 63) return -1;
18123 while ((length | 0) >= 64) {
18124 _core_heap(offset);
18125 offset = offset + 64 | 0;
18126 length = length - 64 | 0;
18127 hashed = hashed + 64 | 0;
18128 }
18129 TOTAL = TOTAL + hashed | 0;
18130 return hashed | 0;
18131 }
18132 function finish(offset, length, output) {
18133 offset = offset | 0;
18134 length = length | 0;
18135 output = output | 0;
18136 var hashed = 0, i = 0;
18137 if (offset & 63) return -1;
18138 if (~output) if (output & 31) return -1;
18139 if ((length | 0) >= 64) {
18140 hashed = process(offset, length) | 0;
18141 if ((hashed | 0) == -1) return -1;
18142 offset = offset + hashed | 0;
18143 length = length - hashed | 0;
18144 }
18145 hashed = hashed + length | 0;
18146 TOTAL = TOTAL + length | 0;
18147 HEAP[offset | length] = 128;
18148 if ((length | 0) >= 56) {
18149 for (i = length + 1 | 0; (i | 0) < 64; i = i + 1 | 0) HEAP[offset | i] = 0;
18150 _core_heap(offset);
18151 length = 0;
18152 HEAP[offset | 0] = 0;
18153 }
18154 for (i = length + 1 | 0; (i | 0) < 59; i = i + 1 | 0) HEAP[offset | i] = 0;
18155 HEAP[offset | 59] = TOTAL >>> 29;
18156 HEAP[offset | 60] = TOTAL >>> 21 & 255;
18157 HEAP[offset | 61] = TOTAL >>> 13 & 255;
18158 HEAP[offset | 62] = TOTAL >>> 5 & 255;
18159 HEAP[offset | 63] = TOTAL << 3 & 255;
18160 _core_heap(offset);
18161 if (~output) _state_to_heap(output);
18162 return hashed | 0;
18163 }
18164 function hmac_reset() {
18165 H0 = I0;
18166 H1 = I1;
18167 H2 = I2;
18168 H3 = I3;
18169 H4 = I4;
18170 H5 = I5;
18171 H6 = I6;
18172 H7 = I7;
18173 TOTAL = 64;
18174 }
18175 function _hmac_opad() {
18176 H0 = O0;
18177 H1 = O1;
18178 H2 = O2;
18179 H3 = O3;
18180 H4 = O4;
18181 H5 = O5;
18182 H6 = O6;
18183 H7 = O7;
18184 TOTAL = 64;
18185 }
18186 function hmac_init(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15) {
18187 p0 = p0 | 0;
18188 p1 = p1 | 0;
18189 p2 = p2 | 0;
18190 p3 = p3 | 0;
18191 p4 = p4 | 0;
18192 p5 = p5 | 0;
18193 p6 = p6 | 0;
18194 p7 = p7 | 0;
18195 p8 = p8 | 0;
18196 p9 = p9 | 0;
18197 p10 = p10 | 0;
18198 p11 = p11 | 0;
18199 p12 = p12 | 0;
18200 p13 = p13 | 0;
18201 p14 = p14 | 0;
18202 p15 = p15 | 0;
18203 reset();
18204 _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);
18205 O0 = H0;
18206 O1 = H1;
18207 O2 = H2;
18208 O3 = H3;
18209 O4 = H4;
18210 O5 = H5;
18211 O6 = H6;
18212 O7 = H7;
18213 reset();
18214 _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);
18215 I0 = H0;
18216 I1 = H1;
18217 I2 = H2;
18218 I3 = H3;
18219 I4 = H4;
18220 I5 = H5;
18221 I6 = H6;
18222 I7 = H7;
18223 TOTAL = 64;
18224 }
18225 function hmac_finish(offset, length, output) {
18226 offset = offset | 0;
18227 length = length | 0;
18228 output = output | 0;
18229 var t0 = 0, t1 = 0, t2 = 0, t3 = 0, t4 = 0, t5 = 0, t6 = 0, t7 = 0, hashed = 0;
18230 if (offset & 63) return -1;
18231 if (~output) if (output & 31) return -1;
18232 hashed = finish(offset, length, -1) | 0;
18233 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18234 _hmac_opad();
18235 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18236 if (~output) _state_to_heap(output);
18237 return hashed | 0;
18238 }
18239 function pbkdf2_generate_block(offset, length, block, count, output) {
18240 offset = offset | 0;
18241 length = length | 0;
18242 block = block | 0;
18243 count = count | 0;
18244 output = output | 0;
18245 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;
18246 if (offset & 63) return -1;
18247 if (~output) if (output & 31) return -1;
18248 HEAP[offset + length | 0] = block >>> 24;
18249 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
18250 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
18251 HEAP[offset + length + 3 | 0] = block & 255;
18252 // Closure compiler warning - The result of the 'bitor' operator is not being used
18253 //hmac_finish(offset, length + 4 | 0, -1) | 0;
18254 hmac_finish(offset, length + 4 | 0, -1);
18255 h0 = t0 = H0, h1 = t1 = H1, h2 = t2 = H2, h3 = t3 = H3, h4 = t4 = H4, h5 = t5 = H5,
18256 h6 = t6 = H6, h7 = t7 = H7;
18257 count = count - 1 | 0;
18258 while ((count | 0) > 0) {
18259 hmac_reset();
18260 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18261 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18262 _hmac_opad();
18263 _core(t0, t1, t2, t3, t4, t5, t6, t7, 2147483648, 0, 0, 0, 0, 0, 0, 768);
18264 t0 = H0, t1 = H1, t2 = H2, t3 = H3, t4 = H4, t5 = H5, t6 = H6, t7 = H7;
18265 h0 = h0 ^ H0;
18266 h1 = h1 ^ H1;
18267 h2 = h2 ^ H2;
18268 h3 = h3 ^ H3;
18269 h4 = h4 ^ H4;
18270 h5 = h5 ^ H5;
18271 h6 = h6 ^ H6;
18272 h7 = h7 ^ H7;
18273 count = count - 1 | 0;
18274 }
18275 H0 = h0;
18276 H1 = h1;
18277 H2 = h2;
18278 H3 = h3;
18279 H4 = h4;
18280 H5 = h5;
18281 H6 = h6;
18282 H7 = h7;
18283 if (~output) _state_to_heap(output);
18284 return 0;
18285 }
18286 return {
18287 reset: reset,
18288 init: init,
18289 process: process,
18290 finish: finish,
18291 hmac_reset: hmac_reset,
18292 hmac_init: hmac_init,
18293 hmac_finish: hmac_finish,
18294 pbkdf2_generate_block: pbkdf2_generate_block
18295 };
18296 }
18297 var _sha256_block_size = 64, _sha256_hash_size = 32;
18298 function sha256_constructor(options) {
18299 options = options || {};
18300 options.heapSize = options.heapSize || 4096;
18301 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
18302 this.heap = options.heap || new Uint8Array(options.heapSize);
18303 this.asm = options.asm || sha256_asm(global, null, this.heap.buffer);
18304 this.BLOCK_SIZE = _sha256_block_size;
18305 this.HASH_SIZE = _sha256_hash_size;
18306 this.reset();
18307 }
18308 function sha256_reset() {
18309 this.result = null;
18310 this.pos = 0;
18311 this.len = 0;
18312 this.asm.reset();
18313 return this;
18314 }
18315 function sha256_process(data) {
18316 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18317 var dpos = 0, dlen = 0, clen = 0;
18318 if (is_buffer(data) || is_bytes(data)) {
18319 dpos = data.byteOffset || 0;
18320 dlen = data.byteLength;
18321 } else if (is_string(data)) {
18322 dlen = data.length;
18323 } else {
18324 throw new TypeError("data isn't of expected type");
18325 }
18326 while (dlen > 0) {
18327 clen = this.heap.byteLength - this.pos - this.len;
18328 clen = clen < dlen ? clen : dlen;
18329 if (is_buffer(data) || is_bytes(data)) {
18330 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
18331 } else {
18332 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
18333 }
18334 this.len += clen;
18335 dpos += clen;
18336 dlen -= clen;
18337 clen = this.asm.process(this.pos, this.len);
18338 if (clen < this.len) {
18339 this.pos += clen;
18340 this.len -= clen;
18341 } else {
18342 this.pos = 0;
18343 this.len = 0;
18344 }
18345 }
18346 return this;
18347 }
18348 function sha256_finish() {
18349 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
18350 this.asm.finish(this.pos, this.len, 0);
18351 this.result = new Uint8Array(_sha256_hash_size);
18352 this.result.set(this.heap.subarray(0, _sha256_hash_size));
18353 this.pos = 0;
18354 this.len = 0;
18355 return this;
18356 }
18357 sha256_constructor.BLOCK_SIZE = _sha256_block_size;
18358 sha256_constructor.HASH_SIZE = _sha256_hash_size;
18359 var sha256_prototype = sha256_constructor.prototype;
18360 sha256_prototype.reset = sha256_reset;
18361 sha256_prototype.process = sha256_process;
18362 sha256_prototype.finish = sha256_finish;
18363 function sha512_asm(stdlib, foreign, buffer) {
18364 // Closure Compiler warning - commented out
18365 //"use asm";
18366 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;
18367 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;
18368 var HEAP = new stdlib.Uint8Array(buffer);
18369 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) {
18370 w0h = w0h | 0;
18371 w0l = w0l | 0;
18372 w1h = w1h | 0;
18373 w1l = w1l | 0;
18374 w2h = w2h | 0;
18375 w2l = w2l | 0;
18376 w3h = w3h | 0;
18377 w3l = w3l | 0;
18378 w4h = w4h | 0;
18379 w4l = w4l | 0;
18380 w5h = w5h | 0;
18381 w5l = w5l | 0;
18382 w6h = w6h | 0;
18383 w6l = w6l | 0;
18384 w7h = w7h | 0;
18385 w7l = w7l | 0;
18386 w8h = w8h | 0;
18387 w8l = w8l | 0;
18388 w9h = w9h | 0;
18389 w9l = w9l | 0;
18390 w10h = w10h | 0;
18391 w10l = w10l | 0;
18392 w11h = w11h | 0;
18393 w11l = w11l | 0;
18394 w12h = w12h | 0;
18395 w12l = w12l | 0;
18396 w13h = w13h | 0;
18397 w13l = w13l | 0;
18398 w14h = w14h | 0;
18399 w14l = w14l | 0;
18400 w15h = w15h | 0;
18401 w15l = w15l | 0;
18402 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;
18403 ah = H0h;
18404 al = H0l;
18405 bh = H1h;
18406 bl = H1l;
18407 ch = H2h;
18408 cl = H2l;
18409 dh = H3h;
18410 dl = H3l;
18411 eh = H4h;
18412 el = H4l;
18413 fh = H5h;
18414 fl = H5l;
18415 gh = H6h;
18416 gl = H6l;
18417 hh = H7h;
18418 hl = H7l;
18419 tl = 3609767458 + w0l | 0;
18420 th = 1116352408 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18421 tl = tl + hl | 0;
18422 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18423 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18424 tl = tl + xl | 0;
18425 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18426 xl = gl ^ el & (fl ^ gl) | 0;
18427 tl = tl + xl | 0;
18428 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18429 hl = gl;
18430 hh = gh;
18431 gl = fl;
18432 gh = fh;
18433 fl = el;
18434 fh = eh;
18435 el = dl + tl | 0;
18436 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18437 dl = cl;
18438 dh = ch;
18439 cl = bl;
18440 ch = bh;
18441 bl = al;
18442 bh = ah;
18443 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18444 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18445 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18446 al = al + xl | 0;
18447 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18448 tl = 602891725 + w1l | 0;
18449 th = 1899447441 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18450 tl = tl + hl | 0;
18451 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18452 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18453 tl = tl + xl | 0;
18454 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18455 xl = gl ^ el & (fl ^ gl) | 0;
18456 tl = tl + xl | 0;
18457 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18458 hl = gl;
18459 hh = gh;
18460 gl = fl;
18461 gh = fh;
18462 fl = el;
18463 fh = eh;
18464 el = dl + tl | 0;
18465 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18466 dl = cl;
18467 dh = ch;
18468 cl = bl;
18469 ch = bh;
18470 bl = al;
18471 bh = ah;
18472 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18473 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18474 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18475 al = al + xl | 0;
18476 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18477 tl = 3964484399 + w2l | 0;
18478 th = 3049323471 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
18479 tl = tl + hl | 0;
18480 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18481 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18482 tl = tl + xl | 0;
18483 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18484 xl = gl ^ el & (fl ^ gl) | 0;
18485 tl = tl + xl | 0;
18486 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18487 hl = gl;
18488 hh = gh;
18489 gl = fl;
18490 gh = fh;
18491 fl = el;
18492 fh = eh;
18493 el = dl + tl | 0;
18494 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18495 dl = cl;
18496 dh = ch;
18497 cl = bl;
18498 ch = bh;
18499 bl = al;
18500 bh = ah;
18501 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18502 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18503 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18504 al = al + xl | 0;
18505 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18506 tl = 2173295548 + w3l | 0;
18507 th = 3921009573 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
18508 tl = tl + hl | 0;
18509 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18510 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18511 tl = tl + xl | 0;
18512 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18513 xl = gl ^ el & (fl ^ gl) | 0;
18514 tl = tl + xl | 0;
18515 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18516 hl = gl;
18517 hh = gh;
18518 gl = fl;
18519 gh = fh;
18520 fl = el;
18521 fh = eh;
18522 el = dl + tl | 0;
18523 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18524 dl = cl;
18525 dh = ch;
18526 cl = bl;
18527 ch = bh;
18528 bl = al;
18529 bh = ah;
18530 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18531 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18532 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18533 al = al + xl | 0;
18534 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18535 tl = 4081628472 + w4l | 0;
18536 th = 961987163 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
18537 tl = tl + hl | 0;
18538 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18539 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18540 tl = tl + xl | 0;
18541 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18542 xl = gl ^ el & (fl ^ gl) | 0;
18543 tl = tl + xl | 0;
18544 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18545 hl = gl;
18546 hh = gh;
18547 gl = fl;
18548 gh = fh;
18549 fl = el;
18550 fh = eh;
18551 el = dl + tl | 0;
18552 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18553 dl = cl;
18554 dh = ch;
18555 cl = bl;
18556 ch = bh;
18557 bl = al;
18558 bh = ah;
18559 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18560 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18561 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18562 al = al + xl | 0;
18563 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18564 tl = 3053834265 + w5l | 0;
18565 th = 1508970993 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
18566 tl = tl + hl | 0;
18567 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18568 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18569 tl = tl + xl | 0;
18570 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18571 xl = gl ^ el & (fl ^ gl) | 0;
18572 tl = tl + xl | 0;
18573 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18574 hl = gl;
18575 hh = gh;
18576 gl = fl;
18577 gh = fh;
18578 fl = el;
18579 fh = eh;
18580 el = dl + tl | 0;
18581 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18582 dl = cl;
18583 dh = ch;
18584 cl = bl;
18585 ch = bh;
18586 bl = al;
18587 bh = ah;
18588 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18589 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18590 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18591 al = al + xl | 0;
18592 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18593 tl = 2937671579 + w6l | 0;
18594 th = 2453635748 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
18595 tl = tl + hl | 0;
18596 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18597 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18598 tl = tl + xl | 0;
18599 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18600 xl = gl ^ el & (fl ^ gl) | 0;
18601 tl = tl + xl | 0;
18602 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18603 hl = gl;
18604 hh = gh;
18605 gl = fl;
18606 gh = fh;
18607 fl = el;
18608 fh = eh;
18609 el = dl + tl | 0;
18610 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18611 dl = cl;
18612 dh = ch;
18613 cl = bl;
18614 ch = bh;
18615 bl = al;
18616 bh = ah;
18617 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18618 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18619 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18620 al = al + xl | 0;
18621 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18622 tl = 3664609560 + w7l | 0;
18623 th = 2870763221 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
18624 tl = tl + hl | 0;
18625 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18626 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18627 tl = tl + xl | 0;
18628 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18629 xl = gl ^ el & (fl ^ gl) | 0;
18630 tl = tl + xl | 0;
18631 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18632 hl = gl;
18633 hh = gh;
18634 gl = fl;
18635 gh = fh;
18636 fl = el;
18637 fh = eh;
18638 el = dl + tl | 0;
18639 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18640 dl = cl;
18641 dh = ch;
18642 cl = bl;
18643 ch = bh;
18644 bl = al;
18645 bh = ah;
18646 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18647 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18648 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18649 al = al + xl | 0;
18650 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18651 tl = 2734883394 + w8l | 0;
18652 th = 3624381080 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
18653 tl = tl + hl | 0;
18654 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18655 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18656 tl = tl + xl | 0;
18657 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18658 xl = gl ^ el & (fl ^ gl) | 0;
18659 tl = tl + xl | 0;
18660 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18661 hl = gl;
18662 hh = gh;
18663 gl = fl;
18664 gh = fh;
18665 fl = el;
18666 fh = eh;
18667 el = dl + tl | 0;
18668 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18669 dl = cl;
18670 dh = ch;
18671 cl = bl;
18672 ch = bh;
18673 bl = al;
18674 bh = ah;
18675 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18676 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18677 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18678 al = al + xl | 0;
18679 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18680 tl = 1164996542 + w9l | 0;
18681 th = 310598401 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18682 tl = tl + hl | 0;
18683 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18684 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18685 tl = tl + xl | 0;
18686 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18687 xl = gl ^ el & (fl ^ gl) | 0;
18688 tl = tl + xl | 0;
18689 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18690 hl = gl;
18691 hh = gh;
18692 gl = fl;
18693 gh = fh;
18694 fl = el;
18695 fh = eh;
18696 el = dl + tl | 0;
18697 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18698 dl = cl;
18699 dh = ch;
18700 cl = bl;
18701 ch = bh;
18702 bl = al;
18703 bh = ah;
18704 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18705 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18706 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18707 al = al + xl | 0;
18708 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18709 tl = 1323610764 + w10l | 0;
18710 th = 607225278 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18711 tl = tl + hl | 0;
18712 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18713 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18714 tl = tl + xl | 0;
18715 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18716 xl = gl ^ el & (fl ^ gl) | 0;
18717 tl = tl + xl | 0;
18718 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18719 hl = gl;
18720 hh = gh;
18721 gl = fl;
18722 gh = fh;
18723 fl = el;
18724 fh = eh;
18725 el = dl + tl | 0;
18726 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18727 dl = cl;
18728 dh = ch;
18729 cl = bl;
18730 ch = bh;
18731 bl = al;
18732 bh = ah;
18733 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18734 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18735 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18736 al = al + xl | 0;
18737 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18738 tl = 3590304994 + w11l | 0;
18739 th = 1426881987 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
18740 tl = tl + hl | 0;
18741 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18742 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18743 tl = tl + xl | 0;
18744 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18745 xl = gl ^ el & (fl ^ gl) | 0;
18746 tl = tl + xl | 0;
18747 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18748 hl = gl;
18749 hh = gh;
18750 gl = fl;
18751 gh = fh;
18752 fl = el;
18753 fh = eh;
18754 el = dl + tl | 0;
18755 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18756 dl = cl;
18757 dh = ch;
18758 cl = bl;
18759 ch = bh;
18760 bl = al;
18761 bh = ah;
18762 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18763 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18764 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18765 al = al + xl | 0;
18766 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18767 tl = 4068182383 + w12l | 0;
18768 th = 1925078388 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
18769 tl = tl + hl | 0;
18770 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18771 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18772 tl = tl + xl | 0;
18773 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18774 xl = gl ^ el & (fl ^ gl) | 0;
18775 tl = tl + xl | 0;
18776 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18777 hl = gl;
18778 hh = gh;
18779 gl = fl;
18780 gh = fh;
18781 fl = el;
18782 fh = eh;
18783 el = dl + tl | 0;
18784 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18785 dl = cl;
18786 dh = ch;
18787 cl = bl;
18788 ch = bh;
18789 bl = al;
18790 bh = ah;
18791 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18792 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18793 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18794 al = al + xl | 0;
18795 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18796 tl = 991336113 + w13l | 0;
18797 th = 2162078206 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
18798 tl = tl + hl | 0;
18799 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18800 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18801 tl = tl + xl | 0;
18802 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18803 xl = gl ^ el & (fl ^ gl) | 0;
18804 tl = tl + xl | 0;
18805 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18806 hl = gl;
18807 hh = gh;
18808 gl = fl;
18809 gh = fh;
18810 fl = el;
18811 fh = eh;
18812 el = dl + tl | 0;
18813 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18814 dl = cl;
18815 dh = ch;
18816 cl = bl;
18817 ch = bh;
18818 bl = al;
18819 bh = ah;
18820 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18821 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18822 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18823 al = al + xl | 0;
18824 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18825 tl = 633803317 + w14l | 0;
18826 th = 2614888103 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
18827 tl = tl + hl | 0;
18828 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18829 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18830 tl = tl + xl | 0;
18831 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18832 xl = gl ^ el & (fl ^ gl) | 0;
18833 tl = tl + xl | 0;
18834 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18835 hl = gl;
18836 hh = gh;
18837 gl = fl;
18838 gh = fh;
18839 fl = el;
18840 fh = eh;
18841 el = dl + tl | 0;
18842 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18843 dl = cl;
18844 dh = ch;
18845 cl = bl;
18846 ch = bh;
18847 bl = al;
18848 bh = ah;
18849 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18850 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18851 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18852 al = al + xl | 0;
18853 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18854 tl = 3479774868 + w15l | 0;
18855 th = 3248222580 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
18856 tl = tl + hl | 0;
18857 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18858 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18859 tl = tl + xl | 0;
18860 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18861 xl = gl ^ el & (fl ^ gl) | 0;
18862 tl = tl + xl | 0;
18863 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18864 hl = gl;
18865 hh = gh;
18866 gl = fl;
18867 gh = fh;
18868 fl = el;
18869 fh = eh;
18870 el = dl + tl | 0;
18871 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18872 dl = cl;
18873 dh = ch;
18874 cl = bl;
18875 ch = bh;
18876 bl = al;
18877 bh = ah;
18878 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18879 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18880 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18881 al = al + xl | 0;
18882 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18883 w0l = w0l + w9l | 0;
18884 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
18885 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
18886 w0l = w0l + xl | 0;
18887 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18888 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
18889 w0l = w0l + xl | 0;
18890 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18891 tl = 2666613458 + w0l | 0;
18892 th = 3835390401 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
18893 tl = tl + hl | 0;
18894 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18895 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18896 tl = tl + xl | 0;
18897 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18898 xl = gl ^ el & (fl ^ gl) | 0;
18899 tl = tl + xl | 0;
18900 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18901 hl = gl;
18902 hh = gh;
18903 gl = fl;
18904 gh = fh;
18905 fl = el;
18906 fh = eh;
18907 el = dl + tl | 0;
18908 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18909 dl = cl;
18910 dh = ch;
18911 cl = bl;
18912 ch = bh;
18913 bl = al;
18914 bh = ah;
18915 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18916 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18917 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18918 al = al + xl | 0;
18919 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18920 w1l = w1l + w10l | 0;
18921 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
18922 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
18923 w1l = w1l + xl | 0;
18924 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18925 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
18926 w1l = w1l + xl | 0;
18927 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18928 tl = 944711139 + w1l | 0;
18929 th = 4022224774 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
18930 tl = tl + hl | 0;
18931 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18932 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18933 tl = tl + xl | 0;
18934 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18935 xl = gl ^ el & (fl ^ gl) | 0;
18936 tl = tl + xl | 0;
18937 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18938 hl = gl;
18939 hh = gh;
18940 gl = fl;
18941 gh = fh;
18942 fl = el;
18943 fh = eh;
18944 el = dl + tl | 0;
18945 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18946 dl = cl;
18947 dh = ch;
18948 cl = bl;
18949 ch = bh;
18950 bl = al;
18951 bh = ah;
18952 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18953 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18954 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18955 al = al + xl | 0;
18956 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18957 w2l = w2l + w11l | 0;
18958 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
18959 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
18960 w2l = w2l + xl | 0;
18961 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18962 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
18963 w2l = w2l + xl | 0;
18964 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18965 tl = 2341262773 + w2l | 0;
18966 th = 264347078 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
18967 tl = tl + hl | 0;
18968 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
18969 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
18970 tl = tl + xl | 0;
18971 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18972 xl = gl ^ el & (fl ^ gl) | 0;
18973 tl = tl + xl | 0;
18974 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18975 hl = gl;
18976 hh = gh;
18977 gl = fl;
18978 gh = fh;
18979 fl = el;
18980 fh = eh;
18981 el = dl + tl | 0;
18982 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
18983 dl = cl;
18984 dh = ch;
18985 cl = bl;
18986 ch = bh;
18987 bl = al;
18988 bh = ah;
18989 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
18990 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
18991 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
18992 al = al + xl | 0;
18993 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18994 w3l = w3l + w12l | 0;
18995 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
18996 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
18997 w3l = w3l + xl | 0;
18998 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
18999 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19000 w3l = w3l + xl | 0;
19001 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19002 tl = 2007800933 + w3l | 0;
19003 th = 604807628 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19004 tl = tl + hl | 0;
19005 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19006 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19007 tl = tl + xl | 0;
19008 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19009 xl = gl ^ el & (fl ^ gl) | 0;
19010 tl = tl + xl | 0;
19011 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19012 hl = gl;
19013 hh = gh;
19014 gl = fl;
19015 gh = fh;
19016 fl = el;
19017 fh = eh;
19018 el = dl + tl | 0;
19019 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19020 dl = cl;
19021 dh = ch;
19022 cl = bl;
19023 ch = bh;
19024 bl = al;
19025 bh = ah;
19026 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19027 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19028 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19029 al = al + xl | 0;
19030 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19031 w4l = w4l + w13l | 0;
19032 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19033 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19034 w4l = w4l + xl | 0;
19035 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19036 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19037 w4l = w4l + xl | 0;
19038 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19039 tl = 1495990901 + w4l | 0;
19040 th = 770255983 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19041 tl = tl + hl | 0;
19042 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19043 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19044 tl = tl + xl | 0;
19045 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19046 xl = gl ^ el & (fl ^ gl) | 0;
19047 tl = tl + xl | 0;
19048 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19049 hl = gl;
19050 hh = gh;
19051 gl = fl;
19052 gh = fh;
19053 fl = el;
19054 fh = eh;
19055 el = dl + tl | 0;
19056 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19057 dl = cl;
19058 dh = ch;
19059 cl = bl;
19060 ch = bh;
19061 bl = al;
19062 bh = ah;
19063 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19064 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19065 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19066 al = al + xl | 0;
19067 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19068 w5l = w5l + w14l | 0;
19069 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19070 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19071 w5l = w5l + xl | 0;
19072 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19073 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19074 w5l = w5l + xl | 0;
19075 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19076 tl = 1856431235 + w5l | 0;
19077 th = 1249150122 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19078 tl = tl + hl | 0;
19079 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19080 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19081 tl = tl + xl | 0;
19082 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19083 xl = gl ^ el & (fl ^ gl) | 0;
19084 tl = tl + xl | 0;
19085 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19086 hl = gl;
19087 hh = gh;
19088 gl = fl;
19089 gh = fh;
19090 fl = el;
19091 fh = eh;
19092 el = dl + tl | 0;
19093 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19094 dl = cl;
19095 dh = ch;
19096 cl = bl;
19097 ch = bh;
19098 bl = al;
19099 bh = ah;
19100 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19101 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19102 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19103 al = al + xl | 0;
19104 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19105 w6l = w6l + w15l | 0;
19106 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19107 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19108 w6l = w6l + xl | 0;
19109 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19110 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19111 w6l = w6l + xl | 0;
19112 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19113 tl = 3175218132 + w6l | 0;
19114 th = 1555081692 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19115 tl = tl + hl | 0;
19116 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19117 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19118 tl = tl + xl | 0;
19119 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19120 xl = gl ^ el & (fl ^ gl) | 0;
19121 tl = tl + xl | 0;
19122 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19123 hl = gl;
19124 hh = gh;
19125 gl = fl;
19126 gh = fh;
19127 fl = el;
19128 fh = eh;
19129 el = dl + tl | 0;
19130 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19131 dl = cl;
19132 dh = ch;
19133 cl = bl;
19134 ch = bh;
19135 bl = al;
19136 bh = ah;
19137 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19138 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19139 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19140 al = al + xl | 0;
19141 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19142 w7l = w7l + w0l | 0;
19143 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19144 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19145 w7l = w7l + xl | 0;
19146 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19147 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19148 w7l = w7l + xl | 0;
19149 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19150 tl = 2198950837 + w7l | 0;
19151 th = 1996064986 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19152 tl = tl + hl | 0;
19153 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19154 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19155 tl = tl + xl | 0;
19156 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19157 xl = gl ^ el & (fl ^ gl) | 0;
19158 tl = tl + xl | 0;
19159 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19160 hl = gl;
19161 hh = gh;
19162 gl = fl;
19163 gh = fh;
19164 fl = el;
19165 fh = eh;
19166 el = dl + tl | 0;
19167 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19168 dl = cl;
19169 dh = ch;
19170 cl = bl;
19171 ch = bh;
19172 bl = al;
19173 bh = ah;
19174 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19175 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19176 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19177 al = al + xl | 0;
19178 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19179 w8l = w8l + w1l | 0;
19180 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19181 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19182 w8l = w8l + xl | 0;
19183 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19184 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19185 w8l = w8l + xl | 0;
19186 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19187 tl = 3999719339 + w8l | 0;
19188 th = 2554220882 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19189 tl = tl + hl | 0;
19190 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19191 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19192 tl = tl + xl | 0;
19193 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19194 xl = gl ^ el & (fl ^ gl) | 0;
19195 tl = tl + xl | 0;
19196 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19197 hl = gl;
19198 hh = gh;
19199 gl = fl;
19200 gh = fh;
19201 fl = el;
19202 fh = eh;
19203 el = dl + tl | 0;
19204 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19205 dl = cl;
19206 dh = ch;
19207 cl = bl;
19208 ch = bh;
19209 bl = al;
19210 bh = ah;
19211 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19212 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19213 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19214 al = al + xl | 0;
19215 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19216 w9l = w9l + w2l | 0;
19217 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19218 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19219 w9l = w9l + xl | 0;
19220 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19221 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19222 w9l = w9l + xl | 0;
19223 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19224 tl = 766784016 + w9l | 0;
19225 th = 2821834349 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19226 tl = tl + hl | 0;
19227 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19228 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19229 tl = tl + xl | 0;
19230 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19231 xl = gl ^ el & (fl ^ gl) | 0;
19232 tl = tl + xl | 0;
19233 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19234 hl = gl;
19235 hh = gh;
19236 gl = fl;
19237 gh = fh;
19238 fl = el;
19239 fh = eh;
19240 el = dl + tl | 0;
19241 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19242 dl = cl;
19243 dh = ch;
19244 cl = bl;
19245 ch = bh;
19246 bl = al;
19247 bh = ah;
19248 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19249 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19250 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19251 al = al + xl | 0;
19252 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19253 w10l = w10l + w3l | 0;
19254 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19255 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19256 w10l = w10l + xl | 0;
19257 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19258 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19259 w10l = w10l + xl | 0;
19260 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19261 tl = 2566594879 + w10l | 0;
19262 th = 2952996808 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19263 tl = tl + hl | 0;
19264 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19265 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19266 tl = tl + xl | 0;
19267 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19268 xl = gl ^ el & (fl ^ gl) | 0;
19269 tl = tl + xl | 0;
19270 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19271 hl = gl;
19272 hh = gh;
19273 gl = fl;
19274 gh = fh;
19275 fl = el;
19276 fh = eh;
19277 el = dl + tl | 0;
19278 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19279 dl = cl;
19280 dh = ch;
19281 cl = bl;
19282 ch = bh;
19283 bl = al;
19284 bh = ah;
19285 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19286 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19287 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19288 al = al + xl | 0;
19289 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19290 w11l = w11l + w4l | 0;
19291 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19292 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19293 w11l = w11l + xl | 0;
19294 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19295 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19296 w11l = w11l + xl | 0;
19297 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19298 tl = 3203337956 + w11l | 0;
19299 th = 3210313671 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19300 tl = tl + hl | 0;
19301 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19302 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19303 tl = tl + xl | 0;
19304 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19305 xl = gl ^ el & (fl ^ gl) | 0;
19306 tl = tl + xl | 0;
19307 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19308 hl = gl;
19309 hh = gh;
19310 gl = fl;
19311 gh = fh;
19312 fl = el;
19313 fh = eh;
19314 el = dl + tl | 0;
19315 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19316 dl = cl;
19317 dh = ch;
19318 cl = bl;
19319 ch = bh;
19320 bl = al;
19321 bh = ah;
19322 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19323 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19324 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19325 al = al + xl | 0;
19326 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19327 w12l = w12l + w5l | 0;
19328 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19329 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19330 w12l = w12l + xl | 0;
19331 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19332 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19333 w12l = w12l + xl | 0;
19334 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19335 tl = 1034457026 + w12l | 0;
19336 th = 3336571891 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19337 tl = tl + hl | 0;
19338 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19339 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19340 tl = tl + xl | 0;
19341 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19342 xl = gl ^ el & (fl ^ gl) | 0;
19343 tl = tl + xl | 0;
19344 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19345 hl = gl;
19346 hh = gh;
19347 gl = fl;
19348 gh = fh;
19349 fl = el;
19350 fh = eh;
19351 el = dl + tl | 0;
19352 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19353 dl = cl;
19354 dh = ch;
19355 cl = bl;
19356 ch = bh;
19357 bl = al;
19358 bh = ah;
19359 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19360 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19361 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19362 al = al + xl | 0;
19363 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19364 w13l = w13l + w6l | 0;
19365 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19366 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
19367 w13l = w13l + xl | 0;
19368 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19369 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
19370 w13l = w13l + xl | 0;
19371 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19372 tl = 2466948901 + w13l | 0;
19373 th = 3584528711 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19374 tl = tl + hl | 0;
19375 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19376 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19377 tl = tl + xl | 0;
19378 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19379 xl = gl ^ el & (fl ^ gl) | 0;
19380 tl = tl + xl | 0;
19381 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19382 hl = gl;
19383 hh = gh;
19384 gl = fl;
19385 gh = fh;
19386 fl = el;
19387 fh = eh;
19388 el = dl + tl | 0;
19389 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19390 dl = cl;
19391 dh = ch;
19392 cl = bl;
19393 ch = bh;
19394 bl = al;
19395 bh = ah;
19396 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19397 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19398 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19399 al = al + xl | 0;
19400 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19401 w14l = w14l + w7l | 0;
19402 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19403 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
19404 w14l = w14l + xl | 0;
19405 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19406 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
19407 w14l = w14l + xl | 0;
19408 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19409 tl = 3758326383 + w14l | 0;
19410 th = 113926993 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19411 tl = tl + hl | 0;
19412 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19413 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19414 tl = tl + xl | 0;
19415 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19416 xl = gl ^ el & (fl ^ gl) | 0;
19417 tl = tl + xl | 0;
19418 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19419 hl = gl;
19420 hh = gh;
19421 gl = fl;
19422 gh = fh;
19423 fl = el;
19424 fh = eh;
19425 el = dl + tl | 0;
19426 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19427 dl = cl;
19428 dh = ch;
19429 cl = bl;
19430 ch = bh;
19431 bl = al;
19432 bh = ah;
19433 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19434 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19435 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19436 al = al + xl | 0;
19437 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19438 w15l = w15l + w8l | 0;
19439 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19440 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
19441 w15l = w15l + xl | 0;
19442 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19443 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
19444 w15l = w15l + xl | 0;
19445 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19446 tl = 168717936 + w15l | 0;
19447 th = 338241895 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19448 tl = tl + hl | 0;
19449 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19450 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19451 tl = tl + xl | 0;
19452 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19453 xl = gl ^ el & (fl ^ gl) | 0;
19454 tl = tl + xl | 0;
19455 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19456 hl = gl;
19457 hh = gh;
19458 gl = fl;
19459 gh = fh;
19460 fl = el;
19461 fh = eh;
19462 el = dl + tl | 0;
19463 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19464 dl = cl;
19465 dh = ch;
19466 cl = bl;
19467 ch = bh;
19468 bl = al;
19469 bh = ah;
19470 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19471 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19472 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19473 al = al + xl | 0;
19474 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19475 w0l = w0l + w9l | 0;
19476 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19477 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
19478 w0l = w0l + xl | 0;
19479 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19480 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
19481 w0l = w0l + xl | 0;
19482 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19483 tl = 1188179964 + w0l | 0;
19484 th = 666307205 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19485 tl = tl + hl | 0;
19486 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19487 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19488 tl = tl + xl | 0;
19489 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19490 xl = gl ^ el & (fl ^ gl) | 0;
19491 tl = tl + xl | 0;
19492 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19493 hl = gl;
19494 hh = gh;
19495 gl = fl;
19496 gh = fh;
19497 fl = el;
19498 fh = eh;
19499 el = dl + tl | 0;
19500 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19501 dl = cl;
19502 dh = ch;
19503 cl = bl;
19504 ch = bh;
19505 bl = al;
19506 bh = ah;
19507 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19508 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19509 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19510 al = al + xl | 0;
19511 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19512 w1l = w1l + w10l | 0;
19513 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19514 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
19515 w1l = w1l + xl | 0;
19516 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19517 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
19518 w1l = w1l + xl | 0;
19519 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19520 tl = 1546045734 + w1l | 0;
19521 th = 773529912 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19522 tl = tl + hl | 0;
19523 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19524 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19525 tl = tl + xl | 0;
19526 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19527 xl = gl ^ el & (fl ^ gl) | 0;
19528 tl = tl + xl | 0;
19529 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19530 hl = gl;
19531 hh = gh;
19532 gl = fl;
19533 gh = fh;
19534 fl = el;
19535 fh = eh;
19536 el = dl + tl | 0;
19537 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19538 dl = cl;
19539 dh = ch;
19540 cl = bl;
19541 ch = bh;
19542 bl = al;
19543 bh = ah;
19544 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19545 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19546 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19547 al = al + xl | 0;
19548 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19549 w2l = w2l + w11l | 0;
19550 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19551 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
19552 w2l = w2l + xl | 0;
19553 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19554 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
19555 w2l = w2l + xl | 0;
19556 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19557 tl = 1522805485 + w2l | 0;
19558 th = 1294757372 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19559 tl = tl + hl | 0;
19560 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19561 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19562 tl = tl + xl | 0;
19563 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19564 xl = gl ^ el & (fl ^ gl) | 0;
19565 tl = tl + xl | 0;
19566 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19567 hl = gl;
19568 hh = gh;
19569 gl = fl;
19570 gh = fh;
19571 fl = el;
19572 fh = eh;
19573 el = dl + tl | 0;
19574 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19575 dl = cl;
19576 dh = ch;
19577 cl = bl;
19578 ch = bh;
19579 bl = al;
19580 bh = ah;
19581 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19582 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19583 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19584 al = al + xl | 0;
19585 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19586 w3l = w3l + w12l | 0;
19587 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19588 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
19589 w3l = w3l + xl | 0;
19590 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19591 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
19592 w3l = w3l + xl | 0;
19593 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19594 tl = 2643833823 + w3l | 0;
19595 th = 1396182291 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19596 tl = tl + hl | 0;
19597 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19598 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19599 tl = tl + xl | 0;
19600 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19601 xl = gl ^ el & (fl ^ gl) | 0;
19602 tl = tl + xl | 0;
19603 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19604 hl = gl;
19605 hh = gh;
19606 gl = fl;
19607 gh = fh;
19608 fl = el;
19609 fh = eh;
19610 el = dl + tl | 0;
19611 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19612 dl = cl;
19613 dh = ch;
19614 cl = bl;
19615 ch = bh;
19616 bl = al;
19617 bh = ah;
19618 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19619 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19620 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19621 al = al + xl | 0;
19622 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19623 w4l = w4l + w13l | 0;
19624 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19625 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
19626 w4l = w4l + xl | 0;
19627 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19628 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
19629 w4l = w4l + xl | 0;
19630 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19631 tl = 2343527390 + w4l | 0;
19632 th = 1695183700 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19633 tl = tl + hl | 0;
19634 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19635 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19636 tl = tl + xl | 0;
19637 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19638 xl = gl ^ el & (fl ^ gl) | 0;
19639 tl = tl + xl | 0;
19640 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19641 hl = gl;
19642 hh = gh;
19643 gl = fl;
19644 gh = fh;
19645 fl = el;
19646 fh = eh;
19647 el = dl + tl | 0;
19648 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19649 dl = cl;
19650 dh = ch;
19651 cl = bl;
19652 ch = bh;
19653 bl = al;
19654 bh = ah;
19655 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19656 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19657 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19658 al = al + xl | 0;
19659 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19660 w5l = w5l + w14l | 0;
19661 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
19662 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
19663 w5l = w5l + xl | 0;
19664 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19665 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
19666 w5l = w5l + xl | 0;
19667 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19668 tl = 1014477480 + w5l | 0;
19669 th = 1986661051 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19670 tl = tl + hl | 0;
19671 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19672 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19673 tl = tl + xl | 0;
19674 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19675 xl = gl ^ el & (fl ^ gl) | 0;
19676 tl = tl + xl | 0;
19677 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19678 hl = gl;
19679 hh = gh;
19680 gl = fl;
19681 gh = fh;
19682 fl = el;
19683 fh = eh;
19684 el = dl + tl | 0;
19685 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19686 dl = cl;
19687 dh = ch;
19688 cl = bl;
19689 ch = bh;
19690 bl = al;
19691 bh = ah;
19692 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19693 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19694 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19695 al = al + xl | 0;
19696 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19697 w6l = w6l + w15l | 0;
19698 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
19699 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
19700 w6l = w6l + xl | 0;
19701 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19702 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
19703 w6l = w6l + xl | 0;
19704 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19705 tl = 1206759142 + w6l | 0;
19706 th = 2177026350 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19707 tl = tl + hl | 0;
19708 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19709 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19710 tl = tl + xl | 0;
19711 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19712 xl = gl ^ el & (fl ^ gl) | 0;
19713 tl = tl + xl | 0;
19714 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19715 hl = gl;
19716 hh = gh;
19717 gl = fl;
19718 gh = fh;
19719 fl = el;
19720 fh = eh;
19721 el = dl + tl | 0;
19722 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19723 dl = cl;
19724 dh = ch;
19725 cl = bl;
19726 ch = bh;
19727 bl = al;
19728 bh = ah;
19729 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19730 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19731 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19732 al = al + xl | 0;
19733 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19734 w7l = w7l + w0l | 0;
19735 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
19736 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
19737 w7l = w7l + xl | 0;
19738 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19739 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
19740 w7l = w7l + xl | 0;
19741 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19742 tl = 344077627 + w7l | 0;
19743 th = 2456956037 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19744 tl = tl + hl | 0;
19745 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19746 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19747 tl = tl + xl | 0;
19748 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19749 xl = gl ^ el & (fl ^ gl) | 0;
19750 tl = tl + xl | 0;
19751 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19752 hl = gl;
19753 hh = gh;
19754 gl = fl;
19755 gh = fh;
19756 fl = el;
19757 fh = eh;
19758 el = dl + tl | 0;
19759 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19760 dl = cl;
19761 dh = ch;
19762 cl = bl;
19763 ch = bh;
19764 bl = al;
19765 bh = ah;
19766 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19767 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19768 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19769 al = al + xl | 0;
19770 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19771 w8l = w8l + w1l | 0;
19772 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
19773 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
19774 w8l = w8l + xl | 0;
19775 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19776 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
19777 w8l = w8l + xl | 0;
19778 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19779 tl = 1290863460 + w8l | 0;
19780 th = 2730485921 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
19781 tl = tl + hl | 0;
19782 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19783 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19784 tl = tl + xl | 0;
19785 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19786 xl = gl ^ el & (fl ^ gl) | 0;
19787 tl = tl + xl | 0;
19788 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19789 hl = gl;
19790 hh = gh;
19791 gl = fl;
19792 gh = fh;
19793 fl = el;
19794 fh = eh;
19795 el = dl + tl | 0;
19796 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19797 dl = cl;
19798 dh = ch;
19799 cl = bl;
19800 ch = bh;
19801 bl = al;
19802 bh = ah;
19803 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19804 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19805 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19806 al = al + xl | 0;
19807 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19808 w9l = w9l + w2l | 0;
19809 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
19810 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
19811 w9l = w9l + xl | 0;
19812 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19813 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
19814 w9l = w9l + xl | 0;
19815 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19816 tl = 3158454273 + w9l | 0;
19817 th = 2820302411 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
19818 tl = tl + hl | 0;
19819 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19820 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19821 tl = tl + xl | 0;
19822 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19823 xl = gl ^ el & (fl ^ gl) | 0;
19824 tl = tl + xl | 0;
19825 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19826 hl = gl;
19827 hh = gh;
19828 gl = fl;
19829 gh = fh;
19830 fl = el;
19831 fh = eh;
19832 el = dl + tl | 0;
19833 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19834 dl = cl;
19835 dh = ch;
19836 cl = bl;
19837 ch = bh;
19838 bl = al;
19839 bh = ah;
19840 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19841 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19842 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19843 al = al + xl | 0;
19844 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19845 w10l = w10l + w3l | 0;
19846 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
19847 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
19848 w10l = w10l + xl | 0;
19849 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19850 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
19851 w10l = w10l + xl | 0;
19852 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19853 tl = 3505952657 + w10l | 0;
19854 th = 3259730800 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
19855 tl = tl + hl | 0;
19856 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19857 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19858 tl = tl + xl | 0;
19859 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19860 xl = gl ^ el & (fl ^ gl) | 0;
19861 tl = tl + xl | 0;
19862 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19863 hl = gl;
19864 hh = gh;
19865 gl = fl;
19866 gh = fh;
19867 fl = el;
19868 fh = eh;
19869 el = dl + tl | 0;
19870 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19871 dl = cl;
19872 dh = ch;
19873 cl = bl;
19874 ch = bh;
19875 bl = al;
19876 bh = ah;
19877 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19878 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19879 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19880 al = al + xl | 0;
19881 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19882 w11l = w11l + w4l | 0;
19883 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
19884 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
19885 w11l = w11l + xl | 0;
19886 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19887 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
19888 w11l = w11l + xl | 0;
19889 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19890 tl = 106217008 + w11l | 0;
19891 th = 3345764771 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
19892 tl = tl + hl | 0;
19893 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19894 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19895 tl = tl + xl | 0;
19896 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19897 xl = gl ^ el & (fl ^ gl) | 0;
19898 tl = tl + xl | 0;
19899 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19900 hl = gl;
19901 hh = gh;
19902 gl = fl;
19903 gh = fh;
19904 fl = el;
19905 fh = eh;
19906 el = dl + tl | 0;
19907 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19908 dl = cl;
19909 dh = ch;
19910 cl = bl;
19911 ch = bh;
19912 bl = al;
19913 bh = ah;
19914 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19915 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19916 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19917 al = al + xl | 0;
19918 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19919 w12l = w12l + w5l | 0;
19920 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
19921 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
19922 w12l = w12l + xl | 0;
19923 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19924 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
19925 w12l = w12l + xl | 0;
19926 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19927 tl = 3606008344 + w12l | 0;
19928 th = 3516065817 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
19929 tl = tl + hl | 0;
19930 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19931 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19932 tl = tl + xl | 0;
19933 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19934 xl = gl ^ el & (fl ^ gl) | 0;
19935 tl = tl + xl | 0;
19936 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19937 hl = gl;
19938 hh = gh;
19939 gl = fl;
19940 gh = fh;
19941 fl = el;
19942 fh = eh;
19943 el = dl + tl | 0;
19944 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19945 dl = cl;
19946 dh = ch;
19947 cl = bl;
19948 ch = bh;
19949 bl = al;
19950 bh = ah;
19951 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19952 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19953 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19954 al = al + xl | 0;
19955 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19956 w13l = w13l + w6l | 0;
19957 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
19958 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
19959 w13l = w13l + xl | 0;
19960 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19961 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
19962 w13l = w13l + xl | 0;
19963 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19964 tl = 1432725776 + w13l | 0;
19965 th = 3600352804 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
19966 tl = tl + hl | 0;
19967 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
19968 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
19969 tl = tl + xl | 0;
19970 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19971 xl = gl ^ el & (fl ^ gl) | 0;
19972 tl = tl + xl | 0;
19973 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19974 hl = gl;
19975 hh = gh;
19976 gl = fl;
19977 gh = fh;
19978 fl = el;
19979 fh = eh;
19980 el = dl + tl | 0;
19981 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
19982 dl = cl;
19983 dh = ch;
19984 cl = bl;
19985 ch = bh;
19986 bl = al;
19987 bh = ah;
19988 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
19989 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
19990 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
19991 al = al + xl | 0;
19992 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19993 w14l = w14l + w7l | 0;
19994 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
19995 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
19996 w14l = w14l + xl | 0;
19997 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
19998 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
19999 w14l = w14l + xl | 0;
20000 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20001 tl = 1467031594 + w14l | 0;
20002 th = 4094571909 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20003 tl = tl + hl | 0;
20004 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20005 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20006 tl = tl + xl | 0;
20007 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20008 xl = gl ^ el & (fl ^ gl) | 0;
20009 tl = tl + xl | 0;
20010 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20011 hl = gl;
20012 hh = gh;
20013 gl = fl;
20014 gh = fh;
20015 fl = el;
20016 fh = eh;
20017 el = dl + tl | 0;
20018 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20019 dl = cl;
20020 dh = ch;
20021 cl = bl;
20022 ch = bh;
20023 bl = al;
20024 bh = ah;
20025 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20026 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20027 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20028 al = al + xl | 0;
20029 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20030 w15l = w15l + w8l | 0;
20031 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20032 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20033 w15l = w15l + xl | 0;
20034 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20035 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20036 w15l = w15l + xl | 0;
20037 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20038 tl = 851169720 + w15l | 0;
20039 th = 275423344 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20040 tl = tl + hl | 0;
20041 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20042 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20043 tl = tl + xl | 0;
20044 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20045 xl = gl ^ el & (fl ^ gl) | 0;
20046 tl = tl + xl | 0;
20047 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20048 hl = gl;
20049 hh = gh;
20050 gl = fl;
20051 gh = fh;
20052 fl = el;
20053 fh = eh;
20054 el = dl + tl | 0;
20055 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20056 dl = cl;
20057 dh = ch;
20058 cl = bl;
20059 ch = bh;
20060 bl = al;
20061 bh = ah;
20062 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20063 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20064 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20065 al = al + xl | 0;
20066 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20067 w0l = w0l + w9l | 0;
20068 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20069 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20070 w0l = w0l + xl | 0;
20071 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20072 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20073 w0l = w0l + xl | 0;
20074 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20075 tl = 3100823752 + w0l | 0;
20076 th = 430227734 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20077 tl = tl + hl | 0;
20078 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20079 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20080 tl = tl + xl | 0;
20081 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20082 xl = gl ^ el & (fl ^ gl) | 0;
20083 tl = tl + xl | 0;
20084 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20085 hl = gl;
20086 hh = gh;
20087 gl = fl;
20088 gh = fh;
20089 fl = el;
20090 fh = eh;
20091 el = dl + tl | 0;
20092 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20093 dl = cl;
20094 dh = ch;
20095 cl = bl;
20096 ch = bh;
20097 bl = al;
20098 bh = ah;
20099 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20100 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20101 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20102 al = al + xl | 0;
20103 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20104 w1l = w1l + w10l | 0;
20105 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20106 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20107 w1l = w1l + xl | 0;
20108 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20109 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20110 w1l = w1l + xl | 0;
20111 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20112 tl = 1363258195 + w1l | 0;
20113 th = 506948616 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20114 tl = tl + hl | 0;
20115 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20116 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20117 tl = tl + xl | 0;
20118 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20119 xl = gl ^ el & (fl ^ gl) | 0;
20120 tl = tl + xl | 0;
20121 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20122 hl = gl;
20123 hh = gh;
20124 gl = fl;
20125 gh = fh;
20126 fl = el;
20127 fh = eh;
20128 el = dl + tl | 0;
20129 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20130 dl = cl;
20131 dh = ch;
20132 cl = bl;
20133 ch = bh;
20134 bl = al;
20135 bh = ah;
20136 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20137 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20138 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20139 al = al + xl | 0;
20140 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20141 w2l = w2l + w11l | 0;
20142 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20143 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20144 w2l = w2l + xl | 0;
20145 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20146 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20147 w2l = w2l + xl | 0;
20148 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20149 tl = 3750685593 + w2l | 0;
20150 th = 659060556 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20151 tl = tl + hl | 0;
20152 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20153 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20154 tl = tl + xl | 0;
20155 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20156 xl = gl ^ el & (fl ^ gl) | 0;
20157 tl = tl + xl | 0;
20158 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20159 hl = gl;
20160 hh = gh;
20161 gl = fl;
20162 gh = fh;
20163 fl = el;
20164 fh = eh;
20165 el = dl + tl | 0;
20166 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20167 dl = cl;
20168 dh = ch;
20169 cl = bl;
20170 ch = bh;
20171 bl = al;
20172 bh = ah;
20173 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20174 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20175 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20176 al = al + xl | 0;
20177 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20178 w3l = w3l + w12l | 0;
20179 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20180 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20181 w3l = w3l + xl | 0;
20182 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20183 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20184 w3l = w3l + xl | 0;
20185 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20186 tl = 3785050280 + w3l | 0;
20187 th = 883997877 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20188 tl = tl + hl | 0;
20189 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20190 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20191 tl = tl + xl | 0;
20192 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20193 xl = gl ^ el & (fl ^ gl) | 0;
20194 tl = tl + xl | 0;
20195 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20196 hl = gl;
20197 hh = gh;
20198 gl = fl;
20199 gh = fh;
20200 fl = el;
20201 fh = eh;
20202 el = dl + tl | 0;
20203 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20204 dl = cl;
20205 dh = ch;
20206 cl = bl;
20207 ch = bh;
20208 bl = al;
20209 bh = ah;
20210 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20211 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20212 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20213 al = al + xl | 0;
20214 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20215 w4l = w4l + w13l | 0;
20216 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20217 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20218 w4l = w4l + xl | 0;
20219 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20220 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20221 w4l = w4l + xl | 0;
20222 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20223 tl = 3318307427 + w4l | 0;
20224 th = 958139571 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20225 tl = tl + hl | 0;
20226 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20227 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20228 tl = tl + xl | 0;
20229 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20230 xl = gl ^ el & (fl ^ gl) | 0;
20231 tl = tl + xl | 0;
20232 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20233 hl = gl;
20234 hh = gh;
20235 gl = fl;
20236 gh = fh;
20237 fl = el;
20238 fh = eh;
20239 el = dl + tl | 0;
20240 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20241 dl = cl;
20242 dh = ch;
20243 cl = bl;
20244 ch = bh;
20245 bl = al;
20246 bh = ah;
20247 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20248 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20249 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20250 al = al + xl | 0;
20251 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20252 w5l = w5l + w14l | 0;
20253 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20254 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20255 w5l = w5l + xl | 0;
20256 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20257 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20258 w5l = w5l + xl | 0;
20259 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20260 tl = 3812723403 + w5l | 0;
20261 th = 1322822218 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20262 tl = tl + hl | 0;
20263 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20264 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20265 tl = tl + xl | 0;
20266 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20267 xl = gl ^ el & (fl ^ gl) | 0;
20268 tl = tl + xl | 0;
20269 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20270 hl = gl;
20271 hh = gh;
20272 gl = fl;
20273 gh = fh;
20274 fl = el;
20275 fh = eh;
20276 el = dl + tl | 0;
20277 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20278 dl = cl;
20279 dh = ch;
20280 cl = bl;
20281 ch = bh;
20282 bl = al;
20283 bh = ah;
20284 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20285 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20286 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20287 al = al + xl | 0;
20288 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20289 w6l = w6l + w15l | 0;
20290 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20291 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20292 w6l = w6l + xl | 0;
20293 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20294 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20295 w6l = w6l + xl | 0;
20296 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20297 tl = 2003034995 + w6l | 0;
20298 th = 1537002063 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20299 tl = tl + hl | 0;
20300 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20301 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20302 tl = tl + xl | 0;
20303 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20304 xl = gl ^ el & (fl ^ gl) | 0;
20305 tl = tl + xl | 0;
20306 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20307 hl = gl;
20308 hh = gh;
20309 gl = fl;
20310 gh = fh;
20311 fl = el;
20312 fh = eh;
20313 el = dl + tl | 0;
20314 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20315 dl = cl;
20316 dh = ch;
20317 cl = bl;
20318 ch = bh;
20319 bl = al;
20320 bh = ah;
20321 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20322 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20323 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20324 al = al + xl | 0;
20325 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20326 w7l = w7l + w0l | 0;
20327 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20328 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20329 w7l = w7l + xl | 0;
20330 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20331 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20332 w7l = w7l + xl | 0;
20333 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20334 tl = 3602036899 + w7l | 0;
20335 th = 1747873779 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20336 tl = tl + hl | 0;
20337 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20338 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20339 tl = tl + xl | 0;
20340 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20341 xl = gl ^ el & (fl ^ gl) | 0;
20342 tl = tl + xl | 0;
20343 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20344 hl = gl;
20345 hh = gh;
20346 gl = fl;
20347 gh = fh;
20348 fl = el;
20349 fh = eh;
20350 el = dl + tl | 0;
20351 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20352 dl = cl;
20353 dh = ch;
20354 cl = bl;
20355 ch = bh;
20356 bl = al;
20357 bh = ah;
20358 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20359 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20360 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20361 al = al + xl | 0;
20362 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20363 w8l = w8l + w1l | 0;
20364 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20365 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
20366 w8l = w8l + xl | 0;
20367 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20368 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
20369 w8l = w8l + xl | 0;
20370 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20371 tl = 1575990012 + w8l | 0;
20372 th = 1955562222 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20373 tl = tl + hl | 0;
20374 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20375 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20376 tl = tl + xl | 0;
20377 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20378 xl = gl ^ el & (fl ^ gl) | 0;
20379 tl = tl + xl | 0;
20380 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20381 hl = gl;
20382 hh = gh;
20383 gl = fl;
20384 gh = fh;
20385 fl = el;
20386 fh = eh;
20387 el = dl + tl | 0;
20388 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20389 dl = cl;
20390 dh = ch;
20391 cl = bl;
20392 ch = bh;
20393 bl = al;
20394 bh = ah;
20395 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20396 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20397 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20398 al = al + xl | 0;
20399 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20400 w9l = w9l + w2l | 0;
20401 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20402 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
20403 w9l = w9l + xl | 0;
20404 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20405 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
20406 w9l = w9l + xl | 0;
20407 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20408 tl = 1125592928 + w9l | 0;
20409 th = 2024104815 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20410 tl = tl + hl | 0;
20411 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20412 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20413 tl = tl + xl | 0;
20414 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20415 xl = gl ^ el & (fl ^ gl) | 0;
20416 tl = tl + xl | 0;
20417 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20418 hl = gl;
20419 hh = gh;
20420 gl = fl;
20421 gh = fh;
20422 fl = el;
20423 fh = eh;
20424 el = dl + tl | 0;
20425 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20426 dl = cl;
20427 dh = ch;
20428 cl = bl;
20429 ch = bh;
20430 bl = al;
20431 bh = ah;
20432 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20433 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20434 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20435 al = al + xl | 0;
20436 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20437 w10l = w10l + w3l | 0;
20438 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20439 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
20440 w10l = w10l + xl | 0;
20441 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20442 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
20443 w10l = w10l + xl | 0;
20444 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20445 tl = 2716904306 + w10l | 0;
20446 th = 2227730452 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20447 tl = tl + hl | 0;
20448 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20449 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20450 tl = tl + xl | 0;
20451 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20452 xl = gl ^ el & (fl ^ gl) | 0;
20453 tl = tl + xl | 0;
20454 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20455 hl = gl;
20456 hh = gh;
20457 gl = fl;
20458 gh = fh;
20459 fl = el;
20460 fh = eh;
20461 el = dl + tl | 0;
20462 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20463 dl = cl;
20464 dh = ch;
20465 cl = bl;
20466 ch = bh;
20467 bl = al;
20468 bh = ah;
20469 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20470 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20471 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20472 al = al + xl | 0;
20473 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20474 w11l = w11l + w4l | 0;
20475 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20476 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
20477 w11l = w11l + xl | 0;
20478 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20479 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
20480 w11l = w11l + xl | 0;
20481 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20482 tl = 442776044 + w11l | 0;
20483 th = 2361852424 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20484 tl = tl + hl | 0;
20485 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20486 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20487 tl = tl + xl | 0;
20488 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20489 xl = gl ^ el & (fl ^ gl) | 0;
20490 tl = tl + xl | 0;
20491 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20492 hl = gl;
20493 hh = gh;
20494 gl = fl;
20495 gh = fh;
20496 fl = el;
20497 fh = eh;
20498 el = dl + tl | 0;
20499 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20500 dl = cl;
20501 dh = ch;
20502 cl = bl;
20503 ch = bh;
20504 bl = al;
20505 bh = ah;
20506 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20507 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20508 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20509 al = al + xl | 0;
20510 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20511 w12l = w12l + w5l | 0;
20512 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20513 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
20514 w12l = w12l + xl | 0;
20515 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20516 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
20517 w12l = w12l + xl | 0;
20518 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20519 tl = 593698344 + w12l | 0;
20520 th = 2428436474 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20521 tl = tl + hl | 0;
20522 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20523 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20524 tl = tl + xl | 0;
20525 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20526 xl = gl ^ el & (fl ^ gl) | 0;
20527 tl = tl + xl | 0;
20528 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20529 hl = gl;
20530 hh = gh;
20531 gl = fl;
20532 gh = fh;
20533 fl = el;
20534 fh = eh;
20535 el = dl + tl | 0;
20536 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20537 dl = cl;
20538 dh = ch;
20539 cl = bl;
20540 ch = bh;
20541 bl = al;
20542 bh = ah;
20543 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20544 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20545 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20546 al = al + xl | 0;
20547 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20548 w13l = w13l + w6l | 0;
20549 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20550 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
20551 w13l = w13l + xl | 0;
20552 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20553 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
20554 w13l = w13l + xl | 0;
20555 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20556 tl = 3733110249 + w13l | 0;
20557 th = 2756734187 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20558 tl = tl + hl | 0;
20559 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20560 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20561 tl = tl + xl | 0;
20562 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20563 xl = gl ^ el & (fl ^ gl) | 0;
20564 tl = tl + xl | 0;
20565 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20566 hl = gl;
20567 hh = gh;
20568 gl = fl;
20569 gh = fh;
20570 fl = el;
20571 fh = eh;
20572 el = dl + tl | 0;
20573 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20574 dl = cl;
20575 dh = ch;
20576 cl = bl;
20577 ch = bh;
20578 bl = al;
20579 bh = ah;
20580 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20581 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20582 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20583 al = al + xl | 0;
20584 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20585 w14l = w14l + w7l | 0;
20586 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20587 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
20588 w14l = w14l + xl | 0;
20589 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20590 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
20591 w14l = w14l + xl | 0;
20592 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20593 tl = 2999351573 + w14l | 0;
20594 th = 3204031479 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20595 tl = tl + hl | 0;
20596 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20597 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20598 tl = tl + xl | 0;
20599 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20600 xl = gl ^ el & (fl ^ gl) | 0;
20601 tl = tl + xl | 0;
20602 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20603 hl = gl;
20604 hh = gh;
20605 gl = fl;
20606 gh = fh;
20607 fl = el;
20608 fh = eh;
20609 el = dl + tl | 0;
20610 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20611 dl = cl;
20612 dh = ch;
20613 cl = bl;
20614 ch = bh;
20615 bl = al;
20616 bh = ah;
20617 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20618 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20619 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20620 al = al + xl | 0;
20621 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20622 w15l = w15l + w8l | 0;
20623 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20624 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
20625 w15l = w15l + xl | 0;
20626 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20627 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
20628 w15l = w15l + xl | 0;
20629 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20630 tl = 3815920427 + w15l | 0;
20631 th = 3329325298 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20632 tl = tl + hl | 0;
20633 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20634 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20635 tl = tl + xl | 0;
20636 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20637 xl = gl ^ el & (fl ^ gl) | 0;
20638 tl = tl + xl | 0;
20639 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20640 hl = gl;
20641 hh = gh;
20642 gl = fl;
20643 gh = fh;
20644 fl = el;
20645 fh = eh;
20646 el = dl + tl | 0;
20647 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20648 dl = cl;
20649 dh = ch;
20650 cl = bl;
20651 ch = bh;
20652 bl = al;
20653 bh = ah;
20654 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20655 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20656 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20657 al = al + xl | 0;
20658 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20659 w0l = w0l + w9l | 0;
20660 w0h = w0h + w9h + (w0l >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
20661 xl = (w1l >>> 1 | w1h << 31) ^ (w1l >>> 8 | w1h << 24) ^ (w1l >>> 7 | w1h << 25) | 0;
20662 w0l = w0l + xl | 0;
20663 w0h = w0h + ((w1h >>> 1 | w1l << 31) ^ (w1h >>> 8 | w1l << 24) ^ w1h >>> 7) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20664 xl = (w14l >>> 19 | w14h << 13) ^ (w14l << 3 | w14h >>> 29) ^ (w14l >>> 6 | w14h << 26) | 0;
20665 w0l = w0l + xl | 0;
20666 w0h = w0h + ((w14h >>> 19 | w14l << 13) ^ (w14h << 3 | w14l >>> 29) ^ w14h >>> 6) + (w0l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20667 tl = 3928383900 + w0l | 0;
20668 th = 3391569614 + w0h + (tl >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20669 tl = tl + hl | 0;
20670 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20671 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20672 tl = tl + xl | 0;
20673 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20674 xl = gl ^ el & (fl ^ gl) | 0;
20675 tl = tl + xl | 0;
20676 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20677 hl = gl;
20678 hh = gh;
20679 gl = fl;
20680 gh = fh;
20681 fl = el;
20682 fh = eh;
20683 el = dl + tl | 0;
20684 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20685 dl = cl;
20686 dh = ch;
20687 cl = bl;
20688 ch = bh;
20689 bl = al;
20690 bh = ah;
20691 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20692 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20693 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20694 al = al + xl | 0;
20695 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20696 w1l = w1l + w10l | 0;
20697 w1h = w1h + w10h + (w1l >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
20698 xl = (w2l >>> 1 | w2h << 31) ^ (w2l >>> 8 | w2h << 24) ^ (w2l >>> 7 | w2h << 25) | 0;
20699 w1l = w1l + xl | 0;
20700 w1h = w1h + ((w2h >>> 1 | w2l << 31) ^ (w2h >>> 8 | w2l << 24) ^ w2h >>> 7) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20701 xl = (w15l >>> 19 | w15h << 13) ^ (w15l << 3 | w15h >>> 29) ^ (w15l >>> 6 | w15h << 26) | 0;
20702 w1l = w1l + xl | 0;
20703 w1h = w1h + ((w15h >>> 19 | w15l << 13) ^ (w15h << 3 | w15l >>> 29) ^ w15h >>> 6) + (w1l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20704 tl = 566280711 + w1l | 0;
20705 th = 3515267271 + w1h + (tl >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20706 tl = tl + hl | 0;
20707 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20708 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20709 tl = tl + xl | 0;
20710 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20711 xl = gl ^ el & (fl ^ gl) | 0;
20712 tl = tl + xl | 0;
20713 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20714 hl = gl;
20715 hh = gh;
20716 gl = fl;
20717 gh = fh;
20718 fl = el;
20719 fh = eh;
20720 el = dl + tl | 0;
20721 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20722 dl = cl;
20723 dh = ch;
20724 cl = bl;
20725 ch = bh;
20726 bl = al;
20727 bh = ah;
20728 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20729 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20730 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20731 al = al + xl | 0;
20732 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20733 w2l = w2l + w11l | 0;
20734 w2h = w2h + w11h + (w2l >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
20735 xl = (w3l >>> 1 | w3h << 31) ^ (w3l >>> 8 | w3h << 24) ^ (w3l >>> 7 | w3h << 25) | 0;
20736 w2l = w2l + xl | 0;
20737 w2h = w2h + ((w3h >>> 1 | w3l << 31) ^ (w3h >>> 8 | w3l << 24) ^ w3h >>> 7) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20738 xl = (w0l >>> 19 | w0h << 13) ^ (w0l << 3 | w0h >>> 29) ^ (w0l >>> 6 | w0h << 26) | 0;
20739 w2l = w2l + xl | 0;
20740 w2h = w2h + ((w0h >>> 19 | w0l << 13) ^ (w0h << 3 | w0l >>> 29) ^ w0h >>> 6) + (w2l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20741 tl = 3454069534 + w2l | 0;
20742 th = 3940187606 + w2h + (tl >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20743 tl = tl + hl | 0;
20744 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20745 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20746 tl = tl + xl | 0;
20747 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20748 xl = gl ^ el & (fl ^ gl) | 0;
20749 tl = tl + xl | 0;
20750 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20751 hl = gl;
20752 hh = gh;
20753 gl = fl;
20754 gh = fh;
20755 fl = el;
20756 fh = eh;
20757 el = dl + tl | 0;
20758 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20759 dl = cl;
20760 dh = ch;
20761 cl = bl;
20762 ch = bh;
20763 bl = al;
20764 bh = ah;
20765 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20766 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20767 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20768 al = al + xl | 0;
20769 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20770 w3l = w3l + w12l | 0;
20771 w3h = w3h + w12h + (w3l >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
20772 xl = (w4l >>> 1 | w4h << 31) ^ (w4l >>> 8 | w4h << 24) ^ (w4l >>> 7 | w4h << 25) | 0;
20773 w3l = w3l + xl | 0;
20774 w3h = w3h + ((w4h >>> 1 | w4l << 31) ^ (w4h >>> 8 | w4l << 24) ^ w4h >>> 7) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20775 xl = (w1l >>> 19 | w1h << 13) ^ (w1l << 3 | w1h >>> 29) ^ (w1l >>> 6 | w1h << 26) | 0;
20776 w3l = w3l + xl | 0;
20777 w3h = w3h + ((w1h >>> 19 | w1l << 13) ^ (w1h << 3 | w1l >>> 29) ^ w1h >>> 6) + (w3l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20778 tl = 4000239992 + w3l | 0;
20779 th = 4118630271 + w3h + (tl >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
20780 tl = tl + hl | 0;
20781 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20782 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20783 tl = tl + xl | 0;
20784 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20785 xl = gl ^ el & (fl ^ gl) | 0;
20786 tl = tl + xl | 0;
20787 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20788 hl = gl;
20789 hh = gh;
20790 gl = fl;
20791 gh = fh;
20792 fl = el;
20793 fh = eh;
20794 el = dl + tl | 0;
20795 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20796 dl = cl;
20797 dh = ch;
20798 cl = bl;
20799 ch = bh;
20800 bl = al;
20801 bh = ah;
20802 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20803 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20804 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20805 al = al + xl | 0;
20806 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20807 w4l = w4l + w13l | 0;
20808 w4h = w4h + w13h + (w4l >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
20809 xl = (w5l >>> 1 | w5h << 31) ^ (w5l >>> 8 | w5h << 24) ^ (w5l >>> 7 | w5h << 25) | 0;
20810 w4l = w4l + xl | 0;
20811 w4h = w4h + ((w5h >>> 1 | w5l << 31) ^ (w5h >>> 8 | w5l << 24) ^ w5h >>> 7) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20812 xl = (w2l >>> 19 | w2h << 13) ^ (w2l << 3 | w2h >>> 29) ^ (w2l >>> 6 | w2h << 26) | 0;
20813 w4l = w4l + xl | 0;
20814 w4h = w4h + ((w2h >>> 19 | w2l << 13) ^ (w2h << 3 | w2l >>> 29) ^ w2h >>> 6) + (w4l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20815 tl = 1914138554 + w4l | 0;
20816 th = 116418474 + w4h + (tl >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
20817 tl = tl + hl | 0;
20818 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20819 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20820 tl = tl + xl | 0;
20821 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20822 xl = gl ^ el & (fl ^ gl) | 0;
20823 tl = tl + xl | 0;
20824 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20825 hl = gl;
20826 hh = gh;
20827 gl = fl;
20828 gh = fh;
20829 fl = el;
20830 fh = eh;
20831 el = dl + tl | 0;
20832 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20833 dl = cl;
20834 dh = ch;
20835 cl = bl;
20836 ch = bh;
20837 bl = al;
20838 bh = ah;
20839 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20840 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20841 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20842 al = al + xl | 0;
20843 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20844 w5l = w5l + w14l | 0;
20845 w5h = w5h + w14h + (w5l >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
20846 xl = (w6l >>> 1 | w6h << 31) ^ (w6l >>> 8 | w6h << 24) ^ (w6l >>> 7 | w6h << 25) | 0;
20847 w5l = w5l + xl | 0;
20848 w5h = w5h + ((w6h >>> 1 | w6l << 31) ^ (w6h >>> 8 | w6l << 24) ^ w6h >>> 7) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20849 xl = (w3l >>> 19 | w3h << 13) ^ (w3l << 3 | w3h >>> 29) ^ (w3l >>> 6 | w3h << 26) | 0;
20850 w5l = w5l + xl | 0;
20851 w5h = w5h + ((w3h >>> 19 | w3l << 13) ^ (w3h << 3 | w3l >>> 29) ^ w3h >>> 6) + (w5l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20852 tl = 2731055270 + w5l | 0;
20853 th = 174292421 + w5h + (tl >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
20854 tl = tl + hl | 0;
20855 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20856 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20857 tl = tl + xl | 0;
20858 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20859 xl = gl ^ el & (fl ^ gl) | 0;
20860 tl = tl + xl | 0;
20861 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20862 hl = gl;
20863 hh = gh;
20864 gl = fl;
20865 gh = fh;
20866 fl = el;
20867 fh = eh;
20868 el = dl + tl | 0;
20869 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20870 dl = cl;
20871 dh = ch;
20872 cl = bl;
20873 ch = bh;
20874 bl = al;
20875 bh = ah;
20876 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20877 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20878 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20879 al = al + xl | 0;
20880 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20881 w6l = w6l + w15l | 0;
20882 w6h = w6h + w15h + (w6l >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
20883 xl = (w7l >>> 1 | w7h << 31) ^ (w7l >>> 8 | w7h << 24) ^ (w7l >>> 7 | w7h << 25) | 0;
20884 w6l = w6l + xl | 0;
20885 w6h = w6h + ((w7h >>> 1 | w7l << 31) ^ (w7h >>> 8 | w7l << 24) ^ w7h >>> 7) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20886 xl = (w4l >>> 19 | w4h << 13) ^ (w4l << 3 | w4h >>> 29) ^ (w4l >>> 6 | w4h << 26) | 0;
20887 w6l = w6l + xl | 0;
20888 w6h = w6h + ((w4h >>> 19 | w4l << 13) ^ (w4h << 3 | w4l >>> 29) ^ w4h >>> 6) + (w6l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20889 tl = 3203993006 + w6l | 0;
20890 th = 289380356 + w6h + (tl >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
20891 tl = tl + hl | 0;
20892 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20893 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20894 tl = tl + xl | 0;
20895 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20896 xl = gl ^ el & (fl ^ gl) | 0;
20897 tl = tl + xl | 0;
20898 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20899 hl = gl;
20900 hh = gh;
20901 gl = fl;
20902 gh = fh;
20903 fl = el;
20904 fh = eh;
20905 el = dl + tl | 0;
20906 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20907 dl = cl;
20908 dh = ch;
20909 cl = bl;
20910 ch = bh;
20911 bl = al;
20912 bh = ah;
20913 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20914 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20915 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20916 al = al + xl | 0;
20917 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20918 w7l = w7l + w0l | 0;
20919 w7h = w7h + w0h + (w7l >>> 0 < w0l >>> 0 ? 1 : 0) | 0;
20920 xl = (w8l >>> 1 | w8h << 31) ^ (w8l >>> 8 | w8h << 24) ^ (w8l >>> 7 | w8h << 25) | 0;
20921 w7l = w7l + xl | 0;
20922 w7h = w7h + ((w8h >>> 1 | w8l << 31) ^ (w8h >>> 8 | w8l << 24) ^ w8h >>> 7) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20923 xl = (w5l >>> 19 | w5h << 13) ^ (w5l << 3 | w5h >>> 29) ^ (w5l >>> 6 | w5h << 26) | 0;
20924 w7l = w7l + xl | 0;
20925 w7h = w7h + ((w5h >>> 19 | w5l << 13) ^ (w5h << 3 | w5l >>> 29) ^ w5h >>> 6) + (w7l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20926 tl = 320620315 + w7l | 0;
20927 th = 460393269 + w7h + (tl >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
20928 tl = tl + hl | 0;
20929 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20930 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20931 tl = tl + xl | 0;
20932 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20933 xl = gl ^ el & (fl ^ gl) | 0;
20934 tl = tl + xl | 0;
20935 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20936 hl = gl;
20937 hh = gh;
20938 gl = fl;
20939 gh = fh;
20940 fl = el;
20941 fh = eh;
20942 el = dl + tl | 0;
20943 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20944 dl = cl;
20945 dh = ch;
20946 cl = bl;
20947 ch = bh;
20948 bl = al;
20949 bh = ah;
20950 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20951 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20952 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20953 al = al + xl | 0;
20954 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20955 w8l = w8l + w1l | 0;
20956 w8h = w8h + w1h + (w8l >>> 0 < w1l >>> 0 ? 1 : 0) | 0;
20957 xl = (w9l >>> 1 | w9h << 31) ^ (w9l >>> 8 | w9h << 24) ^ (w9l >>> 7 | w9h << 25) | 0;
20958 w8l = w8l + xl | 0;
20959 w8h = w8h + ((w9h >>> 1 | w9l << 31) ^ (w9h >>> 8 | w9l << 24) ^ w9h >>> 7) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20960 xl = (w6l >>> 19 | w6h << 13) ^ (w6l << 3 | w6h >>> 29) ^ (w6l >>> 6 | w6h << 26) | 0;
20961 w8l = w8l + xl | 0;
20962 w8h = w8h + ((w6h >>> 19 | w6l << 13) ^ (w6h << 3 | w6l >>> 29) ^ w6h >>> 6) + (w8l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20963 tl = 587496836 + w8l | 0;
20964 th = 685471733 + w8h + (tl >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
20965 tl = tl + hl | 0;
20966 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
20967 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
20968 tl = tl + xl | 0;
20969 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20970 xl = gl ^ el & (fl ^ gl) | 0;
20971 tl = tl + xl | 0;
20972 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20973 hl = gl;
20974 hh = gh;
20975 gl = fl;
20976 gh = fh;
20977 fl = el;
20978 fh = eh;
20979 el = dl + tl | 0;
20980 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
20981 dl = cl;
20982 dh = ch;
20983 cl = bl;
20984 ch = bh;
20985 bl = al;
20986 bh = ah;
20987 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
20988 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
20989 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
20990 al = al + xl | 0;
20991 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20992 w9l = w9l + w2l | 0;
20993 w9h = w9h + w2h + (w9l >>> 0 < w2l >>> 0 ? 1 : 0) | 0;
20994 xl = (w10l >>> 1 | w10h << 31) ^ (w10l >>> 8 | w10h << 24) ^ (w10l >>> 7 | w10h << 25) | 0;
20995 w9l = w9l + xl | 0;
20996 w9h = w9h + ((w10h >>> 1 | w10l << 31) ^ (w10h >>> 8 | w10l << 24) ^ w10h >>> 7) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
20997 xl = (w7l >>> 19 | w7h << 13) ^ (w7l << 3 | w7h >>> 29) ^ (w7l >>> 6 | w7h << 26) | 0;
20998 w9l = w9l + xl | 0;
20999 w9h = w9h + ((w7h >>> 19 | w7l << 13) ^ (w7h << 3 | w7l >>> 29) ^ w7h >>> 6) + (w9l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21000 tl = 1086792851 + w9l | 0;
21001 th = 852142971 + w9h + (tl >>> 0 < w9l >>> 0 ? 1 : 0) | 0;
21002 tl = tl + hl | 0;
21003 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21004 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21005 tl = tl + xl | 0;
21006 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21007 xl = gl ^ el & (fl ^ gl) | 0;
21008 tl = tl + xl | 0;
21009 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21010 hl = gl;
21011 hh = gh;
21012 gl = fl;
21013 gh = fh;
21014 fl = el;
21015 fh = eh;
21016 el = dl + tl | 0;
21017 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21018 dl = cl;
21019 dh = ch;
21020 cl = bl;
21021 ch = bh;
21022 bl = al;
21023 bh = ah;
21024 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21025 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21026 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21027 al = al + xl | 0;
21028 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21029 w10l = w10l + w3l | 0;
21030 w10h = w10h + w3h + (w10l >>> 0 < w3l >>> 0 ? 1 : 0) | 0;
21031 xl = (w11l >>> 1 | w11h << 31) ^ (w11l >>> 8 | w11h << 24) ^ (w11l >>> 7 | w11h << 25) | 0;
21032 w10l = w10l + xl | 0;
21033 w10h = w10h + ((w11h >>> 1 | w11l << 31) ^ (w11h >>> 8 | w11l << 24) ^ w11h >>> 7) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21034 xl = (w8l >>> 19 | w8h << 13) ^ (w8l << 3 | w8h >>> 29) ^ (w8l >>> 6 | w8h << 26) | 0;
21035 w10l = w10l + xl | 0;
21036 w10h = w10h + ((w8h >>> 19 | w8l << 13) ^ (w8h << 3 | w8l >>> 29) ^ w8h >>> 6) + (w10l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21037 tl = 365543100 + w10l | 0;
21038 th = 1017036298 + w10h + (tl >>> 0 < w10l >>> 0 ? 1 : 0) | 0;
21039 tl = tl + hl | 0;
21040 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21041 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21042 tl = tl + xl | 0;
21043 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21044 xl = gl ^ el & (fl ^ gl) | 0;
21045 tl = tl + xl | 0;
21046 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21047 hl = gl;
21048 hh = gh;
21049 gl = fl;
21050 gh = fh;
21051 fl = el;
21052 fh = eh;
21053 el = dl + tl | 0;
21054 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21055 dl = cl;
21056 dh = ch;
21057 cl = bl;
21058 ch = bh;
21059 bl = al;
21060 bh = ah;
21061 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21062 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21063 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21064 al = al + xl | 0;
21065 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21066 w11l = w11l + w4l | 0;
21067 w11h = w11h + w4h + (w11l >>> 0 < w4l >>> 0 ? 1 : 0) | 0;
21068 xl = (w12l >>> 1 | w12h << 31) ^ (w12l >>> 8 | w12h << 24) ^ (w12l >>> 7 | w12h << 25) | 0;
21069 w11l = w11l + xl | 0;
21070 w11h = w11h + ((w12h >>> 1 | w12l << 31) ^ (w12h >>> 8 | w12l << 24) ^ w12h >>> 7) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21071 xl = (w9l >>> 19 | w9h << 13) ^ (w9l << 3 | w9h >>> 29) ^ (w9l >>> 6 | w9h << 26) | 0;
21072 w11l = w11l + xl | 0;
21073 w11h = w11h + ((w9h >>> 19 | w9l << 13) ^ (w9h << 3 | w9l >>> 29) ^ w9h >>> 6) + (w11l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21074 tl = 2618297676 + w11l | 0;
21075 th = 1126000580 + w11h + (tl >>> 0 < w11l >>> 0 ? 1 : 0) | 0;
21076 tl = tl + hl | 0;
21077 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21078 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21079 tl = tl + xl | 0;
21080 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21081 xl = gl ^ el & (fl ^ gl) | 0;
21082 tl = tl + xl | 0;
21083 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21084 hl = gl;
21085 hh = gh;
21086 gl = fl;
21087 gh = fh;
21088 fl = el;
21089 fh = eh;
21090 el = dl + tl | 0;
21091 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21092 dl = cl;
21093 dh = ch;
21094 cl = bl;
21095 ch = bh;
21096 bl = al;
21097 bh = ah;
21098 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21099 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21100 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21101 al = al + xl | 0;
21102 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21103 w12l = w12l + w5l | 0;
21104 w12h = w12h + w5h + (w12l >>> 0 < w5l >>> 0 ? 1 : 0) | 0;
21105 xl = (w13l >>> 1 | w13h << 31) ^ (w13l >>> 8 | w13h << 24) ^ (w13l >>> 7 | w13h << 25) | 0;
21106 w12l = w12l + xl | 0;
21107 w12h = w12h + ((w13h >>> 1 | w13l << 31) ^ (w13h >>> 8 | w13l << 24) ^ w13h >>> 7) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21108 xl = (w10l >>> 19 | w10h << 13) ^ (w10l << 3 | w10h >>> 29) ^ (w10l >>> 6 | w10h << 26) | 0;
21109 w12l = w12l + xl | 0;
21110 w12h = w12h + ((w10h >>> 19 | w10l << 13) ^ (w10h << 3 | w10l >>> 29) ^ w10h >>> 6) + (w12l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21111 tl = 3409855158 + w12l | 0;
21112 th = 1288033470 + w12h + (tl >>> 0 < w12l >>> 0 ? 1 : 0) | 0;
21113 tl = tl + hl | 0;
21114 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21115 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21116 tl = tl + xl | 0;
21117 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21118 xl = gl ^ el & (fl ^ gl) | 0;
21119 tl = tl + xl | 0;
21120 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21121 hl = gl;
21122 hh = gh;
21123 gl = fl;
21124 gh = fh;
21125 fl = el;
21126 fh = eh;
21127 el = dl + tl | 0;
21128 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21129 dl = cl;
21130 dh = ch;
21131 cl = bl;
21132 ch = bh;
21133 bl = al;
21134 bh = ah;
21135 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21136 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21137 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21138 al = al + xl | 0;
21139 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21140 w13l = w13l + w6l | 0;
21141 w13h = w13h + w6h + (w13l >>> 0 < w6l >>> 0 ? 1 : 0) | 0;
21142 xl = (w14l >>> 1 | w14h << 31) ^ (w14l >>> 8 | w14h << 24) ^ (w14l >>> 7 | w14h << 25) | 0;
21143 w13l = w13l + xl | 0;
21144 w13h = w13h + ((w14h >>> 1 | w14l << 31) ^ (w14h >>> 8 | w14l << 24) ^ w14h >>> 7) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21145 xl = (w11l >>> 19 | w11h << 13) ^ (w11l << 3 | w11h >>> 29) ^ (w11l >>> 6 | w11h << 26) | 0;
21146 w13l = w13l + xl | 0;
21147 w13h = w13h + ((w11h >>> 19 | w11l << 13) ^ (w11h << 3 | w11l >>> 29) ^ w11h >>> 6) + (w13l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21148 tl = 4234509866 + w13l | 0;
21149 th = 1501505948 + w13h + (tl >>> 0 < w13l >>> 0 ? 1 : 0) | 0;
21150 tl = tl + hl | 0;
21151 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21152 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21153 tl = tl + xl | 0;
21154 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21155 xl = gl ^ el & (fl ^ gl) | 0;
21156 tl = tl + xl | 0;
21157 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21158 hl = gl;
21159 hh = gh;
21160 gl = fl;
21161 gh = fh;
21162 fl = el;
21163 fh = eh;
21164 el = dl + tl | 0;
21165 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21166 dl = cl;
21167 dh = ch;
21168 cl = bl;
21169 ch = bh;
21170 bl = al;
21171 bh = ah;
21172 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21173 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21174 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21175 al = al + xl | 0;
21176 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21177 w14l = w14l + w7l | 0;
21178 w14h = w14h + w7h + (w14l >>> 0 < w7l >>> 0 ? 1 : 0) | 0;
21179 xl = (w15l >>> 1 | w15h << 31) ^ (w15l >>> 8 | w15h << 24) ^ (w15l >>> 7 | w15h << 25) | 0;
21180 w14l = w14l + xl | 0;
21181 w14h = w14h + ((w15h >>> 1 | w15l << 31) ^ (w15h >>> 8 | w15l << 24) ^ w15h >>> 7) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21182 xl = (w12l >>> 19 | w12h << 13) ^ (w12l << 3 | w12h >>> 29) ^ (w12l >>> 6 | w12h << 26) | 0;
21183 w14l = w14l + xl | 0;
21184 w14h = w14h + ((w12h >>> 19 | w12l << 13) ^ (w12h << 3 | w12l >>> 29) ^ w12h >>> 6) + (w14l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21185 tl = 987167468 + w14l | 0;
21186 th = 1607167915 + w14h + (tl >>> 0 < w14l >>> 0 ? 1 : 0) | 0;
21187 tl = tl + hl | 0;
21188 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21189 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21190 tl = tl + xl | 0;
21191 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21192 xl = gl ^ el & (fl ^ gl) | 0;
21193 tl = tl + xl | 0;
21194 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21195 hl = gl;
21196 hh = gh;
21197 gl = fl;
21198 gh = fh;
21199 fl = el;
21200 fh = eh;
21201 el = dl + tl | 0;
21202 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21203 dl = cl;
21204 dh = ch;
21205 cl = bl;
21206 ch = bh;
21207 bl = al;
21208 bh = ah;
21209 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21210 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21211 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21212 al = al + xl | 0;
21213 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21214 w15l = w15l + w8l | 0;
21215 w15h = w15h + w8h + (w15l >>> 0 < w8l >>> 0 ? 1 : 0) | 0;
21216 xl = (w0l >>> 1 | w0h << 31) ^ (w0l >>> 8 | w0h << 24) ^ (w0l >>> 7 | w0h << 25) | 0;
21217 w15l = w15l + xl | 0;
21218 w15h = w15h + ((w0h >>> 1 | w0l << 31) ^ (w0h >>> 8 | w0l << 24) ^ w0h >>> 7) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21219 xl = (w13l >>> 19 | w13h << 13) ^ (w13l << 3 | w13h >>> 29) ^ (w13l >>> 6 | w13h << 26) | 0;
21220 w15l = w15l + xl | 0;
21221 w15h = w15h + ((w13h >>> 19 | w13l << 13) ^ (w13h << 3 | w13l >>> 29) ^ w13h >>> 6) + (w15l >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21222 tl = 1246189591 + w15l | 0;
21223 th = 1816402316 + w15h + (tl >>> 0 < w15l >>> 0 ? 1 : 0) | 0;
21224 tl = tl + hl | 0;
21225 th = th + hh + (tl >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21226 xl = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9) | 0;
21227 tl = tl + xl | 0;
21228 th = th + ((eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21229 xl = gl ^ el & (fl ^ gl) | 0;
21230 tl = tl + xl | 0;
21231 th = th + (gh ^ eh & (fh ^ gh)) + (tl >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21232 hl = gl;
21233 hh = gh;
21234 gl = fl;
21235 gh = fh;
21236 fl = el;
21237 fh = eh;
21238 el = dl + tl | 0;
21239 eh = dh + th + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21240 dl = cl;
21241 dh = ch;
21242 cl = bl;
21243 ch = bh;
21244 bl = al;
21245 bh = ah;
21246 al = tl + (bl & cl ^ dl & (bl ^ cl)) | 0;
21247 ah = th + (bh & ch ^ dh & (bh ^ ch)) + (al >>> 0 < tl >>> 0 ? 1 : 0) | 0;
21248 xl = (bl >>> 28 | bh << 4) ^ (bl << 30 | bh >>> 2) ^ (bl << 25 | bh >>> 7) | 0;
21249 al = al + xl | 0;
21250 ah = ah + ((bh >>> 28 | bl << 4) ^ (bh << 30 | bl >>> 2) ^ (bh << 25 | bl >>> 7)) + (al >>> 0 < xl >>> 0 ? 1 : 0) | 0;
21251 H0l = H0l + al | 0;
21252 H0h = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0) | 0;
21253 H1l = H1l + bl | 0;
21254 H1h = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0) | 0;
21255 H2l = H2l + cl | 0;
21256 H2h = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0) | 0;
21257 H3l = H3l + dl | 0;
21258 H3h = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0) | 0;
21259 H4l = H4l + el | 0;
21260 H4h = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0) | 0;
21261 H5l = H5l + fl | 0;
21262 H5h = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0) | 0;
21263 H6l = H6l + gl | 0;
21264 H6h = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0) | 0;
21265 H7l = H7l + hl | 0;
21266 H7h = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0) | 0;
21267 }
21268 function _core_heap(offset) {
21269 offset = offset | 0;
21270 _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]);
21271 }
21272 function _state_to_heap(output) {
21273 output = output | 0;
21274 HEAP[output | 0] = H0h >>> 24;
21275 HEAP[output | 1] = H0h >>> 16 & 255;
21276 HEAP[output | 2] = H0h >>> 8 & 255;
21277 HEAP[output | 3] = H0h & 255;
21278 HEAP[output | 4] = H0l >>> 24;
21279 HEAP[output | 5] = H0l >>> 16 & 255;
21280 HEAP[output | 6] = H0l >>> 8 & 255;
21281 HEAP[output | 7] = H0l & 255;
21282 HEAP[output | 8] = H1h >>> 24;
21283 HEAP[output | 9] = H1h >>> 16 & 255;
21284 HEAP[output | 10] = H1h >>> 8 & 255;
21285 HEAP[output | 11] = H1h & 255;
21286 HEAP[output | 12] = H1l >>> 24;
21287 HEAP[output | 13] = H1l >>> 16 & 255;
21288 HEAP[output | 14] = H1l >>> 8 & 255;
21289 HEAP[output | 15] = H1l & 255;
21290 HEAP[output | 16] = H2h >>> 24;
21291 HEAP[output | 17] = H2h >>> 16 & 255;
21292 HEAP[output | 18] = H2h >>> 8 & 255;
21293 HEAP[output | 19] = H2h & 255;
21294 HEAP[output | 20] = H2l >>> 24;
21295 HEAP[output | 21] = H2l >>> 16 & 255;
21296 HEAP[output | 22] = H2l >>> 8 & 255;
21297 HEAP[output | 23] = H2l & 255;
21298 HEAP[output | 24] = H3h >>> 24;
21299 HEAP[output | 25] = H3h >>> 16 & 255;
21300 HEAP[output | 26] = H3h >>> 8 & 255;
21301 HEAP[output | 27] = H3h & 255;
21302 HEAP[output | 28] = H3l >>> 24;
21303 HEAP[output | 29] = H3l >>> 16 & 255;
21304 HEAP[output | 30] = H3l >>> 8 & 255;
21305 HEAP[output | 31] = H3l & 255;
21306 HEAP[output | 32] = H4h >>> 24;
21307 HEAP[output | 33] = H4h >>> 16 & 255;
21308 HEAP[output | 34] = H4h >>> 8 & 255;
21309 HEAP[output | 35] = H4h & 255;
21310 HEAP[output | 36] = H4l >>> 24;
21311 HEAP[output | 37] = H4l >>> 16 & 255;
21312 HEAP[output | 38] = H4l >>> 8 & 255;
21313 HEAP[output | 39] = H4l & 255;
21314 HEAP[output | 40] = H5h >>> 24;
21315 HEAP[output | 41] = H5h >>> 16 & 255;
21316 HEAP[output | 42] = H5h >>> 8 & 255;
21317 HEAP[output | 43] = H5h & 255;
21318 HEAP[output | 44] = H5l >>> 24;
21319 HEAP[output | 45] = H5l >>> 16 & 255;
21320 HEAP[output | 46] = H5l >>> 8 & 255;
21321 HEAP[output | 47] = H5l & 255;
21322 HEAP[output | 48] = H6h >>> 24;
21323 HEAP[output | 49] = H6h >>> 16 & 255;
21324 HEAP[output | 50] = H6h >>> 8 & 255;
21325 HEAP[output | 51] = H6h & 255;
21326 HEAP[output | 52] = H6l >>> 24;
21327 HEAP[output | 53] = H6l >>> 16 & 255;
21328 HEAP[output | 54] = H6l >>> 8 & 255;
21329 HEAP[output | 55] = H6l & 255;
21330 HEAP[output | 56] = H7h >>> 24;
21331 HEAP[output | 57] = H7h >>> 16 & 255;
21332 HEAP[output | 58] = H7h >>> 8 & 255;
21333 HEAP[output | 59] = H7h & 255;
21334 HEAP[output | 60] = H7l >>> 24;
21335 HEAP[output | 61] = H7l >>> 16 & 255;
21336 HEAP[output | 62] = H7l >>> 8 & 255;
21337 HEAP[output | 63] = H7l & 255;
21338 }
21339 function reset() {
21340 H0h = 1779033703;
21341 H0l = 4089235720;
21342 H1h = 3144134277;
21343 H1l = 2227873595;
21344 H2h = 1013904242;
21345 H2l = 4271175723;
21346 H3h = 2773480762;
21347 H3l = 1595750129;
21348 H4h = 1359893119;
21349 H4l = 2917565137;
21350 H5h = 2600822924;
21351 H5l = 725511199;
21352 H6h = 528734635;
21353 H6l = 4215389547;
21354 H7h = 1541459225;
21355 H7l = 327033209;
21356 TOTAL = 0;
21357 }
21358 function init(h0h, h0l, h1h, h1l, h2h, h2l, h3h, h3l, h4h, h4l, h5h, h5l, h6h, h6l, h7h, h7l, total) {
21359 h0h = h0h | 0;
21360 h0l = h0l | 0;
21361 h1h = h1h | 0;
21362 h1l = h1l | 0;
21363 h2h = h2h | 0;
21364 h2l = h2l | 0;
21365 h3h = h3h | 0;
21366 h3l = h3l | 0;
21367 h4h = h4h | 0;
21368 h4l = h4l | 0;
21369 h5h = h5h | 0;
21370 h5l = h5l | 0;
21371 h6h = h6h | 0;
21372 h6l = h6l | 0;
21373 h7h = h7h | 0;
21374 h7l = h7l | 0;
21375 total = total | 0;
21376 H0h = h0h;
21377 H0l = h0l;
21378 H1h = h1h;
21379 H1l = h1l;
21380 H2h = h2h;
21381 H2l = h2l;
21382 H3h = h3h;
21383 H3l = h3l;
21384 H4h = h4h;
21385 H4l = h4l;
21386 H5h = h5h;
21387 H5l = h5l;
21388 H6h = h6h;
21389 H6l = h6l;
21390 H7h = h7h;
21391 H7l = h7l;
21392 TOTAL = total;
21393 }
21394 function process(offset, length) {
21395 offset = offset | 0;
21396 length = length | 0;
21397 var hashed = 0;
21398 if (offset & 127) return -1;
21399 while ((length | 0) >= 128) {
21400 _core_heap(offset);
21401 offset = offset + 128 | 0;
21402 length = length - 128 | 0;
21403 hashed = hashed + 128 | 0;
21404 }
21405 TOTAL = TOTAL + hashed | 0;
21406 return hashed | 0;
21407 }
21408 function finish(offset, length, output) {
21409 offset = offset | 0;
21410 length = length | 0;
21411 output = output | 0;
21412 var hashed = 0, i = 0;
21413 if (offset & 127) return -1;
21414 if (~output) if (output & 63) return -1;
21415 if ((length | 0) >= 128) {
21416 hashed = process(offset, length) | 0;
21417 if ((hashed | 0) == -1) return -1;
21418 offset = offset + hashed | 0;
21419 length = length - hashed | 0;
21420 }
21421 hashed = hashed + length | 0;
21422 TOTAL = TOTAL + length | 0;
21423 HEAP[offset | length] = 128;
21424 if ((length | 0) >= 112) {
21425 for (i = length + 1 | 0; (i | 0) < 128; i = i + 1 | 0) HEAP[offset | i] = 0;
21426 _core_heap(offset);
21427 length = 0;
21428 HEAP[offset | 0] = 0;
21429 }
21430 for (i = length + 1 | 0; (i | 0) < 123; i = i + 1 | 0) HEAP[offset | i] = 0;
21431 HEAP[offset | 123] = TOTAL >>> 29;
21432 HEAP[offset | 124] = TOTAL >>> 21 & 255;
21433 HEAP[offset | 125] = TOTAL >>> 13 & 255;
21434 HEAP[offset | 126] = TOTAL >>> 5 & 255;
21435 HEAP[offset | 127] = TOTAL << 3 & 255;
21436 _core_heap(offset);
21437 if (~output) _state_to_heap(output);
21438 return hashed | 0;
21439 }
21440 function hmac_reset() {
21441 H0h = I0h;
21442 H0l = I0l;
21443 H1h = I1h;
21444 H1l = I1l;
21445 H2h = I2h;
21446 H2l = I2l;
21447 H3h = I3h;
21448 H3l = I3l;
21449 H4h = I4h;
21450 H4l = I4l;
21451 H5h = I5h;
21452 H5l = I5l;
21453 H6h = I6h;
21454 H6l = I6l;
21455 H7h = I7h;
21456 H7l = I7l;
21457 TOTAL = 128;
21458 }
21459 function _hmac_opad() {
21460 H0h = O0h;
21461 H0l = O0l;
21462 H1h = O1h;
21463 H1l = O1l;
21464 H2h = O2h;
21465 H2l = O2l;
21466 H3h = O3h;
21467 H3l = O3l;
21468 H4h = O4h;
21469 H4l = O4l;
21470 H5h = O5h;
21471 H5l = O5l;
21472 H6h = O6h;
21473 H6l = O6l;
21474 H7h = O7h;
21475 H7l = O7l;
21476 TOTAL = 128;
21477 }
21478 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) {
21479 p0h = p0h | 0;
21480 p0l = p0l | 0;
21481 p1h = p1h | 0;
21482 p1l = p1l | 0;
21483 p2h = p2h | 0;
21484 p2l = p2l | 0;
21485 p3h = p3h | 0;
21486 p3l = p3l | 0;
21487 p4h = p4h | 0;
21488 p4l = p4l | 0;
21489 p5h = p5h | 0;
21490 p5l = p5l | 0;
21491 p6h = p6h | 0;
21492 p6l = p6l | 0;
21493 p7h = p7h | 0;
21494 p7l = p7l | 0;
21495 p8h = p8h | 0;
21496 p8l = p8l | 0;
21497 p9h = p9h | 0;
21498 p9l = p9l | 0;
21499 p10h = p10h | 0;
21500 p10l = p10l | 0;
21501 p11h = p11h | 0;
21502 p11l = p11l | 0;
21503 p12h = p12h | 0;
21504 p12l = p12l | 0;
21505 p13h = p13h | 0;
21506 p13l = p13l | 0;
21507 p14h = p14h | 0;
21508 p14l = p14l | 0;
21509 p15h = p15h | 0;
21510 p15l = p15l | 0;
21511 reset();
21512 _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);
21513 O0h = H0h;
21514 O0l = H0l;
21515 O1h = H1h;
21516 O1l = H1l;
21517 O2h = H2h;
21518 O2l = H2l;
21519 O3h = H3h;
21520 O3l = H3l;
21521 O4h = H4h;
21522 O4l = H4l;
21523 O5h = H5h;
21524 O5l = H5l;
21525 O6h = H6h;
21526 O6l = H6l;
21527 O7h = H7h;
21528 O7l = H7l;
21529 reset();
21530 _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);
21531 I0h = H0h;
21532 I0l = H0l;
21533 I1h = H1h;
21534 I1l = H1l;
21535 I2h = H2h;
21536 I2l = H2l;
21537 I3h = H3h;
21538 I3l = H3l;
21539 I4h = H4h;
21540 I4l = H4l;
21541 I5h = H5h;
21542 I5l = H5l;
21543 I6h = H6h;
21544 I6l = H6l;
21545 I7h = H7h;
21546 I7l = H7l;
21547 TOTAL = 128;
21548 }
21549 function hmac_finish(offset, length, output) {
21550 offset = offset | 0;
21551 length = length | 0;
21552 output = output | 0;
21553 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;
21554 if (offset & 127) return -1;
21555 if (~output) if (output & 63) return -1;
21556 hashed = finish(offset, length, -1) | 0;
21557 t0h = H0h;
21558 t0l = H0l;
21559 t1h = H1h;
21560 t1l = H1l;
21561 t2h = H2h;
21562 t2l = H2l;
21563 t3h = H3h;
21564 t3l = H3l;
21565 t4h = H4h;
21566 t4l = H4l;
21567 t5h = H5h;
21568 t5l = H5l;
21569 t6h = H6h;
21570 t6l = H6l;
21571 t7h = H7h;
21572 t7l = H7l;
21573 _hmac_opad();
21574 _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);
21575 if (~output) _state_to_heap(output);
21576 return hashed | 0;
21577 }
21578 function pbkdf2_generate_block(offset, length, block, count, output) {
21579 offset = offset | 0;
21580 length = length | 0;
21581 block = block | 0;
21582 count = count | 0;
21583 output = output | 0;
21584 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;
21585 if (offset & 127) return -1;
21586 if (~output) if (output & 63) return -1;
21587 HEAP[offset + length | 0] = block >>> 24;
21588 HEAP[offset + length + 1 | 0] = block >>> 16 & 255;
21589 HEAP[offset + length + 2 | 0] = block >>> 8 & 255;
21590 HEAP[offset + length + 3 | 0] = block & 255;
21591 // Closure compiler warning - The result of the 'bitor' operator is not being used
21592 //hmac_finish(offset, length + 4 | 0, -1) | 0;
21593 hmac_finish(offset, length + 4 | 0, -1);
21594 h0h = t0h = H0h;
21595 h0l = t0l = H0l;
21596 h1h = t1h = H1h;
21597 h1l = t1l = H1l;
21598 h2h = t2h = H2h;
21599 h2l = t2l = H2l;
21600 h3h = t3h = H3h;
21601 h3l = t3l = H3l;
21602 h4h = t4h = H4h;
21603 h4l = t4l = H4l;
21604 h5h = t5h = H5h;
21605 h5l = t5l = H5l;
21606 h6h = t6h = H6h;
21607 h6l = t6l = H6l;
21608 h7h = t7h = H7h;
21609 h7l = t7l = H7l;
21610 count = count - 1 | 0;
21611 while ((count | 0) > 0) {
21612 hmac_reset();
21613 _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);
21614 t0h = H0h;
21615 t0l = H0l;
21616 t1h = H1h;
21617 t1l = H1l;
21618 t2h = H2h;
21619 t2l = H2l;
21620 t3h = H3h;
21621 t3l = H3l;
21622 t4h = H4h;
21623 t4l = H4l;
21624 t5h = H5h;
21625 t5l = H5l;
21626 t6h = H6h;
21627 t6l = H6l;
21628 t7h = H7h;
21629 t7l = H7l;
21630 _hmac_opad();
21631 _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);
21632 t0h = H0h;
21633 t0l = H0l;
21634 t1h = H1h;
21635 t1l = H1l;
21636 t2h = H2h;
21637 t2l = H2l;
21638 t3h = H3h;
21639 t3l = H3l;
21640 t4h = H4h;
21641 t4l = H4l;
21642 t5h = H5h;
21643 t5l = H5l;
21644 t6h = H6h;
21645 t6l = H6l;
21646 t7h = H7h;
21647 t7l = H7l;
21648 h0h = h0h ^ H0h;
21649 h0l = h0l ^ H0l;
21650 h1h = h1h ^ H1h;
21651 h1l = h1l ^ H1l;
21652 h2h = h2h ^ H2h;
21653 h2l = h2l ^ H2l;
21654 h3h = h3h ^ H3h;
21655 h3l = h3l ^ H3l;
21656 h4h = h4h ^ H4h;
21657 h4l = h4l ^ H4l;
21658 h5h = h5h ^ H5h;
21659 h5l = h5l ^ H5l;
21660 h6h = h6h ^ H6h;
21661 h6l = h6l ^ H6l;
21662 h7h = h7h ^ H7h;
21663 h7l = h7l ^ H7l;
21664 count = count - 1 | 0;
21665 }
21666 H0h = h0h;
21667 H0l = h0l;
21668 H1h = h1h;
21669 H1l = h1l;
21670 H2h = h2h;
21671 H2l = h2l;
21672 H3h = h3h;
21673 H3l = h3l;
21674 H4h = h4h;
21675 H4l = h4l;
21676 H5h = h5h;
21677 H5l = h5l;
21678 H6h = h6h;
21679 H6l = h6l;
21680 H7h = h7h;
21681 H7l = h7l;
21682 if (~output) _state_to_heap(output);
21683 return 0;
21684 }
21685 return {
21686 reset: reset,
21687 init: init,
21688 process: process,
21689 finish: finish,
21690 hmac_reset: hmac_reset,
21691 hmac_init: hmac_init,
21692 hmac_finish: hmac_finish,
21693 pbkdf2_generate_block: pbkdf2_generate_block
21694 };
21695 }
21696 var _sha512_block_size = 128, _sha512_hash_size = 64;
21697 function sha512_constructor(options) {
21698 options = options || {};
21699 options.heapSize = options.heapSize || 4096;
21700 if (options.heapSize <= 0 || options.heapSize % 4096) throw new IllegalArgumentError("heapSize must be a positive number and multiple of 4096");
21701 this.heap = options.heap || new Uint8Array(options.heapSize);
21702 this.asm = options.asm || sha512_asm(global, null, this.heap.buffer);
21703 this.BLOCK_SIZE = _sha512_block_size;
21704 this.HASH_SIZE = _sha512_hash_size;
21705 this.reset();
21706 }
21707 function sha512_reset() {
21708 this.result = null;
21709 this.pos = 0;
21710 this.len = 0;
21711 this.asm.reset();
21712 return this;
21713 }
21714 function sha512_process(data) {
21715 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21716 var dpos = 0, dlen = 0, clen = 0;
21717 if (is_buffer(data) || is_bytes(data)) {
21718 dpos = data.byteOffset || 0;
21719 dlen = data.byteLength;
21720 } else if (is_string(data)) {
21721 dlen = data.length;
21722 } else {
21723 throw new TypeError("data isn't of expected type");
21724 }
21725 while (dlen > 0) {
21726 clen = this.heap.byteLength - this.pos - this.len;
21727 clen = clen < dlen ? clen : dlen;
21728 if (is_buffer(data) || is_bytes(data)) {
21729 this.heap.set(new Uint8Array(data.buffer || data, dpos, clen), this.pos + this.len);
21730 } else {
21731 for (var i = 0; i < clen; i++) this.heap[this.pos + this.len + i] = data.charCodeAt(dpos + i);
21732 }
21733 this.len += clen;
21734 dpos += clen;
21735 dlen -= clen;
21736 clen = this.asm.process(this.pos, this.len);
21737 if (clen < this.len) {
21738 this.pos += clen;
21739 this.len -= clen;
21740 } else {
21741 this.pos = 0;
21742 this.len = 0;
21743 }
21744 }
21745 return this;
21746 }
21747 function sha512_finish() {
21748 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21749 this.asm.finish(this.pos, this.len, 0);
21750 this.result = new Uint8Array(_sha512_hash_size);
21751 this.result.set(this.heap.subarray(0, _sha512_hash_size));
21752 this.pos = 0;
21753 this.len = 0;
21754 return this;
21755 }
21756 sha512_constructor.BLOCK_SIZE = _sha512_block_size;
21757 sha512_constructor.HASH_SIZE = _sha512_hash_size;
21758 var sha512_prototype = sha512_constructor.prototype;
21759 sha512_prototype.reset = sha512_reset;
21760 sha512_prototype.process = sha512_process;
21761 sha512_prototype.finish = sha512_finish;
21762 function hmac_constructor(options) {
21763 options = options || {};
21764 if (!options.hash) throw new SyntaxError("option 'hash' is required");
21765 if (!options.hash.HASH_SIZE) throw new SyntaxError("option 'hash' supplied doesn't seem to be a valid hash function");
21766 this.hash = options.hash;
21767 this.BLOCK_SIZE = this.hash.BLOCK_SIZE;
21768 this.HMAC_SIZE = this.hash.HASH_SIZE;
21769 this.key = null;
21770 this.verify = null;
21771 this.result = null;
21772 if (options.password !== undefined || options.verify !== undefined) this.reset(options);
21773 return this;
21774 }
21775 function hmac_sha256_constructor(options) {
21776 options = options || {};
21777 if (!(options.hash instanceof sha256_constructor)) options.hash = new sha256_constructor(options);
21778 hmac_constructor.call(this, options);
21779 return this;
21780 }
21781 function hmac_sha512_constructor(options) {
21782 options = options || {};
21783 if (!(options.hash instanceof sha512_constructor)) options.hash = new sha512_constructor(options);
21784 hmac_constructor.call(this, options);
21785 return this;
21786 }
21787 function _hmac_key(hash, password) {
21788 var key;
21789 if (is_buffer(password) || is_bytes(password)) {
21790 key = new Uint8Array(hash.BLOCK_SIZE);
21791 if (password.byteLength > hash.BLOCK_SIZE) {
21792 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21793 } else if (is_buffer(password)) {
21794 key.set(new Uint8Array(password));
21795 } else {
21796 key.set(password);
21797 }
21798 } else if (is_string(password)) {
21799 key = new Uint8Array(hash.BLOCK_SIZE);
21800 if (password.length > hash.BLOCK_SIZE) {
21801 key.set(new Uint8Array(hash.reset().process(password).finish().result));
21802 } else {
21803 for (var i = 0; i < password.length; ++i) key[i] = password.charCodeAt(i);
21804 }
21805 } else {
21806 throw new TypeError("password isn't of expected type");
21807 }
21808 return key;
21809 }
21810 function _hmac_init_verify(verify) {
21811 if (is_buffer(verify) || is_bytes(verify)) {
21812 verify = new Uint8Array(verify);
21813 } else if (is_string(verify)) {
21814 verify = string_to_bytes(verify);
21815 } else {
21816 throw new TypeError("verify tag isn't of expected type");
21817 }
21818 if (verify.length !== this.HMAC_SIZE) throw new IllegalArgumentError("illegal verification tag size");
21819 this.verify = verify;
21820 }
21821 function hmac_reset(options) {
21822 options = options || {};
21823 var password = options.password;
21824 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21825 this.result = null;
21826 this.hash.reset();
21827 if (password || is_string(password)) this.key = _hmac_key(this.hash, password);
21828 var ipad = new Uint8Array(this.key);
21829 for (var i = 0; i < ipad.length; ++i) ipad[i] ^= 54;
21830 this.hash.process(ipad);
21831 var verify = options.verify;
21832 if (verify !== undefined) {
21833 _hmac_init_verify.call(this, verify);
21834 } else {
21835 this.verify = null;
21836 }
21837 return this;
21838 }
21839 function hmac_sha256_reset(options) {
21840 options = options || {};
21841 var password = options.password;
21842 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21843 this.result = null;
21844 this.hash.reset();
21845 if (password || is_string(password)) {
21846 this.key = _hmac_key(this.hash, password);
21847 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]);
21848 } else {
21849 this.hash.asm.hmac_reset();
21850 }
21851 var verify = options.verify;
21852 if (verify !== undefined) {
21853 _hmac_init_verify.call(this, verify);
21854 } else {
21855 this.verify = null;
21856 }
21857 return this;
21858 }
21859 function hmac_sha512_reset(options) {
21860 options = options || {};
21861 var password = options.password;
21862 if (this.key === null && !is_string(password) && !password) throw new IllegalStateError("no key is associated with the instance");
21863 this.result = null;
21864 this.hash.reset();
21865 if (password || is_string(password)) {
21866 this.key = _hmac_key(this.hash, password);
21867 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]);
21868 } else {
21869 this.hash.asm.hmac_reset();
21870 }
21871 var verify = options.verify;
21872 if (verify !== undefined) {
21873 _hmac_init_verify.call(this, verify);
21874 } else {
21875 this.verify = null;
21876 }
21877 return this;
21878 }
21879 function hmac_process(data) {
21880 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21881 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21882 this.hash.process(data);
21883 return this;
21884 }
21885 function hmac_finish() {
21886 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21887 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21888 var inner_result = this.hash.finish().result;
21889 var opad = new Uint8Array(this.key);
21890 for (var i = 0; i < opad.length; ++i) opad[i] ^= 92;
21891 var verify = this.verify;
21892 var result = this.hash.reset().process(opad).process(inner_result).finish().result;
21893 if (verify) {
21894 if (verify.length === result.length) {
21895 var diff = 0;
21896 for (var i = 0; i < verify.length; i++) {
21897 diff |= verify[i] ^ result[i];
21898 }
21899 this.result = !diff;
21900 } else {
21901 this.result = false;
21902 }
21903 } else {
21904 this.result = result;
21905 }
21906 return this;
21907 }
21908 function hmac_sha256_finish() {
21909 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21910 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21911 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
21912 asm.hmac_finish(hash.pos, hash.len, 0);
21913 var verify = this.verify;
21914 var result = new Uint8Array(_sha256_hash_size);
21915 result.set(heap.subarray(0, _sha256_hash_size));
21916 if (verify) {
21917 if (verify.length === result.length) {
21918 var diff = 0;
21919 for (var i = 0; i < verify.length; i++) {
21920 diff |= verify[i] ^ result[i];
21921 }
21922 this.result = !diff;
21923 } else {
21924 this.result = false;
21925 }
21926 } else {
21927 this.result = result;
21928 }
21929 return this;
21930 }
21931 function hmac_sha512_finish() {
21932 if (this.key === null) throw new IllegalStateError("no key is associated with the instance");
21933 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
21934 var hash = this.hash, asm = this.hash.asm, heap = this.hash.heap;
21935 asm.hmac_finish(hash.pos, hash.len, 0);
21936 var verify = this.verify;
21937 var result = new Uint8Array(_sha512_hash_size);
21938 result.set(heap.subarray(0, _sha512_hash_size));
21939 if (verify) {
21940 if (verify.length === result.length) {
21941 var diff = 0;
21942 for (var i = 0; i < verify.length; i++) {
21943 diff |= verify[i] ^ result[i];
21944 }
21945 this.result = !diff;
21946 } else {
21947 this.result = false;
21948 }
21949 } else {
21950 this.result = result;
21951 }
21952 return this;
21953 }
21954 var hmac_prototype = hmac_constructor.prototype;
21955 hmac_prototype.reset = hmac_reset;
21956 hmac_prototype.process = hmac_process;
21957 hmac_prototype.finish = hmac_finish;
21958 hmac_sha256_constructor.BLOCK_SIZE = sha256_constructor.BLOCK_SIZE;
21959 hmac_sha256_constructor.HMAC_SIZE = sha256_constructor.HASH_SIZE;
21960 var hmac_sha256_prototype = hmac_sha256_constructor.prototype;
21961 hmac_sha256_prototype.reset = hmac_sha256_reset;
21962 hmac_sha256_prototype.process = hmac_process;
21963 hmac_sha256_prototype.finish = hmac_sha256_finish;
21964 hmac_sha512_constructor.BLOCK_SIZE = sha512_constructor.BLOCK_SIZE;
21965 hmac_sha512_constructor.HMAC_SIZE = sha512_constructor.HASH_SIZE;
21966 var hmac_sha512_prototype = hmac_sha512_constructor.prototype;
21967 hmac_sha512_prototype.reset = hmac_sha512_reset;
21968 hmac_sha512_prototype.process = hmac_process;
21969 hmac_sha512_prototype.finish = hmac_sha512_finish;
21970 function pbkdf2_constructor(options) {
21971 options = options || {};
21972 if (!options.hmac) throw new SyntaxError("option 'hmac' is required");
21973 if (!options.hmac.HMAC_SIZE) throw new SyntaxError("option 'hmac' supplied doesn't seem to be a valid HMAC function");
21974 this.hmac = options.hmac;
21975 this.count = options.count || 4096;
21976 this.length = options.length || this.hmac.HMAC_SIZE;
21977 this.result = null;
21978 var password = options.password;
21979 if (password || is_string(password)) this.reset(options);
21980 return this;
21981 }
21982 function pbkdf2_hmac_sha256_constructor(options) {
21983 options = options || {};
21984 if (!(options.hmac instanceof hmac_sha256_constructor)) options.hmac = new hmac_sha256_constructor(options);
21985 pbkdf2_constructor.call(this, options);
21986 return this;
21987 }
21988 function pbkdf2_hmac_sha512_constructor(options) {
21989 options = options || {};
21990 if (!(options.hmac instanceof hmac_sha512_constructor)) options.hmac = new hmac_sha512_constructor(options);
21991 pbkdf2_constructor.call(this, options);
21992 return this;
21993 }
21994 function pbkdf2_reset(options) {
21995 this.result = null;
21996 this.hmac.reset(options);
21997 return this;
21998 }
21999 function pbkdf2_generate(salt, count, length) {
22000 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22001 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22002 count = count || this.count;
22003 length = length || this.length;
22004 this.result = new Uint8Array(length);
22005 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22006 for (var i = 1; i <= blocks; ++i) {
22007 var j = (i - 1) * this.hmac.HMAC_SIZE;
22008 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22009 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);
22010 this.result.set(tmp.subarray(0, l), j);
22011 for (var k = 1; k < count; ++k) {
22012 tmp = new Uint8Array(this.hmac.reset().process(tmp).finish().result);
22013 for (var r = 0; r < l; ++r) this.result[j + r] ^= tmp[r];
22014 }
22015 }
22016 return this;
22017 }
22018 function pbkdf2_hmac_sha256_generate(salt, count, length) {
22019 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22020 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22021 count = count || this.count;
22022 length = length || this.length;
22023 this.result = new Uint8Array(length);
22024 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22025 for (var i = 1; i <= blocks; ++i) {
22026 var j = (i - 1) * this.hmac.HMAC_SIZE;
22027 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22028 this.hmac.reset().process(salt);
22029 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22030 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22031 }
22032 return this;
22033 }
22034 function pbkdf2_hmac_sha512_generate(salt, count, length) {
22035 if (this.result !== null) throw new IllegalStateError("state must be reset before processing new data");
22036 if (!salt && !is_string(salt)) throw new IllegalArgumentError("bad 'salt' value");
22037 count = count || this.count;
22038 length = length || this.length;
22039 this.result = new Uint8Array(length);
22040 var blocks = Math.ceil(length / this.hmac.HMAC_SIZE);
22041 for (var i = 1; i <= blocks; ++i) {
22042 var j = (i - 1) * this.hmac.HMAC_SIZE;
22043 var l = (i < blocks ? 0 : length % this.hmac.HMAC_SIZE) || this.hmac.HMAC_SIZE;
22044 this.hmac.reset().process(salt);
22045 this.hmac.hash.asm.pbkdf2_generate_block(this.hmac.hash.pos, this.hmac.hash.len, i, count, 0);
22046 this.result.set(this.hmac.hash.heap.subarray(0, l), j);
22047 }
22048 return this;
22049 }
22050 var pbkdf2_prototype = pbkdf2_constructor.prototype;
22051 pbkdf2_prototype.reset = pbkdf2_reset;
22052 pbkdf2_prototype.generate = pbkdf2_generate;
22053 var pbkdf2_hmac_sha256_prototype = pbkdf2_hmac_sha256_constructor.prototype;
22054 pbkdf2_hmac_sha256_prototype.reset = pbkdf2_reset;
22055 pbkdf2_hmac_sha256_prototype.generate = pbkdf2_hmac_sha256_generate;
22056 var pbkdf2_hmac_sha512_prototype = pbkdf2_hmac_sha512_constructor.prototype;
22057 pbkdf2_hmac_sha512_prototype.reset = pbkdf2_reset;
22058 pbkdf2_hmac_sha512_prototype.generate = pbkdf2_hmac_sha512_generate;
22059 global.IllegalStateError = IllegalStateError;
22060 global.IllegalArgumentError = IllegalArgumentError;
22061 global.SecurityError = SecurityError;
22062 exports.string_to_bytes = string_to_bytes;
22063 exports.hex_to_bytes = hex_to_bytes;
22064 exports.base64_to_bytes = base64_to_bytes;
22065 exports.bytes_to_string = bytes_to_string;
22066 exports.bytes_to_hex = bytes_to_hex;
22067 exports.bytes_to_base64 = bytes_to_base64;
22068 var SHA256_instance = new sha256_constructor({
22069 heapSize: 1048576
22070 });
22071 function sha256_bytes(data) {
22072 if (data === undefined) throw new SyntaxError("data required");
22073 return SHA256_instance.reset().process(data).finish().result;
22074 }
22075 function sha256_hex(data) {
22076 var result = sha256_bytes(data);
22077 return bytes_to_hex(result);
22078 }
22079 function sha256_base64(data) {
22080 var result = sha256_bytes(data);
22081 return bytes_to_base64(result);
22082 }
22083 exports.SHA256 = {
22084 bytes: sha256_bytes,
22085 hex: sha256_hex,
22086 base64: sha256_base64
22087 };
22088 var SHA512_instance = new sha512_constructor({
22089 heapSize: 1048576
22090 });
22091 function sha512_bytes(data) {
22092 if (data === undefined) throw new SyntaxError("data required");
22093 return SHA512_instance.reset().process(data).finish().result;
22094 }
22095 function sha512_hex(data) {
22096 var result = sha512_bytes(data);
22097 return bytes_to_hex(result);
22098 }
22099 function sha512_base64(data) {
22100 var result = sha512_bytes(data);
22101 return bytes_to_base64(result);
22102 }
22103 exports.SHA512 = {
22104 bytes: sha512_bytes,
22105 hex: sha512_hex,
22106 base64: sha512_base64
22107 };
22108 var hmac_sha256_instance = new hmac_sha256_constructor({
22109 hash: SHA256_instance
22110 });
22111 function hmac_sha256_bytes(data, password) {
22112 if (data === undefined) throw new SyntaxError("data required");
22113 if (password === undefined) throw new SyntaxError("password required");
22114 return hmac_sha256_instance.reset({
22115 password: password
22116 }).process(data).finish().result;
22117 }
22118 function hmac_sha256_hex(data, password) {
22119 var result = hmac_sha256_bytes(data, password);
22120 return bytes_to_hex(result);
22121 }
22122 function hmac_sha256_base64(data, password) {
22123 var result = hmac_sha256_bytes(data, password);
22124 return bytes_to_base64(result);
22125 }
22126 exports.HMAC = exports.HMAC_SHA256 = {
22127 bytes: hmac_sha256_bytes,
22128 hex: hmac_sha256_hex,
22129 base64: hmac_sha256_base64
22130 };
22131 var hmac_sha512_instance = new hmac_sha512_constructor({
22132 hash: SHA512_instance
22133 });
22134 function hmac_sha512_bytes(data, password) {
22135 if (data === undefined) throw new SyntaxError("data required");
22136 if (password === undefined) throw new SyntaxError("password required");
22137 return hmac_sha512_instance.reset({
22138 password: password
22139 }).process(data).finish().result;
22140 }
22141 function hmac_sha512_hex(data, password) {
22142 var result = hmac_sha512_bytes(data, password);
22143 return bytes_to_hex(result);
22144 }
22145 function hmac_sha512_base64(data, password) {
22146 var result = hmac_sha512_bytes(data, password);
22147 return bytes_to_base64(result);
22148 }
22149 exports.HMAC_SHA512 = {
22150 bytes: hmac_sha512_bytes,
22151 hex: hmac_sha512_hex,
22152 base64: hmac_sha512_base64
22153 };
22154 var pbkdf2_hmac_sha256_instance = new pbkdf2_hmac_sha256_constructor({
22155 hmac: hmac_sha256_instance
22156 });
22157 function pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen) {
22158 if (password === undefined) throw new SyntaxError("password required");
22159 if (salt === undefined) throw new SyntaxError("salt required");
22160 return pbkdf2_hmac_sha256_instance.reset({
22161 password: password
22162 }).generate(salt, iterations, dklen).result;
22163 }
22164 function pbkdf2_hmac_sha256_hex(password, salt, iterations, dklen) {
22165 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22166 return bytes_to_hex(result);
22167 }
22168 function pbkdf2_hmac_sha256_base64(password, salt, iterations, dklen) {
22169 var result = pbkdf2_hmac_sha256_bytes(password, salt, iterations, dklen);
22170 return bytes_to_base64(result);
22171 }
22172 exports.PBKDF2 = exports.PBKDF2_HMAC_SHA256 = {
22173 bytes: pbkdf2_hmac_sha256_bytes,
22174 hex: pbkdf2_hmac_sha256_hex,
22175 base64: pbkdf2_hmac_sha256_base64
22176 };
22177 var pbkdf2_hmac_sha512_instance = new pbkdf2_hmac_sha512_constructor({
22178 hmac: hmac_sha512_instance
22179 });
22180 function pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen) {
22181 if (password === undefined) throw new SyntaxError("password required");
22182 if (salt === undefined) throw new SyntaxError("salt required");
22183 return pbkdf2_hmac_sha512_instance.reset({
22184 password: password
22185 }).generate(salt, iterations, dklen).result;
22186 }
22187 function pbkdf2_hmac_sha512_hex(password, salt, iterations, dklen) {
22188 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22189 return bytes_to_hex(result);
22190 }
22191 function pbkdf2_hmac_sha512_base64(password, salt, iterations, dklen) {
22192 var result = pbkdf2_hmac_sha512_bytes(password, salt, iterations, dklen);
22193 return bytes_to_base64(result);
22194 }
22195 exports.PBKDF2_HMAC_SHA512 = {
22196 bytes: pbkdf2_hmac_sha512_bytes,
22197 hex: pbkdf2_hmac_sha512_hex,
22198 base64: pbkdf2_hmac_sha512_base64
22199 };
22200 var cbc_aes_instance = new cbc_aes_constructor({
22201 heapSize: 1048576
22202 });
22203 function cbc_aes_encrypt_bytes(data, key, padding, iv) {
22204 if (data === undefined) throw new SyntaxError("data required");
22205 if (key === undefined) throw new SyntaxError("key required");
22206 return cbc_aes_instance.reset({
22207 key: key,
22208 padding: padding,
22209 iv: iv
22210 }).encrypt(data).result;
22211 }
22212 function cbc_aes_decrypt_bytes(data, key, padding, iv) {
22213 if (data === undefined) throw new SyntaxError("data required");
22214 if (key === undefined) throw new SyntaxError("key required");
22215 return cbc_aes_instance.reset({
22216 key: key,
22217 padding: padding,
22218 iv: iv
22219 }).decrypt(data).result;
22220 }
22221 exports.AES = exports.AES_CBC = {
22222 encrypt: cbc_aes_encrypt_bytes,
22223 decrypt: cbc_aes_decrypt_bytes
22224 };
22225 var ccm_aes_instance = new ccm_aes_constructor({
22226 heap: cbc_aes_instance.heap,
22227 asm: cbc_aes_instance.asm
22228 });
22229 function ccm_aes_encrypt_bytes(data, key, nonce, adata, tagSize) {
22230 if (data === undefined) throw new SyntaxError("data required");
22231 if (key === undefined) throw new SyntaxError("key required");
22232 if (nonce === undefined) throw new SyntaxError("nonce required");
22233 var dataLength = data.byteLength || data.length || 0;
22234 return ccm_aes_instance.reset({
22235 key: key,
22236 nonce: nonce,
22237 adata: adata,
22238 tagSize: tagSize,
22239 dataLength: dataLength
22240 }).encrypt(data).result;
22241 }
22242 function ccm_aes_decrypt_bytes(data, key, nonce, adata, tagSize) {
22243 if (data === undefined) throw new SyntaxError("data required");
22244 if (key === undefined) throw new SyntaxError("key required");
22245 if (nonce === undefined) throw new SyntaxError("nonce required");
22246 var dataLength = data.byteLength || data.length || 0;
22247 tagSize = tagSize || _aes_block_size;
22248 return ccm_aes_instance.reset({
22249 key: key,
22250 nonce: nonce,
22251 adata: adata,
22252 tagSize: tagSize,
22253 dataLength: dataLength - tagSize
22254 }).decrypt(data).result;
22255 }
22256 exports.AES_CCM = {
22257 encrypt: ccm_aes_encrypt_bytes,
22258 decrypt: ccm_aes_decrypt_bytes
22259 };
22260 var cfb_aes_instance = new cfb_aes_constructor({
22261 heap: cbc_aes_instance.heap,
22262 asm: cbc_aes_instance.asm
22263 });
22264 function cfb_aes_encrypt_bytes(data, key, padding, iv) {
22265 if (data === undefined) throw new SyntaxError("data required");
22266 if (key === undefined) throw new SyntaxError("key required");
22267 return cfb_aes_instance.reset({
22268 key: key,
22269 padding: padding,
22270 iv: iv
22271 }).encrypt(data).result;
22272 }
22273 function cfb_aes_decrypt_bytes(data, key, padding, iv) {
22274 if (data === undefined) throw new SyntaxError("data required");
22275 if (key === undefined) throw new SyntaxError("key required");
22276 return cfb_aes_instance.reset({
22277 key: key,
22278 padding: padding,
22279 iv: iv
22280 }).decrypt(data).result;
22281 }
22282 exports.AES_CFB = {
22283 encrypt: cfb_aes_encrypt_bytes,
22284 decrypt: cfb_aes_decrypt_bytes
22285 };
22286 var cfb_aes_decrypt_instance = new cfb_aes_decrypt_constructor({
22287 heap: cbc_aes_instance.heap,
22288 asm: cbc_aes_instance.asm
22289 });
22290 function cfb_aes_decrypt_init(key, padding, iv) {
22291 if (key === undefined) throw new SyntaxError("key required");
22292 return cfb_aes_decrypt_instance.reset({
22293 key: key,
22294 padding: padding,
22295 iv: iv
22296 });
22297 }
22298 exports.AES_CFB = exports.AES_CFB || {};
22299 exports.AES_CFB.decryptor = {
22300 init: cfb_aes_decrypt_init
22301 };
22302})({}, function() {
22303 return this;
22304}());
22305</script>
22306
22307 <!--<script src="/js/jsbip39.js"></script>-->
22308<script>
22309/*
22310 * Copyright (c) 2013 Pavol Rusnak
22311 *
22312 * Permission is hereby granted, free of charge, to any person obtaining a copy of
22313 * this software and associated documentation files (the "Software"), to deal in
22314 * the Software without restriction, including without limitation the rights to
22315 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
22316 * of the Software, and to permit persons to whom the Software is furnished to do
22317 * so, subject to the following conditions:
22318 *
22319 * The above copyright notice and this permission notice shall be included in all
22320 * copies or substantial portions of the Software.
22321 *
22322 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22323 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22324 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22325 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22326 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22327 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22328 */
22329
22330/*
22331 * Javascript port from python by Ian Coleman
22332 *
22333 * Includes code from asmCrypto
22334 * https://github.com/tresorit/asmcrypto.js
22335 */
22336
22337var Mnemonic = function(language) {
22338
22339 var PBKDF2_ROUNDS = 2048;
22340 var RADIX = 2048;
22341
22342 var self = this;
22343 var wordlist = [];
22344
22345 function init() {
22346 wordlist = WORDLISTS[language];
22347 if (wordlist.length != RADIX) {
22348 err = 'Wordlist should contain ' + RADIX + ' words, but it contains ' + wordlist.length + ' words.';
22349 throw err;
22350 }
22351 }
22352
22353 self.generate = function(strength) {
22354 strength = strength || 128;
22355 var r = strength % 32;
22356 if (r > 0) {
22357 throw 'Strength should be divisible by 32, but it is not (' + r + ').';
22358 }
22359 var hasStrongCrypto = 'crypto' in window && window['crypto'] !== null;
22360 if (!hasStrongCrypto) {
22361 throw 'Mnemonic should be generated with strong randomness, but crypto.getRandomValues is unavailable';
22362 }
22363 var buffer = new Uint8Array(strength / 8);
22364 var data = crypto.getRandomValues(buffer);
22365 return self.toMnemonic(data);
22366 }
22367
22368 self.toMnemonic = function(data) {
22369 if (data.length % 4 > 0) {
22370 throw 'Data length in bits should be divisible by 32, but it is not (' + data.length + ' bytes = ' + data.length*8 + ' bits).'
22371 }
22372
22373 //h = hashlib.sha256(data).hexdigest()
22374 var uintArray = new Uint8Array(data);
22375 var h = asmCrypto.SHA256.bytes(uintArray);
22376
22377 // b is a binary string, eg '00111010101100...'
22378 //b = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8) + \
22379 // bin(int(h, 16))[2:].zfill(256)[:len(data) * 8 / 32]
22380 //
22381 // a = bin(int(binascii.hexlify(data), 16))[2:].zfill(len(data) * 8)
22382 // c = bin(int(h, 16))[2:].zfill(256)
22383 // d = c[:len(data) * 8 / 32]
22384 var a = byteArrayToBinaryString(data);
22385 var c = byteArrayToBinaryString(h);
22386 var d = c.substring(0, data.length * 8 / 32);
22387 // b = line1 + line2
22388 var b = a + d;
22389
22390 var result = [];
22391 var blen = b.length / 11;
22392 for (var i=0; i<blen; i++) {
22393 var idx = parseInt(b.substring(i * 11, (i + 1) * 11), 2);
22394 result.push(wordlist[idx]);
22395 }
22396 return result.join(' ');
22397 }
22398
22399 self.check = function(mnemonic) {
22400 var mnemonic = mnemonic.split(' ')
22401 if (mnemonic.length % 3 > 0) {
22402 return false
22403 }
22404 // idx = map(lambda x: bin(self.wordlist.index(x))[2:].zfill(11), mnemonic)
22405 var idx = [];
22406 for (var i=0; i<mnemonic.length; i++) {
22407 var word = mnemonic[i];
22408 var wordIndex = wordlist.indexOf(word);
22409 if (wordIndex == -1) {
22410 return false;
22411 }
22412 var binaryIndex = zfill(wordIndex.toString(2), 11);
22413 idx.push(binaryIndex);
22414 }
22415 var b = idx.join('');
22416 var l = b.length;
22417 //d = b[:l / 33 * 32]
22418 //h = b[-l / 33:]
22419 var d = b.substring(0, l / 33 * 32);
22420 var h = b.substring(l - l / 33, l);
22421 //nd = binascii.unhexlify(hex(int(d, 2))[2:].rstrip('L').zfill(l / 33 * 8))
22422 //nh = bin(int(hashlib.sha256(nd).hexdigest(), 16))[2:].zfill(256)[:l / 33]
22423 var nd = binaryStringToByteArray(d);
22424 var ndHash = asmCrypto.SHA256.bytes(nd);
22425 var ndBstr = zfill(byteArrayToBinaryString(ndHash), 256);
22426 var nh = ndBstr.substring(0,l/33);
22427 return h == nh;
22428 }
22429
22430 self.toSeed = function(mnemonic, passphrase) {
22431 passphrase = passphrase || '';
22432 mnemonic = normalizeString(mnemonic)
22433 passphrase = normalizeString(passphrase)
22434 passphrase = "mnemonic" + passphrase;
22435 //return PBKDF2(mnemonic, 'mnemonic' + passphrase, iterations=PBKDF2_ROUNDS, macmodule=hmac, digestmodule=hashlib.sha512).read(64)
22436 return asmCrypto.PBKDF2_HMAC_SHA512.hex(mnemonic, passphrase, PBKDF2_ROUNDS, 512/8);
22437 }
22438
22439 function normalizeString(str) {
22440 if (typeof str.normalize == "function") {
22441 return str.normalize("NFKD");
22442 }
22443 else {
22444 // TODO find a library to do this
22445 // Not supported on firefox mobile
22446 console.warn("NFKD Normalization is unavailable");
22447 return str;
22448 }
22449 }
22450
22451 function byteArrayToBinaryString(data) {
22452 var bin = "";
22453 for (var i=0; i<data.length; i++) {
22454 bin += zfill(data[i].toString(2), 8);
22455 }
22456 return bin;
22457 }
22458
22459 function binaryStringToByteArray(str) {
22460 var arrayLen = str.length / 8;
22461 var array = new Uint8Array(arrayLen);
22462 for (var i=0; i<arrayLen; i++) {
22463 var valueStr = str.substring(0,8);
22464 var value = parseInt(valueStr, 2);
22465 array[i] = value;
22466 str = str.slice(8);
22467 }
22468 return array;
22469 }
22470
22471 // Pad a numeric string on the left with zero digits until the given width
22472 // is reached.
22473 // Note this differs to the python implementation because it does not
22474 // handle numbers starting with a sign.
22475 function zfill(source, length) {
22476 source = source.toString();
22477 while (source.length < length) {
22478 source = '0' + source;
22479 }
22480 return source;
22481 }
22482
22483 init();
22484
22485}
22486
22487WORDLISTS = {
22488"english": [
22489"abandon","ability","able","about","above","absent","absorb","abstract","absurd","abuse",
22490"access","accident","account","accuse","achieve","acid","acoustic","acquire","across","act",
22491"action","actor","actress","actual","adapt","add","addict","address","adjust","admit",
22492"adult","advance","advice","aerobic","affair","afford","afraid","again","age","agent",
22493"agree","ahead","aim","air","airport","aisle","alarm","album","alcohol","alert",
22494"alien","all","alley","allow","almost","alone","alpha","already","also","alter",
22495"always","amateur","amazing","among","amount","amused","analyst","anchor","ancient","anger",
22496"angle","angry","animal","ankle","announce","annual","another","answer","antenna","antique",
22497"anxiety","any","apart","apology","appear","apple","approve","april","arch","arctic",
22498"area","arena","argue","arm","armed","armor","army","around","arrange","arrest",
22499"arrive","arrow","art","artefact","artist","artwork","ask","aspect","assault","asset",
22500"assist","assume","asthma","athlete","atom","attack","attend","attitude","attract","auction",
22501"audit","august","aunt","author","auto","autumn","average","avocado","avoid","awake",
22502"aware","away","awesome","awful","awkward","axis","baby","bachelor","bacon","badge",
22503"bag","balance","balcony","ball","bamboo","banana","banner","bar","barely","bargain",
22504"barrel","base","basic","basket","battle","beach","bean","beauty","because","become",
22505"beef","before","begin","behave","behind","believe","below","belt","bench","benefit",
22506"best","betray","better","between","beyond","bicycle","bid","bike","bind","biology",
22507"bird","birth","bitter","black","blade","blame","blanket","blast","bleak","bless",
22508"blind","blood","blossom","blouse","blue","blur","blush","board","boat","body",
22509"boil","bomb","bone","bonus","book","boost","border","boring","borrow","boss",
22510"bottom","bounce","box","boy","bracket","brain","brand","brass","brave","bread",
22511"breeze","brick","bridge","brief","bright","bring","brisk","broccoli","broken","bronze",
22512"broom","brother","brown","brush","bubble","buddy","budget","buffalo","build","bulb",
22513"bulk","bullet","bundle","bunker","burden","burger","burst","bus","business","busy",
22514"butter","buyer","buzz","cabbage","cabin","cable","cactus","cage","cake","call",
22515"calm","camera","camp","can","canal","cancel","candy","cannon","canoe","canvas",
22516"canyon","capable","capital","captain","car","carbon","card","cargo","carpet","carry",
22517"cart","case","cash","casino","castle","casual","cat","catalog","catch","category",
22518"cattle","caught","cause","caution","cave","ceiling","celery","cement","census","century",
22519"cereal","certain","chair","chalk","champion","change","chaos","chapter","charge","chase",
22520"chat","cheap","check","cheese","chef","cherry","chest","chicken","chief","child",
22521"chimney","choice","choose","chronic","chuckle","chunk","churn","cigar","cinnamon","circle",
22522"citizen","city","civil","claim","clap","clarify","claw","clay","clean","clerk",
22523"clever","click","client","cliff","climb","clinic","clip","clock","clog","close",
22524"cloth","cloud","clown","club","clump","cluster","clutch","coach","coast","coconut",
22525"code","coffee","coil","coin","collect","color","column","combine","come","comfort",
22526"comic","common","company","concert","conduct","confirm","congress","connect","consider","control",
22527"convince","cook","cool","copper","copy","coral","core","corn","correct","cost",
22528"cotton","couch","country","couple","course","cousin","cover","coyote","crack","cradle",
22529"craft","cram","crane","crash","crater","crawl","crazy","cream","credit","creek",
22530"crew","cricket","crime","crisp","critic","crop","cross","crouch","crowd","crucial",
22531"cruel","cruise","crumble","crunch","crush","cry","crystal","cube","culture","cup",
22532"cupboard","curious","current","curtain","curve","cushion","custom","cute","cycle","dad",
22533"damage","damp","dance","danger","daring","dash","daughter","dawn","day","deal",
22534"debate","debris","decade","december","decide","decline","decorate","decrease","deer","defense",
22535"define","defy","degree","delay","deliver","demand","demise","denial","dentist","deny",
22536"depart","depend","deposit","depth","deputy","derive","describe","desert","design","desk",
22537"despair","destroy","detail","detect","develop","device","devote","diagram","dial","diamond",
22538"diary","dice","diesel","diet","differ","digital","dignity","dilemma","dinner","dinosaur",
22539"direct","dirt","disagree","discover","disease","dish","dismiss","disorder","display","distance",
22540"divert","divide","divorce","dizzy","doctor","document","dog","doll","dolphin","domain",
22541"donate","donkey","donor","door","dose","double","dove","draft","dragon","drama",
22542"drastic","draw","dream","dress","drift","drill","drink","drip","drive","drop",
22543"drum","dry","duck","dumb","dune","during","dust","dutch","duty","dwarf",
22544"dynamic","eager","eagle","early","earn","earth","easily","east","easy","echo",
22545"ecology","economy","edge","edit","educate","effort","egg","eight","either","elbow",
22546"elder","electric","elegant","element","elephant","elevator","elite","else","embark","embody",
22547"embrace","emerge","emotion","employ","empower","empty","enable","enact","end","endless",
22548"endorse","enemy","energy","enforce","engage","engine","enhance","enjoy","enlist","enough",
22549"enrich","enroll","ensure","enter","entire","entry","envelope","episode","equal","equip",
22550"era","erase","erode","erosion","error","erupt","escape","essay","essence","estate",
22551"eternal","ethics","evidence","evil","evoke","evolve","exact","example","excess","exchange",
22552"excite","exclude","excuse","execute","exercise","exhaust","exhibit","exile","exist","exit",
22553"exotic","expand","expect","expire","explain","expose","express","extend","extra","eye",
22554"eyebrow","fabric","face","faculty","fade","faint","faith","fall","false","fame",
22555"family","famous","fan","fancy","fantasy","farm","fashion","fat","fatal","father",
22556"fatigue","fault","favorite","feature","february","federal","fee","feed","feel","female",
22557"fence","festival","fetch","fever","few","fiber","fiction","field","figure","file",
22558"film","filter","final","find","fine","finger","finish","fire","firm","first",
22559"fiscal","fish","fit","fitness","fix","flag","flame","flash","flat","flavor",
22560"flee","flight","flip","float","flock","floor","flower","fluid","flush","fly",
22561"foam","focus","fog","foil","fold","follow","food","foot","force","forest",
22562"forget","fork","fortune","forum","forward","fossil","foster","found","fox","fragile",
22563"frame","frequent","fresh","friend","fringe","frog","front","frost","frown","frozen",
22564"fruit","fuel","fun","funny","furnace","fury","future","gadget","gain","galaxy",
22565"gallery","game","gap","garage","garbage","garden","garlic","garment","gas","gasp",
22566"gate","gather","gauge","gaze","general","genius","genre","gentle","genuine","gesture",
22567"ghost","giant","gift","giggle","ginger","giraffe","girl","give","glad","glance",
22568"glare","glass","glide","glimpse","globe","gloom","glory","glove","glow","glue",
22569"goat","goddess","gold","good","goose","gorilla","gospel","gossip","govern","gown",
22570"grab","grace","grain","grant","grape","grass","gravity","great","green","grid",
22571"grief","grit","grocery","group","grow","grunt","guard","guess","guide","guilt",
22572"guitar","gun","gym","habit","hair","half","hammer","hamster","hand","happy",
22573"harbor","hard","harsh","harvest","hat","have","hawk","hazard","head","health",
22574"heart","heavy","hedgehog","height","hello","helmet","help","hen","hero","hidden",
22575"high","hill","hint","hip","hire","history","hobby","hockey","hold","hole",
22576"holiday","hollow","home","honey","hood","hope","horn","horror","horse","hospital",
22577"host","hotel","hour","hover","hub","huge","human","humble","humor","hundred",
22578"hungry","hunt","hurdle","hurry","hurt","husband","hybrid","ice","icon","idea",
22579"identify","idle","ignore","ill","illegal","illness","image","imitate","immense","immune",
22580"impact","impose","improve","impulse","inch","include","income","increase","index","indicate",
22581"indoor","industry","infant","inflict","inform","inhale","inherit","initial","inject","injury",
22582"inmate","inner","innocent","input","inquiry","insane","insect","inside","inspire","install",
22583"intact","interest","into","invest","invite","involve","iron","island","isolate","issue",
22584"item","ivory","jacket","jaguar","jar","jazz","jealous","jeans","jelly","jewel",
22585"job","join","joke","journey","joy","judge","juice","jump","jungle","junior",
22586"junk","just","kangaroo","keen","keep","ketchup","key","kick","kid","kidney",
22587"kind","kingdom","kiss","kit","kitchen","kite","kitten","kiwi","knee","knife",
22588"knock","know","lab","label","labor","ladder","lady","lake","lamp","language",
22589"laptop","large","later","latin","laugh","laundry","lava","law","lawn","lawsuit",
22590"layer","lazy","leader","leaf","learn","leave","lecture","left","leg","legal",
22591"legend","leisure","lemon","lend","length","lens","leopard","lesson","letter","level",
22592"liar","liberty","library","license","life","lift","light","like","limb","limit",
22593"link","lion","liquid","list","little","live","lizard","load","loan","lobster",
22594"local","lock","logic","lonely","long","loop","lottery","loud","lounge","love",
22595"loyal","lucky","luggage","lumber","lunar","lunch","luxury","lyrics","machine","mad",
22596"magic","magnet","maid","mail","main","major","make","mammal","man","manage",
22597"mandate","mango","mansion","manual","maple","marble","march","margin","marine","market",
22598"marriage","mask","mass","master","match","material","math","matrix","matter","maximum",
22599"maze","meadow","mean","measure","meat","mechanic","medal","media","melody","melt",
22600"member","memory","mention","menu","mercy","merge","merit","merry","mesh","message",
22601"metal","method","middle","midnight","milk","million","mimic","mind","minimum","minor",
22602"minute","miracle","mirror","misery","miss","mistake","mix","mixed","mixture","mobile",
22603"model","modify","mom","moment","monitor","monkey","monster","month","moon","moral",
22604"more","morning","mosquito","mother","motion","motor","mountain","mouse","move","movie",
22605"much","muffin","mule","multiply","muscle","museum","mushroom","music","must","mutual",
22606"myself","mystery","myth","naive","name","napkin","narrow","nasty","nation","nature",
22607"near","neck","need","negative","neglect","neither","nephew","nerve","nest","net",
22608"network","neutral","never","news","next","nice","night","noble","noise","nominee",
22609"noodle","normal","north","nose","notable","note","nothing","notice","novel","now",
22610"nuclear","number","nurse","nut","oak","obey","object","oblige","obscure","observe",
22611"obtain","obvious","occur","ocean","october","odor","off","offer","office","often",
22612"oil","okay","old","olive","olympic","omit","once","one","onion","online",
22613"only","open","opera","opinion","oppose","option","orange","orbit","orchard","order",
22614"ordinary","organ","orient","original","orphan","ostrich","other","outdoor","outer","output",
22615"outside","oval","oven","over","own","owner","oxygen","oyster","ozone","pact",
22616"paddle","page","pair","palace","palm","panda","panel","panic","panther","paper",
22617"parade","parent","park","parrot","party","pass","patch","path","patient","patrol",
22618"pattern","pause","pave","payment","peace","peanut","pear","peasant","pelican","pen",
22619"penalty","pencil","people","pepper","perfect","permit","person","pet","phone","photo",
22620"phrase","physical","piano","picnic","picture","piece","pig","pigeon","pill","pilot",
22621"pink","pioneer","pipe","pistol","pitch","pizza","place","planet","plastic","plate",
22622"play","please","pledge","pluck","plug","plunge","poem","poet","point","polar",
22623"pole","police","pond","pony","pool","popular","portion","position","possible","post",
22624"potato","pottery","poverty","powder","power","practice","praise","predict","prefer","prepare",
22625"present","pretty","prevent","price","pride","primary","print","priority","prison","private",
22626"prize","problem","process","produce","profit","program","project","promote","proof","property",
22627"prosper","protect","proud","provide","public","pudding","pull","pulp","pulse","pumpkin",
22628"punch","pupil","puppy","purchase","purity","purpose","purse","push","put","puzzle",
22629"pyramid","quality","quantum","quarter","question","quick","quit","quiz","quote","rabbit",
22630"raccoon","race","rack","radar","radio","rail","rain","raise","rally","ramp",
22631"ranch","random","range","rapid","rare","rate","rather","raven","raw","razor",
22632"ready","real","reason","rebel","rebuild","recall","receive","recipe","record","recycle",
22633"reduce","reflect","reform","refuse","region","regret","regular","reject","relax","release",
22634"relief","rely","remain","remember","remind","remove","render","renew","rent","reopen",
22635"repair","repeat","replace","report","require","rescue","resemble","resist","resource","response",
22636"result","retire","retreat","return","reunion","reveal","review","reward","rhythm","rib",
22637"ribbon","rice","rich","ride","ridge","rifle","right","rigid","ring","riot",
22638"ripple","risk","ritual","rival","river","road","roast","robot","robust","rocket",
22639"romance","roof","rookie","room","rose","rotate","rough","round","route","royal",
22640"rubber","rude","rug","rule","run","runway","rural","sad","saddle","sadness",
22641"safe","sail","salad","salmon","salon","salt","salute","same","sample","sand",
22642"satisfy","satoshi","sauce","sausage","save","say","scale","scan","scare","scatter",
22643"scene","scheme","school","science","scissors","scorpion","scout","scrap","screen","script",
22644"scrub","sea","search","season","seat","second","secret","section","security","seed",
22645"seek","segment","select","sell","seminar","senior","sense","sentence","series","service",
22646"session","settle","setup","seven","shadow","shaft","shallow","share","shed","shell",
22647"sheriff","shield","shift","shine","ship","shiver","shock","shoe","shoot","shop",
22648"short","shoulder","shove","shrimp","shrug","shuffle","shy","sibling","sick","side",
22649"siege","sight","sign","silent","silk","silly","silver","similar","simple","since",
22650"sing","siren","sister","situate","six","size","skate","sketch","ski","skill",
22651"skin","skirt","skull","slab","slam","sleep","slender","slice","slide","slight",
22652"slim","slogan","slot","slow","slush","small","smart","smile","smoke","smooth",
22653"snack","snake","snap","sniff","snow","soap","soccer","social","sock","soda",
22654"soft","solar","soldier","solid","solution","solve","someone","song","soon","sorry",
22655"sort","soul","sound","soup","source","south","space","spare","spatial","spawn",
22656"speak","special","speed","spell","spend","sphere","spice","spider","spike","spin",
22657"spirit","split","spoil","sponsor","spoon","sport","spot","spray","spread","spring",
22658"spy","square","squeeze","squirrel","stable","stadium","staff","stage","stairs","stamp",
22659"stand","start","state","stay","steak","steel","stem","step","stereo","stick",
22660"still","sting","stock","stomach","stone","stool","story","stove","strategy","street",
22661"strike","strong","struggle","student","stuff","stumble","style","subject","submit","subway",
22662"success","such","sudden","suffer","sugar","suggest","suit","summer","sun","sunny",
22663"sunset","super","supply","supreme","sure","surface","surge","surprise","surround","survey",
22664"suspect","sustain","swallow","swamp","swap","swarm","swear","sweet","swift","swim",
22665"swing","switch","sword","symbol","symptom","syrup","system","table","tackle","tag",
22666"tail","talent","talk","tank","tape","target","task","taste","tattoo","taxi",
22667"teach","team","tell","ten","tenant","tennis","tent","term","test","text",
22668"thank","that","theme","then","theory","there","they","thing","this","thought",
22669"three","thrive","throw","thumb","thunder","ticket","tide","tiger","tilt","timber",
22670"time","tiny","tip","tired","tissue","title","toast","tobacco","today","toddler",
22671"toe","together","toilet","token","tomato","tomorrow","tone","tongue","tonight","tool",
22672"tooth","top","topic","topple","torch","tornado","tortoise","toss","total","tourist",
22673"toward","tower","town","toy","track","trade","traffic","tragic","train","transfer",
22674"trap","trash","travel","tray","treat","tree","trend","trial","tribe","trick",
22675"trigger","trim","trip","trophy","trouble","truck","true","truly","trumpet","trust",
22676"truth","try","tube","tuition","tumble","tuna","tunnel","turkey","turn","turtle",
22677"twelve","twenty","twice","twin","twist","two","type","typical","ugly","umbrella",
22678"unable","unaware","uncle","uncover","under","undo","unfair","unfold","unhappy","uniform",
22679"unique","unit","universe","unknown","unlock","until","unusual","unveil","update","upgrade",
22680"uphold","upon","upper","upset","urban","urge","usage","use","used","useful",
22681"useless","usual","utility","vacant","vacuum","vague","valid","valley","valve","van",
22682"vanish","vapor","various","vast","vault","vehicle","velvet","vendor","venture","venue",
22683"verb","verify","version","very","vessel","veteran","viable","vibrant","vicious","victory",
22684"video","view","village","vintage","violin","virtual","virus","visa","visit","visual",
22685"vital","vivid","vocal","voice","void","volcano","volume","vote","voyage","wage",
22686"wagon","wait","walk","wall","walnut","want","warfare","warm","warrior","wash",
22687"wasp","waste","water","wave","way","wealth","weapon","wear","weasel","weather",
22688"web","wedding","weekend","weird","welcome","west","wet","whale","what","wheat",
22689"wheel","when","where","whip","whisper","wide","width","wife","wild","will",
22690"win","window","wine","wing","wink","winner","winter","wire","wisdom","wise",
22691"wish","witness","wolf","woman","wonder","wood","wool","word","work","world",
22692"worry","worth","wrap","wreck","wrestle","wrist","write","wrong","yard","year",
22693"yellow","you","young","youth","zebra","zero","zone","zoo"]
22694};
22695</script>
22696
22697 <!--<script src="/js/index.js"></script>-->
22698<script>
22699(function() {
22700
22701 var mnemonic = new Mnemonic("english");
22702 var bip32RootKey = null;
22703 var bip32ExtendedKey = null;
22704 var network = Bitcoin.networks.bitcoin;
22705 var addressRowTemplate = $("#address-row-template");
22706
22707 var phraseChangeTimeoutEvent = null;
22708
22709 var DOM = {};
22710 DOM.phrase = $(".phrase");
721b7284 22711 DOM.passphrase = $(".passphrase");
ebd8d4e8
IC
22712 DOM.generate = $(".generate");
22713 DOM.rootKey = $(".root-key");
22714 DOM.extendedPrivKey = $(".extended-priv-key");
22715 DOM.extendedPubKey = $(".extended-pub-key");
22716 DOM.bip32path = $("#bip32-path");
22717 DOM.bip44path = $("#bip44-path");
22718 DOM.bip44purpose = $("#bip44 .purpose");
22719 DOM.bip44coin = $("#bip44 .coin");
22720 DOM.bip44account = $("#bip44 .account");
22721 DOM.bip44change = $("#bip44 .change");
22722 DOM.strength = $(".strength");
22723 DOM.addresses = $(".addresses");
22724 DOM.rowsToAdd = $(".rows-to-add");
22725 DOM.more = $(".more");
22726 DOM.feedback = $(".feedback");
22727 DOM.tab = $(".derivation-type a");
22728 DOM.indexToggle = $(".index-toggle");
22729 DOM.addressToggle = $(".address-toggle");
22730 DOM.privateKeyToggle = $(".private-key-toggle");
22731
22732 var derivationPath = DOM.bip44path.val();
22733
22734 function init() {
22735 // Events
22736 DOM.phrase.on("keyup", delayedPhraseChanged);
721b7284 22737 DOM.passphrase.on("keyup", delayedPhraseChanged);
ebd8d4e8
IC
22738 DOM.generate.on("click", generateClicked);
22739 DOM.more.on("click", showMore);
22740 DOM.bip32path.on("keyup", bip32Changed);
22741 DOM.bip44purpose.on("keyup", bip44Changed);
22742 DOM.bip44coin.on("keyup", bip44Changed);
22743 DOM.bip44account.on("keyup", bip44Changed);
22744 DOM.bip44change.on("keyup", bip44Changed);
22745 DOM.tab.on("click", tabClicked);
22746 DOM.indexToggle.on("click", toggleIndexes);
22747 DOM.addressToggle.on("click", toggleAddresses);
22748 DOM.privateKeyToggle.on("click", togglePrivateKeys);
22749 disableForms();
22750 hidePending();
22751 hideValidationError();
22752 }
22753
22754 // Event handlers
22755
22756 function delayedPhraseChanged() {
22757 hideValidationError();
22758 showPending();
22759 if (phraseChangeTimeoutEvent != null) {
22760 clearTimeout(phraseChangeTimeoutEvent);
22761 }
22762 phraseChangeTimeoutEvent = setTimeout(phraseChanged, 400);
22763 }
22764
22765 function phraseChanged() {
22766 showPending();
22767 hideValidationError();
22768 // Get the mnemonic phrase
22769 var phrase = DOM.phrase.val();
721b7284 22770 var passphrase = DOM.passphrase.val();
ebd8d4e8
IC
22771 var errorText = findPhraseErrors(phrase);
22772 if (errorText) {
22773 showValidationError(errorText);
22774 return;
22775 }
22776 // Get the derivation path
22777 var errorText = findDerivationPathErrors();
22778 if (errorText) {
22779 showValidationError(errorText);
22780 return;
22781 }
22782 // Calculate and display
721b7284 22783 calcBip32Seed(phrase, passphrase, derivationPath);
ebd8d4e8
IC
22784 displayBip32Info();
22785 hidePending();
22786 }
22787
22788 function generateClicked() {
22789 clearDisplay();
22790 showPending();
22791 setTimeout(function() {
22792 var phrase = generateRandomPhrase();
22793 if (!phrase) {
22794 return;
22795 }
22796 phraseChanged();
22797 }, 50);
22798 }
22799
22800 function tabClicked(e) {
22801 var activePath = $(e.target.getAttribute("href") + " .path");
22802 derivationPath = activePath.val();
22803 derivationChanged();
22804 }
22805
22806 function derivationChanged() {
22807 delayedPhraseChanged();
22808 }
22809
22810 function bip32Changed() {
22811 derivationPath = DOM.bip32path.val();
22812 derivationChanged();
22813 }
22814
22815 function bip44Changed() {
22816 setBip44DerivationPath();
22817 derivationPath = DOM.bip44path.val();
22818 derivationChanged();
22819 }
22820
22821 function toggleIndexes() {
22822 $("td.index span").toggleClass("invisible");
22823 }
22824
22825 function toggleAddresses() {
22826 $("td.address span").toggleClass("invisible");
22827 }
22828
22829 function togglePrivateKeys() {
22830 $("td.privkey span").toggleClass("invisible");
22831 }
22832
22833 // Private methods
22834
22835 function generateRandomPhrase() {
22836 if (!hasStrongRandom()) {
22837 var errorText = "This browser does not support strong randomness";
22838 showValidationError(errorText);
22839 return;
22840 }
22841 var numWords = parseInt(DOM.strength.val());
22842 // Check strength is an integer
22843 if (isNaN(numWords)) {
22844 DOM.strength.val("12");
22845 numWords = 12;
22846 }
22847 // Check strength is a multiple of 32, if not round it down
22848 if (numWords % 3 != 0) {
22849 numWords = Math.floor(numWords / 3) * 3;
22850 DOM.strength.val(numWords);
22851 }
22852 // Check strength is at least 32
22853 if (numWords == 0) {
22854 numWords = 3;
22855 DOM.strength.val(numWords);
22856 }
22857 var strength = numWords / 3 * 32;
22858 var words = mnemonic.generate(strength);
22859 DOM.phrase.val(words);
22860 return words;
22861 }
22862
721b7284
IC
22863 function calcBip32Seed(phrase, passphrase, path) {
22864 var seed = mnemonic.toSeed(phrase, passphrase);
ebd8d4e8
IC
22865 var seedHash = Bitcoin.crypto.sha256(seed).toString("hex");
22866 bip32RootKey = Bitcoin.HDNode.fromSeedHex(seedHash, network);
22867 bip32ExtendedKey = bip32RootKey;
22868 // Derive the key from the path
22869 var pathBits = path.split("/");
22870 for (var i=0; i<pathBits.length; i++) {
22871 var bit = pathBits[i];
22872 var index = parseInt(bit);
22873 if (isNaN(index)) {
22874 continue;
22875 }
22876 var hardened = bit[bit.length-1] == "'";
22877 if (hardened) {
22878 bip32ExtendedKey = bip32ExtendedKey.deriveHardened(index);
22879 }
22880 else {
22881 bip32ExtendedKey = bip32ExtendedKey.derive(index);
22882 }
22883 }
22884 }
22885
22886 function showValidationError(errorText) {
22887 DOM.feedback
22888 .text(errorText)
22889 .show();
22890 }
22891
22892 function hideValidationError() {
22893 DOM.feedback
22894 .text("")
22895 .hide();
22896 }
22897
22898 function findPhraseErrors(phrase) {
22899 // TODO make this right
22900 // Preprocess the words
22901 var parts = phrase.split(" ");
22902 var proper = [];
22903 for (var i=0; i<parts.length; i++) {
22904 var part = parts[i];
22905 if (part.length > 0) {
22906 // TODO check that lowercasing is always valid to do
22907 proper.push(part.toLowerCase());
22908 }
22909 }
22910 // TODO some levenstein on the words
22911 var properPhrase = proper.join(' ');
22912 // Check the words are valid
22913 var isValid = mnemonic.check(properPhrase);
22914 if (!isValid) {
22915 return "Invalid mnemonic";
22916 }
22917 return false;
22918 }
22919
22920 function findDerivationPathErrors(path) {
22921 // TODO
22922 return false;
22923 }
22924
22925 function displayBip32Info() {
22926 // Display the key
22927 var rootKey = bip32RootKey.toBase58();
22928 DOM.rootKey.val(rootKey);
22929 var extendedPrivKey = bip32ExtendedKey.toBase58();
22930 DOM.extendedPrivKey.val(extendedPrivKey);
22931 var extendedPubKey = bip32ExtendedKey.toBase58(false);
22932 DOM.extendedPubKey.val(extendedPubKey);
22933 // Display the addresses and privkeys
22934 clearAddressesList();
22935 displayAddresses(0, 20);
22936 }
22937
22938 function displayAddresses(start, total) {
22939 for (var i=0; i<total; i++) {
22940 var index = i+ start;
22941 var key = bip32ExtendedKey.derive(index);
22942 var address = key.getAddress().toString();
22943 var privkey = key.privKey.toWIF();
22944 addAddressToList(index, address, privkey);
22945 }
22946 }
22947
22948 function showMore() {
22949 var start = DOM.addresses.children().length;
22950 var rowsToAdd = parseInt(DOM.rowsToAdd.val());
22951 if (isNaN(rowsToAdd)) {
22952 rowsToAdd = 20;
22953 DOM.rowsToAdd.val("20");
22954 }
22955 if (rowsToAdd > 200) {
22956 var msg = "Generating " + rowsToAdd + " rows could take a while. ";
22957 msg += "Do you want to continue?";
22958 if (!confirm(msg)) {
22959 return;
22960 }
22961 }
22962 showPending();
22963 setTimeout(function() {
22964 displayAddresses(start, rowsToAdd);
22965 hidePending();
22966 }, 50);
22967 }
22968
22969 function clearDisplay() {
22970 clearAddressesList();
22971 clearKey();
22972 hideValidationError();
22973 }
22974
22975 function clearAddressesList() {
22976 DOM.addresses.empty();
22977 }
22978
22979 function clearKey() {
22980 DOM.rootKey.val("");
22981 DOM.extendedPrivKey.val("");
22982 DOM.extendedPubKey.val("");
22983 }
22984
22985 function addAddressToList(index, address, privkey) {
22986 var row = $(addressRowTemplate.html());
22987 row.find(".index span").text(index);
22988 row.find(".address span").text(address);
22989 row.find(".privkey span").text(privkey);
22990 DOM.addresses.append(row);
22991 }
22992
22993 function hasStrongRandom() {
22994 return 'crypto' in window && window['crypto'] !== null;
22995 }
22996
22997 function disableForms() {
22998 $("form").on("submit", function(e) {
22999 e.preventDefault();
23000 });
23001 }
23002
23003 function setBip44DerivationPath() {
23004 var purpose = parseIntNoNaN(DOM.bip44purpose.val(), 44);
23005 var coin = parseIntNoNaN(DOM.bip44coin.val(), 0);
23006 var account = parseIntNoNaN(DOM.bip44account.val(), 0);
23007 var change = parseIntNoNaN(DOM.bip44change.val(), 0);
23008 var path = "m/";
23009 path += purpose + "'/";
23010 path += coin + "'/";
23011 path += account + "'/";
23012 path += change;
23013 DOM.bip44path.val(path);
23014 }
23015
23016 function parseIntNoNaN(val, defaultVal) {
23017 var v = parseInt(val);
23018 if (isNaN(v)) {
23019 return defaultVal;
23020 }
23021 return v;
23022 }
23023
23024 function showPending() {
23025 DOM.feedback
23026 .text("Calculating...")
23027 .show();
23028 }
23029
23030 function hidePending() {
23031 DOM.feedback
23032 .text("")
23033 .hide();
23034 }
23035
23036 init();
23037
23038})();
23039</script>
23040 </body>
23041</html>