@noble/curves 2.0.1 → 2.2.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 +214 -122
- package/abstract/bls.d.ts +299 -16
- package/abstract/bls.d.ts.map +1 -1
- package/abstract/bls.js +82 -22
- package/abstract/bls.js.map +1 -1
- package/abstract/curve.d.ts +274 -27
- package/abstract/curve.d.ts.map +1 -1
- package/abstract/curve.js +177 -23
- package/abstract/curve.js.map +1 -1
- package/abstract/edwards.d.ts +166 -30
- package/abstract/edwards.d.ts.map +1 -1
- package/abstract/edwards.js +221 -86
- package/abstract/edwards.js.map +1 -1
- package/abstract/fft.d.ts +322 -10
- package/abstract/fft.d.ts.map +1 -1
- package/abstract/fft.js +154 -12
- package/abstract/fft.js.map +1 -1
- package/abstract/frost.d.ts +293 -0
- package/abstract/frost.d.ts.map +1 -0
- package/abstract/frost.js +704 -0
- package/abstract/frost.js.map +1 -0
- package/abstract/hash-to-curve.d.ts +173 -24
- package/abstract/hash-to-curve.d.ts.map +1 -1
- package/abstract/hash-to-curve.js +170 -31
- package/abstract/hash-to-curve.js.map +1 -1
- package/abstract/modular.d.ts +429 -37
- package/abstract/modular.d.ts.map +1 -1
- package/abstract/modular.js +414 -119
- package/abstract/modular.js.map +1 -1
- package/abstract/montgomery.d.ts +83 -12
- package/abstract/montgomery.d.ts.map +1 -1
- package/abstract/montgomery.js +32 -7
- package/abstract/montgomery.js.map +1 -1
- package/abstract/oprf.d.ts +164 -91
- package/abstract/oprf.d.ts.map +1 -1
- package/abstract/oprf.js +88 -29
- package/abstract/oprf.js.map +1 -1
- package/abstract/poseidon.d.ts +138 -7
- package/abstract/poseidon.d.ts.map +1 -1
- package/abstract/poseidon.js +178 -15
- package/abstract/poseidon.js.map +1 -1
- package/abstract/tower.d.ts +122 -3
- package/abstract/tower.d.ts.map +1 -1
- package/abstract/tower.js +323 -139
- package/abstract/tower.js.map +1 -1
- package/abstract/weierstrass.d.ts +339 -76
- package/abstract/weierstrass.d.ts.map +1 -1
- package/abstract/weierstrass.js +395 -205
- package/abstract/weierstrass.js.map +1 -1
- package/bls12-381.d.ts +16 -2
- package/bls12-381.d.ts.map +1 -1
- package/bls12-381.js +199 -209
- package/bls12-381.js.map +1 -1
- package/bn254.d.ts +11 -2
- package/bn254.d.ts.map +1 -1
- package/bn254.js +93 -38
- package/bn254.js.map +1 -1
- package/ed25519.d.ts +125 -14
- package/ed25519.d.ts.map +1 -1
- package/ed25519.js +202 -40
- package/ed25519.js.map +1 -1
- package/ed448.d.ts +108 -14
- package/ed448.d.ts.map +1 -1
- package/ed448.js +194 -42
- package/ed448.js.map +1 -1
- package/index.js +7 -1
- package/index.js.map +1 -1
- package/misc.d.ts +106 -7
- package/misc.d.ts.map +1 -1
- package/misc.js +141 -32
- package/misc.js.map +1 -1
- package/nist.d.ts +112 -11
- package/nist.d.ts.map +1 -1
- package/nist.js +139 -17
- package/nist.js.map +1 -1
- package/package.json +11 -6
- package/secp256k1.d.ts +92 -15
- package/secp256k1.d.ts.map +1 -1
- package/secp256k1.js +211 -28
- package/secp256k1.js.map +1 -1
- package/src/abstract/bls.ts +350 -67
- package/src/abstract/curve.ts +327 -44
- package/src/abstract/edwards.ts +367 -143
- package/src/abstract/fft.ts +369 -36
- package/src/abstract/frost.ts +1092 -0
- package/src/abstract/hash-to-curve.ts +255 -56
- package/src/abstract/modular.ts +591 -144
- package/src/abstract/montgomery.ts +114 -30
- package/src/abstract/oprf.ts +383 -194
- package/src/abstract/poseidon.ts +235 -35
- package/src/abstract/tower.ts +428 -159
- package/src/abstract/weierstrass.ts +710 -312
- package/src/bls12-381.ts +239 -236
- package/src/bn254.ts +107 -46
- package/src/ed25519.ts +227 -55
- package/src/ed448.ts +227 -57
- package/src/index.ts +7 -1
- package/src/misc.ts +154 -35
- package/src/nist.ts +143 -20
- package/src/secp256k1.ts +284 -41
- package/src/utils.ts +583 -81
- package/src/webcrypto.ts +302 -73
- package/utils.d.ts +457 -24
- package/utils.d.ts.map +1 -1
- package/utils.js +410 -53
- package/utils.js.map +1 -1
- package/webcrypto.d.ts +167 -25
- package/webcrypto.d.ts.map +1 -1
- package/webcrypto.js +165 -58
- package/webcrypto.js.map +1 -1
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import { abytes, asafenumber, asciiToBytes, bytesToNumberBE, concatBytes, isBytes, validateObject, } from "../utils.js";
|
|
1
|
+
import { abytes, asafenumber, asciiToBytes, bytesToNumberBE, copyBytes, concatBytes, isBytes, validateObject, } from "../utils.js";
|
|
2
2
|
import { FpInvertBatch, mod } from "./modular.js";
|
|
3
3
|
// Octet Stream to Integer. "spec" implementation of os2ip is 2.5x slower vs bytesToNumberBE.
|
|
4
4
|
const os2ip = bytesToNumberBE;
|
|
5
|
-
// Integer to Octet Stream (numberToBytesBE)
|
|
5
|
+
// Integer to Octet Stream (numberToBytesBE).
|
|
6
6
|
function i2osp(value, length) {
|
|
7
7
|
asafenumber(value);
|
|
8
8
|
asafenumber(length);
|
|
9
|
-
|
|
9
|
+
// This helper stays on the JS bitwise/u32 fast-path. Callers that need wider encodings should
|
|
10
|
+
// use bigint + numberToBytesBE instead of routing large widths through this small helper.
|
|
11
|
+
if (length < 0 || length > 4)
|
|
12
|
+
throw new Error('invalid I2OSP length: ' + length);
|
|
13
|
+
if (value < 0 || value > 2 ** (8 * length) - 1)
|
|
10
14
|
throw new Error('invalid I2OSP input: ' + value);
|
|
11
15
|
const res = Array.from({ length }).fill(0);
|
|
12
16
|
for (let i = length - 1; i >= 0; i--) {
|
|
@@ -15,6 +19,7 @@ function i2osp(value, length) {
|
|
|
15
19
|
}
|
|
16
20
|
return new Uint8Array(res);
|
|
17
21
|
}
|
|
22
|
+
// RFC 9380 only applies strxor() to equal-length strings; callers must preserve that invariant.
|
|
18
23
|
function strxor(a, b) {
|
|
19
24
|
const arr = new Uint8Array(a.length);
|
|
20
25
|
for (let i = 0; i < a.length; i++) {
|
|
@@ -27,11 +32,31 @@ function strxor(a, b) {
|
|
|
27
32
|
function normDST(DST) {
|
|
28
33
|
if (!isBytes(DST) && typeof DST !== 'string')
|
|
29
34
|
throw new Error('DST must be Uint8Array or ascii string');
|
|
30
|
-
|
|
35
|
+
const dst = typeof DST === 'string' ? asciiToBytes(DST) : DST;
|
|
36
|
+
// RFC 9380 §3.1 requirement 2: tags "MUST have nonzero length".
|
|
37
|
+
if (dst.length === 0)
|
|
38
|
+
throw new Error('DST must be non-empty');
|
|
39
|
+
return dst;
|
|
31
40
|
}
|
|
32
41
|
/**
|
|
33
|
-
* Produces a uniformly random byte string using a cryptographic hash
|
|
34
|
-
*
|
|
42
|
+
* Produces a uniformly random byte string using a cryptographic hash
|
|
43
|
+
* function H that outputs b bits.
|
|
44
|
+
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-5.3.1 | RFC 9380 section 5.3.1}.
|
|
45
|
+
* @param msg - Input message.
|
|
46
|
+
* @param DST - Domain separation tag. This helper normalizes DST, rejects empty DSTs, and
|
|
47
|
+
* oversize-hashes DST when needed.
|
|
48
|
+
* @param lenInBytes - Output length.
|
|
49
|
+
* @param H - Hash function.
|
|
50
|
+
* @returns Uniform byte string.
|
|
51
|
+
* @throws If the message, DST, hash, or output length is invalid. {@link Error}
|
|
52
|
+
* @example
|
|
53
|
+
* Expand one message into uniform bytes with the XMD construction.
|
|
54
|
+
*
|
|
55
|
+
* ```ts
|
|
56
|
+
* import { expand_message_xmd } from '@noble/curves/abstract/hash-to-curve.js';
|
|
57
|
+
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
58
|
+
* const uniform = expand_message_xmd(new TextEncoder().encode('hello noble'), 'DST', 32, sha256);
|
|
59
|
+
* ```
|
|
35
60
|
*/
|
|
36
61
|
export function expand_message_xmd(msg, DST, lenInBytes, H) {
|
|
37
62
|
abytes(msg);
|
|
@@ -45,12 +70,15 @@ export function expand_message_xmd(msg, DST, lenInBytes, H) {
|
|
|
45
70
|
if (lenInBytes > 65535 || ell > 255)
|
|
46
71
|
throw new Error('expand_message_xmd: invalid lenInBytes');
|
|
47
72
|
const DST_prime = concatBytes(DST, i2osp(DST.length, 1));
|
|
48
|
-
const Z_pad =
|
|
73
|
+
const Z_pad = new Uint8Array(r_in_bytes); // RFC 9380: Z_pad = I2OSP(0, s_in_bytes)
|
|
49
74
|
const l_i_b_str = i2osp(lenInBytes, 2); // len_in_bytes_str
|
|
50
75
|
const b = new Array(ell);
|
|
51
76
|
const b_0 = H(concatBytes(Z_pad, msg, l_i_b_str, i2osp(0, 1), DST_prime));
|
|
52
77
|
b[0] = H(concatBytes(b_0, i2osp(1, 1), DST_prime));
|
|
53
|
-
|
|
78
|
+
// `b[0]` already stores RFC `b_1`, so only derive `b_2..b_ell` here. The old `<= ell`
|
|
79
|
+
// loop computed one extra tail block, which was usually sliced away but broke at max `ell=255`
|
|
80
|
+
// by reaching `I2OSP(256, 1)`.
|
|
81
|
+
for (let i = 1; i < ell; i++) {
|
|
54
82
|
const args = [strxor(b_0, b[i - 1]), i2osp(i + 1, 1), DST_prime];
|
|
55
83
|
b[i] = H(concatBytes(...args));
|
|
56
84
|
}
|
|
@@ -62,14 +90,36 @@ export function expand_message_xmd(msg, DST, lenInBytes, H) {
|
|
|
62
90
|
* 1. The collision resistance of H MUST be at least k bits.
|
|
63
91
|
* 2. H MUST be an XOF that has been proved indifferentiable from
|
|
64
92
|
* a random oracle under a reasonable cryptographic assumption.
|
|
65
|
-
*
|
|
93
|
+
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-5.3.2 | RFC 9380 section 5.3.2}.
|
|
94
|
+
* @param msg - Input message.
|
|
95
|
+
* @param DST - Domain separation tag. This helper normalizes DST, rejects empty DSTs, and
|
|
96
|
+
* oversize-hashes DST when needed.
|
|
97
|
+
* @param lenInBytes - Output length.
|
|
98
|
+
* @param k - Target security level.
|
|
99
|
+
* @param H - XOF hash function.
|
|
100
|
+
* @returns Uniform byte string.
|
|
101
|
+
* @throws If the message, DST, XOF, or output length is invalid. {@link Error}
|
|
102
|
+
* @example
|
|
103
|
+
* Expand one message into uniform bytes with the XOF construction.
|
|
104
|
+
*
|
|
105
|
+
* ```ts
|
|
106
|
+
* import { expand_message_xof } from '@noble/curves/abstract/hash-to-curve.js';
|
|
107
|
+
* import { shake256 } from '@noble/hashes/sha3.js';
|
|
108
|
+
* const uniform = expand_message_xof(
|
|
109
|
+
* new TextEncoder().encode('hello noble'),
|
|
110
|
+
* 'DST',
|
|
111
|
+
* 32,
|
|
112
|
+
* 128,
|
|
113
|
+
* shake256
|
|
114
|
+
* );
|
|
115
|
+
* ```
|
|
66
116
|
*/
|
|
67
117
|
export function expand_message_xof(msg, DST, lenInBytes, k, H) {
|
|
68
118
|
abytes(msg);
|
|
69
119
|
asafenumber(lenInBytes);
|
|
70
120
|
DST = normDST(DST);
|
|
71
121
|
// https://www.rfc-editor.org/rfc/rfc9380#section-5.3.3
|
|
72
|
-
// DST = H(
|
|
122
|
+
// RFC 9380 §5.3.3: DST = H("H2C-OVERSIZE-DST-" || a_very_long_DST, ceil(2 * k / 8)).
|
|
73
123
|
if (DST.length > 255) {
|
|
74
124
|
const dkLen = Math.ceil((2 * k) / 8);
|
|
75
125
|
DST = H.create({ dkLen }).update(asciiToBytes('H2C-OVERSIZE-DST-')).update(DST).digest();
|
|
@@ -86,11 +136,27 @@ export function expand_message_xof(msg, DST, lenInBytes, k, H) {
|
|
|
86
136
|
}
|
|
87
137
|
/**
|
|
88
138
|
* Hashes arbitrary-length byte strings to a list of one or more elements of a finite field F.
|
|
89
|
-
*
|
|
90
|
-
* @param msg
|
|
91
|
-
* @param count
|
|
92
|
-
* @param options
|
|
93
|
-
* @returns [u_0, ..., u_(count - 1)]
|
|
139
|
+
* See {@link https://www.rfc-editor.org/rfc/rfc9380#section-5.2 | RFC 9380 section 5.2}.
|
|
140
|
+
* @param msg - Input message bytes.
|
|
141
|
+
* @param count - Number of field elements to derive. Must be `>= 1`.
|
|
142
|
+
* @param options - RFC 9380 options. See {@link H2COpts}. `m` must be `>= 1`.
|
|
143
|
+
* @returns `[u_0, ..., u_(count - 1)]`, a list of field elements.
|
|
144
|
+
* @throws If the expander choice or RFC 9380 options are invalid. {@link Error}
|
|
145
|
+
* @example
|
|
146
|
+
* Hash one message into field elements before mapping it onto a curve.
|
|
147
|
+
*
|
|
148
|
+
* ```ts
|
|
149
|
+
* import { hash_to_field } from '@noble/curves/abstract/hash-to-curve.js';
|
|
150
|
+
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
151
|
+
* const scalars = hash_to_field(new TextEncoder().encode('hello noble'), 2, {
|
|
152
|
+
* DST: 'DST',
|
|
153
|
+
* p: 17n,
|
|
154
|
+
* m: 1,
|
|
155
|
+
* k: 128,
|
|
156
|
+
* expand: 'xmd',
|
|
157
|
+
* hash: sha256,
|
|
158
|
+
* });
|
|
159
|
+
* ```
|
|
94
160
|
*/
|
|
95
161
|
export function hash_to_field(msg, count, options) {
|
|
96
162
|
validateObject(options, {
|
|
@@ -103,6 +169,12 @@ export function hash_to_field(msg, count, options) {
|
|
|
103
169
|
asafenumber(hash.outputLen, 'valid hash');
|
|
104
170
|
abytes(msg);
|
|
105
171
|
asafenumber(count);
|
|
172
|
+
// RFC 9380 §5.2 defines hash_to_field over a list of one or more field elements and requires
|
|
173
|
+
// extension degree `m >= 1`; rejecting here avoids degenerate `[]` / `[[]]` helper outputs.
|
|
174
|
+
if (count < 1)
|
|
175
|
+
throw new Error('hash_to_field: expected count >= 1');
|
|
176
|
+
if (m < 1)
|
|
177
|
+
throw new Error('hash_to_field: expected m >= 1');
|
|
106
178
|
const log2p = p.toString(2).length;
|
|
107
179
|
const L = Math.ceil((log2p + k) / 8); // section 5.1 of ietf draft link above
|
|
108
180
|
const len_in_bytes = count * m * L;
|
|
@@ -132,49 +204,115 @@ export function hash_to_field(msg, count, options) {
|
|
|
132
204
|
}
|
|
133
205
|
return u;
|
|
134
206
|
}
|
|
207
|
+
/**
|
|
208
|
+
* @param field - Field implementation.
|
|
209
|
+
* @param map - Isogeny coefficients.
|
|
210
|
+
* @returns Isogeny mapping helper.
|
|
211
|
+
* @example
|
|
212
|
+
* Build one rational isogeny map, then apply it to affine x/y coordinates.
|
|
213
|
+
*
|
|
214
|
+
* ```ts
|
|
215
|
+
* import { isogenyMap } from '@noble/curves/abstract/hash-to-curve.js';
|
|
216
|
+
* import { Field } from '@noble/curves/abstract/modular.js';
|
|
217
|
+
* const Fp = Field(17n);
|
|
218
|
+
* const iso = isogenyMap(Fp, [[0n, 1n], [1n], [1n], [1n]]);
|
|
219
|
+
* const point = iso(3n, 5n);
|
|
220
|
+
* ```
|
|
221
|
+
*/
|
|
135
222
|
export function isogenyMap(field, map) {
|
|
136
223
|
// Make same order as in spec
|
|
137
224
|
const coeff = map.map((i) => Array.from(i).reverse());
|
|
138
225
|
return (x, y) => {
|
|
139
226
|
const [xn, xd, yn, yd] = coeff.map((val) => val.reduce((acc, i) => field.add(field.mul(acc, x), i)));
|
|
140
|
-
// 6.6.3
|
|
141
|
-
//
|
|
142
|
-
//
|
|
143
|
-
//
|
|
227
|
+
// RFC 9380 §6.6.3 / Appendix E: denominator-zero exceptional cases must
|
|
228
|
+
// return the identity on E.
|
|
229
|
+
// Shipped Weierstrass consumers encode that affine identity as all-zero
|
|
230
|
+
// coordinates, so `passZero=true` intentionally collapses zero
|
|
231
|
+
// denominators to `{ x: 0, y: 0 }`.
|
|
144
232
|
const [xd_inv, yd_inv] = FpInvertBatch(field, [xd, yd], true);
|
|
145
233
|
x = field.mul(xn, xd_inv); // xNum / xDen
|
|
146
234
|
y = field.mul(y, field.mul(yn, yd_inv)); // y * (yNum / yDev)
|
|
147
235
|
return { x, y };
|
|
148
236
|
};
|
|
149
237
|
}
|
|
150
|
-
|
|
151
|
-
|
|
238
|
+
// Keep the shared DST removable when the selected bundle never hashes to scalar.
|
|
239
|
+
// Callers that need protocol-specific scalar domain separation must override this generic default.
|
|
240
|
+
// RFC 9497 §§4.1-4.5 use this ASCII prefix before appending the ciphersuite context string.
|
|
241
|
+
// Export a string instead of mutable bytes so callers cannot poison default hash-to-scalar behavior
|
|
242
|
+
// by mutating a shared Uint8Array in place.
|
|
243
|
+
export const _DST_scalar = 'HashToScalar-';
|
|
244
|
+
/**
|
|
245
|
+
* Creates hash-to-curve methods from EC Point and mapToCurve function. See {@link H2CHasher}.
|
|
246
|
+
* @param Point - Point constructor.
|
|
247
|
+
* @param mapToCurve - Map-to-curve function.
|
|
248
|
+
* @param defaults - Default hash-to-curve options. This object is frozen in place and reused as
|
|
249
|
+
* the shared defaults bundle for the returned helpers.
|
|
250
|
+
* @returns Hash-to-curve helper namespace.
|
|
251
|
+
* @throws If the map-to-curve callback or default hash-to-curve options are invalid. {@link Error}
|
|
252
|
+
* @example
|
|
253
|
+
* Bundle hash-to-curve, hash-to-scalar, and encode-to-curve helpers for one curve.
|
|
254
|
+
*
|
|
255
|
+
* ```ts
|
|
256
|
+
* import { createHasher } from '@noble/curves/abstract/hash-to-curve.js';
|
|
257
|
+
* import { p256 } from '@noble/curves/nist.js';
|
|
258
|
+
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
259
|
+
* const hasher = createHasher(p256.Point, () => p256.Point.BASE.toAffine(), {
|
|
260
|
+
* DST: 'P256_XMD:SHA-256_SSWU_RO_',
|
|
261
|
+
* encodeDST: 'P256_XMD:SHA-256_SSWU_NU_',
|
|
262
|
+
* p: p256.Point.Fp.ORDER,
|
|
263
|
+
* m: 1,
|
|
264
|
+
* k: 128,
|
|
265
|
+
* expand: 'xmd',
|
|
266
|
+
* hash: sha256,
|
|
267
|
+
* });
|
|
268
|
+
* const point = hasher.encodeToCurve(new TextEncoder().encode('hello noble'));
|
|
269
|
+
* ```
|
|
270
|
+
*/
|
|
152
271
|
export function createHasher(Point, mapToCurve, defaults) {
|
|
153
272
|
if (typeof mapToCurve !== 'function')
|
|
154
273
|
throw new Error('mapToCurve() must be defined');
|
|
274
|
+
// `Point` is intentionally not shape-validated eagerly here: point constructors vary across
|
|
275
|
+
// curve families, so this helper only checks the hooks it can validate cheaply. Misconfigured
|
|
276
|
+
// suites fail later when hashing first touches Point.fromAffine / Point.ZERO / clearCofactor().
|
|
277
|
+
const snapshot = (src) => Object.freeze({
|
|
278
|
+
...src,
|
|
279
|
+
DST: isBytes(src.DST) ? copyBytes(src.DST) : src.DST,
|
|
280
|
+
...(src.encodeDST === undefined
|
|
281
|
+
? {}
|
|
282
|
+
: { encodeDST: isBytes(src.encodeDST) ? copyBytes(src.encodeDST) : src.encodeDST }),
|
|
283
|
+
});
|
|
284
|
+
// Keep one private defaults snapshot for actual hashing and expose fresh
|
|
285
|
+
// detached snapshots via the public getter.
|
|
286
|
+
// Otherwise a caller could mutate `hasher.defaults.DST` in place and poison
|
|
287
|
+
// the singleton hasher for every other consumer in the same process.
|
|
288
|
+
const safeDefaults = snapshot(defaults);
|
|
155
289
|
function map(num) {
|
|
156
290
|
return Point.fromAffine(mapToCurve(num));
|
|
157
291
|
}
|
|
158
292
|
function clear(initial) {
|
|
159
293
|
const P = initial.clearCofactor();
|
|
294
|
+
// Keep ZERO as the algebraic cofactor-clearing result here; strict public point-validity
|
|
295
|
+
// surfaces may still reject it later, but createHasher.clear() itself is not that boundary.
|
|
160
296
|
if (P.equals(Point.ZERO))
|
|
161
|
-
return Point.ZERO;
|
|
297
|
+
return Point.ZERO;
|
|
162
298
|
P.assertValidity();
|
|
163
299
|
return P;
|
|
164
300
|
}
|
|
165
|
-
return {
|
|
166
|
-
defaults
|
|
301
|
+
return Object.freeze({
|
|
302
|
+
get defaults() {
|
|
303
|
+
return snapshot(safeDefaults);
|
|
304
|
+
},
|
|
167
305
|
Point,
|
|
168
306
|
hashToCurve(msg, options) {
|
|
169
|
-
const opts = Object.assign({},
|
|
307
|
+
const opts = Object.assign({}, safeDefaults, options);
|
|
170
308
|
const u = hash_to_field(msg, 2, opts);
|
|
171
309
|
const u0 = map(u[0]);
|
|
172
310
|
const u1 = map(u[1]);
|
|
173
311
|
return clear(u0.add(u1));
|
|
174
312
|
},
|
|
175
313
|
encodeToCurve(msg, options) {
|
|
176
|
-
const optsDst =
|
|
177
|
-
const opts = Object.assign({},
|
|
314
|
+
const optsDst = safeDefaults.encodeDST ? { DST: safeDefaults.encodeDST } : {};
|
|
315
|
+
const opts = Object.assign({}, safeDefaults, optsDst, options);
|
|
178
316
|
const u = hash_to_field(msg, 1, opts);
|
|
179
317
|
const u0 = map(u[0]);
|
|
180
318
|
return clear(u0);
|
|
@@ -182,7 +320,7 @@ export function createHasher(Point, mapToCurve, defaults) {
|
|
|
182
320
|
/** See {@link H2CHasher} */
|
|
183
321
|
mapToCurve(scalars) {
|
|
184
322
|
// Curves with m=1 accept only single scalar
|
|
185
|
-
if (
|
|
323
|
+
if (safeDefaults.m === 1) {
|
|
186
324
|
if (typeof scalars !== 'bigint')
|
|
187
325
|
throw new Error('expected bigint (m=1)');
|
|
188
326
|
return clear(map([scalars]));
|
|
@@ -195,13 +333,14 @@ export function createHasher(Point, mapToCurve, defaults) {
|
|
|
195
333
|
return clear(map(scalars));
|
|
196
334
|
},
|
|
197
335
|
// hash_to_scalar can produce 0: https://www.rfc-editor.org/errata/eid8393
|
|
198
|
-
// RFC 9380, draft-irtf-cfrg-bbs-signatures-08
|
|
336
|
+
// RFC 9380, draft-irtf-cfrg-bbs-signatures-08. Default scalar DST is the shared generic
|
|
337
|
+
// `HashToScalar-` prefix above unless the caller overrides it per invocation.
|
|
199
338
|
hashToScalar(msg, options) {
|
|
200
339
|
// @ts-ignore
|
|
201
340
|
const N = Point.Fn.ORDER;
|
|
202
|
-
const opts = Object.assign({},
|
|
341
|
+
const opts = Object.assign({}, safeDefaults, { p: N, m: 1, DST: _DST_scalar }, options);
|
|
203
342
|
return hash_to_field(msg, 1, opts)[0][0];
|
|
204
343
|
},
|
|
205
|
-
};
|
|
344
|
+
});
|
|
206
345
|
}
|
|
207
346
|
//# sourceMappingURL=hash-to-curve.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,eAAe,EACf,WAAW,EACX,OAAO,EACP,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,GAAG,EAAe,MAAM,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"hash-to-curve.js","sourceRoot":"","sources":["../src/abstract/hash-to-curve.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,MAAM,EACN,WAAW,EACX,YAAY,EACZ,eAAe,EACf,SAAS,EACT,WAAW,EACX,OAAO,EACP,cAAc,GACf,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,aAAa,EAAE,GAAG,EAAe,MAAM,cAAc,CAAC;AA0G/D,6FAA6F;AAC7F,MAAM,KAAK,GAAG,eAAe,CAAC;AAE9B,6CAA6C;AAC7C,SAAS,KAAK,CAAC,KAAa,EAAE,MAAc;IAC1C,WAAW,CAAC,KAAK,CAAC,CAAC;IACnB,WAAW,CAAC,MAAM,CAAC,CAAC;IACpB,8FAA8F;IAC9F,0FAA0F;IAC1F,IAAI,MAAM,GAAG,CAAC,IAAI,MAAM,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,wBAAwB,GAAG,MAAM,CAAC,CAAC;IACjF,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,uBAAuB,GAAG,KAAK,CAAC,CAAC;IACjG,MAAM,GAAG,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAa,CAAC;IACvD,KAAK,IAAI,CAAC,GAAG,MAAM,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC;QACrC,GAAG,CAAC,CAAC,CAAC,GAAG,KA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