Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

v19.3.0 release proposal #45831

Merged
merged 97 commits into from
Dec 14, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
97 commits
Select commit Hold shift + click to select a range
c842120
deps: patch V8 to 10.8.168.21
targos Dec 5, 2022
c9cbd1d
test_runner: remove stdout and stderr from error
cjihrig Nov 25, 2022
60c9ac5
deps: update nghttp2 to 1.51.0
anonrig Nov 25, 2022
3a02d50
doc: add link to doc with social processes
mhdawson Nov 22, 2022
7892e23
repl: do not define `wasi` on global with no flag
cola119 Nov 26, 2022
358e2fe
test,crypto: update WebCryptoAPI WPT
panva Nov 21, 2022
de2b6b9
crypto: ensure "x" is present when importing private CFRG webcrypto keys
panva Nov 21, 2022
40037b4
crypto: fix X25519 and X448 webcrypto public CryptoKey usages
panva Nov 21, 2022
9e2e3de
crypto: use DataError for webcrypto keyData import failures
panva Nov 21, 2022
9cd106e
crypto: use DataError for CFRG webcrypto raw and jwk import key checks
panva Nov 21, 2022
d030963
crypto: validate CFRG webcrypto JWK import "d" and "x" are a pair
panva Nov 21, 2022
7cc9998
crypto: fix ECDH webcrypto public CryptoKey usages
panva Nov 21, 2022
845f805
crypto: refactor verify acceptable key usage functions
panva Nov 22, 2022
aabfdef
doc: use console.error for error case in fs, https, net and process
deokjinkim Nov 26, 2022
56eee72
stream: use structuredClone instead of v8
anonrig Nov 27, 2022
049ef34
meta: update AUTHORS
nodejs-github-bot Nov 27, 2022
1784768
buffer: make decodeUTF8 params loose
anonrig Nov 27, 2022
d272faa
fs: fix `nonNativeWatcher` leak of `StatWatchers`
MoLow Nov 17, 2022
fbd2d27
deps: update corepack to 0.15.2
nodejs-github-bot Nov 27, 2022
573eab9
crypto: refactor ArrayBuffer to bigint conversion utils
aduh95 Nov 27, 2022
2e767bf
doc: move os.machine() docs to sorted position
cjihrig Nov 27, 2022
e431612
fs: fix `nonNativeWatcher` watching folder with existing files
MoLow Nov 27, 2022
efc4456
test_runner: add getter and setter to MockTracker
fossamagna Nov 18, 2022
b55bd6e
test: fix typos in test/parallel
deokjinkim Nov 28, 2022
23ff505
doc: define "react-native" community condition
huntie Nov 28, 2022
818028c
src: rename internal module declaration as internal bindings
legendecas Nov 20, 2022
1b98f17
tools: update doc to highlight.js@11.7.0
nodejs-github-bot Nov 29, 2022
238fc64
tools: update lint-md-dependencies to rollup@3.4.0
nodejs-github-bot Nov 29, 2022
027e738
doc: add `options` parameter to eventTarget.removeEventListener
deokjinkim Nov 29, 2022
c0df265
doc: fix actual result of example is different in stream
deokjinkim Nov 29, 2022
c527741
diagnostics_channel: fix diagnostics channel memory leak
theanarkh Nov 29, 2022
c9cba2e
src: use `enum class` instead of `enum` in node_i18n
deokjinkim Nov 30, 2022
4fb7cf8
doc: add missing line in debugger
deokjinkim Nov 30, 2022
6b15994
deps: update undici to 5.13.0
nodejs-github-bot Nov 30, 2022
b010820
doc: add Rafael to the tsc
mhdawson Nov 30, 2022
eb9a383
meta: update AUTHORS info for nstepien
nstepien Nov 30, 2022
1b92028
doc: move streaming instruc to doc/contributing
mhdawson Nov 22, 2022
a79f37a
lib: add missing type of removeEventListener in question
deokjinkim Dec 1, 2022
cd36250
test: fix test-watch-mode-inspect
StefanStojanovic Dec 1, 2022
7647250
test: fix test-watch-mode
StefanStojanovic Dec 1, 2022
a6e2cf2
meta: add .mailmap entry for Stefan Stojanovic
Trott Dec 1, 2022
3e48536
test_runner: don't parse TAP from stderr
cjihrig Dec 2, 2022
99410ef
lib: added SuiteContext class
debadree25 Dec 2, 2022
d64e773
http: make `OutgoingMessage` more streamlike
ronag Dec 2, 2022
e124e2a
doc: use console.error for error case in child_process and dgram
deokjinkim Dec 2, 2022
801fe30
doc: add detail on how api docs are published
mhdawson Nov 25, 2022
79edf25
src: cleanup on disambiguating native modules
mhdawson Nov 28, 2022
418ae9b
tools: remove dependency vulnerability checker
facutuesca Dec 3, 2022
9f51b9e
doc: add doc-only deprecation for headers/trailers setters
Trott Dec 3, 2022
b8b13dc
net: add autoSelectFamily and autoSelectFamilyAttemptTimeout options
ShogunPanda Dec 3, 2022
324ae3d
tools: add GitHub token permissions to label flaky-test issues
gabibguti Dec 4, 2022
376f346
meta: update AUTHORS
nodejs-github-bot Dec 4, 2022
1d823a6
Revert "deps: fix zlib compilation for CPUs without SIMD features"
lpinca Nov 22, 2022
09bc89d
build: rework gyp files for zlib
richardlau Apr 24, 2020
d384b73
tools: update lint-md-dependencies
nodejs-github-bot Dec 4, 2022
029060e
doc: fix actual result of example is different in events
deokjinkim Dec 6, 2022
7718ff8
doc: using console.error for error cases in crypto and events
emirgoren Dec 7, 2022
677eb62
deps: upgrade npm to 9.1.3
npm-cli-bot Dec 7, 2022
4c51c5c
test: fix -Wunused-variable on report-fatalerror
santigimeno Dec 8, 2022
b9c2fc7
net: check `autoSelectFamilyAttemptTimeout` is positive
deokjinkim Dec 5, 2022
102c2dc
benchmark: make benchmarks runnable in older versions of Node.js
joyeecheung Dec 8, 2022
6bc7b7e
test_runner: add resetCalls to MockFunctionContext
fossamagna Dec 8, 2022
8c728d2
doc: disambiguate `native module` to `addon`
daeyeon Nov 29, 2022
353339a
lib: disambiguate `native module` to `builtin module`
daeyeon Nov 29, 2022
9f7bb5c
lib: disambiguate `native module` to `binding`
daeyeon Nov 29, 2022
e874508
lib: check number of arguments in `EventTarget`'s function
deokjinkim Dec 9, 2022
9d6af61
doc: add args of filter option of fs.cp
fossamagna Dec 9, 2022
2e4d37e
crypto: fix CipherBase Update int32 overflow
marco-ippolito Dec 9, 2022
75dbce9
deps: upgrade npm to 9.2.0
npm-cli-bot Dec 9, 2022
e2caf7c
bootstrap: lazy load non-essential modules
joyeecheung Dec 9, 2022
382efdf
benchmark: add variety of inputs to text-encoder
anonrig Dec 10, 2022
691f58e
tls: remove trustcor root ca certificates
bnoordhuis Dec 10, 2022
6962ef0
readline: improve robustness against prototype mutation
aduh95 Dec 10, 2022
302c524
lib: allow Writeable.toWeb() to work on http.Outgoing message
debadree25 Dec 10, 2022
81ab540
src: mark generated `snapshot_data` as `const`
addaleax Dec 10, 2022
95a23e2
build: add python 3.11 support for android
VoltrexKeyva Dec 11, 2022
e075046
meta: update AUTHORS
nodejs-github-bot Dec 11, 2022
b35ebeb
src: make structuredClone work for process.env
bnoordhuis Dec 11, 2022
8a03684
src: simplify NodeBIO::GetMethod initialization
addaleax Dec 11, 2022
d1bd779
test_runner: don't use a symbol for runHook()
cjihrig Dec 6, 2022
4165dcd
test_runner: add t.after() hook
cjihrig Dec 8, 2022
5d7cd36
src: add uvwasi version
MrJithil Dec 11, 2022
5c4475d
test: fix invalid output TAP if there newline in test name
pulkit-30 Dec 11, 2022
cee6f38
watch: add CLI flag to preserve output
debadree25 Dec 11, 2022
ffc0f3d
test_runner: refactor `tap_parser` to use more primordials
aduh95 Dec 11, 2022
924f6ab
test: order list alphabetically in `test-bootstrap-modules`
aduh95 Dec 11, 2022
03db415
build: disable v8 snapshot compression by default
joyeecheung Dec 2, 2022
424419c
test_runner: refactor `tap_lexer` to use more primordials
aduh95 Dec 12, 2022
8a90f5c
doc: buffer.fill empty value
marco-ippolito Dec 12, 2022
b297dd5
test: remove flaky parallel/test-process-wrap test
bnoordhuis Dec 12, 2022
470384e
util: use private symbols in JS land directly
joyeecheung Nov 4, 2022
2fbe2f9
src,lib: group properties used as constants from `util` binding
daeyeon Nov 24, 2022
349b4f8
src: add internal isArrayBufferDetached
anonrig Nov 27, 2022
49840d4
buffer: remove unnecessary lazy loading
aduh95 Dec 12, 2022
b5b56b6
crypto: simplify lazy loading of internal modules
aduh95 Dec 12, 2022
ed8ae88
lib: remove unnecessary lazy loading in `internal/encoding`
aduh95 Dec 12, 2022
84aabcf
2022-12-14, Version 19.3.0 (Current)
targos Dec 12, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
crypto: refactor ArrayBuffer to bigint conversion utils
PR-URL: #45567
Refs: nodejs/performance#16
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
  • Loading branch information
aduh95 authored and targos committed Dec 12, 2022
commit 573eab9235fa85100beef5de6d2ffcbd3322ad1e
35 changes: 31 additions & 4 deletions lib/internal/crypto/random.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,22 @@

const {
Array,
ArrayBufferPrototypeGetByteLength,
ArrayPrototypeForEach,
ArrayPrototypePush,
ArrayPrototypeShift,
ArrayPrototypeSplice,
BigInt,
BigIntPrototypeToString,
DataView,
DataViewPrototypeGetUint8,
FunctionPrototypeBind,
FunctionPrototypeCall,
MathMin,
NumberIsNaN,
NumberIsSafeInteger,
NumberPrototypeToString,
StringFromCharCodeApply,
StringPrototypePadStart,
} = primordials;

Expand Down Expand Up @@ -493,17 +498,39 @@ function generatePrimeSync(size, options = kEmptyObject) {
return job.result(prime);
}

function arrayBufferToUnsignedBigInt(arrayBuffer) {
return BigInt(`0x${Buffer.from(arrayBuffer).toString('hex')}`);
/**
* 48 is the ASCII code for '0', 97 is the ASCII code for 'a'.
* @param {number} number An integer between 0 and 15.
* @returns {number} corresponding to the ASCII code of the hex representation
* of the parameter.
*/
const numberToHexCharCode = (number) => (number < 10 ? 48 : 87) + number;

/**
* @param {ArrayBuffer} buf An ArrayBuffer.
* @return {bigint}
*/
function arrayBufferToUnsignedBigInt(buf) {
const length = ArrayBufferPrototypeGetByteLength(buf);
const chars = Array(length * 2);
const view = new DataView(buf);

for (let i = 0; i < length; i++) {
const val = DataViewPrototypeGetUint8(view, i);
chars[2 * i] = numberToHexCharCode(val >> 4);
chars[2 * i + 1] = numberToHexCharCode(val & 0xf);
}

return BigInt(`0x${StringFromCharCodeApply(chars)}`);
}

function unsignedBigIntToBuffer(bigint, name) {
if (bigint < 0) {
throw new ERR_OUT_OF_RANGE(name, '>= 0', bigint);
}

const hex = bigint.toString(16);
const padded = hex.padStart(hex.length + (hex.length % 2), 0);
const hex = BigIntPrototypeToString(bigint, 16);
const padded = StringPrototypePadStart(hex, hex.length + (hex.length % 2), 0);
return Buffer.from(padded, 'hex');
}

Expand Down
2 changes: 2 additions & 0 deletions lib/internal/per_context/primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ const varargsMethods = [
'MathHypot',
'MathMax',
'MathMin',
'StringFromCharCode',
'StringFromCodePoint',
'StringPrototypeConcat',
'TypedArrayOf',
];
Expand Down
2 changes: 2 additions & 0 deletions typings/primordials.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -422,7 +422,9 @@ declare namespace primordials {
export const StringName: typeof String.name
export const StringPrototype: typeof String.prototype
export const StringFromCharCode: typeof String.fromCharCode
export const StringFromCharCodeApply: StaticApply<typeof String.fromCharCode>
export const StringFromCodePoint: typeof String.fromCodePoint
export const StringFromCodePointApply: StaticApply<typeof String.fromCodePoint>
export const StringRaw: typeof String.raw
export const StringPrototypeAnchor: UncurryThis<typeof String.prototype.anchor>
export const StringPrototypeBig: UncurryThis<typeof String.prototype.big>
Expand Down