@protontech/openpgp 6.0.0-beta.3.patch.1 → 6.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 +34 -37
- package/dist/lightweight/argon2id.min.mjs +1 -1
- package/dist/lightweight/argon2id.min.mjs.map +1 -1
- package/dist/lightweight/argon2id.mjs +1 -1
- package/dist/lightweight/legacy_ciphers.min.mjs +1 -1
- package/dist/lightweight/legacy_ciphers.min.mjs.map +1 -1
- package/dist/lightweight/legacy_ciphers.mjs +1 -1
- package/dist/lightweight/noble_curves.min.mjs +1 -1
- package/dist/lightweight/noble_curves.min.mjs.map +1 -1
- package/dist/lightweight/noble_curves.mjs +1 -1
- package/dist/lightweight/noble_hashes.min.mjs +1 -1
- package/dist/lightweight/noble_hashes.min.mjs.map +1 -1
- package/dist/lightweight/noble_hashes.mjs +1 -1
- package/dist/lightweight/openpgp.min.mjs +4 -4
- package/dist/lightweight/openpgp.min.mjs.map +1 -1
- package/dist/lightweight/openpgp.mjs +247 -951
- package/dist/lightweight/seek-bzip.min.mjs +3 -0
- package/dist/lightweight/seek-bzip.min.mjs.map +1 -0
- package/dist/lightweight/seek-bzip.mjs +866 -0
- package/dist/lightweight/sha3.min.mjs +1 -1
- package/dist/lightweight/sha3.min.mjs.map +1 -1
- package/dist/lightweight/sha3.mjs +1 -1
- package/dist/node/openpgp.cjs +11366 -11208
- package/dist/node/openpgp.min.cjs +14 -14
- package/dist/node/openpgp.min.cjs.map +1 -1
- package/dist/node/openpgp.min.mjs +14 -14
- package/dist/node/openpgp.min.mjs.map +1 -1
- package/dist/node/openpgp.mjs +5459 -5301
- package/dist/openpgp.js +6506 -6348
- package/dist/openpgp.min.js +14 -14
- package/dist/openpgp.min.js.map +1 -1
- package/dist/openpgp.min.mjs +14 -14
- package/dist/openpgp.min.mjs.map +1 -1
- package/dist/openpgp.mjs +6506 -6348
- package/package.json +23 -23
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! OpenPGP.js v6.0.0
|
|
1
|
+
/*! OpenPGP.js v6.0.0 - 2024-11-06 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
2
|
const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3
3
|
|
|
4
4
|
import { enums } from './openpgp.mjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! OpenPGP.js v6.0.0
|
|
1
|
+
/*! OpenPGP.js v6.0.0 - 2024-11-06 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
2
|
"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;import{H as t,h as e,t as n,e as r,b as f,c as o,r as i,s,a,d as c,w as d,u,f as l}from"./sha3.min.mjs";class h extends t{constructor(t,r){super(),this.finished=!1,this.destroyed=!1,e(t);const f=n(r);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const o=this.blockLen,i=new Uint8Array(o);i.set(f.length>o?t.create().update(f).digest():f);for(let t=0;t<i.length;t++)i[t]^=54;this.iHash.update(i),this.oHash=t.create();for(let t=0;t<i.length;t++)i[t]^=106;this.oHash.update(i),i.fill(0)}update(t){return r(this),this.iHash.update(t),this}digestInto(t){r(this),f(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:f,blockLen:o,outputLen:i}=this;return t.finished=r,t.destroyed=f,t.blockLen=o,t.outputLen=i,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const g=(t,e,n)=>new h(t,e).update(n).digest();g.create=(t,e)=>new h(t,e)
|
|
3
3
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */;const b=/* @__PURE__ */BigInt(0),y=/* @__PURE__ */BigInt(1),p=/* @__PURE__ */BigInt(2);function m(t){return t instanceof Uint8Array||null!=t&&"object"==typeof t&&"Uint8Array"===t.constructor.name}function w(t){if(!m(t))throw Error("Uint8Array expected")}function B(t,e){if("boolean"!=typeof e)throw Error(`${t} must be valid boolean, got "${e}".`)}const E=/* @__PURE__ */Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function x(t){w(t);let e="";for(let n=0;n<t.length;n++)e+=E[t[n]];return e}function I(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function v(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);return BigInt(""===t?"0":"0x"+t)}const S={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function A(t){return t>=S._0&&t<=S._9?t-S._0:t>=S._A&&t<=S._F?t-(S._A-10):t>=S._a&&t<=S._f?t-(S._a-10):void 0}function O(t){if("string"!=typeof t)throw Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw Error("padded hex string expected, got unpadded hex of length "+e);const r=new Uint8Array(n);for(let e=0,f=0;e<n;e++,f+=2){const n=A(t.charCodeAt(f)),o=A(t.charCodeAt(f+1));if(void 0===n||void 0===o){const e=t[f]+t[f+1];throw Error('hex string expected, got non-hex character "'+e+'" at index '+f)}r[e]=16*n+o}return r}function R(t){return v(x(t))}function q(t){return w(t),v(x(Uint8Array.from(t).reverse()))}function z(t,e){return O(t.toString(16).padStart(2*e,"0"))}function P(t,e){return z(t,e).reverse()}function L(t,e,n){let r;if("string"==typeof e)try{r=O(e)}catch(n){throw Error(`${t} must be valid hex string, got "${e}". Cause: ${n}`)}else{if(!m(e))throw Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const f=r.length;if("number"==typeof n&&f!==n)throw Error(`${t} expected ${n} bytes, got ${f}`);return r}function N(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];w(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const f=t[e];n.set(f,r),r+=f.length}return n}const H=t=>"bigint"==typeof t&&b<=t;function T(t,e,n){return H(t)&&H(e)&&H(n)&&e<=t&&t<n}function F(t,e,n,r){if(!T(e,n,r))throw Error(`expected valid ${t}: ${n} <= n < ${r}, got ${typeof e} ${e}`)}function Z(t){let e;for(e=0;t>b;t>>=y,e+=1);return e}const $=t=>(p<<BigInt(t-1))-y,_=t=>new Uint8Array(t),k=t=>Uint8Array.from(t);function G(t,e,n){if("number"!=typeof t||t<2)throw Error("hashLen must be a number");if("number"!=typeof e||e<2)throw Error("qByteLen must be a number");if("function"!=typeof n)throw Error("hmacFn must be a function");let r=_(t),f=_(t),o=0;const i=()=>{r.fill(1),f.fill(0),o=0},s=(...t)=>n(f,r,...t),a=(t=_())=>{f=s(k([0]),t),r=s(),0!==t.length&&(f=s(k([1]),t),r=s())},c=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=s();const e=r.slice();n.push(e),t+=r.length}return N(...n)};return(t,e)=>{let n;for(i(),a(t);!(n=e(c()));)a();return i(),n}}const U={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||m(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function j(t,e,n={}){const r=(e,n,r)=>{const f=U[n];if("function"!=typeof f)throw Error(`Invalid validator "${n}", expected function`);const o=t[e];if(!(r&&void 0===o||f(o,t)))throw Error(`Invalid param ${e+""}=${o} (${typeof o}), expected ${n}`)};for(const[t,n]of Object.entries(e))r(t,n,!1);for(const[t,e]of Object.entries(n))r(t,e,!0);return t}function C(t){const e=new WeakMap;return(n,...r)=>{const f=e.get(n);if(void 0!==f)return f;const o=t(n,...r);return e.set(n,o),o}}var V=/*#__PURE__*/Object.freeze({__proto__:null,aInRange:F,abool:B,abytes:w,bitGet:function(t,e){return t>>BigInt(e)&y},bitLen:Z,bitMask:$,bitSet:function(t,e,n){return t|(n?y:b)<<BigInt(e)},bytesToHex:x,bytesToNumberBE:R,bytesToNumberLE:q,concatBytes:N,createHmacDrbg:G,ensureBytes:L,equalBytes:function(t,e){if(t.length!==e.length)return!1;let n=0;for(let r=0;r<t.length;r++)n|=t[r]^e[r];return 0===n},hexToBytes:O,hexToNumber:v,inRange:T,isBytes:m,memoized:C,notImplemented:()=>{throw Error("not implemented")},numberToBytesBE:z,numberToBytesLE:P,numberToHexUnpadded:I,numberToVarBytesBE:function(t){return O(I(t))},utf8ToBytes:function(t){if("string"!=typeof t)throw Error("utf8ToBytes expected string, got "+typeof t);return new Uint8Array((new TextEncoder).encode(t))},validateObject:j});
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const K=BigInt(0),Y=BigInt(1),M=BigInt(2),W=BigInt(3),D=BigInt(4),J=BigInt(5),Q=BigInt(8);function X(t,e){const n=t%e;return n>=K?n:e+n}function tt(t,e,n){if(n<=K||e<K)throw Error("Expected power/modulo > 0");if(n===Y)return K;let r=Y;for(;e>K;)e&Y&&(r=r*t%n),t=t*t%n,e>>=Y;return r}function et(t,e,n){let r=t;for(;e-- >K;)r*=r,r%=n;return r}function nt(t,e){if(t===K||e<=K)throw Error(`invert: expected positive integers, got n=${t} mod=${e}`);let n=X(t,e),r=e,f=K,o=Y;for(;n!==K;){const t=r%n,e=f-o*(r/n);r=n,n=t,f=o,o=e}if(r!==Y)throw Error("invert: does not exist");return X(f,e)}function rt(t){if(t%D===W){const e=(t+Y)/D;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw Error("Cannot find square root");return r}}if(t%Q===J){const e=(t-J)/Q;return function(t,n){const r=t.mul(n,M),f=t.pow(r,e),o=t.mul(n,f),i=t.mul(t.mul(o,M),f),s=t.mul(o,t.sub(i,t.ONE));if(!t.eql(t.sqr(s),n))throw Error("Cannot find square root");return s}}return function(t){const e=(t-Y)/M;let n,r,f;for(n=t-Y,r=0;n%M===K;n/=M,r++);for(f=M;f<t&&tt(f,e,t)!==t-Y;f++);if(1===r){const e=(t+Y)/D;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw Error("Cannot find square root");return r}}const o=(n+Y)/M;return function(t,i){if(t.pow(i,e)===t.neg(t.ONE))throw Error("Cannot find square root");let s=r,a=t.pow(t.mul(t.ONE,f),n),c=t.pow(i,o),d=t.pow(i,n);for(;!t.eql(d,t.ONE);){if(t.eql(d,t.ZERO))return t.ZERO;let e=1;for(let n=t.sqr(d);e<s&&!t.eql(n,t.ONE);e++)n=t.sqr(n);const n=t.pow(a,Y<<BigInt(s-e-1));a=t.sqr(n),c=t.mul(c,n),d=t.mul(d,a),s=e}return c}}(t)}BigInt(9),BigInt(16);const ft=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function ot(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function it(t,e,n=!1,r={}){if(t<=K)throw Error("Expected Field ORDER > 0, got "+t);const{nBitLength:f,nByteLength:o}=ot(t,e);if(o>2048)throw Error("Field lengths over 2048 bytes are not supported");const i=rt(t),s=Object.freeze({ORDER:t,BITS:f,BYTES:o,MASK:$(f),ZERO:K,ONE:Y,create:e=>X(e,t),isValid:e=>{if("bigint"!=typeof e)throw Error("Invalid field element: expected bigint, got "+typeof e);return K<=e&&e<t},is0:t=>t===K,isOdd:t=>(t&Y)===Y,neg:e=>X(-e,t),eql:(t,e)=>t===e,sqr:e=>X(e*e,t),add:(e,n)=>X(e+n,t),sub:(e,n)=>X(e-n,t),mul:(e,n)=>X(e*n,t),pow:(t,e)=>function(t,e,n){if(n<K)throw Error("Expected power > 0");if(n===K)return t.ONE;if(n===Y)return e;let r=t.ONE,f=e;for(;n>K;)n&Y&&(r=t.mul(r,f)),f=t.sqr(f),n>>=Y;return r}(s,t,e),div:(e,n)=>X(e*nt(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>nt(e,t),sqrt:r.sqrt||(t=>i(s,t)),invertBatch:t=>function(t,e){const n=Array(e.length),r=e.reduce(((e,r,f)=>t.is0(r)?e:(n[f]=e,t.mul(e,r))),t.ONE),f=t.inv(r);return e.reduceRight(((e,r,f)=>t.is0(r)?e:(n[f]=t.mul(e,n[f]),t.mul(e,r))),f),n}(s,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?P(t,o):z(t,o),fromBytes:t=>{if(t.length!==o)throw Error(`Fp.fromBytes: expected ${o}, got ${t.length}`);return n?q(t):R(t)}});return Object.freeze(s)}function st(t){if("bigint"!=typeof t)throw Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function at(t){const e=st(t);return e+Math.ceil(e/2)}
|