@ac-bench/measure-constant-time 0.2.1 → 0.3.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/CHANGELOG.md +75 -0
- package/README.md +20 -1
- package/dist/_collect.d.ts.map +1 -1
- package/dist/_collect.js +8 -11
- package/dist/_collect.js.map +1 -1
- package/dist/_host.d.ts +15 -0
- package/dist/_host.d.ts.map +1 -0
- package/dist/_host.js +19 -0
- package/dist/_host.js.map +1 -0
- package/dist/_node-host.d.ts +4 -0
- package/dist/_node-host.d.ts.map +1 -0
- package/dist/_node-host.js +4 -0
- package/dist/_node-host.js.map +1 -0
- package/dist/_run-case.d.ts.map +1 -1
- package/dist/_run-case.js +2 -2
- package/dist/_run-case.js.map +1 -1
- package/dist/index.browser.d.ts +13 -0
- package/dist/index.browser.d.ts.map +1 -0
- package/dist/index.browser.js +12 -0
- package/dist/index.browser.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/plugin.js +2 -0
- package/dist/plugin.js.map +1 -1
- package/package.json +24 -13
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,80 @@
|
|
|
1
1
|
# @ac-bench/measure-constant-time
|
|
2
2
|
|
|
3
|
+
## 0.3.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 5c203e7: `runDudectCheck` (with `DudectOptions`, `DudectResult`, `CollectOptions`,
|
|
8
|
+
`DEFAULT_LEAK_THRESHOLD` and `DEFAULT_SEED`) is exported, for a script that
|
|
9
|
+
runs a dudect check outside a suite and applies its own verdict policy.
|
|
10
|
+
|
|
11
|
+
Both classes are now timed through one call site, so the engine compiles and
|
|
12
|
+
calls the two closures alike rather than inlining each at a site of its own.
|
|
13
|
+
- 5c203e7: Browser entries. Each measure package and `@ac-bench/util` adds a `"browser"`
|
|
14
|
+
condition to its `"."` export (`index.browser.ts`, mirrored in
|
|
15
|
+
`publishConfig`), with the same registration API and no `node:` import, so a
|
|
16
|
+
suite mixing measures bundles for a page. What a page cannot do fails the case
|
|
17
|
+
alone with `UnsupportedInRuntimeError` (`unsupported-in-runtime`, new in
|
|
18
|
+
`@ac-bench/core/runner`): duration's spawned processes (per-iteration
|
|
19
|
+
processes, command cases, spawn baselines), jitter's event-loop monitor,
|
|
20
|
+
constant-time's nanosecond clock. Each plugin's `supportsRuntime` lets the
|
|
21
|
+
parent skip what cannot run without a launch: duration runs everywhere,
|
|
22
|
+
resource in Node and Chromium-family runtimes, jitter and constant-time in
|
|
23
|
+
Node only.
|
|
24
|
+
|
|
25
|
+
Resource measures in Chromium through `performance.memory` (allocation source
|
|
26
|
+
`browser-heap-growth`): its `scheduling.browser` asks for
|
|
27
|
+
`--enable-precise-memory-info` and `--js-flags=--expose-gc
|
|
28
|
+
--min-semi-space-size=64 --max-semi-space-size=64`, batches are capped below
|
|
29
|
+
half the young generation, an allocation self-check at the first case warns
|
|
30
|
+
`allocation-probe-failed` when the counter is off by more than 10 %, and CPU
|
|
31
|
+
time, which a page cannot read, is reported 0 with a `cpu-time-unavailable`
|
|
32
|
+
warning. Batches are sized by wall time where CPU time reads 0.
|
|
33
|
+
|
|
34
|
+
`@ac-bench/util` adds `assertSameResult(contender, actual, expected)`: an
|
|
35
|
+
equivalence check for suites meant for browsers (`Object.is` on numbers,
|
|
36
|
+
element-wise on arrays and typed arrays, `isDeepEqual` otherwise), naming the
|
|
37
|
+
contender and the first differing index. Its package now has an `exports` map:
|
|
38
|
+
deep imports are no longer reachable.
|
|
39
|
+
|
|
40
|
+
The measure packages' Node entries now have a side effect (installing their
|
|
41
|
+
Node host), declared in `sideEffects`.
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- 5c203e7: The `homepage` points at the @ac-bench documentation site: `measure(1)` for the CLI, the API reference for `core`, `lib` and `gate`, the site's home for the others.
|
|
46
|
+
- Updated dependencies [5c203e7]
|
|
47
|
+
- Updated dependencies [5c203e7]
|
|
48
|
+
- Updated dependencies [5c203e7]
|
|
49
|
+
- Updated dependencies [5c203e7]
|
|
50
|
+
- Updated dependencies [5c203e7]
|
|
51
|
+
- Updated dependencies [5c203e7]
|
|
52
|
+
- Updated dependencies [5c203e7]
|
|
53
|
+
- Updated dependencies [5c203e7]
|
|
54
|
+
- Updated dependencies [5c203e7]
|
|
55
|
+
- Updated dependencies [5c203e7]
|
|
56
|
+
- Updated dependencies [5c203e7]
|
|
57
|
+
- Updated dependencies [5c203e7]
|
|
58
|
+
- Updated dependencies [5c203e7]
|
|
59
|
+
- Updated dependencies [5c203e7]
|
|
60
|
+
- Updated dependencies [5c203e7]
|
|
61
|
+
- Updated dependencies [5c203e7]
|
|
62
|
+
- Updated dependencies [5c203e7]
|
|
63
|
+
- Updated dependencies [5c203e7]
|
|
64
|
+
- Updated dependencies [5c203e7]
|
|
65
|
+
- Updated dependencies [5c203e7]
|
|
66
|
+
- Updated dependencies [5c203e7]
|
|
67
|
+
- Updated dependencies [5c203e7]
|
|
68
|
+
- Updated dependencies [5c203e7]
|
|
69
|
+
- Updated dependencies [5c203e7]
|
|
70
|
+
- @ac-kit/algo@0.7.0
|
|
71
|
+
- @ac-kit/app-report@0.4.0
|
|
72
|
+
- @ac-bench/core@0.5.0
|
|
73
|
+
- @ac-kit/core@0.14.0
|
|
74
|
+
- @ac-kit/math-stats@0.7.0
|
|
75
|
+
- @ac-kit/math-random@0.4.2
|
|
76
|
+
- @ac-kit/model-dataset@0.3.1
|
|
77
|
+
|
|
3
78
|
## 0.2.1
|
|
4
79
|
|
|
5
80
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -26,6 +26,25 @@ attacker could distinguish them by timing alone.
|
|
|
26
26
|
A passing result is evidence, not proof: it shows no leak was detected at this
|
|
27
27
|
sample size, on this machine, against this compiler's output.
|
|
28
28
|
|
|
29
|
-
Host-bound for `hrtime.bigint()`'s nanosecond resolution
|
|
29
|
+
Host-bound for `hrtime.bigint()`'s nanosecond resolution: a browser runtime
|
|
30
|
+
skips its conditions (a 5–20 µs page clock cannot resolve a timing leak), and
|
|
31
|
+
its `"browser"` entry only lets a suite mixing measures bundle.
|
|
30
32
|
|
|
31
33
|
Run suites with the `measure` CLI from `@ac-bench/cli`.
|
|
34
|
+
|
|
35
|
+
Outside a suite, `runDudectCheck` runs one check directly and returns the
|
|
36
|
+
statistic, for a script that applies its own policy — such as a CI smoke test
|
|
37
|
+
that fails only when a leak replicates across independent seeds:
|
|
38
|
+
|
|
39
|
+
```ts
|
|
40
|
+
import { hrtime } from "node:process";
|
|
41
|
+
|
|
42
|
+
import { runDudectCheck } from "@ac-bench/measure-constant-time";
|
|
43
|
+
import { xoshiro128p } from "@ac-kit/math-random";
|
|
44
|
+
|
|
45
|
+
const { t, leakDetected } = await runDudectCheck(fixedClass, randomClass, {
|
|
46
|
+
samples: 20_000,
|
|
47
|
+
now: hrtime.bigint,
|
|
48
|
+
random: xoshiro128p(0x5eed),
|
|
49
|
+
});
|
|
50
|
+
```
|
package/dist/_collect.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_collect.d.ts","sourceRoot":"","sources":["../src/_collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElE,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG;IAC5B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,GAAG,EAAE,MAAM,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAE5B,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,MAAM,IAAI,EAClB,MAAM,EAAE,MAAM,IAAI,EAClB,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,kBAAkB,CAAC,
|
|
1
|
+
{"version":3,"file":"_collect.d.ts","sourceRoot":"","sources":["../src/_collect.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,wBAAwB,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAElE,wEAAwE;AACxE,MAAM,WAAW,kBAAkB;IAClC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,MAAM,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,qDAAqD;AACrD,MAAM,MAAM,cAAc,GAAG;IAC5B,6DAA6D;IAC7D,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,iFAAiF;IACjF,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,GAAG,EAAE,MAAM,MAAM,CAAC;IAElB;;;;OAIG;IACH,MAAM,EAAE,QAAQ,CAAC;IAEjB,MAAM,CAAC,EAAE,WAAW,GAAG,IAAI,CAAC;IAE5B,aAAa,CAAC,EAAE,wBAAwB,CAAC;IACzC,YAAY,CAAC,EAAE,wBAAwB,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,yBAAyB,CAC9C,MAAM,EAAE,MAAM,IAAI,EAClB,MAAM,EAAE,MAAM,IAAI,EAClB,OAAO,EAAE,cAAc,GACrB,OAAO,CAAC,kBAAkB,CAAC,CAgD7B"}
|
package/dist/_collect.js
CHANGED
|
@@ -39,22 +39,19 @@ export async function collectInterleavedTimings(classA, classB, options) {
|
|
|
39
39
|
order[2 * index] = 0;
|
|
40
40
|
order[2 * index + 1] = 1;
|
|
41
41
|
}
|
|
42
|
-
const shuffledOrder = shuffle(order, {
|
|
42
|
+
const shuffledOrder = shuffle(order, { random: options.random });
|
|
43
43
|
const classATimings = [];
|
|
44
44
|
const classBTimings = [];
|
|
45
45
|
for (const label of shuffledOrder) {
|
|
46
46
|
options.signal?.throwIfAborted();
|
|
47
47
|
await options.beforeMeasure?.();
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
classB();
|
|
56
|
-
classBTimings.push(Number(options.now() - started));
|
|
57
|
-
}
|
|
48
|
+
// One timed call site for both classes, so the engine compiles and calls
|
|
49
|
+
// the two closures alike rather than inlining each at a site of its own.
|
|
50
|
+
const run = label === 0 ? classA : classB;
|
|
51
|
+
const started = options.now();
|
|
52
|
+
run();
|
|
53
|
+
const elapsed = Number(options.now() - started);
|
|
54
|
+
(label === 0 ? classATimings : classBTimings).push(elapsed);
|
|
58
55
|
await options.afterMeasure?.();
|
|
59
56
|
}
|
|
60
57
|
return { classA: classATimings, classB: classBTimings };
|
package/dist/_collect.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_collect.js","sourceRoot":"","sources":["../src/_collect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAoCvC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAC9C,MAAkB,EAClB,MAAkB,EAClB,OAAuB;IAEvB,OAAO,CAAC,MAAM,EAAE,cAAc,EAAE,CAAC;IAEjC,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC;IACxC,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,GAAG,CAAC;IAErC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,MAAM,EAAE,KAAK,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AO,CAAC,CAAC;QAC5D,MAAM,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;IAChC,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;AACzD,CAAC"}
|
package/dist/_host.d.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** What constant-time needs from its runtime; installed by the Node entry. */
|
|
2
|
+
export type ConstantTimeHost = {
|
|
3
|
+
/** A nanosecond clock: a 5–20 µs page clock cannot resolve the effect. */
|
|
4
|
+
readonly now: () => bigint;
|
|
5
|
+
};
|
|
6
|
+
/** Called once by the entry that has a nanosecond clock. */
|
|
7
|
+
export declare function installConstantTimeHost(host: ConstantTimeHost): void;
|
|
8
|
+
/**
|
|
9
|
+
* The installed host.
|
|
10
|
+
*
|
|
11
|
+
* @throws {UnsupportedInRuntimeError} In a browser, where no entry installs
|
|
12
|
+
* one.
|
|
13
|
+
*/
|
|
14
|
+
export declare function constantTimeHost(): ConstantTimeHost;
|
|
15
|
+
//# sourceMappingURL=_host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_host.d.ts","sourceRoot":"","sources":["../src/_host.ts"],"names":[],"mappings":"AAEA,8EAA8E;AAC9E,MAAM,MAAM,gBAAgB,GAAG;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,GAAG,EAAE,MAAM,MAAM,CAAC;CAC3B,CAAC;AAIF,4DAA4D;AAC5D,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,gBAAgB,GAAG,IAAI,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,IAAI,gBAAgB,CAMnD"}
|
package/dist/_host.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { UnsupportedInRuntimeError } from "@ac-bench/core/runner";
|
|
2
|
+
let installed_ = null;
|
|
3
|
+
/** Called once by the entry that has a nanosecond clock. */
|
|
4
|
+
export function installConstantTimeHost(host) {
|
|
5
|
+
installed_ = host;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The installed host.
|
|
9
|
+
*
|
|
10
|
+
* @throws {UnsupportedInRuntimeError} In a browser, where no entry installs
|
|
11
|
+
* one.
|
|
12
|
+
*/
|
|
13
|
+
export function constantTimeHost() {
|
|
14
|
+
if (installed_ === null) {
|
|
15
|
+
throw new UnsupportedInRuntimeError("nanosecond clocks");
|
|
16
|
+
}
|
|
17
|
+
return installed_;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=_host.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_host.js","sourceRoot":"","sources":["../src/_host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAQlE,IAAI,UAAU,GAA4B,IAAI,CAAC;AAE/C,4DAA4D;AAC5D,MAAM,UAAU,uBAAuB,CAAC,IAAsB;IAC7D,UAAU,GAAG,IAAI,CAAC;AACnB,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,gBAAgB;IAC/B,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACzB,MAAM,IAAI,yBAAyB,CAAC,mBAAmB,CAAC,CAAC;IAC1D,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_node-host.d.ts","sourceRoot":"","sources":["../src/_node-host.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAEnD,oCAAoC;AACpC,eAAO,MAAM,uBAAuB,EAAE,gBAAyC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"_node-host.js","sourceRoot":"","sources":["../src/_node-host.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAItC,oCAAoC;AACpC,MAAM,CAAC,MAAM,uBAAuB,GAAqB,EAAE,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC"}
|
package/dist/_run-case.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_run-case.d.ts","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"_run-case.d.ts","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAqB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAW9C,OAAO,EACN,uBAAuB,EACvB,4BAA4B,EAC5B,MAAM,cAAc,CAAC;AAEtB,MAAM,MAAM,0BAA0B,GAAG,uBAAuB,GAAG;IAClE,gBAAgB,CAAC,EAAE,4BAA4B,CAAC;CAChD,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,mBAAmB,CACxC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,cAAc,EACtB,MAAM,EAAE,cAAc,EACtB,OAAO,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,0BAA0B,GAClC,OAAO,CAAC,IAAI,CAAC,CAiDf"}
|
package/dist/_run-case.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { hrtime } from "node:process";
|
|
2
1
|
import { reportCaseFailure } from "@ac-bench/core/runner";
|
|
3
2
|
import { mulberry32 } from "@ac-kit/math-random";
|
|
4
3
|
import { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, runDudectCheck, } from "./_dudect.js";
|
|
4
|
+
import { constantTimeHost } from "./_host.js";
|
|
5
5
|
import { detectConstantTimeWarnings_ } from "./_warnings.js";
|
|
6
6
|
/**
|
|
7
7
|
* Run one constant-time check.
|
|
@@ -27,7 +27,7 @@ export async function runConstantTimeCase(title, classA, classB, context, option
|
|
|
27
27
|
const dudectResult = await runDudectCheck(classA, classB, {
|
|
28
28
|
...options?.conditionOptions?.dudect,
|
|
29
29
|
random: options?.conditionOptions?.dudect?.random ?? mulberry32(DEFAULT_SEED),
|
|
30
|
-
now:
|
|
30
|
+
now: constantTimeHost().now,
|
|
31
31
|
signal: context.signal,
|
|
32
32
|
beforeMeasure,
|
|
33
33
|
afterMeasure,
|
package/dist/_run-case.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"_run-case.js","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"_run-case.js","sourceRoot":"","sources":["../src/_run-case.ts"],"names":[],"mappings":"AAAA,OAAO,EAAuB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAE/E,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEjD,OAAO,EACN,sBAAsB,EACtB,YAAY,EACZ,cAAc,GACd,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAE9C,OAAO,EAAE,2BAA2B,EAAE,MAAM,gBAAgB,CAAC;AAU7D;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACxC,KAAa,EACb,MAAsB,EACtB,MAAsB,EACtB,OAA4B,EAC5B,OAAoC;IAEpC,OAAO,CAAC,MAAM,CAAC,cAAc,EAAE,CAAC;IAEhC,MAAM,IAAI,GAAG,OAAO,EAAE,IAAI,IAAI,EAAE,CAAC;IACjC,MAAM,aAAa,GAClB,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,aAAa,IAAI,sBAAsB,CAAC;IAE5E,MAAM,aAAa,GAAG,OAAO,EAAE,UAAU;QACxC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC;QAC5C,CAAC,CAAC,SAAS,CAAC;IACb,MAAM,YAAY,GAAG,OAAO,EAAE,SAAS;QACtC,CAAC,CAAC,GAAG,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portable entry, selected by the `"browser"` export condition: the same
|
|
3
|
+
* registration API as the Node entry so a suite mixing measures still bundles.
|
|
4
|
+
* A page's 5–20 µs clock cannot resolve a timing leak; the parent skips these
|
|
5
|
+
* conditions through the plugin's `supportsRuntime`, and a case that runs
|
|
6
|
+
* anyway fails with `unsupported-in-runtime`.
|
|
7
|
+
*/
|
|
8
|
+
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
9
|
+
export * from "./decl.js";
|
|
10
|
+
export * from "./options.js";
|
|
11
|
+
export type { CollectOptions } from "./_collect.js";
|
|
12
|
+
export { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, type DudectOptions, type DudectResult, runDudectCheck, } from "./_dudect.js";
|
|
13
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACN,sBAAsB,EACtB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,cAAc,GACd,MAAM,cAAc,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The portable entry, selected by the `"browser"` export condition: the same
|
|
3
|
+
* registration API as the Node entry so a suite mixing measures still bundles.
|
|
4
|
+
* A page's 5–20 µs clock cannot resolve a timing leak; the parent skips these
|
|
5
|
+
* conditions through the plugin's `supportsRuntime`, and a case that runs
|
|
6
|
+
* anyway fails with `unsupported-in-runtime`.
|
|
7
|
+
*/
|
|
8
|
+
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
9
|
+
export * from "./decl.js";
|
|
10
|
+
export * from "./options.js";
|
|
11
|
+
export { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, runDudectCheck, } from "./_dudect.js";
|
|
12
|
+
//# sourceMappingURL=index.browser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../src/index.browser.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAE7B,OAAO,EACN,sBAAsB,EACtB,YAAY,EAGZ,cAAc,GACd,MAAM,cAAc,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
2
2
|
export * from "./decl.js";
|
|
3
3
|
export * from "./options.js";
|
|
4
|
+
export type { CollectOptions } from "./_collect.js";
|
|
5
|
+
export { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, type DudectOptions, type DudectResult, runDudectCheck, } from "./_dudect.js";
|
|
4
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AACpD,OAAO,EACN,sBAAsB,EACtB,YAAY,EACZ,KAAK,aAAa,EAClB,KAAK,YAAY,EACjB,cAAc,GACd,MAAM,cAAc,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,8 @@
|
|
|
1
|
+
import { installConstantTimeHost } from "./_host.js";
|
|
2
|
+
import { NODE_CONSTANT_TIME_HOST } from "./_node-host.js";
|
|
1
3
|
export { afterAll, afterEach, beforeAll, beforeEach, boundGate, differenceGate, ratioGate, registerGate, } from "@ac-bench/core/runner";
|
|
2
4
|
export * from "./decl.js";
|
|
3
5
|
export * from "./options.js";
|
|
6
|
+
export { DEFAULT_LEAK_THRESHOLD, DEFAULT_SEED, runDudectCheck, } from "./_dudect.js";
|
|
7
|
+
installConstantTimeHost(NODE_CONSTANT_TIME_HOST);
|
|
4
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,uBAAuB,EAAE,MAAM,iBAAiB,CAAC;AAE1D,OAAO,EACN,QAAQ,EACR,SAAS,EACT,SAAS,EACT,UAAU,EACV,SAAS,EACT,cAAc,EACd,SAAS,EACT,YAAY,GACZ,MAAM,uBAAuB,CAAC;AAC/B,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAE7B,OAAO,EACN,sBAAsB,EACtB,YAAY,EAGZ,cAAc,GACd,MAAM,cAAc,CAAC;AAEtB,uBAAuB,CAAC,uBAAuB,CAAC,CAAC"}
|
package/dist/plugin.js
CHANGED
|
@@ -91,6 +91,8 @@ export default defineMeasurePlugin({
|
|
|
91
91
|
// interleaving layer above it (round-robin across cases) adds drift it
|
|
92
92
|
// cannot cancel.
|
|
93
93
|
scheduling: { rounds: "one", grouping: "condition" },
|
|
94
|
+
supportsRuntime: (runtime) => runtime.kind === "node" ||
|
|
95
|
+
`a ${runtime.clock.resolutionMs * 1000} µs page clock cannot resolve a timing leak`,
|
|
94
96
|
// A leak verdict is not an average: one process finding a leak is a leak,
|
|
95
97
|
// whatever the others saw. The most significant result stands for the case.
|
|
96
98
|
pool: (executions) => executions.reduce((worst, execution) => Math.abs(execution.result.dudectResult?.t ?? 0) >
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,mBAAmB,EACnB,4BAA4B,GAC5B,MAAM,uBAAuB,CAAC;AAG/B,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,KAAK,CAAC,MAAM,UAAU,CAAC;AAM9B,OAAO,EACN,4BAA4B,EAC5B,iCAAiC,GACjC,MAAM,aAAa,CAAC;AAErB,MAAM,UAAU,GAAG,eAAe,CAAC;AAEnC,SAAS,gBAAgB,CAAC,KAAc;IACvC,MAAM,MAAM,GAAG,4BAA4B,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IAC7D,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACrB,MAAM,IAAI,4BAA4B,CACrC,UAAU,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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ac-bench/measure-constant-time",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "dudect-style constant-time measure for @ac-bench: times two closures under a randomly interleaved schedule and reports Welch's t-statistic.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"benchmark",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"side-channel",
|
|
10
10
|
"timing"
|
|
11
11
|
],
|
|
12
|
-
"homepage": "https://
|
|
12
|
+
"homepage": "https://anthochamp.pages.grenadine.io/node-essentials/bench/",
|
|
13
13
|
"bugs": {
|
|
14
14
|
"url": "https://git.grenadine.io/anthochamp/node-essentials/issues"
|
|
15
15
|
},
|
|
@@ -24,16 +24,27 @@
|
|
|
24
24
|
"dist"
|
|
25
25
|
],
|
|
26
26
|
"type": "module",
|
|
27
|
-
"sideEffects":
|
|
27
|
+
"sideEffects": [
|
|
28
|
+
"./src/index.ts",
|
|
29
|
+
"./src/index.browser.ts",
|
|
30
|
+
"./dist/index.js",
|
|
31
|
+
"./dist/index.browser.js"
|
|
32
|
+
],
|
|
28
33
|
"main": "./dist/index.js",
|
|
29
34
|
"exports": {
|
|
30
|
-
".":
|
|
35
|
+
".": {
|
|
36
|
+
"browser": "./dist/index.browser.js",
|
|
37
|
+
"default": "./dist/index.js"
|
|
38
|
+
},
|
|
31
39
|
"./plugin": "./dist/plugin.js"
|
|
32
40
|
},
|
|
33
41
|
"publishConfig": {
|
|
34
42
|
"main": "./dist/index.js",
|
|
35
43
|
"exports": {
|
|
36
|
-
".":
|
|
44
|
+
".": {
|
|
45
|
+
"browser": "./dist/index.browser.js",
|
|
46
|
+
"default": "./dist/index.js"
|
|
47
|
+
},
|
|
37
48
|
"./plugin": "./dist/plugin.js"
|
|
38
49
|
},
|
|
39
50
|
"access": "public"
|
|
@@ -47,19 +58,19 @@
|
|
|
47
58
|
"prepack": "yarn build"
|
|
48
59
|
},
|
|
49
60
|
"dependencies": {
|
|
50
|
-
"@ac-bench/core": "^0.
|
|
51
|
-
"@ac-kit/algo": "^0.
|
|
52
|
-
"@ac-kit/app-report": "^0.
|
|
53
|
-
"@ac-kit/core": "^0.
|
|
54
|
-
"@ac-kit/math-random": "^0.4.
|
|
55
|
-
"@ac-kit/math-stats": "^0.
|
|
56
|
-
"@ac-kit/model-dataset": "^0.3.
|
|
61
|
+
"@ac-bench/core": "^0.5.0",
|
|
62
|
+
"@ac-kit/algo": "^0.7.0",
|
|
63
|
+
"@ac-kit/app-report": "^0.4.0",
|
|
64
|
+
"@ac-kit/core": "^0.14.0",
|
|
65
|
+
"@ac-kit/math-random": "^0.4.2",
|
|
66
|
+
"@ac-kit/math-stats": "^0.7.0",
|
|
67
|
+
"@ac-kit/model-dataset": "^0.3.1",
|
|
57
68
|
"zod": "^4.5.4"
|
|
58
69
|
},
|
|
59
70
|
"devDependencies": {
|
|
60
71
|
"@ac-kit/tsconfig": "0.1.0",
|
|
61
72
|
"@ac-kit/typedoc-config": "0.1.0",
|
|
62
|
-
"@ac-kit/vitest-config": "0.
|
|
73
|
+
"@ac-kit/vitest-config": "0.3.0",
|
|
63
74
|
"@types/node": "26.6.11",
|
|
64
75
|
"@typescript/native": "typescript@7.0.2",
|
|
65
76
|
"rimraf": "6.1.4",
|