Astroport.ONE/www/AESBox/openpgp.min.js

2 lines
323 KiB
JavaScript
Raw Normal View History

2023-03-25 19:49:45 +01:00
/*! OpenPGP.js v2.6.2 - 2018-01-21 - this is LGPL licensed code, see LICENSE/our website http://openpgpjs.org/ for more information. */
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).openpgp=e()}}(function(){return function e(t,r,n){function i(a,o){if(!r[a]){if(!t[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var f=new Error("Cannot find module '"+a+"'");throw f.code="MODULE_NOT_FOUND",f}var h=r[a]={exports:{}};t[a][0].call(h.exports,function(e){var r=t[a][1][e];return i(r||e)},h,h.exports,e,t,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a<n.length;a++)i(n[a]);return i}({1:[function(e,t,r){!function(e,r){function n(){var e=Error.apply(this,arguments);this.message=e.message,this.stack=e.stack}function i(){var e=Error.apply(this,arguments);this.message=e.message,this.stack=e.stack}function s(){var e=Error.apply(this,arguments);this.message=e.message,this.stack=e.stack}function a(e,t){t=!!t;for(var r=e.length,n=new Uint8Array(t?4*r:r),i=0,s=0;i<r;i++){var a=e.charCodeAt(i);if(t&&55296<=a&&a<=56319){if(++i>=r)throw new Error("Malformed string, low surrogate expected at position "+i);a=(55296^a)<<10|65536|56320^e.charCodeAt(i)}else if(!t&&a>>>8)throw new Error("Wide characters are not allowed.");!t||a<=127?n[s++]=a:a<=2047?(n[s++]=192|a>>6,n[s++]=128|63&a):a<=65535?(n[s++]=224|a>>12,n[s++]=128|a>>6&63,n[s++]=128|63&a):(n[s++]=240|a>>18,n[s++]=128|a>>12&63,n[s++]=128|a>>6&63,n[s++]=128|63&a)}return n.subarray(0,s)}function o(e){return btoa(function(e,t){t=!!t;for(var r=e.length,n=new Array(r),i=0,s=0;i<r;i++){var a=e[i];if(!t||a<128)n[s++]=a;else if(a>=192&&a<224&&i+1<r)n[s++]=(31&a)<<6|63&e[++i];else if(a>=224&&a<240&&i+2<r)n[s++]=(15&a)<<12|(63&e[++i])<<6|63&e[++i];else{if(!(a>=240&&a<248&&i+3<r))throw new Error("Malformed UTF8 character at byte offset "+i);var o=(7&a)<<18|(63&e[++i])<<12|(63&e[++i])<<6|63&e[++i];o<=65535?n[s++]=o:(o^=65536,n[s++]=55296|o>>10,n[s++]=56320|1023&o)}}for(var u="",i=0;i<s;i+=16384)u+=String.fromCharCode.apply(String,n.slice(i,i+16384<=s?i+16384:s));return u}(e))}function u(e){return"number"==typeof e}function f(e){return"string"==typeof e}function h(e){return e instanceof ArrayBuffer}function l(e){return e instanceof Uint8Array}function c(e,t){var r=t.heap,n=r?r.byteLength:t.heapSize||65536;if(4095&n||n<=0)throw new Error("heap size must be a positive integer and a multiple of 4096");return r=r||new e(new ArrayBuffer(n))}function d(e,t,r,n,i){var s=e.length-t,a=s<i?s:i;return e.set(r.subarray(n,n+a),t),a}function p(e){e=e||{},this.heap=c(Uint8Array,e).subarray(D.HEAP_DATA),this.asm=e.asm||D(r,null,this.heap.buffer),this.mode=null,this.key=null,this.reset(e)}function y(e){if(void 0!==e){if(h(e)||l(e))e=new Uint8Array(e);else{if(!f(e))throw new TypeError("unexpected iv type");e=a(e)}if(16!==e.length)throw new i("illegal iv size");var t=new DataView(e.buffer,e.byteOffset,e.byteLength);this.iv=e,this.asm.set_iv(t.getUint32(0),t.getUint32(4),t.getUint32(8),t.getUint32(12))}else this.iv=null,this.asm.set_iv(0,0,0,0)}function g(e){return e=e||{},this.result=null,this.pos=0,this.len=0,function(e){if(void 0!==e){if(h(e)||l(e))e=new Uint8Array(e);else{if(!f(e))throw new TypeError("unexpected key type");e=a(e)}var t=e.length;if(16!==t&&24!==t&&32!==t)throw new i("illegal key size");var r=new DataView(e.buffer,e.byteOffset,e.byteLength);this.asm.set_key(t>>2,r.getUint32(0),r.getUint32(4),r.getUint32(8),r.getUint32(12),t>16?r.getUint32(16):0,t>16?r.getUint32(20):0,t>24?r.getUint32(24):0,t>24?r.getUint32(28):0),this.key=e}else if(!this.key)throw new Error("key is required")}.call(this,e.key),this.hasOwnProperty("iv")&&y.call(this,e.iv),this.hasOwnProperty("padding")&&function(e){this.padding=void 0===e||!!e}.call(this,e.padding),this}function m(e){if(f(e)&&(e=a(e)),h(e)&&(e=new Uint8Array(e)),!l(e))throw new TypeError("data isn't of expected type");for(var t=this.asm,r=this.heap,n=D.ENC[this.mode],i=D.HEAP_DATA,s=this.pos,o=this.len,u=0,c=e.length||0,p=0,y=o+c&-1