diff --git a/src/abstract/hash-to-curve.ts b/src/abstract/hash-to-curve.ts index 2900176..d18a5a5 100644 --- a/src/abstract/hash-to-curve.ts +++ b/src/abstract/hash-to-curve.ts @@ -17,7 +17,7 @@ export type Opts = { p: bigint; m: number; k: number; - expand?: 'xmd' | 'xof'; + expand: 'xmd' | 'xof'; hash: CHash; }; @@ -145,10 +145,10 @@ export function hash_to_field(msg: Uint8Array, count: number, options: Opts): bi prb = expand_message_xmd(msg, DST, len_in_bytes, hash); } else if (expand === 'xof') { prb = expand_message_xof(msg, DST, len_in_bytes, k, hash); - } else if (expand === undefined) { + } else if (expand === '_internal_pass') { // for internal tests only prb = msg; } else { - throw new Error('expand must be "xmd", "xof" or undefined'); + throw new Error('expand must be "xmd" or "xof"'); } const u = new Array(count); for (let i = 0; i < count; i++) { diff --git a/test/bls12-381.test.js b/test/bls12-381.test.js index 8e699c4..9b19853 100644 --- a/test/bls12-381.test.js +++ b/test/bls12-381.test.js @@ -858,7 +858,7 @@ describe('bls12-381/basic', () => { const options = { p: bls.params.r, m: 1, - expand: undefined, + expand: '_internal_pass', }; for (let vector of SCALAR_VECTORS) { const [okmAscii, expectedHex] = vector;