@powersync/web 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  # PowerSync SDK for Web
6
6
 
7
- *[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres or MongoDB on the server-side (MySQL coming soon).*
7
+ *[PowerSync](https://www.powersync.com) is a sync engine for building local-first apps with instantly-responsive UI/UX and simplified state transfer. Syncs between SQLite on the client-side and Postgres, MongoDB or MySQL on the server-side.*
8
8
 
9
9
  This package (`packages/web`) is the PowerSync SDK for JavaScript Web clients. It is an extension of `packages/common`.
10
10
 
package/dist/index.umd.js CHANGED
@@ -6801,41 +6801,45 @@ exports["des-ede"] = {
6801
6801
  \**************************************************/
6802
6802
  /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
6803
6803
 
6804
- var BN = __webpack_require__(/*! bn.js */ "../../node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js")
6805
- var randomBytes = __webpack_require__(/*! randombytes */ "../../node_modules/randombytes/browser.js")
6804
+ "use strict";
6806
6805
 
6807
- function blind (priv) {
6808
- var r = getr(priv)
6809
- var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed()
6810
- return { blinder: blinder, unblinder: r.invm(priv.modulus) }
6811
- }
6812
6806
 
6813
- function getr (priv) {
6814
- var len = priv.modulus.byteLength()
6815
- var r
6816
- do {
6817
- r = new BN(randomBytes(len))
6818
- } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2))
6819
- return r
6820
- }
6821
-
6822
- function crt (msg, priv) {
6823
- var blinds = blind(priv)
6824
- var len = priv.modulus.byteLength()
6825
- var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus)
6826
- var c1 = blinded.toRed(BN.mont(priv.prime1))
6827
- var c2 = blinded.toRed(BN.mont(priv.prime2))
6828
- var qinv = priv.coefficient
6829
- var p = priv.prime1
6830
- var q = priv.prime2
6831
- var m1 = c1.redPow(priv.exponent1).fromRed()
6832
- var m2 = c2.redPow(priv.exponent2).fromRed()
6833
- var h = m1.isub(m2).imul(qinv).umod(p).imul(q)
6834
- return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len)
6835
- }
6836
- crt.getr = getr
6837
-
6838
- module.exports = crt
6807
+ var BN = __webpack_require__(/*! bn.js */ "../../node_modules/browserify-rsa/node_modules/bn.js/lib/bn.js");
6808
+ var randomBytes = __webpack_require__(/*! randombytes */ "../../node_modules/randombytes/browser.js");
6809
+ var Buffer = (__webpack_require__(/*! safe-buffer */ "../../node_modules/safe-buffer/index.js").Buffer);
6810
+
6811
+ function getr(priv) {
6812
+ var len = priv.modulus.byteLength();
6813
+ var r;
6814
+ do {
6815
+ r = new BN(randomBytes(len));
6816
+ } while (r.cmp(priv.modulus) >= 0 || !r.umod(priv.prime1) || !r.umod(priv.prime2));
6817
+ return r;
6818
+ }
6819
+
6820
+ function blind(priv) {
6821
+ var r = getr(priv);
6822
+ var blinder = r.toRed(BN.mont(priv.modulus)).redPow(new BN(priv.publicExponent)).fromRed();
6823
+ return { blinder: blinder, unblinder: r.invm(priv.modulus) };
6824
+ }
6825
+
6826
+ function crt(msg, priv) {
6827
+ var blinds = blind(priv);
6828
+ var len = priv.modulus.byteLength();
6829
+ var blinded = new BN(msg).mul(blinds.blinder).umod(priv.modulus);
6830
+ var c1 = blinded.toRed(BN.mont(priv.prime1));
6831
+ var c2 = blinded.toRed(BN.mont(priv.prime2));
6832
+ var qinv = priv.coefficient;
6833
+ var p = priv.prime1;
6834
+ var q = priv.prime2;
6835
+ var m1 = c1.redPow(priv.exponent1).fromRed();
6836
+ var m2 = c2.redPow(priv.exponent2).fromRed();
6837
+ var h = m1.isub(m2).imul(qinv).umod(p).imul(q);
6838
+ return m2.iadd(h).imul(blinds.unblinder).umod(priv.modulus).toArrayLike(Buffer, 'be', len);
6839
+ }
6840
+ crt.getr = getr;
6841
+
6842
+ module.exports = crt;
6839
6843
 
6840
6844
 
6841
6845
  /***/ }),