@protontech/openpgp 6.0.0-alpha.0 → 6.0.0-alpha.1.patch.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.
- package/README.md +6 -6
- package/dist/lightweight/argon2id.min.mjs +1 -1
- package/dist/lightweight/argon2id.min.mjs.map +1 -1
- package/dist/lightweight/argon2id.mjs +1 -1
- package/dist/lightweight/bn.interface.min.mjs +2 -2
- package/dist/lightweight/bn.interface.min.mjs.map +1 -1
- package/dist/lightweight/bn.interface.mjs +3460 -2
- package/dist/lightweight/interface.min.mjs +1 -1
- package/dist/lightweight/interface.min.mjs.map +1 -1
- package/dist/lightweight/interface.mjs +1 -1
- package/dist/lightweight/legacy_ciphers.min.mjs +3 -0
- package/dist/lightweight/legacy_ciphers.min.mjs.map +1 -0
- package/dist/lightweight/legacy_ciphers.mjs +1829 -0
- package/dist/lightweight/native.interface.min.mjs +1 -1
- package/dist/lightweight/native.interface.min.mjs.map +1 -1
- package/dist/lightweight/native.interface.mjs +1 -1
- package/dist/lightweight/noble_curves.min.mjs +11 -11
- package/dist/lightweight/noble_curves.min.mjs.map +1 -1
- package/dist/lightweight/noble_curves.mjs +84 -55
- package/dist/lightweight/noble_hashes.min.mjs +2 -2
- package/dist/lightweight/noble_hashes.min.mjs.map +1 -1
- package/dist/lightweight/noble_hashes.mjs +1 -2
- package/dist/lightweight/openpgp.min.mjs +2 -2
- package/dist/lightweight/openpgp.min.mjs.map +1 -1
- package/dist/lightweight/openpgp.mjs +1373 -3341
- package/dist/lightweight/sha3.min.mjs +3 -3
- package/dist/lightweight/sha3.min.mjs.map +1 -1
- package/dist/lightweight/sha3.mjs +51 -37
- package/dist/node/openpgp.cjs +7887 -8057
- package/dist/node/openpgp.min.cjs +11 -11
- package/dist/node/openpgp.min.cjs.map +1 -1
- package/dist/node/openpgp.min.mjs +11 -11
- package/dist/node/openpgp.min.mjs.map +1 -1
- package/dist/node/openpgp.mjs +7886 -8058
- package/dist/openpgp.js +7940 -8020
- package/dist/openpgp.min.js +11 -11
- package/dist/openpgp.min.js.map +1 -1
- package/dist/openpgp.min.mjs +11 -11
- package/dist/openpgp.min.mjs.map +1 -1
- package/dist/openpgp.mjs +7939 -8021
- package/openpgp.d.ts +58 -43
- package/package.json +32 -34
- package/dist/lightweight/bn.min.mjs +0 -3
- package/dist/lightweight/bn.min.mjs.map +0 -1
- package/dist/lightweight/bn.mjs +0 -3449
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/*! OpenPGP.js v6.0.0-alpha.0 -
|
|
1
|
+
/*! OpenPGP.js v6.0.0-alpha.1.patch.0 - 2024-03-01 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
2
|
const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3
3
|
|
|
4
4
|
import { H as Hash, h as hash, t as toBytes, e as exists, b as bytes, c as concatBytes$1, r as randomBytes, s as sha256, a as sha384, d as sha512, w as wrapConstructor, u as utf8ToBytes$1, f as shake256 } from './sha3.mjs';
|
|
5
5
|
import { B as BigInteger } from './interface.mjs';
|
|
6
6
|
import './native.interface.mjs';
|
|
7
7
|
import './bn.interface.mjs';
|
|
8
|
-
import './bn.mjs';
|
|
9
8
|
|
|
10
9
|
// HMAC (RFC 2104)
|
|
11
10
|
class HMAC extends Hash {
|
|
@@ -84,14 +83,22 @@ hmac.create = (hash, key) => new HMAC(hash, key);
|
|
|
84
83
|
|
|
85
84
|
// TODOOOOOO use noble-hashes utils instead
|
|
86
85
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
86
|
+
// 100 lines of code in the file are duplicated from noble-hashes (utils).
|
|
87
|
+
// This is OK: `abstract` directory does not use noble-hashes.
|
|
88
|
+
// User may opt-in into using different hashing library. This way, noble-hashes
|
|
89
|
+
// won't be included into their bundle.
|
|
87
90
|
const _2n$5 = Object.freeze(BigInteger.new(2));
|
|
88
|
-
|
|
91
|
+
function isBytes(a) {
|
|
92
|
+
return (a instanceof Uint8Array ||
|
|
93
|
+
(a != null && typeof a === 'object' && a.constructor.name === 'Uint8Array'));
|
|
94
|
+
}
|
|
95
|
+
// Array where index 0xf0 (240) is mapped to string 'f0'
|
|
89
96
|
const hexes = /* @__PURE__ */ Array.from({ length: 256 }, (_, i) => i.toString(16).padStart(2, '0'));
|
|
90
97
|
/**
|
|
91
98
|
* @example bytesToHex(Uint8Array.from([0xca, 0xfe, 0x01, 0x23])) // 'cafe0123'
|
|
92
99
|
*/
|
|
93
100
|
function bytesToHex(bytes) {
|
|
94
|
-
if (!
|
|
101
|
+
if (!isBytes(bytes))
|
|
95
102
|
throw new Error('Uint8Array expected');
|
|
96
103
|
// pre-caching improves the speed 6x
|
|
97
104
|
let hex = '';
|
|
@@ -110,23 +117,36 @@ function hexToNumber(hex) {
|
|
|
110
117
|
// Big Endian
|
|
111
118
|
return BigInteger.new(hex === '' ? '0' : `0x${hex}`);
|
|
112
119
|
}
|
|
120
|
+
// We use optimized technique to convert hex string to byte array
|
|
121
|
+
const asciis = { _0: 48, _9: 57, _A: 65, _F: 70, _a: 97, _f: 102 };
|
|
122
|
+
function asciiToBase16(char) {
|
|
123
|
+
if (char >= asciis._0 && char <= asciis._9)
|
|
124
|
+
return char - asciis._0;
|
|
125
|
+
if (char >= asciis._A && char <= asciis._F)
|
|
126
|
+
return char - (asciis._A - 10);
|
|
127
|
+
if (char >= asciis._a && char <= asciis._f)
|
|
128
|
+
return char - (asciis._a - 10);
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
113
131
|
/**
|
|
114
132
|
* @example hexToBytes('cafe0123') // Uint8Array.from([0xca, 0xfe, 0x01, 0x23])
|
|
115
133
|
*/
|
|
116
134
|
function hexToBytes(hex) {
|
|
117
135
|
if (typeof hex !== 'string')
|
|
118
136
|
throw new Error('hex string expected, got ' + typeof hex);
|
|
119
|
-
const
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
const
|
|
126
|
-
const
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
|
|
137
|
+
const hl = hex.length;
|
|
138
|
+
const al = hl / 2;
|
|
139
|
+
if (hl % 2)
|
|
140
|
+
throw new Error('padded hex string expected, got unpadded hex of length ' + hl);
|
|
141
|
+
const array = new Uint8Array(al);
|
|
142
|
+
for (let ai = 0, hi = 0; ai < al; ai++, hi += 2) {
|
|
143
|
+
const n1 = asciiToBase16(hex.charCodeAt(hi));
|
|
144
|
+
const n2 = asciiToBase16(hex.charCodeAt(hi + 1));
|
|
145
|
+
if (n1 === undefined || n2 === undefined) {
|
|
146
|
+
const char = hex[hi] + hex[hi + 1];
|
|
147
|
+
throw new Error('hex string expected, got non-hex character "' + char + '" at index ' + hi);
|
|
148
|
+
}
|
|
149
|
+
array[ai] = n1 * 16 + n2;
|
|
130
150
|
}
|
|
131
151
|
return array;
|
|
132
152
|
}
|
|
@@ -135,7 +155,7 @@ function bytesToNumberBE(bytes) {
|
|
|
135
155
|
return BigInteger.new(bytes);
|
|
136
156
|
}
|
|
137
157
|
function bytesToNumberLE(bytes) {
|
|
138
|
-
if (!
|
|
158
|
+
if (!isBytes(bytes))
|
|
139
159
|
throw new Error('Uint8Array expected');
|
|
140
160
|
return BigInteger.new(bytes.slice().reverse()); // reverse() is in place
|
|
141
161
|
}
|
|
@@ -168,7 +188,7 @@ function ensureBytes(title, hex, expectedLength) {
|
|
|
168
188
|
throw new Error(`${title} must be valid hex string, got "${hex}". Cause: ${e}`);
|
|
169
189
|
}
|
|
170
190
|
}
|
|
171
|
-
else if (
|
|
191
|
+
else if (isBytes(hex)) {
|
|
172
192
|
// Uint8Array.from() instead of hash.slice() because node.js Buffer
|
|
173
193
|
// is instance of Uint8Array, and its slice() creates **mutable** copy
|
|
174
194
|
res = new Uint8Array(hex);
|
|
@@ -185,24 +205,30 @@ function ensureBytes(title, hex, expectedLength) {
|
|
|
185
205
|
* Copies several Uint8Arrays into one.
|
|
186
206
|
*/
|
|
187
207
|
function concatBytes(...arrays) {
|
|
188
|
-
|
|
189
|
-
let
|
|
190
|
-
|
|
191
|
-
if (!
|
|
208
|
+
let sum = 0;
|
|
209
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
210
|
+
const a = arrays[i];
|
|
211
|
+
if (!isBytes(a))
|
|
192
212
|
throw new Error('Uint8Array expected');
|
|
193
|
-
|
|
213
|
+
sum += a.length;
|
|
214
|
+
}
|
|
215
|
+
let res = new Uint8Array(sum);
|
|
216
|
+
let pad = 0;
|
|
217
|
+
for (let i = 0; i < arrays.length; i++) {
|
|
218
|
+
const a = arrays[i];
|
|
219
|
+
res.set(a, pad);
|
|
194
220
|
pad += a.length;
|
|
195
|
-
}
|
|
196
|
-
return
|
|
221
|
+
}
|
|
222
|
+
return res;
|
|
197
223
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
if (
|
|
224
|
+
// Compares 2 u8a-s in kinda constant time
|
|
225
|
+
function equalBytes(a, b) {
|
|
226
|
+
if (a.length !== b.length)
|
|
201
227
|
return false;
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
return
|
|
228
|
+
let diff = 0;
|
|
229
|
+
for (let i = 0; i < a.length; i++)
|
|
230
|
+
diff |= a[i] ^ b[i];
|
|
231
|
+
return diff === 0;
|
|
206
232
|
}
|
|
207
233
|
/**
|
|
208
234
|
* @example utf8ToBytes('abc') // new Uint8Array([97, 98, 99])
|
|
@@ -306,7 +332,7 @@ const validatorFns = {
|
|
|
306
332
|
function: (val) => typeof val === 'function',
|
|
307
333
|
boolean: (val) => typeof val === 'boolean',
|
|
308
334
|
string: (val) => typeof val === 'string',
|
|
309
|
-
stringOrUint8Array: (val) => typeof val === 'string' || val
|
|
335
|
+
stringOrUint8Array: (val) => typeof val === 'string' || isBytes(val),
|
|
310
336
|
isSafeInteger: (val) => Number.isSafeInteger(val),
|
|
311
337
|
array: (val) => Array.isArray(val),
|
|
312
338
|
field: (val, object) => object.Fp.isValid(val),
|
|
@@ -356,6 +382,7 @@ var ut = /*#__PURE__*/Object.freeze({
|
|
|
356
382
|
equalBytes: equalBytes,
|
|
357
383
|
hexToBytes: hexToBytes,
|
|
358
384
|
hexToNumber: hexToNumber,
|
|
385
|
+
isBytes: isBytes,
|
|
359
386
|
numberToBytesBE: numberToBytesBE,
|
|
360
387
|
numberToBytesLE: numberToBytesLE,
|
|
361
388
|
numberToHexUnpadded: numberToHexUnpadded,
|
|
@@ -919,7 +946,7 @@ const DER = {
|
|
|
919
946
|
// parse DER signature
|
|
920
947
|
const { Err: E } = DER;
|
|
921
948
|
const data = typeof hex === 'string' ? h2b(hex) : hex;
|
|
922
|
-
if (!(data
|
|
949
|
+
if (!isBytes(data))
|
|
923
950
|
throw new Error('ui8a expected');
|
|
924
951
|
let l = data.length;
|
|
925
952
|
if (l < 2 || data[0] != 0x30)
|
|
@@ -1001,7 +1028,7 @@ function weierstrassPoints(opts) {
|
|
|
1001
1028
|
function normPrivateKeyToScalar(key) {
|
|
1002
1029
|
const { allowedPrivateKeyLengths: lengths, nByteLength, wrapPrivateKey, n } = CURVE;
|
|
1003
1030
|
if (lengths && !(key instanceof BigInteger)) {
|
|
1004
|
-
if (key
|
|
1031
|
+
if (isBytes(key))
|
|
1005
1032
|
key = bytesToHex(key);
|
|
1006
1033
|
// Normalize to hex string, pad. E.g. P521 would norm 130-132 char hex to 132-char bytes
|
|
1007
1034
|
if (typeof key !== 'string' || !lengths.includes(key.length))
|
|
@@ -1579,7 +1606,7 @@ function weierstrass(curveDef) {
|
|
|
1579
1606
|
* Quick and dirty check for item being public key. Does not validate hex, or being on-curve.
|
|
1580
1607
|
*/
|
|
1581
1608
|
function isProbPub(item) {
|
|
1582
|
-
const arr = item
|
|
1609
|
+
const arr = isBytes(item);
|
|
1583
1610
|
const str = typeof item === 'string';
|
|
1584
1611
|
const len = (arr || str) && item.length;
|
|
1585
1612
|
if (arr)
|
|
@@ -1740,7 +1767,7 @@ function weierstrass(curveDef) {
|
|
|
1740
1767
|
let _sig = undefined;
|
|
1741
1768
|
let P;
|
|
1742
1769
|
try {
|
|
1743
|
-
if (typeof sg === 'string' || sg
|
|
1770
|
+
if (typeof sg === 'string' || isBytes(sg)) {
|
|
1744
1771
|
// Signature can be represented in 2 ways: compact (2*nByteLength) & DER (variable-length).
|
|
1745
1772
|
// Since DER can also be 2*nByteLength bytes, we check for it first.
|
|
1746
1773
|
try {
|
|
@@ -1816,9 +1843,9 @@ const CURVE_A$4 = Fp$7.create(BigInteger.new('-3'));
|
|
|
1816
1843
|
const CURVE_B$4 = BigInteger.new('0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b');
|
|
1817
1844
|
// prettier-ignore
|
|
1818
1845
|
const p256 = createCurve({
|
|
1819
|
-
a: CURVE_A$4,
|
|
1846
|
+
a: CURVE_A$4, // Equation params: a, b
|
|
1820
1847
|
b: CURVE_B$4,
|
|
1821
|
-
Fp: Fp$7,
|
|
1848
|
+
Fp: Fp$7, // Field: 2n**224n * (2n**32n-1n) + 2n**192n + 2n**96n-1n
|
|
1822
1849
|
// Curve order, total count of valid points in the field
|
|
1823
1850
|
n: BigInteger.new('0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551'),
|
|
1824
1851
|
// Base (generator) point (x, y)
|
|
@@ -1840,9 +1867,9 @@ const CURVE_A$3 = Fp$6.create(BigInteger.new('-3'));
|
|
|
1840
1867
|
const CURVE_B$3 = BigInteger.new('0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef');
|
|
1841
1868
|
// prettier-ignore
|
|
1842
1869
|
const p384 = createCurve({
|
|
1843
|
-
a: CURVE_A$3,
|
|
1870
|
+
a: CURVE_A$3, // Equation params: a, b
|
|
1844
1871
|
b: CURVE_B$3,
|
|
1845
|
-
Fp: Fp$6,
|
|
1872
|
+
Fp: Fp$6, // Field: 2n**384n - 2n**128n - 2n**96n + 2n**32n - 1n
|
|
1846
1873
|
// Curve order, total count of valid points in the field.
|
|
1847
1874
|
n: BigInteger.new('0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973'),
|
|
1848
1875
|
// Base (generator) point (x, y)
|
|
@@ -1871,12 +1898,12 @@ const CURVE = {
|
|
|
1871
1898
|
};
|
|
1872
1899
|
// prettier-ignore
|
|
1873
1900
|
const p521 = createCurve({
|
|
1874
|
-
a: CURVE.a,
|
|
1901
|
+
a: CURVE.a, // Equation params: a, b
|
|
1875
1902
|
b: CURVE.b,
|
|
1876
|
-
Fp: Fp$5,
|
|
1903
|
+
Fp: Fp$5, // Field: 2n**521n - 1n
|
|
1877
1904
|
// Curve order, total count of valid points in the field
|
|
1878
1905
|
n: CURVE.n,
|
|
1879
|
-
Gx: CURVE.Gx,
|
|
1906
|
+
Gx: CURVE.Gx, // Base point (x, y) aka generator point
|
|
1880
1907
|
Gy: CURVE.Gy,
|
|
1881
1908
|
h: CURVE.h,
|
|
1882
1909
|
lowS: false,
|
|
@@ -1889,7 +1916,7 @@ const CURVE_A$2 = Fp$4.create(BigInteger.new('0x7d5a0975fc2c3057eef67530417affe7
|
|
|
1889
1916
|
const CURVE_B$2 = BigInteger.new('0x26dc5c6ce94a4b44f330b5d9bbd77cbf958416295cf7e1ce6bccdc18ff8c07b6');
|
|
1890
1917
|
// prettier-ignore
|
|
1891
1918
|
const brainpoolP256r1 = createCurve({
|
|
1892
|
-
a: CURVE_A$2,
|
|
1919
|
+
a: CURVE_A$2, // Equation params: a, b
|
|
1893
1920
|
b: CURVE_B$2,
|
|
1894
1921
|
Fp: Fp$4,
|
|
1895
1922
|
// Curve order (q), total count of valid points in the field
|
|
@@ -1907,7 +1934,7 @@ const CURVE_A$1 = Fp$3.create(BigInteger.new('0x7bc382c63d8c150c3c72080ace05afa0
|
|
|
1907
1934
|
const CURVE_B$1 = BigInteger.new('0x04a8c7dd22ce28268b39b55416f0447c2fb77de107dcd2a62e880ea53eeb62d57cb4390295dbc9943ab78696fa504c11');
|
|
1908
1935
|
// prettier-ignore
|
|
1909
1936
|
const brainpoolP384r1 = createCurve({
|
|
1910
|
-
a: CURVE_A$1,
|
|
1937
|
+
a: CURVE_A$1, // Equation params: a, b
|
|
1911
1938
|
b: CURVE_B$1,
|
|
1912
1939
|
Fp: Fp$3,
|
|
1913
1940
|
// Curve order (q), total count of valid points in the field
|
|
@@ -1925,7 +1952,7 @@ const CURVE_A = Fp$2.create(BigInteger.new('0x7830a3318b603b89e2327145ac234cc594
|
|
|
1925
1952
|
const CURVE_B = BigInteger.new('0x3df91610a83441caea9863bc2ded5d5aa8253aa10a2ef1c98b9ac8b57f1117a72bf2c7b9e7c1ac4d77fc94cadc083e67984050b75ebae5dd2809bd638016f723');
|
|
1926
1953
|
// prettier-ignore
|
|
1927
1954
|
const brainpoolP512r1 = createCurve({
|
|
1928
|
-
a: CURVE_A,
|
|
1955
|
+
a: CURVE_A, // Equation params: a, b
|
|
1929
1956
|
b: CURVE_B,
|
|
1930
1957
|
Fp: Fp$2,
|
|
1931
1958
|
// Curve order (q), total count of valid points in the field
|
|
@@ -2591,6 +2618,7 @@ const ED448_DEF = {
|
|
|
2591
2618
|
// Subgroup order: how many points curve has;
|
|
2592
2619
|
// 2n**446n - 13818066809895115352007386748515426880336692474882178609894547503885n
|
|
2593
2620
|
n: BigInteger.new('181709681073901722637330951972001133588410340171829515070372549795146003961539585716195755291692375963310293709091662304773755859649779'),
|
|
2621
|
+
// RFC 7748 has 56-byte keys, RFC 8032 has 57-byte keys
|
|
2594
2622
|
nBitLength: 456,
|
|
2595
2623
|
// Cofactor
|
|
2596
2624
|
h: BigInteger.new(4),
|
|
@@ -2627,6 +2655,7 @@ const x448 = /* @__PURE__ */ (() => montgomery({
|
|
|
2627
2655
|
adjustScalarBytes,
|
|
2628
2656
|
randomBytes,
|
|
2629
2657
|
}))();
|
|
2658
|
+
// TODO: add edwardsToMontgomeryPriv, similar to ed25519 version
|
|
2630
2659
|
Object.freeze(BigInteger.new(4));
|
|
2631
2660
|
// Hash To Curve Elligator2 Map
|
|
2632
2661
|
Fp$1.ORDER.sub(_3n).irightShift(_2n$1); // 1. c1 = (q - 3) / 4 # Integer arithmetic
|
|
@@ -2678,15 +2707,15 @@ function sqrtMod(y) {
|
|
|
2678
2707
|
}
|
|
2679
2708
|
const Fp = Field(secp256k1P, undefined, undefined, { sqrt: sqrtMod });
|
|
2680
2709
|
const secp256k1 = createCurve({
|
|
2681
|
-
a: BigInteger.new(0),
|
|
2682
|
-
b: BigInteger.new(7),
|
|
2683
|
-
Fp,
|
|
2684
|
-
n: secp256k1N,
|
|
2710
|
+
a: BigInteger.new(0), // equation params: a, b
|
|
2711
|
+
b: BigInteger.new(7), // Seem to be rigid: bitcointalk.org/index.php?topic=289795.msg3183975#msg3183975
|
|
2712
|
+
Fp, // Field's prime: 2n**256n - 2n**32n - 2n**9n - 2n**8n - 2n**7n - 2n**6n - 2n**4n - 1n
|
|
2713
|
+
n: secp256k1N, // Curve order, total count of valid points in the field
|
|
2685
2714
|
// Base point (x, y) aka generator point
|
|
2686
2715
|
Gx: BigInteger.new('55066263022277343669578718895168534326250603453777594175500187360389116729240'),
|
|
2687
2716
|
Gy: BigInteger.new('32670510020758816978083085130507043184471273380659243275938904335757337482424'),
|
|
2688
|
-
h: BigInteger.new(1),
|
|
2689
|
-
lowS: true,
|
|
2717
|
+
h: BigInteger.new(1), // Cofactor
|
|
2718
|
+
lowS: true, // Allow only low-S signatures by default in sign() and verify()
|
|
2690
2719
|
/**
|
|
2691
2720
|
* secp256k1 belongs to Koblitz curves: it has efficiently computable endomorphism.
|
|
2692
2721
|
* Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%.
|
|
@@ -2729,9 +2758,9 @@ secp256k1.ProjectivePoint;
|
|
|
2729
2758
|
|
|
2730
2759
|
|
|
2731
2760
|
const nobleCurves = new Map(Object.entries({
|
|
2732
|
-
p256,
|
|
2733
|
-
p384,
|
|
2734
|
-
p521,
|
|
2761
|
+
nistP256: p256,
|
|
2762
|
+
nistP384: p384,
|
|
2763
|
+
nistP521: p521,
|
|
2735
2764
|
brainpoolP256r1,
|
|
2736
2765
|
brainpoolP384r1,
|
|
2737
2766
|
brainpoolP512r1,
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
/*! OpenPGP.js v6.0.0-alpha.0 -
|
|
2
|
-
"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;import{w as t,S as s,g as i,s as h,a as e,d as n,i as r,j as
|
|
1
|
+
/*! OpenPGP.js v6.0.0-alpha.1.patch.0 - 2024-03-01 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
|
+
"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;import{w as t,S as s,g as i,s as h,a as e,d as n,i as r,j as a}from"./sha3.min.mjs";import"./interface.min.mjs";import"./native.interface.min.mjs";import"./bn.interface.min.mjs";const o=(t,s)=>t<<s|t>>>32-s>>>0,l=(t,s,i)=>t&s^t&i^s&i,f=/* @__PURE__ */new Uint32Array([1732584193,4023233417,2562383102,271733878,3285377520]),c=/* @__PURE__ */new Uint32Array(80);class p extends s{constructor(){super(64,20,8,!1),this.A=0|f[0],this.B=0|f[1],this.C=0|f[2],this.D=0|f[3],this.E=0|f[4]}get(){const{A:t,B:s,C:i,D:h,E:e}=this;return[t,s,i,h,e]}set(t,s,i,h,e){this.A=0|t,this.B=0|s,this.C=0|i,this.D=0|h,this.E=0|e}process(t,s){for(let i=0;i<16;i++,s+=4)c[i]=t.getUint32(s,!1);for(let t=16;t<80;t++)c[t]=o(c[t-3]^c[t-8]^c[t-14]^c[t-16],1);let{A:i,B:h,C:e,D:n,E:r}=this;for(let t=0;t<80;t++){let s,f;t<20?(s=(a=h)&e^~a&n,f=1518500249):t<40?(s=h^e^n,f=1859775393):t<60?(s=l(h,e,n),f=2400959708):(s=h^e^n,f=3395469782);const p=o(i,5)+s+r+f+c[t]|0;r=n,n=e,e=o(h,30),h=i,i=p}var a;i=i+this.A|0,h=h+this.B|0,e=e+this.C|0,n=n+this.D|0,r=r+this.E|0,this.set(i,h,e,n,r)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0),this.buffer.fill(0)}}const m=/* @__PURE__ */t((()=>new p)),d=/* @__PURE__ */new Uint8Array([7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8]),u=/* @__PURE__ */new Uint8Array(Array(16).fill(0).map(((t,s)=>s)));let w=[u],y=[/* @__PURE__ */u.map((t=>(9*t+5)%16))];for(let t=0;t<4;t++)for(let s of[w,y])s.push(s[t].map((t=>d[t])));const A=/* @__PURE__ */[[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8],[12,13,11,15,6,9,9,7,12,15,11,13,7,8,7,7],[13,15,14,11,7,7,6,8,13,14,13,12,5,5,6,9],[14,11,12,14,8,6,5,5,15,12,15,14,9,9,8,6],[15,12,13,13,9,5,8,6,14,11,12,11,8,6,5,5]].map((t=>new Uint8Array(t))),U=/* @__PURE__ */w.map(((t,s)=>t.map((t=>A[s][t])))),g=/* @__PURE__ */y.map(((t,s)=>t.map((t=>A[s][t])))),C=/* @__PURE__ */new Uint32Array([0,1518500249,1859775393,2400959708,2840853838]),b=/* @__PURE__ */new Uint32Array([1352829926,1548603684,1836072691,2053994217,0]),j=(t,s)=>t<<s|t>>>32-s;function B(t,s,i,h){return 0===t?s^i^h:1===t?s&i|~s&h:2===t?(s|~i)^h:3===t?s&h|i&~h:s^(i|~h)}const D=/* @__PURE__ */new Uint32Array(16);class E extends s{constructor(){super(64,20,8,!0),this.h0=1732584193,this.h1=-271733879,this.h2=-1732584194,this.h3=271733878,this.h4=-1009589776}get(){const{h0:t,h1:s,h2:i,h3:h,h4:e}=this;return[t,s,i,h,e]}set(t,s,i,h,e){this.h0=0|t,this.h1=0|s,this.h2=0|i,this.h3=0|h,this.h4=0|e}process(t,s){for(let i=0;i<16;i++,s+=4)D[i]=t.getUint32(s,!0);let i=0|this.h0,h=i,e=0|this.h1,n=e,r=0|this.h2,a=r,o=0|this.h3,l=o,f=0|this.h4,c=f;for(let t=0;t<5;t++){const s=4-t,p=C[t],m=b[t],d=w[t],u=y[t],A=U[t],E=g[t];for(let s=0;s<16;s++){const h=j(i+B(t,e,r,o)+D[d[s]]+p,A[s])+f|0;i=f,f=o,o=0|j(r,10),r=e,e=h}for(let t=0;t<16;t++){const i=j(h+B(s,n,a,l)+D[u[t]]+m,E[t])+c|0;h=c,c=l,l=0|j(a,10),a=n,n=i}}this.set(this.h1+r+l|0,this.h2+o+c|0,this.h3+f+h|0,this.h4+i+n|0,this.h0+e+a|0)}roundClean(){D.fill(0)}destroy(){this.destroyed=!0,this.buffer.fill(0),this.set(0,0,0,0,0)}}const x=new Map(Object.entries({sha1:m,sha224:i,sha256:h,sha384:e,sha512:n,sha3_256:r,sha3_512:a,ripemd160:/* @__PURE__ */t((()=>new E))}));export{x as nobleHashes};
|
|
3
3
|
//# sourceMappingURL=noble_hashes.min.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noble_hashes.min.mjs","sources":["../../node_modules/@openpgp/noble-hashes/esm/sha1.js","../../node_modules/@openpgp/noble-hashes/esm/ripemd160.js","../../src/crypto/hash/noble_hashes.js"],"sourcesContent":["import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// SHA1 was cryptographically broken.\n// It is still widely used in legacy apps. Don't use it for a new protocol.\n// RFC 3174\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Initial state\nconst IV = /* @__PURE__ */ new Uint32Array([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\nclass SHA1 extends SHA2 {\n constructor() {\n super(64, 20, 8, false);\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n this.set(A, B, C, D, E);\n }\n roundClean() {\n SHA1_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\nexport const sha1 = /* @__PURE__ */ wrapConstructor(() => new SHA1());\n//# sourceMappingURL=sha1.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((_, i) => i));\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","/**\n * This file is needed to dynamic import the noble-hashes.\n * Separate dynamic imports are not convenient as they result in too many chunks,\n * which share a lot of code anyway.\n */\n\nimport { sha1 } from '@openpgp/noble-hashes/sha1';\nimport { sha224, sha256 } from '@openpgp/noble-hashes/sha256';\nimport { sha384, sha512 } from '@openpgp/noble-hashes/sha512';\nimport { sha3_256, sha3_512 } from '@openpgp/noble-hashes/sha3';\nimport { ripemd160 } from '@openpgp/noble-hashes/ripemd160';\n\nexport const nobleHashes = new Map(Object.entries({\n sha1,\n sha224,\n sha256,\n sha384,\n sha512,\n sha3_256,\n sha3_512,\n ripemd160\n}));\n"],"names":["rotl","word","shift","Maj","a","b","c","IV","Uint32Array","SHA1_W","SHA1","SHA2","constructor","super","this","A","B","C","D","E","get","set","process","view","offset","i","getUint32","F","K","T","roundClean","fill","destroy","buffer","sha1","wrapConstructor","Rho","Uint8Array","Id","Array","map","_","idxL","idxR","j","push","k","shifts","shiftsL","idx","shiftsR","Kl","Kr","f","group","x","y","z","BUF","RIPEMD160","h0","h1","h2","h3","h4","al","ar","bl","br","cl","cr","dl","dr","el","er","rGroup","hbl","hbr","rl","rr","sl","sr","tl","tr","destroyed","nobleHashes","Map","Object","entries","sha224","sha256","sha384","sha512","sha3_256","sha3_512","ripemd160"],"mappings":";0SAKA,MAAMA,EAAO,CAACC,EAAMC,IAAWD,GAAQC,EAAWD,IAAU,GAAKC,IAAY,EAIvEC,EAAM,CAACC,EAAGC,EAAGC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Ke,CAC1D,CAED,IAAK,IAAIzD,EAAI,EAAGA,EAAI,GAAIA,IAAK,CACzB,MAAM0D,EAAMnF,EAAKkE,EAAKb,EAAEsB,EAAQP,EAAIE,EAAIE,GAAMd,EAAIqB,EAAGtD,IAAMoD,EAAKI,EAAGxD,IAAMiD,EAAM,EAC/ER,EAAKQ,EAAIA,EAAKF,EAAIA,EAAoB,EAAfxE,EAAKsE,EAAI,IAASA,EAAKF,EAAIA,EAAKe,CAC1D,CACJ,CAEDrE,KAAKO,IAAKP,KAAK+C,GAAKQ,EAAKG,EAAM,EAAI1D,KAAKgD,GAAKS,EAAKG,EAAM,EAAI5D,KAAKiD,GAAKU,EAAKP,EAAM,EAAIpD,KAAKkD,GAAKC,EAAKG,EAAM,EAAItD,KAAK8C,GAAKO,EAAKG,EAAM,EACtI,CACDxC,aACI4B,EAAI3B,KAAK,EACZ,CACDC,UACIlB,KAAKsE,WAAY,EACjBtE,KAAKmB,OAAOF,KAAK,GACjBjB,KAAKO,IAAI,EAAG,EAAG,EAAG,EAAG,EACxB,EAME,MC1FMgE,EAAc,IAAIC,IAAIC,OAAOC,QAAQ,CAChDtD,OACAuD,SACAC,SACAC,SACAC,SACAC,WACAC,WACAC,UDkFuC5D,GAAgB,IAAM,IAAIwB","x_google_ignoreList":[0,1]}
|
|
1
|
+
{"version":3,"file":"noble_hashes.min.mjs","sources":["../../node_modules/@openpgp/noble-hashes/esm/sha1.js","../../node_modules/@openpgp/noble-hashes/esm/ripemd160.js","../../src/crypto/hash/noble_hashes.js"],"sourcesContent":["import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// SHA1 was cryptographically broken.\n// It is still widely used in legacy apps. Don't use it for a new protocol.\n// RFC 3174\nconst rotl = (word, shift) => (word << shift) | ((word >>> (32 - shift)) >>> 0);\n// Choice: a ? b : c\nconst Chi = (a, b, c) => (a & b) ^ (~a & c);\n// Majority function, true if any two inpust is true\nconst Maj = (a, b, c) => (a & b) ^ (a & c) ^ (b & c);\n// Initial state\nconst IV = /* @__PURE__ */ new Uint32Array([\n 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0,\n]);\n// Temporary buffer, not used to store anything between runs\n// Named this way because it matches specification.\nconst SHA1_W = /* @__PURE__ */ new Uint32Array(80);\nclass SHA1 extends SHA2 {\n constructor() {\n super(64, 20, 8, false);\n this.A = IV[0] | 0;\n this.B = IV[1] | 0;\n this.C = IV[2] | 0;\n this.D = IV[3] | 0;\n this.E = IV[4] | 0;\n }\n get() {\n const { A, B, C, D, E } = this;\n return [A, B, C, D, E];\n }\n set(A, B, C, D, E) {\n this.A = A | 0;\n this.B = B | 0;\n this.C = C | 0;\n this.D = D | 0;\n this.E = E | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n SHA1_W[i] = view.getUint32(offset, false);\n for (let i = 16; i < 80; i++)\n SHA1_W[i] = rotl(SHA1_W[i - 3] ^ SHA1_W[i - 8] ^ SHA1_W[i - 14] ^ SHA1_W[i - 16], 1);\n // Compression function main loop, 80 rounds\n let { A, B, C, D, E } = this;\n for (let i = 0; i < 80; i++) {\n let F, K;\n if (i < 20) {\n F = Chi(B, C, D);\n K = 0x5a827999;\n }\n else if (i < 40) {\n F = B ^ C ^ D;\n K = 0x6ed9eba1;\n }\n else if (i < 60) {\n F = Maj(B, C, D);\n K = 0x8f1bbcdc;\n }\n else {\n F = B ^ C ^ D;\n K = 0xca62c1d6;\n }\n const T = (rotl(A, 5) + F + E + K + SHA1_W[i]) | 0;\n E = D;\n D = C;\n C = rotl(B, 30);\n B = A;\n A = T;\n }\n // Add the compressed chunk to the current hash value\n A = (A + this.A) | 0;\n B = (B + this.B) | 0;\n C = (C + this.C) | 0;\n D = (D + this.D) | 0;\n E = (E + this.E) | 0;\n this.set(A, B, C, D, E);\n }\n roundClean() {\n SHA1_W.fill(0);\n }\n destroy() {\n this.set(0, 0, 0, 0, 0);\n this.buffer.fill(0);\n }\n}\nexport const sha1 = /* @__PURE__ */ wrapConstructor(() => new SHA1());\n//# sourceMappingURL=sha1.js.map","import { SHA2 } from './_sha2.js';\nimport { wrapConstructor } from './utils.js';\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160.html\n// https://homes.esat.kuleuven.be/~bosselae/ripemd160/pdf/AB-9601/AB-9601.pdf\nconst Rho = /* @__PURE__ */ new Uint8Array([7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8]);\nconst Id = /* @__PURE__ */ new Uint8Array(new Array(16).fill(0).map((_, i) => i));\nconst Pi = /* @__PURE__ */ Id.map((i) => (9 * i + 5) % 16);\nlet idxL = [Id];\nlet idxR = [Pi];\nfor (let i = 0; i < 4; i++)\n for (let j of [idxL, idxR])\n j.push(j[i].map((k) => Rho[k]));\nconst shifts = /* @__PURE__ */ [\n [11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8],\n [12, 13, 11, 15, 6, 9, 9, 7, 12, 15, 11, 13, 7, 8, 7, 7],\n [13, 15, 14, 11, 7, 7, 6, 8, 13, 14, 13, 12, 5, 5, 6, 9],\n [14, 11, 12, 14, 8, 6, 5, 5, 15, 12, 15, 14, 9, 9, 8, 6],\n [15, 12, 13, 13, 9, 5, 8, 6, 14, 11, 12, 11, 8, 6, 5, 5],\n].map((i) => new Uint8Array(i));\nconst shiftsL = /* @__PURE__ */ idxL.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst shiftsR = /* @__PURE__ */ idxR.map((idx, i) => idx.map((j) => shifts[i][j]));\nconst Kl = /* @__PURE__ */ new Uint32Array([\n 0x00000000, 0x5a827999, 0x6ed9eba1, 0x8f1bbcdc, 0xa953fd4e,\n]);\nconst Kr = /* @__PURE__ */ new Uint32Array([\n 0x50a28be6, 0x5c4dd124, 0x6d703ef3, 0x7a6d76e9, 0x00000000,\n]);\n// The rotate left (circular left shift) operation for uint32\nconst rotl = (word, shift) => (word << shift) | (word >>> (32 - shift));\n// It's called f() in spec.\nfunction f(group, x, y, z) {\n if (group === 0)\n return x ^ y ^ z;\n else if (group === 1)\n return (x & y) | (~x & z);\n else if (group === 2)\n return (x | ~y) ^ z;\n else if (group === 3)\n return (x & z) | (y & ~z);\n else\n return x ^ (y | ~z);\n}\n// Temporary buffer, not used to store anything between runs\nconst BUF = /* @__PURE__ */ new Uint32Array(16);\nexport class RIPEMD160 extends SHA2 {\n constructor() {\n super(64, 20, 8, true);\n this.h0 = 0x67452301 | 0;\n this.h1 = 0xefcdab89 | 0;\n this.h2 = 0x98badcfe | 0;\n this.h3 = 0x10325476 | 0;\n this.h4 = 0xc3d2e1f0 | 0;\n }\n get() {\n const { h0, h1, h2, h3, h4 } = this;\n return [h0, h1, h2, h3, h4];\n }\n set(h0, h1, h2, h3, h4) {\n this.h0 = h0 | 0;\n this.h1 = h1 | 0;\n this.h2 = h2 | 0;\n this.h3 = h3 | 0;\n this.h4 = h4 | 0;\n }\n process(view, offset) {\n for (let i = 0; i < 16; i++, offset += 4)\n BUF[i] = view.getUint32(offset, true);\n // prettier-ignore\n let al = this.h0 | 0, ar = al, bl = this.h1 | 0, br = bl, cl = this.h2 | 0, cr = cl, dl = this.h3 | 0, dr = dl, el = this.h4 | 0, er = el;\n // Instead of iterating 0 to 80, we split it into 5 groups\n // And use the groups in constants, functions, etc. Much simpler\n for (let group = 0; group < 5; group++) {\n const rGroup = 4 - group;\n const hbl = Kl[group], hbr = Kr[group]; // prettier-ignore\n const rl = idxL[group], rr = idxR[group]; // prettier-ignore\n const sl = shiftsL[group], sr = shiftsR[group]; // prettier-ignore\n for (let i = 0; i < 16; i++) {\n const tl = (rotl(al + f(group, bl, cl, dl) + BUF[rl[i]] + hbl, sl[i]) + el) | 0;\n al = el, el = dl, dl = rotl(cl, 10) | 0, cl = bl, bl = tl; // prettier-ignore\n }\n // 2 loops are 10% faster\n for (let i = 0; i < 16; i++) {\n const tr = (rotl(ar + f(rGroup, br, cr, dr) + BUF[rr[i]] + hbr, sr[i]) + er) | 0;\n ar = er, er = dr, dr = rotl(cr, 10) | 0, cr = br, br = tr; // prettier-ignore\n }\n }\n // Add the compressed chunk to the current hash value\n this.set((this.h1 + cl + dr) | 0, (this.h2 + dl + er) | 0, (this.h3 + el + ar) | 0, (this.h4 + al + br) | 0, (this.h0 + bl + cr) | 0);\n }\n roundClean() {\n BUF.fill(0);\n }\n destroy() {\n this.destroyed = true;\n this.buffer.fill(0);\n this.set(0, 0, 0, 0, 0);\n }\n}\n/**\n * RIPEMD-160 - a hash function from 1990s.\n * @param message - msg that would be hashed\n */\nexport const ripemd160 = /* @__PURE__ */ wrapConstructor(() => new RIPEMD160());\n//# sourceMappingURL=ripemd160.js.map","/**\n * This file is needed to dynamic import the noble-hashes.\n * Separate dynamic imports are not convenient as they result in too many chunks,\n * which share a lot of code anyway.\n */\n\nimport { sha1 } from '@openpgp/noble-hashes/sha1';\nimport { sha224, sha256 } from '@openpgp/noble-hashes/sha256';\nimport { sha384, sha512 } from '@openpgp/noble-hashes/sha512';\nimport { sha3_256, sha3_512 } from '@openpgp/noble-hashes/sha3';\nimport { ripemd160 } from '@openpgp/noble-hashes/ripemd160';\n\nexport const nobleHashes = new Map(Object.entries({\n sha1,\n sha224,\n sha256,\n sha384,\n sha512,\n sha3_256,\n sha3_512,\n ripemd160\n}));\n"],"names":["rotl","word","shift","Maj","a","b","c","IV","Uint32Array","SHA1_W","SHA1","SHA2","constructor","super","this","A","B","C","D","E","get","set","process","view","offset","i","getUint32","F","K","T","roundClean","fill","destroy","buffer","sha1","wrapConstructor","Rho","Uint8Array","Id","Array","map","_","idxL","idxR","j","push","k","shifts","shiftsL","idx","shiftsR","Kl","Kr","f","group","x","y","z","BUF","RIPEMD160","h0","h1","h2","h3","h4","al","ar","bl","br","cl","cr","dl","dr","el","er","rGroup","hbl","hbr","rl","rr","sl","sr","tl","tr","destroyed","nobleHashes","Map","Object","entries","sha224","sha256","sha384","sha512","sha3_256","sha3_512","ripemd160"],"mappings":";qRAKA,MAAMA,EA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IE,EAAIE,GAAMb,EAAIoB,EAAGrD,IAAMmD,EAAKI,EAAGvD,IAAMgD,EAAM,EAC9ER,EAAKQ,EAAIA,EAAKF,EAAIA,EAAoB,EAAfvE,EAAKqE,EAAI,IAASA,EAAKF,EAAIA,EAAKe,CAC1D,CAED,IAAK,IAAIzD,EAAI,EAAGA,EAAI,GAAIA,IAAK,CACzB,MAAM0D,EAAMnF,EAAKkE,EAAKb,EAAEsB,EAAQP,EAAIE,EAAIE,GAAMd,EAAIqB,EAAGtD,IAAMoD,EAAKI,EAAGxD,IAAMiD,EAAM,EAC/ER,EAAKQ,EAAIA,EAAKF,EAAIA,EAAoB,EAAfxE,EAAKsE,EAAI,IAASA,EAAKF,EAAIA,EAAKe,CAC1D,CACJ,CAEDrE,KAAKO,IAAKP,KAAK+C,GAAKQ,EAAKG,EAAM,EAAI1D,KAAKgD,GAAKS,EAAKG,EAAM,EAAI5D,KAAKiD,GAAKU,EAAKP,EAAM,EAAIpD,KAAKkD,GAAKC,EAAKG,EAAM,EAAItD,KAAK8C,GAAKO,EAAKG,EAAM,EACtI,CACD,UAAAxC,GACI4B,EAAI3B,KAAK,EACZ,CACD,OAAAC,GACIlB,KAAKsE,WAAY,EACjBtE,KAAKmB,OAAOF,KAAK,GACjBjB,KAAKO,IAAI,EAAG,EAAG,EAAG,EAAG,EACxB,EAME,MC1FMgE,EAAc,IAAIC,IAAIC,OAAOC,QAAQ,CAChDtD,OACAuD,SACAC,SACAC,SACAC,SACAC,WACAC,WACAC,yBDkFuC5D,GAAgB,IAAM,IAAIwB","x_google_ignoreList":[0,1]}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
/*! OpenPGP.js v6.0.0-alpha.0 -
|
|
1
|
+
/*! OpenPGP.js v6.0.0-alpha.1.patch.0 - 2024-03-01 - this is LGPL licensed code, see LICENSE/our website https://openpgpjs.org/ for more information. */
|
|
2
2
|
const globalThis = typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3
3
|
|
|
4
4
|
import { w as wrapConstructor, S as SHA2, g as sha224, s as sha256, a as sha384, d as sha512, i as sha3_256, j as sha3_512 } from './sha3.mjs';
|
|
5
5
|
import './interface.mjs';
|
|
6
6
|
import './native.interface.mjs';
|
|
7
7
|
import './bn.interface.mjs';
|
|
8
|
-
import './bn.mjs';
|
|
9
8
|
|
|
10
9
|
// SHA1 was cryptographically broken.
|
|
11
10
|
// It is still widely used in legacy apps. Don't use it for a new protocol.
|