bugs on firefox, chromium is unaffected

we need further investigation, but have no time to do so.
This commit is contained in:
yigid committed 2024-09-25 15:53:20 +03:00 Verified
1 parent ca521e033f
commit 0cd7ca7f65
6 files changed
+186 -15

No files matched your search

+1 -1
View File
@@ -1 +1 @@
(()=>{var e={724:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function d(e,t,r){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var n;"object"==typeof e?e.exports=d:t.BN=d,d.BN=d,d.wordSize=26;try{n="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(654).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function s(e,t,r,i){for(var f=0,d=Math.min(e.length,r),n=t;n<d;n++){var a=e.charCodeAt(n)-48;f*=i,f+=a>=49?a-49+10:a>=17?a-17+10:a}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,t){return e.cmp(t)>0?e:t},d.min=function(e,t){return e.cmp(t)<0?e:t},d.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f<e.length&&(16===t?this._parseHex(e,f,r):(this._parseBase(e,t,f),"le"===r&&this._initArray(this.toArray(),t,r)))},d.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},d.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d,n,a=0;if("be"===r)for(f=e.length-1,d=0;f>=0;f-=3)n=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=n<<a&67108863,this.words[d+1]=n>>>26-a&67108863,(a+=24)>=26&&(a-=26,d++);else if("le"===r)for(f=0,d=0;f<e.length;f+=3)n=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[d]|=n<<a&67108863,this.words[d+1]=n>>>26-a&67108863,(a+=24)>=26&&(a-=26,d++);return this.strip()},d.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var f,d=0,n=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)f=c(e,t,i)<<d,this.words[n]|=67108863&f,d>=18?(d-=18,n+=1,this.words[n]|=f>>>26):d+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)f=c(e,t,i)<<d,this.words[n]|=67108863&f,d>=18?(d-=18,n+=1,this.words[n]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,f=1;f<=67108863;f*=t)i++;i--,f=f/t|0;for(var d=e.length-r,n=d%i,a=Math.min(d,d-n)+r,c=0,h=r;h<a;h+=i)c=s(e,h,h+i,t),this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==n){var o=1;for(c=s(e,h,e.length,t),h=0;h<n;h++)o*=t;this.imuln(o),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},d.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},d.prototype.clone=function(){var e=new d(null);return this.copy(e),e},d.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},d.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function b(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var f=0|e.words[0],d=0|t.words[0],n=f*d,a=67108863&n,c=n/67108864|0;r.words[0]=a;for(var s=1;s<i;s++){for(var h=c>>>26,o=67108863&c,u=Math.min(s,t.length-1),b=Math.max(0,s-e.length+1);b<=u;b++){var l=s-b|0;h+=(n=(f=0|e.woLine truncated
(()=>{var e={724:function(e,t,r){!function(e,t){"use strict";function i(e,t){if(!e)throw new Error(t||"Assertion failed")}function f(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function d(e,t,r){if(d.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var n;"object"==typeof e?e.exports=d:t.BN=d,d.BN=d,d.wordSize=26;try{n="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(654).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function s(e,t,r,i){for(var f=0,d=Math.min(e.length,r),n=t;n<d;n++){var a=e.charCodeAt(n)-48;f*=i,f+=a>=49?a-49+10:a>=17?a-17+10:a}return f}d.isBN=function(e){return e instanceof d||null!==e&&"object"==typeof e&&e.constructor.wordSize===d.wordSize&&Array.isArray(e.words)},d.max=function(e,t){return e.cmp(t)>0?e:t},d.min=function(e,t){return e.cmp(t)<0?e:t},d.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),i(t===(0|t)&&t>=2&&t<=36);var f=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(f++,this.negative=1),f<e.length&&(16===t?this._parseHex(e,f,r):(this._parseBase(e,t,f),"le"===r&&this._initArray(this.toArray(),t,r)))},d.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(i(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},d.prototype._initArray=function(e,t,r){if(i("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var f=0;f<this.length;f++)this.words[f]=0;var d,n,a=0;if("be"===r)for(f=e.length-1,d=0;f>=0;f-=3)n=e[f]|e[f-1]<<8|e[f-2]<<16,this.words[d]|=n<<a&67108863,this.words[d+1]=n>>>26-a&67108863,(a+=24)>=26&&(a-=26,d++);else if("le"===r)for(f=0,d=0;f<e.length;f+=3)n=e[f]|e[f+1]<<8|e[f+2]<<16,this.words[d]|=n<<a&67108863,this.words[d+1]=n>>>26-a&67108863,(a+=24)>=26&&(a-=26,d++);return this.strip()},d.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var f,d=0,n=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)f=c(e,t,i)<<d,this.words[n]|=67108863&f,d>=18?(d-=18,n+=1,this.words[n]|=f>>>26):d+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)f=c(e,t,i)<<d,this.words[n]|=67108863&f,d>=18?(d-=18,n+=1,this.words[n]|=f>>>26):d+=8;this.strip()},d.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,f=1;f<=67108863;f*=t)i++;i--,f=f/t|0;for(var d=e.length-r,n=d%i,a=Math.min(d,d-n)+r,c=0,h=r;h<a;h+=i)c=s(e,h,h+i,t),this.imuln(f),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==n){var o=1;for(c=s(e,h,e.length,t),h=0;h<n;h++)o*=t;this.imuln(o),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},d.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},d.prototype.clone=function(){var e=new d(null);return this.copy(e),e},d.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},d.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},d.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},d.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],o=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],u=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function b(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var f=0|e.words[0],d=0|t.words[0],n=f*d,a=67108863&n,c=n/67108864|0;r.words[0]=a;for(var s=1;s<i;s++){for(var h=c>>>26,o=67108863&c,u=Math.min(s,t.length-1),b=Math.max(0,s-e.length+1);b<=u;b++){var l=s-b|0;h+=(n=(f=0|e.woLine truncated
+163 -1
View File
@@ -1 +1,163 @@
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
/*!****************!*\
!*** ./key.js ***!
\****************/
/*!******************!*\
!*** ./index.js ***!
\******************/
/*!************************!*\
!*** buffer (ignored) ***!
\************************/
/*!************************!*\
!*** crypto (ignored) ***!
\************************/
/*!***************************!*\
!*** ./key-derivation.js ***!
\***************************/
/*!**********************************************************************!*\
!*** ./node_modules/.pnpm/bn.js@4.12.0/node_modules/bn.js/lib/bn.js ***!
\**********************************************************************/
/*!************************************************************************!*\
!*** ./node_modules/.pnpm/brorand@1.1.0/node_modules/brorand/index.js ***!
\************************************************************************/
/*!***************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash.js ***!
\***************************************************************************/
/*!******************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/package.json ***!
\******************************************************************************/
/*!*******************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha.js ***!
\*******************************************************************************/
/*!********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/hmac.js ***!
\********************************************************************************/
/*!*********************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic.js ***!
\*********************************************************************************/
/*!*********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/1.js ***!
\*********************************************************************************/
/*!*********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/utils.js ***!
\*********************************************************************************/
/*!**********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/common.js ***!
\**********************************************************************************/
/*!**********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/ripemd.js ***!
\**********************************************************************************/
/*!***********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/224.js ***!
\***********************************************************************************/
/*!***********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/256.js ***!
\***********************************************************************************/
/*!***********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/384.js ***!
\***********************************************************************************/
/*!***********************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/512.js ***!
\***********************************************************************************/
/*!************************************************************************************!*\
!*** ./node_modules/.pnpm/hmac-drbg@1.0.1/node_modules/hmac-drbg/lib/hmac-drbg.js ***!
\************************************************************************************/
/*!*************************************************************************************!*\
!*** ./node_modules/.pnpm/inherits@2.0.4/node_modules/inherits/inherits_browser.js ***!
\*************************************************************************************/
/*!**************************************************************************************!*\
!*** ./node_modules/.pnpm/hash.js@1.1.7/node_modules/hash.js/lib/hash/sha/common.js ***!
\**************************************************************************************/
/*!***************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/utils.js ***!
\***************************************************************************************/
/*!****************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curves.js ***!
\****************************************************************************************/
/*!****************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/key.js ***!
\****************************************************************************************/
/*!****************************************************************************************!*\
!*** ./node_modules/.pnpm/web-bip39@0.0.3/node_modules/web-bip39/wordlists/english.js ***!
\****************************************************************************************/
/*!*****************************************************************************************!*\
!*** ./node_modules/.pnpm/web-bip39@0.0.3/node_modules/web-bip39/dist/web-bip39.esm.js ***!
\*****************************************************************************************/
/*!******************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/index.js ***!
\******************************************************************************************/
/*!*******************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/key.js ***!
\*******************************************************************************************/
/*!********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/base.js ***!
\********************************************************************************************/
/*!********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/mont.js ***!
\********************************************************************************************/
/*!*********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/index.js ***!
\*********************************************************************************************/
/*!*********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/short.js ***!
\*********************************************************************************************/
/*!*********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/index.js ***!
\*********************************************************************************************/
/*!**********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/ec/signature.js ***!
\**********************************************************************************************/
/*!***********************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/curve/edwards.js ***!
\***********************************************************************************************/
/*!************************************************************************************************!*\
!*** ./node_modules/.pnpm/minimalistic-assert@1.0.1/node_modules/minimalistic-assert/index.js ***!
\************************************************************************************************/
/*!*************************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/eddsa/signature.js ***!
\*************************************************************************************************/
/*!*******************************************************************************************************!*\
!*** ./node_modules/.pnpm/elliptic@6.5.7/node_modules/elliptic/lib/elliptic/precomputed/secp256k1.js ***!
\*******************************************************************************************************/
/*!****************************************************************************************************************!*\
!*** ./node_modules/.pnpm/minimalistic-crypto-utils@1.0.1/node_modules/minimalistic-crypto-utils/lib/utils.js ***!
\****************************************************************************************************************/
+2 -8
View File
@@ -1,18 +1,12 @@
import {
generateKeyPair,
generateMnemonic,
newGenKeypair
} from "./key-derivation.js";
import { generateKeypair } from "./key-derivation.js";
(async () => {
// const mnemonic = await generateMnemonic();
// console.log(mnemonic);
console.log("start");
const mnemonic =
"digital radio analyst fine casino have mass blood potato hat web capital prefer debate fee differ spray cloud";
const { publicKey, privateKey } = await generateKeyPair(mnemonic);
const { publicKey, privateKey } = await generateKeypair(mnemonic);
console.log(publicKey.keyType, privateKey.keyType);
console.log(publicKey.asHexString, privateKey.asHexString);
console.log(publicKey.asByteArray, privateKey.asByteArray);
+1
View File
@@ -14,6 +14,7 @@
"web-bip39": "^0.0.3"
},
"devDependencies": {
"terser-webpack-plugin": "^5.3.10",
"webpack": "^5.93.0",
"webpack-cli": "^5.1.4"
}
+3
View File
@@ -15,6 +15,9 @@ importers:
specifier: ^0.0.3
version: 0.0.3
devDependencies:
terser-webpack-plugin:
specifier: ^5.3.10
version: 5.3.10(webpack@5.93.0(webpack-cli@5.1.4))
webpack:
specifier: ^5.93.0
version: 5.93.0(webpack-cli@5.1.4)
+16 -5
View File
@@ -1,20 +1,31 @@
const path = require("path");
const { experiments } = require("webpack");
const { library } = require("webpack");
const webpack = require("webpack");
const TerserPlugin = require("terser-webpack-plugin");
module.exports = {
entry: "./index.js",
output: {
filename: "bundle.js",
path: path.resolve(__dirname, "dist"),
path: path.resolve(__dirname, "dist")
},
plugins: [
new webpack.IgnorePlugin({
checkResource(resource) {
return /.*\/wordlists\/(?!english).*\.json/.test(resource);
},
}
}),
new TerserPlugin({
terserOptions: {
mangle: {
reserved: [
"generateKeypair",
"generateMnemonic",
"getPairFromPrivate",
"Key"
]
}
}
})
],
mode: "production",
mode: "production"
};