@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.
Files changed (35) hide show
  1. package/README.md +34 -37
  2. package/dist/lightweight/argon2id.min.mjs +1 -1
  3. package/dist/lightweight/argon2id.min.mjs.map +1 -1
  4. package/dist/lightweight/argon2id.mjs +1 -1
  5. package/dist/lightweight/legacy_ciphers.min.mjs +1 -1
  6. package/dist/lightweight/legacy_ciphers.min.mjs.map +1 -1
  7. package/dist/lightweight/legacy_ciphers.mjs +1 -1
  8. package/dist/lightweight/noble_curves.min.mjs +1 -1
  9. package/dist/lightweight/noble_curves.min.mjs.map +1 -1
  10. package/dist/lightweight/noble_curves.mjs +1 -1
  11. package/dist/lightweight/noble_hashes.min.mjs +1 -1
  12. package/dist/lightweight/noble_hashes.min.mjs.map +1 -1
  13. package/dist/lightweight/noble_hashes.mjs +1 -1
  14. package/dist/lightweight/openpgp.min.mjs +4 -4
  15. package/dist/lightweight/openpgp.min.mjs.map +1 -1
  16. package/dist/lightweight/openpgp.mjs +247 -951
  17. package/dist/lightweight/seek-bzip.min.mjs +3 -0
  18. package/dist/lightweight/seek-bzip.min.mjs.map +1 -0
  19. package/dist/lightweight/seek-bzip.mjs +866 -0
  20. package/dist/lightweight/sha3.min.mjs +1 -1
  21. package/dist/lightweight/sha3.min.mjs.map +1 -1
  22. package/dist/lightweight/sha3.mjs +1 -1
  23. package/dist/node/openpgp.cjs +11366 -11208
  24. package/dist/node/openpgp.min.cjs +14 -14
  25. package/dist/node/openpgp.min.cjs.map +1 -1
  26. package/dist/node/openpgp.min.mjs +14 -14
  27. package/dist/node/openpgp.min.mjs.map +1 -1
  28. package/dist/node/openpgp.mjs +5459 -5301
  29. package/dist/openpgp.js +6506 -6348
  30. package/dist/openpgp.min.js +14 -14
  31. package/dist/openpgp.min.js.map +1 -1
  32. package/dist/openpgp.min.mjs +14 -14
  33. package/dist/openpgp.min.mjs.map +1 -1
  34. package/dist/openpgp.mjs +6506 -6348
  35. package/package.json +23 -23
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
- OpenPGP.js [![BrowserStack Status](https://automate.browserstack.com/badge.svg?badge_key=N1l2eHFOanVBMU9wYWxJM3ZnWERnc1lidkt5UkRqa3BralV3SWVhOGpGTT0tLVljSjE4Z3dzVmdiQjl6RWgxb2c3T2c9PQ==--5864052cd523f751b6b907d547ac9c4c5f88c8a3)](https://automate.browserstack.com/public-build/N1l2eHFOanVBMU9wYWxJM3ZnWERnc1lidkt5UkRqa3BralV3SWVhOGpGTT0tLVljSjE4Z3dzVmdiQjl6RWgxb2c3T2c9PQ==--5864052cd523f751b6b907d547ac9c4c5f88c8a3) [![Join the chat on Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/openpgpjs/openpgpjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
1
+ OpenPGP.js [![Join the chat on Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/openpgpjs/openpgpjs?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
2
2
  ==========
3
3
 
4
- [OpenPGP.js](https://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. It implements the [crypto-refresh](https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh) (superseding [RFC4880](https://tools.ietf.org/html/rfc4880) and [RFC4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10)).
4
+ [OpenPGP.js](https://openpgpjs.org/) is a JavaScript implementation of the OpenPGP protocol. It implements [RFC 9580](https://datatracker.ietf.org/doc/rfc9580/) (superseding [RFC 4880](https://tools.ietf.org/html/rfc4880) and [RFC 4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10)).
5
5
 
6
6
  **Table of Contents**
7
7
 
@@ -35,29 +35,35 @@ OpenPGP.js [![BrowserStack Status](https://automate.browserstack.com/badge.svg?b
35
35
 
36
36
  * The `dist/openpgp.min.js` (or `.mjs`) bundle works with recent versions of Chrome, Firefox, Edge and Safari 14+.
37
37
 
38
- * The `dist/node/openpgp.min.mjs` (or `.cjs`) bundle works in Node.js v18+: it is used by default when you `import ... from 'openpgp'` (resp. `require('openpgp')`).
39
-
40
- * Streaming support: the latest versions of Chrome, Firefox, Edge and Safari implement the
41
- [Streams specification](https://streams.spec.whatwg.org/), including `TransformStream`s.
42
- These are needed if you use the library with streamed inputs.
43
- In previous versions of OpenPGP.js, WebStreams were automatically polyfilled by the library,
44
- but from v6 this task is left up to the library user, due to the more extensive browser support, and the
45
- polyfilling side-effects. If you're working with [older browsers versions which do not implement e.g. TransformStreams](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream), you can manually
46
- load [WebStream polyfill](https://github.com/MattiasBuelens/web-streams-polyfills).
47
- Please note that when you load the polyfills, the global `ReadableStream` property (if it exists) gets overwritten with the polyfill version.
48
- In some edge cases, you might need to use the native
49
- `ReadableStream` (for example when using it to create a `Response`
50
- object), in which case you should store a reference to it before loading
51
- the polyfills. There is also the [web-streams-adapter](https://github.com/MattiasBuelens/web-streams-adapter)
52
- library to convert back and forth between them.
38
+ * The `dist/node/openpgp.min.mjs` (or `.cjs`) bundle works in Node.js v18+: it is used by default when you `import ... from 'openpgp'` (or `require('openpgp')`, respectively).
39
+
40
+ * Support for the [Web Cryptography API](https://w3c.github.io/webcrypto/)'s `SubtleCrypto` is required.
41
+ * In browsers, `SubtleCrypto` is only available in [secure contexts](https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts).
42
+ * In supported versions of Node.js, `SubtleCrypto` is always available.
43
+
44
+ * Support for the [Web Streams API](https://streams.spec.whatwg.org/) is required.
45
+ * In browsers: the latest versions of Chrome, Firefox, Edge and Safari support Streams, including `TransformStream`s.
46
+ These are needed if you use the library with stream inputs.
47
+ In previous versions of OpenPGP.js, Web Streams were automatically polyfilled by the library,
48
+ but from v6 this task is left up to the library user, due to the more extensive browser support, and the
49
+ polyfilling side-effects. If you're working with [older browsers versions which do not implement e.g. TransformStreams](https://developer.mozilla.org/en-US/docs/Web/API/TransformStream#browser_compatibility), you can manually
50
+ load the [Web Streams polyfill](https://github.com/MattiasBuelens/web-streams-polyfills).
51
+ Please note that when you load the polyfills, the global `ReadableStream` property (if it exists) gets overwritten with the polyfill version.
52
+ In some edge cases, you might need to use the native
53
+ `ReadableStream` (for example when using it to create a `Response`
54
+ object), in which case you should store a reference to it before loading
55
+ the polyfills. There is also the [web-streams-adapter](https://github.com/MattiasBuelens/web-streams-adapter)
56
+ library to convert back and forth between them.
57
+ * In Node.js: OpenPGP.js v6 no longer supports native Node `Readable` streams in inputs, and instead expects (and outputs) [Node's Web Streams](https://nodejs.org/api/webstreams.html#class-readablestream). [Node v17+ includes utilities to convert from and to Web Streams](https://nodejs.org/api/stream.html#streamreadabletowebstreamreadable-options).
58
+
53
59
 
54
60
  ### Performance
55
61
 
56
- * Version 3.0.0 of the library introduces support for public-key cryptography using [elliptic curves](https://wiki.gnupg.org/ECC). We use native implementations on browsers and Node.js when available. Elliptic curve cryptography provides stronger security per bits of key, which allows for much faster operations. Currently the following curves are supported:
62
+ * Version 3.0.0 of the library introduced support for public-key cryptography using [elliptic curves](https://wiki.gnupg.org/ECC). We use native implementations on browsers and Node.js when available. Compared to RSA, elliptic curve cryptography provides stronger security per bits of key, which allows for much faster operations. Currently the following curves are supported:
57
63
 
58
64
  | Curve | Encryption | Signature | NodeCrypto | WebCrypto | Constant-Time |
59
65
  |:---------------:|:----------:|:---------:|:----------:|:---------:|:-----------------:|
60
- | curve25519 | ECDH | N/A | No | Yes* | If native** |
66
+ | curve25519 | ECDH | N/A | No | No | Algorithmically |
61
67
  | ed25519 | N/A | EdDSA | No | Yes* | If native** |
62
68
  | nistP256 | ECDH | ECDSA | Yes* | Yes* | If native** |
63
69
  | nistP384 | ECDH | ECDSA | Yes* | Yes* | If native** |
@@ -67,25 +73,22 @@ library to convert back and forth between them.
67
73
  | brainpoolP512r1 | ECDH | ECDSA | Yes* | No | If native** |
68
74
  | secp256k1 | ECDH | ECDSA | Yes* | No | If native** |
69
75
 
70
- \* when available
76
+ \* when available
71
77
  \** these curves are only constant-time if the underlying native implementation is available and constant-time
72
78
 
73
- * If the user's browser supports [native WebCrypto](https://caniuse.com/#feat=cryptography) via the `window.crypto.subtle` API, this will be used. Under Node.js the native [crypto module](https://nodejs.org/api/crypto.html#crypto_crypto) is used.
79
+ * The platform's [native Web Crypto API](https://w3c.github.io/webcrypto/) is used for performance. On Node.js the native [crypto module](https://nodejs.org/api/crypto.html#crypto_crypto) is also used, in cases where it offers additional functionality.
74
80
 
75
- * The library implements authenticated encryption (AEAD) as per the ["crypto refresh" draft standard](https://datatracker.ietf.org/doc/draft-ietf-openpgp-crypto-refresh) using AES-OCB, EAX, or GCM. This makes symmetric encryption faster on platforms with native implementations. However, since the specification is very recent and other OpenPGP implementations are in the process of adopting it, the feature is currently behind a flag. **Note: activating this setting can break compatibility with other OpenPGP implementations which have yet to implement the feature.** You can enable it by setting `openpgp.config.aeadProtect = true`.
76
- Note that this setting has a different effect from the one in OpenPGP.js v6, which implemented support for a provisional version of AEAD from [RFC4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10), which was modified in a later draft of the crypto refresh.
81
+ * The library implements authenticated encryption (AEAD) as per [RFC 9580](https://datatracker.ietf.org/doc/rfc9580/) using AES-GCM, OCB, or EAX. This makes symmetric encryption faster on platforms with native implementations. However, since the specification is very recent and other OpenPGP implementations are in the process of adopting it, the feature is currently behind a flag. **Note: activating this setting can break compatibility with other OpenPGP implementations which have yet to implement the feature.** You can enable it by setting `openpgp.config.aeadProtect = true`.
82
+ Note that this setting has a different effect from the one in OpenPGP.js v5, which implemented support for a provisional version of AEAD from [RFC 4880bis](https://tools.ietf.org/html/draft-ietf-openpgp-rfc4880bis-10), which was modified in RFC 9580.
77
83
 
78
84
  You can change the AEAD mode by setting one of the following options:
79
85
 
80
86
  ```
81
- openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.ocb; // Default (widest ecosystem support), non-native
82
- openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.gcm; // Native in WebCrypto and Node.js
87
+ openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.gcm; // Default, native in WebCrypto and Node.js
88
+ openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.ocb; // Non-native, but supported across RFC 9580 implementations
83
89
  openpgp.config.preferredAEADAlgorithm = openpgp.enums.aead.eax; // Native in Node.js
84
90
  ```
85
91
 
86
- * For environments that don't provide native crypto, the library falls back to [asm.js](https://caniuse.com/#feat=asmjs) AES and AEAD implementations.
87
-
88
-
89
92
  ### Getting started
90
93
 
91
94
  #### Node.js
@@ -386,14 +389,8 @@ Where the value can be any of:
386
389
  })();
387
390
  ```
388
391
 
389
- For more information on using ReadableStreams, see [the MDN Documentation on the
390
- Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API).
391
-
392
- You can also pass a [Node.js `Readable`
393
- stream](https://nodejs.org/api/stream.html#stream_class_stream_readable), in
394
- which case OpenPGP.js will return a Node.js `Readable` stream as well, which you
395
- can `.pipe()` to a `Writable` stream, for example.
396
-
392
+ For more information on using ReadableStreams (both in browsers and Node.js), see [the MDN Documentation on the
393
+ Streams API](https://developer.mozilla.org/en-US/docs/Web/API/Streams_API) .
397
394
 
398
395
  #### Streaming encrypt and decrypt *String* data with PGP keys
399
396
 
@@ -667,7 +664,7 @@ To create your own build of the library, just run the following command after cl
667
664
 
668
665
  npm install && npm test
669
666
 
670
- For debugging browser errors, you can run `npm start` and open [`http://localhost:8080/test/unittests.html`](http://localhost:8080/test/unittests.html) in a browser, or run the following command:
667
+ For debugging browser errors, run the following command:
671
668
 
672
669
  npm run browsertest
673
670
 
@@ -1,3 +1,3 @@
1
- /*! OpenPGP.js v6.0.0-beta.3.patch.1 - 2024-09-11 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
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 A="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function I(A,I,g,B){A[I]+=g[B],A[I+1]+=g[B+1]+(A[I]<g[B])}function g(A,I){A[0]+=I,A[1]+=A[0]<I}function B(A,g,B,C,Q,E,w,t){I(A,B,A,C),I(A,B,g,w);let i=A[E]^A[B],e=A[E+1]^A[B+1];A[E]=e,A[E+1]=i,I(A,Q,A,E),i=A[C]^A[Q],e=A[C+1]^A[Q+1],A[C]=i>>>24^e<<8,A[C+1]=e>>>24^i<<8,I(A,B,A,C),I(A,B,g,t),i=A[E]^A[B],e=A[E+1]^A[B+1],A[E]=i>>>16^e<<16,A[E+1]=e>>>16^i<<16,I(A,Q,A,E),i=A[C]^A[Q],e=A[C+1]^A[Q+1],A[C]=e>>>31^i<<1,A[C+1]=i>>>31^e<<1}const C=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),Q=new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3].map((A=>2*A)));function E(A,I){const g=new Uint32Array(32),E=new Uint32Array(A.b.buffer,A.b.byteOffset,32);for(let I=0;I<16;I++)g[I]=A.h[I],g[I+16]=C[I];g[24]^=A.t0[0],g[25]^=A.t0[1];const w=I?4294967295:0;g[28]^=w,g[29]^=w;for(let A=0;A<12;A++){const I=A<<4;B(g,E,0,8,16,24,Q[I+0],Q[I+1]),B(g,E,2,10,18,26,Q[I+2],Q[I+3]),B(g,E,4,12,20,28,Q[I+4],Q[I+5]),B(g,E,6,14,22,30,Q[I+6],Q[I+7]),B(g,E,0,10,20,30,Q[I+8],Q[I+9]),B(g,E,2,12,22,24,Q[I+10],Q[I+11]),B(g,E,4,14,16,26,Q[I+12],Q[I+13]),B(g,E,6,8,18,28,Q[I+14],Q[I+15])}for(let I=0;I<16;I++)A.h[I]^=g[I]^g[I+16]}class w{constructor(A,I,g,B){const Q=new Uint8Array(64);this.S={b:new Uint8Array(e),h:new Uint32Array(i/4),t0:new Uint32Array(2),c:0,outlen:A},Q[0]=A,I&&(Q[1]=I.length),Q[2]=1,Q[3]=1,g&&Q.set(g,32),B&&Q.set(B,48);const E=new Uint32Array(Q.buffer,Q.byteOffset,Q.length/Uint32Array.BYTES_PER_ELEMENT);for(let A=0;A<16;A++)this.S.h[A]=C[A]^E[A];if(I){const A=new Uint8Array(e);A.set(I),this.update(A)}}update(A){if(!(A instanceof Uint8Array))throw Error("Input must be Uint8Array or Buffer");let I=0;for(;I<A.length;){this.S.c===e&&(g(this.S.t0,this.S.c),E(this.S,!1),this.S.c=0);let B=e-this.S.c;this.S.b.set(A.subarray(I,I+B),this.S.c);const C=Math.min(B,A.length-I);this.S.c+=C,I+=C}return this}digest(A){g(this.S.t0,this.S.c),this.S.b.fill(0,this.S.c),this.S.c=e,E(this.S,!0);const I=A||new Uint8Array(this.S.outlen);for(let A=0;A<this.S.outlen;A++)I[A]=this.S.h[A>>2]>>8*(3&A);return this.S.h=null,I.buffer}}function t(A,I,g,B){if(A>i)throw Error(`outlen must be at most ${i} (given: ${A})`);return new w(A,I,g,B)}const i=64,e=128,n=2,D=19,s=4294967295,f=4,r=4294967295,o=8,c=4294967295,S=8,y=4294967295,a=4294967295,h=32,M=1024,U=64,R=205===new Uint8Array(new Uint16Array([43981]).buffer)[0];function N(A,I,g){return A[g+0]=I,A[g+1]=I>>8,A[g+2]=I>>16,A[g+3]=I>>24,A}function k(A,I,g){if(I>Number.MAX_SAFE_INTEGER)throw Error("LE64: large numbers unsupported");let B=I;for(let I=g;I<g+7;I++)A[I]=B,B=(B-A[I])/256;return A}function H(A,I,g){const B=new Uint8Array(64),C=new Uint8Array(4+I.length);if(N(C,A,0),C.set(I,4),A<=64)return t(A).update(C).digest(g),g;const Q=Math.ceil(A/32)-2;for(let A=0;A<Q;A++)t(64).update(0===A?C:B).digest(B),g.set(B.subarray(0,32),32*A);const E=new Uint8Array(t(A-32*Q).update(B).digest());return g.set(E,32*Q),g}function l(A,I,g,B){return A.fn.XOR(I.byteOffset,g.byteOffset,B.byteOffset),I}function G(A,I,g,B){return A.fn.G(I.byteOffset,g.byteOffset,B.byteOffset,A.refs.gZ.byteOffset),B}function F(A,I,g,B){return A.fn.G2(I.byteOffset,g.byteOffset,B.byteOffset,A.refs.gZ.byteOffset),B}function*L(A,I,g,B,C,Q,E,w){A.refs.prngTmp.fill(0);const t=A.refs.prngTmp.subarray(0,48);k(t,I,0),k(t,g,8),k(t,B,16),k(t,C,24),k(t,Q,32),k(t,n,40);for(let I=1;I<=E;I++){k(A.refs.prngTmp,I,t.length);const g=F(A,A.refs.ZERO1024,A.refs.prngTmp,A.refs.prngR);for(let A=1===I?8*w:0;A<g.length;A+=8)yield g.subarray(A,A+8)}return[]}const J=1024,u=64*J;function K(A,{memory:I,instance:g}){if(!R)throw Error("BigEndian system not supported");const B=function({type:A,version:I,tagLength:g,password:B,salt:C,ad:Q,secret:E,parallelism:w,memorySize:t,passes:i}){const e=(A,I,g,B)=>{if(I<g||I>B)throw Error(`${A} size should be between ${g} and ${B} bytes`)};if(A!==n||I!==D)throw Error("Unsupported type or version");return e("password",B,S,c),e("salt",C,o,r),e("tag",g,f,s),e("memory",t,8*w,y),Q&&e("associated data",Q,0,a),E&&e("secret",E,0,h),{type:A,version:I,tagLength:g,password:B,salt:C,ad:Q,secret:E,lanes:w,memorySize:t,passes:i}}({type:n,version:D,...A}),{G:C,G2:Q,xor:E,getLZ:w}=g.exports,i={},e={};e.G=C,e.G2=Q,e.XOR=E;const k=4*B.lanes*Math.floor(B.memorySize/(4*B.lanes)),F=k*M+10*J;if(I.buffer.byteLength<F){const A=Math.ceil((F-I.buffer.byteLength)/u);I.grow(A)}let K=0;i.gZ=new Uint8Array(I.buffer,K,M),K+=i.gZ.length,i.prngR=new Uint8Array(I.buffer,K,M),K+=i.prngR.length,i.prngTmp=new Uint8Array(I.buffer,K,M),K+=i.prngTmp.length,i.ZERO1024=new Uint8Array(I.buffer,K,1024),K+=i.ZERO1024.length;const p=new Uint32Array(I.buffer,K,2);K+=p.length*Uint32Array.BYTES_PER_ELEMENT;const d={fn:e,refs:i},b=new Uint8Array(I.buffer,K,M);K+=b.length;const v=new Uint8Array(I.buffer,K,B.memorySize*M),Y=new Uint8Array(I.buffer,0,K),T=function(A){const I=t(U),g=new Uint8Array(4),B=new Uint8Array(24);N(B,A.lanes,0),N(B,A.tagLength,4),N(B,A.memorySize,8),N(B,A.passes,12),N(B,A.version,16),N(B,A.type,20);const C=[B];A.password?(C.push(N(new Uint8Array(4),A.password.length,0)),C.push(A.password)):C.push(g);A.salt?(C.push(N(new Uint8Array(4),A.salt.length,0)),C.push(A.salt)):C.push(g);A.secret?(C.push(N(new Uint8Array(4),A.secret.length,0)),C.push(A.secret)):C.push(g);A.ad?(C.push(N(new Uint8Array(4),A.ad.length,0)),C.push(A.ad)):C.push(g);I.update(function(A){if(1===A.length)return A[0];let I=0;for(let g=0;g<A.length;g++){if(!(A[g]instanceof Uint8Array))throw Error("concatArrays: Data must be in the form of a Uint8Array");I+=A[g].length}const g=new Uint8Array(I);let B=0;return A.forEach((A=>{g.set(A,B),B+=A.length})),g}(C));const Q=I.digest();return new Uint8Array(Q)}(B),P=k/B.lanes,x=Array(B.lanes).fill(null).map((()=>Array(P))),m=(A,I)=>(x[A][I]=v.subarray(A*P*1024+1024*I,A*P*1024+1024*I+M),x[A][I]);for(let A=0;A<B.lanes;A++){const I=new Uint8Array(T.length+8);I.set(T),N(I,0,T.length),N(I,A,T.length+4),H(M,I,m(A,0)),N(I,1,T.length),H(M,I,m(A,1))}const O=P/4;for(let A=0;A<B.passes;A++)for(let I=0;I<4;I++){const g=0===A&&I<=1;for(let C=0;C<B.lanes;C++){let Q=0===I&&0===A?2:0;const E=g?L(d,A,C,I,k,B.passes,O,Q):null;for(;Q<O;Q++){const t=I*O+Q,i=t>0?x[C][t-1]:x[C][P-1],e=g?E.next().value:i;w(p.byteOffset,e.byteOffset,C,B.lanes,A,I,Q,4,O);const n=p[0],D=p[1];0===A&&m(C,t),G(d,i,x[n][D],A>0?b:x[C][t]),A>0&&l(d,x[C][t],b,x[C][t])}}}const V=x[0][P-1];for(let A=1;A<B.lanes;A++)l(d,V,V,x[A][P-1]);const Z=H(B.tagLength,V,new Uint8Array(B.tagLength));return Y.fill(0),I.grow(0),Z}let p;async function d(A,I){const g=new WebAssembly.Memory({initial:1040,maximum:65536}),B=await async function(A,I,g){const B={env:{memory:A}};if(void 0===p)try{const A=await I(B);return p=!0,A}catch(A){p=!1}return(p?I:g)(B)}(g,A,I);return A=>K(A,{instance:B.instance,memory:g})}function b(I,g,B,C){var Q=null,E=A.atob(B),w=E.length;Q=new Uint8Array(new ArrayBuffer(w));for(var t=0;t<w;t++)Q[t]=E.charCodeAt(t);return function(A,I){var g=WebAssembly.instantiate,B=WebAssembly.compile;return I?g(A,I):B(A)}(Q,C)}const v=async()=>d((A=>b(0,0,"AGFzbQEAAAABKwdgBH9/f38AYAABf2AAAGADf39/AGAJf39/f39/f39/AX9gAX8AYAF/AX8CEwEDZW52Bm1lbW9yeQIBkAiAgAQDCgkCAwAABAEFBgEEBQFwAQICBgkBfwFBkIjAAg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ANq/QAEACAP/QAEAP1R/QsEACACIABBMHIiAGoiASAAIANq/QAEACAB/QAEAP1R/QsEACAQQQRqIhBBwABHDQALCxYAIAAgASACIAMQAiAAIAIgAiADEAILewIBfwF+IAIhCSABNQIAIQogBCAFcgRAIAEoAgQgA3AhCQsgACAJNgIAIAAgB0EBayAFIAQbIAhsIAZBAWtBAEF/IAYbIAIgCUYbaiIBIAVBAWogCGxBACAEG2ogAa0gCiAKfkIgiH5CIIinQX9zaiAHIAhscDYCBCAACwQAIwALBgAgACQACxAAIwAgAGtBcHEiACQAIAALBQBBgAgL",A)),(A=>b(0,0,"AGFzbQEAAAABPwhgBH9/f38AYAABf2AAAGADf39/AGARf39/f39/f39/f39/f39/f38AYAl/f39/f39/f38Bf2ABfwBgAX8BfwITAQNlbnYGbWVtb3J5AgGQCICABAMLCgIDBAAABQEGBwEEBQFwAQICBgkBfwFBkIjAAgsHfQoDeG9yAAEBRwADAkcyAAQFZ2V0TFoABRlfX2luZGlyZWN0X2Z1bmN0aW9uX3RhYmxlAQALX2luaXRpYWxpemUAABBfX2Vycm5vX2xvY2F0aW9uAAkJc3RhY2tTYXZlAAYMc3RhY2tSZXN0b3JlAAcKc3RhY2tBbGxvYwAICQcBAEEBCwEACssaCgMAAQtQAQJ/A0AgACAEQQN0IgNqIAIgA2opAwAgASADaikDAIU3AwAgACADQQhyIgNqIAIgA2opAwAgASADaikDAIU3AwAgBEECaiIEQYABRw0ACwveDwICfgF/IAAgAUEDdGoiEyATKQMAIhEgACAFQQN0aiIBKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA1BA3RqIgUgESAFKQMAhUIgiSIRNwMAIAAgCUEDdGoiCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIoiSIRNwMAIBMgESATKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAFIBEgBSkDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgASARIAEpAwCFQgGJNwMAIAAgAkEDdGoiDSANKQMAIhEgACAGQQN0aiICKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA5BA3RqIgYgESAGKQMAhUIgiSIRNwMAIAAgCkEDdGoiCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIoiSIRNwMAIA0gESANKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAKIBEgCikDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAiARIAIpAwCFQgGJNwMAIAAgA0EDdGoiDiAOKQMAIhEgACAHQQN0aiIDKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIA9BA3RqIgcgESAHKQMAhUIgiSIRNwMAIAAgC0EDdGoiCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAMgESADKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAHIBEgBykDAIVCMIkiETcDACALIBEgCykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQgGJNwMAIAAgBEEDdGoiDyAPKQMAIhEgACAIQQN0aiIEKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAAIBBBA3RqIgggESAIKQMAhUIgiSIRNwMAIAAgDEEDdGoiACARIAApAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA8gESAPKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAIIBEgCCkDAIVCMIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIBMgEykDACIRIAIpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAggESAIKQMAhUIgiSIRNwMAIAsgESALKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACACIBEgAikDAIVCKIkiETcDACATIBEgEykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgCCARIAgpAwCFQjCJIhE3AwAgCyARIAspAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAIgESACKQMAhUIBiTcDACANIA0pAwAiESADKQMAIhJ8IBFCAYZC/v///x+DIBJC/////w+DfnwiETcDACAFIBEgBSkDAIVCIIkiETcDACAAIBEgACkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgAyARIAMpAwCFQiiJIhE3AwAgDSARIA0pAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAUgESAFKQMAhUIwiSIRNwMAIAAgESAAKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACADIBEgAykDAIVCAYk3AwAgDiAOKQMAIhEgBCkDACISfCARQgGGQv7///8fgyASQv////8Pg358IhE3AwAgBiARIAYpAwCFQiCJIhE3AwAgCSARIAkpAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAQgESAEKQMAhUIoiSIRNwMAIA4gESAOKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACAGIBEgBikDAIVCMIkiETcDACAJIBEgCSkDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgBCARIAQpAwCFQgGJNwMAIA8gDykDACIRIAEpAwAiEnwgEUIBhkL+////H4MgEkL/////D4N+fCIRNwMAIAcgESAHKQMAhUIgiSIRNwMAIAogESAKKQMAIhJ8IBFC/////w+DIBJCAYZC/v///x+DfnwiETcDACABIBEgASkDAIVCKIkiETcDACAPIBEgDykDACISfCARQv////8PgyASQgGGQv7///8fg358IhE3AwAgByARIAcpAwCFQjCJIhE3AwAgCiARIAopAwAiEnwgEUL/////D4MgEkIBhkL+////H4N+fCIRNwMAIAEgESABKQMAhUIBiTcDAAvdCAEPfwNAIAIgBUEDdCIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAIgBkEIciIGaiABIAZqKQMAIAAgBmopAwCFNwMAIAVBAmoiBUGAAUcNAAsDQCADIARBA3QiAGogACACaikDADcDACADIARBAXIiAEEDdCIBaiABIAJqKQMANwMAIAMgBEECciIBQQN0IgVqIAIgBWopAwA3AwAgAyAEQQNyIgVBA3QiBmogAiAGaikDADcDACADIARBBHIiBkEDdCIHaiACIAdqKQMANwMAIAMgBEEFciIHQQN0IghqIAIgCGopAwA3AwAgAyAEQQZyIghBA3QiCWogAiAJaikDADcDACADIARBB3IiCUEDdCIKaiACIApqKQMANwMAIAMgBEEIciIKQQN0IgtqIAIgC2opAwA3AwAgAyAEQQlyIgtBA3QiDGogAiAMaikDADcDACADIARBCnIiDEEDdCINaiACIA1qKQMANwMAIAMgBEELciINQQN0Ig5qIAIgDmopAwA3AwAgAyAEQQxyIg5BA3QiD2ogAiAPaikDADcDACADIARBDXIiD0EDdCIQaiACIBBqKQMANwMAIAMgBEEOciIQQQN0IhFqIAIgEWopAwA3AwAgAyAEQQ9yIhFBA3QiEmogAiASaikDADcDACADIARB//8DcSAAQf//A3EgAUH//wNxIAVB//8DcSAGQf//A3EgB0H//wNxIAhB//8DcSAJQf//A3EgCkH//wNxIAtB//8DcSAMQf//A3EgDUH//wNxIA5B//8DcSAPQf//A3EgEEH//wNxIBFB//8DcRACIARB8ABJIQAgBEEQaiEEIAANAAtBACEBIANBAEEBQRBBEUEgQSFBMEExQcAAQcEAQdAAQdEAQeAAQeEAQfAAQfEAEAIgA0ECQQNBEkETQSJBI0EyQTNBwgBBwwBB0gBB0wBB4gBB4wBB8gBB8wAQAiADQQRBBUEUQRVBJEElQTRBNUHEAEHFAEHUAEHVAEHkAEHlAEH0AEH1ABACIANBBkEHQRZBF0EmQSdBNkE3QcYAQccAQdYAQdcAQeYAQecAQfYAQfcAEAIgA0EIQQlBGEEZQShBKUE4QTlByABByQBB2ABB2QBB6ABB6QBB+ABB+QAQAiADQQpBC0EaQRtBKkErQTpBO0HKAEHLAEHaAEHbAEHqAEHrAEH6AEH7ABACIANBDEENQRxBHUEsQS1BPEE9QcwAQc0AQdwAQd0AQewAQe0AQfwAQf0AEAIgA0EOQQ9BHkEfQS5BL0E+QT9BzgBBzwBB3gBB3wBB7gBB7wBB/gBB/wAQAgNAIAIgAUEDdCIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAiAAQQhyIgRqIgUgAyAEaikDACAFKQMAhTcDACACIABBEHIiBGoiBSADIARqKQMAIAUpAwCFNwMAIAIgAEEYciIAaiIEIAAgA2opAwAgBCkDAIU3AwAgAUEEaiIBQYABRw0ACwsWACAAIAEgAiADEAMgACACIAIgAxADC3sCAX8BfiACIQkgATUCACEKIAQgBXIEQCABKAIEIANwIQkLIAAgCTYCACAAIAdBAWsgBSAEGyAIbCAGQQFrQQBBfyAGGyACIAlGG2oiASAFQQFqIAhsQQAgBBtqIAGtIAogCn5CIIh+QiCIp0F/c2ogByAIbHA2AgQgAAsEACMACwYAIAAkAAsQACMAIABrQXBxIgAkACAACwUAQYAICw==",A)));export{v as default};
3
3
  //# sourceMappingURL=argon2id.min.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"argon2id.min.mjs","sources":["../../node_modules/argon2id/lib/blake2b.js","../../node_modules/argon2id/lib/argon2id.js","../../node_modules/argon2id/lib/setup.js","../../node_modules/argon2id/index.js"],"sourcesContent":["// Adapted from the reference implementation in RFC7693\n// Initial port to Javascript by https://github.com/dcposch and https://github.com/emilbayes\n\n// Uint64 values are represented using two Uint32s, stored as little endian\n// NB: Uint32Arrays endianness depends on the underlying system, so for interoperability, conversions between Uint8Array and Uint32Arrays\n// need to be manually handled\n\n// 64-bit unsigned addition (little endian, in place)\n// Sets a[i,i+1] += b[j,j+1]\n// `a` and `b` must be Uint32Array(2)\nfunction ADD64 (a, i, b, j) {\n a[i] += b[j];\n a[i+1] += b[j+1] + (a[i] < b[j]); // add carry\n}\n\n// Increment 64-bit little-endian unsigned value by `c` (in place)\n// `a` must be Uint32Array(2)\nfunction INC64 (a, c) {\n a[0] += c;\n a[1] += (a[0] < c);\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction G (v, m, a, b, c, d, ix, iy) {\n ADD64(v, a, v, b) // v[a,a+1] += v[b,b+1]\n ADD64(v, a, m, ix) // v[a, a+1] += x ... x0\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64(v, c, v, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64(v, a, v, b)\n ADD64(v, a, m, iy)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64(v, c, v, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xF3BCC908, 0x6A09E667, 0x84CAA73B, 0xBB67AE85,\n 0xFE94F82B, 0x3C6EF372, 0x5F1D36F1, 0xA54FF53A,\n 0xADE682D1, 0x510E527F, 0x2B3E6C1F, 0x9B05688C,\n 0xFB41BD6B, 0x1F83D9AB, 0x137E2179, 0x5BE0CD19\n])\n\n// These are offsets into a Uint64 buffer.\n// Multiply them all by 2 to make them offsets into a Uint32 buffer\nconst SIGMA = new Uint8Array([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3\n].map(x => x * 2))\n\n// Compression function. 'last' flag indicates last block.\n// Note: we're representing 16 uint64s as 32 uint32s\nfunction compress(S, last) {\n const v = new Uint32Array(32)\n const m = new Uint32Array(S.b.buffer, S.b.byteOffset, 32)\n\n // init work variables\n for (let i = 0; i < 16; i++) {\n v[i] = S.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] ^= S.t0[0]\n v[25] ^= S.t0[1]\n // high 64 bits not supported (`t1`), offset may not be higher than 2**53-1\n\n // if last block\n const f0 = last ? 0xFFFFFFFF : 0;\n v[28] ^= f0;\n v[29] ^= f0;\n\n // twelve rounds of mixing\n for (let i = 0; i < 12; i++) {\n // ROUND(r)\n const i16 = i << 4;\n G(v, m, 0, 8, 16, 24, SIGMA[i16 + 0], SIGMA[i16 + 1])\n G(v, m, 2, 10, 18, 26, SIGMA[i16 + 2], SIGMA[i16 + 3])\n G(v, m, 4, 12, 20, 28, SIGMA[i16 + 4], SIGMA[i16 + 5])\n G(v, m, 6, 14, 22, 30, SIGMA[i16 + 6], SIGMA[i16 + 7])\n G(v, m, 0, 10, 20, 30, SIGMA[i16 + 8], SIGMA[i16 + 9])\n G(v, m, 2, 12, 22, 24, SIGMA[i16 + 10], SIGMA[i16 + 11])\n G(v, m, 4, 14, 16, 26, SIGMA[i16 + 12], SIGMA[i16 + 13])\n G(v, m, 6, 8, 18, 28, SIGMA[i16 + 14], SIGMA[i16 + 15])\n }\n\n for (let i = 0; i < 16; i++) {\n S.h[i] ^= v[i] ^ v[i + 16]\n }\n}\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\nclass Blake2b {\n constructor(outlen, key, salt, personal) {\n const params = new Uint8Array(64)\n // 0: outlen, keylen, fanout, depth\n // 4: leaf length, sequential mode\n // 8: node offset\n // 12: node offset\n // 16: node depth, inner length, rfu\n // 20: rfu\n // 24: rfu\n // 28: rfu\n // 32: salt\n // 36: salt\n // 40: salt\n // 44: salt\n // 48: personal\n // 52: personal\n // 56: personal\n // 60: personal\n\n // init internal state\n this.S = {\n b: new Uint8Array(BLOCKBYTES),\n h: new Uint32Array(OUTBYTES_MAX / 4),\n t0: new Uint32Array(2), // input counter `t`, lower 64-bits only\n c: 0, // `fill`, pointer within buffer, up to `BLOCKBYTES`\n outlen // output length in bytes\n }\n\n // init parameter block\n params[0] = outlen\n if (key) params[1] = key.length\n params[2] = 1 // fanout\n params[3] = 1 // depth\n if (salt) params.set(salt, 32)\n if (personal) params.set(personal, 48)\n const params32 = new Uint32Array(params.buffer, params.byteOffset, params.length / Uint32Array.BYTES_PER_ELEMENT);\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n this.S.h[i] = BLAKE2B_IV32[i] ^ params32[i];\n }\n\n // key the hash, if applicable\n if (key) {\n const block = new Uint8Array(BLOCKBYTES)\n block.set(key)\n this.update(block)\n }\n }\n\n // Updates a BLAKE2b streaming hash\n // Requires Uint8Array (byte array)\n update(input) {\n if (!(input instanceof Uint8Array)) throw new Error('Input must be Uint8Array or Buffer')\n // for (let i = 0; i < input.length; i++) {\n // if (this.S.c === BLOCKBYTES) { // buffer full\n // INC64(this.S.t0, this.S.c) // add counters\n // compress(this.S, false)\n // this.S.c = 0 // empty buffer\n // }\n // this.S.b[this.S.c++] = input[i]\n // }\n let i = 0\n while(i < input.length) {\n if (this.S.c === BLOCKBYTES) { // buffer full\n INC64(this.S.t0, this.S.c) // add counters\n compress(this.S, false)\n this.S.c = 0 // empty buffer\n }\n let left = BLOCKBYTES - this.S.c\n this.S.b.set(input.subarray(i, i + left), this.S.c) // end index can be out of bounds\n const fill = Math.min(left, input.length - i)\n this.S.c += fill\n i += fill\n }\n return this\n }\n\n /**\n * Return a BLAKE2b hash, either filling the given Uint8Array or allocating a new one\n * @param {Uint8Array} [prealloc] - optional preallocated buffer\n * @returns {ArrayBuffer} message digest\n */\n digest(prealloc) {\n INC64(this.S.t0, this.S.c) // mark last block offset\n\n // final block, padded\n this.S.b.fill(0, this.S.c);\n this.S.c = BLOCKBYTES;\n compress(this.S, true)\n\n const out = prealloc || new Uint8Array(this.S.outlen);\n for (let i = 0; i < this.S.outlen; i++) {\n // must be loaded individually since default Uint32 endianness is platform dependant\n out[i] = this.S.h[i >> 2] >> (8 * (i & 3))\n }\n this.S.h = null; // prevent calling `update` after `digest`\n return out.buffer;\n }\n}\n\n\nexport default function createHash(outlen, key, salt, personal) {\n if (outlen > OUTBYTES_MAX) throw new Error(`outlen must be at most ${OUTBYTES_MAX} (given: ${outlen})`)\n if (key) {\n if (!(key instanceof Uint8Array)) throw new Error('key must be Uint8Array or Buffer')\n if (key.length > KEYBYTES_MAX) throw new Error(`key size must be at most ${KEYBYTES_MAX} (given: ${key.length})`)\n }\n if (salt) {\n if (!(salt instanceof Uint8Array)) throw new Error('salt must be Uint8Array or Buffer')\n if (salt.length !== SALTBYTES) throw new Error(`salt must be exactly ${SALTBYTES} (given: ${salt.length}`)\n }\n if (personal) {\n if (!(personal instanceof Uint8Array)) throw new Error('personal must be Uint8Array or Buffer')\n if (personal.length !== PERSONALBYTES) throw new Error(`salt must be exactly ${PERSONALBYTES} (given: ${personal.length}`)\n }\n\n return new Blake2b(outlen, key, salt, personal)\n}\n\nconst OUTBYTES_MAX = 64;\nconst KEYBYTES_MAX = 64;\nconst SALTBYTES = 16;\nconst PERSONALBYTES = 16;\nconst BLOCKBYTES = 128;\n\n","import blake2b from \"./blake2b.js\"\nconst TYPE = 2; // Argon2id\nconst VERSION = 0x13;\nconst TAGBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1;\nconst TAGBYTES_MIN = 4; // Math.pow(2, 32) - 1;\nconst SALTBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1;\nconst SALTBYTES_MIN = 8;\nconst passwordBYTES_MAX = 0xFFFFFFFF;// Math.pow(2, 32) - 1;\nconst passwordBYTES_MIN = 8;\nconst MEMBYTES_MAX = 0xFFFFFFFF;// Math.pow(2, 32) - 1;\nconst ADBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1; // associated data (optional)\nconst SECRETBYTES_MAX = 32; // key (optional)\n\nconst ARGON2_BLOCK_SIZE = 1024;\nconst ARGON2_PREHASH_DIGEST_LENGTH = 64;\n\nconst isLittleEndian = new Uint8Array(new Uint16Array([0xabcd]).buffer)[0] === 0xcd;\n\n// store n as a little-endian 32-bit Uint8Array inside buf (at buf[i:i+3])\nfunction LE32(buf, n, i) {\n buf[i+0] = n;\n buf[i+1] = n >> 8;\n buf[i+2] = n >> 16;\n buf[i+3] = n >> 24;\n return buf;\n}\n\n/**\n * Store n as a 64-bit LE number in the given buffer (from buf[i] to buf[i+7])\n * @param {Uint8Array} buf\n * @param {Number} n\n * @param {Number} i\n */\nfunction LE64(buf, n, i) {\n if (n > Number.MAX_SAFE_INTEGER) throw new Error(\"LE64: large numbers unsupported\");\n // ECMAScript standard has engines convert numbers to 32-bit integers for bitwise operations\n // shifting by 32 or more bits is not supported (https://stackoverflow.com/questions/6729122/javascript-bit-shift-number-wraps)\n // so we manually extract each byte\n let remainder = n;\n for (let offset = i; offset < i+7; offset++) { // last byte can be ignored as it would overflow MAX_SAFE_INTEGER\n buf[offset] = remainder; // implicit & 0xff\n remainder = (remainder - buf[offset]) / 256;\n }\n return buf;\n}\n\n/**\n * Variable-Length Hash Function H'\n * @param {Number} outlen - T\n * @param {Uint8Array} X - value to hash\n * @param {Uint8Array} res - output buffer, of length `outlength` or larger\n */\nfunction H_(outlen, X, res) {\n const V = new Uint8Array(64); // no need to keep around all V_i\n\n const V1_in = new Uint8Array(4 + X.length);\n LE32(V1_in, outlen, 0);\n V1_in.set(X, 4);\n if (outlen <= 64) {\n // H'^T(A) = H^T(LE32(T)||A)\n blake2b(outlen).update(V1_in).digest(res);\n return res\n }\n\n const r = Math.ceil(outlen / 32) - 2;\n\n // Let V_i be a 64-byte block and W_i be its first 32 bytes.\n // V_1 = H^(64)(LE32(T)||A)\n // V_2 = H^(64)(V_1)\n // ...\n // V_r = H^(64)(V_{r-1})\n // V_{r+1} = H^(T-32*r)(V_{r})\n // H'^T(X) = W_1 || W_2 || ... || W_r || V_{r+1}\n for (let i = 0; i < r; i++) {\n blake2b(64).update(i === 0 ? V1_in : V).digest(V);\n // store W_i in result buffer already\n res.set(V.subarray(0, 32), i*32)\n }\n // V_{r+1}\n const V_r1 = new Uint8Array(blake2b(outlen - 32*r).update(V).digest());\n res.set(V_r1, r*32);\n\n return res;\n}\n\n// compute buf = xs ^ ys\nfunction XOR(wasmContext, buf, xs, ys) {\n wasmContext.fn.XOR(\n buf.byteOffset,\n xs.byteOffset,\n ys.byteOffset,\n );\n return buf\n}\n\n/**\n * @param {Uint8Array} X (read-only)\n * @param {Uint8Array} Y (read-only)\n * @param {Uint8Array} R - output buffer\n * @returns\n */\nfunction G(wasmContext, X, Y, R) {\n wasmContext.fn.G(\n X.byteOffset,\n Y.byteOffset,\n R.byteOffset,\n wasmContext.refs.gZ.byteOffset\n );\n return R;\n}\n\nfunction G2(wasmContext, X, Y, R) {\n wasmContext.fn.G2(\n X.byteOffset,\n Y.byteOffset,\n R.byteOffset,\n wasmContext.refs.gZ.byteOffset\n );\n return R;\n}\n\n// Generator for data-independent J1, J2. Each `next()` invocation returns a new pair of values.\nfunction* makePRNG(wasmContext, pass, lane, slice, m_, totalPasses, segmentLength, segmentOffset) {\n // For each segment, we do the following. First, we compute the value Z as:\n // Z= ( LE64(r) || LE64(l) || LE64(sl) || LE64(m') || LE64(t) || LE64(y) )\n wasmContext.refs.prngTmp.fill(0);\n const Z = wasmContext.refs.prngTmp.subarray(0, 6 * 8);\n LE64(Z, pass, 0);\n LE64(Z, lane, 8);\n LE64(Z, slice, 16);\n LE64(Z, m_, 24);\n LE64(Z, totalPasses, 32);\n LE64(Z, TYPE, 40);\n\n // Then we compute q/(128*SL) 1024-byte values\n // G( ZERO(1024),\n // G( ZERO(1024), Z || LE64(1) || ZERO(968) ) ),\n // ...,\n // G( ZERO(1024),\n // G( ZERO(1024), Z || LE64(q/(128*SL)) || ZERO(968) )),\n for(let i = 1; i <= segmentLength; i++) {\n // tmp.set(Z); // no need to re-copy\n LE64(wasmContext.refs.prngTmp, i, Z.length); // tmp.set(ZER0968) not necessary, memory already zeroed\n const g2 = G2(wasmContext, wasmContext.refs.ZERO1024, wasmContext.refs.prngTmp, wasmContext.refs.prngR );\n\n // each invocation of G^2 outputs 1024 bytes that are to be partitioned into 8-bytes values, take as X1 || X2\n // NB: the first generated pair must be used for the first block of the segment, and so on.\n // Hence, if some blocks are skipped (e.g. during the first pass), the corresponding J1J2 are discarded based on the given segmentOffset.\n for(let k = i === 1 ? segmentOffset*8 : 0; k < g2.length; k += 8) {\n yield g2.subarray(k, k+8);\n }\n }\n return [];\n}\n\nfunction validateParams({ type, version, tagLength, password, salt, ad, secret, parallelism, memorySize, passes }) {\n const assertLength = (name, value, min, max) => {\n if (value < min || value > max) { throw new Error(`${name} size should be between ${min} and ${max} bytes`); }\n }\n\n if (type !== TYPE || version !== VERSION) throw new Error('Unsupported type or version');\n assertLength('password', password, passwordBYTES_MIN, passwordBYTES_MAX);\n assertLength('salt', salt, SALTBYTES_MIN, SALTBYTES_MAX);\n assertLength('tag', tagLength, TAGBYTES_MIN, TAGBYTES_MAX);\n assertLength('memory', memorySize, 8*parallelism, MEMBYTES_MAX);\n // optional fields\n ad && assertLength('associated data', ad, 0, ADBYTES_MAX);\n secret && assertLength('secret', secret, 0, SECRETBYTES_MAX);\n\n return { type, version, tagLength, password, salt, ad, secret, lanes: parallelism, memorySize, passes };\n}\n\nconst KB = 1024;\nconst WASM_PAGE_SIZE = 64 * KB;\n\nexport default function argon2id(params, { memory, instance: wasmInstance }) {\n if (!isLittleEndian) throw new Error('BigEndian system not supported'); // optmisations assume LE system\n\n const ctx = validateParams({ type: TYPE, version: VERSION, ...params });\n\n const { G:wasmG, G2:wasmG2, xor:wasmXOR, getLZ:wasmLZ } = wasmInstance.exports;\n const wasmRefs = {};\n const wasmFn = {};\n wasmFn.G = wasmG;\n wasmFn.G2 = wasmG2;\n wasmFn.XOR = wasmXOR;\n\n // The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p.\n const m_ = 4 * ctx.lanes * Math.floor(ctx.memorySize / (4 * ctx.lanes));\n const requiredMemory = m_ * ARGON2_BLOCK_SIZE + 10 * KB; // Additional KBs for utility references\n if (memory.buffer.byteLength < requiredMemory) {\n const missing = Math.ceil((requiredMemory - memory.buffer.byteLength) / WASM_PAGE_SIZE)\n // If enough memory is available, the `memory.buffer` is internally detached and the reference updated.\n // Otherwise, the operation fails, and the original memory can still be used.\n memory.grow(missing)\n }\n\n let offset = 0;\n // Init wasm memory needed in other functions\n wasmRefs.gZ = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+= wasmRefs.gZ.length;\n wasmRefs.prngR = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=wasmRefs.prngR.length;\n wasmRefs.prngTmp = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=wasmRefs.prngTmp.length;\n wasmRefs.ZERO1024 = new Uint8Array(memory.buffer, offset, 1024); offset+=wasmRefs.ZERO1024.length;\n // Init wasm memory needed locally\n const lz = new Uint32Array(memory.buffer, offset, 2); offset+=lz.length * Uint32Array.BYTES_PER_ELEMENT;\n const wasmContext = { fn: wasmFn, refs: wasmRefs };\n const newBlock = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=newBlock.length;\n const blockMemory = new Uint8Array(memory.buffer, offset, ctx.memorySize * ARGON2_BLOCK_SIZE);\n const allocatedMemory = new Uint8Array(memory.buffer, 0, offset);\n\n // 1. Establish H_0\n const H0 = getH0(ctx);\n\n // 2. Allocate the memory as m' 1024-byte blocks\n // For p lanes, the memory is organized in a matrix B[i][j] of blocks with p rows (lanes) and q = m' / p columns.\n const q = m_ / ctx.lanes;\n const B = new Array(ctx.lanes).fill(null).map(() => new Array(q));\n const initBlock = (i, j) => {\n B[i][j] = blockMemory.subarray(i*q*1024 + j*1024, (i*q*1024 + j*1024) + ARGON2_BLOCK_SIZE);\n return B[i][j];\n }\n\n for (let i = 0; i < ctx.lanes; i++) {\n // const LEi = LE0; // since p = 1 for us\n const tmp = new Uint8Array(H0.length + 8);\n // 3. Compute B[i][0] for all i ranging from (and including) 0 to (not including) p\n // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i))\n tmp.set(H0); LE32(tmp, 0, H0.length); LE32(tmp, i, H0.length + 4);\n H_(ARGON2_BLOCK_SIZE, tmp, initBlock(i, 0));\n // 4. Compute B[i][1] for all i ranging from (and including) 0 to (not including) p\n // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i))\n LE32(tmp, 1, H0.length);\n H_(ARGON2_BLOCK_SIZE, tmp, initBlock(i, 1));\n }\n\n // 5. Compute B[i][j] for all i ranging from (and including) 0 to (not including) p and for all j ranging from (and including) 2\n // to (not including) q. The computation MUST proceed slicewise (Section 3.4) : first, blocks from slice 0 are computed for all lanes\n // (in an arbitrary order of lanes), then blocks from slice 1 are computed, etc.\n const SL = 4; // vertical slices\n const segmentLength = q / SL;\n for (let pass = 0; pass < ctx.passes; pass++) {\n // The intersection of a slice and a lane is called a segment, which has a length of q/SL. Segments of the same slice can be computed in parallel\n for (let sl = 0; sl < SL; sl++) {\n const isDataIndependent = pass === 0 && sl <= 1;\n for (let i = 0; i < ctx.lanes; i++) { // lane\n // On the first slice of the first pass, blocks 0 and 1 are already filled\n let segmentOffset = sl === 0 && pass === 0 ? 2 : 0;\n // no need to generate all J1J2s, use iterator/generator that creates the value on the fly (to save memory)\n const PRNG = isDataIndependent ? makePRNG(wasmContext, pass, i, sl, m_, ctx.passes, segmentLength, segmentOffset) : null;\n for (segmentOffset; segmentOffset < segmentLength; segmentOffset++) {\n const j = sl * segmentLength + segmentOffset;\n const prevBlock = j > 0 ? B[i][j-1] : B[i][q-1]; // B[i][(j-1) mod q]\n\n // we can assume the PRNG is never done\n const J1J2 = isDataIndependent ? PRNG.next().value : prevBlock; // .subarray(0, 8) not required since we only pass the byteOffset to wasm\n // The block indices l and z are determined for each i, j differently for Argon2d, Argon2i, and Argon2id.\n wasmLZ(lz.byteOffset, J1J2.byteOffset, i, ctx.lanes, pass, sl, segmentOffset, SL, segmentLength)\n const l = lz[0]; const z = lz[1];\n // for (let i = 0; i < p; i++ )\n // B[i][j] = G(B[i][j-1], B[l][z])\n // The block indices l and z are determined for each i, j differently for Argon2d, Argon2i, and Argon2id.\n if (pass === 0) initBlock(i, j);\n G(wasmContext, prevBlock, B[l][z], pass > 0 ? newBlock : B[i][j]);\n\n // 6. If the number of passes t is larger than 1, we repeat step 5. However, blocks are computed differently as the old value is XORed with the new one\n if (pass > 0) XOR(wasmContext, B[i][j], newBlock, B[i][j])\n }\n }\n }\n }\n\n // 7. After t steps have been iterated, the final block C is computed as the XOR of the last column:\n // C = B[0][q-1] XOR B[1][q-1] XOR ... XOR B[p-1][q-1]\n const C = B[0][q-1];\n for(let i = 1; i < ctx.lanes; i++) {\n XOR(wasmContext, C, C, B[i][q-1])\n }\n\n const tag = H_(ctx.tagLength, C, new Uint8Array(ctx.tagLength));\n // clear memory since the module might be cached\n allocatedMemory.fill(0) // clear sensitive contents\n memory.grow(0) // allow deallocation\n // 8. The output tag is computed as H'^T(C).\n return tag;\n\n}\n\nfunction getH0(ctx) {\n const H = blake2b(ARGON2_PREHASH_DIGEST_LENGTH);\n const ZERO32 = new Uint8Array(4);\n const params = new Uint8Array(24);\n LE32(params, ctx.lanes, 0);\n LE32(params, ctx.tagLength, 4);\n LE32(params, ctx.memorySize, 8);\n LE32(params, ctx.passes, 12);\n LE32(params, ctx.version, 16);\n LE32(params, ctx.type, 20);\n\n const toHash = [params];\n if (ctx.password) {\n toHash.push(LE32(new Uint8Array(4), ctx.password.length, 0))\n toHash.push(ctx.password)\n } else {\n toHash.push(ZERO32) // context.password.length\n }\n\n if (ctx.salt) {\n toHash.push(LE32(new Uint8Array(4), ctx.salt.length, 0))\n toHash.push(ctx.salt)\n } else {\n toHash.push(ZERO32) // context.salt.length\n }\n\n if (ctx.secret) {\n toHash.push(LE32(new Uint8Array(4), ctx.secret.length, 0))\n toHash.push(ctx.secret)\n // todo clear secret?\n } else {\n toHash.push(ZERO32) // context.secret.length\n }\n\n if (ctx.ad) {\n toHash.push(LE32(new Uint8Array(4), ctx.ad.length, 0))\n toHash.push(ctx.ad)\n } else {\n toHash.push(ZERO32) // context.ad.length\n }\n H.update(concatArrays(toHash))\n\n const outputBuffer = H.digest();\n return new Uint8Array(outputBuffer);\n}\n\nfunction concatArrays(arrays) {\n if (arrays.length === 1) return arrays[0];\n\n let totalLength = 0;\n for (let i = 0; i < arrays.length; i++) {\n if (!(arrays[i] instanceof Uint8Array)) {\n throw new Error('concatArrays: Data must be in the form of a Uint8Array');\n }\n\n totalLength += arrays[i].length;\n }\n\n const result = new Uint8Array(totalLength);\n let pos = 0;\n arrays.forEach((element) => {\n result.set(element, pos);\n pos += element.length;\n });\n\n return result;\n}\n","import argon2id from \"./argon2id.js\";\n\nlet isSIMDSupported;\nasync function wasmLoader(memory, getSIMD, getNonSIMD) {\n const importObject = { env: { memory } };\n if (isSIMDSupported === undefined) {\n try {\n const loaded = await getSIMD(importObject);\n isSIMDSupported = true;\n return loaded;\n } catch(e) {\n isSIMDSupported = false;\n }\n }\n\n const loader = isSIMDSupported ? getSIMD : getNonSIMD;\n return loader(importObject);\n}\n\nexport default async function setupWasm(getSIMD, getNonSIMD) {\n const memory = new WebAssembly.Memory({\n // in pages of 64KiB each\n // these values need to be compatible with those declared when building in `build-wasm`\n initial: 1040, // 65MB\n maximum: 65536, // 4GB\n });\n const wasmModule = await wasmLoader(memory, getSIMD, getNonSIMD);\n\n /**\n * Argon2id hash function\n * @callback computeHash\n * @param {Object} params\n * @param {Uint8Array} params.password - password\n * @param {Uint8Array} params.salt - salt\n * @param {Integer} params.parallelism\n * @param {Integer} params.passes\n * @param {Integer} params.memorySize - in kibibytes\n * @param {Integer} params.tagLength - output tag length\n * @param {Uint8Array} [params.ad] - associated data (optional)\n * @param {Uint8Array} [params.secret] - secret data (optional)\n * @return {Uint8Array} argon2id hash\n */\n const computeHash = (params) => argon2id(params, { instance: wasmModule.instance, memory });\n\n return computeHash;\n}\n","import setupWasm from './lib/setup.js';\nimport wasmSIMD from './dist/simd.wasm';\nimport wasmNonSIMD from './dist/no-simd.wasm';\n\nconst loadWasm = async () => setupWasm(\n (instanceObject) => wasmSIMD(instanceObject),\n (instanceObject) => wasmNonSIMD(instanceObject),\n);\n\nexport default loadWasm;\n"],"names":["ADD64","a","i","b","j","INC64","c","G","v","m","d","ix","iy","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA","Uint8Array","map","x","compress","S","last","buffer","byteOffset","h","t0","f0","i16","Blake2b","constructor","outlen","key","salt","personal","params","this","BLOCKBYTES","OUTBYTES_MAX","length","set","params32","BYTES_PER_ELEMENT","block","update","input","Error","left","subarray","fill","Math","min","digest","prealloc","out","createHash","TYPE","VERSION","TAGBYTES_MAX","TAGBYTES_MIN","SALTBYTES_MAX","SALTBYTES_MIN","passwordBYTES_MAX","passwordBYTES_MIN","MEMBYTES_MAX","ADBYTES_MAX","SECRETBYTES_MAX","ARGON2_BLOCK_SIZE","ARGON2_PREHASH_DIGEST_LENGTH","isLittleEndian","Uint16Array","LE32","buf","n","LE64","Number","MAX_SAFE_INTEGER","remainder","offset","H_","X","res","V","V1_in","blake2b","r","ceil","V_r1","XOR","wasmContext","xs","ys","fn","Y","R","refs","gZ","G2","makePRNG","pass","lane","slice","m_","totalPasses","segmentLength","segmentOffset","prngTmp","Z","g2","ZERO1024","prngR","k","KB","WASM_PAGE_SIZE","argon2id","memory","instance","wasmInstance","ctx","type","version","tagLength","password","ad","secret","parallelism","memorySize","passes","assertLength","name","value","max","lanes","validateParams","wasmG","wasmG2","xor","wasmXOR","getLZ","wasmLZ","exports","wasmRefs","wasmFn","floor","requiredMemory","byteLength","missing","grow","lz","newBlock","blockMemory","allocatedMemory","H0","H","ZERO32","toHash","push","arrays","totalLength","result","pos","forEach","element","concatArrays","outputBuffer","getH0","q","B","Array","initBlock","tmp","sl","isDataIndependent","PRNG","prevBlock","J1J2","next","l","z","C","tag","isSIMDSupported","async","setupWasm","getSIMD","getNonSIMD","WebAssembly","Memory","initial","maximum","wasmModule","importObject","env","undefined","loaded","e","wasmLoader","loadWasm","instanceObject"],"mappings":";6GAUA,SAASA,EAAOC,EAAGC,EAAGC,EAAGC,GACvBH,EAAEC,IAAMC,EAAEC,GACVH,EAAEC,EAAE,IAAMC,EAAEC,EAAE,IAAMH,EAAEC,GAAKC,EAAEC,GA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rG,EAAGuC,EAAIG,UAAW0D,EAAG,IAAIlK,WAAWqG,EAAIG,YAKpD,OAHA8B,EAAgBtG,KAAK,GACrBkE,EAAOgC,KAAK,GAELiC,CAET,CC3RA,IAAIC,EAiBWC,eAAeC,EAAUC,EAASC,GAC/C,MAAMtE,EAAS,IAAIuE,YAAYC,OAAO,CAGpCC,QAAS,KACTC,QAAS,QAELC,QAvBRR,eAA0BnE,EAAQqE,EAASC,GACzC,MAAMM,EAAe,CAAEC,IAAK,CAAE7E,WAC9B,QAAwB8E,IAApBZ,EACF,IACE,MAAMa,QAAeV,EAAQO,GAE7B,OADAV,GAAkB,EACXa,CACR,CAAC,MAAMC,GACNd,GAAkB,CACnB,CAIH,OADeA,EAAkBG,EAAUC,GAC7BM,EAChB,CAS2BK,CAAWjF,EAAQqE,EAASC,GAkBrD,OAFqBtJ,GAAW+E,EAAS/E,EAAQ,CAAEiF,SAAU0E,EAAW1E,SAAUD,UAGpF,yOCzCK,MAACkF,EAAWf,SAAYC,GAC1Be,4wLAA4BA,KAC5BA,wyJAA+BA","x_google_ignoreList":[0,1,2,3]}
1
+ {"version":3,"file":"argon2id.min.mjs","sources":["../../node_modules/argon2id/lib/blake2b.js","../../node_modules/argon2id/lib/argon2id.js","../../node_modules/argon2id/lib/setup.js","../../node_modules/argon2id/index.js"],"sourcesContent":["// Adapted from the reference implementation in RFC7693\n// Initial port to Javascript by https://github.com/dcposch and https://github.com/emilbayes\n\n// Uint64 values are represented using two Uint32s, stored as little endian\n// NB: Uint32Arrays endianness depends on the underlying system, so for interoperability, conversions between Uint8Array and Uint32Arrays\n// need to be manually handled\n\n// 64-bit unsigned addition (little endian, in place)\n// Sets a[i,i+1] += b[j,j+1]\n// `a` and `b` must be Uint32Array(2)\nfunction ADD64 (a, i, b, j) {\n a[i] += b[j];\n a[i+1] += b[j+1] + (a[i] < b[j]); // add carry\n}\n\n// Increment 64-bit little-endian unsigned value by `c` (in place)\n// `a` must be Uint32Array(2)\nfunction INC64 (a, c) {\n a[0] += c;\n a[1] += (a[0] < c);\n}\n\n// G Mixing function\n// The ROTRs are inlined for speed\nfunction G (v, m, a, b, c, d, ix, iy) {\n ADD64(v, a, v, b) // v[a,a+1] += v[b,b+1]\n ADD64(v, a, m, ix) // v[a, a+1] += x ... x0\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated to the right by 32 bits\n let xor0 = v[d] ^ v[a]\n let xor1 = v[d + 1] ^ v[a + 1]\n v[d] = xor1\n v[d + 1] = xor0\n\n ADD64(v, c, v, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 24 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor0 >>> 24) ^ (xor1 << 8)\n v[b + 1] = (xor1 >>> 24) ^ (xor0 << 8)\n\n ADD64(v, a, v, b)\n ADD64(v, a, m, iy)\n\n // v[d,d+1] = (v[d,d+1] xor v[a,a+1]) rotated right by 16 bits\n xor0 = v[d] ^ v[a]\n xor1 = v[d + 1] ^ v[a + 1]\n v[d] = (xor0 >>> 16) ^ (xor1 << 16)\n v[d + 1] = (xor1 >>> 16) ^ (xor0 << 16)\n\n ADD64(v, c, v, d)\n\n // v[b,b+1] = (v[b,b+1] xor v[c,c+1]) rotated right by 63 bits\n xor0 = v[b] ^ v[c]\n xor1 = v[b + 1] ^ v[c + 1]\n v[b] = (xor1 >>> 31) ^ (xor0 << 1)\n v[b + 1] = (xor0 >>> 31) ^ (xor1 << 1)\n}\n\n// Initialization Vector\nconst BLAKE2B_IV32 = new Uint32Array([\n 0xF3BCC908, 0x6A09E667, 0x84CAA73B, 0xBB67AE85,\n 0xFE94F82B, 0x3C6EF372, 0x5F1D36F1, 0xA54FF53A,\n 0xADE682D1, 0x510E527F, 0x2B3E6C1F, 0x9B05688C,\n 0xFB41BD6B, 0x1F83D9AB, 0x137E2179, 0x5BE0CD19\n])\n\n// These are offsets into a Uint64 buffer.\n// Multiply them all by 2 to make them offsets into a Uint32 buffer\nconst SIGMA = new Uint8Array([\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3,\n 11, 8, 12, 0, 5, 2, 15, 13, 10, 14, 3, 6, 7, 1, 9, 4,\n 7, 9, 3, 1, 13, 12, 11, 14, 2, 6, 5, 10, 4, 0, 15, 8,\n 9, 0, 5, 7, 2, 4, 10, 15, 14, 1, 11, 12, 6, 8, 3, 13,\n 2, 12, 6, 10, 0, 11, 8, 3, 4, 13, 7, 5, 15, 14, 1, 9,\n 12, 5, 1, 15, 14, 13, 4, 10, 0, 7, 6, 3, 9, 2, 8, 11,\n 13, 11, 7, 14, 12, 1, 3, 9, 5, 0, 15, 4, 8, 6, 2, 10,\n 6, 15, 14, 9, 11, 3, 0, 8, 12, 2, 13, 7, 1, 4, 10, 5,\n 10, 2, 8, 4, 7, 6, 1, 5, 15, 11, 9, 14, 3, 12, 13, 0,\n 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,\n 14, 10, 4, 8, 9, 15, 13, 6, 1, 12, 0, 2, 11, 7, 5, 3\n].map(x => x * 2))\n\n// Compression function. 'last' flag indicates last block.\n// Note: we're representing 16 uint64s as 32 uint32s\nfunction compress(S, last) {\n const v = new Uint32Array(32)\n const m = new Uint32Array(S.b.buffer, S.b.byteOffset, 32)\n\n // init work variables\n for (let i = 0; i < 16; i++) {\n v[i] = S.h[i]\n v[i + 16] = BLAKE2B_IV32[i]\n }\n\n // low 64 bits of offset\n v[24] ^= S.t0[0]\n v[25] ^= S.t0[1]\n // high 64 bits not supported (`t1`), offset may not be higher than 2**53-1\n\n // if last block\n const f0 = last ? 0xFFFFFFFF : 0;\n v[28] ^= f0;\n v[29] ^= f0;\n\n // twelve rounds of mixing\n for (let i = 0; i < 12; i++) {\n // ROUND(r)\n const i16 = i << 4;\n G(v, m, 0, 8, 16, 24, SIGMA[i16 + 0], SIGMA[i16 + 1])\n G(v, m, 2, 10, 18, 26, SIGMA[i16 + 2], SIGMA[i16 + 3])\n G(v, m, 4, 12, 20, 28, SIGMA[i16 + 4], SIGMA[i16 + 5])\n G(v, m, 6, 14, 22, 30, SIGMA[i16 + 6], SIGMA[i16 + 7])\n G(v, m, 0, 10, 20, 30, SIGMA[i16 + 8], SIGMA[i16 + 9])\n G(v, m, 2, 12, 22, 24, SIGMA[i16 + 10], SIGMA[i16 + 11])\n G(v, m, 4, 14, 16, 26, SIGMA[i16 + 12], SIGMA[i16 + 13])\n G(v, m, 6, 8, 18, 28, SIGMA[i16 + 14], SIGMA[i16 + 15])\n }\n\n for (let i = 0; i < 16; i++) {\n S.h[i] ^= v[i] ^ v[i + 16]\n }\n}\n\n// Creates a BLAKE2b hashing context\n// Requires an output length between 1 and 64 bytes\n// Takes an optional Uint8Array key\nclass Blake2b {\n constructor(outlen, key, salt, personal) {\n const params = new Uint8Array(64)\n // 0: outlen, keylen, fanout, depth\n // 4: leaf length, sequential mode\n // 8: node offset\n // 12: node offset\n // 16: node depth, inner length, rfu\n // 20: rfu\n // 24: rfu\n // 28: rfu\n // 32: salt\n // 36: salt\n // 40: salt\n // 44: salt\n // 48: personal\n // 52: personal\n // 56: personal\n // 60: personal\n\n // init internal state\n this.S = {\n b: new Uint8Array(BLOCKBYTES),\n h: new Uint32Array(OUTBYTES_MAX / 4),\n t0: new Uint32Array(2), // input counter `t`, lower 64-bits only\n c: 0, // `fill`, pointer within buffer, up to `BLOCKBYTES`\n outlen // output length in bytes\n }\n\n // init parameter block\n params[0] = outlen\n if (key) params[1] = key.length\n params[2] = 1 // fanout\n params[3] = 1 // depth\n if (salt) params.set(salt, 32)\n if (personal) params.set(personal, 48)\n const params32 = new Uint32Array(params.buffer, params.byteOffset, params.length / Uint32Array.BYTES_PER_ELEMENT);\n\n // initialize hash state\n for (let i = 0; i < 16; i++) {\n this.S.h[i] = BLAKE2B_IV32[i] ^ params32[i];\n }\n\n // key the hash, if applicable\n if (key) {\n const block = new Uint8Array(BLOCKBYTES)\n block.set(key)\n this.update(block)\n }\n }\n\n // Updates a BLAKE2b streaming hash\n // Requires Uint8Array (byte array)\n update(input) {\n if (!(input instanceof Uint8Array)) throw new Error('Input must be Uint8Array or Buffer')\n // for (let i = 0; i < input.length; i++) {\n // if (this.S.c === BLOCKBYTES) { // buffer full\n // INC64(this.S.t0, this.S.c) // add counters\n // compress(this.S, false)\n // this.S.c = 0 // empty buffer\n // }\n // this.S.b[this.S.c++] = input[i]\n // }\n let i = 0\n while(i < input.length) {\n if (this.S.c === BLOCKBYTES) { // buffer full\n INC64(this.S.t0, this.S.c) // add counters\n compress(this.S, false)\n this.S.c = 0 // empty buffer\n }\n let left = BLOCKBYTES - this.S.c\n this.S.b.set(input.subarray(i, i + left), this.S.c) // end index can be out of bounds\n const fill = Math.min(left, input.length - i)\n this.S.c += fill\n i += fill\n }\n return this\n }\n\n /**\n * Return a BLAKE2b hash, either filling the given Uint8Array or allocating a new one\n * @param {Uint8Array} [prealloc] - optional preallocated buffer\n * @returns {ArrayBuffer} message digest\n */\n digest(prealloc) {\n INC64(this.S.t0, this.S.c) // mark last block offset\n\n // final block, padded\n this.S.b.fill(0, this.S.c);\n this.S.c = BLOCKBYTES;\n compress(this.S, true)\n\n const out = prealloc || new Uint8Array(this.S.outlen);\n for (let i = 0; i < this.S.outlen; i++) {\n // must be loaded individually since default Uint32 endianness is platform dependant\n out[i] = this.S.h[i >> 2] >> (8 * (i & 3))\n }\n this.S.h = null; // prevent calling `update` after `digest`\n return out.buffer;\n }\n}\n\n\nexport default function createHash(outlen, key, salt, personal) {\n if (outlen > OUTBYTES_MAX) throw new Error(`outlen must be at most ${OUTBYTES_MAX} (given: ${outlen})`)\n if (key) {\n if (!(key instanceof Uint8Array)) throw new Error('key must be Uint8Array or Buffer')\n if (key.length > KEYBYTES_MAX) throw new Error(`key size must be at most ${KEYBYTES_MAX} (given: ${key.length})`)\n }\n if (salt) {\n if (!(salt instanceof Uint8Array)) throw new Error('salt must be Uint8Array or Buffer')\n if (salt.length !== SALTBYTES) throw new Error(`salt must be exactly ${SALTBYTES} (given: ${salt.length}`)\n }\n if (personal) {\n if (!(personal instanceof Uint8Array)) throw new Error('personal must be Uint8Array or Buffer')\n if (personal.length !== PERSONALBYTES) throw new Error(`salt must be exactly ${PERSONALBYTES} (given: ${personal.length}`)\n }\n\n return new Blake2b(outlen, key, salt, personal)\n}\n\nconst OUTBYTES_MAX = 64;\nconst KEYBYTES_MAX = 64;\nconst SALTBYTES = 16;\nconst PERSONALBYTES = 16;\nconst BLOCKBYTES = 128;\n\n","import blake2b from \"./blake2b.js\"\nconst TYPE = 2; // Argon2id\nconst VERSION = 0x13;\nconst TAGBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1;\nconst TAGBYTES_MIN = 4; // Math.pow(2, 32) - 1;\nconst SALTBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1;\nconst SALTBYTES_MIN = 8;\nconst passwordBYTES_MAX = 0xFFFFFFFF;// Math.pow(2, 32) - 1;\nconst passwordBYTES_MIN = 8;\nconst MEMBYTES_MAX = 0xFFFFFFFF;// Math.pow(2, 32) - 1;\nconst ADBYTES_MAX = 0xFFFFFFFF; // Math.pow(2, 32) - 1; // associated data (optional)\nconst SECRETBYTES_MAX = 32; // key (optional)\n\nconst ARGON2_BLOCK_SIZE = 1024;\nconst ARGON2_PREHASH_DIGEST_LENGTH = 64;\n\nconst isLittleEndian = new Uint8Array(new Uint16Array([0xabcd]).buffer)[0] === 0xcd;\n\n// store n as a little-endian 32-bit Uint8Array inside buf (at buf[i:i+3])\nfunction LE32(buf, n, i) {\n buf[i+0] = n;\n buf[i+1] = n >> 8;\n buf[i+2] = n >> 16;\n buf[i+3] = n >> 24;\n return buf;\n}\n\n/**\n * Store n as a 64-bit LE number in the given buffer (from buf[i] to buf[i+7])\n * @param {Uint8Array} buf\n * @param {Number} n\n * @param {Number} i\n */\nfunction LE64(buf, n, i) {\n if (n > Number.MAX_SAFE_INTEGER) throw new Error(\"LE64: large numbers unsupported\");\n // ECMAScript standard has engines convert numbers to 32-bit integers for bitwise operations\n // shifting by 32 or more bits is not supported (https://stackoverflow.com/questions/6729122/javascript-bit-shift-number-wraps)\n // so we manually extract each byte\n let remainder = n;\n for (let offset = i; offset < i+7; offset++) { // last byte can be ignored as it would overflow MAX_SAFE_INTEGER\n buf[offset] = remainder; // implicit & 0xff\n remainder = (remainder - buf[offset]) / 256;\n }\n return buf;\n}\n\n/**\n * Variable-Length Hash Function H'\n * @param {Number} outlen - T\n * @param {Uint8Array} X - value to hash\n * @param {Uint8Array} res - output buffer, of length `outlength` or larger\n */\nfunction H_(outlen, X, res) {\n const V = new Uint8Array(64); // no need to keep around all V_i\n\n const V1_in = new Uint8Array(4 + X.length);\n LE32(V1_in, outlen, 0);\n V1_in.set(X, 4);\n if (outlen <= 64) {\n // H'^T(A) = H^T(LE32(T)||A)\n blake2b(outlen).update(V1_in).digest(res);\n return res\n }\n\n const r = Math.ceil(outlen / 32) - 2;\n\n // Let V_i be a 64-byte block and W_i be its first 32 bytes.\n // V_1 = H^(64)(LE32(T)||A)\n // V_2 = H^(64)(V_1)\n // ...\n // V_r = H^(64)(V_{r-1})\n // V_{r+1} = H^(T-32*r)(V_{r})\n // H'^T(X) = W_1 || W_2 || ... || W_r || V_{r+1}\n for (let i = 0; i < r; i++) {\n blake2b(64).update(i === 0 ? V1_in : V).digest(V);\n // store W_i in result buffer already\n res.set(V.subarray(0, 32), i*32)\n }\n // V_{r+1}\n const V_r1 = new Uint8Array(blake2b(outlen - 32*r).update(V).digest());\n res.set(V_r1, r*32);\n\n return res;\n}\n\n// compute buf = xs ^ ys\nfunction XOR(wasmContext, buf, xs, ys) {\n wasmContext.fn.XOR(\n buf.byteOffset,\n xs.byteOffset,\n ys.byteOffset,\n );\n return buf\n}\n\n/**\n * @param {Uint8Array} X (read-only)\n * @param {Uint8Array} Y (read-only)\n * @param {Uint8Array} R - output buffer\n * @returns\n */\nfunction G(wasmContext, X, Y, R) {\n wasmContext.fn.G(\n X.byteOffset,\n Y.byteOffset,\n R.byteOffset,\n wasmContext.refs.gZ.byteOffset\n );\n return R;\n}\n\nfunction G2(wasmContext, X, Y, R) {\n wasmContext.fn.G2(\n X.byteOffset,\n Y.byteOffset,\n R.byteOffset,\n wasmContext.refs.gZ.byteOffset\n );\n return R;\n}\n\n// Generator for data-independent J1, J2. Each `next()` invocation returns a new pair of values.\nfunction* makePRNG(wasmContext, pass, lane, slice, m_, totalPasses, segmentLength, segmentOffset) {\n // For each segment, we do the following. First, we compute the value Z as:\n // Z= ( LE64(r) || LE64(l) || LE64(sl) || LE64(m') || LE64(t) || LE64(y) )\n wasmContext.refs.prngTmp.fill(0);\n const Z = wasmContext.refs.prngTmp.subarray(0, 6 * 8);\n LE64(Z, pass, 0);\n LE64(Z, lane, 8);\n LE64(Z, slice, 16);\n LE64(Z, m_, 24);\n LE64(Z, totalPasses, 32);\n LE64(Z, TYPE, 40);\n\n // Then we compute q/(128*SL) 1024-byte values\n // G( ZERO(1024),\n // G( ZERO(1024), Z || LE64(1) || ZERO(968) ) ),\n // ...,\n // G( ZERO(1024),\n // G( ZERO(1024), Z || LE64(q/(128*SL)) || ZERO(968) )),\n for(let i = 1; i <= segmentLength; i++) {\n // tmp.set(Z); // no need to re-copy\n LE64(wasmContext.refs.prngTmp, i, Z.length); // tmp.set(ZER0968) not necessary, memory already zeroed\n const g2 = G2(wasmContext, wasmContext.refs.ZERO1024, wasmContext.refs.prngTmp, wasmContext.refs.prngR );\n\n // each invocation of G^2 outputs 1024 bytes that are to be partitioned into 8-bytes values, take as X1 || X2\n // NB: the first generated pair must be used for the first block of the segment, and so on.\n // Hence, if some blocks are skipped (e.g. during the first pass), the corresponding J1J2 are discarded based on the given segmentOffset.\n for(let k = i === 1 ? segmentOffset*8 : 0; k < g2.length; k += 8) {\n yield g2.subarray(k, k+8);\n }\n }\n return [];\n}\n\nfunction validateParams({ type, version, tagLength, password, salt, ad, secret, parallelism, memorySize, passes }) {\n const assertLength = (name, value, min, max) => {\n if (value < min || value > max) { throw new Error(`${name} size should be between ${min} and ${max} bytes`); }\n }\n\n if (type !== TYPE || version !== VERSION) throw new Error('Unsupported type or version');\n assertLength('password', password, passwordBYTES_MIN, passwordBYTES_MAX);\n assertLength('salt', salt, SALTBYTES_MIN, SALTBYTES_MAX);\n assertLength('tag', tagLength, TAGBYTES_MIN, TAGBYTES_MAX);\n assertLength('memory', memorySize, 8*parallelism, MEMBYTES_MAX);\n // optional fields\n ad && assertLength('associated data', ad, 0, ADBYTES_MAX);\n secret && assertLength('secret', secret, 0, SECRETBYTES_MAX);\n\n return { type, version, tagLength, password, salt, ad, secret, lanes: parallelism, memorySize, passes };\n}\n\nconst KB = 1024;\nconst WASM_PAGE_SIZE = 64 * KB;\n\nexport default function argon2id(params, { memory, instance: wasmInstance }) {\n if (!isLittleEndian) throw new Error('BigEndian system not supported'); // optmisations assume LE system\n\n const ctx = validateParams({ type: TYPE, version: VERSION, ...params });\n\n const { G:wasmG, G2:wasmG2, xor:wasmXOR, getLZ:wasmLZ } = wasmInstance.exports;\n const wasmRefs = {};\n const wasmFn = {};\n wasmFn.G = wasmG;\n wasmFn.G2 = wasmG2;\n wasmFn.XOR = wasmXOR;\n\n // The actual number of blocks is m', which is m rounded down to the nearest multiple of 4*p.\n const m_ = 4 * ctx.lanes * Math.floor(ctx.memorySize / (4 * ctx.lanes));\n const requiredMemory = m_ * ARGON2_BLOCK_SIZE + 10 * KB; // Additional KBs for utility references\n if (memory.buffer.byteLength < requiredMemory) {\n const missing = Math.ceil((requiredMemory - memory.buffer.byteLength) / WASM_PAGE_SIZE)\n // If enough memory is available, the `memory.buffer` is internally detached and the reference updated.\n // Otherwise, the operation fails, and the original memory can still be used.\n memory.grow(missing)\n }\n\n let offset = 0;\n // Init wasm memory needed in other functions\n wasmRefs.gZ = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+= wasmRefs.gZ.length;\n wasmRefs.prngR = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=wasmRefs.prngR.length;\n wasmRefs.prngTmp = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=wasmRefs.prngTmp.length;\n wasmRefs.ZERO1024 = new Uint8Array(memory.buffer, offset, 1024); offset+=wasmRefs.ZERO1024.length;\n // Init wasm memory needed locally\n const lz = new Uint32Array(memory.buffer, offset, 2); offset+=lz.length * Uint32Array.BYTES_PER_ELEMENT;\n const wasmContext = { fn: wasmFn, refs: wasmRefs };\n const newBlock = new Uint8Array(memory.buffer, offset, ARGON2_BLOCK_SIZE); offset+=newBlock.length;\n const blockMemory = new Uint8Array(memory.buffer, offset, ctx.memorySize * ARGON2_BLOCK_SIZE);\n const allocatedMemory = new Uint8Array(memory.buffer, 0, offset);\n\n // 1. Establish H_0\n const H0 = getH0(ctx);\n\n // 2. Allocate the memory as m' 1024-byte blocks\n // For p lanes, the memory is organized in a matrix B[i][j] of blocks with p rows (lanes) and q = m' / p columns.\n const q = m_ / ctx.lanes;\n const B = new Array(ctx.lanes).fill(null).map(() => new Array(q));\n const initBlock = (i, j) => {\n B[i][j] = blockMemory.subarray(i*q*1024 + j*1024, (i*q*1024 + j*1024) + ARGON2_BLOCK_SIZE);\n return B[i][j];\n }\n\n for (let i = 0; i < ctx.lanes; i++) {\n // const LEi = LE0; // since p = 1 for us\n const tmp = new Uint8Array(H0.length + 8);\n // 3. Compute B[i][0] for all i ranging from (and including) 0 to (not including) p\n // B[i][0] = H'^(1024)(H_0 || LE32(0) || LE32(i))\n tmp.set(H0); LE32(tmp, 0, H0.length); LE32(tmp, i, H0.length + 4);\n H_(ARGON2_BLOCK_SIZE, tmp, initBlock(i, 0));\n // 4. Compute B[i][1] for all i ranging from (and including) 0 to (not including) p\n // B[i][1] = H'^(1024)(H_0 || LE32(1) || LE32(i))\n LE32(tmp, 1, H0.length);\n H_(ARGON2_BLOCK_SIZE, tmp, initBlock(i, 1));\n }\n\n // 5. Compute B[i][j] for all i ranging from (and including) 0 to (not including) p and for all j ranging from (and including) 2\n // to (not including) q. The computation MUST proceed slicewise (Section 3.4) : first, blocks from slice 0 are computed for all lanes\n // (in an arbitrary order of lanes), then blocks from slice 1 are computed, etc.\n const SL = 4; // vertical slices\n const segmentLength = q / SL;\n for (let pass = 0; pass < ctx.passes; pass++) {\n // The intersection of a slice and a lane is called a segment, which has a length of q/SL. Segments of the same slice can be computed in parallel\n for (let sl = 0; sl < SL; sl++) {\n const isDataIndependent = pass === 0 && sl <= 1;\n for (let i = 0; i < ctx.lanes; i++) { // lane\n // On the first slice of the first pass, blocks 0 and 1 are already filled\n let segmentOffset = sl === 0 && pass === 0 ? 2 : 0;\n // no need to generate all J1J2s, use iterator/generator that creates the value on the fly (to save memory)\n const PRNG = isDataIndependent ? makePRNG(wasmContext, pass, i, sl, m_, ctx.passes, segmentLength, segmentOffset) : null;\n for (segmentOffset; segmentOffset < segmentLength; segmentOffset++) {\n const j = sl * segmentLength + segmentOffset;\n const prevBlock = j > 0 ? B[i][j-1] : B[i][q-1]; // B[i][(j-1) mod q]\n\n // we can assume the PRNG is never done\n const J1J2 = isDataIndependent ? PRNG.next().value : prevBlock; // .subarray(0, 8) not required since we only pass the byteOffset to wasm\n // The block indices l and z are determined for each i, j differently for Argon2d, Argon2i, and Argon2id.\n wasmLZ(lz.byteOffset, J1J2.byteOffset, i, ctx.lanes, pass, sl, segmentOffset, SL, segmentLength)\n const l = lz[0]; const z = lz[1];\n // for (let i = 0; i < p; i++ )\n // B[i][j] = G(B[i][j-1], B[l][z])\n // The block indices l and z are determined for each i, j differently for Argon2d, Argon2i, and Argon2id.\n if (pass === 0) initBlock(i, j);\n G(wasmContext, prevBlock, B[l][z], pass > 0 ? newBlock : B[i][j]);\n\n // 6. If the number of passes t is larger than 1, we repeat step 5. However, blocks are computed differently as the old value is XORed with the new one\n if (pass > 0) XOR(wasmContext, B[i][j], newBlock, B[i][j])\n }\n }\n }\n }\n\n // 7. After t steps have been iterated, the final block C is computed as the XOR of the last column:\n // C = B[0][q-1] XOR B[1][q-1] XOR ... XOR B[p-1][q-1]\n const C = B[0][q-1];\n for(let i = 1; i < ctx.lanes; i++) {\n XOR(wasmContext, C, C, B[i][q-1])\n }\n\n const tag = H_(ctx.tagLength, C, new Uint8Array(ctx.tagLength));\n // clear memory since the module might be cached\n allocatedMemory.fill(0) // clear sensitive contents\n memory.grow(0) // allow deallocation\n // 8. The output tag is computed as H'^T(C).\n return tag;\n\n}\n\nfunction getH0(ctx) {\n const H = blake2b(ARGON2_PREHASH_DIGEST_LENGTH);\n const ZERO32 = new Uint8Array(4);\n const params = new Uint8Array(24);\n LE32(params, ctx.lanes, 0);\n LE32(params, ctx.tagLength, 4);\n LE32(params, ctx.memorySize, 8);\n LE32(params, ctx.passes, 12);\n LE32(params, ctx.version, 16);\n LE32(params, ctx.type, 20);\n\n const toHash = [params];\n if (ctx.password) {\n toHash.push(LE32(new Uint8Array(4), ctx.password.length, 0))\n toHash.push(ctx.password)\n } else {\n toHash.push(ZERO32) // context.password.length\n }\n\n if (ctx.salt) {\n toHash.push(LE32(new Uint8Array(4), ctx.salt.length, 0))\n toHash.push(ctx.salt)\n } else {\n toHash.push(ZERO32) // context.salt.length\n }\n\n if (ctx.secret) {\n toHash.push(LE32(new Uint8Array(4), ctx.secret.length, 0))\n toHash.push(ctx.secret)\n // todo clear secret?\n } else {\n toHash.push(ZERO32) // context.secret.length\n }\n\n if (ctx.ad) {\n toHash.push(LE32(new Uint8Array(4), ctx.ad.length, 0))\n toHash.push(ctx.ad)\n } else {\n toHash.push(ZERO32) // context.ad.length\n }\n H.update(concatArrays(toHash))\n\n const outputBuffer = H.digest();\n return new Uint8Array(outputBuffer);\n}\n\nfunction concatArrays(arrays) {\n if (arrays.length === 1) return arrays[0];\n\n let totalLength = 0;\n for (let i = 0; i < arrays.length; i++) {\n if (!(arrays[i] instanceof Uint8Array)) {\n throw new Error('concatArrays: Data must be in the form of a Uint8Array');\n }\n\n totalLength += arrays[i].length;\n }\n\n const result = new Uint8Array(totalLength);\n let pos = 0;\n arrays.forEach((element) => {\n result.set(element, pos);\n pos += element.length;\n });\n\n return result;\n}\n","import argon2id from \"./argon2id.js\";\n\nlet isSIMDSupported;\nasync function wasmLoader(memory, getSIMD, getNonSIMD) {\n const importObject = { env: { memory } };\n if (isSIMDSupported === undefined) {\n try {\n const loaded = await getSIMD(importObject);\n isSIMDSupported = true;\n return loaded;\n } catch(e) {\n isSIMDSupported = false;\n }\n }\n\n const loader = isSIMDSupported ? getSIMD : getNonSIMD;\n return loader(importObject);\n}\n\nexport default async function setupWasm(getSIMD, getNonSIMD) {\n const memory = new WebAssembly.Memory({\n // in pages of 64KiB each\n // these values need to be compatible with those declared when building in `build-wasm`\n initial: 1040, // 65MB\n maximum: 65536, // 4GB\n });\n const wasmModule = await wasmLoader(memory, getSIMD, getNonSIMD);\n\n /**\n * Argon2id hash function\n * @callback computeHash\n * @param {Object} params\n * @param {Uint8Array} params.password - password\n * @param {Uint8Array} params.salt - salt\n * @param {Integer} params.parallelism\n * @param {Integer} params.passes\n * @param {Integer} params.memorySize - in kibibytes\n * @param {Integer} params.tagLength - output tag length\n * @param {Uint8Array} [params.ad] - associated data (optional)\n * @param {Uint8Array} [params.secret] - secret data (optional)\n * @return {Uint8Array} argon2id hash\n */\n const computeHash = (params) => argon2id(params, { instance: wasmModule.instance, memory });\n\n return computeHash;\n}\n","import setupWasm from './lib/setup.js';\nimport wasmSIMD from './dist/simd.wasm';\nimport wasmNonSIMD from './dist/no-simd.wasm';\n\nconst loadWasm = async () => setupWasm(\n (instanceObject) => wasmSIMD(instanceObject),\n (instanceObject) => wasmNonSIMD(instanceObject),\n);\n\nexport default loadWasm;\n"],"names":["ADD64","a","i","b","j","INC64","c","G","v","m","d","ix","iy","xor0","xor1","BLAKE2B_IV32","Uint32Array","SIGMA","Uint8Array","map","x","compress","S","last","buffer","byteOffset","h","t0","f0","i16","Blake2b","constructor","outlen","key","salt","personal","params","this","BLOCKBYTES","OUTBYTES_MAX","length","set","params32","BYTES_PER_ELEMENT","block","update","input","Error","left","subarray","fill","Math","min","digest","prealloc","out","createHash","TYPE","VERSION","TAGBYTES_MAX","TAGBYTES_MIN","SALTBYTES_MAX","SALTBYTES_MIN","passwordBYTES_MAX","passwordBYTES_MIN","MEMBYTES_MAX","ADBYTES_MAX","SECRETBYTES_MAX","ARGON2_BLOCK_SIZE","ARGON2_PREHASH_DIGEST_LENGTH","isLittleEndian","Uint16Array","LE32","buf","n","LE64","Number","MAX_SAFE_INTEGER","remainder","offset","H_","X","res","V","V1_in","blake2b","r","ceil","V_r1","XOR","wasmContext","xs","ys","fn","Y","R","refs","gZ","G2","makePRNG","pass","lane","slice","m_","totalPasses","segmentLength","segmentOffset","prngTmp","Z","g2","ZERO1024","prngR","k","KB","WASM_PAGE_SIZE","argon2id","memory","instance","wasmInstance","ctx","type","version","tagLength","password","ad","secret","parallelism","memorySize","passes","assertLength","name","value","max","lanes","validateParams","wasmG","wasmG2","xor","wasmXOR","getLZ","wasmLZ","exports","wasmRefs","wasmFn","floor","requiredMemory","byteLength","missing","grow","lz","newBlock","blockMemory","allocatedMemory","H0","H","ZERO32","toHash","push","arrays","totalLength","result","pos","forEach","element","concatArrays","outputBuffer","getH0","q","B","Array","initBlock","tmp","sl","isDataIndependent","PRNG","prevBlock","J1J2","next","l","z","C","tag","isSIMDSupported","async","setupWasm","getSIMD","getNonSIMD","WebAssembly","Memory","initial","maximum","wasmModule","importObject","env","undefined","loaded","e","wasmLoader","loadWasm","instanceObject"],"mappings":";6GAUA,SAASA,EAAOC,EAAGC,EAAGC,EAAGC,GACvBH,EAAEC,IAAMC,EAAEC,GACVH,EAAEC,EAAE,IAAMC,EAAEC,EAAE,IAAMH,EAAEC,GAAKC,EAAEC,GAC/B,CAIA,SAASC,EAAOJ,EAAGK,GACjBL,EAAE,IAAMK,EACRL,EAAE,IAAOA,EAAE,GA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,EAAgBtG,KAAK,GACrBkE,EAAOgC,KAAK,GAELiC,CAET,CC3RA,IAAIC,EAiBWC,eAAeC,EAAUC,EAASC,GAC/C,MAAMtE,EAAS,IAAIuE,YAAYC,OAAO,CAGpCC,QAAS,KACTC,QAAS,QAELC,QAvBRR,eAA0BnE,EAAQqE,EAASC,GACzC,MAAMM,EAAe,CAAEC,IAAK,CAAE7E,WAC9B,QAAwB8E,IAApBZ,EACF,IACE,MAAMa,QAAeV,EAAQO,GAE7B,OADAV,GAAkB,EACXa,CACR,CAAC,MAAMC,GACNd,GAAkB,CACxB,CAIE,OADeA,EAAkBG,EAAUC,GAC7BM,EAChB,CAS2BK,CAAWjF,EAAQqE,EAASC,GAkBrD,OAFqBtJ,GAAW+E,EAAS/E,EAAQ,CAAEiF,SAAU0E,EAAW1E,SAAUD,UAGpF,yOCzCK,MAACkF,EAAWf,SAAYC,GAC1Be,4wLAA4BA,KAC5BA,wyJAA+BA","x_google_ignoreList":[0,1,2,3]}
@@ -1,4 +1,4 @@
1
- /*! OpenPGP.js v6.0.0-beta.3.patch.1 - 2024-09-11 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
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
  // Adapted from the reference implementation in RFC7693
@@ -1,3 +1,3 @@
1
- /*! OpenPGP.js v6.0.0-beta.3.patch.1 - 2024-09-11 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
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{enums as t}from"./openpgp.min.mjs";function i(t,i,e,n,s,o){const r=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],h=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],c=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],a=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],f=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],u=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],y=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];let p,k,g,m,S,b,z,d,w,A,B=0,N=i.length;const _=32===t.length?3:9;d=3===_?e?[0,32,2]:[30,-2,-2]:e?[0,32,2,62,30,-2,64,96,2]:[94,62,-2,32,64,2,30,-2,-2],e&&(i=function(t){const i=8-t.length%8;let e;if(!(i<8)){if(8===i)return t;throw Error("des: invalid padding")}e=0;const n=new Uint8Array(t.length+i);for(let i=0;i<t.length;i++)n[i]=t[i];for(let s=0;s<i;s++)n[t.length+s]=e;return n}(i),N=i.length);let x=new Uint8Array(N),E=0;for(;B<N;){for(b=i[B++]<<24|i[B++]<<16|i[B++]<<8|i[B++],z=i[B++]<<24|i[B++]<<16|i[B++]<<8|i[B++],g=252645135&(b>>>4^z),z^=g,b^=g<<4,g=65535&(b>>>16^z),z^=g,b^=g<<16,g=858993459&(z>>>2^b),b^=g,z^=g<<2,g=16711935&(z>>>8^b),b^=g,z^=g<<8,g=1431655765&(b>>>1^z),z^=g,b^=g<<1,b=b<<1|b>>>31,z=z<<1|z>>>31,k=0;k<_;k+=3){for(w=d[k+1],A=d[k+2],p=d[k];p!==w;p+=A)m=z^t[p],S=(z>>>4|z<<28)^t[p+1],g=b,b=z,z=g^(h[m>>>24&63]|a[m>>>16&63]|l[m>>>8&63]|y[63&m]|r[S>>>24&63]|c[S>>>16&63]|f[S>>>8&63]|u[63&S]);g=b,b=z,z=g}b=b>>>1|b<<31,z=z>>>1|z<<31,g=1431655765&(b>>>1^z),z^=g,b^=g<<1,g=16711935&(z>>>8^b),b^=g,z^=g<<8,g=858993459&(z>>>2^b),b^=g,z^=g<<2,g=65535&(b>>>16^z),z^=g,b^=g<<16,g=252645135&(b>>>4^z),z^=g,b^=g<<4,x[E++]=b>>>24,x[E++]=b>>>16&255,x[E++]=b>>>8&255,x[E++]=255&b,x[E++]=z>>>24,x[E++]=z>>>16&255,x[E++]=z>>>8&255,x[E++]=255&z}return e||(x=function(t){let i,e=null;if(i=0,!e){for(e=1;t[t.length-e]===i;)e++;e--}return t.subarray(0,t.length-e)}(x)),x}function e(t){const i=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],e=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],n=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],s=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],o=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],r=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],h=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],a=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],l=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],u=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],y=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],p=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],k=t.length>8?3:1,g=Array(32*k),m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0];let S,b,z,d=0,w=0;for(let A=0;A<k;A++){let k=t[d++]<<24|t[d++]<<16|t[d++]<<8|t[d++],A=t[d++]<<24|t[d++]<<16|t[d++]<<8|t[d++];z=252645135&(k>>>4^A),A^=z,k^=z<<4,z=65535&(A>>>-16^k),k^=z,A^=z<<-16,z=858993459&(k>>>2^A),A^=z,k^=z<<2,z=65535&(A>>>-16^k),k^=z,A^=z<<-16,z=1431655765&(k>>>1^A),A^=z,k^=z<<1,z=16711935&(A>>>8^k),k^=z,A^=z<<8,z=1431655765&(k>>>1^A),A^=z,k^=z<<1,z=k<<8|A>>>20&240,k=A<<24|A<<8&16711680|A>>>8&65280|A>>>24&240,A=z;for(let t=0;t<16;t++)m[t]?(k=k<<2|k>>>26,A=A<<2|A>>>26):(k=k<<1|k>>>27,A=A<<1|A>>>27),k&=-15,A&=-15,S=i[k>>>28]|e[k>>>24&15]|n[k>>>20&15]|s[k>>>16&15]|o[k>>>12&15]|r[k>>>8&15]|h[k>>>4&15],b=c[A>>>28]|a[A>>>24&15]|f[A>>>20&15]|l[A>>>16&15]|u[A>>>12&15]|y[A>>>8&15]|p[A>>>4&15],z=65535&(b>>>16^S),g[w++]=S^z,g[w++]=b^z<<16}return g}function n(t){this.key=[];for(let i=0;i<3;i++)this.key.push(new Uint8Array(t.subarray(8*i,8*i+8)));this.encrypt=function(t){return i(e(this.key[2]),i(e(this.key[1]),i(e(this.key[0]),t,!0),!1),!0)}}function s(){this.BlockSize=8,this.KeySize=16,this.setKey=function(t){if(this.masking=Array(16),this.rotate=Array(16),this.reset(),t.length!==this.KeySize)throw Error("CAST-128: keys must be 16 bytes");return this.keySchedule(t),!0},this.reset=function(){for(let t=0;t<16;t++)this.masking[t]=0,this.rotate[t]=0},this.getBlockSize=function(){return this.BlockSize},this.encrypt=function(t){const i=Array(t.length);for(let o=0;o<t.length;o+=8){let r,h=t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3],c=t[o+4]<<24|t[o+5]<<16|t[o+6]<<8|t[o+7];r=c,c=h^e(c,this.masking[0],this.rotate[0]),h=r,r=c,c=h^n(c,this.masking[1],this.rotate[1]),h=r,r=c,c=h^s(c,this.masking[2],this.rotate[2]),h=r,r=c,c=h^e(c,this.masking[3],this.rotate[3]),h=r,r=c,c=h^n(c,this.masking[4],this.rotate[4]),h=r,r=c,c=h^s(c,this.masking[5],this.rotate[5]),h=r,r=c,c=h^e(c,this.masking[6],this.rotate[6]),h=r,r=c,c=h^n(c,this.masking[7],this.rotate[7]),h=r,r=c,c=h^s(c,this.masking[8],this.rotate[8]),h=r,r=c,c=h^e(c,this.masking[9],this.rotate[9]),h=r,r=c,c=h^n(c,this.masking[10],this.rotate[10]),h=r,r=c,c=h^s(c,this.masking[11],this.rotate[11]),h=r,r=c,c=h^e(c,this.masking[12],this.rotate[12]),h=r,r=c,c=h^n(c,this.masking[13],this.rotate[13]),h=r,r=c,c=h^s(c,this.masking[14],this.rotate[14]),h=r,r=c,c=h^e(c,this.masking[15],this.rotate[15]),h=r,i[o]=c>>>24&255,i[o+1]=c>>>16&255,i[o+2]=c>>>8&255,i[o+3]=255&c,i[o+4]=h>>>24&255,i[o+5]=h>>>16&255,i[o+6]=h>>>8&255,i[o+7]=255&h}return i},this.decrypt=function(t){const i=Array(t.length);for(let o=0;o<t.length;o+=8){let r,h=t[o]<<24|t[o+1]<<16|t[o+2]<<8|t[o+3],c=t[o+4]<<24|t[o+5]<<16|t[o+6]<<8|t[o+7];r=c,c=h^e(c,this.masking[15],this.rotate[15]),h=r,r=c,c=h^s(c,this.masking[14],this.rotate[14]),h=r,r=c,c=h^n(c,this.masking[13],this.rotate[13]),h=r,r=c,c=h^e(c,this.masking[12],this.rotate[12]),h=r,r=c,c=h^s(c,this.masking[11],this.rotate[11]),h=r,r=c,c=h^n(c,this.masking[10],this.rotate[10]),h=r,r=c,c=h^e(c,this.masking[9],this.rotate[9]),h=r,r=c,c=h^s(c,this.masking[8],this.rotate[8]),h=r,r=c,c=h^n(c,this.masking[7],this.rotate[7]),h=r,r=c,c=h^e(c,this.masking[6],this.rotate[6]),h=r,r=c,c=h^s(c,this.masking[5],this.rotate[5]),h=r,r=c,c=h^n(c,this.masking[4],this.rotate[4]),h=r,r=c,c=h^e(c,this.masking[3],this.rotate[3]),h=r,r=c,c=h^s(c,this.masking[2],this.rotate[2]),h=r,r=c,c=h^n(c,this.masking[1],this.rotate[1]),h=r,r=c,c=h^e(c,this.masking[0],this.rotate[0]),h=r,i[o]=c>>>24&255,i[o+1]=c>>>16&255,i[o+2]=c>>>8&255,i[o+3]=255&c,i[o+4]=h>>>24&255,i[o+5]=h>>16&255,i[o+6]=h>>8&255,i[o+7]=255&h}return i};const t=[,,,,];t[0]=[,,,,],t[0][0]=[4,0,13,15,12,14,8],t[0][1]=[5,2,16,18,17,19,10],t[0][2]=[6,3,23,22,21,20,9],t[0][3]=[7,1,26,25,27,24,11],t[1]=[,,,,],t[1][0]=[0,6,21,23,20,22,16],t[1][1]=[1,4,0,2,1,3,18],t[1][2]=[2,5,7,6,5,4,17],t[1][3]=[3,7,10,9,11,8,19],t[2]=[,,,,],t[2][0]=[4,0,13,15,12,14,8],t[2][1]=[5,2,16,18,17,19,10],t[2][2]=[6,3,23,22,21,20,9],t[2][3]=[7,1,26,25,27,24,11],t[3]=[,,,,],t[3][0]=[0,6,21,23,20,22,16],t[3][1]=[1,4,0,2,1,3,18],t[3][2]=[2,5,7,6,5,4,17],t[3][3]=[3,7,10,9,11,8,19];const i=[,,,,];function e(t,i,e){const n=i+t,s=n<<e|n>>>32-e;return(o[0][s>>>24]^o[1][s>>>16&255])-o[2][s>>>8&255]+o[3][255&s]}function n(t,i,e){const n=i^t,s=n<<e|n>>>32-e;return o[0][s>>>24]-o[1][s>>>16&255]+o[2][s>>>8&255]^o[3][255&s]}function s(t,i,e){const n=i-t,s=n<<e|n>>>32-e;return(o[0][s>>>24]+o[1][s>>>16&255]^o[2][s>>>8&255])-o[3][255&s]}i[0]=[,,,,],i[0][0]=[24,25,23,22,18],i[0][1]=[26,27,21,20,22],i[0][2]=[28,29,19,18,25],i[0][3]=[30,31,17,16,28],i[1]=[,,,,],i[1][0]=[3,2,12,13,8],i[1][1]=[1,0,14,15,13],i[1][2]=[7,6,8,9,3],i[1][3]=[5,4,10,11,7],i[2]=[,,,,],i[2][0]=[19,18,28,29,25],i[2][1]=[17,16,30,31,28],i[2][2]=[23,22,24,25,18],i[2][3]=[21,20,26,27,22],i[3]=[,,,,],i[3][0]=[8,9,7,6,3],i[3][1]=[10,11,5,4,7],i[3][2]=[12,13,3,2,8],i[3][3]=[14,15,1,0,13],this.keySchedule=function(e){const n=[,,,,,,,,],s=Array(32);let r;for(let t=0;t<4;t++)r=4*t,n[t]=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3];const h=[6,7,4,5];let c,a=0;for(let e=0;e<2;e++)for(let e=0;e<4;e++){for(r=0;r<4;r++){const i=t[e][r];c=n[i[1]],c^=o[4][n[i[2]>>>2]>>>24-8*(3&i[2])&255],c^=o[5][n[i[3]>>>2]>>>24-8*(3&i[3])&255],c^=o[6][n[i[4]>>>2]>>>24-8*(3&i[4])&255],c^=o[7][n[i[5]>>>2]>>>24-8*(3&i[5])&255],c^=o[h[r]][n[i[6]>>>2]>>>24-8*(3&i[6])&255],n[i[0]]=c}for(r=0;r<4;r++){const t=i[e][r];c=o[4][n[t[0]>>>2]>>>24-8*(3&t[0])&255],c^=o[5][n[t[1]>>>2]>>>24-8*(3&t[1])&255],c^=o[6][n[t[2]>>>2]>>>24-8*(3&t[2])&255],c^=o[7][n[t[3]>>>2]>>>24-8*(3&t[3])&255],c^=o[4+r][n[t[4]>>>2]>>>24-8*(3&t[4])&255],s[a]=c,a++}}for(let t=0;t<16;t++)this.masking[t]=s[t],this.rotate[t]=31&s[16+t]};const o=[,,,,,,,,];o[0]=[821772500,2678128395,1810681135,1059425402,505495343,2617265619,1610868032,3483355465,3218386727,2294005173,3791863952,2563806837,1852023008,365126098,3269944861,584384398,677919599,3229601881,4280515016,2002735330,1136869587,3744433750,2289869850,2731719981,2714362070,879511577,1639411079,575934255,717107937,2857637483,576097850,2731753936,1725645e3,2810460463,5111599,767152862,2543075244,1251459544,1383482551,3052681127,3089939183,3612463449,1878520045,1510570527,2189125840,2431448366,582008916,3163445557,1265446783,1354458274,3529918736,3202711853,3073581712,3912963487,3029263377,1275016285,4249207360,2905708351,3304509486,1442611557,3585198765,2712415662,2731849581,3248163920,2283946226,208555832,2766454743,1331405426,1447828783,3315356441,3108627284,2957404670,2981538698,3339933917,1669711173,286233437,1465092821,1782121619,3862771680,710211251,980974943,1651941557,430374111,2051154026,704238805,4128970897,3144820574,2857402727,948965521,3333752299,2227686284,718756367,2269778983,2731643755,718440111,2857816721,3616097120,1113355533,2478022182,410092745,1811985197,1944238868,2696854588,1415722873,1682284203,1060277122,1998114690,1503841958,82706478,2315155686,1068173648,845149890,2167947013,1768146376,1993038550,3566826697,3390574031,940016341,3355073782,2328040721,904371731,1205506512,4094660742,2816623006,825647681,85914773,2857843460,1249926541,1417871568,3287612,3211054559,3126306446,1975924523,1353700161,2814456437,2438597621,1800716203,722146342,2873936343,1151126914,4160483941,2877670899,458611604,2866078500,3483680063,770352098,2652916994,3367839148,3940505011,3585973912,3809620402,718646636,2504206814,2914927912,3631288169,2857486607,2860018678,575749918,2857478043,718488780,2069512688,3548183469,453416197,1106044049,3032691430,52586708,3378514636,3459808877,3211506028,1785789304,218356169,3571399134,3759170522,1194783844,1523787992,3007827094,1975193539,2555452411,1341901877,3045838698,3776907964,3217423946,2802510864,2889438986,1057244207,1636348243,3761863214,1462225785,2632663439,481089165,718503062,24497053,3332243209,3344655856,3655024856,3960371065,1195698900,2971415156,3710176158,2115785917,4027663609,3525578417,2524296189,2745972565,3564906415,1372086093,1452307862,2780501478,1476592880,3389271281,18495466,2378148571,901398090,891748256,3279637769,3157290713,2560960102,1447622437,4284372637,216884176,2086908623,1879786977,3588903153,2242455666,2938092967,3559082096,2810645491,758861177,1121993112,215018983,642190776,4169236812,1196255959,2081185372,3508738393,941322904,4124243163,2877523539,1848581667,2205260958,3180453958,2589345134,3694731276,550028657,2519456284,3789985535,2973870856,2093648313,443148163,46942275,2734146937,1117713533,1115362972,1523183689,3717140224,1551984063],o[1]=[522195092,4010518363,1776537470,960447360,4267822970,4005896314,1435016340,1929119313,2913464185,1310552629,3579470798,3724818106,2579771631,1594623892,417127293,2715217907,2696228731,1508390405,3994398868,3925858569,3695444102,4019471449,3129199795,3770928635,3520741761,990456497,4187484609,2783367035,21106139,3840405339,631373633,3783325702,532942976,396095098,3548038825,4267192484,2564721535,2011709262,2039648873,620404603,3776170075,2898526339,3612357925,4159332703,1645490516,223693667,1567101217,3362177881,1029951347,3470931136,3570957959,1550265121,119497089,972513919,907948164,3840628539,1613718692,3594177948,465323573,2659255085,654439692,2575596212,2699288441,3127702412,277098644,624404830,4100943870,2717858591,546110314,2403699828,3655377447,1321679412,4236791657,1045293279,4010672264,895050893,2319792268,494945126,1914543101,2777056443,3894764339,2219737618,311263384,4275257268,3458730721,669096869,3584475730,3835122877,3319158237,3949359204,2005142349,2713102337,2228954793,3769984788,569394103,3855636576,1425027204,108000370,2736431443,3671869269,3043122623,1750473702,2211081108,762237499,3972989403,2798899386,3061857628,2943854345,867476300,964413654,1591880597,1594774276,2179821409,552026980,3026064248,3726140315,2283577634,3110545105,2152310760,582474363,1582640421,1383256631,2043843868,3322775884,1217180674,463797851,2763038571,480777679,2718707717,2289164131,3118346187,214354409,200212307,3810608407,3025414197,2674075964,3997296425,1847405948,1342460550,510035443,4080271814,815934613,833030224,1620250387,1945732119,2703661145,3966000196,1388869545,3456054182,2687178561,2092620194,562037615,1356438536,3409922145,3261847397,1688467115,2150901366,631725691,3840332284,549916902,3455104640,394546491,837744717,2114462948,751520235,2221554606,2415360136,3999097078,2063029875,803036379,2702586305,821456707,3019566164,360699898,4018502092,3511869016,3677355358,2402471449,812317050,49299192,2570164949,3259169295,2816732080,3331213574,3101303564,2156015656,3705598920,3546263921,143268808,3200304480,1638124008,3165189453,3341807610,578956953,2193977524,3638120073,2333881532,807278310,658237817,2969561766,1641658566,11683945,3086995007,148645947,1138423386,4158756760,1981396783,2401016740,3699783584,380097457,2680394679,2803068651,3334260286,441530178,4016580796,1375954390,761952171,891809099,2183123478,157052462,3683840763,1592404427,341349109,2438483839,1417898363,644327628,2233032776,2353769706,2201510100,220455161,1815641738,182899273,2995019788,3627381533,3702638151,2890684138,1052606899,588164016,1681439879,4038439418,2405343923,4229449282,167996282,1336969661,1688053129,2739224926,1543734051,1046297529,1138201970,2121126012,115334942,1819067631,1902159161,1941945968,2206692869,1159982321],o[2]=[2381300288,637164959,3952098751,3893414151,1197506559,916448331,2350892612,2932787856,3199334847,4009478890,3905886544,1373570990,2450425862,4037870920,3778841987,2456817877,286293407,124026297,3001279700,1028597854,3115296800,4208886496,2691114635,2188540206,1430237888,1218109995,3572471700,308166588,570424558,2187009021,2455094765,307733056,1310360322,3135275007,1384269543,2388071438,863238079,2359263624,2801553128,3380786597,2831162807,1470087780,1728663345,4072488799,1090516929,532123132,2389430977,1132193179,2578464191,3051079243,1670234342,1434557849,2711078940,1241591150,3314043432,3435360113,3091448339,1812415473,2198440252,267246943,796911696,3619716990,38830015,1526438404,2806502096,374413614,2943401790,1489179520,1603809326,1920779204,168801282,260042626,2358705581,1563175598,2397674057,1356499128,2217211040,514611088,2037363785,2186468373,4022173083,2792511869,2913485016,1173701892,4200428547,3896427269,1334932762,2455136706,602925377,2835607854,1613172210,41346230,2499634548,2457437618,2188827595,41386358,4172255629,1313404830,2405527007,3801973774,2217704835,873260488,2528884354,2478092616,4012915883,2555359016,2006953883,2463913485,575479328,2218240648,2099895446,660001756,2341502190,3038761536,3888151779,3848713377,3286851934,1022894237,1620365795,3449594689,1551255054,15374395,3570825345,4249311020,4151111129,3181912732,310226346,1133119310,530038928,136043402,2476768958,3107506709,2544909567,1036173560,2367337196,1681395281,1758231547,3641649032,306774401,1575354324,3716085866,1990386196,3114533736,2455606671,1262092282,3124342505,2768229131,4210529083,1833535011,423410938,660763973,2187129978,1639812e3,3508421329,3467445492,310289298,272797111,2188552562,2456863912,310240523,677093832,1013118031,901835429,3892695601,1116285435,3036471170,1337354835,243122523,520626091,277223598,4244441197,4194248841,1766575121,594173102,316590669,742362309,3536858622,4176435350,3838792410,2501204839,1229605004,3115755532,1552908988,2312334149,979407927,3959474601,1148277331,176638793,3614686272,2083809052,40992502,1340822838,2731552767,3535757508,3560899520,1354035053,122129617,7215240,2732932949,3118912700,2718203926,2539075635,3609230695,3725561661,1928887091,2882293555,1988674909,2063640240,2491088897,1459647954,4189817080,2302804382,1113892351,2237858528,1927010603,4002880361,1856122846,1594404395,2944033133,3855189863,3474975698,1643104450,4054590833,3431086530,1730235576,2984608721,3084664418,2131803598,4178205752,267404349,1617849798,1616132681,1462223176,736725533,2327058232,551665188,2945899023,1749386277,2575514597,1611482493,674206544,2201269090,3642560800,728599968,1680547377,2620414464,1388111496,453204106,4156223445,1094905244,2754698257,2201108165,3757000246,2704524545,3922940700,3996465027],o[3]=[2645754912,532081118,2814278639,3530793624,1246723035,1689095255,2236679235,4194438865,2116582143,3859789411,157234593,2045505824,4245003587,1687664561,4083425123,605965023,672431967,1336064205,3376611392,214114848,4258466608,3232053071,489488601,605322005,3998028058,264917351,1912574028,756637694,436560991,202637054,135989450,85393697,2152923392,3896401662,2895836408,2145855233,3535335007,115294817,3147733898,1922296357,3464822751,4117858305,1037454084,2725193275,2127856640,1417604070,1148013728,1827919605,642362335,2929772533,909348033,1346338451,3547799649,297154785,1917849091,4161712827,2883604526,3968694238,1469521537,3780077382,3375584256,1763717519,136166297,4290970789,1295325189,2134727907,2798151366,1566297257,3672928234,2677174161,2672173615,965822077,2780786062,289653839,1133871874,3491843819,35685304,1068898316,418943774,672553190,642281022,2346158704,1954014401,3037126780,4079815205,2030668546,3840588673,672283427,1776201016,359975446,3750173538,555499703,2769985273,1324923,69110472,152125443,3176785106,3822147285,1340634837,798073664,1434183902,15393959,216384236,1303690150,3881221631,3711134124,3960975413,106373927,2578434224,1455997841,1801814300,1578393881,1854262133,3188178946,3258078583,2302670060,1539295533,3505142565,3078625975,2372746020,549938159,3278284284,2620926080,181285381,2865321098,3970029511,68876850,488006234,1728155692,2608167508,836007927,2435231793,919367643,3339422534,3655756360,1457871481,40520939,1380155135,797931188,234455205,2255801827,3990488299,397000196,739833055,3077865373,2871719860,4022553888,772369276,390177364,3853951029,557662966,740064294,1640166671,1699928825,3535942136,622006121,3625353122,68743880,1742502,219489963,1664179233,1577743084,1236991741,410585305,2366487942,823226535,1050371084,3426619607,3586839478,212779912,4147118561,1819446015,1911218849,530248558,3486241071,3252585495,2886188651,3410272728,2342195030,20547779,2982490058,3032363469,3631753222,312714466,1870521650,1493008054,3491686656,615382978,4103671749,2534517445,1932181,2196105170,278426614,6369430,3274544417,2913018367,697336853,2143000447,2946413531,701099306,1558357093,2805003052,3500818408,2321334417,3567135975,216290473,3591032198,23009561,1996984579,3735042806,2024298078,3739440863,569400510,2339758983,3016033873,3097871343,3639523026,3844324983,3256173865,795471839,2951117563,4101031090,4091603803,3603732598,971261452,534414648,428311343,3389027175,2844869880,694888862,1227866773,2456207019,3043454569,2614353370,3749578031,3676663836,459166190,4132644070,1794958188,51825668,2252611902,3084671440,2036672799,3436641603,1099053433,2469121526,3059204941,1323291266,2061838604,1018778475,2233344254,2553501054,334295216,3556750194,1065731521,183467730],o[4]=[2127105028,745436345,2601412319,2788391185,3093987327,500390133,1155374404,389092991,150729210,3891597772,3523549952,1935325696,716645080,946045387,2901812282,1774124410,3869435775,4039581901,3293136918,3438657920,948246080,363898952,3867875531,1286266623,1598556673,68334250,630723836,1104211938,1312863373,613332731,2377784574,1101634306,441780740,3129959883,1917973735,2510624549,3238456535,2544211978,3308894634,1299840618,4076074851,1756332096,3977027158,297047435,3790297736,2265573040,3621810518,1311375015,1667687725,47300608,3299642885,2474112369,201668394,1468347890,576830978,3594690761,3742605952,1958042578,1747032512,3558991340,1408974056,3366841779,682131401,1033214337,1545599232,4265137049,206503691,103024618,2855227313,1337551222,2428998917,2963842932,4015366655,3852247746,2796956967,3865723491,3747938335,247794022,3755824572,702416469,2434691994,397379957,851939612,2314769512,218229120,1380406772,62274761,214451378,3170103466,2276210409,3845813286,28563499,446592073,1693330814,3453727194,29968656,3093872512,220656637,2470637031,77972100,1667708854,1358280214,4064765667,2395616961,325977563,4277240721,4220025399,3605526484,3355147721,811859167,3069544926,3962126810,652502677,3075892249,4132761541,3498924215,1217549313,3250244479,3858715919,3053989961,1538642152,2279026266,2875879137,574252750,3324769229,2651358713,1758150215,141295887,2719868960,3515574750,4093007735,4194485238,1082055363,3417560400,395511885,2966884026,179534037,3646028556,3738688086,1092926436,2496269142,257381841,3772900718,1636087230,1477059743,2499234752,3811018894,2675660129,3285975680,90732309,1684827095,1150307763,1723134115,3237045386,1769919919,1240018934,815675215,750138730,2239792499,1234303040,1995484674,138143821,675421338,1145607174,1936608440,3238603024,2345230278,2105974004,323969391,779555213,3004902369,2861610098,1017501463,2098600890,2628620304,2940611490,2682542546,1171473753,3656571411,3687208071,4091869518,393037935,159126506,1662887367,1147106178,391545844,3452332695,1891500680,3016609650,1851642611,546529401,1167818917,3194020571,2848076033,3953471836,575554290,475796850,4134673196,450035699,2351251534,844027695,1080539133,86184846,1554234488,3692025454,1972511363,2018339607,1491841390,1141460869,1061690759,4244549243,2008416118,2351104703,2868147542,1598468138,722020353,1027143159,212344630,1387219594,1725294528,3745187956,2500153616,458938280,4129215917,1828119673,544571780,3503225445,2297937496,1241802790,267843827,2694610800,1397140384,1558801448,3782667683,1806446719,929573330,2234912681,400817706,616011623,4121520928,3603768725,1761550015,1968522284,4053731006,4192232858,4005120285,872482584,3140537016,3894607381,2287405443,1963876937,3663887957,1584857e3,2975024454,1833426440,4025083860],o[5]=[4143615901,749497569,1285769319,3795025788,2514159847,23610292,3974978748,844452780,3214870880,3751928557,2213566365,1676510905,448177848,3730751033,4086298418,2307502392,871450977,3222878141,4110862042,3831651966,2735270553,1310974780,2043402188,1218528103,2736035353,4274605013,2702448458,3936360550,2693061421,162023535,2827510090,687910808,23484817,3784910947,3371371616,779677500,3503626546,3473927188,4157212626,3500679282,4248902014,2466621104,3899384794,1958663117,925738300,1283408968,3669349440,1840910019,137959847,2679828185,1239142320,1315376211,1547541505,1690155329,739140458,3128809933,3933172616,3876308834,905091803,1548541325,4040461708,3095483362,144808038,451078856,676114313,2861728291,2469707347,993665471,373509091,2599041286,4025009006,4170239449,2149739950,3275793571,3749616649,2794760199,1534877388,572371878,2590613551,1753320020,3467782511,1405125690,4270405205,633333386,3026356924,3475123903,632057672,2846462855,1404951397,3882875879,3915906424,195638627,2385783745,3902872553,1233155085,3355999740,2380578713,2702246304,2144565621,3663341248,3894384975,2502479241,4248018925,3094885567,1594115437,572884632,3385116731,767645374,1331858858,1475698373,3793881790,3532746431,1321687957,619889600,1121017241,3440213920,2070816767,2833025776,1933951238,4095615791,890643334,3874130214,859025556,360630002,925594799,1764062180,3920222280,4078305929,979562269,2810700344,4087740022,1949714515,546639971,1165388173,3069891591,1495988560,922170659,1291546247,2107952832,1813327274,3406010024,3306028637,4241950635,153207855,2313154747,1608695416,1150242611,1967526857,721801357,1220138373,3691287617,3356069787,2112743302,3281662835,1111556101,1778980689,250857638,2298507990,673216130,2846488510,3207751581,3562756981,3008625920,3417367384,2198807050,529510932,3547516680,3426503187,2364944742,102533054,2294910856,1617093527,1204784762,3066581635,1019391227,1069574518,1317995090,1691889997,3661132003,510022745,3238594800,1362108837,1817929911,2184153760,805817662,1953603311,3699844737,120799444,2118332377,207536705,2282301548,4120041617,145305846,2508124933,3086745533,3261524335,1877257368,2977164480,3160454186,2503252186,4221677074,759945014,254147243,2767453419,3801518371,629083197,2471014217,907280572,3900796746,940896768,2751021123,2625262786,3161476951,3661752313,3260732218,1425318020,2977912069,1496677566,3988592072,2140652971,3126511541,3069632175,977771578,1392695845,1698528874,1411812681,1369733098,1343739227,3620887944,1142123638,67414216,3102056737,3088749194,1626167401,2546293654,3941374235,697522451,33404913,143560186,2595682037,994885535,1247667115,3859094837,2699155541,3547024625,4114935275,2968073508,3199963069,2732024527,1237921620,951448369,1898488916,1211705605,2790989240,2233243581,3598044975],o[6]=[2246066201,858518887,1714274303,3485882003,713916271,2879113490,3730835617,539548191,36158695,1298409750,419087104,1358007170,749914897,2989680476,1261868530,2995193822,2690628854,3443622377,3780124940,3796824509,2976433025,4259637129,1551479e3,512490819,1296650241,951993153,2436689437,2460458047,144139966,3136204276,310820559,3068840729,643875328,1969602020,1680088954,2185813161,3283332454,672358534,198762408,896343282,276269502,3014846926,84060815,197145886,376173866,3943890818,3813173521,3545068822,1316698879,1598252827,2633424951,1233235075,859989710,2358460855,3503838400,3409603720,1203513385,1193654839,2792018475,2060853022,207403770,1144516871,3068631394,1121114134,177607304,3785736302,326409831,1929119770,2983279095,4183308101,3474579288,3200513878,3228482096,119610148,1170376745,3378393471,3163473169,951863017,3337026068,3135789130,2907618374,1183797387,2015970143,4045674555,2182986399,2952138740,3928772205,384012900,2454997643,10178499,2879818989,2596892536,111523738,2995089006,451689641,3196290696,235406569,1441906262,3890558523,3013735005,4158569349,1644036924,376726067,1006849064,3664579700,2041234796,1021632941,1374734338,2566452058,371631263,4007144233,490221539,206551450,3140638584,1053219195,1853335209,3412429660,3562156231,735133835,1623211703,3104214392,2738312436,4096837757,3366392578,3110964274,3956598718,3196820781,2038037254,3877786376,2339753847,300912036,3766732888,2372630639,1516443558,4200396704,1574567987,4069441456,4122592016,2699739776,146372218,2748961456,2043888151,35287437,2596680554,655490400,1132482787,110692520,1031794116,2188192751,1324057718,1217253157,919197030,686247489,3261139658,1028237775,3135486431,3059715558,2460921700,986174950,2661811465,4062904701,2752986992,3709736643,367056889,1353824391,731860949,1650113154,1778481506,784341916,357075625,3608602432,1074092588,2480052770,3811426202,92751289,877911070,3600361838,1231880047,480201094,3756190983,3094495953,434011822,87971354,363687820,1717726236,1901380172,3926403882,2481662265,400339184,1490350766,2661455099,1389319756,2558787174,784598401,1983468483,30828846,3550527752,2716276238,3841122214,1765724805,1955612312,1277890269,1333098070,1564029816,2704417615,1026694237,3287671188,1260819201,3349086767,1016692350,1582273796,1073413053,1995943182,694588404,1025494639,3323872702,3551898420,4146854327,453260480,1316140391,1435673405,3038941953,3486689407,1622062951,403978347,817677117,950059133,4246079218,3278066075,1486738320,1417279718,481875527,2549965225,3933690356,760697757,1452955855,3897451437,1177426808,1702951038,4085348628,2447005172,1084371187,3516436277,3068336338,1073369276,1027665953,3284188590,1230553676,1368340146,2226246512,267243139,2274220762,4070734279,2497715176,2423353163,2504755875],o[7]=[3793104909,3151888380,2817252029,895778965,2005530807,3871412763,237245952,86829237,296341424,3851759377,3974600970,2475086196,709006108,1994621201,2972577594,937287164,3734691505,168608556,3189338153,2225080640,3139713551,3033610191,3025041904,77524477,185966941,1208824168,2344345178,1721625922,3354191921,1066374631,1927223579,1971335949,2483503697,1551748602,2881383779,2856329572,3003241482,48746954,1398218158,2050065058,313056748,4255789917,393167848,1912293076,940740642,3465845460,3091687853,2522601570,2197016661,1727764327,364383054,492521376,1291706479,3264136376,1474851438,1685747964,2575719748,1619776915,1814040067,970743798,1561002147,2925768690,2123093554,1880132620,3151188041,697884420,2550985770,2607674513,2659114323,110200136,1489731079,997519150,1378877361,3527870668,478029773,2766872923,1022481122,431258168,1112503832,897933369,2635587303,669726182,3383752315,918222264,163866573,3246985393,3776823163,114105080,1903216136,761148244,3571337562,1690750982,3166750252,1037045171,1888456500,2010454850,642736655,616092351,365016990,1185228132,4174898510,1043824992,2023083429,2241598885,3863320456,3279669087,3674716684,108438443,2132974366,830746235,606445527,4173263986,2204105912,1844756978,2532684181,4245352700,2969441100,3796921661,1335562986,4061524517,2720232303,2679424040,634407289,885462008,3294724487,3933892248,2094100220,339117932,4048830727,3202280980,1458155303,2689246273,1022871705,2464987878,3714515309,353796843,2822958815,4256850100,4052777845,551748367,618185374,3778635579,4020649912,1904685140,3069366075,2670879810,3407193292,2954511620,4058283405,2219449317,3135758300,1120655984,3447565834,1474845562,3577699062,550456716,3466908712,2043752612,881257467,869518812,2005220179,938474677,3305539448,3850417126,1315485940,3318264702,226533026,965733244,321539988,1136104718,804158748,573969341,3708209826,937399083,3290727049,2901666755,1461057207,4013193437,4066861423,3242773476,2421326174,1581322155,3028952165,786071460,3900391652,3918438532,1485433313,4023619836,3708277595,3678951060,953673138,1467089153,1930354364,1533292819,2492563023,1346121658,1685000834,1965281866,3765933717,4190206607,2052792609,3515332758,690371149,3125873887,2180283551,2903598061,3933952357,436236910,289419410,14314871,1242357089,2904507907,1616633776,2666382180,585885352,3471299210,2699507360,1432659641,277164553,3354103607,770115018,2303809295,3741942315,3177781868,2853364978,2269453327,3774259834,987383833,1290892879,225909803,1741533526,890078084,1496906255,1111072499,916028167,243534141,1252605537,2204162171,531204876,290011180,3916834213,102027703,237315147,209093447,1486785922,220223953,2758195998,4175039106,82940208,3127791296,2569425252,518464269,1353887104,3941492737,2377294467,3935040926]}function o(t){this.cast5=new s,this.cast5.setKey(t),this.encrypt=function(t){return this.cast5.encrypt(t)}}n.keySize=n.prototype.keySize=24,n.blockSize=n.prototype.blockSize=8,o.blockSize=o.prototype.blockSize=8,o.keySize=o.prototype.keySize=16;const r=4294967295;function h(t,i){return(t<<i|t>>>32-i)&r}function c(t,i){return t[i]|t[i+1]<<8|t[i+2]<<16|t[i+3]<<24}function a(t,i,e){t.splice(i,4,255&e,e>>>8&255,e>>>16&255,e>>>24&255)}function f(t,i){return t>>>8*i&255}function l(t){this.tf=function(){let t=null,i=null,e=-1,n=[],s=[[],[],[],[]];function o(t){return s[0][f(t,0)]^s[1][f(t,1)]^s[2][f(t,2)]^s[3][f(t,3)]}function l(t){return s[0][f(t,3)]^s[1][f(t,0)]^s[2][f(t,1)]^s[3][f(t,2)]}function u(t,i){let e=o(i[0]),s=l(i[1]);i[2]=h(i[2]^e+s+n[4*t+8]&r,31),i[3]=h(i[3],1)^e+2*s+n[4*t+9]&r,e=o(i[2]),s=l(i[3]),i[0]=h(i[0]^e+s+n[4*t+10]&r,31),i[1]=h(i[1],1)^e+2*s+n[4*t+11]&r}function y(t,i){let e=o(i[0]),s=l(i[1]);i[2]=h(i[2],1)^e+s+n[4*t+10]&r,i[3]=h(i[3]^e+2*s+n[4*t+11]&r,31),e=o(i[2]),s=l(i[3]),i[0]=h(i[0],1)^e+s+n[4*t+8]&r,i[1]=h(i[1]^e+2*s+n[4*t+9]&r,31)}return{name:"twofish",blocksize:16,open:function(i){let e,o,a,l,u;t=i;const y=[],p=[],k=[];let g;const m=[];let S,b,z;const d=[[8,1,7,13,6,15,3,2,0,11,5,9,14,12,10,4],[2,8,11,13,15,7,6,14,3,1,9,4,0,10,12,5]],w=[[14,12,11,8,1,2,3,5,15,4,10,6,7,0,9,13],[1,14,2,11,4,12,3,7,6,13,10,5,15,9,0,8]],A=[[11,10,5,14,6,13,9,0,12,8,15,3,2,4,7,1],[4,12,7,5,1,6,9,10,0,14,13,8,2,11,3,15]],B=[[13,7,15,4,1,2,6,14,9,11,3,0,8,5,12,10],[11,9,5,1,12,3,13,14,6,4,7,15,2,0,8,10]],N=[0,8,1,9,2,10,3,11,4,12,5,13,6,14,7,15],_=[0,9,2,11,4,13,6,15,8,1,10,3,12,5,14,7],x=[[],[]],E=[[],[],[],[]];function K(t){return t^t>>2^[0,90,180,238][3&t]}function O(t){return t^t>>1^t>>2^[0,238,180,90][3&t]}function C(t,i){let e,n,s;for(e=0;e<8;e++)n=i>>>24,i=i<<8&r|t>>>24,t=t<<8&r,s=n<<1,128&n&&(s^=333),i^=n^s<<16,s^=n>>>1,1&n&&(s^=166),i^=s<<24|s<<8;return i}function I(t,i){const e=i>>4,n=15&i,s=d[t][e^n],o=w[t][N[n]^_[e]];return B[t][N[o]^_[s]]<<4|A[t][s^o]}function L(t,i){let e=f(t,0),n=f(t,1),s=f(t,2),o=f(t,3);switch(g){case 4:e=x[1][e]^f(i[3],0),n=x[0][n]^f(i[3],1),s=x[0][s]^f(i[3],2),o=x[1][o]^f(i[3],3);case 3:e=x[1][e]^f(i[2],0),n=x[1][n]^f(i[2],1),s=x[0][s]^f(i[2],2),o=x[0][o]^f(i[2],3);case 2:e=x[0][x[0][e]^f(i[1],0)]^f(i[0],0),n=x[0][x[1][n]^f(i[1],1)]^f(i[0],1),s=x[1][x[0][s]^f(i[1],2)]^f(i[0],2),o=x[1][x[1][o]^f(i[1],3)]^f(i[0],3)}return E[0][e]^E[1][n]^E[2][s]^E[3][o]}for(t=t.slice(0,32),e=t.length;16!==e&&24!==e&&32!==e;)t[e++]=0;for(e=0;e<t.length;e+=4)k[e>>2]=c(t,e);for(e=0;e<256;e++)x[0][e]=I(0,e),x[1][e]=I(1,e);for(e=0;e<256;e++)S=x[1][e],b=K(S),z=O(S),E[0][e]=S+(b<<8)+(z<<16)+(z<<24),E[2][e]=b+(z<<8)+(S<<16)+(z<<24),S=x[0][e],b=K(S),z=O(S),E[1][e]=z+(z<<8)+(b<<16)+(S<<24),E[3][e]=b+(S<<8)+(z<<16)+(b<<24);for(g=k.length/2,e=0;e<g;e++)o=k[e+e],y[e]=o,a=k[e+e+1],p[e]=a,m[g-e-1]=C(o,a);for(e=0;e<40;e+=2)o=16843009*e,a=o+16843009,o=L(o,y),a=h(L(a,p),8),n[e]=o+a&r,n[e+1]=h(o+2*a,9);for(e=0;e<256;e++)switch(o=a=l=u=e,g){case 4:o=x[1][o]^f(m[3],0),a=x[0][a]^f(m[3],1),l=x[0][l]^f(m[3],2),u=x[1][u]^f(m[3],3);case 3:o=x[1][o]^f(m[2],0),a=x[1][a]^f(m[2],1),l=x[0][l]^f(m[2],2),u=x[0][u]^f(m[2],3);case 2:s[0][e]=E[0][x[0][x[0][o]^f(m[1],0)]^f(m[0],0)],s[1][e]=E[1][x[0][x[1][a]^f(m[1],1)]^f(m[0],1)],s[2][e]=E[2][x[1][x[0][l]^f(m[1],2)]^f(m[0],2)],s[3][e]=E[3][x[1][x[1][u]^f(m[1],3)]^f(m[0],3)]}},close:function(){n=[],s=[[],[],[],[]]},encrypt:function(t,s){i=t,e=s;const o=[c(i,e)^n[0],c(i,e+4)^n[1],c(i,e+8)^n[2],c(i,e+12)^n[3]];for(let t=0;t<8;t++)u(t,o);return a(i,e,o[2]^n[4]),a(i,e+4,o[3]^n[5]),a(i,e+8,o[0]^n[6]),a(i,e+12,o[1]^n[7]),e+=16,i},decrypt:function(t,s){i=t,e=s;const o=[c(i,e)^n[4],c(i,e+4)^n[5],c(i,e+8)^n[6],c(i,e+12)^n[7]];for(let t=7;t>=0;t--)y(t,o);a(i,e,o[2]^n[0]),a(i,e+4,o[3]^n[1]),a(i,e+8,o[0]^n[2]),a(i,e+12,o[1]^n[3]),e+=16},finalize:function(){return i}}}(),this.tf.open(Array.from(t),0),this.encrypt=function(t){return this.tf.encrypt(Array.from(t),0)}}function u(){}function y(t){this.bf=new u,this.bf.init(t),this.encrypt=function(t){return this.bf.encryptBlock(t)}}l.keySize=l.prototype.keySize=32,l.blockSize=l.prototype.blockSize=16,u.prototype.BLOCKSIZE=8,u.prototype.SBOXES=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]],u.prototype.PARRAY=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],u.prototype.NN=16,u.prototype._clean=function(t){if(t<0){t=(2147483647&t)+2147483648}return t},u.prototype._F=function(t){let i;const e=255&t,n=255&(t>>>=8),s=255&(t>>>=8),o=255&(t>>>=8);return i=this.sboxes[0][o]+this.sboxes[1][s],i^=this.sboxes[2][n],i+=this.sboxes[3][e],i},u.prototype._encryptBlock=function(t){let i,e=t[0],n=t[1];for(i=0;i<this.NN;++i){e^=this.parray[i],n=this._F(e)^n;const t=e;e=n,n=t}e^=this.parray[this.NN+0],n^=this.parray[this.NN+1],t[0]=this._clean(n),t[1]=this._clean(e)},u.prototype.encryptBlock=function(t){let i;const e=[0,0],n=this.BLOCKSIZE/2;for(i=0;i<this.BLOCKSIZE/2;++i)e[0]=e[0]<<8|255&t[i+0],e[1]=e[1]<<8|255&t[i+n];this._encryptBlock(e);const s=[];for(i=0;i<this.BLOCKSIZE/2;++i)s[i+0]=e[0]>>>24-8*i&255,s[i+n]=e[1]>>>24-8*i&255;return s},u.prototype._decryptBlock=function(t){let i,e=t[0],n=t[1];for(i=this.NN+1;i>1;--i){e^=this.parray[i],n=this._F(e)^n;const t=e;e=n,n=t}e^=this.parray[1],n^=this.parray[0],t[0]=this._clean(n),t[1]=this._clean(e)},u.prototype.init=function(t){let i,e=0;for(this.parray=[],i=0;i<this.NN+2;++i){let n=0;for(let i=0;i<4;++i)n=n<<8|255&t[e],++e>=t.length&&(e=0);this.parray[i]=this.PARRAY[i]^n}for(this.sboxes=[],i=0;i<4;++i)for(this.sboxes[i]=[],e=0;e<256;++e)this.sboxes[i][e]=this.SBOXES[i][e];const n=[0,0];for(i=0;i<this.NN+2;i+=2)this._encryptBlock(n),this.parray[i+0]=n[0],this.parray[i+1]=n[1];for(i=0;i<4;++i)for(e=0;e<256;e+=2)this._encryptBlock(n),this.sboxes[i][e+0]=n[0],this.sboxes[i][e+1]=n[1]},y.keySize=y.prototype.keySize=16,y.blockSize=y.prototype.blockSize=8;const p=new Map([[t.symmetric.tripledes,n],[t.symmetric.cast5,o],[t.symmetric.blowfish,y],[t.symmetric.twofish,l]]);export{p as legacyCiphers};
3
3
  //# sourceMappingURL=legacy_ciphers.min.mjs.map