@bootpay/client-js 5.0.0-rc.6 → 5.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/dist/index.es.js +3921 -356
- package/dist/index.umd.js +19 -2
- package/dist/package.json.d.ts +2 -1
- package/dist/src/bootpay-widget.d.ts +3 -0
- package/dist/src/lib/bootpay-widget.d.ts +2 -98
- package/dist/src/lib/event/payment.d.ts +0 -3
- package/dist/src/lib/template/confirm-modal.d.ts +17 -0
- package/dist/src/lib/template/oopay.d.ts +1 -1
- package/dist/src/lib/template/payment.d.ts +8 -2
- package/dist/src/models/bootpay-widget-interface.d.ts +1 -0
- package/dist/src/support/logger.d.ts +1 -1
- package/dist/src/support/storage.d.ts +4 -4
- package/dist/src/support/template-manager.d.ts +2 -1
- package/dist/src/support/util.d.ts +1 -0
- package/dist/src/support/widget-store.d.ts +5 -0
- package/package.json +2 -1
- package/tsconfig.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translate(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translate(0);opacity:1}to{transform:translateY(150%);opacity:0}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
1
|
+
!function(){"use strict";try{if("undefined"!=typeof document){var o=document.createElement("style");o.appendChild(document.createTextNode('.bootpay-progress-background{position:fixed;display:block;background-color:transparent;inset:0;text-align:center;z-index:200000;white-space:nowrap}.bootpay-progress-background.blur-off{background-color:transparent}.bootpay-progress-background:before{display:inline-block;height:100%;content:" ";vertical-align:middle}.bootpay-progress-background .progress-message-window{display:inline-block;text-align:center;max-width:600px;border-radius:3px;width:100%;background-color:transparent;padding:0;vertical-align:middle}@media (min-width: 600px){.bootpay-progress-background .progress-message-window{padding:1rem}}.bootpay-progress-background .progress-message-window .bootpay-spinner{display:inline-block;width:50px;height:50px;border-radius:50%;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2);border-left:2px solid #ffffff;animation:spin 1s infinite linear}.bootpay-progress-background .progress-message-window .alfred-text{margin-top:1rem}.bootpay-progress-background .progress-message-window .alfred-text span.alfred-inner-text{font-weight:400;color:#eee}@keyframes spin{0%{transform:rotate(0);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}50%{transform:rotate(180deg);border-left:3px solid #ffffff;border-top:2px solid rgba(255,255,255,.4);border-right:2px solid rgba(255,255,255,.4);border-bottom:2px solid rgba(255,255,255,.4)}to{transform:rotate(360deg);border-left:2px solid #ffffff;border-top:2px solid rgba(255,255,255,.2);border-right:2px solid rgba(255,255,255,.2);border-bottom:2px solid rgba(255,255,255,.2)}}body.bootpay-open{position:fixed!important;inset:0;padding:0;margin:0;height:100vh!important;overflow:hidden!important;-webkit-overflow-scrolling:auto!important}body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:transparent}@media (min-width: 600px){body.bootpay-open.bootpay-mobile .bootpay-payment-background{background-color:#000000b3}}body.bootpay-open .bootpay-payment-background{position:fixed;inset:0;display:block;text-align:center;background-color:#000000b3;z-index:9999}body.bootpay-open .bootpay-payment-background:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert{padding:1rem}body.bootpay-open .bootpay-payment-background.__alert:before{display:inline-block;vertical-align:middle;height:100%;content:" "}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{position:absolute;max-width:400px;width:100%;background-color:#fff;border-radius:12px;left:50%;top:50%;transform:translate(-50%,-50%);overflow:hidden;box-shadow:0 0 10px #0000001a}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-in{animation:__bootpay-fade-in .1s linear}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window.fade-out{animation:__bootpay-fade-out .1s linear}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window{left:1rem;right:1rem;width:auto;top:50%;transform:translateY(-50%)}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header{padding:1rem;text-align:left;font-size:20px;font-weight:600;position:relative}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{top:40%;transform:translateY(-50%);padding:0;right:1rem}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn{right:8px;top:50%;transform:translateY(-55%)}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:before,body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-header>.bootpay-close-btn:after{background-color:#333;width:1px}}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-body{padding:1.5rem 1rem;text-align:center;font-size:16px;color:#333;line-height:1.5}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer{display:flex;justify-content:flex-end;border-top:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close{flex:0 1 50%;padding:1rem;background-color:#fff;color:#333;font-size:16px;cursor:pointer;border:0;outline:none}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.border-right{border-right:1px solid #f2f2f2}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close:hover{background-color:#e0e0e0}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary{color:#507cf3;font-weight:600}body.bootpay-open .bootpay-payment-background.__alert>.bootpay-confirm-window>.bootpay__alert-footer>button.bootpay__alert-close.bootpay-primary:hover{color:#3f6be2}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:relative;display:inline-block;vertical-align:middle}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{max-width:470px;height:90%}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window{position:absolute;inset:0;border-radius:0!important}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window.__mobile{position:absolute;max-width:inherit;inset:0;height:100%}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%!important;height:100%!important;border-radius:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.transparent{background:transparent!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{position:absolute;display:none;top:-32px;right:4px;color:#fff;font-size:32px;text-decoration:none;outline:none;box-shadow:none;border:0;background-color:transparent}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#fff!important}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close{top:1rem;right:16px;color:#000;padding:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:before,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>button.bootpay-payment-close:after{width:2px!important;background-color:#000!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:relative;width:400px;height:600px;display:none;background-color:#fff;border-radius:5px;overflow:hidden}@media (max-width: 768px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window{position:absolute;inset:0;width:100%;height:100%;border-radius:0}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.header{position:absolute;left:0;right:0;top:0;height:50px;color:#333;background-color:#fff;text-align:left}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body{position:absolute;inset:50px 0 72px;padding:1rem;text-align:left;font-size:14px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-item-name-id{font-size:16px;color:#888;font-weight:400!important;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>#bootpay-price-id{font-size:36px;color:#333;font-weight:700;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.body>.agree-text{position:absolute;bottom:1rem;left:0;right:0;color:#888;font-size:14px;text-align:center}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer{position:absolute;left:0;right:0;bottom:0;height:72px;padding:0 1rem;margin:0}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button{display:block;width:100%;padding:1rem;outline:none;border:none;background-color:#507cf3;border-radius:5px;color:#fff;font-size:16px}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:hover,body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>.bootpay-popup-window>.footer>button.bootpay-button:active{outline:none;box-shadow:none}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:100%;height:100%;display:none;border:0!important;outline:0!important;border-radius:0;box-shadow:none}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe{width:0;height:0;border:0;outline:0;border-radius:0!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{border-radius:0}@media (min-width: 600px){body.bootpay-open .bootpay-payment-background>.bootpay-payment-window>iframe.rounded-iframe{width:0;height:0;border:0;outline:0;border-radius:20px!important;box-shadow:none!important}}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-up{animation:__bootpay-slide-up .3s linear}body.bootpay-open .bootpay-payment-background #__bootpay-modal-iframe.slide-down{animation:__bootpay-slide-down .3s linear}body.bootpay-open .bootpay-payment-background>.bootpay-confirm-window>iframe{display:none;width:1px;height:1px;background:transparent;border:0!important;outline:0!important}.bootpay-close-btn{position:absolute;box-shadow:none;background-color:#fff;outline:0;z-index:10001;right:8px;top:8px;height:21px;width:21px;border:0!important;outline:none!important}@media (min-width: 600px){.bootpay-close-btn{right:4px;top:-32px;width:25px;height:25px;background:transparent;outline:none!important;border:0!important}}.bootpay-close-btn.active,.bootpay-close-btn:focus{outline:none!important;border:0!important}.bootpay-close-btn:before,.bootpay-close-btn:after{position:absolute;left:8px;top:2px;content:" ";height:24px;width:1px;background-color:#333}@media (min-width: 600px){.bootpay-close-btn:before,.bootpay-close-btn:after{height:23px;top:0;width:2px;background-color:#fff}}.bootpay-close-btn:before{transform:rotate(45deg)}.bootpay-close-btn:after{transform:rotate(-45deg)}@keyframes __bootpay-slide-up{0%{transform:translateY(150%);opacity:0}to{transform:translateY(0);opacity:1}}@keyframes __bootpay-slide-down{0%{transform:translateY(0);opacity:1}to{transform:translateY(150%);opacity:0}}@keyframes __bootpay-fade-in{0%{opacity:0;scale:.9}to{opacity:1;scale:1}}@keyframes __bootpay-fade-out{0%{opacity:1;scale:1}to{opacity:0;scale:.9}}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}}();
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
4
4
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
@@ -70,6 +70,14 @@ const isPresent = (value) => {
|
|
|
70
70
|
const isType = (value, type) => {
|
|
71
71
|
return typeof value === type;
|
|
72
72
|
};
|
|
73
|
+
const toUrl = (url, parameters = void 0) => {
|
|
74
|
+
if (isPresent(parameters)) {
|
|
75
|
+
const uriParameters = typeof parameters !== "string" ? new URLSearchParams(JSON.parse(JSON.stringify(parameters))).toString() : parameters;
|
|
76
|
+
return /\?/.test(url) ? `${url}&${uriParameters}` : `${url}?${uriParameters}`;
|
|
77
|
+
} else {
|
|
78
|
+
return url;
|
|
79
|
+
}
|
|
80
|
+
};
|
|
73
81
|
var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {};
|
|
74
82
|
function getDefaultExportFromCjs(x) {
|
|
75
83
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
|
|
@@ -122,7 +130,7 @@ function requireCore() {
|
|
|
122
130
|
module.exports = factory();
|
|
123
131
|
}
|
|
124
132
|
})(commonjsGlobal, function() {
|
|
125
|
-
var
|
|
133
|
+
var CryptoJS2 = CryptoJS2 || function(Math2, undefined$1) {
|
|
126
134
|
var crypto;
|
|
127
135
|
if (typeof window !== "undefined" && window.crypto) {
|
|
128
136
|
crypto = window.crypto;
|
|
@@ -713,7 +721,7 @@ function requireCore() {
|
|
|
713
721
|
var C_algo = C.algo = {};
|
|
714
722
|
return C;
|
|
715
723
|
}(Math);
|
|
716
|
-
return
|
|
724
|
+
return CryptoJS2;
|
|
717
725
|
});
|
|
718
726
|
})(core);
|
|
719
727
|
return core.exports;
|
|
@@ -723,8 +731,8 @@ function requireCore() {
|
|
|
723
731
|
{
|
|
724
732
|
module.exports = factory(requireCore());
|
|
725
733
|
}
|
|
726
|
-
})(commonjsGlobal, function(
|
|
727
|
-
return
|
|
734
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
735
|
+
return CryptoJS2.enc.Utf8;
|
|
728
736
|
});
|
|
729
737
|
})(encUtf8);
|
|
730
738
|
var encUtf8Exports = encUtf8.exports;
|
|
@@ -735,9 +743,9 @@ var encBase64 = { exports: {} };
|
|
|
735
743
|
{
|
|
736
744
|
module.exports = factory(requireCore());
|
|
737
745
|
}
|
|
738
|
-
})(commonjsGlobal, function(
|
|
746
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
739
747
|
(function() {
|
|
740
|
-
var C =
|
|
748
|
+
var C = CryptoJS2;
|
|
741
749
|
var C_lib = C.lib;
|
|
742
750
|
var WordArray = C_lib.WordArray;
|
|
743
751
|
var C_enc = C.enc;
|
|
@@ -827,7 +835,7 @@ var encBase64 = { exports: {} };
|
|
|
827
835
|
return WordArray.create(words, nBytes);
|
|
828
836
|
}
|
|
829
837
|
})();
|
|
830
|
-
return
|
|
838
|
+
return CryptoJS2.enc.Base64;
|
|
831
839
|
});
|
|
832
840
|
})(encBase64);
|
|
833
841
|
var encBase64Exports = encBase64.exports;
|
|
@@ -1080,7 +1088,7 @@ class SessionStorageManager extends StorageManager {
|
|
|
1080
1088
|
}
|
|
1081
1089
|
const SessionStorage = new SessionStorageManager();
|
|
1082
1090
|
const name = "@bootpay/client-js";
|
|
1083
|
-
const version = "5.0.0
|
|
1091
|
+
const version = "5.0.0";
|
|
1084
1092
|
const main = "dist/index.es.js";
|
|
1085
1093
|
const types = "dist/src/index.d.ts";
|
|
1086
1094
|
const styles = "dist/index.css";
|
|
@@ -1107,6 +1115,7 @@ const devDependencies = {
|
|
|
1107
1115
|
"@babel/plugin-transform-runtime": "^7.22.5",
|
|
1108
1116
|
"@babel/plugin-transform-object-assign": "^7.22.5",
|
|
1109
1117
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
1118
|
+
"@babel/plugin-transform-destructuring": "^7.24.8",
|
|
1110
1119
|
"@babel/preset-env": "^7.22.5",
|
|
1111
1120
|
"@babel/preset-typescript": "^7.22.5",
|
|
1112
1121
|
"@babel/runtime-corejs3": "^7.22.5",
|
|
@@ -1365,13 +1374,20 @@ class TemplateManager extends BootpayManager {
|
|
|
1365
1374
|
document.body.insertAdjacentHTML("beforeend", this.$template);
|
|
1366
1375
|
}
|
|
1367
1376
|
}
|
|
1368
|
-
bodyOpen() {
|
|
1377
|
+
bodyOpen(addClass = void 0) {
|
|
1369
1378
|
const body = document.querySelector("body");
|
|
1370
1379
|
if (this.$present(body.className)) {
|
|
1371
1380
|
body.className = `${body.className} bootpay-open`;
|
|
1372
1381
|
} else {
|
|
1373
1382
|
body.className = "bootpay-open";
|
|
1374
1383
|
}
|
|
1384
|
+
if (this.$present(addClass)) {
|
|
1385
|
+
body.className = `${body.className} ${addClass}`;
|
|
1386
|
+
}
|
|
1387
|
+
}
|
|
1388
|
+
bodyClose() {
|
|
1389
|
+
const body = document.querySelector("body");
|
|
1390
|
+
body.className = body.className.replace("bootpay-open", "");
|
|
1375
1391
|
}
|
|
1376
1392
|
templateResize(el, resizeData) {
|
|
1377
1393
|
const element = this.byId(el);
|
|
@@ -2842,9 +2858,9 @@ function requireMd5() {
|
|
|
2842
2858
|
{
|
|
2843
2859
|
module.exports = factory(requireCore());
|
|
2844
2860
|
}
|
|
2845
|
-
})(commonjsGlobal, function(
|
|
2861
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
2846
2862
|
(function(Math2) {
|
|
2847
|
-
var C =
|
|
2863
|
+
var C = CryptoJS2;
|
|
2848
2864
|
var C_lib = C.lib;
|
|
2849
2865
|
var WordArray = C_lib.WordArray;
|
|
2850
2866
|
var Hasher = C_lib.Hasher;
|
|
@@ -3005,7 +3021,7 @@ function requireMd5() {
|
|
|
3005
3021
|
C.MD5 = Hasher._createHelper(MD5);
|
|
3006
3022
|
C.HmacMD5 = Hasher._createHmacHelper(MD5);
|
|
3007
3023
|
})(Math);
|
|
3008
|
-
return
|
|
3024
|
+
return CryptoJS2.MD5;
|
|
3009
3025
|
});
|
|
3010
3026
|
})(md5);
|
|
3011
3027
|
return md5.exports;
|
|
@@ -3022,9 +3038,9 @@ function requireSha1() {
|
|
|
3022
3038
|
{
|
|
3023
3039
|
module.exports = factory(requireCore());
|
|
3024
3040
|
}
|
|
3025
|
-
})(commonjsGlobal, function(
|
|
3041
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
3026
3042
|
(function() {
|
|
3027
|
-
var C =
|
|
3043
|
+
var C = CryptoJS2;
|
|
3028
3044
|
var C_lib = C.lib;
|
|
3029
3045
|
var WordArray = C_lib.WordArray;
|
|
3030
3046
|
var Hasher = C_lib.Hasher;
|
|
@@ -3097,7 +3113,7 @@ function requireSha1() {
|
|
|
3097
3113
|
C.SHA1 = Hasher._createHelper(SHA1);
|
|
3098
3114
|
C.HmacSHA1 = Hasher._createHmacHelper(SHA1);
|
|
3099
3115
|
})();
|
|
3100
|
-
return
|
|
3116
|
+
return CryptoJS2.SHA1;
|
|
3101
3117
|
});
|
|
3102
3118
|
})(sha1);
|
|
3103
3119
|
return sha1.exports;
|
|
@@ -3113,9 +3129,9 @@ function requireHmac() {
|
|
|
3113
3129
|
{
|
|
3114
3130
|
module.exports = factory(requireCore());
|
|
3115
3131
|
}
|
|
3116
|
-
})(commonjsGlobal, function(
|
|
3132
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
3117
3133
|
(function() {
|
|
3118
|
-
var C =
|
|
3134
|
+
var C = CryptoJS2;
|
|
3119
3135
|
var C_lib = C.lib;
|
|
3120
3136
|
var Base = C_lib.Base;
|
|
3121
3137
|
var C_enc = C.enc;
|
|
@@ -3219,9 +3235,9 @@ function requireEvpkdf() {
|
|
|
3219
3235
|
{
|
|
3220
3236
|
module.exports = factory(requireCore(), requireSha1(), requireHmac());
|
|
3221
3237
|
}
|
|
3222
|
-
})(commonjsGlobal, function(
|
|
3238
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
3223
3239
|
(function() {
|
|
3224
|
-
var C =
|
|
3240
|
+
var C = CryptoJS2;
|
|
3225
3241
|
var C_lib = C.lib;
|
|
3226
3242
|
var Base = C_lib.Base;
|
|
3227
3243
|
var WordArray = C_lib.WordArray;
|
|
@@ -3294,7 +3310,7 @@ function requireEvpkdf() {
|
|
|
3294
3310
|
return EvpKDF.create(cfg).compute(password, salt);
|
|
3295
3311
|
};
|
|
3296
3312
|
})();
|
|
3297
|
-
return
|
|
3313
|
+
return CryptoJS2.EvpKDF;
|
|
3298
3314
|
});
|
|
3299
3315
|
})(evpkdf);
|
|
3300
3316
|
return evpkdf.exports;
|
|
@@ -3310,9 +3326,9 @@ function requireCipherCore() {
|
|
|
3310
3326
|
{
|
|
3311
3327
|
module.exports = factory(requireCore(), requireEvpkdf());
|
|
3312
3328
|
}
|
|
3313
|
-
})(commonjsGlobal, function(
|
|
3314
|
-
|
|
3315
|
-
var C =
|
|
3329
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
3330
|
+
CryptoJS2.lib.Cipher || function(undefined$1) {
|
|
3331
|
+
var C = CryptoJS2;
|
|
3316
3332
|
var C_lib = C.lib;
|
|
3317
3333
|
var Base = C_lib.Base;
|
|
3318
3334
|
var WordArray = C_lib.WordArray;
|
|
@@ -3939,153 +3955,160 @@ function requireCipherCore() {
|
|
|
3939
3955
|
})(cipherCore);
|
|
3940
3956
|
return cipherCore.exports;
|
|
3941
3957
|
}
|
|
3942
|
-
|
|
3943
|
-
|
|
3944
|
-
|
|
3945
|
-
|
|
3946
|
-
|
|
3947
|
-
|
|
3948
|
-
(function() {
|
|
3949
|
-
|
|
3950
|
-
|
|
3951
|
-
|
|
3952
|
-
|
|
3953
|
-
var SBOX = [];
|
|
3954
|
-
var INV_SBOX = [];
|
|
3955
|
-
var SUB_MIX_0 = [];
|
|
3956
|
-
var SUB_MIX_1 = [];
|
|
3957
|
-
var SUB_MIX_2 = [];
|
|
3958
|
-
var SUB_MIX_3 = [];
|
|
3959
|
-
var INV_SUB_MIX_0 = [];
|
|
3960
|
-
var INV_SUB_MIX_1 = [];
|
|
3961
|
-
var INV_SUB_MIX_2 = [];
|
|
3962
|
-
var INV_SUB_MIX_3 = [];
|
|
3958
|
+
var hasRequiredAes;
|
|
3959
|
+
function requireAes() {
|
|
3960
|
+
if (hasRequiredAes)
|
|
3961
|
+
return aes.exports;
|
|
3962
|
+
hasRequiredAes = 1;
|
|
3963
|
+
(function(module, exports) {
|
|
3964
|
+
(function(root, factory, undef) {
|
|
3965
|
+
{
|
|
3966
|
+
module.exports = factory(requireCore(), encBase64Exports, requireMd5(), requireEvpkdf(), requireCipherCore());
|
|
3967
|
+
}
|
|
3968
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
3963
3969
|
(function() {
|
|
3964
|
-
var
|
|
3965
|
-
|
|
3966
|
-
|
|
3967
|
-
|
|
3968
|
-
|
|
3969
|
-
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
var
|
|
3973
|
-
var
|
|
3974
|
-
|
|
3975
|
-
|
|
3976
|
-
|
|
3977
|
-
|
|
3978
|
-
|
|
3979
|
-
var
|
|
3980
|
-
var
|
|
3981
|
-
|
|
3982
|
-
|
|
3983
|
-
SUB_MIX_0[x] = t << 24 | t >>> 8;
|
|
3984
|
-
SUB_MIX_1[x] = t << 16 | t >>> 16;
|
|
3985
|
-
SUB_MIX_2[x] = t << 8 | t >>> 24;
|
|
3986
|
-
SUB_MIX_3[x] = t;
|
|
3987
|
-
var t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
|
|
3988
|
-
INV_SUB_MIX_0[sx] = t << 24 | t >>> 8;
|
|
3989
|
-
INV_SUB_MIX_1[sx] = t << 16 | t >>> 16;
|
|
3990
|
-
INV_SUB_MIX_2[sx] = t << 8 | t >>> 24;
|
|
3991
|
-
INV_SUB_MIX_3[sx] = t;
|
|
3992
|
-
if (!x) {
|
|
3993
|
-
x = xi = 1;
|
|
3994
|
-
} else {
|
|
3995
|
-
x = x2 ^ d[d[d[x8 ^ x2]]];
|
|
3996
|
-
xi ^= d[d[xi]];
|
|
3997
|
-
}
|
|
3998
|
-
}
|
|
3999
|
-
})();
|
|
4000
|
-
var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
|
|
4001
|
-
var AES2 = C_algo.AES = BlockCipher.extend({
|
|
4002
|
-
_doReset: function() {
|
|
4003
|
-
var t;
|
|
4004
|
-
if (this._nRounds && this._keyPriorReset === this._key) {
|
|
4005
|
-
return;
|
|
4006
|
-
}
|
|
4007
|
-
var key = this._keyPriorReset = this._key;
|
|
4008
|
-
var keyWords = key.words;
|
|
4009
|
-
var keySize = key.sigBytes / 4;
|
|
4010
|
-
var nRounds = this._nRounds = keySize + 6;
|
|
4011
|
-
var ksRows = (nRounds + 1) * 4;
|
|
4012
|
-
var keySchedule = this._keySchedule = [];
|
|
4013
|
-
for (var ksRow = 0; ksRow < ksRows; ksRow++) {
|
|
4014
|
-
if (ksRow < keySize) {
|
|
4015
|
-
keySchedule[ksRow] = keyWords[ksRow];
|
|
3970
|
+
var C = CryptoJS2;
|
|
3971
|
+
var C_lib = C.lib;
|
|
3972
|
+
var BlockCipher = C_lib.BlockCipher;
|
|
3973
|
+
var C_algo = C.algo;
|
|
3974
|
+
var SBOX = [];
|
|
3975
|
+
var INV_SBOX = [];
|
|
3976
|
+
var SUB_MIX_0 = [];
|
|
3977
|
+
var SUB_MIX_1 = [];
|
|
3978
|
+
var SUB_MIX_2 = [];
|
|
3979
|
+
var SUB_MIX_3 = [];
|
|
3980
|
+
var INV_SUB_MIX_0 = [];
|
|
3981
|
+
var INV_SUB_MIX_1 = [];
|
|
3982
|
+
var INV_SUB_MIX_2 = [];
|
|
3983
|
+
var INV_SUB_MIX_3 = [];
|
|
3984
|
+
(function() {
|
|
3985
|
+
var d = [];
|
|
3986
|
+
for (var i = 0; i < 256; i++) {
|
|
3987
|
+
if (i < 128) {
|
|
3988
|
+
d[i] = i << 1;
|
|
4016
3989
|
} else {
|
|
4017
|
-
|
|
4018
|
-
if (!(ksRow % keySize)) {
|
|
4019
|
-
t = t << 8 | t >>> 24;
|
|
4020
|
-
t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
|
|
4021
|
-
t ^= RCON[ksRow / keySize | 0] << 24;
|
|
4022
|
-
} else if (keySize > 6 && ksRow % keySize == 4) {
|
|
4023
|
-
t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
|
|
4024
|
-
}
|
|
4025
|
-
keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
|
|
3990
|
+
d[i] = i << 1 ^ 283;
|
|
4026
3991
|
}
|
|
4027
3992
|
}
|
|
4028
|
-
var
|
|
4029
|
-
|
|
4030
|
-
|
|
4031
|
-
|
|
4032
|
-
|
|
4033
|
-
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
4037
|
-
|
|
3993
|
+
var x = 0;
|
|
3994
|
+
var xi = 0;
|
|
3995
|
+
for (var i = 0; i < 256; i++) {
|
|
3996
|
+
var sx = xi ^ xi << 1 ^ xi << 2 ^ xi << 3 ^ xi << 4;
|
|
3997
|
+
sx = sx >>> 8 ^ sx & 255 ^ 99;
|
|
3998
|
+
SBOX[x] = sx;
|
|
3999
|
+
INV_SBOX[sx] = x;
|
|
4000
|
+
var x2 = d[x];
|
|
4001
|
+
var x4 = d[x2];
|
|
4002
|
+
var x8 = d[x4];
|
|
4003
|
+
var t = d[sx] * 257 ^ sx * 16843008;
|
|
4004
|
+
SUB_MIX_0[x] = t << 24 | t >>> 8;
|
|
4005
|
+
SUB_MIX_1[x] = t << 16 | t >>> 16;
|
|
4006
|
+
SUB_MIX_2[x] = t << 8 | t >>> 24;
|
|
4007
|
+
SUB_MIX_3[x] = t;
|
|
4008
|
+
var t = x8 * 16843009 ^ x4 * 65537 ^ x2 * 257 ^ x * 16843008;
|
|
4009
|
+
INV_SUB_MIX_0[sx] = t << 24 | t >>> 8;
|
|
4010
|
+
INV_SUB_MIX_1[sx] = t << 16 | t >>> 16;
|
|
4011
|
+
INV_SUB_MIX_2[sx] = t << 8 | t >>> 24;
|
|
4012
|
+
INV_SUB_MIX_3[sx] = t;
|
|
4013
|
+
if (!x) {
|
|
4014
|
+
x = xi = 1;
|
|
4038
4015
|
} else {
|
|
4039
|
-
|
|
4016
|
+
x = x2 ^ d[d[d[x8 ^ x2]]];
|
|
4017
|
+
xi ^= d[d[xi]];
|
|
4040
4018
|
}
|
|
4041
4019
|
}
|
|
4042
|
-
}
|
|
4043
|
-
|
|
4044
|
-
|
|
4045
|
-
|
|
4046
|
-
|
|
4047
|
-
|
|
4048
|
-
|
|
4049
|
-
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
4053
|
-
|
|
4054
|
-
|
|
4055
|
-
|
|
4056
|
-
|
|
4057
|
-
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
4061
|
-
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
|
|
4065
|
-
|
|
4066
|
-
|
|
4067
|
-
|
|
4068
|
-
|
|
4069
|
-
|
|
4070
|
-
|
|
4071
|
-
|
|
4072
|
-
|
|
4073
|
-
|
|
4074
|
-
|
|
4075
|
-
|
|
4076
|
-
|
|
4077
|
-
|
|
4078
|
-
|
|
4079
|
-
|
|
4080
|
-
|
|
4081
|
-
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
4085
|
-
|
|
4086
|
-
|
|
4087
|
-
|
|
4088
|
-
|
|
4020
|
+
})();
|
|
4021
|
+
var RCON = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
|
|
4022
|
+
var AES2 = C_algo.AES = BlockCipher.extend({
|
|
4023
|
+
_doReset: function() {
|
|
4024
|
+
var t;
|
|
4025
|
+
if (this._nRounds && this._keyPriorReset === this._key) {
|
|
4026
|
+
return;
|
|
4027
|
+
}
|
|
4028
|
+
var key = this._keyPriorReset = this._key;
|
|
4029
|
+
var keyWords = key.words;
|
|
4030
|
+
var keySize = key.sigBytes / 4;
|
|
4031
|
+
var nRounds = this._nRounds = keySize + 6;
|
|
4032
|
+
var ksRows = (nRounds + 1) * 4;
|
|
4033
|
+
var keySchedule = this._keySchedule = [];
|
|
4034
|
+
for (var ksRow = 0; ksRow < ksRows; ksRow++) {
|
|
4035
|
+
if (ksRow < keySize) {
|
|
4036
|
+
keySchedule[ksRow] = keyWords[ksRow];
|
|
4037
|
+
} else {
|
|
4038
|
+
t = keySchedule[ksRow - 1];
|
|
4039
|
+
if (!(ksRow % keySize)) {
|
|
4040
|
+
t = t << 8 | t >>> 24;
|
|
4041
|
+
t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
|
|
4042
|
+
t ^= RCON[ksRow / keySize | 0] << 24;
|
|
4043
|
+
} else if (keySize > 6 && ksRow % keySize == 4) {
|
|
4044
|
+
t = SBOX[t >>> 24] << 24 | SBOX[t >>> 16 & 255] << 16 | SBOX[t >>> 8 & 255] << 8 | SBOX[t & 255];
|
|
4045
|
+
}
|
|
4046
|
+
keySchedule[ksRow] = keySchedule[ksRow - keySize] ^ t;
|
|
4047
|
+
}
|
|
4048
|
+
}
|
|
4049
|
+
var invKeySchedule = this._invKeySchedule = [];
|
|
4050
|
+
for (var invKsRow = 0; invKsRow < ksRows; invKsRow++) {
|
|
4051
|
+
var ksRow = ksRows - invKsRow;
|
|
4052
|
+
if (invKsRow % 4) {
|
|
4053
|
+
var t = keySchedule[ksRow];
|
|
4054
|
+
} else {
|
|
4055
|
+
var t = keySchedule[ksRow - 4];
|
|
4056
|
+
}
|
|
4057
|
+
if (invKsRow < 4 || ksRow <= 4) {
|
|
4058
|
+
invKeySchedule[invKsRow] = t;
|
|
4059
|
+
} else {
|
|
4060
|
+
invKeySchedule[invKsRow] = INV_SUB_MIX_0[SBOX[t >>> 24]] ^ INV_SUB_MIX_1[SBOX[t >>> 16 & 255]] ^ INV_SUB_MIX_2[SBOX[t >>> 8 & 255]] ^ INV_SUB_MIX_3[SBOX[t & 255]];
|
|
4061
|
+
}
|
|
4062
|
+
}
|
|
4063
|
+
},
|
|
4064
|
+
encryptBlock: function(M, offset) {
|
|
4065
|
+
this._doCryptBlock(M, offset, this._keySchedule, SUB_MIX_0, SUB_MIX_1, SUB_MIX_2, SUB_MIX_3, SBOX);
|
|
4066
|
+
},
|
|
4067
|
+
decryptBlock: function(M, offset) {
|
|
4068
|
+
var t = M[offset + 1];
|
|
4069
|
+
M[offset + 1] = M[offset + 3];
|
|
4070
|
+
M[offset + 3] = t;
|
|
4071
|
+
this._doCryptBlock(M, offset, this._invKeySchedule, INV_SUB_MIX_0, INV_SUB_MIX_1, INV_SUB_MIX_2, INV_SUB_MIX_3, INV_SBOX);
|
|
4072
|
+
var t = M[offset + 1];
|
|
4073
|
+
M[offset + 1] = M[offset + 3];
|
|
4074
|
+
M[offset + 3] = t;
|
|
4075
|
+
},
|
|
4076
|
+
_doCryptBlock: function(M, offset, keySchedule, SUB_MIX_02, SUB_MIX_12, SUB_MIX_22, SUB_MIX_32, SBOX2) {
|
|
4077
|
+
var nRounds = this._nRounds;
|
|
4078
|
+
var s0 = M[offset] ^ keySchedule[0];
|
|
4079
|
+
var s1 = M[offset + 1] ^ keySchedule[1];
|
|
4080
|
+
var s2 = M[offset + 2] ^ keySchedule[2];
|
|
4081
|
+
var s3 = M[offset + 3] ^ keySchedule[3];
|
|
4082
|
+
var ksRow = 4;
|
|
4083
|
+
for (var round = 1; round < nRounds; round++) {
|
|
4084
|
+
var t0 = SUB_MIX_02[s0 >>> 24] ^ SUB_MIX_12[s1 >>> 16 & 255] ^ SUB_MIX_22[s2 >>> 8 & 255] ^ SUB_MIX_32[s3 & 255] ^ keySchedule[ksRow++];
|
|
4085
|
+
var t1 = SUB_MIX_02[s1 >>> 24] ^ SUB_MIX_12[s2 >>> 16 & 255] ^ SUB_MIX_22[s3 >>> 8 & 255] ^ SUB_MIX_32[s0 & 255] ^ keySchedule[ksRow++];
|
|
4086
|
+
var t2 = SUB_MIX_02[s2 >>> 24] ^ SUB_MIX_12[s3 >>> 16 & 255] ^ SUB_MIX_22[s0 >>> 8 & 255] ^ SUB_MIX_32[s1 & 255] ^ keySchedule[ksRow++];
|
|
4087
|
+
var t3 = SUB_MIX_02[s3 >>> 24] ^ SUB_MIX_12[s0 >>> 16 & 255] ^ SUB_MIX_22[s1 >>> 8 & 255] ^ SUB_MIX_32[s2 & 255] ^ keySchedule[ksRow++];
|
|
4088
|
+
s0 = t0;
|
|
4089
|
+
s1 = t1;
|
|
4090
|
+
s2 = t2;
|
|
4091
|
+
s3 = t3;
|
|
4092
|
+
}
|
|
4093
|
+
var t0 = (SBOX2[s0 >>> 24] << 24 | SBOX2[s1 >>> 16 & 255] << 16 | SBOX2[s2 >>> 8 & 255] << 8 | SBOX2[s3 & 255]) ^ keySchedule[ksRow++];
|
|
4094
|
+
var t1 = (SBOX2[s1 >>> 24] << 24 | SBOX2[s2 >>> 16 & 255] << 16 | SBOX2[s3 >>> 8 & 255] << 8 | SBOX2[s0 & 255]) ^ keySchedule[ksRow++];
|
|
4095
|
+
var t2 = (SBOX2[s2 >>> 24] << 24 | SBOX2[s3 >>> 16 & 255] << 16 | SBOX2[s0 >>> 8 & 255] << 8 | SBOX2[s1 & 255]) ^ keySchedule[ksRow++];
|
|
4096
|
+
var t3 = (SBOX2[s3 >>> 24] << 24 | SBOX2[s0 >>> 16 & 255] << 16 | SBOX2[s1 >>> 8 & 255] << 8 | SBOX2[s2 & 255]) ^ keySchedule[ksRow++];
|
|
4097
|
+
M[offset] = t0;
|
|
4098
|
+
M[offset + 1] = t1;
|
|
4099
|
+
M[offset + 2] = t2;
|
|
4100
|
+
M[offset + 3] = t3;
|
|
4101
|
+
},
|
|
4102
|
+
keySize: 256 / 32
|
|
4103
|
+
});
|
|
4104
|
+
C.AES = BlockCipher._createHelper(AES2);
|
|
4105
|
+
})();
|
|
4106
|
+
return CryptoJS2.AES;
|
|
4107
|
+
});
|
|
4108
|
+
})(aes);
|
|
4109
|
+
return aes.exports;
|
|
4110
|
+
}
|
|
4111
|
+
var aesExports = requireAes();
|
|
4089
4112
|
const AES = /* @__PURE__ */ getDefaultExportFromCjs(aesExports);
|
|
4090
4113
|
class Resource {
|
|
4091
4114
|
constructor() {
|
|
@@ -4234,8 +4257,6 @@ class BootpayPaymentEventManager extends BootpayWindowEvent {
|
|
|
4234
4257
|
* 결제 이벤트를 바인딩한다
|
|
4235
4258
|
* Comment by GOSOMI
|
|
4236
4259
|
* @date: 2021-05-11
|
|
4237
|
-
* @param resolve: Function
|
|
4238
|
-
* @param reject: Function
|
|
4239
4260
|
*/
|
|
4240
4261
|
bind(resolve, reject) {
|
|
4241
4262
|
this.isDone = false;
|
|
@@ -4255,6 +4276,14 @@ class BootpayPaymentEventManager extends BootpayWindowEvent {
|
|
|
4255
4276
|
message: response.message,
|
|
4256
4277
|
payload: response.payload
|
|
4257
4278
|
});
|
|
4279
|
+
case "setConfirmParameters":
|
|
4280
|
+
const url = `${response.gateway_url}/confirm/${response.receipt_id}?application_id=${response.application_id}`;
|
|
4281
|
+
if (response.open_type === "redirect") {
|
|
4282
|
+
TemplatePayment.setConfirmRedirect(url);
|
|
4283
|
+
} else {
|
|
4284
|
+
TemplatePayment.setConfirmFormUrl(url);
|
|
4285
|
+
}
|
|
4286
|
+
break;
|
|
4258
4287
|
case "confirm":
|
|
4259
4288
|
return this.resolve({
|
|
4260
4289
|
event: response.event,
|
|
@@ -4263,15 +4292,15 @@ class BootpayPaymentEventManager extends BootpayWindowEvent {
|
|
|
4263
4292
|
order_id: response.order_id
|
|
4264
4293
|
});
|
|
4265
4294
|
case "redirect":
|
|
4266
|
-
TemplatePayment.destroy();
|
|
4295
|
+
TemplatePayment.destroy(false);
|
|
4267
4296
|
location.href = response.url;
|
|
4268
4297
|
return;
|
|
4269
4298
|
case "moveRedirectUrl":
|
|
4270
4299
|
TemplatePayment.hidePaymentiFrame();
|
|
4271
4300
|
AlfredProgress.showProgress("결제 진행 중입니다. 잠시만 기다려주세요.");
|
|
4272
|
-
location.replace(
|
|
4301
|
+
location.replace(toUrl(response.url, response.parameters));
|
|
4273
4302
|
setTimeout(() => {
|
|
4274
|
-
TemplatePayment.destroy();
|
|
4303
|
+
TemplatePayment.destroy(false);
|
|
4275
4304
|
}, 5e3);
|
|
4276
4305
|
break;
|
|
4277
4306
|
case "polling":
|
|
@@ -4357,7 +4386,6 @@ class BootpayPaymentEventManager extends BootpayWindowEvent {
|
|
|
4357
4386
|
* Polling Event를 시작한다
|
|
4358
4387
|
* Comment by GOSOMI
|
|
4359
4388
|
* @date: 2021-12-29
|
|
4360
|
-
* @param
|
|
4361
4389
|
*/
|
|
4362
4390
|
startPollingEvent() {
|
|
4363
4391
|
this.$pollingInterval = setInterval(() => __async(this, null, function* () {
|
|
@@ -4708,6 +4736,16 @@ class TemplatePaymentManager extends TemplateManager {
|
|
|
4708
4736
|
form.target = this.$confirmIFrame;
|
|
4709
4737
|
form.action = url;
|
|
4710
4738
|
}
|
|
4739
|
+
/**
|
|
4740
|
+
* 결제 승인시 redirect 인 경우 _self target으로 설정한다
|
|
4741
|
+
* Comment by GOSOMI
|
|
4742
|
+
* @date: 2024-06-12
|
|
4743
|
+
*/
|
|
4744
|
+
setConfirmRedirect(url) {
|
|
4745
|
+
const form = this.byId(this.$confirmFormId);
|
|
4746
|
+
form.target = "_self";
|
|
4747
|
+
form.action = url;
|
|
4748
|
+
}
|
|
4711
4749
|
/**
|
|
4712
4750
|
* 결제 승인
|
|
4713
4751
|
* Comment by GOSOMI
|
|
@@ -4906,7 +4944,7 @@ class TemplatePaymentManager extends TemplateManager {
|
|
|
4906
4944
|
* @date: 2021-05-12
|
|
4907
4945
|
* @returns void
|
|
4908
4946
|
*/
|
|
4909
|
-
destroy() {
|
|
4947
|
+
destroy(callCloseEvent = true) {
|
|
4910
4948
|
if (this.$present(document.querySelector("body").className)) {
|
|
4911
4949
|
document.querySelector("body").className = document.querySelector("body").className.replace(/bootpay-open/gi, "");
|
|
4912
4950
|
}
|
|
@@ -4918,7 +4956,9 @@ class TemplatePaymentManager extends TemplateManager {
|
|
|
4918
4956
|
this.closePopup();
|
|
4919
4957
|
BootpayPaymentEvent.allClearEvent();
|
|
4920
4958
|
EventLogger.clearInstance();
|
|
4921
|
-
|
|
4959
|
+
if (callCloseEvent) {
|
|
4960
|
+
setTimeout(() => BootpayPaymentEvent.callBootpayDOMEvent("close"), 300);
|
|
4961
|
+
}
|
|
4922
4962
|
}
|
|
4923
4963
|
/**
|
|
4924
4964
|
* IFrame 창을 컨트롤한다
|
|
@@ -6411,196 +6451,3634 @@ const BootpaySDK = {
|
|
|
6411
6451
|
if (typeof window !== "undefined") {
|
|
6412
6452
|
window.BootpaySDK = BootpaySDK;
|
|
6413
6453
|
}
|
|
6414
|
-
|
|
6415
|
-
|
|
6416
|
-
|
|
6417
|
-
|
|
6418
|
-
|
|
6419
|
-
|
|
6420
|
-
|
|
6421
|
-
|
|
6422
|
-
|
|
6423
|
-
|
|
6424
|
-
|
|
6425
|
-
|
|
6426
|
-
|
|
6427
|
-
|
|
6428
|
-
|
|
6429
|
-
|
|
6430
|
-
|
|
6431
|
-
|
|
6432
|
-
|
|
6433
|
-
|
|
6434
|
-
|
|
6435
|
-
|
|
6436
|
-
|
|
6437
|
-
|
|
6438
|
-
|
|
6439
|
-
|
|
6440
|
-
|
|
6441
|
-
|
|
6442
|
-
|
|
6443
|
-
|
|
6444
|
-
|
|
6445
|
-
|
|
6446
|
-
|
|
6447
|
-
|
|
6448
|
-
|
|
6449
|
-
|
|
6450
|
-
|
|
6451
|
-
|
|
6452
|
-
|
|
6453
|
-
|
|
6454
|
-
|
|
6455
|
-
|
|
6456
|
-
|
|
6457
|
-
|
|
6458
|
-
|
|
6459
|
-
|
|
6460
|
-
|
|
6461
|
-
|
|
6462
|
-
|
|
6463
|
-
|
|
6464
|
-
|
|
6465
|
-
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
|
|
6470
|
-
|
|
6471
|
-
|
|
6472
|
-
|
|
6473
|
-
|
|
6474
|
-
|
|
6475
|
-
|
|
6476
|
-
|
|
6477
|
-
|
|
6478
|
-
|
|
6479
|
-
|
|
6480
|
-
|
|
6481
|
-
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
|
|
6493
|
-
|
|
6494
|
-
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
|
|
6504
|
-
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
|
|
6527
|
-
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
|
|
6539
|
-
|
|
6540
|
-
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
|
|
6555
|
-
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
|
|
6566
|
-
|
|
6567
|
-
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6579
|
-
|
|
6580
|
-
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6454
|
+
var cryptoJs = { exports: {} };
|
|
6455
|
+
var x64Core = { exports: {} };
|
|
6456
|
+
var hasRequiredX64Core;
|
|
6457
|
+
function requireX64Core() {
|
|
6458
|
+
if (hasRequiredX64Core)
|
|
6459
|
+
return x64Core.exports;
|
|
6460
|
+
hasRequiredX64Core = 1;
|
|
6461
|
+
(function(module, exports) {
|
|
6462
|
+
(function(root, factory) {
|
|
6463
|
+
{
|
|
6464
|
+
module.exports = factory(requireCore());
|
|
6465
|
+
}
|
|
6466
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
6467
|
+
(function(undefined$1) {
|
|
6468
|
+
var C = CryptoJS2;
|
|
6469
|
+
var C_lib = C.lib;
|
|
6470
|
+
var Base = C_lib.Base;
|
|
6471
|
+
var X32WordArray = C_lib.WordArray;
|
|
6472
|
+
var C_x64 = C.x64 = {};
|
|
6473
|
+
C_x64.Word = Base.extend({
|
|
6474
|
+
/**
|
|
6475
|
+
* Initializes a newly created 64-bit word.
|
|
6476
|
+
*
|
|
6477
|
+
* @param {number} high The high 32 bits.
|
|
6478
|
+
* @param {number} low The low 32 bits.
|
|
6479
|
+
*
|
|
6480
|
+
* @example
|
|
6481
|
+
*
|
|
6482
|
+
* var x64Word = CryptoJS.x64.Word.create(0x00010203, 0x04050607);
|
|
6483
|
+
*/
|
|
6484
|
+
init: function(high, low) {
|
|
6485
|
+
this.high = high;
|
|
6486
|
+
this.low = low;
|
|
6487
|
+
}
|
|
6488
|
+
/**
|
|
6489
|
+
* Bitwise NOTs this word.
|
|
6490
|
+
*
|
|
6491
|
+
* @return {X64Word} A new x64-Word object after negating.
|
|
6492
|
+
*
|
|
6493
|
+
* @example
|
|
6494
|
+
*
|
|
6495
|
+
* var negated = x64Word.not();
|
|
6496
|
+
*/
|
|
6497
|
+
// not: function () {
|
|
6498
|
+
// var high = ~this.high;
|
|
6499
|
+
// var low = ~this.low;
|
|
6500
|
+
// return X64Word.create(high, low);
|
|
6501
|
+
// },
|
|
6502
|
+
/**
|
|
6503
|
+
* Bitwise ANDs this word with the passed word.
|
|
6504
|
+
*
|
|
6505
|
+
* @param {X64Word} word The x64-Word to AND with this word.
|
|
6506
|
+
*
|
|
6507
|
+
* @return {X64Word} A new x64-Word object after ANDing.
|
|
6508
|
+
*
|
|
6509
|
+
* @example
|
|
6510
|
+
*
|
|
6511
|
+
* var anded = x64Word.and(anotherX64Word);
|
|
6512
|
+
*/
|
|
6513
|
+
// and: function (word) {
|
|
6514
|
+
// var high = this.high & word.high;
|
|
6515
|
+
// var low = this.low & word.low;
|
|
6516
|
+
// return X64Word.create(high, low);
|
|
6517
|
+
// },
|
|
6518
|
+
/**
|
|
6519
|
+
* Bitwise ORs this word with the passed word.
|
|
6520
|
+
*
|
|
6521
|
+
* @param {X64Word} word The x64-Word to OR with this word.
|
|
6522
|
+
*
|
|
6523
|
+
* @return {X64Word} A new x64-Word object after ORing.
|
|
6524
|
+
*
|
|
6525
|
+
* @example
|
|
6526
|
+
*
|
|
6527
|
+
* var ored = x64Word.or(anotherX64Word);
|
|
6528
|
+
*/
|
|
6529
|
+
// or: function (word) {
|
|
6530
|
+
// var high = this.high | word.high;
|
|
6531
|
+
// var low = this.low | word.low;
|
|
6532
|
+
// return X64Word.create(high, low);
|
|
6533
|
+
// },
|
|
6534
|
+
/**
|
|
6535
|
+
* Bitwise XORs this word with the passed word.
|
|
6536
|
+
*
|
|
6537
|
+
* @param {X64Word} word The x64-Word to XOR with this word.
|
|
6538
|
+
*
|
|
6539
|
+
* @return {X64Word} A new x64-Word object after XORing.
|
|
6540
|
+
*
|
|
6541
|
+
* @example
|
|
6542
|
+
*
|
|
6543
|
+
* var xored = x64Word.xor(anotherX64Word);
|
|
6544
|
+
*/
|
|
6545
|
+
// xor: function (word) {
|
|
6546
|
+
// var high = this.high ^ word.high;
|
|
6547
|
+
// var low = this.low ^ word.low;
|
|
6548
|
+
// return X64Word.create(high, low);
|
|
6549
|
+
// },
|
|
6550
|
+
/**
|
|
6551
|
+
* Shifts this word n bits to the left.
|
|
6552
|
+
*
|
|
6553
|
+
* @param {number} n The number of bits to shift.
|
|
6554
|
+
*
|
|
6555
|
+
* @return {X64Word} A new x64-Word object after shifting.
|
|
6556
|
+
*
|
|
6557
|
+
* @example
|
|
6558
|
+
*
|
|
6559
|
+
* var shifted = x64Word.shiftL(25);
|
|
6560
|
+
*/
|
|
6561
|
+
// shiftL: function (n) {
|
|
6562
|
+
// if (n < 32) {
|
|
6563
|
+
// var high = (this.high << n) | (this.low >>> (32 - n));
|
|
6564
|
+
// var low = this.low << n;
|
|
6565
|
+
// } else {
|
|
6566
|
+
// var high = this.low << (n - 32);
|
|
6567
|
+
// var low = 0;
|
|
6568
|
+
// }
|
|
6569
|
+
// return X64Word.create(high, low);
|
|
6570
|
+
// },
|
|
6571
|
+
/**
|
|
6572
|
+
* Shifts this word n bits to the right.
|
|
6573
|
+
*
|
|
6574
|
+
* @param {number} n The number of bits to shift.
|
|
6575
|
+
*
|
|
6576
|
+
* @return {X64Word} A new x64-Word object after shifting.
|
|
6577
|
+
*
|
|
6578
|
+
* @example
|
|
6579
|
+
*
|
|
6580
|
+
* var shifted = x64Word.shiftR(7);
|
|
6581
|
+
*/
|
|
6582
|
+
// shiftR: function (n) {
|
|
6583
|
+
// if (n < 32) {
|
|
6584
|
+
// var low = (this.low >>> n) | (this.high << (32 - n));
|
|
6585
|
+
// var high = this.high >>> n;
|
|
6586
|
+
// } else {
|
|
6587
|
+
// var low = this.high >>> (n - 32);
|
|
6588
|
+
// var high = 0;
|
|
6589
|
+
// }
|
|
6590
|
+
// return X64Word.create(high, low);
|
|
6591
|
+
// },
|
|
6592
|
+
/**
|
|
6593
|
+
* Rotates this word n bits to the left.
|
|
6594
|
+
*
|
|
6595
|
+
* @param {number} n The number of bits to rotate.
|
|
6596
|
+
*
|
|
6597
|
+
* @return {X64Word} A new x64-Word object after rotating.
|
|
6598
|
+
*
|
|
6599
|
+
* @example
|
|
6600
|
+
*
|
|
6601
|
+
* var rotated = x64Word.rotL(25);
|
|
6602
|
+
*/
|
|
6603
|
+
// rotL: function (n) {
|
|
6604
|
+
// return this.shiftL(n).or(this.shiftR(64 - n));
|
|
6605
|
+
// },
|
|
6606
|
+
/**
|
|
6607
|
+
* Rotates this word n bits to the right.
|
|
6608
|
+
*
|
|
6609
|
+
* @param {number} n The number of bits to rotate.
|
|
6610
|
+
*
|
|
6611
|
+
* @return {X64Word} A new x64-Word object after rotating.
|
|
6612
|
+
*
|
|
6613
|
+
* @example
|
|
6614
|
+
*
|
|
6615
|
+
* var rotated = x64Word.rotR(7);
|
|
6616
|
+
*/
|
|
6617
|
+
// rotR: function (n) {
|
|
6618
|
+
// return this.shiftR(n).or(this.shiftL(64 - n));
|
|
6619
|
+
// },
|
|
6620
|
+
/**
|
|
6621
|
+
* Adds this word with the passed word.
|
|
6622
|
+
*
|
|
6623
|
+
* @param {X64Word} word The x64-Word to add with this word.
|
|
6624
|
+
*
|
|
6625
|
+
* @return {X64Word} A new x64-Word object after adding.
|
|
6626
|
+
*
|
|
6627
|
+
* @example
|
|
6628
|
+
*
|
|
6629
|
+
* var added = x64Word.add(anotherX64Word);
|
|
6630
|
+
*/
|
|
6631
|
+
// add: function (word) {
|
|
6632
|
+
// var low = (this.low + word.low) | 0;
|
|
6633
|
+
// var carry = (low >>> 0) < (this.low >>> 0) ? 1 : 0;
|
|
6634
|
+
// var high = (this.high + word.high + carry) | 0;
|
|
6635
|
+
// return X64Word.create(high, low);
|
|
6636
|
+
// }
|
|
6637
|
+
});
|
|
6638
|
+
C_x64.WordArray = Base.extend({
|
|
6639
|
+
/**
|
|
6640
|
+
* Initializes a newly created word array.
|
|
6641
|
+
*
|
|
6642
|
+
* @param {Array} words (Optional) An array of CryptoJS.x64.Word objects.
|
|
6643
|
+
* @param {number} sigBytes (Optional) The number of significant bytes in the words.
|
|
6644
|
+
*
|
|
6645
|
+
* @example
|
|
6646
|
+
*
|
|
6647
|
+
* var wordArray = CryptoJS.x64.WordArray.create();
|
|
6648
|
+
*
|
|
6649
|
+
* var wordArray = CryptoJS.x64.WordArray.create([
|
|
6650
|
+
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
|
|
6651
|
+
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
|
|
6652
|
+
* ]);
|
|
6653
|
+
*
|
|
6654
|
+
* var wordArray = CryptoJS.x64.WordArray.create([
|
|
6655
|
+
* CryptoJS.x64.Word.create(0x00010203, 0x04050607),
|
|
6656
|
+
* CryptoJS.x64.Word.create(0x18191a1b, 0x1c1d1e1f)
|
|
6657
|
+
* ], 10);
|
|
6658
|
+
*/
|
|
6659
|
+
init: function(words, sigBytes) {
|
|
6660
|
+
words = this.words = words || [];
|
|
6661
|
+
if (sigBytes != undefined$1) {
|
|
6662
|
+
this.sigBytes = sigBytes;
|
|
6663
|
+
} else {
|
|
6664
|
+
this.sigBytes = words.length * 8;
|
|
6665
|
+
}
|
|
6666
|
+
},
|
|
6667
|
+
/**
|
|
6668
|
+
* Converts this 64-bit word array to a 32-bit word array.
|
|
6669
|
+
*
|
|
6670
|
+
* @return {CryptoJS.lib.WordArray} This word array's data as a 32-bit word array.
|
|
6671
|
+
*
|
|
6672
|
+
* @example
|
|
6673
|
+
*
|
|
6674
|
+
* var x32WordArray = x64WordArray.toX32();
|
|
6675
|
+
*/
|
|
6676
|
+
toX32: function() {
|
|
6677
|
+
var x64Words = this.words;
|
|
6678
|
+
var x64WordsLength = x64Words.length;
|
|
6679
|
+
var x32Words = [];
|
|
6680
|
+
for (var i = 0; i < x64WordsLength; i++) {
|
|
6681
|
+
var x64Word = x64Words[i];
|
|
6682
|
+
x32Words.push(x64Word.high);
|
|
6683
|
+
x32Words.push(x64Word.low);
|
|
6684
|
+
}
|
|
6685
|
+
return X32WordArray.create(x32Words, this.sigBytes);
|
|
6686
|
+
},
|
|
6687
|
+
/**
|
|
6688
|
+
* Creates a copy of this word array.
|
|
6689
|
+
*
|
|
6690
|
+
* @return {X64WordArray} The clone.
|
|
6691
|
+
*
|
|
6692
|
+
* @example
|
|
6693
|
+
*
|
|
6694
|
+
* var clone = x64WordArray.clone();
|
|
6695
|
+
*/
|
|
6696
|
+
clone: function() {
|
|
6697
|
+
var clone = Base.clone.call(this);
|
|
6698
|
+
var words = clone.words = this.words.slice(0);
|
|
6699
|
+
var wordsLength = words.length;
|
|
6700
|
+
for (var i = 0; i < wordsLength; i++) {
|
|
6701
|
+
words[i] = words[i].clone();
|
|
6702
|
+
}
|
|
6703
|
+
return clone;
|
|
6704
|
+
}
|
|
6705
|
+
});
|
|
6706
|
+
})();
|
|
6707
|
+
return CryptoJS2;
|
|
6708
|
+
});
|
|
6709
|
+
})(x64Core);
|
|
6710
|
+
return x64Core.exports;
|
|
6711
|
+
}
|
|
6712
|
+
var libTypedarrays = { exports: {} };
|
|
6713
|
+
var hasRequiredLibTypedarrays;
|
|
6714
|
+
function requireLibTypedarrays() {
|
|
6715
|
+
if (hasRequiredLibTypedarrays)
|
|
6716
|
+
return libTypedarrays.exports;
|
|
6717
|
+
hasRequiredLibTypedarrays = 1;
|
|
6718
|
+
(function(module, exports) {
|
|
6719
|
+
(function(root, factory) {
|
|
6720
|
+
{
|
|
6721
|
+
module.exports = factory(requireCore());
|
|
6722
|
+
}
|
|
6723
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
6724
|
+
(function() {
|
|
6725
|
+
if (typeof ArrayBuffer != "function") {
|
|
6726
|
+
return;
|
|
6727
|
+
}
|
|
6728
|
+
var C = CryptoJS2;
|
|
6729
|
+
var C_lib = C.lib;
|
|
6730
|
+
var WordArray = C_lib.WordArray;
|
|
6731
|
+
var superInit = WordArray.init;
|
|
6732
|
+
var subInit = WordArray.init = function(typedArray) {
|
|
6733
|
+
if (typedArray instanceof ArrayBuffer) {
|
|
6734
|
+
typedArray = new Uint8Array(typedArray);
|
|
6735
|
+
}
|
|
6736
|
+
if (typedArray instanceof Int8Array || typeof Uint8ClampedArray !== "undefined" && typedArray instanceof Uint8ClampedArray || typedArray instanceof Int16Array || typedArray instanceof Uint16Array || typedArray instanceof Int32Array || typedArray instanceof Uint32Array || typedArray instanceof Float32Array || typedArray instanceof Float64Array) {
|
|
6737
|
+
typedArray = new Uint8Array(typedArray.buffer, typedArray.byteOffset, typedArray.byteLength);
|
|
6738
|
+
}
|
|
6739
|
+
if (typedArray instanceof Uint8Array) {
|
|
6740
|
+
var typedArrayByteLength = typedArray.byteLength;
|
|
6741
|
+
var words = [];
|
|
6742
|
+
for (var i = 0; i < typedArrayByteLength; i++) {
|
|
6743
|
+
words[i >>> 2] |= typedArray[i] << 24 - i % 4 * 8;
|
|
6744
|
+
}
|
|
6745
|
+
superInit.call(this, words, typedArrayByteLength);
|
|
6746
|
+
} else {
|
|
6747
|
+
superInit.apply(this, arguments);
|
|
6748
|
+
}
|
|
6749
|
+
};
|
|
6750
|
+
subInit.prototype = WordArray;
|
|
6751
|
+
})();
|
|
6752
|
+
return CryptoJS2.lib.WordArray;
|
|
6753
|
+
});
|
|
6754
|
+
})(libTypedarrays);
|
|
6755
|
+
return libTypedarrays.exports;
|
|
6756
|
+
}
|
|
6757
|
+
var encUtf16 = { exports: {} };
|
|
6758
|
+
var hasRequiredEncUtf16;
|
|
6759
|
+
function requireEncUtf16() {
|
|
6760
|
+
if (hasRequiredEncUtf16)
|
|
6761
|
+
return encUtf16.exports;
|
|
6762
|
+
hasRequiredEncUtf16 = 1;
|
|
6763
|
+
(function(module, exports) {
|
|
6764
|
+
(function(root, factory) {
|
|
6765
|
+
{
|
|
6766
|
+
module.exports = factory(requireCore());
|
|
6767
|
+
}
|
|
6768
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
6769
|
+
(function() {
|
|
6770
|
+
var C = CryptoJS2;
|
|
6771
|
+
var C_lib = C.lib;
|
|
6772
|
+
var WordArray = C_lib.WordArray;
|
|
6773
|
+
var C_enc = C.enc;
|
|
6774
|
+
C_enc.Utf16 = C_enc.Utf16BE = {
|
|
6775
|
+
/**
|
|
6776
|
+
* Converts a word array to a UTF-16 BE string.
|
|
6777
|
+
*
|
|
6778
|
+
* @param {WordArray} wordArray The word array.
|
|
6779
|
+
*
|
|
6780
|
+
* @return {string} The UTF-16 BE string.
|
|
6781
|
+
*
|
|
6782
|
+
* @static
|
|
6783
|
+
*
|
|
6784
|
+
* @example
|
|
6785
|
+
*
|
|
6786
|
+
* var utf16String = CryptoJS.enc.Utf16.stringify(wordArray);
|
|
6787
|
+
*/
|
|
6788
|
+
stringify: function(wordArray) {
|
|
6789
|
+
var words = wordArray.words;
|
|
6790
|
+
var sigBytes = wordArray.sigBytes;
|
|
6791
|
+
var utf16Chars = [];
|
|
6792
|
+
for (var i = 0; i < sigBytes; i += 2) {
|
|
6793
|
+
var codePoint = words[i >>> 2] >>> 16 - i % 4 * 8 & 65535;
|
|
6794
|
+
utf16Chars.push(String.fromCharCode(codePoint));
|
|
6795
|
+
}
|
|
6796
|
+
return utf16Chars.join("");
|
|
6797
|
+
},
|
|
6798
|
+
/**
|
|
6799
|
+
* Converts a UTF-16 BE string to a word array.
|
|
6800
|
+
*
|
|
6801
|
+
* @param {string} utf16Str The UTF-16 BE string.
|
|
6802
|
+
*
|
|
6803
|
+
* @return {WordArray} The word array.
|
|
6804
|
+
*
|
|
6805
|
+
* @static
|
|
6806
|
+
*
|
|
6807
|
+
* @example
|
|
6808
|
+
*
|
|
6809
|
+
* var wordArray = CryptoJS.enc.Utf16.parse(utf16String);
|
|
6810
|
+
*/
|
|
6811
|
+
parse: function(utf16Str) {
|
|
6812
|
+
var utf16StrLength = utf16Str.length;
|
|
6813
|
+
var words = [];
|
|
6814
|
+
for (var i = 0; i < utf16StrLength; i++) {
|
|
6815
|
+
words[i >>> 1] |= utf16Str.charCodeAt(i) << 16 - i % 2 * 16;
|
|
6816
|
+
}
|
|
6817
|
+
return WordArray.create(words, utf16StrLength * 2);
|
|
6818
|
+
}
|
|
6819
|
+
};
|
|
6820
|
+
C_enc.Utf16LE = {
|
|
6821
|
+
/**
|
|
6822
|
+
* Converts a word array to a UTF-16 LE string.
|
|
6823
|
+
*
|
|
6824
|
+
* @param {WordArray} wordArray The word array.
|
|
6825
|
+
*
|
|
6826
|
+
* @return {string} The UTF-16 LE string.
|
|
6827
|
+
*
|
|
6828
|
+
* @static
|
|
6829
|
+
*
|
|
6830
|
+
* @example
|
|
6831
|
+
*
|
|
6832
|
+
* var utf16Str = CryptoJS.enc.Utf16LE.stringify(wordArray);
|
|
6833
|
+
*/
|
|
6834
|
+
stringify: function(wordArray) {
|
|
6835
|
+
var words = wordArray.words;
|
|
6836
|
+
var sigBytes = wordArray.sigBytes;
|
|
6837
|
+
var utf16Chars = [];
|
|
6838
|
+
for (var i = 0; i < sigBytes; i += 2) {
|
|
6839
|
+
var codePoint = swapEndian(words[i >>> 2] >>> 16 - i % 4 * 8 & 65535);
|
|
6840
|
+
utf16Chars.push(String.fromCharCode(codePoint));
|
|
6841
|
+
}
|
|
6842
|
+
return utf16Chars.join("");
|
|
6843
|
+
},
|
|
6844
|
+
/**
|
|
6845
|
+
* Converts a UTF-16 LE string to a word array.
|
|
6846
|
+
*
|
|
6847
|
+
* @param {string} utf16Str The UTF-16 LE string.
|
|
6848
|
+
*
|
|
6849
|
+
* @return {WordArray} The word array.
|
|
6850
|
+
*
|
|
6851
|
+
* @static
|
|
6852
|
+
*
|
|
6853
|
+
* @example
|
|
6854
|
+
*
|
|
6855
|
+
* var wordArray = CryptoJS.enc.Utf16LE.parse(utf16Str);
|
|
6856
|
+
*/
|
|
6857
|
+
parse: function(utf16Str) {
|
|
6858
|
+
var utf16StrLength = utf16Str.length;
|
|
6859
|
+
var words = [];
|
|
6860
|
+
for (var i = 0; i < utf16StrLength; i++) {
|
|
6861
|
+
words[i >>> 1] |= swapEndian(utf16Str.charCodeAt(i) << 16 - i % 2 * 16);
|
|
6862
|
+
}
|
|
6863
|
+
return WordArray.create(words, utf16StrLength * 2);
|
|
6864
|
+
}
|
|
6865
|
+
};
|
|
6866
|
+
function swapEndian(word) {
|
|
6867
|
+
return word << 8 & 4278255360 | word >>> 8 & 16711935;
|
|
6868
|
+
}
|
|
6869
|
+
})();
|
|
6870
|
+
return CryptoJS2.enc.Utf16;
|
|
6871
|
+
});
|
|
6872
|
+
})(encUtf16);
|
|
6873
|
+
return encUtf16.exports;
|
|
6874
|
+
}
|
|
6875
|
+
var encBase64url = { exports: {} };
|
|
6876
|
+
var hasRequiredEncBase64url;
|
|
6877
|
+
function requireEncBase64url() {
|
|
6878
|
+
if (hasRequiredEncBase64url)
|
|
6879
|
+
return encBase64url.exports;
|
|
6880
|
+
hasRequiredEncBase64url = 1;
|
|
6881
|
+
(function(module, exports) {
|
|
6882
|
+
(function(root, factory) {
|
|
6883
|
+
{
|
|
6884
|
+
module.exports = factory(requireCore());
|
|
6885
|
+
}
|
|
6886
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
6887
|
+
(function() {
|
|
6888
|
+
var C = CryptoJS2;
|
|
6889
|
+
var C_lib = C.lib;
|
|
6890
|
+
var WordArray = C_lib.WordArray;
|
|
6891
|
+
var C_enc = C.enc;
|
|
6892
|
+
C_enc.Base64url = {
|
|
6893
|
+
/**
|
|
6894
|
+
* Converts a word array to a Base64url string.
|
|
6895
|
+
*
|
|
6896
|
+
* @param {WordArray} wordArray The word array.
|
|
6897
|
+
*
|
|
6898
|
+
* @param {boolean} urlSafe Whether to use url safe
|
|
6899
|
+
*
|
|
6900
|
+
* @return {string} The Base64url string.
|
|
6901
|
+
*
|
|
6902
|
+
* @static
|
|
6903
|
+
*
|
|
6904
|
+
* @example
|
|
6905
|
+
*
|
|
6906
|
+
* var base64String = CryptoJS.enc.Base64url.stringify(wordArray);
|
|
6907
|
+
*/
|
|
6908
|
+
stringify: function(wordArray, urlSafe = true) {
|
|
6909
|
+
var words = wordArray.words;
|
|
6910
|
+
var sigBytes = wordArray.sigBytes;
|
|
6911
|
+
var map = urlSafe ? this._safe_map : this._map;
|
|
6912
|
+
wordArray.clamp();
|
|
6913
|
+
var base64Chars = [];
|
|
6914
|
+
for (var i = 0; i < sigBytes; i += 3) {
|
|
6915
|
+
var byte1 = words[i >>> 2] >>> 24 - i % 4 * 8 & 255;
|
|
6916
|
+
var byte2 = words[i + 1 >>> 2] >>> 24 - (i + 1) % 4 * 8 & 255;
|
|
6917
|
+
var byte3 = words[i + 2 >>> 2] >>> 24 - (i + 2) % 4 * 8 & 255;
|
|
6918
|
+
var triplet = byte1 << 16 | byte2 << 8 | byte3;
|
|
6919
|
+
for (var j = 0; j < 4 && i + j * 0.75 < sigBytes; j++) {
|
|
6920
|
+
base64Chars.push(map.charAt(triplet >>> 6 * (3 - j) & 63));
|
|
6921
|
+
}
|
|
6922
|
+
}
|
|
6923
|
+
var paddingChar = map.charAt(64);
|
|
6924
|
+
if (paddingChar) {
|
|
6925
|
+
while (base64Chars.length % 4) {
|
|
6926
|
+
base64Chars.push(paddingChar);
|
|
6927
|
+
}
|
|
6928
|
+
}
|
|
6929
|
+
return base64Chars.join("");
|
|
6930
|
+
},
|
|
6931
|
+
/**
|
|
6932
|
+
* Converts a Base64url string to a word array.
|
|
6933
|
+
*
|
|
6934
|
+
* @param {string} base64Str The Base64url string.
|
|
6935
|
+
*
|
|
6936
|
+
* @param {boolean} urlSafe Whether to use url safe
|
|
6937
|
+
*
|
|
6938
|
+
* @return {WordArray} The word array.
|
|
6939
|
+
*
|
|
6940
|
+
* @static
|
|
6941
|
+
*
|
|
6942
|
+
* @example
|
|
6943
|
+
*
|
|
6944
|
+
* var wordArray = CryptoJS.enc.Base64url.parse(base64String);
|
|
6945
|
+
*/
|
|
6946
|
+
parse: function(base64Str, urlSafe = true) {
|
|
6947
|
+
var base64StrLength = base64Str.length;
|
|
6948
|
+
var map = urlSafe ? this._safe_map : this._map;
|
|
6949
|
+
var reverseMap = this._reverseMap;
|
|
6950
|
+
if (!reverseMap) {
|
|
6951
|
+
reverseMap = this._reverseMap = [];
|
|
6952
|
+
for (var j = 0; j < map.length; j++) {
|
|
6953
|
+
reverseMap[map.charCodeAt(j)] = j;
|
|
6954
|
+
}
|
|
6955
|
+
}
|
|
6956
|
+
var paddingChar = map.charAt(64);
|
|
6957
|
+
if (paddingChar) {
|
|
6958
|
+
var paddingIndex = base64Str.indexOf(paddingChar);
|
|
6959
|
+
if (paddingIndex !== -1) {
|
|
6960
|
+
base64StrLength = paddingIndex;
|
|
6961
|
+
}
|
|
6962
|
+
}
|
|
6963
|
+
return parseLoop(base64Str, base64StrLength, reverseMap);
|
|
6964
|
+
},
|
|
6965
|
+
_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",
|
|
6966
|
+
_safe_map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"
|
|
6967
|
+
};
|
|
6968
|
+
function parseLoop(base64Str, base64StrLength, reverseMap) {
|
|
6969
|
+
var words = [];
|
|
6970
|
+
var nBytes = 0;
|
|
6971
|
+
for (var i = 0; i < base64StrLength; i++) {
|
|
6972
|
+
if (i % 4) {
|
|
6973
|
+
var bits1 = reverseMap[base64Str.charCodeAt(i - 1)] << i % 4 * 2;
|
|
6974
|
+
var bits2 = reverseMap[base64Str.charCodeAt(i)] >>> 6 - i % 4 * 2;
|
|
6975
|
+
var bitsCombined = bits1 | bits2;
|
|
6976
|
+
words[nBytes >>> 2] |= bitsCombined << 24 - nBytes % 4 * 8;
|
|
6977
|
+
nBytes++;
|
|
6978
|
+
}
|
|
6979
|
+
}
|
|
6980
|
+
return WordArray.create(words, nBytes);
|
|
6981
|
+
}
|
|
6982
|
+
})();
|
|
6983
|
+
return CryptoJS2.enc.Base64url;
|
|
6984
|
+
});
|
|
6985
|
+
})(encBase64url);
|
|
6986
|
+
return encBase64url.exports;
|
|
6987
|
+
}
|
|
6988
|
+
var sha256 = { exports: {} };
|
|
6989
|
+
var hasRequiredSha256;
|
|
6990
|
+
function requireSha256() {
|
|
6991
|
+
if (hasRequiredSha256)
|
|
6992
|
+
return sha256.exports;
|
|
6993
|
+
hasRequiredSha256 = 1;
|
|
6994
|
+
(function(module, exports) {
|
|
6995
|
+
(function(root, factory) {
|
|
6996
|
+
{
|
|
6997
|
+
module.exports = factory(requireCore());
|
|
6998
|
+
}
|
|
6999
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7000
|
+
(function(Math2) {
|
|
7001
|
+
var C = CryptoJS2;
|
|
7002
|
+
var C_lib = C.lib;
|
|
7003
|
+
var WordArray = C_lib.WordArray;
|
|
7004
|
+
var Hasher = C_lib.Hasher;
|
|
7005
|
+
var C_algo = C.algo;
|
|
7006
|
+
var H = [];
|
|
7007
|
+
var K = [];
|
|
7008
|
+
(function() {
|
|
7009
|
+
function isPrime(n2) {
|
|
7010
|
+
var sqrtN = Math2.sqrt(n2);
|
|
7011
|
+
for (var factor = 2; factor <= sqrtN; factor++) {
|
|
7012
|
+
if (!(n2 % factor)) {
|
|
7013
|
+
return false;
|
|
7014
|
+
}
|
|
7015
|
+
}
|
|
7016
|
+
return true;
|
|
7017
|
+
}
|
|
7018
|
+
function getFractionalBits(n2) {
|
|
7019
|
+
return (n2 - (n2 | 0)) * 4294967296 | 0;
|
|
7020
|
+
}
|
|
7021
|
+
var n = 2;
|
|
7022
|
+
var nPrime = 0;
|
|
7023
|
+
while (nPrime < 64) {
|
|
7024
|
+
if (isPrime(n)) {
|
|
7025
|
+
if (nPrime < 8) {
|
|
7026
|
+
H[nPrime] = getFractionalBits(Math2.pow(n, 1 / 2));
|
|
7027
|
+
}
|
|
7028
|
+
K[nPrime] = getFractionalBits(Math2.pow(n, 1 / 3));
|
|
7029
|
+
nPrime++;
|
|
7030
|
+
}
|
|
7031
|
+
n++;
|
|
7032
|
+
}
|
|
7033
|
+
})();
|
|
7034
|
+
var W = [];
|
|
7035
|
+
var SHA256 = C_algo.SHA256 = Hasher.extend({
|
|
7036
|
+
_doReset: function() {
|
|
7037
|
+
this._hash = new WordArray.init(H.slice(0));
|
|
7038
|
+
},
|
|
7039
|
+
_doProcessBlock: function(M, offset) {
|
|
7040
|
+
var H2 = this._hash.words;
|
|
7041
|
+
var a = H2[0];
|
|
7042
|
+
var b = H2[1];
|
|
7043
|
+
var c = H2[2];
|
|
7044
|
+
var d = H2[3];
|
|
7045
|
+
var e = H2[4];
|
|
7046
|
+
var f = H2[5];
|
|
7047
|
+
var g = H2[6];
|
|
7048
|
+
var h = H2[7];
|
|
7049
|
+
for (var i = 0; i < 64; i++) {
|
|
7050
|
+
if (i < 16) {
|
|
7051
|
+
W[i] = M[offset + i] | 0;
|
|
7052
|
+
} else {
|
|
7053
|
+
var gamma0x = W[i - 15];
|
|
7054
|
+
var gamma0 = (gamma0x << 25 | gamma0x >>> 7) ^ (gamma0x << 14 | gamma0x >>> 18) ^ gamma0x >>> 3;
|
|
7055
|
+
var gamma1x = W[i - 2];
|
|
7056
|
+
var gamma1 = (gamma1x << 15 | gamma1x >>> 17) ^ (gamma1x << 13 | gamma1x >>> 19) ^ gamma1x >>> 10;
|
|
7057
|
+
W[i] = gamma0 + W[i - 7] + gamma1 + W[i - 16];
|
|
7058
|
+
}
|
|
7059
|
+
var ch = e & f ^ ~e & g;
|
|
7060
|
+
var maj = a & b ^ a & c ^ b & c;
|
|
7061
|
+
var sigma0 = (a << 30 | a >>> 2) ^ (a << 19 | a >>> 13) ^ (a << 10 | a >>> 22);
|
|
7062
|
+
var sigma1 = (e << 26 | e >>> 6) ^ (e << 21 | e >>> 11) ^ (e << 7 | e >>> 25);
|
|
7063
|
+
var t1 = h + sigma1 + ch + K[i] + W[i];
|
|
7064
|
+
var t2 = sigma0 + maj;
|
|
7065
|
+
h = g;
|
|
7066
|
+
g = f;
|
|
7067
|
+
f = e;
|
|
7068
|
+
e = d + t1 | 0;
|
|
7069
|
+
d = c;
|
|
7070
|
+
c = b;
|
|
7071
|
+
b = a;
|
|
7072
|
+
a = t1 + t2 | 0;
|
|
7073
|
+
}
|
|
7074
|
+
H2[0] = H2[0] + a | 0;
|
|
7075
|
+
H2[1] = H2[1] + b | 0;
|
|
7076
|
+
H2[2] = H2[2] + c | 0;
|
|
7077
|
+
H2[3] = H2[3] + d | 0;
|
|
7078
|
+
H2[4] = H2[4] + e | 0;
|
|
7079
|
+
H2[5] = H2[5] + f | 0;
|
|
7080
|
+
H2[6] = H2[6] + g | 0;
|
|
7081
|
+
H2[7] = H2[7] + h | 0;
|
|
7082
|
+
},
|
|
7083
|
+
_doFinalize: function() {
|
|
7084
|
+
var data2 = this._data;
|
|
7085
|
+
var dataWords = data2.words;
|
|
7086
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
7087
|
+
var nBitsLeft = data2.sigBytes * 8;
|
|
7088
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
7089
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = Math2.floor(nBitsTotal / 4294967296);
|
|
7090
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 15] = nBitsTotal;
|
|
7091
|
+
data2.sigBytes = dataWords.length * 4;
|
|
7092
|
+
this._process();
|
|
7093
|
+
return this._hash;
|
|
7094
|
+
},
|
|
7095
|
+
clone: function() {
|
|
7096
|
+
var clone = Hasher.clone.call(this);
|
|
7097
|
+
clone._hash = this._hash.clone();
|
|
7098
|
+
return clone;
|
|
7099
|
+
}
|
|
7100
|
+
});
|
|
7101
|
+
C.SHA256 = Hasher._createHelper(SHA256);
|
|
7102
|
+
C.HmacSHA256 = Hasher._createHmacHelper(SHA256);
|
|
7103
|
+
})(Math);
|
|
7104
|
+
return CryptoJS2.SHA256;
|
|
7105
|
+
});
|
|
7106
|
+
})(sha256);
|
|
7107
|
+
return sha256.exports;
|
|
7108
|
+
}
|
|
7109
|
+
var sha224 = { exports: {} };
|
|
7110
|
+
var hasRequiredSha224;
|
|
7111
|
+
function requireSha224() {
|
|
7112
|
+
if (hasRequiredSha224)
|
|
7113
|
+
return sha224.exports;
|
|
7114
|
+
hasRequiredSha224 = 1;
|
|
7115
|
+
(function(module, exports) {
|
|
7116
|
+
(function(root, factory, undef) {
|
|
7117
|
+
{
|
|
7118
|
+
module.exports = factory(requireCore(), requireSha256());
|
|
7119
|
+
}
|
|
7120
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7121
|
+
(function() {
|
|
7122
|
+
var C = CryptoJS2;
|
|
7123
|
+
var C_lib = C.lib;
|
|
7124
|
+
var WordArray = C_lib.WordArray;
|
|
7125
|
+
var C_algo = C.algo;
|
|
7126
|
+
var SHA256 = C_algo.SHA256;
|
|
7127
|
+
var SHA224 = C_algo.SHA224 = SHA256.extend({
|
|
7128
|
+
_doReset: function() {
|
|
7129
|
+
this._hash = new WordArray.init([
|
|
7130
|
+
3238371032,
|
|
7131
|
+
914150663,
|
|
7132
|
+
812702999,
|
|
7133
|
+
4144912697,
|
|
7134
|
+
4290775857,
|
|
7135
|
+
1750603025,
|
|
7136
|
+
1694076839,
|
|
7137
|
+
3204075428
|
|
7138
|
+
]);
|
|
7139
|
+
},
|
|
7140
|
+
_doFinalize: function() {
|
|
7141
|
+
var hash = SHA256._doFinalize.call(this);
|
|
7142
|
+
hash.sigBytes -= 4;
|
|
7143
|
+
return hash;
|
|
7144
|
+
}
|
|
7145
|
+
});
|
|
7146
|
+
C.SHA224 = SHA256._createHelper(SHA224);
|
|
7147
|
+
C.HmacSHA224 = SHA256._createHmacHelper(SHA224);
|
|
7148
|
+
})();
|
|
7149
|
+
return CryptoJS2.SHA224;
|
|
7150
|
+
});
|
|
7151
|
+
})(sha224);
|
|
7152
|
+
return sha224.exports;
|
|
7153
|
+
}
|
|
7154
|
+
var sha512 = { exports: {} };
|
|
7155
|
+
var hasRequiredSha512;
|
|
7156
|
+
function requireSha512() {
|
|
7157
|
+
if (hasRequiredSha512)
|
|
7158
|
+
return sha512.exports;
|
|
7159
|
+
hasRequiredSha512 = 1;
|
|
7160
|
+
(function(module, exports) {
|
|
7161
|
+
(function(root, factory, undef) {
|
|
7162
|
+
{
|
|
7163
|
+
module.exports = factory(requireCore(), requireX64Core());
|
|
7164
|
+
}
|
|
7165
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7166
|
+
(function() {
|
|
7167
|
+
var C = CryptoJS2;
|
|
7168
|
+
var C_lib = C.lib;
|
|
7169
|
+
var Hasher = C_lib.Hasher;
|
|
7170
|
+
var C_x64 = C.x64;
|
|
7171
|
+
var X64Word = C_x64.Word;
|
|
7172
|
+
var X64WordArray = C_x64.WordArray;
|
|
7173
|
+
var C_algo = C.algo;
|
|
7174
|
+
function X64Word_create() {
|
|
7175
|
+
return X64Word.create.apply(X64Word, arguments);
|
|
7176
|
+
}
|
|
7177
|
+
var K = [
|
|
7178
|
+
X64Word_create(1116352408, 3609767458),
|
|
7179
|
+
X64Word_create(1899447441, 602891725),
|
|
7180
|
+
X64Word_create(3049323471, 3964484399),
|
|
7181
|
+
X64Word_create(3921009573, 2173295548),
|
|
7182
|
+
X64Word_create(961987163, 4081628472),
|
|
7183
|
+
X64Word_create(1508970993, 3053834265),
|
|
7184
|
+
X64Word_create(2453635748, 2937671579),
|
|
7185
|
+
X64Word_create(2870763221, 3664609560),
|
|
7186
|
+
X64Word_create(3624381080, 2734883394),
|
|
7187
|
+
X64Word_create(310598401, 1164996542),
|
|
7188
|
+
X64Word_create(607225278, 1323610764),
|
|
7189
|
+
X64Word_create(1426881987, 3590304994),
|
|
7190
|
+
X64Word_create(1925078388, 4068182383),
|
|
7191
|
+
X64Word_create(2162078206, 991336113),
|
|
7192
|
+
X64Word_create(2614888103, 633803317),
|
|
7193
|
+
X64Word_create(3248222580, 3479774868),
|
|
7194
|
+
X64Word_create(3835390401, 2666613458),
|
|
7195
|
+
X64Word_create(4022224774, 944711139),
|
|
7196
|
+
X64Word_create(264347078, 2341262773),
|
|
7197
|
+
X64Word_create(604807628, 2007800933),
|
|
7198
|
+
X64Word_create(770255983, 1495990901),
|
|
7199
|
+
X64Word_create(1249150122, 1856431235),
|
|
7200
|
+
X64Word_create(1555081692, 3175218132),
|
|
7201
|
+
X64Word_create(1996064986, 2198950837),
|
|
7202
|
+
X64Word_create(2554220882, 3999719339),
|
|
7203
|
+
X64Word_create(2821834349, 766784016),
|
|
7204
|
+
X64Word_create(2952996808, 2566594879),
|
|
7205
|
+
X64Word_create(3210313671, 3203337956),
|
|
7206
|
+
X64Word_create(3336571891, 1034457026),
|
|
7207
|
+
X64Word_create(3584528711, 2466948901),
|
|
7208
|
+
X64Word_create(113926993, 3758326383),
|
|
7209
|
+
X64Word_create(338241895, 168717936),
|
|
7210
|
+
X64Word_create(666307205, 1188179964),
|
|
7211
|
+
X64Word_create(773529912, 1546045734),
|
|
7212
|
+
X64Word_create(1294757372, 1522805485),
|
|
7213
|
+
X64Word_create(1396182291, 2643833823),
|
|
7214
|
+
X64Word_create(1695183700, 2343527390),
|
|
7215
|
+
X64Word_create(1986661051, 1014477480),
|
|
7216
|
+
X64Word_create(2177026350, 1206759142),
|
|
7217
|
+
X64Word_create(2456956037, 344077627),
|
|
7218
|
+
X64Word_create(2730485921, 1290863460),
|
|
7219
|
+
X64Word_create(2820302411, 3158454273),
|
|
7220
|
+
X64Word_create(3259730800, 3505952657),
|
|
7221
|
+
X64Word_create(3345764771, 106217008),
|
|
7222
|
+
X64Word_create(3516065817, 3606008344),
|
|
7223
|
+
X64Word_create(3600352804, 1432725776),
|
|
7224
|
+
X64Word_create(4094571909, 1467031594),
|
|
7225
|
+
X64Word_create(275423344, 851169720),
|
|
7226
|
+
X64Word_create(430227734, 3100823752),
|
|
7227
|
+
X64Word_create(506948616, 1363258195),
|
|
7228
|
+
X64Word_create(659060556, 3750685593),
|
|
7229
|
+
X64Word_create(883997877, 3785050280),
|
|
7230
|
+
X64Word_create(958139571, 3318307427),
|
|
7231
|
+
X64Word_create(1322822218, 3812723403),
|
|
7232
|
+
X64Word_create(1537002063, 2003034995),
|
|
7233
|
+
X64Word_create(1747873779, 3602036899),
|
|
7234
|
+
X64Word_create(1955562222, 1575990012),
|
|
7235
|
+
X64Word_create(2024104815, 1125592928),
|
|
7236
|
+
X64Word_create(2227730452, 2716904306),
|
|
7237
|
+
X64Word_create(2361852424, 442776044),
|
|
7238
|
+
X64Word_create(2428436474, 593698344),
|
|
7239
|
+
X64Word_create(2756734187, 3733110249),
|
|
7240
|
+
X64Word_create(3204031479, 2999351573),
|
|
7241
|
+
X64Word_create(3329325298, 3815920427),
|
|
7242
|
+
X64Word_create(3391569614, 3928383900),
|
|
7243
|
+
X64Word_create(3515267271, 566280711),
|
|
7244
|
+
X64Word_create(3940187606, 3454069534),
|
|
7245
|
+
X64Word_create(4118630271, 4000239992),
|
|
7246
|
+
X64Word_create(116418474, 1914138554),
|
|
7247
|
+
X64Word_create(174292421, 2731055270),
|
|
7248
|
+
X64Word_create(289380356, 3203993006),
|
|
7249
|
+
X64Word_create(460393269, 320620315),
|
|
7250
|
+
X64Word_create(685471733, 587496836),
|
|
7251
|
+
X64Word_create(852142971, 1086792851),
|
|
7252
|
+
X64Word_create(1017036298, 365543100),
|
|
7253
|
+
X64Word_create(1126000580, 2618297676),
|
|
7254
|
+
X64Word_create(1288033470, 3409855158),
|
|
7255
|
+
X64Word_create(1501505948, 4234509866),
|
|
7256
|
+
X64Word_create(1607167915, 987167468),
|
|
7257
|
+
X64Word_create(1816402316, 1246189591)
|
|
7258
|
+
];
|
|
7259
|
+
var W = [];
|
|
7260
|
+
(function() {
|
|
7261
|
+
for (var i = 0; i < 80; i++) {
|
|
7262
|
+
W[i] = X64Word_create();
|
|
7263
|
+
}
|
|
7264
|
+
})();
|
|
7265
|
+
var SHA512 = C_algo.SHA512 = Hasher.extend({
|
|
7266
|
+
_doReset: function() {
|
|
7267
|
+
this._hash = new X64WordArray.init([
|
|
7268
|
+
new X64Word.init(1779033703, 4089235720),
|
|
7269
|
+
new X64Word.init(3144134277, 2227873595),
|
|
7270
|
+
new X64Word.init(1013904242, 4271175723),
|
|
7271
|
+
new X64Word.init(2773480762, 1595750129),
|
|
7272
|
+
new X64Word.init(1359893119, 2917565137),
|
|
7273
|
+
new X64Word.init(2600822924, 725511199),
|
|
7274
|
+
new X64Word.init(528734635, 4215389547),
|
|
7275
|
+
new X64Word.init(1541459225, 327033209)
|
|
7276
|
+
]);
|
|
7277
|
+
},
|
|
7278
|
+
_doProcessBlock: function(M, offset) {
|
|
7279
|
+
var H = this._hash.words;
|
|
7280
|
+
var H0 = H[0];
|
|
7281
|
+
var H1 = H[1];
|
|
7282
|
+
var H2 = H[2];
|
|
7283
|
+
var H3 = H[3];
|
|
7284
|
+
var H4 = H[4];
|
|
7285
|
+
var H5 = H[5];
|
|
7286
|
+
var H6 = H[6];
|
|
7287
|
+
var H7 = H[7];
|
|
7288
|
+
var H0h = H0.high;
|
|
7289
|
+
var H0l = H0.low;
|
|
7290
|
+
var H1h = H1.high;
|
|
7291
|
+
var H1l = H1.low;
|
|
7292
|
+
var H2h = H2.high;
|
|
7293
|
+
var H2l = H2.low;
|
|
7294
|
+
var H3h = H3.high;
|
|
7295
|
+
var H3l = H3.low;
|
|
7296
|
+
var H4h = H4.high;
|
|
7297
|
+
var H4l = H4.low;
|
|
7298
|
+
var H5h = H5.high;
|
|
7299
|
+
var H5l = H5.low;
|
|
7300
|
+
var H6h = H6.high;
|
|
7301
|
+
var H6l = H6.low;
|
|
7302
|
+
var H7h = H7.high;
|
|
7303
|
+
var H7l = H7.low;
|
|
7304
|
+
var ah = H0h;
|
|
7305
|
+
var al = H0l;
|
|
7306
|
+
var bh = H1h;
|
|
7307
|
+
var bl = H1l;
|
|
7308
|
+
var ch = H2h;
|
|
7309
|
+
var cl = H2l;
|
|
7310
|
+
var dh = H3h;
|
|
7311
|
+
var dl = H3l;
|
|
7312
|
+
var eh = H4h;
|
|
7313
|
+
var el = H4l;
|
|
7314
|
+
var fh = H5h;
|
|
7315
|
+
var fl = H5l;
|
|
7316
|
+
var gh = H6h;
|
|
7317
|
+
var gl = H6l;
|
|
7318
|
+
var hh = H7h;
|
|
7319
|
+
var hl = H7l;
|
|
7320
|
+
for (var i = 0; i < 80; i++) {
|
|
7321
|
+
var Wil;
|
|
7322
|
+
var Wih;
|
|
7323
|
+
var Wi = W[i];
|
|
7324
|
+
if (i < 16) {
|
|
7325
|
+
Wih = Wi.high = M[offset + i * 2] | 0;
|
|
7326
|
+
Wil = Wi.low = M[offset + i * 2 + 1] | 0;
|
|
7327
|
+
} else {
|
|
7328
|
+
var gamma0x = W[i - 15];
|
|
7329
|
+
var gamma0xh = gamma0x.high;
|
|
7330
|
+
var gamma0xl = gamma0x.low;
|
|
7331
|
+
var gamma0h = (gamma0xh >>> 1 | gamma0xl << 31) ^ (gamma0xh >>> 8 | gamma0xl << 24) ^ gamma0xh >>> 7;
|
|
7332
|
+
var gamma0l = (gamma0xl >>> 1 | gamma0xh << 31) ^ (gamma0xl >>> 8 | gamma0xh << 24) ^ (gamma0xl >>> 7 | gamma0xh << 25);
|
|
7333
|
+
var gamma1x = W[i - 2];
|
|
7334
|
+
var gamma1xh = gamma1x.high;
|
|
7335
|
+
var gamma1xl = gamma1x.low;
|
|
7336
|
+
var gamma1h = (gamma1xh >>> 19 | gamma1xl << 13) ^ (gamma1xh << 3 | gamma1xl >>> 29) ^ gamma1xh >>> 6;
|
|
7337
|
+
var gamma1l = (gamma1xl >>> 19 | gamma1xh << 13) ^ (gamma1xl << 3 | gamma1xh >>> 29) ^ (gamma1xl >>> 6 | gamma1xh << 26);
|
|
7338
|
+
var Wi7 = W[i - 7];
|
|
7339
|
+
var Wi7h = Wi7.high;
|
|
7340
|
+
var Wi7l = Wi7.low;
|
|
7341
|
+
var Wi16 = W[i - 16];
|
|
7342
|
+
var Wi16h = Wi16.high;
|
|
7343
|
+
var Wi16l = Wi16.low;
|
|
7344
|
+
Wil = gamma0l + Wi7l;
|
|
7345
|
+
Wih = gamma0h + Wi7h + (Wil >>> 0 < gamma0l >>> 0 ? 1 : 0);
|
|
7346
|
+
Wil = Wil + gamma1l;
|
|
7347
|
+
Wih = Wih + gamma1h + (Wil >>> 0 < gamma1l >>> 0 ? 1 : 0);
|
|
7348
|
+
Wil = Wil + Wi16l;
|
|
7349
|
+
Wih = Wih + Wi16h + (Wil >>> 0 < Wi16l >>> 0 ? 1 : 0);
|
|
7350
|
+
Wi.high = Wih;
|
|
7351
|
+
Wi.low = Wil;
|
|
7352
|
+
}
|
|
7353
|
+
var chh = eh & fh ^ ~eh & gh;
|
|
7354
|
+
var chl = el & fl ^ ~el & gl;
|
|
7355
|
+
var majh = ah & bh ^ ah & ch ^ bh & ch;
|
|
7356
|
+
var majl = al & bl ^ al & cl ^ bl & cl;
|
|
7357
|
+
var sigma0h = (ah >>> 28 | al << 4) ^ (ah << 30 | al >>> 2) ^ (ah << 25 | al >>> 7);
|
|
7358
|
+
var sigma0l = (al >>> 28 | ah << 4) ^ (al << 30 | ah >>> 2) ^ (al << 25 | ah >>> 7);
|
|
7359
|
+
var sigma1h = (eh >>> 14 | el << 18) ^ (eh >>> 18 | el << 14) ^ (eh << 23 | el >>> 9);
|
|
7360
|
+
var sigma1l = (el >>> 14 | eh << 18) ^ (el >>> 18 | eh << 14) ^ (el << 23 | eh >>> 9);
|
|
7361
|
+
var Ki = K[i];
|
|
7362
|
+
var Kih = Ki.high;
|
|
7363
|
+
var Kil = Ki.low;
|
|
7364
|
+
var t1l = hl + sigma1l;
|
|
7365
|
+
var t1h = hh + sigma1h + (t1l >>> 0 < hl >>> 0 ? 1 : 0);
|
|
7366
|
+
var t1l = t1l + chl;
|
|
7367
|
+
var t1h = t1h + chh + (t1l >>> 0 < chl >>> 0 ? 1 : 0);
|
|
7368
|
+
var t1l = t1l + Kil;
|
|
7369
|
+
var t1h = t1h + Kih + (t1l >>> 0 < Kil >>> 0 ? 1 : 0);
|
|
7370
|
+
var t1l = t1l + Wil;
|
|
7371
|
+
var t1h = t1h + Wih + (t1l >>> 0 < Wil >>> 0 ? 1 : 0);
|
|
7372
|
+
var t2l = sigma0l + majl;
|
|
7373
|
+
var t2h = sigma0h + majh + (t2l >>> 0 < sigma0l >>> 0 ? 1 : 0);
|
|
7374
|
+
hh = gh;
|
|
7375
|
+
hl = gl;
|
|
7376
|
+
gh = fh;
|
|
7377
|
+
gl = fl;
|
|
7378
|
+
fh = eh;
|
|
7379
|
+
fl = el;
|
|
7380
|
+
el = dl + t1l | 0;
|
|
7381
|
+
eh = dh + t1h + (el >>> 0 < dl >>> 0 ? 1 : 0) | 0;
|
|
7382
|
+
dh = ch;
|
|
7383
|
+
dl = cl;
|
|
7384
|
+
ch = bh;
|
|
7385
|
+
cl = bl;
|
|
7386
|
+
bh = ah;
|
|
7387
|
+
bl = al;
|
|
7388
|
+
al = t1l + t2l | 0;
|
|
7389
|
+
ah = t1h + t2h + (al >>> 0 < t1l >>> 0 ? 1 : 0) | 0;
|
|
7390
|
+
}
|
|
7391
|
+
H0l = H0.low = H0l + al;
|
|
7392
|
+
H0.high = H0h + ah + (H0l >>> 0 < al >>> 0 ? 1 : 0);
|
|
7393
|
+
H1l = H1.low = H1l + bl;
|
|
7394
|
+
H1.high = H1h + bh + (H1l >>> 0 < bl >>> 0 ? 1 : 0);
|
|
7395
|
+
H2l = H2.low = H2l + cl;
|
|
7396
|
+
H2.high = H2h + ch + (H2l >>> 0 < cl >>> 0 ? 1 : 0);
|
|
7397
|
+
H3l = H3.low = H3l + dl;
|
|
7398
|
+
H3.high = H3h + dh + (H3l >>> 0 < dl >>> 0 ? 1 : 0);
|
|
7399
|
+
H4l = H4.low = H4l + el;
|
|
7400
|
+
H4.high = H4h + eh + (H4l >>> 0 < el >>> 0 ? 1 : 0);
|
|
7401
|
+
H5l = H5.low = H5l + fl;
|
|
7402
|
+
H5.high = H5h + fh + (H5l >>> 0 < fl >>> 0 ? 1 : 0);
|
|
7403
|
+
H6l = H6.low = H6l + gl;
|
|
7404
|
+
H6.high = H6h + gh + (H6l >>> 0 < gl >>> 0 ? 1 : 0);
|
|
7405
|
+
H7l = H7.low = H7l + hl;
|
|
7406
|
+
H7.high = H7h + hh + (H7l >>> 0 < hl >>> 0 ? 1 : 0);
|
|
7407
|
+
},
|
|
7408
|
+
_doFinalize: function() {
|
|
7409
|
+
var data2 = this._data;
|
|
7410
|
+
var dataWords = data2.words;
|
|
7411
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
7412
|
+
var nBitsLeft = data2.sigBytes * 8;
|
|
7413
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
7414
|
+
dataWords[(nBitsLeft + 128 >>> 10 << 5) + 30] = Math.floor(nBitsTotal / 4294967296);
|
|
7415
|
+
dataWords[(nBitsLeft + 128 >>> 10 << 5) + 31] = nBitsTotal;
|
|
7416
|
+
data2.sigBytes = dataWords.length * 4;
|
|
7417
|
+
this._process();
|
|
7418
|
+
var hash = this._hash.toX32();
|
|
7419
|
+
return hash;
|
|
7420
|
+
},
|
|
7421
|
+
clone: function() {
|
|
7422
|
+
var clone = Hasher.clone.call(this);
|
|
7423
|
+
clone._hash = this._hash.clone();
|
|
7424
|
+
return clone;
|
|
7425
|
+
},
|
|
7426
|
+
blockSize: 1024 / 32
|
|
7427
|
+
});
|
|
7428
|
+
C.SHA512 = Hasher._createHelper(SHA512);
|
|
7429
|
+
C.HmacSHA512 = Hasher._createHmacHelper(SHA512);
|
|
7430
|
+
})();
|
|
7431
|
+
return CryptoJS2.SHA512;
|
|
7432
|
+
});
|
|
7433
|
+
})(sha512);
|
|
7434
|
+
return sha512.exports;
|
|
7435
|
+
}
|
|
7436
|
+
var sha384 = { exports: {} };
|
|
7437
|
+
var hasRequiredSha384;
|
|
7438
|
+
function requireSha384() {
|
|
7439
|
+
if (hasRequiredSha384)
|
|
7440
|
+
return sha384.exports;
|
|
7441
|
+
hasRequiredSha384 = 1;
|
|
7442
|
+
(function(module, exports) {
|
|
7443
|
+
(function(root, factory, undef) {
|
|
7444
|
+
{
|
|
7445
|
+
module.exports = factory(requireCore(), requireX64Core(), requireSha512());
|
|
7446
|
+
}
|
|
7447
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7448
|
+
(function() {
|
|
7449
|
+
var C = CryptoJS2;
|
|
7450
|
+
var C_x64 = C.x64;
|
|
7451
|
+
var X64Word = C_x64.Word;
|
|
7452
|
+
var X64WordArray = C_x64.WordArray;
|
|
7453
|
+
var C_algo = C.algo;
|
|
7454
|
+
var SHA512 = C_algo.SHA512;
|
|
7455
|
+
var SHA384 = C_algo.SHA384 = SHA512.extend({
|
|
7456
|
+
_doReset: function() {
|
|
7457
|
+
this._hash = new X64WordArray.init([
|
|
7458
|
+
new X64Word.init(3418070365, 3238371032),
|
|
7459
|
+
new X64Word.init(1654270250, 914150663),
|
|
7460
|
+
new X64Word.init(2438529370, 812702999),
|
|
7461
|
+
new X64Word.init(355462360, 4144912697),
|
|
7462
|
+
new X64Word.init(1731405415, 4290775857),
|
|
7463
|
+
new X64Word.init(2394180231, 1750603025),
|
|
7464
|
+
new X64Word.init(3675008525, 1694076839),
|
|
7465
|
+
new X64Word.init(1203062813, 3204075428)
|
|
7466
|
+
]);
|
|
7467
|
+
},
|
|
7468
|
+
_doFinalize: function() {
|
|
7469
|
+
var hash = SHA512._doFinalize.call(this);
|
|
7470
|
+
hash.sigBytes -= 16;
|
|
7471
|
+
return hash;
|
|
7472
|
+
}
|
|
7473
|
+
});
|
|
7474
|
+
C.SHA384 = SHA512._createHelper(SHA384);
|
|
7475
|
+
C.HmacSHA384 = SHA512._createHmacHelper(SHA384);
|
|
7476
|
+
})();
|
|
7477
|
+
return CryptoJS2.SHA384;
|
|
7478
|
+
});
|
|
7479
|
+
})(sha384);
|
|
7480
|
+
return sha384.exports;
|
|
7481
|
+
}
|
|
7482
|
+
var sha3 = { exports: {} };
|
|
7483
|
+
var hasRequiredSha3;
|
|
7484
|
+
function requireSha3() {
|
|
7485
|
+
if (hasRequiredSha3)
|
|
7486
|
+
return sha3.exports;
|
|
7487
|
+
hasRequiredSha3 = 1;
|
|
7488
|
+
(function(module, exports) {
|
|
7489
|
+
(function(root, factory, undef) {
|
|
7490
|
+
{
|
|
7491
|
+
module.exports = factory(requireCore(), requireX64Core());
|
|
7492
|
+
}
|
|
7493
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7494
|
+
(function(Math2) {
|
|
7495
|
+
var C = CryptoJS2;
|
|
7496
|
+
var C_lib = C.lib;
|
|
7497
|
+
var WordArray = C_lib.WordArray;
|
|
7498
|
+
var Hasher = C_lib.Hasher;
|
|
7499
|
+
var C_x64 = C.x64;
|
|
7500
|
+
var X64Word = C_x64.Word;
|
|
7501
|
+
var C_algo = C.algo;
|
|
7502
|
+
var RHO_OFFSETS = [];
|
|
7503
|
+
var PI_INDEXES = [];
|
|
7504
|
+
var ROUND_CONSTANTS = [];
|
|
7505
|
+
(function() {
|
|
7506
|
+
var x = 1, y = 0;
|
|
7507
|
+
for (var t = 0; t < 24; t++) {
|
|
7508
|
+
RHO_OFFSETS[x + 5 * y] = (t + 1) * (t + 2) / 2 % 64;
|
|
7509
|
+
var newX = y % 5;
|
|
7510
|
+
var newY = (2 * x + 3 * y) % 5;
|
|
7511
|
+
x = newX;
|
|
7512
|
+
y = newY;
|
|
7513
|
+
}
|
|
7514
|
+
for (var x = 0; x < 5; x++) {
|
|
7515
|
+
for (var y = 0; y < 5; y++) {
|
|
7516
|
+
PI_INDEXES[x + 5 * y] = y + (2 * x + 3 * y) % 5 * 5;
|
|
7517
|
+
}
|
|
7518
|
+
}
|
|
7519
|
+
var LFSR = 1;
|
|
7520
|
+
for (var i = 0; i < 24; i++) {
|
|
7521
|
+
var roundConstantMsw = 0;
|
|
7522
|
+
var roundConstantLsw = 0;
|
|
7523
|
+
for (var j = 0; j < 7; j++) {
|
|
7524
|
+
if (LFSR & 1) {
|
|
7525
|
+
var bitPosition = (1 << j) - 1;
|
|
7526
|
+
if (bitPosition < 32) {
|
|
7527
|
+
roundConstantLsw ^= 1 << bitPosition;
|
|
7528
|
+
} else {
|
|
7529
|
+
roundConstantMsw ^= 1 << bitPosition - 32;
|
|
7530
|
+
}
|
|
7531
|
+
}
|
|
7532
|
+
if (LFSR & 128) {
|
|
7533
|
+
LFSR = LFSR << 1 ^ 113;
|
|
7534
|
+
} else {
|
|
7535
|
+
LFSR <<= 1;
|
|
7536
|
+
}
|
|
7537
|
+
}
|
|
7538
|
+
ROUND_CONSTANTS[i] = X64Word.create(roundConstantMsw, roundConstantLsw);
|
|
7539
|
+
}
|
|
7540
|
+
})();
|
|
7541
|
+
var T = [];
|
|
7542
|
+
(function() {
|
|
7543
|
+
for (var i = 0; i < 25; i++) {
|
|
7544
|
+
T[i] = X64Word.create();
|
|
7545
|
+
}
|
|
7546
|
+
})();
|
|
7547
|
+
var SHA3 = C_algo.SHA3 = Hasher.extend({
|
|
7548
|
+
/**
|
|
7549
|
+
* Configuration options.
|
|
7550
|
+
*
|
|
7551
|
+
* @property {number} outputLength
|
|
7552
|
+
* The desired number of bits in the output hash.
|
|
7553
|
+
* Only values permitted are: 224, 256, 384, 512.
|
|
7554
|
+
* Default: 512
|
|
7555
|
+
*/
|
|
7556
|
+
cfg: Hasher.cfg.extend({
|
|
7557
|
+
outputLength: 512
|
|
7558
|
+
}),
|
|
7559
|
+
_doReset: function() {
|
|
7560
|
+
var state = this._state = [];
|
|
7561
|
+
for (var i = 0; i < 25; i++) {
|
|
7562
|
+
state[i] = new X64Word.init();
|
|
7563
|
+
}
|
|
7564
|
+
this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32;
|
|
7565
|
+
},
|
|
7566
|
+
_doProcessBlock: function(M, offset) {
|
|
7567
|
+
var state = this._state;
|
|
7568
|
+
var nBlockSizeLanes = this.blockSize / 2;
|
|
7569
|
+
for (var i = 0; i < nBlockSizeLanes; i++) {
|
|
7570
|
+
var M2i = M[offset + 2 * i];
|
|
7571
|
+
var M2i1 = M[offset + 2 * i + 1];
|
|
7572
|
+
M2i = (M2i << 8 | M2i >>> 24) & 16711935 | (M2i << 24 | M2i >>> 8) & 4278255360;
|
|
7573
|
+
M2i1 = (M2i1 << 8 | M2i1 >>> 24) & 16711935 | (M2i1 << 24 | M2i1 >>> 8) & 4278255360;
|
|
7574
|
+
var lane = state[i];
|
|
7575
|
+
lane.high ^= M2i1;
|
|
7576
|
+
lane.low ^= M2i;
|
|
7577
|
+
}
|
|
7578
|
+
for (var round = 0; round < 24; round++) {
|
|
7579
|
+
for (var x = 0; x < 5; x++) {
|
|
7580
|
+
var tMsw = 0, tLsw = 0;
|
|
7581
|
+
for (var y = 0; y < 5; y++) {
|
|
7582
|
+
var lane = state[x + 5 * y];
|
|
7583
|
+
tMsw ^= lane.high;
|
|
7584
|
+
tLsw ^= lane.low;
|
|
7585
|
+
}
|
|
7586
|
+
var Tx = T[x];
|
|
7587
|
+
Tx.high = tMsw;
|
|
7588
|
+
Tx.low = tLsw;
|
|
7589
|
+
}
|
|
7590
|
+
for (var x = 0; x < 5; x++) {
|
|
7591
|
+
var Tx4 = T[(x + 4) % 5];
|
|
7592
|
+
var Tx1 = T[(x + 1) % 5];
|
|
7593
|
+
var Tx1Msw = Tx1.high;
|
|
7594
|
+
var Tx1Lsw = Tx1.low;
|
|
7595
|
+
var tMsw = Tx4.high ^ (Tx1Msw << 1 | Tx1Lsw >>> 31);
|
|
7596
|
+
var tLsw = Tx4.low ^ (Tx1Lsw << 1 | Tx1Msw >>> 31);
|
|
7597
|
+
for (var y = 0; y < 5; y++) {
|
|
7598
|
+
var lane = state[x + 5 * y];
|
|
7599
|
+
lane.high ^= tMsw;
|
|
7600
|
+
lane.low ^= tLsw;
|
|
7601
|
+
}
|
|
7602
|
+
}
|
|
7603
|
+
for (var laneIndex = 1; laneIndex < 25; laneIndex++) {
|
|
7604
|
+
var tMsw;
|
|
7605
|
+
var tLsw;
|
|
7606
|
+
var lane = state[laneIndex];
|
|
7607
|
+
var laneMsw = lane.high;
|
|
7608
|
+
var laneLsw = lane.low;
|
|
7609
|
+
var rhoOffset = RHO_OFFSETS[laneIndex];
|
|
7610
|
+
if (rhoOffset < 32) {
|
|
7611
|
+
tMsw = laneMsw << rhoOffset | laneLsw >>> 32 - rhoOffset;
|
|
7612
|
+
tLsw = laneLsw << rhoOffset | laneMsw >>> 32 - rhoOffset;
|
|
7613
|
+
} else {
|
|
7614
|
+
tMsw = laneLsw << rhoOffset - 32 | laneMsw >>> 64 - rhoOffset;
|
|
7615
|
+
tLsw = laneMsw << rhoOffset - 32 | laneLsw >>> 64 - rhoOffset;
|
|
7616
|
+
}
|
|
7617
|
+
var TPiLane = T[PI_INDEXES[laneIndex]];
|
|
7618
|
+
TPiLane.high = tMsw;
|
|
7619
|
+
TPiLane.low = tLsw;
|
|
7620
|
+
}
|
|
7621
|
+
var T0 = T[0];
|
|
7622
|
+
var state0 = state[0];
|
|
7623
|
+
T0.high = state0.high;
|
|
7624
|
+
T0.low = state0.low;
|
|
7625
|
+
for (var x = 0; x < 5; x++) {
|
|
7626
|
+
for (var y = 0; y < 5; y++) {
|
|
7627
|
+
var laneIndex = x + 5 * y;
|
|
7628
|
+
var lane = state[laneIndex];
|
|
7629
|
+
var TLane = T[laneIndex];
|
|
7630
|
+
var Tx1Lane = T[(x + 1) % 5 + 5 * y];
|
|
7631
|
+
var Tx2Lane = T[(x + 2) % 5 + 5 * y];
|
|
7632
|
+
lane.high = TLane.high ^ ~Tx1Lane.high & Tx2Lane.high;
|
|
7633
|
+
lane.low = TLane.low ^ ~Tx1Lane.low & Tx2Lane.low;
|
|
7634
|
+
}
|
|
7635
|
+
}
|
|
7636
|
+
var lane = state[0];
|
|
7637
|
+
var roundConstant = ROUND_CONSTANTS[round];
|
|
7638
|
+
lane.high ^= roundConstant.high;
|
|
7639
|
+
lane.low ^= roundConstant.low;
|
|
7640
|
+
}
|
|
7641
|
+
},
|
|
7642
|
+
_doFinalize: function() {
|
|
7643
|
+
var data2 = this._data;
|
|
7644
|
+
var dataWords = data2.words;
|
|
7645
|
+
this._nDataBytes * 8;
|
|
7646
|
+
var nBitsLeft = data2.sigBytes * 8;
|
|
7647
|
+
var blockSizeBits = this.blockSize * 32;
|
|
7648
|
+
dataWords[nBitsLeft >>> 5] |= 1 << 24 - nBitsLeft % 32;
|
|
7649
|
+
dataWords[(Math2.ceil((nBitsLeft + 1) / blockSizeBits) * blockSizeBits >>> 5) - 1] |= 128;
|
|
7650
|
+
data2.sigBytes = dataWords.length * 4;
|
|
7651
|
+
this._process();
|
|
7652
|
+
var state = this._state;
|
|
7653
|
+
var outputLengthBytes = this.cfg.outputLength / 8;
|
|
7654
|
+
var outputLengthLanes = outputLengthBytes / 8;
|
|
7655
|
+
var hashWords = [];
|
|
7656
|
+
for (var i = 0; i < outputLengthLanes; i++) {
|
|
7657
|
+
var lane = state[i];
|
|
7658
|
+
var laneMsw = lane.high;
|
|
7659
|
+
var laneLsw = lane.low;
|
|
7660
|
+
laneMsw = (laneMsw << 8 | laneMsw >>> 24) & 16711935 | (laneMsw << 24 | laneMsw >>> 8) & 4278255360;
|
|
7661
|
+
laneLsw = (laneLsw << 8 | laneLsw >>> 24) & 16711935 | (laneLsw << 24 | laneLsw >>> 8) & 4278255360;
|
|
7662
|
+
hashWords.push(laneLsw);
|
|
7663
|
+
hashWords.push(laneMsw);
|
|
7664
|
+
}
|
|
7665
|
+
return new WordArray.init(hashWords, outputLengthBytes);
|
|
7666
|
+
},
|
|
7667
|
+
clone: function() {
|
|
7668
|
+
var clone = Hasher.clone.call(this);
|
|
7669
|
+
var state = clone._state = this._state.slice(0);
|
|
7670
|
+
for (var i = 0; i < 25; i++) {
|
|
7671
|
+
state[i] = state[i].clone();
|
|
7672
|
+
}
|
|
7673
|
+
return clone;
|
|
7674
|
+
}
|
|
7675
|
+
});
|
|
7676
|
+
C.SHA3 = Hasher._createHelper(SHA3);
|
|
7677
|
+
C.HmacSHA3 = Hasher._createHmacHelper(SHA3);
|
|
7678
|
+
})(Math);
|
|
7679
|
+
return CryptoJS2.SHA3;
|
|
7680
|
+
});
|
|
7681
|
+
})(sha3);
|
|
7682
|
+
return sha3.exports;
|
|
7683
|
+
}
|
|
7684
|
+
var ripemd160 = { exports: {} };
|
|
7685
|
+
var hasRequiredRipemd160;
|
|
7686
|
+
function requireRipemd160() {
|
|
7687
|
+
if (hasRequiredRipemd160)
|
|
7688
|
+
return ripemd160.exports;
|
|
7689
|
+
hasRequiredRipemd160 = 1;
|
|
7690
|
+
(function(module, exports) {
|
|
7691
|
+
(function(root, factory) {
|
|
7692
|
+
{
|
|
7693
|
+
module.exports = factory(requireCore());
|
|
7694
|
+
}
|
|
7695
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
7696
|
+
/** @preserve
|
|
7697
|
+
(c) 2012 by Cédric Mesnil. All rights reserved.
|
|
7698
|
+
|
|
7699
|
+
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
|
7700
|
+
|
|
7701
|
+
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
|
|
7702
|
+
- 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.
|
|
7703
|
+
|
|
7704
|
+
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.
|
|
7705
|
+
*/
|
|
7706
|
+
(function(Math2) {
|
|
7707
|
+
var C = CryptoJS2;
|
|
7708
|
+
var C_lib = C.lib;
|
|
7709
|
+
var WordArray = C_lib.WordArray;
|
|
7710
|
+
var Hasher = C_lib.Hasher;
|
|
7711
|
+
var C_algo = C.algo;
|
|
7712
|
+
var _zl = WordArray.create([
|
|
7713
|
+
0,
|
|
7714
|
+
1,
|
|
7715
|
+
2,
|
|
7716
|
+
3,
|
|
7717
|
+
4,
|
|
7718
|
+
5,
|
|
7719
|
+
6,
|
|
7720
|
+
7,
|
|
7721
|
+
8,
|
|
7722
|
+
9,
|
|
7723
|
+
10,
|
|
7724
|
+
11,
|
|
7725
|
+
12,
|
|
7726
|
+
13,
|
|
7727
|
+
14,
|
|
7728
|
+
15,
|
|
7729
|
+
7,
|
|
7730
|
+
4,
|
|
7731
|
+
13,
|
|
7732
|
+
1,
|
|
7733
|
+
10,
|
|
7734
|
+
6,
|
|
7735
|
+
15,
|
|
7736
|
+
3,
|
|
7737
|
+
12,
|
|
7738
|
+
0,
|
|
7739
|
+
9,
|
|
7740
|
+
5,
|
|
7741
|
+
2,
|
|
7742
|
+
14,
|
|
7743
|
+
11,
|
|
7744
|
+
8,
|
|
7745
|
+
3,
|
|
7746
|
+
10,
|
|
7747
|
+
14,
|
|
7748
|
+
4,
|
|
7749
|
+
9,
|
|
7750
|
+
15,
|
|
7751
|
+
8,
|
|
7752
|
+
1,
|
|
7753
|
+
2,
|
|
7754
|
+
7,
|
|
7755
|
+
0,
|
|
7756
|
+
6,
|
|
7757
|
+
13,
|
|
7758
|
+
11,
|
|
7759
|
+
5,
|
|
7760
|
+
12,
|
|
7761
|
+
1,
|
|
7762
|
+
9,
|
|
7763
|
+
11,
|
|
7764
|
+
10,
|
|
7765
|
+
0,
|
|
7766
|
+
8,
|
|
7767
|
+
12,
|
|
7768
|
+
4,
|
|
7769
|
+
13,
|
|
7770
|
+
3,
|
|
7771
|
+
7,
|
|
7772
|
+
15,
|
|
7773
|
+
14,
|
|
7774
|
+
5,
|
|
7775
|
+
6,
|
|
7776
|
+
2,
|
|
7777
|
+
4,
|
|
7778
|
+
0,
|
|
7779
|
+
5,
|
|
7780
|
+
9,
|
|
7781
|
+
7,
|
|
7782
|
+
12,
|
|
7783
|
+
2,
|
|
7784
|
+
10,
|
|
7785
|
+
14,
|
|
7786
|
+
1,
|
|
7787
|
+
3,
|
|
7788
|
+
8,
|
|
7789
|
+
11,
|
|
7790
|
+
6,
|
|
7791
|
+
15,
|
|
7792
|
+
13
|
|
7793
|
+
]);
|
|
7794
|
+
var _zr = WordArray.create([
|
|
7795
|
+
5,
|
|
7796
|
+
14,
|
|
7797
|
+
7,
|
|
7798
|
+
0,
|
|
7799
|
+
9,
|
|
7800
|
+
2,
|
|
7801
|
+
11,
|
|
7802
|
+
4,
|
|
7803
|
+
13,
|
|
7804
|
+
6,
|
|
7805
|
+
15,
|
|
7806
|
+
8,
|
|
7807
|
+
1,
|
|
7808
|
+
10,
|
|
7809
|
+
3,
|
|
7810
|
+
12,
|
|
7811
|
+
6,
|
|
7812
|
+
11,
|
|
7813
|
+
3,
|
|
7814
|
+
7,
|
|
7815
|
+
0,
|
|
7816
|
+
13,
|
|
7817
|
+
5,
|
|
7818
|
+
10,
|
|
7819
|
+
14,
|
|
7820
|
+
15,
|
|
7821
|
+
8,
|
|
7822
|
+
12,
|
|
7823
|
+
4,
|
|
7824
|
+
9,
|
|
7825
|
+
1,
|
|
7826
|
+
2,
|
|
7827
|
+
15,
|
|
7828
|
+
5,
|
|
7829
|
+
1,
|
|
7830
|
+
3,
|
|
7831
|
+
7,
|
|
7832
|
+
14,
|
|
7833
|
+
6,
|
|
7834
|
+
9,
|
|
7835
|
+
11,
|
|
7836
|
+
8,
|
|
7837
|
+
12,
|
|
7838
|
+
2,
|
|
7839
|
+
10,
|
|
7840
|
+
0,
|
|
7841
|
+
4,
|
|
7842
|
+
13,
|
|
7843
|
+
8,
|
|
7844
|
+
6,
|
|
7845
|
+
4,
|
|
7846
|
+
1,
|
|
7847
|
+
3,
|
|
7848
|
+
11,
|
|
7849
|
+
15,
|
|
7850
|
+
0,
|
|
7851
|
+
5,
|
|
7852
|
+
12,
|
|
7853
|
+
2,
|
|
7854
|
+
13,
|
|
7855
|
+
9,
|
|
7856
|
+
7,
|
|
7857
|
+
10,
|
|
7858
|
+
14,
|
|
7859
|
+
12,
|
|
7860
|
+
15,
|
|
7861
|
+
10,
|
|
7862
|
+
4,
|
|
7863
|
+
1,
|
|
7864
|
+
5,
|
|
7865
|
+
8,
|
|
7866
|
+
7,
|
|
7867
|
+
6,
|
|
7868
|
+
2,
|
|
7869
|
+
13,
|
|
7870
|
+
14,
|
|
7871
|
+
0,
|
|
7872
|
+
3,
|
|
7873
|
+
9,
|
|
7874
|
+
11
|
|
7875
|
+
]);
|
|
7876
|
+
var _sl = WordArray.create([
|
|
7877
|
+
11,
|
|
7878
|
+
14,
|
|
7879
|
+
15,
|
|
7880
|
+
12,
|
|
7881
|
+
5,
|
|
7882
|
+
8,
|
|
7883
|
+
7,
|
|
7884
|
+
9,
|
|
7885
|
+
11,
|
|
7886
|
+
13,
|
|
7887
|
+
14,
|
|
7888
|
+
15,
|
|
7889
|
+
6,
|
|
7890
|
+
7,
|
|
7891
|
+
9,
|
|
7892
|
+
8,
|
|
7893
|
+
7,
|
|
7894
|
+
6,
|
|
7895
|
+
8,
|
|
7896
|
+
13,
|
|
7897
|
+
11,
|
|
7898
|
+
9,
|
|
7899
|
+
7,
|
|
7900
|
+
15,
|
|
7901
|
+
7,
|
|
7902
|
+
12,
|
|
7903
|
+
15,
|
|
7904
|
+
9,
|
|
7905
|
+
11,
|
|
7906
|
+
7,
|
|
7907
|
+
13,
|
|
7908
|
+
12,
|
|
7909
|
+
11,
|
|
7910
|
+
13,
|
|
7911
|
+
6,
|
|
7912
|
+
7,
|
|
7913
|
+
14,
|
|
7914
|
+
9,
|
|
7915
|
+
13,
|
|
7916
|
+
15,
|
|
7917
|
+
14,
|
|
7918
|
+
8,
|
|
7919
|
+
13,
|
|
7920
|
+
6,
|
|
7921
|
+
5,
|
|
7922
|
+
12,
|
|
7923
|
+
7,
|
|
7924
|
+
5,
|
|
7925
|
+
11,
|
|
7926
|
+
12,
|
|
7927
|
+
14,
|
|
7928
|
+
15,
|
|
7929
|
+
14,
|
|
7930
|
+
15,
|
|
7931
|
+
9,
|
|
7932
|
+
8,
|
|
7933
|
+
9,
|
|
7934
|
+
14,
|
|
7935
|
+
5,
|
|
7936
|
+
6,
|
|
7937
|
+
8,
|
|
7938
|
+
6,
|
|
7939
|
+
5,
|
|
7940
|
+
12,
|
|
7941
|
+
9,
|
|
7942
|
+
15,
|
|
7943
|
+
5,
|
|
7944
|
+
11,
|
|
7945
|
+
6,
|
|
7946
|
+
8,
|
|
7947
|
+
13,
|
|
7948
|
+
12,
|
|
7949
|
+
5,
|
|
7950
|
+
12,
|
|
7951
|
+
13,
|
|
7952
|
+
14,
|
|
7953
|
+
11,
|
|
7954
|
+
8,
|
|
7955
|
+
5,
|
|
7956
|
+
6
|
|
7957
|
+
]);
|
|
7958
|
+
var _sr = WordArray.create([
|
|
7959
|
+
8,
|
|
7960
|
+
9,
|
|
7961
|
+
9,
|
|
7962
|
+
11,
|
|
7963
|
+
13,
|
|
7964
|
+
15,
|
|
7965
|
+
15,
|
|
7966
|
+
5,
|
|
7967
|
+
7,
|
|
7968
|
+
7,
|
|
7969
|
+
8,
|
|
7970
|
+
11,
|
|
7971
|
+
14,
|
|
7972
|
+
14,
|
|
7973
|
+
12,
|
|
7974
|
+
6,
|
|
7975
|
+
9,
|
|
7976
|
+
13,
|
|
7977
|
+
15,
|
|
7978
|
+
7,
|
|
7979
|
+
12,
|
|
7980
|
+
8,
|
|
7981
|
+
9,
|
|
7982
|
+
11,
|
|
7983
|
+
7,
|
|
7984
|
+
7,
|
|
7985
|
+
12,
|
|
7986
|
+
7,
|
|
7987
|
+
6,
|
|
7988
|
+
15,
|
|
7989
|
+
13,
|
|
7990
|
+
11,
|
|
7991
|
+
9,
|
|
7992
|
+
7,
|
|
7993
|
+
15,
|
|
7994
|
+
11,
|
|
7995
|
+
8,
|
|
7996
|
+
6,
|
|
7997
|
+
6,
|
|
7998
|
+
14,
|
|
7999
|
+
12,
|
|
8000
|
+
13,
|
|
8001
|
+
5,
|
|
8002
|
+
14,
|
|
8003
|
+
13,
|
|
8004
|
+
13,
|
|
8005
|
+
7,
|
|
8006
|
+
5,
|
|
8007
|
+
15,
|
|
8008
|
+
5,
|
|
8009
|
+
8,
|
|
8010
|
+
11,
|
|
8011
|
+
14,
|
|
8012
|
+
14,
|
|
8013
|
+
6,
|
|
8014
|
+
14,
|
|
8015
|
+
6,
|
|
8016
|
+
9,
|
|
8017
|
+
12,
|
|
8018
|
+
9,
|
|
8019
|
+
12,
|
|
8020
|
+
5,
|
|
8021
|
+
15,
|
|
8022
|
+
8,
|
|
8023
|
+
8,
|
|
8024
|
+
5,
|
|
8025
|
+
12,
|
|
8026
|
+
9,
|
|
8027
|
+
12,
|
|
8028
|
+
5,
|
|
8029
|
+
14,
|
|
8030
|
+
6,
|
|
8031
|
+
8,
|
|
8032
|
+
13,
|
|
8033
|
+
6,
|
|
8034
|
+
5,
|
|
8035
|
+
15,
|
|
8036
|
+
13,
|
|
8037
|
+
11,
|
|
8038
|
+
11
|
|
8039
|
+
]);
|
|
8040
|
+
var _hl = WordArray.create([0, 1518500249, 1859775393, 2400959708, 2840853838]);
|
|
8041
|
+
var _hr = WordArray.create([1352829926, 1548603684, 1836072691, 2053994217, 0]);
|
|
8042
|
+
var RIPEMD160 = C_algo.RIPEMD160 = Hasher.extend({
|
|
8043
|
+
_doReset: function() {
|
|
8044
|
+
this._hash = WordArray.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]);
|
|
8045
|
+
},
|
|
8046
|
+
_doProcessBlock: function(M, offset) {
|
|
8047
|
+
for (var i = 0; i < 16; i++) {
|
|
8048
|
+
var offset_i = offset + i;
|
|
8049
|
+
var M_offset_i = M[offset_i];
|
|
8050
|
+
M[offset_i] = (M_offset_i << 8 | M_offset_i >>> 24) & 16711935 | (M_offset_i << 24 | M_offset_i >>> 8) & 4278255360;
|
|
8051
|
+
}
|
|
8052
|
+
var H = this._hash.words;
|
|
8053
|
+
var hl = _hl.words;
|
|
8054
|
+
var hr = _hr.words;
|
|
8055
|
+
var zl = _zl.words;
|
|
8056
|
+
var zr = _zr.words;
|
|
8057
|
+
var sl = _sl.words;
|
|
8058
|
+
var sr = _sr.words;
|
|
8059
|
+
var al, bl, cl, dl, el;
|
|
8060
|
+
var ar, br, cr, dr, er;
|
|
8061
|
+
ar = al = H[0];
|
|
8062
|
+
br = bl = H[1];
|
|
8063
|
+
cr = cl = H[2];
|
|
8064
|
+
dr = dl = H[3];
|
|
8065
|
+
er = el = H[4];
|
|
8066
|
+
var t;
|
|
8067
|
+
for (var i = 0; i < 80; i += 1) {
|
|
8068
|
+
t = al + M[offset + zl[i]] | 0;
|
|
8069
|
+
if (i < 16) {
|
|
8070
|
+
t += f1(bl, cl, dl) + hl[0];
|
|
8071
|
+
} else if (i < 32) {
|
|
8072
|
+
t += f2(bl, cl, dl) + hl[1];
|
|
8073
|
+
} else if (i < 48) {
|
|
8074
|
+
t += f3(bl, cl, dl) + hl[2];
|
|
8075
|
+
} else if (i < 64) {
|
|
8076
|
+
t += f4(bl, cl, dl) + hl[3];
|
|
8077
|
+
} else {
|
|
8078
|
+
t += f5(bl, cl, dl) + hl[4];
|
|
8079
|
+
}
|
|
8080
|
+
t = t | 0;
|
|
8081
|
+
t = rotl(t, sl[i]);
|
|
8082
|
+
t = t + el | 0;
|
|
8083
|
+
al = el;
|
|
8084
|
+
el = dl;
|
|
8085
|
+
dl = rotl(cl, 10);
|
|
8086
|
+
cl = bl;
|
|
8087
|
+
bl = t;
|
|
8088
|
+
t = ar + M[offset + zr[i]] | 0;
|
|
8089
|
+
if (i < 16) {
|
|
8090
|
+
t += f5(br, cr, dr) + hr[0];
|
|
8091
|
+
} else if (i < 32) {
|
|
8092
|
+
t += f4(br, cr, dr) + hr[1];
|
|
8093
|
+
} else if (i < 48) {
|
|
8094
|
+
t += f3(br, cr, dr) + hr[2];
|
|
8095
|
+
} else if (i < 64) {
|
|
8096
|
+
t += f2(br, cr, dr) + hr[3];
|
|
8097
|
+
} else {
|
|
8098
|
+
t += f1(br, cr, dr) + hr[4];
|
|
8099
|
+
}
|
|
8100
|
+
t = t | 0;
|
|
8101
|
+
t = rotl(t, sr[i]);
|
|
8102
|
+
t = t + er | 0;
|
|
8103
|
+
ar = er;
|
|
8104
|
+
er = dr;
|
|
8105
|
+
dr = rotl(cr, 10);
|
|
8106
|
+
cr = br;
|
|
8107
|
+
br = t;
|
|
8108
|
+
}
|
|
8109
|
+
t = H[1] + cl + dr | 0;
|
|
8110
|
+
H[1] = H[2] + dl + er | 0;
|
|
8111
|
+
H[2] = H[3] + el + ar | 0;
|
|
8112
|
+
H[3] = H[4] + al + br | 0;
|
|
8113
|
+
H[4] = H[0] + bl + cr | 0;
|
|
8114
|
+
H[0] = t;
|
|
8115
|
+
},
|
|
8116
|
+
_doFinalize: function() {
|
|
8117
|
+
var data2 = this._data;
|
|
8118
|
+
var dataWords = data2.words;
|
|
8119
|
+
var nBitsTotal = this._nDataBytes * 8;
|
|
8120
|
+
var nBitsLeft = data2.sigBytes * 8;
|
|
8121
|
+
dataWords[nBitsLeft >>> 5] |= 128 << 24 - nBitsLeft % 32;
|
|
8122
|
+
dataWords[(nBitsLeft + 64 >>> 9 << 4) + 14] = (nBitsTotal << 8 | nBitsTotal >>> 24) & 16711935 | (nBitsTotal << 24 | nBitsTotal >>> 8) & 4278255360;
|
|
8123
|
+
data2.sigBytes = (dataWords.length + 1) * 4;
|
|
8124
|
+
this._process();
|
|
8125
|
+
var hash = this._hash;
|
|
8126
|
+
var H = hash.words;
|
|
8127
|
+
for (var i = 0; i < 5; i++) {
|
|
8128
|
+
var H_i = H[i];
|
|
8129
|
+
H[i] = (H_i << 8 | H_i >>> 24) & 16711935 | (H_i << 24 | H_i >>> 8) & 4278255360;
|
|
8130
|
+
}
|
|
8131
|
+
return hash;
|
|
8132
|
+
},
|
|
8133
|
+
clone: function() {
|
|
8134
|
+
var clone = Hasher.clone.call(this);
|
|
8135
|
+
clone._hash = this._hash.clone();
|
|
8136
|
+
return clone;
|
|
8137
|
+
}
|
|
8138
|
+
});
|
|
8139
|
+
function f1(x, y, z) {
|
|
8140
|
+
return x ^ y ^ z;
|
|
8141
|
+
}
|
|
8142
|
+
function f2(x, y, z) {
|
|
8143
|
+
return x & y | ~x & z;
|
|
8144
|
+
}
|
|
8145
|
+
function f3(x, y, z) {
|
|
8146
|
+
return (x | ~y) ^ z;
|
|
8147
|
+
}
|
|
8148
|
+
function f4(x, y, z) {
|
|
8149
|
+
return x & z | y & ~z;
|
|
8150
|
+
}
|
|
8151
|
+
function f5(x, y, z) {
|
|
8152
|
+
return x ^ (y | ~z);
|
|
8153
|
+
}
|
|
8154
|
+
function rotl(x, n) {
|
|
8155
|
+
return x << n | x >>> 32 - n;
|
|
8156
|
+
}
|
|
8157
|
+
C.RIPEMD160 = Hasher._createHelper(RIPEMD160);
|
|
8158
|
+
C.HmacRIPEMD160 = Hasher._createHmacHelper(RIPEMD160);
|
|
8159
|
+
})();
|
|
8160
|
+
return CryptoJS2.RIPEMD160;
|
|
8161
|
+
});
|
|
8162
|
+
})(ripemd160);
|
|
8163
|
+
return ripemd160.exports;
|
|
8164
|
+
}
|
|
8165
|
+
var pbkdf2 = { exports: {} };
|
|
8166
|
+
var hasRequiredPbkdf2;
|
|
8167
|
+
function requirePbkdf2() {
|
|
8168
|
+
if (hasRequiredPbkdf2)
|
|
8169
|
+
return pbkdf2.exports;
|
|
8170
|
+
hasRequiredPbkdf2 = 1;
|
|
8171
|
+
(function(module, exports) {
|
|
8172
|
+
(function(root, factory, undef) {
|
|
8173
|
+
{
|
|
8174
|
+
module.exports = factory(requireCore(), requireSha1(), requireHmac());
|
|
8175
|
+
}
|
|
8176
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8177
|
+
(function() {
|
|
8178
|
+
var C = CryptoJS2;
|
|
8179
|
+
var C_lib = C.lib;
|
|
8180
|
+
var Base = C_lib.Base;
|
|
8181
|
+
var WordArray = C_lib.WordArray;
|
|
8182
|
+
var C_algo = C.algo;
|
|
8183
|
+
var SHA1 = C_algo.SHA1;
|
|
8184
|
+
var HMAC = C_algo.HMAC;
|
|
8185
|
+
var PBKDF2 = C_algo.PBKDF2 = Base.extend({
|
|
8186
|
+
/**
|
|
8187
|
+
* Configuration options.
|
|
8188
|
+
*
|
|
8189
|
+
* @property {number} keySize The key size in words to generate. Default: 4 (128 bits)
|
|
8190
|
+
* @property {Hasher} hasher The hasher to use. Default: SHA1
|
|
8191
|
+
* @property {number} iterations The number of iterations to perform. Default: 1
|
|
8192
|
+
*/
|
|
8193
|
+
cfg: Base.extend({
|
|
8194
|
+
keySize: 128 / 32,
|
|
8195
|
+
hasher: SHA1,
|
|
8196
|
+
iterations: 1
|
|
8197
|
+
}),
|
|
8198
|
+
/**
|
|
8199
|
+
* Initializes a newly created key derivation function.
|
|
8200
|
+
*
|
|
8201
|
+
* @param {Object} cfg (Optional) The configuration options to use for the derivation.
|
|
8202
|
+
*
|
|
8203
|
+
* @example
|
|
8204
|
+
*
|
|
8205
|
+
* var kdf = CryptoJS.algo.PBKDF2.create();
|
|
8206
|
+
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8 });
|
|
8207
|
+
* var kdf = CryptoJS.algo.PBKDF2.create({ keySize: 8, iterations: 1000 });
|
|
8208
|
+
*/
|
|
8209
|
+
init: function(cfg) {
|
|
8210
|
+
this.cfg = this.cfg.extend(cfg);
|
|
8211
|
+
},
|
|
8212
|
+
/**
|
|
8213
|
+
* Computes the Password-Based Key Derivation Function 2.
|
|
8214
|
+
*
|
|
8215
|
+
* @param {WordArray|string} password The password.
|
|
8216
|
+
* @param {WordArray|string} salt A salt.
|
|
8217
|
+
*
|
|
8218
|
+
* @return {WordArray} The derived key.
|
|
8219
|
+
*
|
|
8220
|
+
* @example
|
|
8221
|
+
*
|
|
8222
|
+
* var key = kdf.compute(password, salt);
|
|
8223
|
+
*/
|
|
8224
|
+
compute: function(password, salt) {
|
|
8225
|
+
var cfg = this.cfg;
|
|
8226
|
+
var hmac2 = HMAC.create(cfg.hasher, password);
|
|
8227
|
+
var derivedKey = WordArray.create();
|
|
8228
|
+
var blockIndex = WordArray.create([1]);
|
|
8229
|
+
var derivedKeyWords = derivedKey.words;
|
|
8230
|
+
var blockIndexWords = blockIndex.words;
|
|
8231
|
+
var keySize = cfg.keySize;
|
|
8232
|
+
var iterations = cfg.iterations;
|
|
8233
|
+
while (derivedKeyWords.length < keySize) {
|
|
8234
|
+
var block = hmac2.update(salt).finalize(blockIndex);
|
|
8235
|
+
hmac2.reset();
|
|
8236
|
+
var blockWords = block.words;
|
|
8237
|
+
var blockWordsLength = blockWords.length;
|
|
8238
|
+
var intermediate = block;
|
|
8239
|
+
for (var i = 1; i < iterations; i++) {
|
|
8240
|
+
intermediate = hmac2.finalize(intermediate);
|
|
8241
|
+
hmac2.reset();
|
|
8242
|
+
var intermediateWords = intermediate.words;
|
|
8243
|
+
for (var j = 0; j < blockWordsLength; j++) {
|
|
8244
|
+
blockWords[j] ^= intermediateWords[j];
|
|
8245
|
+
}
|
|
8246
|
+
}
|
|
8247
|
+
derivedKey.concat(block);
|
|
8248
|
+
blockIndexWords[0]++;
|
|
8249
|
+
}
|
|
8250
|
+
derivedKey.sigBytes = keySize * 4;
|
|
8251
|
+
return derivedKey;
|
|
8252
|
+
}
|
|
8253
|
+
});
|
|
8254
|
+
C.PBKDF2 = function(password, salt, cfg) {
|
|
8255
|
+
return PBKDF2.create(cfg).compute(password, salt);
|
|
8256
|
+
};
|
|
8257
|
+
})();
|
|
8258
|
+
return CryptoJS2.PBKDF2;
|
|
8259
|
+
});
|
|
8260
|
+
})(pbkdf2);
|
|
8261
|
+
return pbkdf2.exports;
|
|
8262
|
+
}
|
|
8263
|
+
var modeCfb = { exports: {} };
|
|
8264
|
+
var hasRequiredModeCfb;
|
|
8265
|
+
function requireModeCfb() {
|
|
8266
|
+
if (hasRequiredModeCfb)
|
|
8267
|
+
return modeCfb.exports;
|
|
8268
|
+
hasRequiredModeCfb = 1;
|
|
8269
|
+
(function(module, exports) {
|
|
8270
|
+
(function(root, factory, undef) {
|
|
8271
|
+
{
|
|
8272
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8273
|
+
}
|
|
8274
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8275
|
+
CryptoJS2.mode.CFB = function() {
|
|
8276
|
+
var CFB = CryptoJS2.lib.BlockCipherMode.extend();
|
|
8277
|
+
CFB.Encryptor = CFB.extend({
|
|
8278
|
+
processBlock: function(words, offset) {
|
|
8279
|
+
var cipher = this._cipher;
|
|
8280
|
+
var blockSize = cipher.blockSize;
|
|
8281
|
+
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
|
8282
|
+
this._prevBlock = words.slice(offset, offset + blockSize);
|
|
8283
|
+
}
|
|
8284
|
+
});
|
|
8285
|
+
CFB.Decryptor = CFB.extend({
|
|
8286
|
+
processBlock: function(words, offset) {
|
|
8287
|
+
var cipher = this._cipher;
|
|
8288
|
+
var blockSize = cipher.blockSize;
|
|
8289
|
+
var thisBlock = words.slice(offset, offset + blockSize);
|
|
8290
|
+
generateKeystreamAndEncrypt.call(this, words, offset, blockSize, cipher);
|
|
8291
|
+
this._prevBlock = thisBlock;
|
|
8292
|
+
}
|
|
8293
|
+
});
|
|
8294
|
+
function generateKeystreamAndEncrypt(words, offset, blockSize, cipher) {
|
|
8295
|
+
var keystream;
|
|
8296
|
+
var iv = this._iv;
|
|
8297
|
+
if (iv) {
|
|
8298
|
+
keystream = iv.slice(0);
|
|
8299
|
+
this._iv = void 0;
|
|
8300
|
+
} else {
|
|
8301
|
+
keystream = this._prevBlock;
|
|
8302
|
+
}
|
|
8303
|
+
cipher.encryptBlock(keystream, 0);
|
|
8304
|
+
for (var i = 0; i < blockSize; i++) {
|
|
8305
|
+
words[offset + i] ^= keystream[i];
|
|
8306
|
+
}
|
|
8307
|
+
}
|
|
8308
|
+
return CFB;
|
|
8309
|
+
}();
|
|
8310
|
+
return CryptoJS2.mode.CFB;
|
|
8311
|
+
});
|
|
8312
|
+
})(modeCfb);
|
|
8313
|
+
return modeCfb.exports;
|
|
8314
|
+
}
|
|
8315
|
+
var modeCtr = { exports: {} };
|
|
8316
|
+
var hasRequiredModeCtr;
|
|
8317
|
+
function requireModeCtr() {
|
|
8318
|
+
if (hasRequiredModeCtr)
|
|
8319
|
+
return modeCtr.exports;
|
|
8320
|
+
hasRequiredModeCtr = 1;
|
|
8321
|
+
(function(module, exports) {
|
|
8322
|
+
(function(root, factory, undef) {
|
|
8323
|
+
{
|
|
8324
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8325
|
+
}
|
|
8326
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8327
|
+
CryptoJS2.mode.CTR = function() {
|
|
8328
|
+
var CTR = CryptoJS2.lib.BlockCipherMode.extend();
|
|
8329
|
+
var Encryptor = CTR.Encryptor = CTR.extend({
|
|
8330
|
+
processBlock: function(words, offset) {
|
|
8331
|
+
var cipher = this._cipher;
|
|
8332
|
+
var blockSize = cipher.blockSize;
|
|
8333
|
+
var iv = this._iv;
|
|
8334
|
+
var counter = this._counter;
|
|
8335
|
+
if (iv) {
|
|
8336
|
+
counter = this._counter = iv.slice(0);
|
|
8337
|
+
this._iv = void 0;
|
|
8338
|
+
}
|
|
8339
|
+
var keystream = counter.slice(0);
|
|
8340
|
+
cipher.encryptBlock(keystream, 0);
|
|
8341
|
+
counter[blockSize - 1] = counter[blockSize - 1] + 1 | 0;
|
|
8342
|
+
for (var i = 0; i < blockSize; i++) {
|
|
8343
|
+
words[offset + i] ^= keystream[i];
|
|
8344
|
+
}
|
|
8345
|
+
}
|
|
8346
|
+
});
|
|
8347
|
+
CTR.Decryptor = Encryptor;
|
|
8348
|
+
return CTR;
|
|
8349
|
+
}();
|
|
8350
|
+
return CryptoJS2.mode.CTR;
|
|
8351
|
+
});
|
|
8352
|
+
})(modeCtr);
|
|
8353
|
+
return modeCtr.exports;
|
|
8354
|
+
}
|
|
8355
|
+
var modeCtrGladman = { exports: {} };
|
|
8356
|
+
var hasRequiredModeCtrGladman;
|
|
8357
|
+
function requireModeCtrGladman() {
|
|
8358
|
+
if (hasRequiredModeCtrGladman)
|
|
8359
|
+
return modeCtrGladman.exports;
|
|
8360
|
+
hasRequiredModeCtrGladman = 1;
|
|
8361
|
+
(function(module, exports) {
|
|
8362
|
+
(function(root, factory, undef) {
|
|
8363
|
+
{
|
|
8364
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8365
|
+
}
|
|
8366
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8367
|
+
/** @preserve
|
|
8368
|
+
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
8369
|
+
* derived from CryptoJS.mode.CTR
|
|
8370
|
+
* Jan Hruby jhruby.web@gmail.com
|
|
8371
|
+
*/
|
|
8372
|
+
CryptoJS2.mode.CTRGladman = function() {
|
|
8373
|
+
var CTRGladman = CryptoJS2.lib.BlockCipherMode.extend();
|
|
8374
|
+
function incWord(word) {
|
|
8375
|
+
if ((word >> 24 & 255) === 255) {
|
|
8376
|
+
var b1 = word >> 16 & 255;
|
|
8377
|
+
var b2 = word >> 8 & 255;
|
|
8378
|
+
var b3 = word & 255;
|
|
8379
|
+
if (b1 === 255) {
|
|
8380
|
+
b1 = 0;
|
|
8381
|
+
if (b2 === 255) {
|
|
8382
|
+
b2 = 0;
|
|
8383
|
+
if (b3 === 255) {
|
|
8384
|
+
b3 = 0;
|
|
8385
|
+
} else {
|
|
8386
|
+
++b3;
|
|
8387
|
+
}
|
|
8388
|
+
} else {
|
|
8389
|
+
++b2;
|
|
8390
|
+
}
|
|
8391
|
+
} else {
|
|
8392
|
+
++b1;
|
|
8393
|
+
}
|
|
8394
|
+
word = 0;
|
|
8395
|
+
word += b1 << 16;
|
|
8396
|
+
word += b2 << 8;
|
|
8397
|
+
word += b3;
|
|
8398
|
+
} else {
|
|
8399
|
+
word += 1 << 24;
|
|
8400
|
+
}
|
|
8401
|
+
return word;
|
|
8402
|
+
}
|
|
8403
|
+
function incCounter(counter) {
|
|
8404
|
+
if ((counter[0] = incWord(counter[0])) === 0) {
|
|
8405
|
+
counter[1] = incWord(counter[1]);
|
|
8406
|
+
}
|
|
8407
|
+
return counter;
|
|
8408
|
+
}
|
|
8409
|
+
var Encryptor = CTRGladman.Encryptor = CTRGladman.extend({
|
|
8410
|
+
processBlock: function(words, offset) {
|
|
8411
|
+
var cipher = this._cipher;
|
|
8412
|
+
var blockSize = cipher.blockSize;
|
|
8413
|
+
var iv = this._iv;
|
|
8414
|
+
var counter = this._counter;
|
|
8415
|
+
if (iv) {
|
|
8416
|
+
counter = this._counter = iv.slice(0);
|
|
8417
|
+
this._iv = void 0;
|
|
8418
|
+
}
|
|
8419
|
+
incCounter(counter);
|
|
8420
|
+
var keystream = counter.slice(0);
|
|
8421
|
+
cipher.encryptBlock(keystream, 0);
|
|
8422
|
+
for (var i = 0; i < blockSize; i++) {
|
|
8423
|
+
words[offset + i] ^= keystream[i];
|
|
8424
|
+
}
|
|
8425
|
+
}
|
|
8426
|
+
});
|
|
8427
|
+
CTRGladman.Decryptor = Encryptor;
|
|
8428
|
+
return CTRGladman;
|
|
8429
|
+
}();
|
|
8430
|
+
return CryptoJS2.mode.CTRGladman;
|
|
8431
|
+
});
|
|
8432
|
+
})(modeCtrGladman);
|
|
8433
|
+
return modeCtrGladman.exports;
|
|
8434
|
+
}
|
|
8435
|
+
var modeOfb = { exports: {} };
|
|
8436
|
+
var hasRequiredModeOfb;
|
|
8437
|
+
function requireModeOfb() {
|
|
8438
|
+
if (hasRequiredModeOfb)
|
|
8439
|
+
return modeOfb.exports;
|
|
8440
|
+
hasRequiredModeOfb = 1;
|
|
8441
|
+
(function(module, exports) {
|
|
8442
|
+
(function(root, factory, undef) {
|
|
8443
|
+
{
|
|
8444
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8445
|
+
}
|
|
8446
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8447
|
+
CryptoJS2.mode.OFB = function() {
|
|
8448
|
+
var OFB = CryptoJS2.lib.BlockCipherMode.extend();
|
|
8449
|
+
var Encryptor = OFB.Encryptor = OFB.extend({
|
|
8450
|
+
processBlock: function(words, offset) {
|
|
8451
|
+
var cipher = this._cipher;
|
|
8452
|
+
var blockSize = cipher.blockSize;
|
|
8453
|
+
var iv = this._iv;
|
|
8454
|
+
var keystream = this._keystream;
|
|
8455
|
+
if (iv) {
|
|
8456
|
+
keystream = this._keystream = iv.slice(0);
|
|
8457
|
+
this._iv = void 0;
|
|
8458
|
+
}
|
|
8459
|
+
cipher.encryptBlock(keystream, 0);
|
|
8460
|
+
for (var i = 0; i < blockSize; i++) {
|
|
8461
|
+
words[offset + i] ^= keystream[i];
|
|
8462
|
+
}
|
|
8463
|
+
}
|
|
8464
|
+
});
|
|
8465
|
+
OFB.Decryptor = Encryptor;
|
|
8466
|
+
return OFB;
|
|
8467
|
+
}();
|
|
8468
|
+
return CryptoJS2.mode.OFB;
|
|
8469
|
+
});
|
|
8470
|
+
})(modeOfb);
|
|
8471
|
+
return modeOfb.exports;
|
|
8472
|
+
}
|
|
8473
|
+
var modeEcb = { exports: {} };
|
|
8474
|
+
var hasRequiredModeEcb;
|
|
8475
|
+
function requireModeEcb() {
|
|
8476
|
+
if (hasRequiredModeEcb)
|
|
8477
|
+
return modeEcb.exports;
|
|
8478
|
+
hasRequiredModeEcb = 1;
|
|
8479
|
+
(function(module, exports) {
|
|
8480
|
+
(function(root, factory, undef) {
|
|
8481
|
+
{
|
|
8482
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8483
|
+
}
|
|
8484
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8485
|
+
CryptoJS2.mode.ECB = function() {
|
|
8486
|
+
var ECB = CryptoJS2.lib.BlockCipherMode.extend();
|
|
8487
|
+
ECB.Encryptor = ECB.extend({
|
|
8488
|
+
processBlock: function(words, offset) {
|
|
8489
|
+
this._cipher.encryptBlock(words, offset);
|
|
8490
|
+
}
|
|
8491
|
+
});
|
|
8492
|
+
ECB.Decryptor = ECB.extend({
|
|
8493
|
+
processBlock: function(words, offset) {
|
|
8494
|
+
this._cipher.decryptBlock(words, offset);
|
|
8495
|
+
}
|
|
8496
|
+
});
|
|
8497
|
+
return ECB;
|
|
8498
|
+
}();
|
|
8499
|
+
return CryptoJS2.mode.ECB;
|
|
8500
|
+
});
|
|
8501
|
+
})(modeEcb);
|
|
8502
|
+
return modeEcb.exports;
|
|
8503
|
+
}
|
|
8504
|
+
var padAnsix923 = { exports: {} };
|
|
8505
|
+
var hasRequiredPadAnsix923;
|
|
8506
|
+
function requirePadAnsix923() {
|
|
8507
|
+
if (hasRequiredPadAnsix923)
|
|
8508
|
+
return padAnsix923.exports;
|
|
8509
|
+
hasRequiredPadAnsix923 = 1;
|
|
8510
|
+
(function(module, exports) {
|
|
8511
|
+
(function(root, factory, undef) {
|
|
8512
|
+
{
|
|
8513
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8514
|
+
}
|
|
8515
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8516
|
+
CryptoJS2.pad.AnsiX923 = {
|
|
8517
|
+
pad: function(data2, blockSize) {
|
|
8518
|
+
var dataSigBytes = data2.sigBytes;
|
|
8519
|
+
var blockSizeBytes = blockSize * 4;
|
|
8520
|
+
var nPaddingBytes = blockSizeBytes - dataSigBytes % blockSizeBytes;
|
|
8521
|
+
var lastBytePos = dataSigBytes + nPaddingBytes - 1;
|
|
8522
|
+
data2.clamp();
|
|
8523
|
+
data2.words[lastBytePos >>> 2] |= nPaddingBytes << 24 - lastBytePos % 4 * 8;
|
|
8524
|
+
data2.sigBytes += nPaddingBytes;
|
|
8525
|
+
},
|
|
8526
|
+
unpad: function(data2) {
|
|
8527
|
+
var nPaddingBytes = data2.words[data2.sigBytes - 1 >>> 2] & 255;
|
|
8528
|
+
data2.sigBytes -= nPaddingBytes;
|
|
8529
|
+
}
|
|
8530
|
+
};
|
|
8531
|
+
return CryptoJS2.pad.Ansix923;
|
|
8532
|
+
});
|
|
8533
|
+
})(padAnsix923);
|
|
8534
|
+
return padAnsix923.exports;
|
|
8535
|
+
}
|
|
8536
|
+
var padIso10126 = { exports: {} };
|
|
8537
|
+
var hasRequiredPadIso10126;
|
|
8538
|
+
function requirePadIso10126() {
|
|
8539
|
+
if (hasRequiredPadIso10126)
|
|
8540
|
+
return padIso10126.exports;
|
|
8541
|
+
hasRequiredPadIso10126 = 1;
|
|
8542
|
+
(function(module, exports) {
|
|
8543
|
+
(function(root, factory, undef) {
|
|
8544
|
+
{
|
|
8545
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8546
|
+
}
|
|
8547
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8548
|
+
CryptoJS2.pad.Iso10126 = {
|
|
8549
|
+
pad: function(data2, blockSize) {
|
|
8550
|
+
var blockSizeBytes = blockSize * 4;
|
|
8551
|
+
var nPaddingBytes = blockSizeBytes - data2.sigBytes % blockSizeBytes;
|
|
8552
|
+
data2.concat(CryptoJS2.lib.WordArray.random(nPaddingBytes - 1)).concat(CryptoJS2.lib.WordArray.create([nPaddingBytes << 24], 1));
|
|
8553
|
+
},
|
|
8554
|
+
unpad: function(data2) {
|
|
8555
|
+
var nPaddingBytes = data2.words[data2.sigBytes - 1 >>> 2] & 255;
|
|
8556
|
+
data2.sigBytes -= nPaddingBytes;
|
|
8557
|
+
}
|
|
8558
|
+
};
|
|
8559
|
+
return CryptoJS2.pad.Iso10126;
|
|
8560
|
+
});
|
|
8561
|
+
})(padIso10126);
|
|
8562
|
+
return padIso10126.exports;
|
|
8563
|
+
}
|
|
8564
|
+
var padIso97971 = { exports: {} };
|
|
8565
|
+
var hasRequiredPadIso97971;
|
|
8566
|
+
function requirePadIso97971() {
|
|
8567
|
+
if (hasRequiredPadIso97971)
|
|
8568
|
+
return padIso97971.exports;
|
|
8569
|
+
hasRequiredPadIso97971 = 1;
|
|
8570
|
+
(function(module, exports) {
|
|
8571
|
+
(function(root, factory, undef) {
|
|
8572
|
+
{
|
|
8573
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8574
|
+
}
|
|
8575
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8576
|
+
CryptoJS2.pad.Iso97971 = {
|
|
8577
|
+
pad: function(data2, blockSize) {
|
|
8578
|
+
data2.concat(CryptoJS2.lib.WordArray.create([2147483648], 1));
|
|
8579
|
+
CryptoJS2.pad.ZeroPadding.pad(data2, blockSize);
|
|
8580
|
+
},
|
|
8581
|
+
unpad: function(data2) {
|
|
8582
|
+
CryptoJS2.pad.ZeroPadding.unpad(data2);
|
|
8583
|
+
data2.sigBytes--;
|
|
8584
|
+
}
|
|
8585
|
+
};
|
|
8586
|
+
return CryptoJS2.pad.Iso97971;
|
|
8587
|
+
});
|
|
8588
|
+
})(padIso97971);
|
|
8589
|
+
return padIso97971.exports;
|
|
8590
|
+
}
|
|
8591
|
+
var padZeropadding = { exports: {} };
|
|
8592
|
+
var hasRequiredPadZeropadding;
|
|
8593
|
+
function requirePadZeropadding() {
|
|
8594
|
+
if (hasRequiredPadZeropadding)
|
|
8595
|
+
return padZeropadding.exports;
|
|
8596
|
+
hasRequiredPadZeropadding = 1;
|
|
8597
|
+
(function(module, exports) {
|
|
8598
|
+
(function(root, factory, undef) {
|
|
8599
|
+
{
|
|
8600
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8601
|
+
}
|
|
8602
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8603
|
+
CryptoJS2.pad.ZeroPadding = {
|
|
8604
|
+
pad: function(data2, blockSize) {
|
|
8605
|
+
var blockSizeBytes = blockSize * 4;
|
|
8606
|
+
data2.clamp();
|
|
8607
|
+
data2.sigBytes += blockSizeBytes - (data2.sigBytes % blockSizeBytes || blockSizeBytes);
|
|
8608
|
+
},
|
|
8609
|
+
unpad: function(data2) {
|
|
8610
|
+
var dataWords = data2.words;
|
|
8611
|
+
var i = data2.sigBytes - 1;
|
|
8612
|
+
for (var i = data2.sigBytes - 1; i >= 0; i--) {
|
|
8613
|
+
if (dataWords[i >>> 2] >>> 24 - i % 4 * 8 & 255) {
|
|
8614
|
+
data2.sigBytes = i + 1;
|
|
8615
|
+
break;
|
|
8616
|
+
}
|
|
8617
|
+
}
|
|
8618
|
+
}
|
|
8619
|
+
};
|
|
8620
|
+
return CryptoJS2.pad.ZeroPadding;
|
|
8621
|
+
});
|
|
8622
|
+
})(padZeropadding);
|
|
8623
|
+
return padZeropadding.exports;
|
|
8624
|
+
}
|
|
8625
|
+
var padNopadding = { exports: {} };
|
|
8626
|
+
var hasRequiredPadNopadding;
|
|
8627
|
+
function requirePadNopadding() {
|
|
8628
|
+
if (hasRequiredPadNopadding)
|
|
8629
|
+
return padNopadding.exports;
|
|
8630
|
+
hasRequiredPadNopadding = 1;
|
|
8631
|
+
(function(module, exports) {
|
|
8632
|
+
(function(root, factory, undef) {
|
|
8633
|
+
{
|
|
8634
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8635
|
+
}
|
|
8636
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8637
|
+
CryptoJS2.pad.NoPadding = {
|
|
8638
|
+
pad: function() {
|
|
8639
|
+
},
|
|
8640
|
+
unpad: function() {
|
|
8641
|
+
}
|
|
8642
|
+
};
|
|
8643
|
+
return CryptoJS2.pad.NoPadding;
|
|
8644
|
+
});
|
|
8645
|
+
})(padNopadding);
|
|
8646
|
+
return padNopadding.exports;
|
|
8647
|
+
}
|
|
8648
|
+
var formatHex = { exports: {} };
|
|
8649
|
+
var hasRequiredFormatHex;
|
|
8650
|
+
function requireFormatHex() {
|
|
8651
|
+
if (hasRequiredFormatHex)
|
|
8652
|
+
return formatHex.exports;
|
|
8653
|
+
hasRequiredFormatHex = 1;
|
|
8654
|
+
(function(module, exports) {
|
|
8655
|
+
(function(root, factory, undef) {
|
|
8656
|
+
{
|
|
8657
|
+
module.exports = factory(requireCore(), requireCipherCore());
|
|
8658
|
+
}
|
|
8659
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8660
|
+
(function(undefined$1) {
|
|
8661
|
+
var C = CryptoJS2;
|
|
8662
|
+
var C_lib = C.lib;
|
|
8663
|
+
var CipherParams = C_lib.CipherParams;
|
|
8664
|
+
var C_enc = C.enc;
|
|
8665
|
+
var Hex = C_enc.Hex;
|
|
8666
|
+
var C_format = C.format;
|
|
8667
|
+
C_format.Hex = {
|
|
8668
|
+
/**
|
|
8669
|
+
* Converts the ciphertext of a cipher params object to a hexadecimally encoded string.
|
|
8670
|
+
*
|
|
8671
|
+
* @param {CipherParams} cipherParams The cipher params object.
|
|
8672
|
+
*
|
|
8673
|
+
* @return {string} The hexadecimally encoded string.
|
|
8674
|
+
*
|
|
8675
|
+
* @static
|
|
8676
|
+
*
|
|
8677
|
+
* @example
|
|
8678
|
+
*
|
|
8679
|
+
* var hexString = CryptoJS.format.Hex.stringify(cipherParams);
|
|
8680
|
+
*/
|
|
8681
|
+
stringify: function(cipherParams) {
|
|
8682
|
+
return cipherParams.ciphertext.toString(Hex);
|
|
8683
|
+
},
|
|
8684
|
+
/**
|
|
8685
|
+
* Converts a hexadecimally encoded ciphertext string to a cipher params object.
|
|
8686
|
+
*
|
|
8687
|
+
* @param {string} input The hexadecimally encoded string.
|
|
8688
|
+
*
|
|
8689
|
+
* @return {CipherParams} The cipher params object.
|
|
8690
|
+
*
|
|
8691
|
+
* @static
|
|
8692
|
+
*
|
|
8693
|
+
* @example
|
|
8694
|
+
*
|
|
8695
|
+
* var cipherParams = CryptoJS.format.Hex.parse(hexString);
|
|
8696
|
+
*/
|
|
8697
|
+
parse: function(input) {
|
|
8698
|
+
var ciphertext = Hex.parse(input);
|
|
8699
|
+
return CipherParams.create({ ciphertext });
|
|
8700
|
+
}
|
|
8701
|
+
};
|
|
8702
|
+
})();
|
|
8703
|
+
return CryptoJS2.format.Hex;
|
|
8704
|
+
});
|
|
8705
|
+
})(formatHex);
|
|
8706
|
+
return formatHex.exports;
|
|
8707
|
+
}
|
|
8708
|
+
var tripledes = { exports: {} };
|
|
8709
|
+
var hasRequiredTripledes;
|
|
8710
|
+
function requireTripledes() {
|
|
8711
|
+
if (hasRequiredTripledes)
|
|
8712
|
+
return tripledes.exports;
|
|
8713
|
+
hasRequiredTripledes = 1;
|
|
8714
|
+
(function(module, exports) {
|
|
8715
|
+
(function(root, factory, undef) {
|
|
8716
|
+
{
|
|
8717
|
+
module.exports = factory(requireCore(), encBase64Exports, requireMd5(), requireEvpkdf(), requireCipherCore());
|
|
8718
|
+
}
|
|
8719
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
8720
|
+
(function() {
|
|
8721
|
+
var C = CryptoJS2;
|
|
8722
|
+
var C_lib = C.lib;
|
|
8723
|
+
var WordArray = C_lib.WordArray;
|
|
8724
|
+
var BlockCipher = C_lib.BlockCipher;
|
|
8725
|
+
var C_algo = C.algo;
|
|
8726
|
+
var PC1 = [
|
|
8727
|
+
57,
|
|
8728
|
+
49,
|
|
8729
|
+
41,
|
|
8730
|
+
33,
|
|
8731
|
+
25,
|
|
8732
|
+
17,
|
|
8733
|
+
9,
|
|
8734
|
+
1,
|
|
8735
|
+
58,
|
|
8736
|
+
50,
|
|
8737
|
+
42,
|
|
8738
|
+
34,
|
|
8739
|
+
26,
|
|
8740
|
+
18,
|
|
8741
|
+
10,
|
|
8742
|
+
2,
|
|
8743
|
+
59,
|
|
8744
|
+
51,
|
|
8745
|
+
43,
|
|
8746
|
+
35,
|
|
8747
|
+
27,
|
|
8748
|
+
19,
|
|
8749
|
+
11,
|
|
8750
|
+
3,
|
|
8751
|
+
60,
|
|
8752
|
+
52,
|
|
8753
|
+
44,
|
|
8754
|
+
36,
|
|
8755
|
+
63,
|
|
8756
|
+
55,
|
|
8757
|
+
47,
|
|
8758
|
+
39,
|
|
8759
|
+
31,
|
|
8760
|
+
23,
|
|
8761
|
+
15,
|
|
8762
|
+
7,
|
|
8763
|
+
62,
|
|
8764
|
+
54,
|
|
8765
|
+
46,
|
|
8766
|
+
38,
|
|
8767
|
+
30,
|
|
8768
|
+
22,
|
|
8769
|
+
14,
|
|
8770
|
+
6,
|
|
8771
|
+
61,
|
|
8772
|
+
53,
|
|
8773
|
+
45,
|
|
8774
|
+
37,
|
|
8775
|
+
29,
|
|
8776
|
+
21,
|
|
8777
|
+
13,
|
|
8778
|
+
5,
|
|
8779
|
+
28,
|
|
8780
|
+
20,
|
|
8781
|
+
12,
|
|
8782
|
+
4
|
|
8783
|
+
];
|
|
8784
|
+
var PC2 = [
|
|
8785
|
+
14,
|
|
8786
|
+
17,
|
|
8787
|
+
11,
|
|
8788
|
+
24,
|
|
8789
|
+
1,
|
|
8790
|
+
5,
|
|
8791
|
+
3,
|
|
8792
|
+
28,
|
|
8793
|
+
15,
|
|
8794
|
+
6,
|
|
8795
|
+
21,
|
|
8796
|
+
10,
|
|
8797
|
+
23,
|
|
8798
|
+
19,
|
|
8799
|
+
12,
|
|
8800
|
+
4,
|
|
8801
|
+
26,
|
|
8802
|
+
8,
|
|
8803
|
+
16,
|
|
8804
|
+
7,
|
|
8805
|
+
27,
|
|
8806
|
+
20,
|
|
8807
|
+
13,
|
|
8808
|
+
2,
|
|
8809
|
+
41,
|
|
8810
|
+
52,
|
|
8811
|
+
31,
|
|
8812
|
+
37,
|
|
8813
|
+
47,
|
|
8814
|
+
55,
|
|
8815
|
+
30,
|
|
8816
|
+
40,
|
|
8817
|
+
51,
|
|
8818
|
+
45,
|
|
8819
|
+
33,
|
|
8820
|
+
48,
|
|
8821
|
+
44,
|
|
8822
|
+
49,
|
|
8823
|
+
39,
|
|
8824
|
+
56,
|
|
8825
|
+
34,
|
|
8826
|
+
53,
|
|
8827
|
+
46,
|
|
8828
|
+
42,
|
|
8829
|
+
50,
|
|
8830
|
+
36,
|
|
8831
|
+
29,
|
|
8832
|
+
32
|
|
8833
|
+
];
|
|
8834
|
+
var BIT_SHIFTS = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28];
|
|
8835
|
+
var SBOX_P = [
|
|
8836
|
+
{
|
|
8837
|
+
0: 8421888,
|
|
8838
|
+
268435456: 32768,
|
|
8839
|
+
536870912: 8421378,
|
|
8840
|
+
805306368: 2,
|
|
8841
|
+
1073741824: 512,
|
|
8842
|
+
1342177280: 8421890,
|
|
8843
|
+
1610612736: 8389122,
|
|
8844
|
+
1879048192: 8388608,
|
|
8845
|
+
2147483648: 514,
|
|
8846
|
+
2415919104: 8389120,
|
|
8847
|
+
2684354560: 33280,
|
|
8848
|
+
2952790016: 8421376,
|
|
8849
|
+
3221225472: 32770,
|
|
8850
|
+
3489660928: 8388610,
|
|
8851
|
+
3758096384: 0,
|
|
8852
|
+
4026531840: 33282,
|
|
8853
|
+
134217728: 0,
|
|
8854
|
+
402653184: 8421890,
|
|
8855
|
+
671088640: 33282,
|
|
8856
|
+
939524096: 32768,
|
|
8857
|
+
1207959552: 8421888,
|
|
8858
|
+
1476395008: 512,
|
|
8859
|
+
1744830464: 8421378,
|
|
8860
|
+
2013265920: 2,
|
|
8861
|
+
2281701376: 8389120,
|
|
8862
|
+
2550136832: 33280,
|
|
8863
|
+
2818572288: 8421376,
|
|
8864
|
+
3087007744: 8389122,
|
|
8865
|
+
3355443200: 8388610,
|
|
8866
|
+
3623878656: 32770,
|
|
8867
|
+
3892314112: 514,
|
|
8868
|
+
4160749568: 8388608,
|
|
8869
|
+
1: 32768,
|
|
8870
|
+
268435457: 2,
|
|
8871
|
+
536870913: 8421888,
|
|
8872
|
+
805306369: 8388608,
|
|
8873
|
+
1073741825: 8421378,
|
|
8874
|
+
1342177281: 33280,
|
|
8875
|
+
1610612737: 512,
|
|
8876
|
+
1879048193: 8389122,
|
|
8877
|
+
2147483649: 8421890,
|
|
8878
|
+
2415919105: 8421376,
|
|
8879
|
+
2684354561: 8388610,
|
|
8880
|
+
2952790017: 33282,
|
|
8881
|
+
3221225473: 514,
|
|
8882
|
+
3489660929: 8389120,
|
|
8883
|
+
3758096385: 32770,
|
|
8884
|
+
4026531841: 0,
|
|
8885
|
+
134217729: 8421890,
|
|
8886
|
+
402653185: 8421376,
|
|
8887
|
+
671088641: 8388608,
|
|
8888
|
+
939524097: 512,
|
|
8889
|
+
1207959553: 32768,
|
|
8890
|
+
1476395009: 8388610,
|
|
8891
|
+
1744830465: 2,
|
|
8892
|
+
2013265921: 33282,
|
|
8893
|
+
2281701377: 32770,
|
|
8894
|
+
2550136833: 8389122,
|
|
8895
|
+
2818572289: 514,
|
|
8896
|
+
3087007745: 8421888,
|
|
8897
|
+
3355443201: 8389120,
|
|
8898
|
+
3623878657: 0,
|
|
8899
|
+
3892314113: 33280,
|
|
8900
|
+
4160749569: 8421378
|
|
8901
|
+
},
|
|
8902
|
+
{
|
|
8903
|
+
0: 1074282512,
|
|
8904
|
+
16777216: 16384,
|
|
8905
|
+
33554432: 524288,
|
|
8906
|
+
50331648: 1074266128,
|
|
8907
|
+
67108864: 1073741840,
|
|
8908
|
+
83886080: 1074282496,
|
|
8909
|
+
100663296: 1073758208,
|
|
8910
|
+
117440512: 16,
|
|
8911
|
+
134217728: 540672,
|
|
8912
|
+
150994944: 1073758224,
|
|
8913
|
+
167772160: 1073741824,
|
|
8914
|
+
184549376: 540688,
|
|
8915
|
+
201326592: 524304,
|
|
8916
|
+
218103808: 0,
|
|
8917
|
+
234881024: 16400,
|
|
8918
|
+
251658240: 1074266112,
|
|
8919
|
+
8388608: 1073758208,
|
|
8920
|
+
25165824: 540688,
|
|
8921
|
+
41943040: 16,
|
|
8922
|
+
58720256: 1073758224,
|
|
8923
|
+
75497472: 1074282512,
|
|
8924
|
+
92274688: 1073741824,
|
|
8925
|
+
109051904: 524288,
|
|
8926
|
+
125829120: 1074266128,
|
|
8927
|
+
142606336: 524304,
|
|
8928
|
+
159383552: 0,
|
|
8929
|
+
176160768: 16384,
|
|
8930
|
+
192937984: 1074266112,
|
|
8931
|
+
209715200: 1073741840,
|
|
8932
|
+
226492416: 540672,
|
|
8933
|
+
243269632: 1074282496,
|
|
8934
|
+
260046848: 16400,
|
|
8935
|
+
268435456: 0,
|
|
8936
|
+
285212672: 1074266128,
|
|
8937
|
+
301989888: 1073758224,
|
|
8938
|
+
318767104: 1074282496,
|
|
8939
|
+
335544320: 1074266112,
|
|
8940
|
+
352321536: 16,
|
|
8941
|
+
369098752: 540688,
|
|
8942
|
+
385875968: 16384,
|
|
8943
|
+
402653184: 16400,
|
|
8944
|
+
419430400: 524288,
|
|
8945
|
+
436207616: 524304,
|
|
8946
|
+
452984832: 1073741840,
|
|
8947
|
+
469762048: 540672,
|
|
8948
|
+
486539264: 1073758208,
|
|
8949
|
+
503316480: 1073741824,
|
|
8950
|
+
520093696: 1074282512,
|
|
8951
|
+
276824064: 540688,
|
|
8952
|
+
293601280: 524288,
|
|
8953
|
+
310378496: 1074266112,
|
|
8954
|
+
327155712: 16384,
|
|
8955
|
+
343932928: 1073758208,
|
|
8956
|
+
360710144: 1074282512,
|
|
8957
|
+
377487360: 16,
|
|
8958
|
+
394264576: 1073741824,
|
|
8959
|
+
411041792: 1074282496,
|
|
8960
|
+
427819008: 1073741840,
|
|
8961
|
+
444596224: 1073758224,
|
|
8962
|
+
461373440: 524304,
|
|
8963
|
+
478150656: 0,
|
|
8964
|
+
494927872: 16400,
|
|
8965
|
+
511705088: 1074266128,
|
|
8966
|
+
528482304: 540672
|
|
8967
|
+
},
|
|
8968
|
+
{
|
|
8969
|
+
0: 260,
|
|
8970
|
+
1048576: 0,
|
|
8971
|
+
2097152: 67109120,
|
|
8972
|
+
3145728: 65796,
|
|
8973
|
+
4194304: 65540,
|
|
8974
|
+
5242880: 67108868,
|
|
8975
|
+
6291456: 67174660,
|
|
8976
|
+
7340032: 67174400,
|
|
8977
|
+
8388608: 67108864,
|
|
8978
|
+
9437184: 67174656,
|
|
8979
|
+
10485760: 65792,
|
|
8980
|
+
11534336: 67174404,
|
|
8981
|
+
12582912: 67109124,
|
|
8982
|
+
13631488: 65536,
|
|
8983
|
+
14680064: 4,
|
|
8984
|
+
15728640: 256,
|
|
8985
|
+
524288: 67174656,
|
|
8986
|
+
1572864: 67174404,
|
|
8987
|
+
2621440: 0,
|
|
8988
|
+
3670016: 67109120,
|
|
8989
|
+
4718592: 67108868,
|
|
8990
|
+
5767168: 65536,
|
|
8991
|
+
6815744: 65540,
|
|
8992
|
+
7864320: 260,
|
|
8993
|
+
8912896: 4,
|
|
8994
|
+
9961472: 256,
|
|
8995
|
+
11010048: 67174400,
|
|
8996
|
+
12058624: 65796,
|
|
8997
|
+
13107200: 65792,
|
|
8998
|
+
14155776: 67109124,
|
|
8999
|
+
15204352: 67174660,
|
|
9000
|
+
16252928: 67108864,
|
|
9001
|
+
16777216: 67174656,
|
|
9002
|
+
17825792: 65540,
|
|
9003
|
+
18874368: 65536,
|
|
9004
|
+
19922944: 67109120,
|
|
9005
|
+
20971520: 256,
|
|
9006
|
+
22020096: 67174660,
|
|
9007
|
+
23068672: 67108868,
|
|
9008
|
+
24117248: 0,
|
|
9009
|
+
25165824: 67109124,
|
|
9010
|
+
26214400: 67108864,
|
|
9011
|
+
27262976: 4,
|
|
9012
|
+
28311552: 65792,
|
|
9013
|
+
29360128: 67174400,
|
|
9014
|
+
30408704: 260,
|
|
9015
|
+
31457280: 65796,
|
|
9016
|
+
32505856: 67174404,
|
|
9017
|
+
17301504: 67108864,
|
|
9018
|
+
18350080: 260,
|
|
9019
|
+
19398656: 67174656,
|
|
9020
|
+
20447232: 0,
|
|
9021
|
+
21495808: 65540,
|
|
9022
|
+
22544384: 67109120,
|
|
9023
|
+
23592960: 256,
|
|
9024
|
+
24641536: 67174404,
|
|
9025
|
+
25690112: 65536,
|
|
9026
|
+
26738688: 67174660,
|
|
9027
|
+
27787264: 65796,
|
|
9028
|
+
28835840: 67108868,
|
|
9029
|
+
29884416: 67109124,
|
|
9030
|
+
30932992: 67174400,
|
|
9031
|
+
31981568: 4,
|
|
9032
|
+
33030144: 65792
|
|
9033
|
+
},
|
|
9034
|
+
{
|
|
9035
|
+
0: 2151682048,
|
|
9036
|
+
65536: 2147487808,
|
|
9037
|
+
131072: 4198464,
|
|
9038
|
+
196608: 2151677952,
|
|
9039
|
+
262144: 0,
|
|
9040
|
+
327680: 4198400,
|
|
9041
|
+
393216: 2147483712,
|
|
9042
|
+
458752: 4194368,
|
|
9043
|
+
524288: 2147483648,
|
|
9044
|
+
589824: 4194304,
|
|
9045
|
+
655360: 64,
|
|
9046
|
+
720896: 2147487744,
|
|
9047
|
+
786432: 2151678016,
|
|
9048
|
+
851968: 4160,
|
|
9049
|
+
917504: 4096,
|
|
9050
|
+
983040: 2151682112,
|
|
9051
|
+
32768: 2147487808,
|
|
9052
|
+
98304: 64,
|
|
9053
|
+
163840: 2151678016,
|
|
9054
|
+
229376: 2147487744,
|
|
9055
|
+
294912: 4198400,
|
|
9056
|
+
360448: 2151682112,
|
|
9057
|
+
425984: 0,
|
|
9058
|
+
491520: 2151677952,
|
|
9059
|
+
557056: 4096,
|
|
9060
|
+
622592: 2151682048,
|
|
9061
|
+
688128: 4194304,
|
|
9062
|
+
753664: 4160,
|
|
9063
|
+
819200: 2147483648,
|
|
9064
|
+
884736: 4194368,
|
|
9065
|
+
950272: 4198464,
|
|
9066
|
+
1015808: 2147483712,
|
|
9067
|
+
1048576: 4194368,
|
|
9068
|
+
1114112: 4198400,
|
|
9069
|
+
1179648: 2147483712,
|
|
9070
|
+
1245184: 0,
|
|
9071
|
+
1310720: 4160,
|
|
9072
|
+
1376256: 2151678016,
|
|
9073
|
+
1441792: 2151682048,
|
|
9074
|
+
1507328: 2147487808,
|
|
9075
|
+
1572864: 2151682112,
|
|
9076
|
+
1638400: 2147483648,
|
|
9077
|
+
1703936: 2151677952,
|
|
9078
|
+
1769472: 4198464,
|
|
9079
|
+
1835008: 2147487744,
|
|
9080
|
+
1900544: 4194304,
|
|
9081
|
+
1966080: 64,
|
|
9082
|
+
2031616: 4096,
|
|
9083
|
+
1081344: 2151677952,
|
|
9084
|
+
1146880: 2151682112,
|
|
9085
|
+
1212416: 0,
|
|
9086
|
+
1277952: 4198400,
|
|
9087
|
+
1343488: 4194368,
|
|
9088
|
+
1409024: 2147483648,
|
|
9089
|
+
1474560: 2147487808,
|
|
9090
|
+
1540096: 64,
|
|
9091
|
+
1605632: 2147483712,
|
|
9092
|
+
1671168: 4096,
|
|
9093
|
+
1736704: 2147487744,
|
|
9094
|
+
1802240: 2151678016,
|
|
9095
|
+
1867776: 4160,
|
|
9096
|
+
1933312: 2151682048,
|
|
9097
|
+
1998848: 4194304,
|
|
9098
|
+
2064384: 4198464
|
|
9099
|
+
},
|
|
9100
|
+
{
|
|
9101
|
+
0: 128,
|
|
9102
|
+
4096: 17039360,
|
|
9103
|
+
8192: 262144,
|
|
9104
|
+
12288: 536870912,
|
|
9105
|
+
16384: 537133184,
|
|
9106
|
+
20480: 16777344,
|
|
9107
|
+
24576: 553648256,
|
|
9108
|
+
28672: 262272,
|
|
9109
|
+
32768: 16777216,
|
|
9110
|
+
36864: 537133056,
|
|
9111
|
+
40960: 536871040,
|
|
9112
|
+
45056: 553910400,
|
|
9113
|
+
49152: 553910272,
|
|
9114
|
+
53248: 0,
|
|
9115
|
+
57344: 17039488,
|
|
9116
|
+
61440: 553648128,
|
|
9117
|
+
2048: 17039488,
|
|
9118
|
+
6144: 553648256,
|
|
9119
|
+
10240: 128,
|
|
9120
|
+
14336: 17039360,
|
|
9121
|
+
18432: 262144,
|
|
9122
|
+
22528: 537133184,
|
|
9123
|
+
26624: 553910272,
|
|
9124
|
+
30720: 536870912,
|
|
9125
|
+
34816: 537133056,
|
|
9126
|
+
38912: 0,
|
|
9127
|
+
43008: 553910400,
|
|
9128
|
+
47104: 16777344,
|
|
9129
|
+
51200: 536871040,
|
|
9130
|
+
55296: 553648128,
|
|
9131
|
+
59392: 16777216,
|
|
9132
|
+
63488: 262272,
|
|
9133
|
+
65536: 262144,
|
|
9134
|
+
69632: 128,
|
|
9135
|
+
73728: 536870912,
|
|
9136
|
+
77824: 553648256,
|
|
9137
|
+
81920: 16777344,
|
|
9138
|
+
86016: 553910272,
|
|
9139
|
+
90112: 537133184,
|
|
9140
|
+
94208: 16777216,
|
|
9141
|
+
98304: 553910400,
|
|
9142
|
+
102400: 553648128,
|
|
9143
|
+
106496: 17039360,
|
|
9144
|
+
110592: 537133056,
|
|
9145
|
+
114688: 262272,
|
|
9146
|
+
118784: 536871040,
|
|
9147
|
+
122880: 0,
|
|
9148
|
+
126976: 17039488,
|
|
9149
|
+
67584: 553648256,
|
|
9150
|
+
71680: 16777216,
|
|
9151
|
+
75776: 17039360,
|
|
9152
|
+
79872: 537133184,
|
|
9153
|
+
83968: 536870912,
|
|
9154
|
+
88064: 17039488,
|
|
9155
|
+
92160: 128,
|
|
9156
|
+
96256: 553910272,
|
|
9157
|
+
100352: 262272,
|
|
9158
|
+
104448: 553910400,
|
|
9159
|
+
108544: 0,
|
|
9160
|
+
112640: 553648128,
|
|
9161
|
+
116736: 16777344,
|
|
9162
|
+
120832: 262144,
|
|
9163
|
+
124928: 537133056,
|
|
9164
|
+
129024: 536871040
|
|
9165
|
+
},
|
|
9166
|
+
{
|
|
9167
|
+
0: 268435464,
|
|
9168
|
+
256: 8192,
|
|
9169
|
+
512: 270532608,
|
|
9170
|
+
768: 270540808,
|
|
9171
|
+
1024: 268443648,
|
|
9172
|
+
1280: 2097152,
|
|
9173
|
+
1536: 2097160,
|
|
9174
|
+
1792: 268435456,
|
|
9175
|
+
2048: 0,
|
|
9176
|
+
2304: 268443656,
|
|
9177
|
+
2560: 2105344,
|
|
9178
|
+
2816: 8,
|
|
9179
|
+
3072: 270532616,
|
|
9180
|
+
3328: 2105352,
|
|
9181
|
+
3584: 8200,
|
|
9182
|
+
3840: 270540800,
|
|
9183
|
+
128: 270532608,
|
|
9184
|
+
384: 270540808,
|
|
9185
|
+
640: 8,
|
|
9186
|
+
896: 2097152,
|
|
9187
|
+
1152: 2105352,
|
|
9188
|
+
1408: 268435464,
|
|
9189
|
+
1664: 268443648,
|
|
9190
|
+
1920: 8200,
|
|
9191
|
+
2176: 2097160,
|
|
9192
|
+
2432: 8192,
|
|
9193
|
+
2688: 268443656,
|
|
9194
|
+
2944: 270532616,
|
|
9195
|
+
3200: 0,
|
|
9196
|
+
3456: 270540800,
|
|
9197
|
+
3712: 2105344,
|
|
9198
|
+
3968: 268435456,
|
|
9199
|
+
4096: 268443648,
|
|
9200
|
+
4352: 270532616,
|
|
9201
|
+
4608: 270540808,
|
|
9202
|
+
4864: 8200,
|
|
9203
|
+
5120: 2097152,
|
|
9204
|
+
5376: 268435456,
|
|
9205
|
+
5632: 268435464,
|
|
9206
|
+
5888: 2105344,
|
|
9207
|
+
6144: 2105352,
|
|
9208
|
+
6400: 0,
|
|
9209
|
+
6656: 8,
|
|
9210
|
+
6912: 270532608,
|
|
9211
|
+
7168: 8192,
|
|
9212
|
+
7424: 268443656,
|
|
9213
|
+
7680: 270540800,
|
|
9214
|
+
7936: 2097160,
|
|
9215
|
+
4224: 8,
|
|
9216
|
+
4480: 2105344,
|
|
9217
|
+
4736: 2097152,
|
|
9218
|
+
4992: 268435464,
|
|
9219
|
+
5248: 268443648,
|
|
9220
|
+
5504: 8200,
|
|
9221
|
+
5760: 270540808,
|
|
9222
|
+
6016: 270532608,
|
|
9223
|
+
6272: 270540800,
|
|
9224
|
+
6528: 270532616,
|
|
9225
|
+
6784: 8192,
|
|
9226
|
+
7040: 2105352,
|
|
9227
|
+
7296: 2097160,
|
|
9228
|
+
7552: 0,
|
|
9229
|
+
7808: 268435456,
|
|
9230
|
+
8064: 268443656
|
|
9231
|
+
},
|
|
9232
|
+
{
|
|
9233
|
+
0: 1048576,
|
|
9234
|
+
16: 33555457,
|
|
9235
|
+
32: 1024,
|
|
9236
|
+
48: 1049601,
|
|
9237
|
+
64: 34604033,
|
|
9238
|
+
80: 0,
|
|
9239
|
+
96: 1,
|
|
9240
|
+
112: 34603009,
|
|
9241
|
+
128: 33555456,
|
|
9242
|
+
144: 1048577,
|
|
9243
|
+
160: 33554433,
|
|
9244
|
+
176: 34604032,
|
|
9245
|
+
192: 34603008,
|
|
9246
|
+
208: 1025,
|
|
9247
|
+
224: 1049600,
|
|
9248
|
+
240: 33554432,
|
|
9249
|
+
8: 34603009,
|
|
9250
|
+
24: 0,
|
|
9251
|
+
40: 33555457,
|
|
9252
|
+
56: 34604032,
|
|
9253
|
+
72: 1048576,
|
|
9254
|
+
88: 33554433,
|
|
9255
|
+
104: 33554432,
|
|
9256
|
+
120: 1025,
|
|
9257
|
+
136: 1049601,
|
|
9258
|
+
152: 33555456,
|
|
9259
|
+
168: 34603008,
|
|
9260
|
+
184: 1048577,
|
|
9261
|
+
200: 1024,
|
|
9262
|
+
216: 34604033,
|
|
9263
|
+
232: 1,
|
|
9264
|
+
248: 1049600,
|
|
9265
|
+
256: 33554432,
|
|
9266
|
+
272: 1048576,
|
|
9267
|
+
288: 33555457,
|
|
9268
|
+
304: 34603009,
|
|
9269
|
+
320: 1048577,
|
|
9270
|
+
336: 33555456,
|
|
9271
|
+
352: 34604032,
|
|
9272
|
+
368: 1049601,
|
|
9273
|
+
384: 1025,
|
|
9274
|
+
400: 34604033,
|
|
9275
|
+
416: 1049600,
|
|
9276
|
+
432: 1,
|
|
9277
|
+
448: 0,
|
|
9278
|
+
464: 34603008,
|
|
9279
|
+
480: 33554433,
|
|
9280
|
+
496: 1024,
|
|
9281
|
+
264: 1049600,
|
|
9282
|
+
280: 33555457,
|
|
9283
|
+
296: 34603009,
|
|
9284
|
+
312: 1,
|
|
9285
|
+
328: 33554432,
|
|
9286
|
+
344: 1048576,
|
|
9287
|
+
360: 1025,
|
|
9288
|
+
376: 34604032,
|
|
9289
|
+
392: 33554433,
|
|
9290
|
+
408: 34603008,
|
|
9291
|
+
424: 0,
|
|
9292
|
+
440: 34604033,
|
|
9293
|
+
456: 1049601,
|
|
9294
|
+
472: 1024,
|
|
9295
|
+
488: 33555456,
|
|
9296
|
+
504: 1048577
|
|
9297
|
+
},
|
|
9298
|
+
{
|
|
9299
|
+
0: 134219808,
|
|
9300
|
+
1: 131072,
|
|
9301
|
+
2: 134217728,
|
|
9302
|
+
3: 32,
|
|
9303
|
+
4: 131104,
|
|
9304
|
+
5: 134350880,
|
|
9305
|
+
6: 134350848,
|
|
9306
|
+
7: 2048,
|
|
9307
|
+
8: 134348800,
|
|
9308
|
+
9: 134219776,
|
|
9309
|
+
10: 133120,
|
|
9310
|
+
11: 134348832,
|
|
9311
|
+
12: 2080,
|
|
9312
|
+
13: 0,
|
|
9313
|
+
14: 134217760,
|
|
9314
|
+
15: 133152,
|
|
9315
|
+
2147483648: 2048,
|
|
9316
|
+
2147483649: 134350880,
|
|
9317
|
+
2147483650: 134219808,
|
|
9318
|
+
2147483651: 134217728,
|
|
9319
|
+
2147483652: 134348800,
|
|
9320
|
+
2147483653: 133120,
|
|
9321
|
+
2147483654: 133152,
|
|
9322
|
+
2147483655: 32,
|
|
9323
|
+
2147483656: 134217760,
|
|
9324
|
+
2147483657: 2080,
|
|
9325
|
+
2147483658: 131104,
|
|
9326
|
+
2147483659: 134350848,
|
|
9327
|
+
2147483660: 0,
|
|
9328
|
+
2147483661: 134348832,
|
|
9329
|
+
2147483662: 134219776,
|
|
9330
|
+
2147483663: 131072,
|
|
9331
|
+
16: 133152,
|
|
9332
|
+
17: 134350848,
|
|
9333
|
+
18: 32,
|
|
9334
|
+
19: 2048,
|
|
9335
|
+
20: 134219776,
|
|
9336
|
+
21: 134217760,
|
|
9337
|
+
22: 134348832,
|
|
9338
|
+
23: 131072,
|
|
9339
|
+
24: 0,
|
|
9340
|
+
25: 131104,
|
|
9341
|
+
26: 134348800,
|
|
9342
|
+
27: 134219808,
|
|
9343
|
+
28: 134350880,
|
|
9344
|
+
29: 133120,
|
|
9345
|
+
30: 2080,
|
|
9346
|
+
31: 134217728,
|
|
9347
|
+
2147483664: 131072,
|
|
9348
|
+
2147483665: 2048,
|
|
9349
|
+
2147483666: 134348832,
|
|
9350
|
+
2147483667: 133152,
|
|
9351
|
+
2147483668: 32,
|
|
9352
|
+
2147483669: 134348800,
|
|
9353
|
+
2147483670: 134217728,
|
|
9354
|
+
2147483671: 134219808,
|
|
9355
|
+
2147483672: 134350880,
|
|
9356
|
+
2147483673: 134217760,
|
|
9357
|
+
2147483674: 134219776,
|
|
9358
|
+
2147483675: 0,
|
|
9359
|
+
2147483676: 133120,
|
|
9360
|
+
2147483677: 2080,
|
|
9361
|
+
2147483678: 131104,
|
|
9362
|
+
2147483679: 134350848
|
|
9363
|
+
}
|
|
9364
|
+
];
|
|
9365
|
+
var SBOX_MASK = [
|
|
9366
|
+
4160749569,
|
|
9367
|
+
528482304,
|
|
9368
|
+
33030144,
|
|
9369
|
+
2064384,
|
|
9370
|
+
129024,
|
|
9371
|
+
8064,
|
|
9372
|
+
504,
|
|
9373
|
+
2147483679
|
|
9374
|
+
];
|
|
9375
|
+
var DES = C_algo.DES = BlockCipher.extend({
|
|
9376
|
+
_doReset: function() {
|
|
9377
|
+
var key = this._key;
|
|
9378
|
+
var keyWords = key.words;
|
|
9379
|
+
var keyBits = [];
|
|
9380
|
+
for (var i = 0; i < 56; i++) {
|
|
9381
|
+
var keyBitPos = PC1[i] - 1;
|
|
9382
|
+
keyBits[i] = keyWords[keyBitPos >>> 5] >>> 31 - keyBitPos % 32 & 1;
|
|
9383
|
+
}
|
|
9384
|
+
var subKeys = this._subKeys = [];
|
|
9385
|
+
for (var nSubKey = 0; nSubKey < 16; nSubKey++) {
|
|
9386
|
+
var subKey = subKeys[nSubKey] = [];
|
|
9387
|
+
var bitShift = BIT_SHIFTS[nSubKey];
|
|
9388
|
+
for (var i = 0; i < 24; i++) {
|
|
9389
|
+
subKey[i / 6 | 0] |= keyBits[(PC2[i] - 1 + bitShift) % 28] << 31 - i % 6;
|
|
9390
|
+
subKey[4 + (i / 6 | 0)] |= keyBits[28 + (PC2[i + 24] - 1 + bitShift) % 28] << 31 - i % 6;
|
|
9391
|
+
}
|
|
9392
|
+
subKey[0] = subKey[0] << 1 | subKey[0] >>> 31;
|
|
9393
|
+
for (var i = 1; i < 7; i++) {
|
|
9394
|
+
subKey[i] = subKey[i] >>> (i - 1) * 4 + 3;
|
|
9395
|
+
}
|
|
9396
|
+
subKey[7] = subKey[7] << 5 | subKey[7] >>> 27;
|
|
9397
|
+
}
|
|
9398
|
+
var invSubKeys = this._invSubKeys = [];
|
|
9399
|
+
for (var i = 0; i < 16; i++) {
|
|
9400
|
+
invSubKeys[i] = subKeys[15 - i];
|
|
9401
|
+
}
|
|
9402
|
+
},
|
|
9403
|
+
encryptBlock: function(M, offset) {
|
|
9404
|
+
this._doCryptBlock(M, offset, this._subKeys);
|
|
9405
|
+
},
|
|
9406
|
+
decryptBlock: function(M, offset) {
|
|
9407
|
+
this._doCryptBlock(M, offset, this._invSubKeys);
|
|
9408
|
+
},
|
|
9409
|
+
_doCryptBlock: function(M, offset, subKeys) {
|
|
9410
|
+
this._lBlock = M[offset];
|
|
9411
|
+
this._rBlock = M[offset + 1];
|
|
9412
|
+
exchangeLR.call(this, 4, 252645135);
|
|
9413
|
+
exchangeLR.call(this, 16, 65535);
|
|
9414
|
+
exchangeRL.call(this, 2, 858993459);
|
|
9415
|
+
exchangeRL.call(this, 8, 16711935);
|
|
9416
|
+
exchangeLR.call(this, 1, 1431655765);
|
|
9417
|
+
for (var round = 0; round < 16; round++) {
|
|
9418
|
+
var subKey = subKeys[round];
|
|
9419
|
+
var lBlock = this._lBlock;
|
|
9420
|
+
var rBlock = this._rBlock;
|
|
9421
|
+
var f = 0;
|
|
9422
|
+
for (var i = 0; i < 8; i++) {
|
|
9423
|
+
f |= SBOX_P[i][((rBlock ^ subKey[i]) & SBOX_MASK[i]) >>> 0];
|
|
9424
|
+
}
|
|
9425
|
+
this._lBlock = rBlock;
|
|
9426
|
+
this._rBlock = lBlock ^ f;
|
|
9427
|
+
}
|
|
9428
|
+
var t = this._lBlock;
|
|
9429
|
+
this._lBlock = this._rBlock;
|
|
9430
|
+
this._rBlock = t;
|
|
9431
|
+
exchangeLR.call(this, 1, 1431655765);
|
|
9432
|
+
exchangeRL.call(this, 8, 16711935);
|
|
9433
|
+
exchangeRL.call(this, 2, 858993459);
|
|
9434
|
+
exchangeLR.call(this, 16, 65535);
|
|
9435
|
+
exchangeLR.call(this, 4, 252645135);
|
|
9436
|
+
M[offset] = this._lBlock;
|
|
9437
|
+
M[offset + 1] = this._rBlock;
|
|
9438
|
+
},
|
|
9439
|
+
keySize: 64 / 32,
|
|
9440
|
+
ivSize: 64 / 32,
|
|
9441
|
+
blockSize: 64 / 32
|
|
9442
|
+
});
|
|
9443
|
+
function exchangeLR(offset, mask) {
|
|
9444
|
+
var t = (this._lBlock >>> offset ^ this._rBlock) & mask;
|
|
9445
|
+
this._rBlock ^= t;
|
|
9446
|
+
this._lBlock ^= t << offset;
|
|
9447
|
+
}
|
|
9448
|
+
function exchangeRL(offset, mask) {
|
|
9449
|
+
var t = (this._rBlock >>> offset ^ this._lBlock) & mask;
|
|
9450
|
+
this._lBlock ^= t;
|
|
9451
|
+
this._rBlock ^= t << offset;
|
|
9452
|
+
}
|
|
9453
|
+
C.DES = BlockCipher._createHelper(DES);
|
|
9454
|
+
var TripleDES = C_algo.TripleDES = BlockCipher.extend({
|
|
9455
|
+
_doReset: function() {
|
|
9456
|
+
var key = this._key;
|
|
9457
|
+
var keyWords = key.words;
|
|
9458
|
+
if (keyWords.length !== 2 && keyWords.length !== 4 && keyWords.length < 6) {
|
|
9459
|
+
throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");
|
|
9460
|
+
}
|
|
9461
|
+
var key1 = keyWords.slice(0, 2);
|
|
9462
|
+
var key2 = keyWords.length < 4 ? keyWords.slice(0, 2) : keyWords.slice(2, 4);
|
|
9463
|
+
var key3 = keyWords.length < 6 ? keyWords.slice(0, 2) : keyWords.slice(4, 6);
|
|
9464
|
+
this._des1 = DES.createEncryptor(WordArray.create(key1));
|
|
9465
|
+
this._des2 = DES.createEncryptor(WordArray.create(key2));
|
|
9466
|
+
this._des3 = DES.createEncryptor(WordArray.create(key3));
|
|
9467
|
+
},
|
|
9468
|
+
encryptBlock: function(M, offset) {
|
|
9469
|
+
this._des1.encryptBlock(M, offset);
|
|
9470
|
+
this._des2.decryptBlock(M, offset);
|
|
9471
|
+
this._des3.encryptBlock(M, offset);
|
|
9472
|
+
},
|
|
9473
|
+
decryptBlock: function(M, offset) {
|
|
9474
|
+
this._des3.decryptBlock(M, offset);
|
|
9475
|
+
this._des2.encryptBlock(M, offset);
|
|
9476
|
+
this._des1.decryptBlock(M, offset);
|
|
9477
|
+
},
|
|
9478
|
+
keySize: 192 / 32,
|
|
9479
|
+
ivSize: 64 / 32,
|
|
9480
|
+
blockSize: 64 / 32
|
|
9481
|
+
});
|
|
9482
|
+
C.TripleDES = BlockCipher._createHelper(TripleDES);
|
|
9483
|
+
})();
|
|
9484
|
+
return CryptoJS2.TripleDES;
|
|
9485
|
+
});
|
|
9486
|
+
})(tripledes);
|
|
9487
|
+
return tripledes.exports;
|
|
9488
|
+
}
|
|
9489
|
+
var rc4 = { exports: {} };
|
|
9490
|
+
var hasRequiredRc4;
|
|
9491
|
+
function requireRc4() {
|
|
9492
|
+
if (hasRequiredRc4)
|
|
9493
|
+
return rc4.exports;
|
|
9494
|
+
hasRequiredRc4 = 1;
|
|
9495
|
+
(function(module, exports) {
|
|
9496
|
+
(function(root, factory, undef) {
|
|
9497
|
+
{
|
|
9498
|
+
module.exports = factory(requireCore(), encBase64Exports, requireMd5(), requireEvpkdf(), requireCipherCore());
|
|
9499
|
+
}
|
|
9500
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
9501
|
+
(function() {
|
|
9502
|
+
var C = CryptoJS2;
|
|
9503
|
+
var C_lib = C.lib;
|
|
9504
|
+
var StreamCipher = C_lib.StreamCipher;
|
|
9505
|
+
var C_algo = C.algo;
|
|
9506
|
+
var RC4 = C_algo.RC4 = StreamCipher.extend({
|
|
9507
|
+
_doReset: function() {
|
|
9508
|
+
var key = this._key;
|
|
9509
|
+
var keyWords = key.words;
|
|
9510
|
+
var keySigBytes = key.sigBytes;
|
|
9511
|
+
var S = this._S = [];
|
|
9512
|
+
for (var i = 0; i < 256; i++) {
|
|
9513
|
+
S[i] = i;
|
|
9514
|
+
}
|
|
9515
|
+
for (var i = 0, j = 0; i < 256; i++) {
|
|
9516
|
+
var keyByteIndex = i % keySigBytes;
|
|
9517
|
+
var keyByte = keyWords[keyByteIndex >>> 2] >>> 24 - keyByteIndex % 4 * 8 & 255;
|
|
9518
|
+
j = (j + S[i] + keyByte) % 256;
|
|
9519
|
+
var t = S[i];
|
|
9520
|
+
S[i] = S[j];
|
|
9521
|
+
S[j] = t;
|
|
9522
|
+
}
|
|
9523
|
+
this._i = this._j = 0;
|
|
9524
|
+
},
|
|
9525
|
+
_doProcessBlock: function(M, offset) {
|
|
9526
|
+
M[offset] ^= generateKeystreamWord.call(this);
|
|
9527
|
+
},
|
|
9528
|
+
keySize: 256 / 32,
|
|
9529
|
+
ivSize: 0
|
|
9530
|
+
});
|
|
9531
|
+
function generateKeystreamWord() {
|
|
9532
|
+
var S = this._S;
|
|
9533
|
+
var i = this._i;
|
|
9534
|
+
var j = this._j;
|
|
9535
|
+
var keystreamWord = 0;
|
|
9536
|
+
for (var n = 0; n < 4; n++) {
|
|
9537
|
+
i = (i + 1) % 256;
|
|
9538
|
+
j = (j + S[i]) % 256;
|
|
9539
|
+
var t = S[i];
|
|
9540
|
+
S[i] = S[j];
|
|
9541
|
+
S[j] = t;
|
|
9542
|
+
keystreamWord |= S[(S[i] + S[j]) % 256] << 24 - n * 8;
|
|
9543
|
+
}
|
|
9544
|
+
this._i = i;
|
|
9545
|
+
this._j = j;
|
|
9546
|
+
return keystreamWord;
|
|
9547
|
+
}
|
|
9548
|
+
C.RC4 = StreamCipher._createHelper(RC4);
|
|
9549
|
+
var RC4Drop = C_algo.RC4Drop = RC4.extend({
|
|
9550
|
+
/**
|
|
9551
|
+
* Configuration options.
|
|
9552
|
+
*
|
|
9553
|
+
* @property {number} drop The number of keystream words to drop. Default 192
|
|
9554
|
+
*/
|
|
9555
|
+
cfg: RC4.cfg.extend({
|
|
9556
|
+
drop: 192
|
|
9557
|
+
}),
|
|
9558
|
+
_doReset: function() {
|
|
9559
|
+
RC4._doReset.call(this);
|
|
9560
|
+
for (var i = this.cfg.drop; i > 0; i--) {
|
|
9561
|
+
generateKeystreamWord.call(this);
|
|
9562
|
+
}
|
|
9563
|
+
}
|
|
9564
|
+
});
|
|
9565
|
+
C.RC4Drop = StreamCipher._createHelper(RC4Drop);
|
|
9566
|
+
})();
|
|
9567
|
+
return CryptoJS2.RC4;
|
|
9568
|
+
});
|
|
9569
|
+
})(rc4);
|
|
9570
|
+
return rc4.exports;
|
|
9571
|
+
}
|
|
9572
|
+
var rabbit = { exports: {} };
|
|
9573
|
+
var hasRequiredRabbit;
|
|
9574
|
+
function requireRabbit() {
|
|
9575
|
+
if (hasRequiredRabbit)
|
|
9576
|
+
return rabbit.exports;
|
|
9577
|
+
hasRequiredRabbit = 1;
|
|
9578
|
+
(function(module, exports) {
|
|
9579
|
+
(function(root, factory, undef) {
|
|
9580
|
+
{
|
|
9581
|
+
module.exports = factory(requireCore(), encBase64Exports, requireMd5(), requireEvpkdf(), requireCipherCore());
|
|
9582
|
+
}
|
|
9583
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
9584
|
+
(function() {
|
|
9585
|
+
var C = CryptoJS2;
|
|
9586
|
+
var C_lib = C.lib;
|
|
9587
|
+
var StreamCipher = C_lib.StreamCipher;
|
|
9588
|
+
var C_algo = C.algo;
|
|
9589
|
+
var S = [];
|
|
9590
|
+
var C_ = [];
|
|
9591
|
+
var G = [];
|
|
9592
|
+
var Rabbit = C_algo.Rabbit = StreamCipher.extend({
|
|
9593
|
+
_doReset: function() {
|
|
9594
|
+
var K = this._key.words;
|
|
9595
|
+
var iv = this.cfg.iv;
|
|
9596
|
+
for (var i = 0; i < 4; i++) {
|
|
9597
|
+
K[i] = (K[i] << 8 | K[i] >>> 24) & 16711935 | (K[i] << 24 | K[i] >>> 8) & 4278255360;
|
|
9598
|
+
}
|
|
9599
|
+
var X = this._X = [
|
|
9600
|
+
K[0],
|
|
9601
|
+
K[3] << 16 | K[2] >>> 16,
|
|
9602
|
+
K[1],
|
|
9603
|
+
K[0] << 16 | K[3] >>> 16,
|
|
9604
|
+
K[2],
|
|
9605
|
+
K[1] << 16 | K[0] >>> 16,
|
|
9606
|
+
K[3],
|
|
9607
|
+
K[2] << 16 | K[1] >>> 16
|
|
9608
|
+
];
|
|
9609
|
+
var C2 = this._C = [
|
|
9610
|
+
K[2] << 16 | K[2] >>> 16,
|
|
9611
|
+
K[0] & 4294901760 | K[1] & 65535,
|
|
9612
|
+
K[3] << 16 | K[3] >>> 16,
|
|
9613
|
+
K[1] & 4294901760 | K[2] & 65535,
|
|
9614
|
+
K[0] << 16 | K[0] >>> 16,
|
|
9615
|
+
K[2] & 4294901760 | K[3] & 65535,
|
|
9616
|
+
K[1] << 16 | K[1] >>> 16,
|
|
9617
|
+
K[3] & 4294901760 | K[0] & 65535
|
|
9618
|
+
];
|
|
9619
|
+
this._b = 0;
|
|
9620
|
+
for (var i = 0; i < 4; i++) {
|
|
9621
|
+
nextState.call(this);
|
|
9622
|
+
}
|
|
9623
|
+
for (var i = 0; i < 8; i++) {
|
|
9624
|
+
C2[i] ^= X[i + 4 & 7];
|
|
9625
|
+
}
|
|
9626
|
+
if (iv) {
|
|
9627
|
+
var IV = iv.words;
|
|
9628
|
+
var IV_0 = IV[0];
|
|
9629
|
+
var IV_1 = IV[1];
|
|
9630
|
+
var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
|
|
9631
|
+
var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
|
|
9632
|
+
var i1 = i0 >>> 16 | i2 & 4294901760;
|
|
9633
|
+
var i3 = i2 << 16 | i0 & 65535;
|
|
9634
|
+
C2[0] ^= i0;
|
|
9635
|
+
C2[1] ^= i1;
|
|
9636
|
+
C2[2] ^= i2;
|
|
9637
|
+
C2[3] ^= i3;
|
|
9638
|
+
C2[4] ^= i0;
|
|
9639
|
+
C2[5] ^= i1;
|
|
9640
|
+
C2[6] ^= i2;
|
|
9641
|
+
C2[7] ^= i3;
|
|
9642
|
+
for (var i = 0; i < 4; i++) {
|
|
9643
|
+
nextState.call(this);
|
|
9644
|
+
}
|
|
9645
|
+
}
|
|
9646
|
+
},
|
|
9647
|
+
_doProcessBlock: function(M, offset) {
|
|
9648
|
+
var X = this._X;
|
|
9649
|
+
nextState.call(this);
|
|
9650
|
+
S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
|
|
9651
|
+
S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
|
|
9652
|
+
S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
|
|
9653
|
+
S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
|
|
9654
|
+
for (var i = 0; i < 4; i++) {
|
|
9655
|
+
S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
|
|
9656
|
+
M[offset + i] ^= S[i];
|
|
9657
|
+
}
|
|
9658
|
+
},
|
|
9659
|
+
blockSize: 128 / 32,
|
|
9660
|
+
ivSize: 64 / 32
|
|
9661
|
+
});
|
|
9662
|
+
function nextState() {
|
|
9663
|
+
var X = this._X;
|
|
9664
|
+
var C2 = this._C;
|
|
9665
|
+
for (var i = 0; i < 8; i++) {
|
|
9666
|
+
C_[i] = C2[i];
|
|
9667
|
+
}
|
|
9668
|
+
C2[0] = C2[0] + 1295307597 + this._b | 0;
|
|
9669
|
+
C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
|
|
9670
|
+
C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
|
|
9671
|
+
C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
|
|
9672
|
+
C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
|
|
9673
|
+
C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
|
|
9674
|
+
C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
|
|
9675
|
+
C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
|
|
9676
|
+
this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
|
|
9677
|
+
for (var i = 0; i < 8; i++) {
|
|
9678
|
+
var gx = X[i] + C2[i];
|
|
9679
|
+
var ga = gx & 65535;
|
|
9680
|
+
var gb = gx >>> 16;
|
|
9681
|
+
var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
|
|
9682
|
+
var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
|
|
9683
|
+
G[i] = gh ^ gl;
|
|
9684
|
+
}
|
|
9685
|
+
X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
|
|
9686
|
+
X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
|
|
9687
|
+
X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
|
|
9688
|
+
X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
|
|
9689
|
+
X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
|
|
9690
|
+
X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
|
|
9691
|
+
X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
|
|
9692
|
+
X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
|
|
9693
|
+
}
|
|
9694
|
+
C.Rabbit = StreamCipher._createHelper(Rabbit);
|
|
9695
|
+
})();
|
|
9696
|
+
return CryptoJS2.Rabbit;
|
|
9697
|
+
});
|
|
9698
|
+
})(rabbit);
|
|
9699
|
+
return rabbit.exports;
|
|
9700
|
+
}
|
|
9701
|
+
var rabbitLegacy = { exports: {} };
|
|
9702
|
+
var hasRequiredRabbitLegacy;
|
|
9703
|
+
function requireRabbitLegacy() {
|
|
9704
|
+
if (hasRequiredRabbitLegacy)
|
|
9705
|
+
return rabbitLegacy.exports;
|
|
9706
|
+
hasRequiredRabbitLegacy = 1;
|
|
9707
|
+
(function(module, exports) {
|
|
9708
|
+
(function(root, factory, undef) {
|
|
9709
|
+
{
|
|
9710
|
+
module.exports = factory(requireCore(), encBase64Exports, requireMd5(), requireEvpkdf(), requireCipherCore());
|
|
9711
|
+
}
|
|
9712
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
9713
|
+
(function() {
|
|
9714
|
+
var C = CryptoJS2;
|
|
9715
|
+
var C_lib = C.lib;
|
|
9716
|
+
var StreamCipher = C_lib.StreamCipher;
|
|
9717
|
+
var C_algo = C.algo;
|
|
9718
|
+
var S = [];
|
|
9719
|
+
var C_ = [];
|
|
9720
|
+
var G = [];
|
|
9721
|
+
var RabbitLegacy = C_algo.RabbitLegacy = StreamCipher.extend({
|
|
9722
|
+
_doReset: function() {
|
|
9723
|
+
var K = this._key.words;
|
|
9724
|
+
var iv = this.cfg.iv;
|
|
9725
|
+
var X = this._X = [
|
|
9726
|
+
K[0],
|
|
9727
|
+
K[3] << 16 | K[2] >>> 16,
|
|
9728
|
+
K[1],
|
|
9729
|
+
K[0] << 16 | K[3] >>> 16,
|
|
9730
|
+
K[2],
|
|
9731
|
+
K[1] << 16 | K[0] >>> 16,
|
|
9732
|
+
K[3],
|
|
9733
|
+
K[2] << 16 | K[1] >>> 16
|
|
9734
|
+
];
|
|
9735
|
+
var C2 = this._C = [
|
|
9736
|
+
K[2] << 16 | K[2] >>> 16,
|
|
9737
|
+
K[0] & 4294901760 | K[1] & 65535,
|
|
9738
|
+
K[3] << 16 | K[3] >>> 16,
|
|
9739
|
+
K[1] & 4294901760 | K[2] & 65535,
|
|
9740
|
+
K[0] << 16 | K[0] >>> 16,
|
|
9741
|
+
K[2] & 4294901760 | K[3] & 65535,
|
|
9742
|
+
K[1] << 16 | K[1] >>> 16,
|
|
9743
|
+
K[3] & 4294901760 | K[0] & 65535
|
|
9744
|
+
];
|
|
9745
|
+
this._b = 0;
|
|
9746
|
+
for (var i = 0; i < 4; i++) {
|
|
9747
|
+
nextState.call(this);
|
|
9748
|
+
}
|
|
9749
|
+
for (var i = 0; i < 8; i++) {
|
|
9750
|
+
C2[i] ^= X[i + 4 & 7];
|
|
9751
|
+
}
|
|
9752
|
+
if (iv) {
|
|
9753
|
+
var IV = iv.words;
|
|
9754
|
+
var IV_0 = IV[0];
|
|
9755
|
+
var IV_1 = IV[1];
|
|
9756
|
+
var i0 = (IV_0 << 8 | IV_0 >>> 24) & 16711935 | (IV_0 << 24 | IV_0 >>> 8) & 4278255360;
|
|
9757
|
+
var i2 = (IV_1 << 8 | IV_1 >>> 24) & 16711935 | (IV_1 << 24 | IV_1 >>> 8) & 4278255360;
|
|
9758
|
+
var i1 = i0 >>> 16 | i2 & 4294901760;
|
|
9759
|
+
var i3 = i2 << 16 | i0 & 65535;
|
|
9760
|
+
C2[0] ^= i0;
|
|
9761
|
+
C2[1] ^= i1;
|
|
9762
|
+
C2[2] ^= i2;
|
|
9763
|
+
C2[3] ^= i3;
|
|
9764
|
+
C2[4] ^= i0;
|
|
9765
|
+
C2[5] ^= i1;
|
|
9766
|
+
C2[6] ^= i2;
|
|
9767
|
+
C2[7] ^= i3;
|
|
9768
|
+
for (var i = 0; i < 4; i++) {
|
|
9769
|
+
nextState.call(this);
|
|
9770
|
+
}
|
|
9771
|
+
}
|
|
9772
|
+
},
|
|
9773
|
+
_doProcessBlock: function(M, offset) {
|
|
9774
|
+
var X = this._X;
|
|
9775
|
+
nextState.call(this);
|
|
9776
|
+
S[0] = X[0] ^ X[5] >>> 16 ^ X[3] << 16;
|
|
9777
|
+
S[1] = X[2] ^ X[7] >>> 16 ^ X[5] << 16;
|
|
9778
|
+
S[2] = X[4] ^ X[1] >>> 16 ^ X[7] << 16;
|
|
9779
|
+
S[3] = X[6] ^ X[3] >>> 16 ^ X[1] << 16;
|
|
9780
|
+
for (var i = 0; i < 4; i++) {
|
|
9781
|
+
S[i] = (S[i] << 8 | S[i] >>> 24) & 16711935 | (S[i] << 24 | S[i] >>> 8) & 4278255360;
|
|
9782
|
+
M[offset + i] ^= S[i];
|
|
9783
|
+
}
|
|
9784
|
+
},
|
|
9785
|
+
blockSize: 128 / 32,
|
|
9786
|
+
ivSize: 64 / 32
|
|
9787
|
+
});
|
|
9788
|
+
function nextState() {
|
|
9789
|
+
var X = this._X;
|
|
9790
|
+
var C2 = this._C;
|
|
9791
|
+
for (var i = 0; i < 8; i++) {
|
|
9792
|
+
C_[i] = C2[i];
|
|
9793
|
+
}
|
|
9794
|
+
C2[0] = C2[0] + 1295307597 + this._b | 0;
|
|
9795
|
+
C2[1] = C2[1] + 3545052371 + (C2[0] >>> 0 < C_[0] >>> 0 ? 1 : 0) | 0;
|
|
9796
|
+
C2[2] = C2[2] + 886263092 + (C2[1] >>> 0 < C_[1] >>> 0 ? 1 : 0) | 0;
|
|
9797
|
+
C2[3] = C2[3] + 1295307597 + (C2[2] >>> 0 < C_[2] >>> 0 ? 1 : 0) | 0;
|
|
9798
|
+
C2[4] = C2[4] + 3545052371 + (C2[3] >>> 0 < C_[3] >>> 0 ? 1 : 0) | 0;
|
|
9799
|
+
C2[5] = C2[5] + 886263092 + (C2[4] >>> 0 < C_[4] >>> 0 ? 1 : 0) | 0;
|
|
9800
|
+
C2[6] = C2[6] + 1295307597 + (C2[5] >>> 0 < C_[5] >>> 0 ? 1 : 0) | 0;
|
|
9801
|
+
C2[7] = C2[7] + 3545052371 + (C2[6] >>> 0 < C_[6] >>> 0 ? 1 : 0) | 0;
|
|
9802
|
+
this._b = C2[7] >>> 0 < C_[7] >>> 0 ? 1 : 0;
|
|
9803
|
+
for (var i = 0; i < 8; i++) {
|
|
9804
|
+
var gx = X[i] + C2[i];
|
|
9805
|
+
var ga = gx & 65535;
|
|
9806
|
+
var gb = gx >>> 16;
|
|
9807
|
+
var gh = ((ga * ga >>> 17) + ga * gb >>> 15) + gb * gb;
|
|
9808
|
+
var gl = ((gx & 4294901760) * gx | 0) + ((gx & 65535) * gx | 0);
|
|
9809
|
+
G[i] = gh ^ gl;
|
|
9810
|
+
}
|
|
9811
|
+
X[0] = G[0] + (G[7] << 16 | G[7] >>> 16) + (G[6] << 16 | G[6] >>> 16) | 0;
|
|
9812
|
+
X[1] = G[1] + (G[0] << 8 | G[0] >>> 24) + G[7] | 0;
|
|
9813
|
+
X[2] = G[2] + (G[1] << 16 | G[1] >>> 16) + (G[0] << 16 | G[0] >>> 16) | 0;
|
|
9814
|
+
X[3] = G[3] + (G[2] << 8 | G[2] >>> 24) + G[1] | 0;
|
|
9815
|
+
X[4] = G[4] + (G[3] << 16 | G[3] >>> 16) + (G[2] << 16 | G[2] >>> 16) | 0;
|
|
9816
|
+
X[5] = G[5] + (G[4] << 8 | G[4] >>> 24) + G[3] | 0;
|
|
9817
|
+
X[6] = G[6] + (G[5] << 16 | G[5] >>> 16) + (G[4] << 16 | G[4] >>> 16) | 0;
|
|
9818
|
+
X[7] = G[7] + (G[6] << 8 | G[6] >>> 24) + G[5] | 0;
|
|
9819
|
+
}
|
|
9820
|
+
C.RabbitLegacy = StreamCipher._createHelper(RabbitLegacy);
|
|
9821
|
+
})();
|
|
9822
|
+
return CryptoJS2.RabbitLegacy;
|
|
9823
|
+
});
|
|
9824
|
+
})(rabbitLegacy);
|
|
9825
|
+
return rabbitLegacy.exports;
|
|
9826
|
+
}
|
|
9827
|
+
(function(module, exports) {
|
|
9828
|
+
(function(root, factory, undef) {
|
|
9829
|
+
{
|
|
9830
|
+
module.exports = factory(requireCore(), requireX64Core(), requireLibTypedarrays(), requireEncUtf16(), encBase64Exports, requireEncBase64url(), requireMd5(), requireSha1(), requireSha256(), requireSha224(), requireSha512(), requireSha384(), requireSha3(), requireRipemd160(), requireHmac(), requirePbkdf2(), requireEvpkdf(), requireCipherCore(), requireModeCfb(), requireModeCtr(), requireModeCtrGladman(), requireModeOfb(), requireModeEcb(), requirePadAnsix923(), requirePadIso10126(), requirePadIso97971(), requirePadZeropadding(), requirePadNopadding(), requireFormatHex(), requireAes(), requireTripledes(), requireRc4(), requireRabbit(), requireRabbitLegacy());
|
|
9831
|
+
}
|
|
9832
|
+
})(commonjsGlobal, function(CryptoJS2) {
|
|
9833
|
+
return CryptoJS2;
|
|
9834
|
+
});
|
|
9835
|
+
})(cryptoJs);
|
|
9836
|
+
var cryptoJsExports = cryptoJs.exports;
|
|
9837
|
+
const CryptoJS = /* @__PURE__ */ getDefaultExportFromCjs(cryptoJsExports);
|
|
9838
|
+
const WidgetStore = {
|
|
9839
|
+
el: void 0,
|
|
9840
|
+
applicationId: void 0,
|
|
9841
|
+
price: 0,
|
|
9842
|
+
taxFree: 0,
|
|
9843
|
+
depositPrice: 0,
|
|
9844
|
+
currency: "KRW",
|
|
9845
|
+
userToken: void 0,
|
|
9846
|
+
pg: void 0,
|
|
9847
|
+
method: void 0,
|
|
9848
|
+
walletId: void 0,
|
|
9849
|
+
selectTerms: [],
|
|
9850
|
+
useOnlyOOpay: false,
|
|
9851
|
+
termsPassed: false,
|
|
9852
|
+
useTerms: true,
|
|
9853
|
+
sandbox: false,
|
|
9854
|
+
useBootpayInAppSdk: false,
|
|
9855
|
+
widgetKey: void 0,
|
|
9856
|
+
externalTerms: [],
|
|
9857
|
+
widgetExtra: {
|
|
9858
|
+
card_quota: []
|
|
9859
|
+
},
|
|
9860
|
+
extra: {},
|
|
9861
|
+
setWidgetData(data2) {
|
|
9862
|
+
this.el = String(data2.el).replace(/#/gi, "");
|
|
9863
|
+
this.applicationId = data2.application_id;
|
|
9864
|
+
this.price = data2.price;
|
|
9865
|
+
this.taxFree = data2.tax_free;
|
|
9866
|
+
this.depositPrice = data2.deposit_price;
|
|
9867
|
+
this.currency = data2.currency;
|
|
9868
|
+
this.userToken = data2.user_token;
|
|
9869
|
+
this.useOnlyOOpay = data2.use_only_oopay === void 0 ? false : data2.use_only_oopay;
|
|
9870
|
+
this.useTerms = !(data2.use_terms === false);
|
|
9871
|
+
this.walletId = data2.wallet_id;
|
|
9872
|
+
this.externalTerms = data2.external_terms;
|
|
9873
|
+
this.widgetExtra = data2.widget_extra;
|
|
9874
|
+
this.widgetKey = data2.widget_key;
|
|
9875
|
+
this.sandbox = data2.sandbox === true;
|
|
9876
|
+
this.useBootpayInAppSdk = data2.use_bootpay_inapp_sdk === true;
|
|
9877
|
+
this.termsPassed = false;
|
|
9878
|
+
this.extra = {};
|
|
9879
|
+
},
|
|
9880
|
+
setPayment(pg, method, wallet_id, terms = false, select_terms, extra) {
|
|
9881
|
+
this.pg = pg;
|
|
9882
|
+
this.method = method;
|
|
9883
|
+
this.walletId = wallet_id;
|
|
9884
|
+
this.termsPassed = terms;
|
|
9885
|
+
this.selectTerms = select_terms;
|
|
9886
|
+
this.extra = extra;
|
|
9887
|
+
},
|
|
9888
|
+
updateOnProcessing(data2) {
|
|
9889
|
+
if (isPresent(data2.price)) {
|
|
9890
|
+
this.price = data2.price;
|
|
9891
|
+
}
|
|
9892
|
+
if (isPresent(data2.tax_free)) {
|
|
9893
|
+
this.taxFree = data2.tax_free;
|
|
9894
|
+
}
|
|
9895
|
+
if (isPresent(data2.currency)) {
|
|
9896
|
+
this.currency = data2.currency;
|
|
9897
|
+
}
|
|
9898
|
+
if (data2.user_token !== void 0) {
|
|
9899
|
+
this.userToken = data2.user_token;
|
|
9900
|
+
}
|
|
9901
|
+
if (isPresent(data2.use_terms)) {
|
|
9902
|
+
this.useTerms = !(data2.use_terms === false);
|
|
9903
|
+
}
|
|
9904
|
+
if (isPresent(data2.sandbox)) {
|
|
9905
|
+
this.sandbox = data2.sandbox === true;
|
|
9906
|
+
}
|
|
9907
|
+
if (isPresent(data2.widget_key)) {
|
|
9908
|
+
this.widgetKey = data2.widget_key;
|
|
9909
|
+
}
|
|
9910
|
+
if (data2.external_terms !== void 0) {
|
|
9911
|
+
this.externalTerms = data2.external_terms;
|
|
9912
|
+
}
|
|
9913
|
+
if (data2.use_bootpay_inapp_sdk !== void 0) {
|
|
9914
|
+
this.useBootpayInAppSdk = data2.use_bootpay_inapp_sdk;
|
|
9915
|
+
}
|
|
9916
|
+
if (data2.widget_key !== void 0) {
|
|
9917
|
+
this.widgetKey = data2.widget_key;
|
|
9918
|
+
}
|
|
9919
|
+
},
|
|
9920
|
+
encryptParameters() {
|
|
9921
|
+
return encodeURIComponent(
|
|
9922
|
+
this.encrypt({
|
|
9923
|
+
use_only_oopay: this.useOnlyOOpay,
|
|
9924
|
+
user_token: this.userToken,
|
|
9925
|
+
sandbox: this.sandbox,
|
|
9926
|
+
use_terms: this.useTerms,
|
|
9927
|
+
external_terms: this.externalTerms,
|
|
9928
|
+
key: this.widgetKey,
|
|
9929
|
+
use_bootpay_inapp_sdk: this.useBootpayInAppSdk,
|
|
9930
|
+
extra: this.extra,
|
|
9931
|
+
log_level: Logger.level
|
|
9932
|
+
})
|
|
9933
|
+
);
|
|
9934
|
+
},
|
|
9935
|
+
encrypt(data2) {
|
|
9936
|
+
if (isBlank(this.applicationId)) {
|
|
9937
|
+
throw new Error("privateKey is not set");
|
|
9938
|
+
}
|
|
9939
|
+
const payload = typeof data2 === "string" ? data2 : JSON.stringify(data2);
|
|
9940
|
+
const encrypted = AES.encrypt(
|
|
9941
|
+
payload,
|
|
9942
|
+
CryptoJS.enc.Utf8.parse(this.applicationId.substring(0, 16)),
|
|
9943
|
+
{
|
|
9944
|
+
mode: CryptoJS.mode.ECB,
|
|
9945
|
+
padding: CryptoJS.pad.Pkcs7
|
|
9946
|
+
}
|
|
9947
|
+
);
|
|
9948
|
+
return Base64.stringify(encrypted.ciphertext);
|
|
9949
|
+
},
|
|
9950
|
+
decrypt(data2) {
|
|
9951
|
+
if (isBlank(this.applicationId)) {
|
|
9952
|
+
throw new Error("privateKey is not set");
|
|
9953
|
+
}
|
|
9954
|
+
const decrypted = AES.decrypt(
|
|
9955
|
+
data2,
|
|
9956
|
+
CryptoJS.enc.Utf8.parse(this.applicationId.substring(0, 16)),
|
|
9957
|
+
{
|
|
9958
|
+
mode: CryptoJS.mode.ECB,
|
|
9959
|
+
padding: CryptoJS.pad.Pkcs7
|
|
9960
|
+
}
|
|
9961
|
+
);
|
|
9962
|
+
const decryptedString = decrypted.toString(CryptoJS.enc.Utf8);
|
|
9963
|
+
try {
|
|
9964
|
+
return JSON.parse(decryptedString);
|
|
9965
|
+
} catch (e) {
|
|
9966
|
+
return decryptedString;
|
|
9967
|
+
}
|
|
9968
|
+
}
|
|
9969
|
+
};
|
|
9970
|
+
class TemplateWidgetManager extends TemplateManager {
|
|
9971
|
+
constructor() {
|
|
9972
|
+
super();
|
|
9973
|
+
this.$iFrameId = "bootpay-widget-iframe";
|
|
9974
|
+
this.$widgetStore = WidgetStore;
|
|
9975
|
+
this.$template = `
|
|
9976
|
+
<iframe id="${this.$iFrameId}" src="" frameborder="0" allowtransparency="true" scrolling="no" style="background: transparent; width: 100%; height: 100%;"></iframe>
|
|
9977
|
+
`;
|
|
9978
|
+
}
|
|
9979
|
+
/**
|
|
9980
|
+
* 첫 Rendering을 진행한다
|
|
9981
|
+
* Comment by GOSOMI
|
|
9982
|
+
* @date: 2023-06-15
|
|
9983
|
+
*/
|
|
9984
|
+
render() {
|
|
9985
|
+
const element = document.getElementById(this.$widgetStore.el);
|
|
9986
|
+
if (this.$blank(this.$widgetStore.el) || element === null) {
|
|
9987
|
+
throw new Error("부트페이 위젯을 설정할 Element ID를 입력하지 않았거나 해당 Element DOM이 존재하지 않습니다.");
|
|
9988
|
+
}
|
|
9989
|
+
this.templateRender();
|
|
9990
|
+
}
|
|
9991
|
+
/**
|
|
9992
|
+
* 렌더링 공통 함수
|
|
9993
|
+
* Comment by GOSOMI
|
|
9994
|
+
* @date: 2023-06-15
|
|
9995
|
+
*/
|
|
9996
|
+
templateRender() {
|
|
9997
|
+
const element = document.getElementById(this.$widgetStore.el);
|
|
9998
|
+
element.style.setProperty("height", "0px");
|
|
9999
|
+
element.innerHTML = this.$template;
|
|
10000
|
+
const iFrame = this.byId(this.$iFrameId);
|
|
10001
|
+
iFrame.setAttribute(
|
|
10002
|
+
"src",
|
|
10003
|
+
Environment.toWidget(
|
|
10004
|
+
`p/${this.$widgetStore.applicationId}/${this.$widgetStore.encryptParameters()}`
|
|
10005
|
+
)
|
|
10006
|
+
);
|
|
10007
|
+
}
|
|
10008
|
+
resize(resizeData) {
|
|
10009
|
+
this.templateResize(this.$widgetStore.el, resizeData);
|
|
10010
|
+
}
|
|
10011
|
+
/**
|
|
10012
|
+
* widget을 재 렌더링한다
|
|
10013
|
+
* Comment by GOSOMI
|
|
10014
|
+
* @date: 2023-06-15
|
|
10015
|
+
*/
|
|
10016
|
+
rerender() {
|
|
10017
|
+
this.postMessage("bootpayWidgetRerender");
|
|
10018
|
+
}
|
|
10019
|
+
/**
|
|
10020
|
+
* 창을 삭제한다
|
|
10021
|
+
* Comment by GOSOMI
|
|
10022
|
+
* @date: 2023-06-15
|
|
10023
|
+
*/
|
|
10024
|
+
destroy() {
|
|
10025
|
+
const element = document.getElementById(this.$widgetStore.el);
|
|
10026
|
+
element.innerHTML = "";
|
|
10027
|
+
}
|
|
10028
|
+
/**
|
|
10029
|
+
* child iframe에 PostMessage를 보낸다
|
|
10030
|
+
* Comment by GOSOMI
|
|
10031
|
+
* @date: 2023-06-15
|
|
10032
|
+
*/
|
|
10033
|
+
postMessage(event, data2 = void 0) {
|
|
10034
|
+
var _a;
|
|
10035
|
+
const element = this.byId(this.$iFrameId);
|
|
10036
|
+
(_a = element == null ? void 0 : element.contentWindow) == null ? void 0 : _a.postMessage(JSON.stringify({
|
|
10037
|
+
bootpay_event: true,
|
|
10038
|
+
event,
|
|
10039
|
+
data: data2
|
|
10040
|
+
}), "*");
|
|
10041
|
+
}
|
|
10042
|
+
/**
|
|
10043
|
+
* render가 되었는지 체크한다
|
|
10044
|
+
* Comment by GOSOMI
|
|
10045
|
+
* @date: 2024-02-22
|
|
10046
|
+
*/
|
|
10047
|
+
isRendered() {
|
|
10048
|
+
const iFrameElement = document.getElementById(this.$iFrameId);
|
|
10049
|
+
Logger.debug(`isRendered`, `iFrameElement: ${iFrameElement}`);
|
|
10050
|
+
return iFrameElement !== null && iFrameElement.src !== null && iFrameElement.src !== "";
|
|
10051
|
+
}
|
|
10052
|
+
}
|
|
10053
|
+
const TemplateWidget = new TemplateWidgetManager();
|
|
10054
|
+
class OOpayTemplateManager extends TemplateManager {
|
|
10055
|
+
constructor() {
|
|
10056
|
+
super();
|
|
10057
|
+
this.$oopayWindowId = "__bootpay-card-easy-window";
|
|
10058
|
+
this.$iFrameId = "__bootpay-card-easy-iframe";
|
|
10059
|
+
this.$windowId = "__bootpay-card-easy-container-window";
|
|
10060
|
+
this.$additionalClass = Environment.isMobile() ? "transparent" : "rounded-iframe transparent";
|
|
10061
|
+
this.$template = this.template();
|
|
10062
|
+
this.$widgetStore = WidgetStore;
|
|
10063
|
+
}
|
|
10064
|
+
template() {
|
|
10065
|
+
return `
|
|
10066
|
+
<div id="${this.$windowId}" class="bootpay-payment-background">
|
|
10067
|
+
<div class="bootpay-payment-window ${Environment.isMobile() ? "__mobile" : ""}" id="${this.$oopayWindowId}">
|
|
10068
|
+
<iframe class="${this.$additionalClass}" id="${this.$iFrameId}" name="${this.$iFrameId}"></iframe>
|
|
10069
|
+
</div>
|
|
10070
|
+
</div>
|
|
10071
|
+
`;
|
|
6594
10072
|
}
|
|
6595
10073
|
createIFrame(url) {
|
|
6596
10074
|
this.createTemplateHtml();
|
|
6597
10075
|
const iframe = document.getElementById(this.$iFrameId);
|
|
6598
10076
|
iframe == null ? void 0 : iframe.setAttribute("src", Environment.toWidget(`${url}`));
|
|
6599
10077
|
iframe == null ? void 0 : iframe.style.setProperty("display", "block");
|
|
6600
|
-
this.bodyOpen();
|
|
10078
|
+
this.bodyOpen("bootpay-mobile");
|
|
6601
10079
|
}
|
|
6602
|
-
addWallet() {
|
|
6603
|
-
this.createIFrame(
|
|
10080
|
+
addWallet(url) {
|
|
10081
|
+
this.createIFrame(url);
|
|
6604
10082
|
}
|
|
6605
10083
|
removeWallet(walletId) {
|
|
6606
10084
|
this.createIFrame(`oopay/destroy/${this.$widgetStore.applicationId}/${walletId}`);
|
|
@@ -6683,6 +10161,61 @@ class ModalTemplateManager extends TemplateManager {
|
|
|
6683
10161
|
}
|
|
6684
10162
|
}
|
|
6685
10163
|
const ModalTemplate = new ModalTemplateManager();
|
|
10164
|
+
class ConfirmModalManager extends TemplateManager {
|
|
10165
|
+
constructor() {
|
|
10166
|
+
super();
|
|
10167
|
+
this.$windowId = "__bootpay-confirm-modal-window-container";
|
|
10168
|
+
this.$modalWindowId = "__bootpay-confirm-modal-window";
|
|
10169
|
+
this.$additionalClass = "rounded-iframe";
|
|
10170
|
+
this.$title = "알림";
|
|
10171
|
+
this.$confirmButtonText = "확인";
|
|
10172
|
+
this.$cancelButtonText = "취소";
|
|
10173
|
+
this.$template = this.template();
|
|
10174
|
+
this.$message = "";
|
|
10175
|
+
}
|
|
10176
|
+
template() {
|
|
10177
|
+
return `
|
|
10178
|
+
<div id="${this.$windowId}" class="bootpay-payment-background __alert">
|
|
10179
|
+
<div class="bootpay-confirm-window fade-in" id="${this.$modalWindowId}">
|
|
10180
|
+
<div class="bootpay__alert-header">
|
|
10181
|
+
${this.$title}
|
|
10182
|
+
<button class="bootpay-close-btn" onClick="window.BootpayWidget.alertCancel()"></button>
|
|
10183
|
+
</div>
|
|
10184
|
+
<div class="bootpay__alert-body">
|
|
10185
|
+
${this.$message}
|
|
10186
|
+
</div>
|
|
10187
|
+
<div class="bootpay__alert-footer">
|
|
10188
|
+
<button class="bootpay__alert-close border-right" onClick="window.BootpayWidget.alertCancel()">${this.$cancelButtonText}</button>
|
|
10189
|
+
<button class="bootpay__alert-close bootpay-primary" onClick="window.BootpayWidget.alertConfirm()">${this.$confirmButtonText}</button>
|
|
10190
|
+
</div>
|
|
10191
|
+
</div>
|
|
10192
|
+
</div>
|
|
10193
|
+
`;
|
|
10194
|
+
}
|
|
10195
|
+
show(message, title = "알림", confirmButton = "확인", cancelButton = "취소") {
|
|
10196
|
+
this.$title = title;
|
|
10197
|
+
this.$message = message;
|
|
10198
|
+
this.$confirmButtonText = confirmButton;
|
|
10199
|
+
this.$cancelButtonText = cancelButton;
|
|
10200
|
+
this.$template = this.template();
|
|
10201
|
+
this.createTemplateHtml();
|
|
10202
|
+
this.bodyOpen();
|
|
10203
|
+
}
|
|
10204
|
+
destroy() {
|
|
10205
|
+
const window2 = document.getElementById(this.$modalWindowId);
|
|
10206
|
+
window2.classList.remove("fade-in");
|
|
10207
|
+
window2.classList.add("fade-out");
|
|
10208
|
+
setTimeout(() => {
|
|
10209
|
+
const element = document.getElementById(this.$windowId);
|
|
10210
|
+
if (element !== void 0) {
|
|
10211
|
+
element.outerHTML = "";
|
|
10212
|
+
element.remove();
|
|
10213
|
+
}
|
|
10214
|
+
this.bodyClose();
|
|
10215
|
+
}, 100);
|
|
10216
|
+
}
|
|
10217
|
+
}
|
|
10218
|
+
const ConfirmModal = new ConfirmModalManager();
|
|
6686
10219
|
class BootpayWidgetEventManager extends BootpayWindowEvent {
|
|
6687
10220
|
constructor() {
|
|
6688
10221
|
super();
|
|
@@ -6717,6 +10250,7 @@ class BootpayWidgetEventManager extends BootpayWindowEvent {
|
|
|
6717
10250
|
use_terms: TemplateWidget.$widgetStore.useTerms,
|
|
6718
10251
|
external_terms: TemplateWidget.$widgetStore.externalTerms,
|
|
6719
10252
|
key: TemplateWidget.$widgetStore.widgetKey,
|
|
10253
|
+
use_bootpay_inapp_sdk: TemplateWidget.$widgetStore.useBootpayInAppSdk,
|
|
6720
10254
|
log_level: Logger.level
|
|
6721
10255
|
});
|
|
6722
10256
|
case "bootpayRequestGetEnvironmentWidget":
|
|
@@ -6743,7 +10277,7 @@ class BootpayWidgetEventManager extends BootpayWindowEvent {
|
|
|
6743
10277
|
case "bootpayWidgetShowInterestInformation":
|
|
6744
10278
|
return OOpayTemplate.showCardInterestInformation(response.data);
|
|
6745
10279
|
case "bootpayWidgetAddWallet":
|
|
6746
|
-
return OOpayTemplate.addWallet();
|
|
10280
|
+
return OOpayTemplate.addWallet(response.data.url);
|
|
6747
10281
|
case "bootpayWidgetRemoveWallet":
|
|
6748
10282
|
return OOpayTemplate.removeWallet(response.data.wallet_id);
|
|
6749
10283
|
case "bootpayWidgetPaymentWindowResize":
|
|
@@ -6803,6 +10337,16 @@ class BootpayWidgetEventManager extends BootpayWindowEvent {
|
|
|
6803
10337
|
case "bootpayWidgetUpdateStore":
|
|
6804
10338
|
WidgetStore.updateOnProcessing(__spreadValues({}, response.data));
|
|
6805
10339
|
break;
|
|
10340
|
+
case "bootpayWidgetToUrl":
|
|
10341
|
+
location.href = response.data.url;
|
|
10342
|
+
break;
|
|
10343
|
+
case "bootpayWidgetShowModal":
|
|
10344
|
+
return ConfirmModal.show(
|
|
10345
|
+
response.data.message,
|
|
10346
|
+
response.data.title,
|
|
10347
|
+
response.data.confirmButtonText,
|
|
10348
|
+
response.data.cancelButtonText
|
|
10349
|
+
);
|
|
6806
10350
|
default:
|
|
6807
10351
|
return this.reject(response);
|
|
6808
10352
|
}
|
|
@@ -6877,6 +10421,7 @@ class BootpayWidgetWindowManager extends BootpayManager {
|
|
|
6877
10421
|
user_token: data2.user_token,
|
|
6878
10422
|
use_only_oopay: data2.use_only_oopay,
|
|
6879
10423
|
external_terms: data2.external_terms,
|
|
10424
|
+
use_bootpay_inapp_sdk: data2.use_bootpay_inapp_sdk,
|
|
6880
10425
|
widget_extra: data2.extra,
|
|
6881
10426
|
use_terms: data2.use_terms,
|
|
6882
10427
|
sandbox: data2.sandbox,
|
|
@@ -7105,6 +10650,26 @@ const BootpayWidget = {
|
|
|
7105
10650
|
*/
|
|
7106
10651
|
sendMessage(event, data2 = void 0) {
|
|
7107
10652
|
BootpayWidgetWindow.sendMessage(event, data2);
|
|
10653
|
+
},
|
|
10654
|
+
/**
|
|
10655
|
+
* DeviceType을 설정
|
|
10656
|
+
* Comment by GOSOMI
|
|
10657
|
+
* @date: 2021-12-23
|
|
10658
|
+
*/
|
|
10659
|
+
setDevice(deviceType) {
|
|
10660
|
+
return Bootpay.setDevice(deviceType);
|
|
10661
|
+
},
|
|
10662
|
+
alertConfirm() {
|
|
10663
|
+
ConfirmModal.destroy();
|
|
10664
|
+
BootpayWidgetWindow.sendMessage("BootpayWidgetAlertConfirm", {
|
|
10665
|
+
confirm: true
|
|
10666
|
+
});
|
|
10667
|
+
},
|
|
10668
|
+
alertCancel() {
|
|
10669
|
+
ConfirmModal.destroy();
|
|
10670
|
+
BootpayWidgetWindow.sendMessage("BootpayWidgetAlertConfirm", {
|
|
10671
|
+
confirm: false
|
|
10672
|
+
});
|
|
7108
10673
|
}
|
|
7109
10674
|
};
|
|
7110
10675
|
if (typeof window !== "undefined") {
|