@waku/rln 0.1.5-cad3e7a.0 → 0.1.5-d17562d.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (168) hide show
  1. package/bundle/index.js +4 -3
  2. package/bundle/packages/rln/dist/contract/constants.js +2 -1
  3. package/bundle/packages/rln/dist/contract/{rln_light_contract.js → rln_base_contract.js} +191 -186
  4. package/bundle/packages/rln/dist/contract/rln_contract.js +10 -420
  5. package/bundle/packages/rln/dist/contract/types.js +9 -0
  6. package/bundle/packages/rln/dist/create.js +1 -1
  7. package/bundle/packages/rln/dist/{rln_light.js → credentials_manager.js} +114 -48
  8. package/bundle/packages/rln/dist/identity.js +0 -9
  9. package/bundle/packages/rln/dist/keystore/keystore.js +31 -17
  10. package/bundle/packages/rln/dist/rln.js +57 -167
  11. package/bundle/packages/rln/dist/utils/bytes.js +8 -2
  12. package/bundle/packages/rln/dist/utils/metamask.js +2 -2
  13. package/bundle/packages/rln/dist/zerokit.js +5 -5
  14. package/dist/.tsbuildinfo +1 -1
  15. package/dist/contract/constants.d.ts +1 -1
  16. package/dist/contract/constants.js +1 -1
  17. package/dist/contract/constants.js.map +1 -1
  18. package/dist/contract/index.d.ts +1 -0
  19. package/dist/contract/index.js +1 -0
  20. package/dist/contract/index.js.map +1 -1
  21. package/dist/contract/{rln_light_contract.d.ts → rln_base_contract.d.ts} +24 -58
  22. package/dist/contract/{rln_light_contract.js → rln_base_contract.js} +189 -184
  23. package/dist/contract/rln_base_contract.js.map +1 -0
  24. package/dist/contract/rln_contract.d.ts +5 -122
  25. package/dist/contract/rln_contract.js +8 -417
  26. package/dist/contract/rln_contract.js.map +1 -1
  27. package/dist/contract/types.d.ts +45 -0
  28. package/dist/contract/types.js +8 -0
  29. package/dist/contract/types.js.map +1 -0
  30. package/dist/create.js +1 -1
  31. package/dist/create.js.map +1 -1
  32. package/dist/credentials_manager.d.ts +44 -0
  33. package/dist/credentials_manager.js +197 -0
  34. package/dist/credentials_manager.js.map +1 -0
  35. package/dist/identity.d.ts +0 -1
  36. package/dist/identity.js +0 -9
  37. package/dist/identity.js.map +1 -1
  38. package/dist/index.d.ts +5 -4
  39. package/dist/index.js +4 -3
  40. package/dist/index.js.map +1 -1
  41. package/dist/keystore/keystore.d.ts +1 -0
  42. package/dist/keystore/keystore.js +31 -17
  43. package/dist/keystore/keystore.js.map +1 -1
  44. package/dist/keystore/types.d.ts +3 -3
  45. package/dist/rln.d.ts +9 -52
  46. package/dist/rln.js +55 -164
  47. package/dist/rln.js.map +1 -1
  48. package/dist/types.d.ts +27 -0
  49. package/dist/types.js +2 -0
  50. package/dist/types.js.map +1 -0
  51. package/dist/utils/bytes.js +8 -2
  52. package/dist/utils/bytes.js.map +1 -1
  53. package/dist/zerokit.d.ts +3 -3
  54. package/dist/zerokit.js +5 -5
  55. package/dist/zerokit.js.map +1 -1
  56. package/package.json +1 -1
  57. package/src/contract/constants.ts +1 -1
  58. package/src/contract/index.ts +1 -0
  59. package/src/contract/{rln_light_contract.ts → rln_base_contract.ts} +308 -323
  60. package/src/contract/rln_contract.ts +9 -663
  61. package/src/contract/types.ts +53 -0
  62. package/src/create.ts +1 -1
  63. package/src/credentials_manager.ts +282 -0
  64. package/src/identity.ts +0 -10
  65. package/src/index.ts +7 -5
  66. package/src/keystore/keystore.ts +57 -31
  67. package/src/keystore/types.ts +3 -3
  68. package/src/rln.ts +68 -259
  69. package/src/types.ts +31 -0
  70. package/src/utils/bytes.ts +10 -2
  71. package/src/zerokit.ts +3 -3
  72. package/bundle/_virtual/__node-resolve_empty.js +0 -6
  73. package/bundle/_virtual/_node-resolve_empty.js +0 -3
  74. package/bundle/_virtual/bn.js +0 -3
  75. package/bundle/_virtual/common.js +0 -3
  76. package/bundle/_virtual/common2.js +0 -3
  77. package/bundle/_virtual/hash.js +0 -3
  78. package/bundle/_virtual/inherits_browser.js +0 -3
  79. package/bundle/_virtual/ripemd.js +0 -3
  80. package/bundle/_virtual/sha.js +0 -3
  81. package/bundle/_virtual/sha3.js +0 -3
  82. package/bundle/_virtual/utils3.js +0 -3
  83. package/bundle/node_modules/@ethersproject/abi/lib.esm/_version.js +0 -3
  84. package/bundle/node_modules/@ethersproject/abi/lib.esm/abi-coder.js +0 -96
  85. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/abstract-coder.js +0 -148
  86. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/address.js +0 -26
  87. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/anonymous.js +0 -20
  88. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/array.js +0 -210
  89. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/boolean.js +0 -18
  90. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/bytes.js +0 -30
  91. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/fixed-bytes.js +0 -26
  92. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/null.js +0 -22
  93. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/number.js +0 -43
  94. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/string.js +0 -19
  95. package/bundle/node_modules/@ethersproject/abi/lib.esm/coders/tuple.js +0 -58
  96. package/bundle/node_modules/@ethersproject/abi/lib.esm/fragments.js +0 -854
  97. package/bundle/node_modules/@ethersproject/abi/lib.esm/interface.js +0 -609
  98. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/_version.js +0 -3
  99. package/bundle/node_modules/@ethersproject/abstract-provider/lib.esm/index.js +0 -66
  100. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/_version.js +0 -3
  101. package/bundle/node_modules/@ethersproject/abstract-signer/lib.esm/index.js +0 -302
  102. package/bundle/node_modules/@ethersproject/address/lib.esm/_version.js +0 -3
  103. package/bundle/node_modules/@ethersproject/address/lib.esm/index.js +0 -110
  104. package/bundle/node_modules/@ethersproject/base64/lib.esm/base64.js +0 -20
  105. package/bundle/node_modules/@ethersproject/basex/lib.esm/index.js +0 -120
  106. package/bundle/node_modules/@ethersproject/bignumber/lib.esm/_version.js +0 -3
  107. package/bundle/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js +0 -287
  108. package/bundle/node_modules/@ethersproject/bytes/lib.esm/_version.js +0 -3
  109. package/bundle/node_modules/@ethersproject/bytes/lib.esm/index.js +0 -402
  110. package/bundle/node_modules/@ethersproject/constants/lib.esm/addresses.js +0 -3
  111. package/bundle/node_modules/@ethersproject/constants/lib.esm/bignumbers.js +0 -8
  112. package/bundle/node_modules/@ethersproject/constants/lib.esm/hashes.js +0 -3
  113. package/bundle/node_modules/@ethersproject/contracts/lib.esm/_version.js +0 -3
  114. package/bundle/node_modules/@ethersproject/contracts/lib.esm/index.js +0 -893
  115. package/bundle/node_modules/@ethersproject/hash/lib.esm/_version.js +0 -3
  116. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/decoder.js +0 -256
  117. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/include.js +0 -36
  118. package/bundle/node_modules/@ethersproject/hash/lib.esm/ens-normalize/lib.js +0 -135
  119. package/bundle/node_modules/@ethersproject/hash/lib.esm/id.js +0 -8
  120. package/bundle/node_modules/@ethersproject/hash/lib.esm/namehash.js +0 -64
  121. package/bundle/node_modules/@ethersproject/hash/lib.esm/typed-data.js +0 -443
  122. package/bundle/node_modules/@ethersproject/keccak256/lib.esm/index.js +0 -8
  123. package/bundle/node_modules/@ethersproject/keccak256/node_modules/js-sha3/src/sha3.js +0 -660
  124. package/bundle/node_modules/@ethersproject/logger/lib.esm/_version.js +0 -3
  125. package/bundle/node_modules/@ethersproject/logger/lib.esm/index.js +0 -352
  126. package/bundle/node_modules/@ethersproject/networks/lib.esm/_version.js +0 -3
  127. package/bundle/node_modules/@ethersproject/networks/lib.esm/index.js +0 -248
  128. package/bundle/node_modules/@ethersproject/properties/lib.esm/_version.js +0 -3
  129. package/bundle/node_modules/@ethersproject/properties/lib.esm/index.js +0 -127
  130. package/bundle/node_modules/@ethersproject/providers/lib.esm/_version.js +0 -3
  131. package/bundle/node_modules/@ethersproject/providers/lib.esm/base-provider.js +0 -2007
  132. package/bundle/node_modules/@ethersproject/providers/lib.esm/formatter.js +0 -422
  133. package/bundle/node_modules/@ethersproject/providers/lib.esm/json-rpc-provider.js +0 -674
  134. package/bundle/node_modules/@ethersproject/providers/lib.esm/web3-provider.js +0 -132
  135. package/bundle/node_modules/@ethersproject/rlp/lib.esm/_version.js +0 -3
  136. package/bundle/node_modules/@ethersproject/rlp/lib.esm/index.js +0 -120
  137. package/bundle/node_modules/@ethersproject/sha2/lib.esm/sha2.js +0 -8
  138. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/_version.js +0 -3
  139. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/elliptic.js +0 -2430
  140. package/bundle/node_modules/@ethersproject/signing-key/lib.esm/index.js +0 -76
  141. package/bundle/node_modules/@ethersproject/strings/lib.esm/_version.js +0 -3
  142. package/bundle/node_modules/@ethersproject/strings/lib.esm/utf8.js +0 -219
  143. package/bundle/node_modules/@ethersproject/transactions/lib.esm/_version.js +0 -3
  144. package/bundle/node_modules/@ethersproject/transactions/lib.esm/index.js +0 -279
  145. package/bundle/node_modules/@ethersproject/web/lib.esm/_version.js +0 -3
  146. package/bundle/node_modules/@ethersproject/web/lib.esm/geturl.js +0 -69
  147. package/bundle/node_modules/@ethersproject/web/lib.esm/index.js +0 -404
  148. package/bundle/node_modules/bech32/index.js +0 -187
  149. package/bundle/node_modules/bn.js/lib/bn.js +0 -3361
  150. package/bundle/node_modules/hash.js/lib/hash/common.js +0 -97
  151. package/bundle/node_modules/hash.js/lib/hash/hmac.js +0 -51
  152. package/bundle/node_modules/hash.js/lib/hash/ripemd.js +0 -152
  153. package/bundle/node_modules/hash.js/lib/hash/sha/1.js +0 -81
  154. package/bundle/node_modules/hash.js/lib/hash/sha/224.js +0 -33
  155. package/bundle/node_modules/hash.js/lib/hash/sha/256.js +0 -113
  156. package/bundle/node_modules/hash.js/lib/hash/sha/384.js +0 -39
  157. package/bundle/node_modules/hash.js/lib/hash/sha/512.js +0 -336
  158. package/bundle/node_modules/hash.js/lib/hash/sha/common.js +0 -53
  159. package/bundle/node_modules/hash.js/lib/hash/sha.js +0 -14
  160. package/bundle/node_modules/hash.js/lib/hash/utils.js +0 -282
  161. package/bundle/node_modules/hash.js/lib/hash.js +0 -33
  162. package/bundle/node_modules/inherits/inherits_browser.js +0 -33
  163. package/bundle/node_modules/minimalistic-assert/index.js +0 -13
  164. package/dist/contract/rln_light_contract.js.map +0 -1
  165. package/dist/rln_light.d.ts +0 -64
  166. package/dist/rln_light.js +0 -144
  167. package/dist/rln_light.js.map +0 -1
  168. package/src/rln_light.ts +0 -235
@@ -1,97 +0,0 @@
1
- import { __exports as common } from '../../../../_virtual/common.js';
2
- import './utils.js';
3
- import { m as minimalisticAssert } from '../../../minimalistic-assert/index.js';
4
- import { __exports as utils$1 } from '../../../../_virtual/utils3.js';
5
-
6
- var utils = utils$1;
7
- var assert = minimalisticAssert;
8
-
9
- function BlockHash() {
10
- this.pending = null;
11
- this.pendingTotal = 0;
12
- this.blockSize = this.constructor.blockSize;
13
- this.outSize = this.constructor.outSize;
14
- this.hmacStrength = this.constructor.hmacStrength;
15
- this.padLength = this.constructor.padLength / 8;
16
- this.endian = 'big';
17
-
18
- this._delta8 = this.blockSize / 8;
19
- this._delta32 = this.blockSize / 32;
20
- }
21
- common.BlockHash = BlockHash;
22
-
23
- BlockHash.prototype.update = function update(msg, enc) {
24
- // Convert message to array, pad it, and join into 32bit blocks
25
- msg = utils.toArray(msg, enc);
26
- if (!this.pending)
27
- this.pending = msg;
28
- else
29
- this.pending = this.pending.concat(msg);
30
- this.pendingTotal += msg.length;
31
-
32
- // Enough data, try updating
33
- if (this.pending.length >= this._delta8) {
34
- msg = this.pending;
35
-
36
- // Process pending data in blocks
37
- var r = msg.length % this._delta8;
38
- this.pending = msg.slice(msg.length - r, msg.length);
39
- if (this.pending.length === 0)
40
- this.pending = null;
41
-
42
- msg = utils.join32(msg, 0, msg.length - r, this.endian);
43
- for (var i = 0; i < msg.length; i += this._delta32)
44
- this._update(msg, i, i + this._delta32);
45
- }
46
-
47
- return this;
48
- };
49
-
50
- BlockHash.prototype.digest = function digest(enc) {
51
- this.update(this._pad());
52
- assert(this.pending === null);
53
-
54
- return this._digest(enc);
55
- };
56
-
57
- BlockHash.prototype._pad = function pad() {
58
- var len = this.pendingTotal;
59
- var bytes = this._delta8;
60
- var k = bytes - ((len + this.padLength) % bytes);
61
- var res = new Array(k + this.padLength);
62
- res[0] = 0x80;
63
- for (var i = 1; i < k; i++)
64
- res[i] = 0;
65
-
66
- // Append length
67
- len <<= 3;
68
- if (this.endian === 'big') {
69
- for (var t = 8; t < this.padLength; t++)
70
- res[i++] = 0;
71
-
72
- res[i++] = 0;
73
- res[i++] = 0;
74
- res[i++] = 0;
75
- res[i++] = 0;
76
- res[i++] = (len >>> 24) & 0xff;
77
- res[i++] = (len >>> 16) & 0xff;
78
- res[i++] = (len >>> 8) & 0xff;
79
- res[i++] = len & 0xff;
80
- } else {
81
- res[i++] = len & 0xff;
82
- res[i++] = (len >>> 8) & 0xff;
83
- res[i++] = (len >>> 16) & 0xff;
84
- res[i++] = (len >>> 24) & 0xff;
85
- res[i++] = 0;
86
- res[i++] = 0;
87
- res[i++] = 0;
88
- res[i++] = 0;
89
-
90
- for (t = 8; t < this.padLength; t++)
91
- res[i++] = 0;
92
- }
93
-
94
- return res;
95
- };
96
-
97
- export { common as default };
@@ -1,51 +0,0 @@
1
- import './utils.js';
2
- import { m as minimalisticAssert } from '../../../minimalistic-assert/index.js';
3
- import { __exports as utils$1 } from '../../../../_virtual/utils3.js';
4
-
5
- var utils = utils$1;
6
- var assert = minimalisticAssert;
7
-
8
- function Hmac(hash, key, enc) {
9
- if (!(this instanceof Hmac))
10
- return new Hmac(hash, key, enc);
11
- this.Hash = hash;
12
- this.blockSize = hash.blockSize / 8;
13
- this.outSize = hash.outSize / 8;
14
- this.inner = null;
15
- this.outer = null;
16
-
17
- this._init(utils.toArray(key, enc));
18
- }
19
- var hmac = Hmac;
20
-
21
- Hmac.prototype._init = function init(key) {
22
- // Shorten key, if needed
23
- if (key.length > this.blockSize)
24
- key = new this.Hash().update(key).digest();
25
- assert(key.length <= this.blockSize);
26
-
27
- // Add padding to key
28
- for (var i = key.length; i < this.blockSize; i++)
29
- key.push(0);
30
-
31
- for (i = 0; i < key.length; i++)
32
- key[i] ^= 0x36;
33
- this.inner = new this.Hash().update(key);
34
-
35
- // 0x36 ^ 0x5c = 0x6a
36
- for (i = 0; i < key.length; i++)
37
- key[i] ^= 0x6a;
38
- this.outer = new this.Hash().update(key);
39
- };
40
-
41
- Hmac.prototype.update = function update(msg, enc) {
42
- this.inner.update(msg, enc);
43
- return this;
44
- };
45
-
46
- Hmac.prototype.digest = function digest(enc) {
47
- this.outer.update(this.inner.digest());
48
- return this.outer.digest(enc);
49
- };
50
-
51
- export { hmac as h };
@@ -1,152 +0,0 @@
1
- import { __exports as ripemd } from '../../../../_virtual/ripemd.js';
2
- import './utils.js';
3
- import './common.js';
4
- import { __exports as utils$1 } from '../../../../_virtual/utils3.js';
5
- import { __exports as common$1 } from '../../../../_virtual/common.js';
6
-
7
- var utils = utils$1;
8
- var common = common$1;
9
-
10
- var rotl32 = utils.rotl32;
11
- var sum32 = utils.sum32;
12
- var sum32_3 = utils.sum32_3;
13
- var sum32_4 = utils.sum32_4;
14
- var BlockHash = common.BlockHash;
15
-
16
- function RIPEMD160() {
17
- if (!(this instanceof RIPEMD160))
18
- return new RIPEMD160();
19
-
20
- BlockHash.call(this);
21
-
22
- this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ];
23
- this.endian = 'little';
24
- }
25
- utils.inherits(RIPEMD160, BlockHash);
26
- ripemd.ripemd160 = RIPEMD160;
27
-
28
- RIPEMD160.blockSize = 512;
29
- RIPEMD160.outSize = 160;
30
- RIPEMD160.hmacStrength = 192;
31
- RIPEMD160.padLength = 64;
32
-
33
- RIPEMD160.prototype._update = function update(msg, start) {
34
- var A = this.h[0];
35
- var B = this.h[1];
36
- var C = this.h[2];
37
- var D = this.h[3];
38
- var E = this.h[4];
39
- var Ah = A;
40
- var Bh = B;
41
- var Ch = C;
42
- var Dh = D;
43
- var Eh = E;
44
- for (var j = 0; j < 80; j++) {
45
- var T = sum32(
46
- rotl32(
47
- sum32_4(A, f(j, B, C, D), msg[r[j] + start], K(j)),
48
- s[j]),
49
- E);
50
- A = E;
51
- E = D;
52
- D = rotl32(C, 10);
53
- C = B;
54
- B = T;
55
- T = sum32(
56
- rotl32(
57
- sum32_4(Ah, f(79 - j, Bh, Ch, Dh), msg[rh[j] + start], Kh(j)),
58
- sh[j]),
59
- Eh);
60
- Ah = Eh;
61
- Eh = Dh;
62
- Dh = rotl32(Ch, 10);
63
- Ch = Bh;
64
- Bh = T;
65
- }
66
- T = sum32_3(this.h[1], C, Dh);
67
- this.h[1] = sum32_3(this.h[2], D, Eh);
68
- this.h[2] = sum32_3(this.h[3], E, Ah);
69
- this.h[3] = sum32_3(this.h[4], A, Bh);
70
- this.h[4] = sum32_3(this.h[0], B, Ch);
71
- this.h[0] = T;
72
- };
73
-
74
- RIPEMD160.prototype._digest = function digest(enc) {
75
- if (enc === 'hex')
76
- return utils.toHex32(this.h, 'little');
77
- else
78
- return utils.split32(this.h, 'little');
79
- };
80
-
81
- function f(j, x, y, z) {
82
- if (j <= 15)
83
- return x ^ y ^ z;
84
- else if (j <= 31)
85
- return (x & y) | ((~x) & z);
86
- else if (j <= 47)
87
- return (x | (~y)) ^ z;
88
- else if (j <= 63)
89
- return (x & z) | (y & (~z));
90
- else
91
- return x ^ (y | (~z));
92
- }
93
-
94
- function K(j) {
95
- if (j <= 15)
96
- return 0x00000000;
97
- else if (j <= 31)
98
- return 0x5a827999;
99
- else if (j <= 47)
100
- return 0x6ed9eba1;
101
- else if (j <= 63)
102
- return 0x8f1bbcdc;
103
- else
104
- return 0xa953fd4e;
105
- }
106
-
107
- function Kh(j) {
108
- if (j <= 15)
109
- return 0x50a28be6;
110
- else if (j <= 31)
111
- return 0x5c4dd124;
112
- else if (j <= 47)
113
- return 0x6d703ef3;
114
- else if (j <= 63)
115
- return 0x7a6d76e9;
116
- else
117
- return 0x00000000;
118
- }
119
-
120
- var r = [
121
- 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15,
122
- 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8,
123
- 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12,
124
- 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2,
125
- 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13
126
- ];
127
-
128
- var rh = [
129
- 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12,
130
- 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2,
131
- 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13,
132
- 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14,
133
- 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11
134
- ];
135
-
136
- var s = [
137
- 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8,
138
- 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12,
139
- 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5,
140
- 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12,
141
- 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6
142
- ];
143
-
144
- var sh = [
145
- 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6,
146
- 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11,
147
- 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5,
148
- 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8,
149
- 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11
150
- ];
151
-
152
- export { ripemd as default };
@@ -1,81 +0,0 @@
1
- import '../utils.js';
2
- import '../common.js';
3
- import './common.js';
4
- import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
5
- import { __exports as common$1 } from '../../../../../_virtual/common.js';
6
- import { __exports as common$2 } from '../../../../../_virtual/common2.js';
7
-
8
- var utils = utils$1;
9
- var common = common$1;
10
- var shaCommon = common$2;
11
-
12
- var rotl32 = utils.rotl32;
13
- var sum32 = utils.sum32;
14
- var sum32_5 = utils.sum32_5;
15
- var ft_1 = shaCommon.ft_1;
16
- var BlockHash = common.BlockHash;
17
-
18
- var sha1_K = [
19
- 0x5A827999, 0x6ED9EBA1,
20
- 0x8F1BBCDC, 0xCA62C1D6
21
- ];
22
-
23
- function SHA1() {
24
- if (!(this instanceof SHA1))
25
- return new SHA1();
26
-
27
- BlockHash.call(this);
28
- this.h = [
29
- 0x67452301, 0xefcdab89, 0x98badcfe,
30
- 0x10325476, 0xc3d2e1f0 ];
31
- this.W = new Array(80);
32
- }
33
-
34
- utils.inherits(SHA1, BlockHash);
35
- var _1 = SHA1;
36
-
37
- SHA1.blockSize = 512;
38
- SHA1.outSize = 160;
39
- SHA1.hmacStrength = 80;
40
- SHA1.padLength = 64;
41
-
42
- SHA1.prototype._update = function _update(msg, start) {
43
- var W = this.W;
44
-
45
- for (var i = 0; i < 16; i++)
46
- W[i] = msg[start + i];
47
-
48
- for(; i < W.length; i++)
49
- W[i] = rotl32(W[i - 3] ^ W[i - 8] ^ W[i - 14] ^ W[i - 16], 1);
50
-
51
- var a = this.h[0];
52
- var b = this.h[1];
53
- var c = this.h[2];
54
- var d = this.h[3];
55
- var e = this.h[4];
56
-
57
- for (i = 0; i < W.length; i++) {
58
- var s = ~~(i / 20);
59
- var t = sum32_5(rotl32(a, 5), ft_1(s, b, c, d), e, W[i], sha1_K[s]);
60
- e = d;
61
- d = c;
62
- c = rotl32(b, 30);
63
- b = a;
64
- a = t;
65
- }
66
-
67
- this.h[0] = sum32(this.h[0], a);
68
- this.h[1] = sum32(this.h[1], b);
69
- this.h[2] = sum32(this.h[2], c);
70
- this.h[3] = sum32(this.h[3], d);
71
- this.h[4] = sum32(this.h[4], e);
72
- };
73
-
74
- SHA1.prototype._digest = function digest(enc) {
75
- if (enc === 'hex')
76
- return utils.toHex32(this.h, 'big');
77
- else
78
- return utils.split32(this.h, 'big');
79
- };
80
-
81
- export { _1 as _ };
@@ -1,33 +0,0 @@
1
- import '../utils.js';
2
- import { _ as _256 } from './256.js';
3
- import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
4
-
5
- var utils = utils$1;
6
- var SHA256 = _256;
7
-
8
- function SHA224() {
9
- if (!(this instanceof SHA224))
10
- return new SHA224();
11
-
12
- SHA256.call(this);
13
- this.h = [
14
- 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939,
15
- 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ];
16
- }
17
- utils.inherits(SHA224, SHA256);
18
- var _224 = SHA224;
19
-
20
- SHA224.blockSize = 512;
21
- SHA224.outSize = 224;
22
- SHA224.hmacStrength = 192;
23
- SHA224.padLength = 64;
24
-
25
- SHA224.prototype._digest = function digest(enc) {
26
- // Just truncate output
27
- if (enc === 'hex')
28
- return utils.toHex32(this.h.slice(0, 7), 'big');
29
- else
30
- return utils.split32(this.h.slice(0, 7), 'big');
31
- };
32
-
33
- export { _224 as _ };
@@ -1,113 +0,0 @@
1
- import '../utils.js';
2
- import '../common.js';
3
- import './common.js';
4
- import { m as minimalisticAssert } from '../../../../minimalistic-assert/index.js';
5
- import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
6
- import { __exports as common$1 } from '../../../../../_virtual/common.js';
7
- import { __exports as common$2 } from '../../../../../_virtual/common2.js';
8
-
9
- var utils = utils$1;
10
- var common = common$1;
11
- var shaCommon = common$2;
12
- var assert = minimalisticAssert;
13
-
14
- var sum32 = utils.sum32;
15
- var sum32_4 = utils.sum32_4;
16
- var sum32_5 = utils.sum32_5;
17
- var ch32 = shaCommon.ch32;
18
- var maj32 = shaCommon.maj32;
19
- var s0_256 = shaCommon.s0_256;
20
- var s1_256 = shaCommon.s1_256;
21
- var g0_256 = shaCommon.g0_256;
22
- var g1_256 = shaCommon.g1_256;
23
-
24
- var BlockHash = common.BlockHash;
25
-
26
- var sha256_K = [
27
- 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5,
28
- 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5,
29
- 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3,
30
- 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174,
31
- 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc,
32
- 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da,
33
- 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7,
34
- 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967,
35
- 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13,
36
- 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85,
37
- 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3,
38
- 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070,
39
- 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5,
40
- 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3,
41
- 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208,
42
- 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2
43
- ];
44
-
45
- function SHA256() {
46
- if (!(this instanceof SHA256))
47
- return new SHA256();
48
-
49
- BlockHash.call(this);
50
- this.h = [
51
- 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a,
52
- 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19
53
- ];
54
- this.k = sha256_K;
55
- this.W = new Array(64);
56
- }
57
- utils.inherits(SHA256, BlockHash);
58
- var _256 = SHA256;
59
-
60
- SHA256.blockSize = 512;
61
- SHA256.outSize = 256;
62
- SHA256.hmacStrength = 192;
63
- SHA256.padLength = 64;
64
-
65
- SHA256.prototype._update = function _update(msg, start) {
66
- var W = this.W;
67
-
68
- for (var i = 0; i < 16; i++)
69
- W[i] = msg[start + i];
70
- for (; i < W.length; i++)
71
- W[i] = sum32_4(g1_256(W[i - 2]), W[i - 7], g0_256(W[i - 15]), W[i - 16]);
72
-
73
- var a = this.h[0];
74
- var b = this.h[1];
75
- var c = this.h[2];
76
- var d = this.h[3];
77
- var e = this.h[4];
78
- var f = this.h[5];
79
- var g = this.h[6];
80
- var h = this.h[7];
81
-
82
- assert(this.k.length === W.length);
83
- for (i = 0; i < W.length; i++) {
84
- var T1 = sum32_5(h, s1_256(e), ch32(e, f, g), this.k[i], W[i]);
85
- var T2 = sum32(s0_256(a), maj32(a, b, c));
86
- h = g;
87
- g = f;
88
- f = e;
89
- e = sum32(d, T1);
90
- d = c;
91
- c = b;
92
- b = a;
93
- a = sum32(T1, T2);
94
- }
95
-
96
- this.h[0] = sum32(this.h[0], a);
97
- this.h[1] = sum32(this.h[1], b);
98
- this.h[2] = sum32(this.h[2], c);
99
- this.h[3] = sum32(this.h[3], d);
100
- this.h[4] = sum32(this.h[4], e);
101
- this.h[5] = sum32(this.h[5], f);
102
- this.h[6] = sum32(this.h[6], g);
103
- this.h[7] = sum32(this.h[7], h);
104
- };
105
-
106
- SHA256.prototype._digest = function digest(enc) {
107
- if (enc === 'hex')
108
- return utils.toHex32(this.h, 'big');
109
- else
110
- return utils.split32(this.h, 'big');
111
- };
112
-
113
- export { _256 as _ };
@@ -1,39 +0,0 @@
1
- import '../utils.js';
2
- import { _ as _512 } from './512.js';
3
- import { __exports as utils$1 } from '../../../../../_virtual/utils3.js';
4
-
5
- var utils = utils$1;
6
-
7
- var SHA512 = _512;
8
-
9
- function SHA384() {
10
- if (!(this instanceof SHA384))
11
- return new SHA384();
12
-
13
- SHA512.call(this);
14
- this.h = [
15
- 0xcbbb9d5d, 0xc1059ed8,
16
- 0x629a292a, 0x367cd507,
17
- 0x9159015a, 0x3070dd17,
18
- 0x152fecd8, 0xf70e5939,
19
- 0x67332667, 0xffc00b31,
20
- 0x8eb44a87, 0x68581511,
21
- 0xdb0c2e0d, 0x64f98fa7,
22
- 0x47b5481d, 0xbefa4fa4 ];
23
- }
24
- utils.inherits(SHA384, SHA512);
25
- var _384 = SHA384;
26
-
27
- SHA384.blockSize = 1024;
28
- SHA384.outSize = 384;
29
- SHA384.hmacStrength = 192;
30
- SHA384.padLength = 128;
31
-
32
- SHA384.prototype._digest = function digest(enc) {
33
- if (enc === 'hex')
34
- return utils.toHex32(this.h.slice(0, 12), 'big');
35
- else
36
- return utils.split32(this.h.slice(0, 12), 'big');
37
- };
38
-
39
- export { _384 as _ };