| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 4f4ff15 commit f69ed4b
14 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1869,19 +1869,27 @@ the message. | |||
| 1869 | 1869 | ||
| 1870 | 1870 | <!-- YAML | |
| 1871 | 1871 | added: v24.7.0 | |
| 1872 | + changes: | ||
| 1873 | + - version: REPLACEME | ||
| 1874 | + pr-url: https://github.com/nodejs/node/pull/61875 | ||
| 1875 | + description: Renamed `cShakeParams.length` to `cShakeParams.outputLength`. | ||
| 1872 | 1876 | --> | |
| 1873 | 1877 | ||
| 1874 | - #### `cShakeParams.customization` | ||
| 1878 | + #### `cShakeParams.name` | ||
| 1875 | 1879 | ||
| 1876 | 1880 | <!-- YAML | |
| 1877 | 1881 | added: v24.7.0 | |
| 1878 | 1882 | --> | |
| 1879 | 1883 | ||
| 1880 | - * Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} | ||
| 1884 | + * Type: {string} Must be `'cSHAKE128'`[^modern-algos] or `'cSHAKE256'`[^modern-algos] | ||
| 1881 | 1885 | ||
| 1882 | - The `customization` member represents the customization string. | ||
| 1883 | - The Node.js Web Crypto API implementation only supports zero-length customization | ||
| 1884 | - which is equivalent to not providing customization at all. | ||
| 1886 | + #### `cShakeParams.outputLength` | ||
| 1887 | + | ||
| 1888 | + <!-- YAML | ||
| 1889 | + added: REPLACEME | ||
| 1890 | + --> | ||
| 1891 | + | ||
| 1892 | + * Type: {number} represents the requested output length in bits. | ||
| 1885 | 1893 | ||
| 1886 | 1894 | #### `cShakeParams.functionName` | |
| 1887 | 1895 | ||
@@ -1896,21 +1904,17 @@ functions based on cSHAKE. | |||
| 1896 | 1904 | The Node.js Web Crypto API implementation only supports zero-length functionName | |
| 1897 | 1905 | which is equivalent to not providing functionName at all. | |
| 1898 | 1906 | ||
| 1899 | - #### `cShakeParams.length` | ||
| 1907 | + #### `cShakeParams.customization` | ||
| 1900 | 1908 | ||
| 1901 | 1909 | <!-- YAML | |
| 1902 | 1910 | added: v24.7.0 | |
| 1903 | 1911 | --> | |
| 1904 | 1912 | ||
| 1905 | - * Type: {number} represents the requested output length in bits. | ||
| 1906 | - | ||
| 1907 | - #### `cShakeParams.name` | ||
| 1908 | - | ||
| 1909 | - <!-- YAML | ||
| 1910 | - added: v24.7.0 | ||
| 1911 | - --> | ||
| 1913 | + * Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} | ||
| 1912 | 1914 | ||
| 1913 | - * Type: {string} Must be `'cSHAKE128'`[^modern-algos] or `'cSHAKE256'`[^modern-algos] | ||
| 1915 | + The `customization` member represents the customization string. | ||
| 1916 | + The Node.js Web Crypto API implementation only supports zero-length customization | ||
| 1917 | + which is equivalent to not providing customization at all. | ||
| 1914 | 1918 | ||
| 1915 | 1919 | ### Class: `EcdhKeyDeriveParams` | |
| 1916 | 1920 | ||
@@ -2387,6 +2391,10 @@ added: v24.8.0 | |||
| 2387 | 2391 | ||
| 2388 | 2392 | <!-- YAML | |
| 2389 | 2393 | added: v24.8.0 | |
| 2394 | + changes: | ||
| 2395 | + - version: REPLACEME | ||
| 2396 | + pr-url: https://github.com/nodejs/node/pull/61875 | ||
| 2397 | + description: Renamed `kmacParams.length` to `kmacParams.outputLength`. | ||
| 2390 | 2398 | --> | |
| 2391 | 2399 | ||
| 2392 | 2400 | #### `kmacParams.algorithm` | |
@@ -2397,25 +2405,25 @@ added: v24.8.0 | |||
| 2397 | 2405 | ||
| 2398 | 2406 | * Type: {string} Must be `'KMAC128'` or `'KMAC256'`. | |
| 2399 | 2407 | ||
| 2400 | - #### `kmacParams.customization` | ||
| 2408 | + #### `kmacParams.outputLength` | ||
| 2401 | 2409 | ||
| 2402 | 2410 | <!-- YAML | |
| 2403 | - added: v24.8.0 | ||
| 2411 | + added: REPLACEME | ||
| 2404 | 2412 | --> | |
| 2405 | 2413 | ||
| 2406 | - * Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} | ||
| 2414 | + * Type: {number} | ||
| 2407 | 2415 | ||
| 2408 | - The `customization` member represents the optional customization string. | ||
| 2416 | + The length of the output in bytes. This must be a positive integer. | ||
| 2409 | 2417 | ||
| 2410 | - #### `kmacParams.length` | ||
| 2418 | + #### `kmacParams.customization` | ||
| 2411 | 2419 | ||
| 2412 | 2420 | <!-- YAML | |
| 2413 | 2421 | added: v24.8.0 | |
| 2414 | 2422 | --> | |
| 2415 | 2423 | ||
| 2416 | - * Type: {number} | ||
| 2424 | + * Type: {ArrayBuffer|TypedArray|DataView|Buffer|undefined} | ||
| 2417 | 2425 | ||
| 2418 | - The length of the output in bytes. This must be a positive integer. | ||
| 2426 | + The `customization` member represents the optional customization string. | ||
| 2419 | 2427 | ||
| 2420 | 2428 | ### Class: `Pbkdf2Params` | |
| 2421 | 2429 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -223,7 +223,7 @@ async function asyncDigest(algorithm, data) { | |||
| 223 | 223 | kCryptoJobAsync, | |
| 224 | 224 | normalizeHashName(algorithm.name), | |
| 225 | 225 | data, | |
| 226 | - algorithm.length)); | ||
| 226 | + algorithm.outputLength)); | ||
| 227 | 227 | } | |
| 228 | 228 | ||
| 229 | 229 | throw lazyDOMException('Unrecognized algorithm name', 'NotSupportedError'); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -234,7 +234,7 @@ function kmacSignVerify(key, data, algorithm, signature) { | |||
| 234 | 234 | key[kKeyObject][kHandle], | |
| 235 | 235 | algorithm.name, | |
| 236 | 236 | algorithm.customization, | |
| 237 | - algorithm.length / 8, | ||
| 237 | + algorithm.outputLength / 8, | ||
| 238 | 238 | data, | |
| 239 | 239 | signature)); | |
| 240 | 240 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -591,14 +591,14 @@ converters.CShakeParams = createDictionaryConverter( | |||
| 591 | 591 | 'CShakeParams', [ | |
| 592 | 592 | ...new SafeArrayIterator(dictAlgorithm), | |
| 593 | 593 | { | |
| 594 | - key: 'length', | ||
| 594 | + key: 'outputLength', | ||
| 595 | 595 | converter: (V, opts) => | |
| 596 | 596 | converters['unsigned long'](V, { ...opts, enforceRange: true }), | |
| 597 | 597 | validator: (V, opts) => { | |
| 598 | 598 | // The Web Crypto spec allows for SHAKE output length that are not multiples of | |
| 599 | 599 | // 8. We don't. | |
| 600 | 600 | if (V % 8) | |
| 601 | - throw lazyDOMException('Unsupported CShakeParams length', 'NotSupportedError'); | ||
| 601 | + throw lazyDOMException('Unsupported CShakeParams outputLength', 'NotSupportedError'); | ||
| 602 | 602 | }, | |
| 603 | 603 | required: true, | |
| 604 | 604 | }, | |
@@ -881,13 +881,13 @@ converters.KmacParams = createDictionaryConverter( | |||
| 881 | 881 | 'KmacParams', [ | |
| 882 | 882 | ...new SafeArrayIterator(dictAlgorithm), | |
| 883 | 883 | { | |
| 884 | - key: 'length', | ||
| 884 | + key: 'outputLength', | ||
| 885 | 885 | converter: (V, opts) => | |
| 886 | 886 | converters['unsigned long'](V, { ...opts, enforceRange: true }), | |
| 887 | 887 | validator: (V, opts) => { | |
| 888 | 888 | // The Web Crypto spec allows for KMAC output length that are not multiples of 8. We don't. | |
| 889 | 889 | if (V % 8) | |
| 890 | - throw lazyDOMException('Unsupported KmacParams length', 'NotSupportedError'); | ||
| 890 | + throw lazyDOMException('Unsupported KmacParams outputLength', 'NotSupportedError'); | ||
| 891 | 891 | }, | |
| 892 | 892 | required: true, | |
| 893 | 893 | }, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,7 +13,7 @@ module.exports = function() { | |||
| 13 | 13 | ]), | |
| 14 | 14 | data: Buffer.from([0x00, 0x01, 0x02, 0x03]), | |
| 15 | 15 | customization: undefined, | |
| 16 | - length: 256, | ||
| 16 | + outputLength: 256, | ||
| 17 | 17 | expected: Buffer.from([ | |
| 18 | 18 | 0xe5, 0x78, 0x0b, 0x0d, 0x3e, 0xa6, 0xf7, 0xd3, 0xa4, 0x29, 0xc5, 0x70, | |
| 19 | 19 | 0x6a, 0xa4, 0x3a, 0x00, 0xfa, 0xdb, 0xd7, 0xd4, 0x96, 0x28, 0x83, 0x9e, | |
@@ -30,7 +30,7 @@ module.exports = function() { | |||
| 30 | 30 | ]), | |
| 31 | 31 | data: Buffer.from([0x00, 0x01, 0x02, 0x03]), | |
| 32 | 32 | customization: Buffer.from('My Tagged Application'), | |
| 33 | - length: 256, | ||
| 33 | + outputLength: 256, | ||
| 34 | 34 | expected: Buffer.from([ | |
| 35 | 35 | 0x3b, 0x1f, 0xba, 0x96, 0x3c, 0xd8, 0xb0, 0xb5, 0x9e, 0x8c, 0x1a, 0x6d, | |
| 36 | 36 | 0x71, 0x88, 0x8b, 0x71, 0x43, 0x65, 0x1a, 0xf8, 0xba, 0x0a, 0x70, 0x70, | |
@@ -47,7 +47,7 @@ module.exports = function() { | |||
| 47 | 47 | ]), | |
| 48 | 48 | data: Buffer.from(Array.from({ length: 200 }, (_, i) => i)), // 0x00-0xC7 | |
| 49 | 49 | customization: Buffer.from('My Tagged Application'), | |
| 50 | - length: 256, | ||
| 50 | + outputLength: 256, | ||
| 51 | 51 | expected: Buffer.from([ | |
| 52 | 52 | 0x1f, 0x5b, 0x4e, 0x6c, 0xca, 0x02, 0x20, 0x9e, 0x0d, 0xcb, 0x5c, 0xa6, | |
| 53 | 53 | 0x35, 0xb8, 0x9a, 0x15, 0xe2, 0x71, 0xec, 0xc7, 0x60, 0x07, 0x1d, 0xfd, | |
@@ -64,7 +64,7 @@ module.exports = function() { | |||
| 64 | 64 | ]), | |
| 65 | 65 | data: Buffer.from([0x00, 0x01, 0x02, 0x03]), | |
| 66 | 66 | customization: Buffer.from('My Tagged Application'), | |
| 67 | - length: 512, | ||
| 67 | + outputLength: 512, | ||
| 68 | 68 | expected: Buffer.from([ | |
| 69 | 69 | 0x20, 0xc5, 0x70, 0xc3, 0x13, 0x46, 0xf7, 0x03, 0xc9, 0xac, 0x36, 0xc6, | |
| 70 | 70 | 0x1c, 0x03, 0xcb, 0x64, 0xc3, 0x97, 0x0d, 0x0c, 0xfc, 0x78, 0x7e, 0x9b, | |
@@ -84,7 +84,7 @@ module.exports = function() { | |||
| 84 | 84 | ]), | |
| 85 | 85 | data: Buffer.from(Array.from({ length: 200 }, (_, i) => i)), // 0x00-0xC7 | |
| 86 | 86 | customization: undefined, | |
| 87 | - length: 512, | ||
| 87 | + outputLength: 512, | ||
| 88 | 88 | expected: Buffer.from([ | |
| 89 | 89 | 0x75, 0x35, 0x8c, 0xf3, 0x9e, 0x41, 0x49, 0x4e, 0x94, 0x97, 0x07, 0x92, | |
| 90 | 90 | 0x7c, 0xee, 0x0a, 0xf2, 0x0a, 0x3f, 0xf5, 0x53, 0x90, 0x4c, 0x86, 0xb0, | |
@@ -104,7 +104,7 @@ module.exports = function() { | |||
| 104 | 104 | ]), | |
| 105 | 105 | data: Buffer.from(Array.from({ length: 200 }, (_, i) => i)), // 0x00-0xC7 | |
| 106 | 106 | customization: Buffer.from('My Tagged Application'), | |
| 107 | - length: 512, | ||
| 107 | + outputLength: 512, | ||
| 108 | 108 | expected: Buffer.from([ | |
| 109 | 109 | 0xb5, 0x86, 0x18, 0xf7, 0x1f, 0x92, 0xe1, 0xd5, 0x6c, 0x1b, 0x8c, 0x55, | |
| 110 | 110 | 0xdd, 0xd7, 0xcd, 0x18, 0x8b, 0x97, 0xb4, 0xca, 0x4d, 0x99, 0x83, 0x1e, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,17 +17,17 @@ const X25519 = await subtle.generateKey('X25519', false, ['deriveBits', 'deriveK | |||
| 17 | 17 | export const vectors = { | |
| 18 | 18 | 'digest': [ | |
| 19 | 19 | [false, 'cSHAKE128'], | |
| 20 | - [shake128, { name: 'cSHAKE128', length: 128 }], | ||
| 21 | - [shake128, { name: 'cSHAKE128', length: 128, functionName: Buffer.alloc(0), customization: Buffer.alloc(0) }], | ||
| 22 | - [false, { name: 'cSHAKE128', length: 128, functionName: Buffer.alloc(1) }], | ||
| 23 | - [false, { name: 'cSHAKE128', length: 128, customization: Buffer.alloc(1) }], | ||
| 24 | - [false, { name: 'cSHAKE128', length: 127 }], | ||
| 20 | + [shake128, { name: 'cSHAKE128', outputLength: 128 }], | ||
| 21 | + [shake128, { name: 'cSHAKE128', outputLength: 128, functionName: Buffer.alloc(0), customization: Buffer.alloc(0) }], | ||
| 22 | + [false, { name: 'cSHAKE128', outputLength: 128, functionName: Buffer.alloc(1) }], | ||
| 23 | + [false, { name: 'cSHAKE128', outputLength: 128, customization: Buffer.alloc(1) }], | ||
| 24 | + [false, { name: 'cSHAKE128', outputLength: 127 }], | ||
| 25 | 25 | [false, 'cSHAKE256'], | |
| 26 | - [shake256, { name: 'cSHAKE256', length: 256 }], | ||
| 27 | - [shake256, { name: 'cSHAKE256', length: 256, functionName: Buffer.alloc(0), customization: Buffer.alloc(0) }], | ||
| 28 | - [false, { name: 'cSHAKE256', length: 256, functionName: Buffer.alloc(1) }], | ||
| 29 | - [false, { name: 'cSHAKE256', length: 256, customization: Buffer.alloc(1) }], | ||
| 30 | - [false, { name: 'cSHAKE256', length: 255 }], | ||
| 26 | + [shake256, { name: 'cSHAKE256', outputLength: 256 }], | ||
| 27 | + [shake256, { name: 'cSHAKE256', outputLength: 256, functionName: Buffer.alloc(0), customization: Buffer.alloc(0) }], | ||
| 28 | + [false, { name: 'cSHAKE256', outputLength: 256, functionName: Buffer.alloc(1) }], | ||
| 29 | + [false, { name: 'cSHAKE256', outputLength: 256, customization: Buffer.alloc(1) }], | ||
| 30 | + [false, { name: 'cSHAKE256', outputLength: 255 }], | ||
| 31 | 31 | ], | |
| 32 | 32 | 'sign': [ | |
| 33 | 33 | [pqc, 'ML-DSA-44'], | |
@@ -44,8 +44,8 @@ export const vectors = { | |||
| 44 | 44 | [false, 'Argon2id'], | |
| 45 | 45 | [false, 'KMAC128'], | |
| 46 | 46 | [false, 'KMAC256'], | |
| 47 | - [kmac, { name: 'KMAC128', length: 256 }], | ||
| 48 | - [kmac, { name: 'KMAC256', length: 256 }], | ||
| 47 | + [kmac, { name: 'KMAC128', outputLength: 256 }], | ||
| 48 | + [kmac, { name: 'KMAC256', outputLength: 256 }], | ||
| 49 | 49 | ], | |
| 50 | 50 | 'generateKey': [ | |
| 51 | 51 | [pqc, 'ML-DSA-44'], | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -34,7 +34,7 @@ Last update: | |||
| 34 | 34 | - wasm/jsapi: https://github.com/web-platform-tests/wpt/tree/cde25e7e3c/wasm/jsapi | |
| 35 | 35 | - wasm/webapi: https://github.com/web-platform-tests/wpt/tree/fd1b23eeaa/wasm/webapi | |
| 36 | 36 | - web-locks: https://github.com/web-platform-tests/wpt/tree/10a122a6bc/web-locks | |
| 37 | - - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/6a1c545d77/WebCryptoAPI | ||
| 37 | + - WebCryptoAPI: https://github.com/web-platform-tests/wpt/tree/0acea989ac/WebCryptoAPI | ||
| 38 | 38 | - webidl: https://github.com/web-platform-tests/wpt/tree/63ca529a02/webidl | |
| 39 | 39 | - webidl/ecmascript-binding/es-exceptions: https://github.com/web-platform-tests/wpt/tree/2f96fa1996/webidl/ecmascript-binding/es-exceptions | |
| 40 | 40 | - webmessaging/broadcastchannel: https://github.com/web-platform-tests/wpt/tree/6495c91853/webmessaging/broadcastchannel | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -162,7 +162,7 @@ Object.keys(digestedData).forEach(function (alg) { | |||
| 162 | 162 | Object.keys(sourceData).forEach(function (size) { | |
| 163 | 163 | promise_test(function (test) { | |
| 164 | 164 | return crypto.subtle | |
| 165 | - .digest({ name: alg, length: length }, sourceData[size]) | ||
| 165 | + .digest({ name: alg, outputLength: length }, sourceData[size]) | ||
| 166 | 166 | .then(function (result) { | |
| 167 | 167 | assert_true( | |
| 168 | 168 | equalBuffers(result, digestedData[alg][length][size]), | |
@@ -183,7 +183,7 @@ Object.keys(digestedData).forEach(function (alg) { | |||
| 183 | 183 | buffer[0] = sourceData[size][0]; | |
| 184 | 184 | return alg; | |
| 185 | 185 | }, | |
| 186 | - length | ||
| 186 | + outputLength: length | ||
| 187 | 187 | }, buffer) | |
| 188 | 188 | .then(function (result) { | |
| 189 | 189 | assert_true( | |
@@ -196,7 +196,7 @@ Object.keys(digestedData).forEach(function (alg) { | |||
| 196 | 196 | promise_test(function (test) { | |
| 197 | 197 | var buffer = new Uint8Array(sourceData[size]); | |
| 198 | 198 | var promise = crypto.subtle | |
| 199 | - .digest({ name: alg, length: length }, buffer) | ||
| 199 | + .digest({ name: alg, outputLength: length }, buffer) | ||
| 200 | 200 | .then(function (result) { | |
| 201 | 201 | assert_true( | |
| 202 | 202 | equalBuffers(result, digestedData[alg][length][size]), | |
@@ -217,7 +217,7 @@ Object.keys(digestedData).forEach(function (alg) { | |||
| 217 | 217 | buffer.buffer.transfer(); | |
| 218 | 218 | return alg; | |
| 219 | 219 | }, | |
| 220 | - length | ||
| 220 | + outputLength: length | ||
| 221 | 221 | }, buffer) | |
| 222 | 222 | .then(function (result) { | |
| 223 | 223 | assert_true( | |
@@ -230,7 +230,7 @@ Object.keys(digestedData).forEach(function (alg) { | |||
| 230 | 230 | promise_test(function (test) { | |
| 231 | 231 | var buffer = new Uint8Array(sourceData[size]); | |
| 232 | 232 | var promise = crypto.subtle | |
| 233 | - .digest({ name: alg, length: length }, buffer) | ||
| 233 | + .digest({ name: alg, outputLength: length }, buffer) | ||
| 234 | 234 | .then(function (result) { | |
| 235 | 235 | assert_true( | |
| 236 | 236 | equalBuffers(result, digestedData[alg][length][size]), | |
| Back | FazBrowse Home | New Git URL |
0 commit comments