mol_crypto_lib 0.0.414 → 0.0.415

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mol_crypto_lib",
3
- "version": "0.0.414",
3
+ "version": "0.0.415",
4
4
  "main": "node.js",
5
5
  "module": "node.esm.js",
6
6
  "browser": "web.js",
@@ -10,6 +10,23 @@
10
10
  "$mol_crypto",
11
11
  "$mol",
12
12
  "$mol_crypto_secret",
13
+ "$mol_crypto_native",
14
+ "$node",
15
+ "$node_modules",
16
+ "$mol_exec",
17
+ "$mol_log3",
18
+ "$mol_tree",
19
+ "$mol_object2",
20
+ "$mol_ambient",
21
+ "$mol_owning",
22
+ "$mol_delegate",
23
+ "$mol_fail_hidden",
24
+ "$mol_fail",
25
+ "$mol_type_writable",
26
+ "$mol_type",
27
+ "$mol_term_color",
28
+ "$mol_term",
29
+ "$mol_env",
13
30
  "$mol_crypto_cipher",
14
31
  "$mol_crypto_auditor",
15
32
  "$mol_crypto_hash",
package/web.d.ts CHANGED
@@ -13,6 +13,10 @@ declare namespace $ {
13
13
  export {};
14
14
  }
15
15
 
16
+ declare namespace $ {
17
+ var $mol_crypto_native: Crypto;
18
+ }
19
+
16
20
  declare namespace $ {
17
21
  class $mol_crypto_secret extends Object {
18
22
  readonly native: CryptoKey & {
package/web.deps.json CHANGED
@@ -1 +1 @@
1
- {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/hash/hash.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/hash":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/hash":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/hash":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991},"mol/crypto/auditor":{"mol/crypto":-9007199254740991},"mol/crypto/hash":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991}},"sloc":{"LICENSE":113,"md":533,"tree":36,"js":9,"ts":349,"json":85,"lock":994,"CNAME":1,"html":1},"deps":{"mol/crypto/lib":{"..":-9007199254740991,"/mol/crypto/secret":-9000,"/mol/crypto/cipher":-9000,"/mol/crypto/auditor":-9000,"/mol/crypto/hash":-9000,"/mol/crypto/salt":-9000},"mol/crypto":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/crypto/secret":{"..":-9007199254740991,"/mol/crypto/secret":-1},"mol/crypto/cipher":{"..":-9007199254740991,"/mol/crypto/cipher/pair":-1,"/mol/crypto/cipher/public":-1,"/mol/crypto/cipher/private":-1,"/mol/crypto/cipher/ecrypted/size":-1},"mol/crypto/auditor":{"..":-9007199254740991,"/mol/crypto/auditor/pair":-1,"/mol/crypto/auditor/public":-1,"/mol/crypto/auditor/private":-1,"/mol/crypto/auditor/sign/size":-1},"mol/crypto/hash":{"..":-9007199254740991,"/mol/crypto/hash":-1},"mol/crypto/salt":{"..":-9007199254740991,"/mol/crypto/salt":-1}}}
1
+ {"files":["LICENSE","README.md","lang.lang.tree","mam.jam.js","mam.ts","package.json","sandbox.config.json","tsconfig.json","tsfmt.json","yarn.lock","mol/CNAME","mol/CODE_OF_CONDUCT.md","mol/CONTRIBUTING.md","mol/LICENSE","mol/index.html","mol/mol.meta.tree","mol/readme.md","mol/crypto/README.md","mol/crypto/native/native.web.ts","mol/crypto/secret/secret.ts","mol/crypto/cipher/cipher.ts","mol/crypto/auditor/auditor.ts","mol/crypto/hash/hash.ts","mol/crypto/salt/salt.ts","mol/crypto/lib/lib.meta.tree"],"mods":{},"deps_in":{"mol/crypto":{"mol/crypto/lib":-9007199254740991,"mol/crypto/secret":-9007199254740991,"mol/crypto/native":-9007199254740991,"mol/crypto/cipher":-9007199254740991,"mol/crypto/auditor":-9007199254740991,"mol/crypto/hash":-9007199254740991,"mol/crypto/salt":-9007199254740991},"mol":{"mol/crypto":-9007199254740991},"":{"mol":-9007199254740991},"mol/crypto/secret":{"mol/crypto/lib":-9000},"mol/crypto/native":{"mol/crypto/secret":-3,"mol/crypto/cipher":-2,"mol/crypto/auditor":-2,"mol/crypto/salt":-2},"mol/crypto/cipher":{"mol/crypto/lib":-9000},"mol/crypto/auditor":{"mol/crypto/lib":-9000},"mol/crypto/hash":{"mol/crypto/lib":-9000},"mol/crypto/salt":{"mol/crypto/lib":-9000}},"deps_out":{"mol/crypto/lib":{"mol/crypto":-9007199254740991,"mol/crypto/secret":-9000,"mol/crypto/cipher":-9000,"mol/crypto/auditor":-9000,"mol/crypto/hash":-9000,"mol/crypto/salt":-9000},"mol/crypto":{"mol":-9007199254740991},"mol":{"":-9007199254740991},"mol/crypto/secret":{"mol/crypto":-9007199254740991,"mol/crypto/native":-3},"mol/crypto/native":{"mol/crypto":-9007199254740991},"mol/crypto/cipher":{"mol/crypto":-9007199254740991,"mol/crypto/native":-2},"mol/crypto/auditor":{"mol/crypto":-9007199254740991,"mol/crypto/native":-2},"mol/crypto/hash":{"mol/crypto":-9007199254740991},"mol/crypto/salt":{"mol/crypto":-9007199254740991,"mol/crypto/native":-2}},"sloc":{"LICENSE":113,"md":533,"tree":36,"js":9,"ts":352,"json":85,"lock":994,"CNAME":1,"html":1},"deps":{"mol/crypto/lib":{"..":-9007199254740991,"/mol/crypto/secret":-9000,"/mol/crypto/cipher":-9000,"/mol/crypto/auditor":-9000,"/mol/crypto/hash":-9000,"/mol/crypto/salt":-9000},"mol/crypto":{"..":-9007199254740991},"mol":{"..":-9007199254740991},"":{},"mol/crypto/secret":{"..":-9007199254740991,"/mol/crypto/secret":-1,"/mol/crypto/native/subtle/generate/key":-4,"/mol/crypto/native/subtle/import/key":-4,"/mol/crypto/native/subtle/export/key":-3,"/mol/crypto/native/subtle/encrypt":-3,"/mol/crypto/native/subtle/decrypt":-3},"mol/crypto/native":{"..":-9007199254740991,"./native.ts":0,"/mol/crypto/native":-1},"mol/crypto/cipher":{"..":-9007199254740991,"/mol/crypto/cipher/pair":-1,"/mol/crypto/native/subtle/generate/key":-2,"/mol/crypto/cipher/public":-1,"/mol/crypto/cipher/private":-1,"/mol/crypto/native/subtle/import/key":-4,"/mol/crypto/native/subtle/export/key":-3,"/mol/crypto/native/subtle/encrypt":-3,"/mol/crypto/native/subtle/decrypt":-3,"/mol/crypto/cipher/ecrypted/size":-1},"mol/crypto/auditor":{"..":-9007199254740991,"/mol/crypto/auditor/pair":-1,"/mol/crypto/native/subtle/generate/key":-2,"/mol/crypto/auditor/public":-1,"/mol/crypto/auditor/private":-1,"/mol/crypto/native/subtle/import/key":-4,"/mol/crypto/native/subtle/export/key":-3,"/mol/crypto/native/subtle/verify":-3,"/mol/crypto/native/subtle/sign":-3,"/mol/crypto/auditor/sign/size":-1},"mol/crypto/hash":{"..":-9007199254740991,"/mol/crypto/hash":-1},"mol/crypto/salt":{"..":-9007199254740991,"/mol/crypto/salt":-1,"/mol/crypto/native/get/random/values":-2}}}
package/web.esm.js CHANGED
@@ -30,6 +30,13 @@ $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
30
30
  ;
31
31
  "use strict";
32
32
  var $;
33
+ (function ($) {
34
+ $.$mol_crypto_native = crypto;
35
+ })($ || ($ = {}));
36
+ //mol/crypto/native/native.web.ts
37
+ ;
38
+ "use strict";
39
+ var $;
33
40
  (function ($) {
34
41
  const algorithm = {
35
42
  name: 'AES-GCM',
@@ -45,22 +52,22 @@ var $;
45
52
  this.native = native;
46
53
  }
47
54
  static async generate() {
48
- return new this(await crypto.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']));
55
+ return new this(await $mol_crypto_native.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']));
49
56
  }
50
57
  static async from(serial) {
51
- return new this(await crypto.subtle.importKey('raw', serial, algorithm, true, ['encrypt', 'decrypt']));
58
+ return new this(await $mol_crypto_native.subtle.importKey('raw', serial, algorithm, true, ['encrypt', 'decrypt']));
52
59
  }
53
60
  async serial() {
54
- return await crypto.subtle.exportKey('raw', this.native);
61
+ return await $mol_crypto_native.subtle.exportKey('raw', this.native);
55
62
  }
56
63
  async encrypt(open, salt) {
57
- return await crypto.subtle.encrypt({
64
+ return await $mol_crypto_native.subtle.encrypt({
58
65
  ...algorithm,
59
66
  iv: salt,
60
67
  }, this.native, open);
61
68
  }
62
69
  async decrypt(closed, salt) {
63
- return await crypto.subtle.decrypt({
70
+ return await $mol_crypto_native.subtle.decrypt({
64
71
  ...algorithm,
65
72
  iv: salt,
66
73
  }, this.native, closed);
@@ -80,7 +87,7 @@ var $;
80
87
  hash: 'SHA-1',
81
88
  };
82
89
  async function $mol_crypto_cipher_pair() {
83
- const pair = await $.crypto.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']);
90
+ const pair = await $mol_crypto_native.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']);
84
91
  return {
85
92
  public: new $mol_crypto_cipher_public(pair.publicKey),
86
93
  private: new $mol_crypto_cipher_private(pair.privateKey),
@@ -95,13 +102,13 @@ var $;
95
102
  this.native = native;
96
103
  }
97
104
  static async from(serial) {
98
- return new this(await crypto.subtle.importKey('spki', serial, algorithm, true, ['encrypt']));
105
+ return new this(await $mol_crypto_native.subtle.importKey('spki', serial, algorithm, true, ['encrypt']));
99
106
  }
100
107
  async serial() {
101
- return await crypto.subtle.exportKey('spki', this.native);
108
+ return await $mol_crypto_native.subtle.exportKey('spki', this.native);
102
109
  }
103
110
  async encrypt(data) {
104
- return await crypto.subtle.encrypt(algorithm, this.native, data);
111
+ return await $mol_crypto_native.subtle.encrypt(algorithm, this.native, data);
105
112
  }
106
113
  }
107
114
  $.$mol_crypto_cipher_public = $mol_crypto_cipher_public;
@@ -112,13 +119,13 @@ var $;
112
119
  this.native = native;
113
120
  }
114
121
  static async from(serial) {
115
- return new this(await crypto.subtle.importKey('pkcs8', serial, algorithm, true, ['decrypt']));
122
+ return new this(await $mol_crypto_native.subtle.importKey('pkcs8', serial, algorithm, true, ['decrypt']));
116
123
  }
117
124
  async serial() {
118
- return await crypto.subtle.exportKey('pkcs8', this.native);
125
+ return await $mol_crypto_native.subtle.exportKey('pkcs8', this.native);
119
126
  }
120
127
  async decrypt(data) {
121
- return await crypto.subtle.decrypt(algorithm, this.native, data);
128
+ return await $mol_crypto_native.subtle.decrypt(algorithm, this.native, data);
122
129
  }
123
130
  }
124
131
  $.$mol_crypto_cipher_private = $mol_crypto_cipher_private;
@@ -137,7 +144,7 @@ var $;
137
144
  saltLength: 8,
138
145
  };
139
146
  async function $mol_crypto_auditor_pair() {
140
- const pair = await $.crypto.subtle.generateKey(algorithm, true, ['sign', 'verify']);
147
+ const pair = await $mol_crypto_native.subtle.generateKey(algorithm, true, ['sign', 'verify']);
141
148
  return {
142
149
  public: new $mol_crypto_auditor_public(pair.publicKey),
143
150
  private: new $mol_crypto_auditor_private(pair.privateKey),
@@ -152,13 +159,13 @@ var $;
152
159
  this.native = native;
153
160
  }
154
161
  static async from(serial) {
155
- return new this(await crypto.subtle.importKey('spki', serial, algorithm, true, ['verify']));
162
+ return new this(await $mol_crypto_native.subtle.importKey('spki', serial, algorithm, true, ['verify']));
156
163
  }
157
164
  async serial() {
158
- return await crypto.subtle.exportKey('spki', this.native);
165
+ return await $mol_crypto_native.subtle.exportKey('spki', this.native);
159
166
  }
160
167
  async verify(data, sign) {
161
- return await crypto.subtle.verify(algorithm, this.native, sign, data);
168
+ return await $mol_crypto_native.subtle.verify(algorithm, this.native, sign, data);
162
169
  }
163
170
  }
164
171
  $.$mol_crypto_auditor_public = $mol_crypto_auditor_public;
@@ -170,13 +177,13 @@ var $;
170
177
  this.native = native;
171
178
  }
172
179
  static async from(serial) {
173
- return new this(await crypto.subtle.importKey('pkcs8', serial, algorithm, true, ['sign']));
180
+ return new this(await $mol_crypto_native.subtle.importKey('pkcs8', serial, algorithm, true, ['sign']));
174
181
  }
175
182
  async serial() {
176
- return await crypto.subtle.exportKey('pkcs8', this.native);
183
+ return await $mol_crypto_native.subtle.exportKey('pkcs8', this.native);
177
184
  }
178
185
  async sign(data) {
179
- return await crypto.subtle.sign(algorithm, this.native, data);
186
+ return await $mol_crypto_native.subtle.sign(algorithm, this.native, data);
180
187
  }
181
188
  }
182
189
  $.$mol_crypto_auditor_private = $mol_crypto_auditor_private;
@@ -260,7 +267,7 @@ var $;
260
267
  var $;
261
268
  (function ($) {
262
269
  function $mol_crypto_salt() {
263
- return crypto.getRandomValues(new Uint8Array(8));
270
+ return $mol_crypto_native.getRandomValues(new Uint8Array(12));
264
271
  }
265
272
  $.$mol_crypto_salt = $mol_crypto_salt;
266
273
  })($ || ($ = {}));
package/web.esm.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../mam.jam.js","-","../../../../mam.ts","../../secret/mol/crypto/secret/secret.ts","../../cipher/mol/crypto/cipher/cipher.ts","../../auditor/mol/crypto/auditor/auditor.ts","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AAI,CAAA;SACtF;QAED,OAAO,IAAI,UAAU,CAAE,IAAI,CAAC,MAAM,CAAE,CAAA;IACrC,CAAC;IA3Fe,kBAAgB,mBA2F/B,CAAA;AAEF,CAAC,EAlGS,CAAC,KAAD,CAAC,QAkGV;;;;AClGD,IAAU,CAAC,CASV;AATD,WAAU,CAAC;IAGV,SAAgB,gBAAgB;QAC/B,OAAO,MAAM,CAAC,eAAe,CAC5B,IAAI,UAAU,CAAE,CAAC,CAAE,CACnB,CAAA;IACF,CAAC;IAJe,kBAAgB,mBAI/B,CAAA;AAEF,CAAC,EATS,CAAC,KAAD,CAAC,QASV;;;ANTD","file":"web.esm.js","sourcesContent":[null,null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'AES-GCM',\n\t\tlength: 128,\n\t\ttagLength: 32,\n\t}\n\t\n\t/** Symmetric cipher with shortest payload */\n\texport class $mol_crypto_secret extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 16\n\t\t\n\t\t/** Extra size in bytes to encrypted data. */\n\t\tstatic extra = 4\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async generate() {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.generateKey(\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'raw',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 16 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'raw',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\n\t\t/** 4 bytes + data length */\n\t\tasync encrypt( open: BufferSource, salt: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.encrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\topen\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( closed: BufferSource, salt : BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.decrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\tclosed\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'RSA-OAEP',\n\t\tmodulusLength: 1024,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t}\n\t\n\t/** Asymmetric cipher pair with shortest payload */\n\texport async function $mol_crypto_cipher_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $.crypto.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_cipher_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_cipher_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher public key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_public extends Object {\n\t\t\n\t\t/** Public key size in bytes. */\n\t\tstatic size = 162\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 162 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** max 86 bytes input, 128 bytes output */\n\t\tasync encrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.encrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher private key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_private extends Object {\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** ~640 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.decrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Encrypted size in bytes. */\n\texport const $mol_crypto_cipher_ecrypted_size = 128\n\n}\n","namespace $ {\n\n\t/** @FIXME Need polyfill for Safari (https://github.com/microsoft/MSR-JavaScript-Crypto/) */\n\tconst algorithm = {\n\t\tname: 'RSA-PSS',\n\t\tmodulusLength: 256,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t\tsaltLength: 8,\n\t}\n\t\n\t/** Asymmetric signing pair with shortest payload */\n\texport async function $mol_crypto_auditor_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $.crypto.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'sign', 'verify' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_auditor_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_auditor_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing public key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_public extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 62\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'verify' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 62 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync verify( data: BufferSource, sign: BufferSource ) {\n\t\t\treturn await crypto.subtle.verify(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tsign,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing private key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_private extends Object {\n\t\t\n\t\t/** Max key size in bytes. */\n\t\tstatic size = 200\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'sign' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 190-200 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 32 bytes */\n\t\tasync sign( data: BufferSource ) {\n\t\t\t\n\t\t\treturn await crypto.subtle.sign(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata\n\t\t\t)\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Sign size in bytes. */\n\texport const $mol_crypto_auditor_sign_size = 32\n\t\n}\n","namespace $ {\n\t\n\tlet sponge = new Uint32Array(80)\n\t\n\t/** Fast small sync SHA-1 */\n\texport function $mol_crypto_hash( data: Uint8Array ) {\n\t\t\n\t\tconst bits = data.byteLength << 3\n\t\tconst kbits = bits >> 5\n\t\tconst kword = 0x80 << ( 24 - bits & 0b11111 )\n\t\t\n\t\tconst bytes = 16 + ( bits + 64 >>> 9 << 4 )\n\t\tconst klens = bytes - 1\n\t\tconst words = new Int32Array( data.buffer, data.byteOffset, data.byteLength >> 2 )\n\t\t\n\t\tlet tail = 0\n\t\tfor( let i = words.length * 4; i < data.length; ++i ) {\n\t\t\ttail |= data[i] << ( i << 3 & 0b11000 )\n\t\t}\n\t\t\n\t\t// Initial\n\t\tconst hash = new Int32Array([ 1732584193, -271733879, -1732584194, 271733878, -1009589776 ])\n\t\t\n\t\t// Digest\n\t\tfor( let i = 0; i < bytes; i += 16 ) {\n\t\t\t\n\t\t\tlet h0 = hash[0]\n\t\t\tlet h1 = hash[1]\n\t\t\tlet h2 = hash[2]\n\t\t\tlet h3 = hash[3]\n\t\t\tlet h4 = hash[4]\n\n\t\t\tfor( let j = 0; j < 80; ++j ) {\n\t\t\t\t\n\t\t\t\tlet turn\n\t\t\t\t\n\t\t\t\tif( j < 16 ) {\n\t\t\t\t\t\n\t\t\t\t\tconst k = i + j\n\t\t\t\t\tif( k === klens ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = bits\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet word =\n\t\t\t\t\t\t\tk === words.length ? tail :\n\t\t\t\t\t\t\tk > words.length ? 0 :\n\t\t\t\t\t\t\twords[k]\n\t\t\t\t\t\t\n\t\t\t\t\t\tword = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // LE -> BE\n\t\t\t\t\t\tif( k === kbits ) word |= kword\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = word\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tturn = ( h1 & h2 | ~h1 & h3 ) + 1518500249\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tconst shuffle = sponge[j-3] ^ sponge[j-8] ^ sponge[j-14] ^ sponge[j-16]\n\t\t\t\t\tsponge[j] = shuffle << 1 | shuffle >>> 31\n\t\t\t\t\t\n\t\t\t\t\tturn =\n\t\t\t\t\t\tj < 20 ? ( h1 & h2 | ~h1 & h3 ) + 1518500249 :\n\t\t\t\t\t\tj < 40 ? ( h1 ^ h2 ^ h3 ) + 1859775393 :\n\t\t\t\t\t\tj < 60 ? ( h1 & h2 | h1 & h3 | h2 & h3 ) - 1894007588 :\n\t\t\t\t\t\t( h1 ^ h2 ^ h3 ) - 899497514\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst next = turn + h4 + ( sponge[j] >>> 0 ) + (( h0 << 5 )|( h0 >>> 27 ))\n\n\t\t\t\th4 = h3\n\t\t\t\th3 = h2\n\t\t\t\th2 = ( h1 << 30 )|( h1 >>> 2 )\n\t\t\t\th1 = h0\n\t\t\t\th0 = next\n\t\t\t\t\n\t\t\t}\n\n\t\t\thash[0] += h0\n\t\t\thash[1] += h1\n\t\t\thash[2] += h2\n\t\t\thash[3] += h3\n\t\t\thash[4] += h4\n\t\t\t\n\t\t}\n\t\t\n\t\tfor( let i = 0; i < 20; ++i ) {\n\t\t\tconst word = hash[i]\n\t\t\thash[i] = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // BE -> LE\n\t\t}\n\n\t\treturn new Uint8Array( hash.buffer )\n\t}\n\t\n}\n","namespace $ {\n\t\n\t/** 8 byte */\n\texport function $mol_crypto_salt() {\n\t\treturn crypto.getRandomValues(\n\t\t\tnew Uint8Array( 8 )\n\t\t)\n\t}\n\t\n}\n"]}
1
+ {"version":3,"sources":["../../../../mam.jam.js","-","../../../../mam.ts","../../native/mol/crypto/native/native.web.ts","../../secret/mol/crypto/secret/secret.ts","../../cipher/mol/crypto/cipher/cipher.ts","../../auditor/mol/crypto/auditor/auditor.ts","../../hash/mol/crypto/hash/hash.ts","../../salt/mol/crypto/salt/salt.ts"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;AAMX,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADblB;AACA;AACA;;AEFA,IAAU,CAAC,CAEV;AAFD,WAAU,CAAC;IACC,oBAAkB,GAAG,MAAM,CAAA;AACvC,CAAC,EAFS,CAAC,KAAD,CAAC,QAEV;;;;ACFD,IAAU,CAAC,CA8EV;AA9ED,WAAU,CAAC;IAEV,MAAM,SAAS,GAAG;QACjB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,EAAE;KACb,CAAA;IAGD,MAAa,kBAAmB,SAAQ,MAAM;QASnC;QANV,MAAM,CAAC,IAAI,GAAG,EAAE,CAAA;QAGhB,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;QAEhB,YACU,MAAuC;YAEhD,KAAK,EAAE,CAAA;YAFE,WAAM,GAAN,MAAM,CAAiC;QAGjD,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,QAAQ;YACpB,OAAO,IAAI,IAAI,CACd,MAAM,kBAAkB,CAAC,MAAM,CAAC,WAAW,CAC1C,SAAS,EACT,IAAI,EACJ,CAAE,SAAS,EAAE,SAAS,CAAE,CACW,CACpC,CAAA;QACF,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,IAAI,CAAE,MAAoB;YACtC,OAAO,IAAI,IAAI,CACd,MAAM,kBAAkB,CAAC,MAAM,CAAC,SAAS,CACx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AG,EAAE,EAAE,EAAE,CAAC,EAAG;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,KAAK,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,CAAA;SACtF;QAED,OAAO,IAAI,UAAU,CAAE,IAAI,CAAC,MAAM,CAAE,CAAA;IACrC,CAAC;IA3Fe,kBAAgB,mBA2F/B,CAAA;AAEF,CAAC,EAlGS,CAAC,KAAD,CAAC,QAkGV;;;;AClGD,IAAU,CAAC,CASV;AATD,WAAU,CAAC;IAGV,SAAgB,gBAAgB;QAC/B,OAAO,kBAAkB,CAAC,eAAe,CACxC,IAAI,UAAU,CAAE,EAAE,CAAE,CACpB,CAAA;IACF,CAAC;IAJe,kBAAgB,mBAI/B,CAAA;AAEF,CAAC,EATS,CAAC,KAAD,CAAC,QASV;;;APTD","file":"web.esm.js","sourcesContent":[null,null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\texport var $mol_crypto_native = crypto\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'AES-GCM',\n\t\tlength: 128,\n\t\ttagLength: 32,\n\t}\n\t\n\t/** Symmetric cipher with shortest payload */\n\texport class $mol_crypto_secret extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 16\n\t\t\n\t\t/** Extra size in bytes to encrypted data. */\n\t\tstatic extra = 4\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async generate() {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.generateKey(\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'raw',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 16 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'raw',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\n\t\t/** 4 bytes + data length */\n\t\tasync encrypt( open: BufferSource, salt: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.encrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\topen\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( closed: BufferSource, salt : BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.decrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\tclosed\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'RSA-OAEP',\n\t\tmodulusLength: 1024,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t}\n\t\n\t/** Asymmetric cipher pair with shortest payload */\n\texport async function $mol_crypto_cipher_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $mol_crypto_native.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_cipher_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_cipher_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher public key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_public extends Object {\n\t\t\n\t\t/** Public key size in bytes. */\n\t\tstatic size = 162\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 162 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** max 86 bytes input, 128 bytes output */\n\t\tasync encrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.encrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher private key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_private extends Object {\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** ~640 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.decrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Encrypted size in bytes. */\n\texport const $mol_crypto_cipher_ecrypted_size = 128\n\n}\n","namespace $ {\n\n\t/** @FIXME Need polyfill for Safari and Node (https://github.com/microsoft/MSR-JavaScript-Crypto/) */\n\tconst algorithm = {\n\t\tname: 'RSA-PSS',\n\t\tmodulusLength: 256,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t\tsaltLength: 8,\n\t}\n\t\n\t/** Asymmetric signing pair with shortest payload */\n\texport async function $mol_crypto_auditor_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $mol_crypto_native.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'sign', 'verify' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_auditor_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_auditor_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing public key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_public extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 62\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'verify' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 62 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync verify( data: BufferSource, sign: BufferSource ) {\n\t\t\treturn await $mol_crypto_native.subtle.verify(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tsign,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing private key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_private extends Object {\n\t\t\n\t\t/** Max key size in bytes. */\n\t\tstatic size = 200\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'sign' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 190-200 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 32 bytes */\n\t\tasync sign( data: BufferSource ) {\n\t\t\t\n\t\t\treturn await $mol_crypto_native.subtle.sign(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata\n\t\t\t)\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Sign size in bytes. */\n\texport const $mol_crypto_auditor_sign_size = 32\n\t\n}\n","namespace $ {\n\t\n\tlet sponge = new Uint32Array(80)\n\t\n\t/** Fast small sync SHA-1 */\n\texport function $mol_crypto_hash( data: Uint8Array ) {\n\t\t\n\t\tconst bits = data.byteLength << 3\n\t\tconst kbits = bits >> 5\n\t\tconst kword = 0x80 << ( 24 - bits & 0b11111 )\n\t\t\n\t\tconst bytes = 16 + ( bits + 64 >>> 9 << 4 )\n\t\tconst klens = bytes - 1\n\t\tconst words = new Int32Array( data.buffer, data.byteOffset, data.byteLength >> 2 )\n\t\t\n\t\tlet tail = 0\n\t\tfor( let i = words.length * 4; i < data.length; ++i ) {\n\t\t\ttail |= data[i] << ( i << 3 & 0b11000 )\n\t\t}\n\t\t\n\t\t// Initial\n\t\tconst hash = new Int32Array([ 1732584193, -271733879, -1732584194, 271733878, -1009589776 ])\n\t\t\n\t\t// Digest\n\t\tfor( let i = 0; i < bytes; i += 16 ) {\n\t\t\t\n\t\t\tlet h0 = hash[0]\n\t\t\tlet h1 = hash[1]\n\t\t\tlet h2 = hash[2]\n\t\t\tlet h3 = hash[3]\n\t\t\tlet h4 = hash[4]\n\n\t\t\tfor( let j = 0; j < 80; ++j ) {\n\t\t\t\t\n\t\t\t\tlet turn\n\t\t\t\t\n\t\t\t\tif( j < 16 ) {\n\t\t\t\t\t\n\t\t\t\t\tconst k = i + j\n\t\t\t\t\tif( k === klens ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = bits\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet word =\n\t\t\t\t\t\t\tk === words.length ? tail :\n\t\t\t\t\t\t\tk > words.length ? 0 :\n\t\t\t\t\t\t\twords[k]\n\t\t\t\t\t\t\n\t\t\t\t\t\tword = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // LE -> BE\n\t\t\t\t\t\tif( k === kbits ) word |= kword\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = word\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tturn = ( h1 & h2 | ~h1 & h3 ) + 1518500249\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tconst shuffle = sponge[j-3] ^ sponge[j-8] ^ sponge[j-14] ^ sponge[j-16]\n\t\t\t\t\tsponge[j] = shuffle << 1 | shuffle >>> 31\n\t\t\t\t\t\n\t\t\t\t\tturn =\n\t\t\t\t\t\tj < 20 ? ( h1 & h2 | ~h1 & h3 ) + 1518500249 :\n\t\t\t\t\t\tj < 40 ? ( h1 ^ h2 ^ h3 ) + 1859775393 :\n\t\t\t\t\t\tj < 60 ? ( h1 & h2 | h1 & h3 | h2 & h3 ) - 1894007588 :\n\t\t\t\t\t\t( h1 ^ h2 ^ h3 ) - 899497514\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst next = turn + h4 + ( sponge[j] >>> 0 ) + (( h0 << 5 )|( h0 >>> 27 ))\n\n\t\t\t\th4 = h3\n\t\t\t\th3 = h2\n\t\t\t\th2 = ( h1 << 30 )|( h1 >>> 2 )\n\t\t\t\th1 = h0\n\t\t\t\th0 = next\n\t\t\t\t\n\t\t\t}\n\n\t\t\thash[0] += h0\n\t\t\thash[1] += h1\n\t\t\thash[2] += h2\n\t\t\thash[3] += h3\n\t\t\thash[4] += h4\n\t\t\t\n\t\t}\n\t\t\n\t\tfor( let i = 0; i < 20; ++i ) {\n\t\t\tconst word = hash[i]\n\t\t\thash[i] = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // BE -> LE\n\t\t}\n\n\t\treturn new Uint8Array( hash.buffer )\n\t}\n\t\n}\n","namespace $ {\n\t\n\t/** 8 byte */\n\texport function $mol_crypto_salt() {\n\t\treturn $mol_crypto_native.getRandomValues(\n\t\t\tnew Uint8Array( 12 )\n\t\t)\n\t}\n\t\n}\n"]}
package/web.js CHANGED
@@ -30,6 +30,13 @@ $node[ "../mam.ts" ] = $node[ "../mam.ts" ] = module.exports }.call( {} , {} )
30
30
  ;
31
31
  "use strict";
32
32
  var $;
33
+ (function ($) {
34
+ $.$mol_crypto_native = crypto;
35
+ })($ || ($ = {}));
36
+ //mol/crypto/native/native.web.ts
37
+ ;
38
+ "use strict";
39
+ var $;
33
40
  (function ($) {
34
41
  const algorithm = {
35
42
  name: 'AES-GCM',
@@ -45,22 +52,22 @@ var $;
45
52
  this.native = native;
46
53
  }
47
54
  static async generate() {
48
- return new this(await crypto.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']));
55
+ return new this(await $mol_crypto_native.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']));
49
56
  }
50
57
  static async from(serial) {
51
- return new this(await crypto.subtle.importKey('raw', serial, algorithm, true, ['encrypt', 'decrypt']));
58
+ return new this(await $mol_crypto_native.subtle.importKey('raw', serial, algorithm, true, ['encrypt', 'decrypt']));
52
59
  }
53
60
  async serial() {
54
- return await crypto.subtle.exportKey('raw', this.native);
61
+ return await $mol_crypto_native.subtle.exportKey('raw', this.native);
55
62
  }
56
63
  async encrypt(open, salt) {
57
- return await crypto.subtle.encrypt({
64
+ return await $mol_crypto_native.subtle.encrypt({
58
65
  ...algorithm,
59
66
  iv: salt,
60
67
  }, this.native, open);
61
68
  }
62
69
  async decrypt(closed, salt) {
63
- return await crypto.subtle.decrypt({
70
+ return await $mol_crypto_native.subtle.decrypt({
64
71
  ...algorithm,
65
72
  iv: salt,
66
73
  }, this.native, closed);
@@ -80,7 +87,7 @@ var $;
80
87
  hash: 'SHA-1',
81
88
  };
82
89
  async function $mol_crypto_cipher_pair() {
83
- const pair = await $.crypto.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']);
90
+ const pair = await $mol_crypto_native.subtle.generateKey(algorithm, true, ['encrypt', 'decrypt']);
84
91
  return {
85
92
  public: new $mol_crypto_cipher_public(pair.publicKey),
86
93
  private: new $mol_crypto_cipher_private(pair.privateKey),
@@ -95,13 +102,13 @@ var $;
95
102
  this.native = native;
96
103
  }
97
104
  static async from(serial) {
98
- return new this(await crypto.subtle.importKey('spki', serial, algorithm, true, ['encrypt']));
105
+ return new this(await $mol_crypto_native.subtle.importKey('spki', serial, algorithm, true, ['encrypt']));
99
106
  }
100
107
  async serial() {
101
- return await crypto.subtle.exportKey('spki', this.native);
108
+ return await $mol_crypto_native.subtle.exportKey('spki', this.native);
102
109
  }
103
110
  async encrypt(data) {
104
- return await crypto.subtle.encrypt(algorithm, this.native, data);
111
+ return await $mol_crypto_native.subtle.encrypt(algorithm, this.native, data);
105
112
  }
106
113
  }
107
114
  $.$mol_crypto_cipher_public = $mol_crypto_cipher_public;
@@ -112,13 +119,13 @@ var $;
112
119
  this.native = native;
113
120
  }
114
121
  static async from(serial) {
115
- return new this(await crypto.subtle.importKey('pkcs8', serial, algorithm, true, ['decrypt']));
122
+ return new this(await $mol_crypto_native.subtle.importKey('pkcs8', serial, algorithm, true, ['decrypt']));
116
123
  }
117
124
  async serial() {
118
- return await crypto.subtle.exportKey('pkcs8', this.native);
125
+ return await $mol_crypto_native.subtle.exportKey('pkcs8', this.native);
119
126
  }
120
127
  async decrypt(data) {
121
- return await crypto.subtle.decrypt(algorithm, this.native, data);
128
+ return await $mol_crypto_native.subtle.decrypt(algorithm, this.native, data);
122
129
  }
123
130
  }
124
131
  $.$mol_crypto_cipher_private = $mol_crypto_cipher_private;
@@ -137,7 +144,7 @@ var $;
137
144
  saltLength: 8,
138
145
  };
139
146
  async function $mol_crypto_auditor_pair() {
140
- const pair = await $.crypto.subtle.generateKey(algorithm, true, ['sign', 'verify']);
147
+ const pair = await $mol_crypto_native.subtle.generateKey(algorithm, true, ['sign', 'verify']);
141
148
  return {
142
149
  public: new $mol_crypto_auditor_public(pair.publicKey),
143
150
  private: new $mol_crypto_auditor_private(pair.privateKey),
@@ -152,13 +159,13 @@ var $;
152
159
  this.native = native;
153
160
  }
154
161
  static async from(serial) {
155
- return new this(await crypto.subtle.importKey('spki', serial, algorithm, true, ['verify']));
162
+ return new this(await $mol_crypto_native.subtle.importKey('spki', serial, algorithm, true, ['verify']));
156
163
  }
157
164
  async serial() {
158
- return await crypto.subtle.exportKey('spki', this.native);
165
+ return await $mol_crypto_native.subtle.exportKey('spki', this.native);
159
166
  }
160
167
  async verify(data, sign) {
161
- return await crypto.subtle.verify(algorithm, this.native, sign, data);
168
+ return await $mol_crypto_native.subtle.verify(algorithm, this.native, sign, data);
162
169
  }
163
170
  }
164
171
  $.$mol_crypto_auditor_public = $mol_crypto_auditor_public;
@@ -170,13 +177,13 @@ var $;
170
177
  this.native = native;
171
178
  }
172
179
  static async from(serial) {
173
- return new this(await crypto.subtle.importKey('pkcs8', serial, algorithm, true, ['sign']));
180
+ return new this(await $mol_crypto_native.subtle.importKey('pkcs8', serial, algorithm, true, ['sign']));
174
181
  }
175
182
  async serial() {
176
- return await crypto.subtle.exportKey('pkcs8', this.native);
183
+ return await $mol_crypto_native.subtle.exportKey('pkcs8', this.native);
177
184
  }
178
185
  async sign(data) {
179
- return await crypto.subtle.sign(algorithm, this.native, data);
186
+ return await $mol_crypto_native.subtle.sign(algorithm, this.native, data);
180
187
  }
181
188
  }
182
189
  $.$mol_crypto_auditor_private = $mol_crypto_auditor_private;
@@ -260,7 +267,7 @@ var $;
260
267
  var $;
261
268
  (function ($) {
262
269
  function $mol_crypto_salt() {
263
- return crypto.getRandomValues(new Uint8Array(8));
270
+ return $mol_crypto_native.getRandomValues(new Uint8Array(12));
264
271
  }
265
272
  $.$mol_crypto_salt = $mol_crypto_salt;
266
273
  })($ || ($ = {}));
package/web.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../mam.jam.js","-","../../../../mam.ts","../../secret/mol/crypto/secret/secret.ts","../../cipher/mol/crypto/cipher/cipher.ts","../../auditor/mol/crypto/auditor/auditor.ts","../../hash/mol/crypto/hash/hash.ts","../../salt/mol/crypto/salt/salt.ts"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;AAMX,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADblB;AACA;AACA;;AEFA,IAAU,CAAC,CA8EV;AA9ED,WAAU,CAAC;IAEV,MAAM,SAAS,GAAG;QACjB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,EAAE;KACb,CAAA;IAGD,MAAa,kBAAmB,SAAQ,MAAM;QASnC;QANV,MAAM,CAAC,IAAI,GAAG,EAAE,CAAA;QAGhB,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;QAEhB,YACU,MAAuC;YAEhD,KAAK,EAAE,CAAA;YAFE,WAAM,GAAN,MAAM,CAAiC;QAGjD,CAAC;QAED,MAAM,CAAC,KAAK,CAAC,QAAQ;YACpB,OAAO,IAAI,IAAI,CACd,MAAM,MAAM,CAAC,MAAM,CAAC,WAAW,CAC9B,SAAS,EACT,IAAI,EACJ,CAAE,SAAS,EAAE,SAAS,CAAE,CACW,CACpC,CAAA;QACF,CAAC;QAED,MAAM,CAAC,KAAK,CAA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I,EAAE,CAAA;SAEb;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAG;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,KAAK,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,CAAA;SACtF;QAED,OAAO,IAAI,UAAU,CAAE,IAAI,CAAC,MAAM,CAAE,CAAA;IACrC,CAAC;IA3Fe,kBAAgB,mBA2F/B,CAAA;AAEF,CAAC,EAlGS,CAAC,KAAD,CAAC,QAkGV;;;;AClGD,IAAU,CAAC,CASV;AATD,WAAU,CAAC;IAGV,SAAgB,gBAAgB;QAC/B,OAAO,MAAM,CAAC,eAAe,CAC5B,IAAI,UAAU,CAAE,CAAC,CAAE,CACnB,CAAA;IACF,CAAC;IAJe,kBAAgB,mBAI/B,CAAA;AAEF,CAAC,EATS,CAAC,KAAD,CAAC,QASV;;","file":"web.js","sourcesContent":[null,null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'AES-GCM',\n\t\tlength: 128,\n\t\ttagLength: 32,\n\t}\n\t\n\t/** Symmetric cipher with shortest payload */\n\texport class $mol_crypto_secret extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 16\n\t\t\n\t\t/** Extra size in bytes to encrypted data. */\n\t\tstatic extra = 4\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async generate() {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.generateKey(\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'raw',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 16 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'raw',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\n\t\t/** 4 bytes + data length */\n\t\tasync encrypt( open: BufferSource, salt: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.encrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\topen\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( closed: BufferSource, salt : BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.decrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\tclosed\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'RSA-OAEP',\n\t\tmodulusLength: 1024,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t}\n\t\n\t/** Asymmetric cipher pair with shortest payload */\n\texport async function $mol_crypto_cipher_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $.crypto.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_cipher_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_cipher_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher public key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_public extends Object {\n\t\t\n\t\t/** Public key size in bytes. */\n\t\tstatic size = 162\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 162 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** max 86 bytes input, 128 bytes output */\n\t\tasync encrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.encrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher private key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_private extends Object {\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** ~640 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await crypto.subtle.decrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Encrypted size in bytes. */\n\texport const $mol_crypto_cipher_ecrypted_size = 128\n\n}\n","namespace $ {\n\n\t/** @FIXME Need polyfill for Safari (https://github.com/microsoft/MSR-JavaScript-Crypto/) */\n\tconst algorithm = {\n\t\tname: 'RSA-PSS',\n\t\tmodulusLength: 256,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t\tsaltLength: 8,\n\t}\n\t\n\t/** Asymmetric signing pair with shortest payload */\n\texport async function $mol_crypto_auditor_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $.crypto.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'sign', 'verify' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_auditor_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_auditor_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing public key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_public extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 62\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'verify' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 62 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync verify( data: BufferSource, sign: BufferSource ) {\n\t\t\treturn await crypto.subtle.verify(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tsign,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing private key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_private extends Object {\n\t\t\n\t\t/** Max key size in bytes. */\n\t\tstatic size = 200\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait crypto.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'sign' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 190-200 bytes */\n\t\tasync serial() {\n\t\t\treturn await crypto.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 32 bytes */\n\t\tasync sign( data: BufferSource ) {\n\t\t\t\n\t\t\treturn await crypto.subtle.sign(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata\n\t\t\t)\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Sign size in bytes. */\n\texport const $mol_crypto_auditor_sign_size = 32\n\t\n}\n","namespace $ {\n\t\n\tlet sponge = new Uint32Array(80)\n\t\n\t/** Fast small sync SHA-1 */\n\texport function $mol_crypto_hash( data: Uint8Array ) {\n\t\t\n\t\tconst bits = data.byteLength << 3\n\t\tconst kbits = bits >> 5\n\t\tconst kword = 0x80 << ( 24 - bits & 0b11111 )\n\t\t\n\t\tconst bytes = 16 + ( bits + 64 >>> 9 << 4 )\n\t\tconst klens = bytes - 1\n\t\tconst words = new Int32Array( data.buffer, data.byteOffset, data.byteLength >> 2 )\n\t\t\n\t\tlet tail = 0\n\t\tfor( let i = words.length * 4; i < data.length; ++i ) {\n\t\t\ttail |= data[i] << ( i << 3 & 0b11000 )\n\t\t}\n\t\t\n\t\t// Initial\n\t\tconst hash = new Int32Array([ 1732584193, -271733879, -1732584194, 271733878, -1009589776 ])\n\t\t\n\t\t// Digest\n\t\tfor( let i = 0; i < bytes; i += 16 ) {\n\t\t\t\n\t\t\tlet h0 = hash[0]\n\t\t\tlet h1 = hash[1]\n\t\t\tlet h2 = hash[2]\n\t\t\tlet h3 = hash[3]\n\t\t\tlet h4 = hash[4]\n\n\t\t\tfor( let j = 0; j < 80; ++j ) {\n\t\t\t\t\n\t\t\t\tlet turn\n\t\t\t\t\n\t\t\t\tif( j < 16 ) {\n\t\t\t\t\t\n\t\t\t\t\tconst k = i + j\n\t\t\t\t\tif( k === klens ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = bits\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet word =\n\t\t\t\t\t\t\tk === words.length ? tail :\n\t\t\t\t\t\t\tk > words.length ? 0 :\n\t\t\t\t\t\t\twords[k]\n\t\t\t\t\t\t\n\t\t\t\t\t\tword = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // LE -> BE\n\t\t\t\t\t\tif( k === kbits ) word |= kword\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = word\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tturn = ( h1 & h2 | ~h1 & h3 ) + 1518500249\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tconst shuffle = sponge[j-3] ^ sponge[j-8] ^ sponge[j-14] ^ sponge[j-16]\n\t\t\t\t\tsponge[j] = shuffle << 1 | shuffle >>> 31\n\t\t\t\t\t\n\t\t\t\t\tturn =\n\t\t\t\t\t\tj < 20 ? ( h1 & h2 | ~h1 & h3 ) + 1518500249 :\n\t\t\t\t\t\tj < 40 ? ( h1 ^ h2 ^ h3 ) + 1859775393 :\n\t\t\t\t\t\tj < 60 ? ( h1 & h2 | h1 & h3 | h2 & h3 ) - 1894007588 :\n\t\t\t\t\t\t( h1 ^ h2 ^ h3 ) - 899497514\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst next = turn + h4 + ( sponge[j] >>> 0 ) + (( h0 << 5 )|( h0 >>> 27 ))\n\n\t\t\t\th4 = h3\n\t\t\t\th3 = h2\n\t\t\t\th2 = ( h1 << 30 )|( h1 >>> 2 )\n\t\t\t\th1 = h0\n\t\t\t\th0 = next\n\t\t\t\t\n\t\t\t}\n\n\t\t\thash[0] += h0\n\t\t\thash[1] += h1\n\t\t\thash[2] += h2\n\t\t\thash[3] += h3\n\t\t\thash[4] += h4\n\t\t\t\n\t\t}\n\t\t\n\t\tfor( let i = 0; i < 20; ++i ) {\n\t\t\tconst word = hash[i]\n\t\t\thash[i] = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // BE -> LE\n\t\t}\n\n\t\treturn new Uint8Array( hash.buffer )\n\t}\n\t\n}\n","namespace $ {\n\t\n\t/** 8 byte */\n\texport function $mol_crypto_salt() {\n\t\treturn crypto.getRandomValues(\n\t\t\tnew Uint8Array( 8 )\n\t\t)\n\t}\n\t\n}\n"]}
1
+ {"version":3,"sources":["../../../../mam.jam.js","-","../../../../mam.ts","../../native/mol/crypto/native/native.web.ts","../../secret/mol/crypto/secret/secret.ts","../../cipher/mol/crypto/cipher/cipher.ts","../../auditor/mol/crypto/auditor/auditor.ts","../../hash/mol/crypto/hash/hash.ts","../../salt/mol/crypto/salt/salt.ts"],"names":[],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACZA;AACA;AACA;AACA;;ACHA,KAAK,CAAC,eAAe,GAAG,EAAE,CAAC;AAK3B,IAAU,CAAC,CAMV;AAND,WAAU,CAAC;AAMX,CAAC,EANS,CAAC,KAAD,CAAC,QAMV;AAED,MAAM,CAAC,OAAO,GAAG,CAAC,CAAA;;;ADblB;AACA;AACA;;AEFA,IAAU,CAAC,CAEV;AAFD,WAAU,CAAC;IACC,oBAAkB,GAAG,MAAM,CAAA;AACvC,CAAC,EAFS,CAAC,KAAD,CAAC,QAEV;;;;ACFD,IAAU,CAAC,CA8EV;AA9ED,WAAU,CAAC;IAEV,MAAM,SAAS,GAAG;QACjB,IAAI,EAAE,SAAS;QACf,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,EAAE;KACb,CAAA;IAGD,MAAa,kBAAmB,SAAQ,MAAM;QASnC;QANV,MAAM,CAAC,IAAI,GAAG,EAAE,CAAA;QAGhB,MAAM,CAAC,KAAK,GAAG,CAAC,CAAA;QAEhB,YACU,MAAuC;YAEhD,KAAK,EAAE,CAAA;YAFE,WAAM,GAAN,MAAM,CAAiC;QAGjD,CAAC;QA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,IAAI,CAAA;aAET;YAED,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YACb,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YACb,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YACb,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;YACb,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAA;SAEb;QAED,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,CAAC,EAAG;YAC7B,MAAM,IAAI,GAAG,IAAI,CAAC,CAAC,CAAC,CAAA;YACpB,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC,GAAG,QAAQ,GAAG,IAAI,KAAK,CAAC,GAAG,MAAM,GAAG,IAAI,KAAK,EAAE,GAAG,IAAI,CAAA;SACtF;QAED,OAAO,IAAI,UAAU,CAAE,IAAI,CAAC,MAAM,CAAE,CAAA;IACrC,CAAC;IA3Fe,kBAAgB,mBA2F/B,CAAA;AAEF,CAAC,EAlGS,CAAC,KAAD,CAAC,QAkGV;;;;AClGD,IAAU,CAAC,CASV;AATD,WAAU,CAAC;IAGV,SAAgB,gBAAgB;QAC/B,OAAO,kBAAkB,CAAC,eAAe,CACxC,IAAI,UAAU,CAAE,EAAE,CAAE,CACpB,CAAA;IACF,CAAC;IAJe,kBAAgB,mBAI/B,CAAA;AAEF,CAAC,EATS,CAAC,KAAD,CAAC,QASV;;","file":"web.js","sourcesContent":[null,null,"Error.stackTraceLimit = 50;\n\ndeclare let _$_: { new(): {} } & typeof globalThis\ndeclare class $ extends _$_ {}\n\nnamespace $ {\n\texport type $ = typeof $$\n\texport declare class $$ extends $ {}\n\tnamespace $$ {\n\t\texport type $$ = $\n\t}\n}\n\nmodule.exports = $\n","namespace $ {\n\texport var $mol_crypto_native = crypto\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'AES-GCM',\n\t\tlength: 128,\n\t\ttagLength: 32,\n\t}\n\t\n\t/** Symmetric cipher with shortest payload */\n\texport class $mol_crypto_secret extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 16\n\t\t\n\t\t/** Extra size in bytes to encrypted data. */\n\t\tstatic extra = 4\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async generate() {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.generateKey(\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'raw',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt', 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 16 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'raw',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\n\t\t/** 4 bytes + data length */\n\t\tasync encrypt( open: BufferSource, salt: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.encrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\topen\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( closed: BufferSource, salt : BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.decrypt(\n\t\t\t\t{\n\t\t\t\t\t... algorithm,\n\t\t\t\t\tiv: salt,\n\t\t\t\t},\n\t\t\t\tthis.native,\n\t\t\t\tclosed\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n}\n","namespace $ {\n\t\n\tconst algorithm = {\n\t\tname: 'RSA-OAEP',\n\t\tmodulusLength: 1024,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t}\n\t\n\t/** Asymmetric cipher pair with shortest payload */\n\texport async function $mol_crypto_cipher_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $mol_crypto_native.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'encrypt', 'decrypt' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_cipher_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_cipher_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher public key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_public extends Object {\n\t\t\n\t\t/** Public key size in bytes. */\n\t\tstatic size = 162\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'encrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 162 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** max 86 bytes input, 128 bytes output */\n\t\tasync encrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.encrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\n\t/** Asymmetric cipher private key wrapper with shortest payload */\n\texport class $mol_crypto_cipher_private extends Object {\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'decrypt' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** ~640 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync decrypt( data: BufferSource ): Promise< ArrayBuffer > {\n\t\t\treturn await $mol_crypto_native.subtle.decrypt(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Encrypted size in bytes. */\n\texport const $mol_crypto_cipher_ecrypted_size = 128\n\n}\n","namespace $ {\n\n\t/** @FIXME Need polyfill for Safari and Node (https://github.com/microsoft/MSR-JavaScript-Crypto/) */\n\tconst algorithm = {\n\t\tname: 'RSA-PSS',\n\t\tmodulusLength: 256,\n\t\tpublicExponent: new Uint8Array([ 1, 0, 1 ]),\n\t\thash: 'SHA-1',\n\t\tsaltLength: 8,\n\t}\n\t\n\t/** Asymmetric signing pair with shortest payload */\n\texport async function $mol_crypto_auditor_pair( this: $ ) {\n\t\t\n\t\tconst pair = await $mol_crypto_native.subtle.generateKey(\n\t\t\talgorithm,\n\t\t\ttrue,\n\t\t\t[ 'sign', 'verify' ]\n\t\t)\n\t\t\n\t\treturn {\n\t\t\t\n\t\t\tpublic: new $mol_crypto_auditor_public(\n\t\t\t\tpair.publicKey as CryptoKey & { type: 'public' }\n\t\t\t),\n\t\t\t\n\t\t\tprivate: new $mol_crypto_auditor_private(\n\t\t\t\tpair.privateKey as CryptoKey & { type: 'private' }\n\t\t\t),\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing public key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_public extends Object {\n\t\t\n\t\t/** Key size in bytes. */\n\t\tstatic size = 62\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'public' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'spki',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'verify' ],\n\t\t\t\t) as CryptoKey & { type: 'public' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 62 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'spki',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\tasync verify( data: BufferSource, sign: BufferSource ) {\n\t\t\treturn await $mol_crypto_native.subtle.verify(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tsign,\n\t\t\t\tdata,\n\t\t\t)\n\t\t}\n\t\t\n\t}\n\t\n\t/** Asymmetric signing private key wrapper with shortest payload */\n\texport class $mol_crypto_auditor_private extends Object {\n\t\t\n\t\t/** Max key size in bytes. */\n\t\tstatic size = 200\n\t\t\n\t\tconstructor(\n\t\t\treadonly native: CryptoKey & { type: 'private' }\n\t\t) {\n\t\t\tsuper()\n\t\t}\n\t\n\t\tstatic async from( serial: BufferSource ) {\n\t\t\treturn new this(\n\t\t\t\tawait $mol_crypto_native.subtle.importKey(\n\t\t\t\t\t'pkcs8',\n\t\t\t\t\tserial,\n\t\t\t\t\talgorithm,\n\t\t\t\t\ttrue,\n\t\t\t\t\t[ 'sign' ],\n\t\t\t\t) as CryptoKey & { type: 'private' }\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 190-200 bytes */\n\t\tasync serial() {\n\t\t\treturn await $mol_crypto_native.subtle.exportKey(\n\t\t\t\t'pkcs8',\n\t\t\t\tthis.native,\n\t\t\t)\n\t\t}\n\t\t\n\t\t/** 32 bytes */\n\t\tasync sign( data: BufferSource ) {\n\t\t\t\n\t\t\treturn await $mol_crypto_native.subtle.sign(\n\t\t\t\talgorithm,\n\t\t\t\tthis.native,\n\t\t\t\tdata\n\t\t\t)\n\t\t\t\n\t\t}\n\t\t\n\t}\n\t\n\t/** Sign size in bytes. */\n\texport const $mol_crypto_auditor_sign_size = 32\n\t\n}\n","namespace $ {\n\t\n\tlet sponge = new Uint32Array(80)\n\t\n\t/** Fast small sync SHA-1 */\n\texport function $mol_crypto_hash( data: Uint8Array ) {\n\t\t\n\t\tconst bits = data.byteLength << 3\n\t\tconst kbits = bits >> 5\n\t\tconst kword = 0x80 << ( 24 - bits & 0b11111 )\n\t\t\n\t\tconst bytes = 16 + ( bits + 64 >>> 9 << 4 )\n\t\tconst klens = bytes - 1\n\t\tconst words = new Int32Array( data.buffer, data.byteOffset, data.byteLength >> 2 )\n\t\t\n\t\tlet tail = 0\n\t\tfor( let i = words.length * 4; i < data.length; ++i ) {\n\t\t\ttail |= data[i] << ( i << 3 & 0b11000 )\n\t\t}\n\t\t\n\t\t// Initial\n\t\tconst hash = new Int32Array([ 1732584193, -271733879, -1732584194, 271733878, -1009589776 ])\n\t\t\n\t\t// Digest\n\t\tfor( let i = 0; i < bytes; i += 16 ) {\n\t\t\t\n\t\t\tlet h0 = hash[0]\n\t\t\tlet h1 = hash[1]\n\t\t\tlet h2 = hash[2]\n\t\t\tlet h3 = hash[3]\n\t\t\tlet h4 = hash[4]\n\n\t\t\tfor( let j = 0; j < 80; ++j ) {\n\t\t\t\t\n\t\t\t\tlet turn\n\t\t\t\t\n\t\t\t\tif( j < 16 ) {\n\t\t\t\t\t\n\t\t\t\t\tconst k = i + j\n\t\t\t\t\tif( k === klens ) {\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = bits\n\t\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\t\n\t\t\t\t\t\tlet word =\n\t\t\t\t\t\t\tk === words.length ? tail :\n\t\t\t\t\t\t\tk > words.length ? 0 :\n\t\t\t\t\t\t\twords[k]\n\t\t\t\t\t\t\n\t\t\t\t\t\tword = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // LE -> BE\n\t\t\t\t\t\tif( k === kbits ) word |= kword\n\t\t\t\t\t\t\n\t\t\t\t\t\tsponge[j] = word\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tturn = ( h1 & h2 | ~h1 & h3 ) + 1518500249\n\t\t\t\t\t\n\t\t\t\t} else {\n\t\t\t\t\t\n\t\t\t\t\tconst shuffle = sponge[j-3] ^ sponge[j-8] ^ sponge[j-14] ^ sponge[j-16]\n\t\t\t\t\tsponge[j] = shuffle << 1 | shuffle >>> 31\n\t\t\t\t\t\n\t\t\t\t\tturn =\n\t\t\t\t\t\tj < 20 ? ( h1 & h2 | ~h1 & h3 ) + 1518500249 :\n\t\t\t\t\t\tj < 40 ? ( h1 ^ h2 ^ h3 ) + 1859775393 :\n\t\t\t\t\t\tj < 60 ? ( h1 & h2 | h1 & h3 | h2 & h3 ) - 1894007588 :\n\t\t\t\t\t\t( h1 ^ h2 ^ h3 ) - 899497514\n\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tconst next = turn + h4 + ( sponge[j] >>> 0 ) + (( h0 << 5 )|( h0 >>> 27 ))\n\n\t\t\t\th4 = h3\n\t\t\t\th3 = h2\n\t\t\t\th2 = ( h1 << 30 )|( h1 >>> 2 )\n\t\t\t\th1 = h0\n\t\t\t\th0 = next\n\t\t\t\t\n\t\t\t}\n\n\t\t\thash[0] += h0\n\t\t\thash[1] += h1\n\t\t\thash[2] += h2\n\t\t\thash[3] += h3\n\t\t\thash[4] += h4\n\t\t\t\n\t\t}\n\t\t\n\t\tfor( let i = 0; i < 20; ++i ) {\n\t\t\tconst word = hash[i]\n\t\t\thash[i] = word << 24 | word << 8 & 0xFF0000 | word >>> 8 & 0xFF00 | word >>> 24 & 0xFF // BE -> LE\n\t\t}\n\n\t\treturn new Uint8Array( hash.buffer )\n\t}\n\t\n}\n","namespace $ {\n\t\n\t/** 8 byte */\n\texport function $mol_crypto_salt() {\n\t\treturn $mol_crypto_native.getRandomValues(\n\t\t\tnew Uint8Array( 12 )\n\t\t)\n\t}\n\t\n}\n"]}
package/web.test.js CHANGED
@@ -61,12 +61,8 @@ var $;
61
61
  scheduled = true;
62
62
  setTimeout(async () => {
63
63
  scheduled = false;
64
- try {
65
- await $mol_test_run();
66
- }
67
- finally {
68
- $$.$mol_test_complete();
69
- }
64
+ await $mol_test_run();
65
+ $$.$mol_test_complete();
70
66
  }, 0);
71
67
  }
72
68
  $_1.$mol_test_schedule = $mol_test_schedule;
@@ -990,7 +986,7 @@ var $;
990
986
  },
991
987
  });
992
988
  })($ || ($ = {}));
993
- //mol/crypto/auditor/auditor.test.ts
989
+ //mol/crypto/auditor/auditor.web.test.ts
994
990
  ;
995
991
  "use strict";
996
992
  var $;